Texture making its way into custom depth
I am trying to use custom depth with a translucent material to get a post process fog effect working under water. I need my water shader to draw to custom depth so the fog will affect the water plane as well. I can draw to custom depth just fine, I have 'Allow Custom Depth Writes' on in the material and have Custom Depth enabled in the rendering settings. However the depth that is drawn seems to also take values from a texture that is being used in the scene.
The underwater fog should make all of the screen blue but where I am drawing custom depth some values are being taken from a texture. I have no idea how this is happening, it seems almost like the custom depth buffer is overrunning graphics memory to a location where there is texture data. I am using UE 4.14 with the deferred renderer with a NVidia Geforce GTX 980.
asked Dec 20 '16 at 07:36 PM in Bug Reports
Thank you for all of the help and cooperation. This issue is very specific and was a pain to lock down to an exact cause. I was able to narrow down the issue and file a report here: https://issues.unrealengine.com/issue/UE-40252
It seems that the new "Allow Custom Depth Writes" feature has some kinks to work out so you may need to do the old work around. This involves having a duplicate mesh with "render in main pass" unchecked occupying the same space. It needs to have an opaque material and render to custom depth as well.
That should create the custom depth info you need from the water mesh. There are a few specific conditions that need to be met in order for this issue to occur so be sure to check out the report for more info!
answered Jan 05 '17 at 08:17 PM
I'm going to need a bit more information. Could you provide screenshots of your material graphs. I have a few questions about your setup as well.
I put together my own underwater effect to get an idea of what you are doing. First I made the post process material:
Then I applied it to an unbound post process volume. Once the fog looked like how I wanted I used a water plane "BP_OceanWater" from our "Water Plane Examples" assets and put it above some boxes.
This is where I get a bit confused as to where the Translucent material utilizing Custom Depth comes into play. If I have your workflow all wrong could you please elaborate on how you are putting together this effect so that I may reproduce this issue on my end.
answered Dec 21 '16 at 05:24 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here