PDA

View Full Version : how to get a shader that is only visible on light?


tostao_wayne
09-11-2009, 09:24 AM
i would like to do a shader that only shows the part of the object that is in light, the part in shadow must to be totaly transparent.


any sugestion??

JayHoo
09-11-2009, 12:32 PM
I had one solution which works with directional light. When I am at home I can search for it.

moonangel
09-11-2009, 12:45 PM
you could try this:
create a lambert, color white, diffuse 1.0,
connect its outColor to a reverse node,
connect the reverse node output to your final shaders transparency

tostao_wayne
09-11-2009, 02:11 PM
I had one solution which works with directional light. When I am at home I can search for it.


Thanks Jayhoo,


moonangel, i have try your idea, it dind't work for me, the ambient ilumination makes the lambert not to be black in shadows

royterr
09-11-2009, 03:06 PM
connect a "surfaceluminance" node to a "reverse" node (out value - input x,y,z) and connect this node to the transoarency (output - transparency) of your shader. It should give you exactly what you want.

lacluna
09-11-2009, 05:54 PM
Easy: create a render pass where your object is either illuminated with white light or completely black. Then, use that as a mask to make him transparent on the black parts and opaque on the white.

JayHoo
09-11-2009, 08:27 PM
i used royterr`s method with the help of the layered shader.

tostao_wayne
09-14-2009, 07:28 AM
thanx jayhoo, royter and lacluna, the two methods are good for me.

CGTalk Moderation
09-14-2009, 07:28 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.