Page 1 of 1

Texture only visible in shadow solution needed.

PostPosted: Sat Mar 05, 2022 11:43 pm
by Greggers
Hi,

Is there a way I can only make a materials texture appear in shadow ie opposite from the light source?
Another question I hope to have answered, using the new aov system, is there a way to use camera depth to control a materials visibility on a model using the depth pass?

Re: Texture only visible in shadow solution needed.

PostPosted: Fri Mar 11, 2022 11:36 am
by linograndiotoy
It would be great if you could be more specific, with real examples about the final result you would like to get.

Re: Texture only visible in shadow solution needed.

PostPosted: Fri Mar 11, 2022 12:35 pm
by jobigoud
My guess is they are looking for a way to show a certain texture only in the parts of the model that are not directly illuminated by the light source.
There is an AOV that gives the direction of the light source, maybe there is a way to composite that with the local normal with a dot product to determine if these two vectors go in the same direction (if they go in the same direction that part of the model is facing opposite the light source).

For material visibility based on depth you should be able to use the Z depth texture, plug it into a Compare texture and return 1 or 0 based on a distance threshold. Then plug that in the material opacity.

Re: Texture only visible in shadow solution needed.

PostPosted: Sat Mar 12, 2022 8:03 am
by Greggers
Yes. I want to be able to add a texture that is only revealed in the shadow. Maybe using the shadow pass as a mask? Regards the depth, yes the zdepth pass will be useful there.

Re: Texture only visible in shadow solution needed.

PostPosted: Sun Mar 13, 2022 9:34 am
by linograndiotoy
Yes, you should use the shadow pass for something like that.

Re: Texture only visible in shadow solution needed.

PostPosted: Sun Mar 13, 2022 11:11 am
by Greggers
Thanks Lino. Going to experiment.

Re: Texture only visible in shadow solution needed.

PostPosted: Mon May 02, 2022 9:15 am
by Turck
Any new insights?

Re: Texture only visible in shadow solution needed.

PostPosted: Wed Oct 05, 2022 3:34 pm
by Turck
I would like to revive the question. I can't get it to work. Has anyone had success with this?

Re: Texture only visible in shadow solution needed.

PostPosted: Wed Oct 05, 2022 11:59 pm
by pegot
jobigoud wrote:For material visibility based on depth you should be able to use the Z depth texture, plug it into a Compare texture and return 1 or 0 based on a distance threshold. Then plug that in the material opacity.

Can you show the exact set up and placement for that? I'm unfamiliar with either of these nodes.