ClearColor not reliable

Hi
I did set the render properties to “transparent canvas” and defined a clearColor in the Camerasettings. In Chrome it shows the correct color. Firefox sometimes (only sometimes!) shows a black background instead the clearColor.

Does anybody know how to solve this problem?
ChatGPT doesn’t get it :wink:

Kind regards
Alain

clearAlpha

How?
Can’t find any clearAlpha property.

For clearing alpha, go to your Camera → Clear Color and drag down to 0 the Alpha value.

This makes the background white (instead of the correct color) in Chrome and still black in Firefox.

Edit: For a short moment, after the loadingscreen, the correct background-color appears. But then in Firefox it gets overwriten by black.

I think if you clear alpha to 0, than the clear color does not show, as it’s fully transparent … and the color of you web page underneath the webgl shows - so you might need to set that up.

@mvaligursky You are right. But it shows the underneath color only in Chrome. Firefox still shows black and Opera shows white. Its very inconsistent. When I set the alpha to 0 then I don’t need the clearColor and can use the underneath color instead.
Sometime it works correct even on Firefox, depending on the GSplat-Model I load into the scene.
I think its something with the framebuffer … :thinking:

With the help of Claude Sonnet 3.5 I got a correct transparent background in Firefox when I run the app as standalone in the Browser. But when I intergrate it in an iframe then it gets black again.

Is it a Firefox-Problem?
Does anybody know anything about it?

this.mainCamera.clearColor.fromArray([0, 0, 0, 0]);

@gameatp That’s not really how you should set the clearColor property. You’d do:

this.entity.camera.clearColor = new Color(0, 0, 0, 0);

In other words, you need to assign a value, or the property won’t update properly.

But I don’t think this is the problem here.

@Alain I have never seen this problem before. Without the ability to reproduce this easily, I’m struggling to see how we can investigate. Ideally, any reproducible test case would be small and isolated.