MSDF Text with autoClear PostProcess

Hello, I’m currently using the MSDF renderer and am experiencing an issue where text fails the depth test.

Here’s my situation.

I’m using the DefaultRenderingPipeline and SSAO2RenderingPipeline.

These render using the full-screen quad method(?), and it appears the depth buffer is not updated during this process.

Therefore, when using either the DefaultRenderingPipeline or SSAO2RenderingPipeline, MSDF Text does not pass the depth test.

This is because, by default, MSDF Text is always processed last with code like the following:

scene.onAfterRenderObservable.add(() => {
    textRenderer.render(camera.getViewMatrix(), camera.getProjectionMatrix());
});

Here is the PG that reproduces the issue.


I’m not sure whether this is an easily solvable issue or one that requires modifying the TextRenderer.

I would appreciate your advice. Thank you.

This is because, by default, MSDF Text is always processed last

making it render before the postprocessing happens seems to help

2 Likes

Thank you!.
There are so many observables in the scene that I didn’t realize there was an appropriate one there!

1 Like

I don’t think this addresses your specific question, but here’s a diagram of some of the Observables.

1 Like