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?
Texture only visible in shadow solution needed.
- linograndiotoy

- Posts: 1377
- Joined: Thu Feb 01, 2018 7:10 pm
It would be great if you could be more specific, with real examples about the final result you would like to get.
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.
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.
- linograndiotoy

- Posts: 1377
- Joined: Thu Feb 01, 2018 7:10 pm
Yes, you should use the shadow pass for something like that.
Last edited by linograndiotoy on Tue May 03, 2022 1:04 pm, edited 1 time in total.
Can you show the exact set up and placement for that? I'm unfamiliar with either of these nodes.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.
Win 10 - AMD Ryzen 9 5950X
MB: ASRock X570 Creator
PSU: 1600w EVGA
5090 MSI Suprim WC
3090 ASUS Tuff
MB: ASRock X570 Creator
PSU: 1600w EVGA
5090 MSI Suprim WC
3090 ASUS Tuff
