neophob / wpc-emu

Williams Pinball machine emulator, Play it @
https://playfield.dev
Apache License 2.0
68 stars 12 forks source link

Emulator rendering issues in Google Chrome #76

Closed Titanic4 closed 2 years ago

Titanic4 commented 3 years ago

Capture The emulator gives Hall of Mirrors effect while it's running, as seen on the provided screenshot. That's most noticeable when scrolling, or when DMD is updating. The issue doesn't occur in Mozilla Firefox on the same system. Chrome version: 88.0.4324.96 OS: Windows 10 Home Version 2004 build 19041.685

neophob commented 3 years ago

Thanks for the report.. this fancy effect is visible all the time or only temporary?

Titanic4 commented 3 years ago

This effect seems to happen every time I open the website on affected browser. The effect is visible all the time.

mars-low commented 2 years ago

It is a bug in Chrome that can be tracked here: https://bugs.chromium.org/p/chromium/issues/detail?id=1294557. On Linux canvas becomes transparent so you can see your desktop background behind controls. On Android and Windows it causes additional rendering issues.

Basically it is caused by combo in this two lines: https://github.com/neophob/wpc-emu/blob/a8de4bc8bc92689930a36935cb7fb9326c920327/client/scripts/ui/oblivion-ui.js#L355 https://github.com/neophob/wpc-emu/blob/a8de4bc8bc92689930a36935cb7fb9326c920327/client/scripts/ui/oblivion-ui.js#L397

Calling getContext with {alpha: false} and then clear on this context causes this issue. Removing explicit {alpha: false} should fix a problem.

neophob commented 2 years ago

thanks @mars-low for the solution. afaik I added that alpha: false as optimisation - but i think that should not be an issue..

neophob commented 2 years ago

fixed in v0.36.8