Description

When a transparent material has "Allow Custom Depth Writes" enabled it is prone to have artifacts in the custom depth buffer under specific conditions.

The conditions are as follows:

  • The translucent material must be applied to a mesh that is above and close to a landscape
  • The landscape material needs to have a texture input in the normal and base color pins
  • The mesh that has the translucent material applied must have "render custom depth pass" enabled
  • The translucent material needs to have depth fade and a texture sampler plugged into opacity

ADDITIONAL NOTES

An interesting thing is that the artifacts wont appear if you don't use a texture sampler with depth fade in some way. In my test project I subtract the texture sampler RGB values from depth fade. If you use a 3 vector you won't get the issue even if it is the same value as the texture. To prove this I used a plain white texture and then swapped it out with a 3 vector of (1,1,1).

Steps to Reproduce
  1. Open attached project
  2. You will load into a scene with a blank terrain and the default floor mesh over top of the terrain. Make sure you are close and looking through the floor mesh at the terrain.
  3. Enable Custom Depth buffer visualization
  4. Select the terrain

RESULT
The floor mesh's material is outputting noisy artifacts to the depth buffer. The noise appears to resemble values from the texture applied in the terrains material.

EXPECTED
The floor mesh appears light grey in the visualizer.

Have Comments or More Details?

Head over to the existing Questions & Answers thread and let us know what's up.

3
Login to Vote

Non-Issue
ComponentUE - Graphics Features
Affects Versions4.14.14.17
CreatedJan 5, 2017
ResolvedMar 23, 2018
UpdatedJul 14, 2021