Post Process Material: Occlusion Detection
i have written an easy pp material to get occluded pixel and put them in a mask.
But somehow it is wrong or i do not get it.
Thats the logic:
Thats the result (Objects are rendered in custom depth):
What i expected, is that there should only be white where the soldier is occluded from the box.
Can anyone give me the right kick. I do not get it :D
Thanks in advance
asked Oct 22 '16 at 12:26 PM in Rendering
Unfortunately, custom depth is a single pass. It stores depth for all enabled meshes. The only way is to set custom depth enable for one mesh, and not set it for another, then proceed to a depth tests.
For many objects may be used a custom stencil buffer, but as custom depth it only stores one pass (all of the meshes on single image with different colors, i.e. no overlapping).
In Your example You just subtracting A from A, which leads to 0 (black).
Follow this question
Once you sign in you will be able to subscribe for any updates here