engine icon indicating copy to clipboard operation
engine copied to clipboard

Application cannot start in Windows Firefox when antialiasing is enabled, or transparent canvas disabled

Open LeXXik opened this issue 1 year ago • 14 comments

Forum: https://forum.playcanvas.com/t/back-screen-in-latest-firefox-version-120-0-playcanvas-version-166-3/33964/1 https://forum.playcanvas.com/t/camera-blackscreen-with-the-latest-firefox-version-120-0/33986/1

Repro: https://playcanvas.com/project/1167343/overview/roll-a-ball

The project is a new default one from Roll a Ball template. Launch a game in latest Firefox. A black screen is shown.

Console: image

LeXXik avatar Nov 27 '23 10:11 LeXXik

Is this FF120? I can't replicate

marklundin avatar Nov 27 '23 10:11 marklundin

image

LeXXik avatar Nov 27 '23 10:11 LeXXik

Interesting, I just suggested PlayCanvas to someone yesterday and he mentioned the same issue, but it worked with WebGL1 for him (Windows + Firefox) :thinking:

kungfooman avatar Nov 27 '23 10:11 kungfooman

I'm on Mac and it seems to work for me. Is this a Window issue perhaps?

Screenshot 2023-11-27 at 10 43 00

mvaligursky avatar Nov 27 '23 10:11 mvaligursky

I've tried to run under Ubuntu (WSL in Windows) and it runs fine.

LeXXik avatar Nov 27 '23 10:11 LeXXik

OK I can replicate this on Windows FF120. Works in engine 165.5, broken in 1.66.2

marklundin avatar Nov 27 '23 10:11 marklundin

Engine examples work fine, except these (black screen as well): positional mini stats obj video texture transform feedback point cloud point cloud simulation particles snow / random sprites / anim index paint mesh orbit fly first person

These take very long time to load: shader compile lights physical units

LeXXik avatar Nov 27 '23 10:11 LeXXik

I can repro on Windows as well, Firefox 120. I captured this in Spector, and under the hood rendering seems ok to a multi-sampled buffer. At the very end, we resolve this multi-sampled buffer to a single sampled default backbuffer (NULL), maybe that does not work for some reason in FF on Windows. API calls to do it seem correct to me.

Screenshot 2023-11-27 at 11 01 55

I suspect that if the multi-sampling was disabled, this would work. WebGL1 does not support multi-sampling, so that explains why it works.

mvaligursky avatar Nov 27 '23 11:11 mvaligursky

These take very long time to load: shader compile lights physical units

Yes, the first one is compiling many large shaders, and is expected to take longer on Windows (where DX shader compiler is very slow). This is a banchmark for it really.

The second one has many complex shaders, and so suffers from the same.

Known issue without a solution at the moment. Shared by all WebGL implementations.

mvaligursky avatar Nov 27 '23 11:11 mvaligursky

The project runs fine, if Anti-Alias is disabled.

LeXXik avatar Nov 27 '23 11:11 LeXXik

Engine examples work fine, except these (black screen as well): positional mini stats obj video texture transform feedback point cloud point cloud simulation particles snow / random sprites / anim index paint mesh orbit fly first person

Interesting that I think all these examples that do not work use new pc.Application and not new pc.AppBase that's used by the working examples. Launcher uses new pc.AppBase though I believe.

mvaligursky avatar Nov 27 '23 11:11 mvaligursky

Latest Firefox beta in Window: 121.0b3 (64-bit) has the same issue. Also, when I enabled transparent canvas, all works. So it seems to me that Firefox seems to have a problem resolving RGB8 multi-sampled surface to a default framebuffer. Rendering to RGB8 multisamplewd texture (RenderToTexture examples does it) seems to work fine.

mvaligursky avatar Nov 27 '23 12:11 mvaligursky

created a Firefox bug report: https://bugzilla.mozilla.org/show_bug.cgi?id=1866762

mvaligursky avatar Nov 27 '23 12:11 mvaligursky

The workaround has been released as part of https://github.com/playcanvas/engine/releases/tag/v1.67.1

I'll leave the issue opened to keep an eye on possible Firefox fix, allowing us to enable AA on newer versions.

mvaligursky avatar Nov 28 '23 11:11 mvaligursky