SSR fails with transparent surfaces

SRR fails with alpha of 0.9:
https://playground.babylonjs.com/#PIZ1GK#253

Also, in the same example, if alpha is set to 0.4, SRR stops showing completely.

adding @julien-moreau

By the way, again, this does not occur in 4.2.0.

I have spotted many similar errors now with 5.0, but then again generally 5.0.0 major version gives higher quality visualization so we do not want to downgrade. :slight_smile:

Hi @JSa thanks for reporting!

I have tried forcing the geometry buffer renderer here: https://playground.babylonjs.com/#PIZ1GK#254 (line 53, see last parameter set to “true”). It looks like the problem comes more from the prepass renderer.

@CraigFeldspar do you have any idea? The difference I see here is that:

  • Using the GBR, the alpha of the reflectivity texture is applied on glFragData[REFLECTIVITY_INDEX]
  • Using PPR, the alpha can only be 0 or 1, which will be a problem in future. Do you think applying always the alpha of the reflectivity sampler instead of “writeGeometryInfo” would be a problem? I don’t see any problem on my side.

Unfortunately, this alpha question doesn’t resolves the issue of @JSa, I’m still having a look :slight_smile:

Hi guys,

Addressing the 2 issues here :

  • alpha 0.4 is a cutoff value. We consider that below 0.4, the object is not visible enough to have it’s geometry taken into account in effects like SSAO and SSR. Unfortunately this is a limitation because there is no such thing as alpha blending geometry. It is simply “there” or “not there”. GeometryBufferRenderer somehow doesn’t seem to have an alpha cutoff value for reflectivity, which leads to another issue when the alpha is very low. Geometry should be almost invisible, but the SSR post-process reflects as if the mesh was fully opaque. I agree that both GeometryBufferRenderer and PrePassRenderer should behave in a same way though, but I still think having an alpha cutoff value is the way to go, even more when we involve SSAO2 which will darken surrounding objects.

  • At a 0.9 alpha value reflection is weird. Looking under the hood, I see that the geometry of the plane is not rendered at all, which is indeed a bug. I have filed an issue in the repo for it : PrePassRenderer sometimes does not render geometry with alpha blending · Issue #10337 · BabylonJS/Babylon.js · GitHub

I played around with these ideas a bit and @julien-moreau 's ideas worked to some extent (the GBR), but still I really did not get very pleasing results… I am trying to use this SSR for wall surfaces rather than floors and it acts quite randomly… some walls reflect, others dont etc.

For example, if material is listed to be doubleSided, could we somehow force SSR to look for this? Now it seems that it renderes only to single normal direction.