How to make an item transparent but keep the shadow of it I have a project where I need to see light rays. I have a light source which is a sphere :



Over it I have an Icosphere where I removed some faces to let light pass through it :



I wanted to enhance the light effect by making it glossy a bit.

Over all of it i have a simple sphere where i use this node


With this setup and a sampling of 512, I got this result:


I need to keep the rays but hide the icosphere so the light source and rays remain visible. Is it possible to do it?
Sure. You have two options:
You can disable camera visibility in the properties of the object:


Or you could make a material for it that is mixed with transparent shader with Light Paths node's Is Camera Ray output:


In this case you just need the condition Is Camera Ray to 'show' transparent shader and for the rest you don't even need a shader since it just needs to cast a shadow. 
Light paths node tends to slow down render time, so chances are the first method with object properties is going to be faster to render, but you can do more complex stuff with Light Paths node so it's worth knowing about.