I’m using the Sobel post process filter to draw an outline around meshes in my game. I’d also like to have transparent decals, but the transparent decals seem to get their own depth, possibly calculated from the decal’s alpha. It’s really strange.
I made a material to help me figure out what exactly is going wrong. This material takes the difference between pixel depth and target depth, and uses that to blend between some different colors.
If the decal were taking the mesh’s depth, it would be invisible behind that material. But it seems to me that the decal’s alpha has some effect on the decal’s depth. I’m trying to figure out where that’s happening and stop it.
Can anyone tell me a simple place to start checking what happens when you place a decal in the scene? Can anyone tell me what a decal scene proxy is and where to see what it does?
I’d suspect the translucent sorting order to be doing strange things. any other depth-related hypothesis would be weird for me, since AFAIK decals’ magic is pretty much the geometry-duplicating part (the rest is handled almost like regular geometry)
can you try to put the mesh with a higher translucency sort priority and show the result?
also what exactly are you using for “pixel depth” and “target depth” ?
Thanks so much for taking a look Chosker. Unfortunately, changing the translucency sorting priority (of both the square and the decal, tried going both positive and negative) didn’t change anything. For measuring pixel depth and target depth, I guess I meant destination depth and pixel depth.
In another forum, someone recommended that I try RenderDoc. I checked that out briefly. Maybe I’ll come back to it. Unfortunately, on my current timeline I think I’ll just have to move on and maybe come back to this later.
Nope, no difference. That depth is actually getting written somehow. I’ll bet that would really mess with the player if he had VR goggles on. Thanks for helping me out Chosker.
there’s one other thing that could make it write to depth in such a way. on the material properties under Translucency make sure “Use Lit Translucency Depth Pass” and “Use Lit Translucency Post Render Depth Pass” are both disabled