[Bug] Material Billboard Component doesn't work with CustomDepth

Repro steps:

  1. Create a material with Allow CustomDepth Writes = True. Mine is Translucent, but an Opaque material will have the same issue.
  2. Give any actor in the world a MaterialBillboardComponent with your new material.
  3. On the MaterialBillboardComponent, set Render in Main Pass = False, and Render CustomDepth Pass = True.
  4. Use a postprocess to visualize the custom depth buffer. Note that the material billboard doesn’t seem to write to the custom depth buffer, and it still renders normally in the main render pass despite setting Render in Main Pass = False.

Hopefully I’m not just missing something here? It seems like these settings are ignored on this component, or there’s a lower-level bug. If the component is unable to support these settings for technical reasons it seems like they shouldn’t be visible in the editor. It would be great to have support for this functionality though, since the best alternative seems to be implementing billboarding/camera scaling in the material itself and mapping that into a quad static mesh that renders to custom depth (which works as expected, it’s just unfortunate to re-implement functionality that already exists.)

Hi rinbu,

I am having trouble replicating this issue. What are the settings you have enabled on the PPV? This might be a smaller bug or it may be experimental. I will continue to look into this and update you once I make progress.

All the best,

Hi , here’s a sample project demonstrating my issue. The level (TestLevel) has a cylinder, a plane with a checkbox texture, and a material billboard with the same texture. All are set to Render Custom Depth = True, and I’m using the custom stencil feature in a postprocess to mask them out. When you launch the game, everything will be black except you should see the cylinder and the plane, but not the material billboard.
I also tried just visualizing the Custom Depth buffer itself in the postprocess (the nodes are there in the material graph off to the side if you want to try this – just plug them into Emissive), but I didn’t see the material billboard when doing that, either. Maybe I’m missing something.

As a side note, when I set “Render in Main Pass = False” on the material billboard, it disappears as expected. I don’t know why that wasn’t working in my main project, so I’ll have to look into that further. Ignore that part from my original question, please :slight_smile:

Thanks for looking into it!

Hello rinbu,

Thank you for reporting this bug and for the information. I have logged a ticket for the issue which you can track here: UE-52710.

Thanks,