SSR does not support transparent background

We are using a transparent background (clearColor) to render the 3D scene on top of our website. This does not work with SSR. The backround is black if the clearcolor is transparent:
https://www.babylonjs-playground.com/#8L4MQ3

If you disable line 54 the background will be red as it should be.

The SSR postprocess does not preserve the alpha component of the albedo texture.

I have updated the shader in this PG so that the alpha component of the albedo texture is used as the final alpha component:

https://www.babylonjs-playground.com/#8L4MQ3#1

I guess I could do a PR for this: @julien-moreau What do you think? Is there any side-effect of doing that?

Hey @Evgeni_Popov you rocks !!
I don’t think this causes any issue as the reflection is mixed only with rgb here and doesn’t take care of the alpha.

Thanks for that fix! I let you create the PR ? =D

No problem:

2 Likes