Enabled SSR problem

When SSR is turned off

When SSR is turned on

Why does the scene become dark after turning on SSR? Can you provide some ideas for troubleshooting?

We will need a repro somehow, because the error “Active draw buffers with missing fragment shader outputs” is definitely not normal.

2 Likes

I can’t restore this error on PG.

If I use SSAO2 first, then use SSR, an error occurs

When I enable SSAO2 and SSR, InstanceMesh objects become invisible

Thanks for the repro!

The problem is that when adding the SSR effect, new shaders have to be recompiled because we now have to write in an additional texture (the reflectivity texture) in addition to the normal/depth textures we’re already writing in (because SSAO is enabled).

However, recompiling the shaders can take some time, and while we’re waiting for them to be ready, we continue to use the previous shaders (those compiled when the SSAO effect was the only one enabled).

The problem is that these shaders only write to two textures (normal and depth), whereas the system is now configured for 3 output textures, so we have to write to 3 textures to avoid the warnings you get.

Unfortunately, I can’t see any way of solving the problem on Babylon’s side…

You have three options:

  • do nothing. These warnings are only transitory, until the shaders are ready, and will not prevent the scene from working.
  • enable SSAO and SSR at the same time, so that shaders can be compiled directly to support both effects
  • disable parallel shader compilation by setting engine.getCaps().parallelShaderCompile = null;.

cc @sebavan in case I would miss something.

As for your second problem, I’m not reproducing it in this PG:

2 Likes

I reverted this error

For this to work, the master meshes of the instances must also be part of the scene. So, you should call assets.addAllToScene() to make the PG work:

1 Like

Why some models are visible and some are not?

I don’t really know, but if addAllToScene is called for all assets as it should be, it does work as expected:

1 Like

image

image

Before and after SSR is turned on, will it affect the number of faces and the number of Draw Calls?

You will only see a large increase in draw calls (depending on your number of meshes) if you use the geometry buffer renderer instead of the prepass renderer.

For eg, for the Back to the future scene:

  • geometry buffer renderer (without / with SSR): 63 / 132
  • prepass renderer (without / with SSR): 63 / 67

That’s because the geometry buffer renderer must render the scene a second time. See the last table in this section of the doc:

ok, i got it, tks!