- Home /
Custom Shader Occlusion Visible
Hello, I wasn't sure exactly what to name this question as I'm not dealing with occlusion, but my custom shader mesh looks like it occluding the mesh too aggressively. Something like that...? I really have no idea what's going on but I did some research and it seems to be some transparent sorting problem with the Z-buffer.
Here's what I know.
I'm trying to design a custom shader for clouds. Clouds are somewhat transparent so I found this clever node graph example to make the mesh transparent around any objects intersecting it.
NOTE: Before I connect this to the Alpha channel of the PBR master node everything works just fine.
Once connected there is missing mesh around the backside of any objects intersecting the cloud mesh. But worse, the mesh doesn't render at all in game mode.
Here's an example of what's going wrong:
This is my Node Graph:
I'm rather lost, haha. So, any help would be much appreciated!!!
Thanks so much
I've not used shader graph, but general shader rules should still apply. At first I would think it's potentially one of two things. The first is the fact that (it looks like) you are using alpha clipping with alpha blending, so unless the alpha clip threshold is necessary for something else, you shouldn't need it. However, that would rely on the alpha regardless, meaning there's still something else going on. $$anonymous$$y guess is that the shader is passing screen position for the depth sample before the mesh is displaced, therefore the actual depth sample is being distorted and showing depth in wrong places. Try assigning the 'screen position' node to the UV input of the 'scene depth' node, rather than whatever is going in there by default.