-
Notifications
You must be signed in to change notification settings - Fork 491
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom fonts render with glitches on certain Windows devices #740
Comments
Someone reported a similar issue in Phaser 3. |
We've just had reports of the same thing happening, thanks for raising the issue |
The Text Game Object is literally just a hidden canvas that uses If disabling hardware rendering fixes it, then clearly something is very wrong in that combination of Chrome + GPU + Windows. The fact that resizing the text to a much larger size fixes it is curious. Doing that would cause it to resize the canvas it was using, re-draw the text, and re-upload it to the GPU. Perhaps this is triggering a certain size threshold (next power of two up, perhaps?) on the GPU? Also, I wonder if mipmaps may cause this. I honestly can't remember if they're supported in CE, but if they are, I would try disabling them. We definitely can't fix the root cause of the issue (i.e. whatever causes Chrome to nuke parts of the font), but maybe there is a combination of sizes, or a certain texture size/ratio that prevents it from occurring in the first place. If you were to run WebGLSpector on one of the 'broken' machines, you could profile a frame and inspect all of the textures on the GPU. I fully expect you to see the glitch in there, but you'd also get to inspect the rest of the texture properties, too. I still reckon this is related to the base canvas size that the Text object creates initially (which is driven by the text content) |
You've just made me realise I've overlooked the type of renderer in my tests. Currently I've only seen the issue via the Canvas renderer, but I now realise the tests in Phaser 3 and Pixi are likely using WebGL. So I'll need to do some more tests with WebGL vs Canvas2D once I get access to the broken machines again. Thanks for all the replies and insight, already very helpful ❤️ |
Was there any update on this? Having the same issue. |
Hi @DennisEmberex, unfortunately I haven't been able to get back to this to add more tests, but it is still on my radar as we are needing to do prod hacks to circumvent the issue. Hopefully I'll have a chance in the next couple of weeks. In the meantime, it would be helpful to know if you have any example links where the issue is occurring, as well as any browser and hardware specifications. Thanks! |
I was able to update to previous tests.
And both don't have issues. I've also made another Phaser-CE test to try WebGL:
And it contains the same Font glitch. We've also had some more recent issues where my previous hack (calling In the meantime, I'll have a look more at PhotonStorm's suggestions and try run WebGLSpector (I found a couple, WebGL-Inspector and Spector.js - not sure which was the correct one to try, but will give them a go). It might also be worth spitting out the hidden canvas texture of the text, into the DOM. Maybe it will show it broken too 🤷 Will touch base again once I've done more testing EDT: By the way, I just quickly tested it, the original hidden canvas of the Phaser-CE Text object does display the font glitches too. Will try recreate that in Vanilla JS, to see what Phaser-CE might be doing to trigger that glitch 🤔 |
Summary
Description
Hi all, we've been experiencing this strange text glitch when using custom fonts in Phaser-CE on some Windows machines (it's similar to these posted Chrome issues, caused by hardware rendering. And is also addressed when hardware rendering is turned off).
Even though this does appear to be a Chrome/Windows issue, the reason I'm posting it here is that I've tested this with various other Canvas 2D frameworks, and they all seem to circumvent the issue, as I only see it in Phaser-CE (yet to test PixiJS v2, but v3 is fine). Links to each version are listed above.
I plan to further investigate this issue myself when I get more time, but thought to post it here in case others have also experienced the issue, or have ideas of what it could be. Or maybe we need to replicate what other frameworks do, and patch Phaser-CE to address it.
The glitch only appears in Chrome on some Windows machines (i7 laptops with integrated Intel Xe graphics). Our company supplies these to some non-dev employees, and most or all are seeing this glitch. It does not appear on MacOS or Desktop Windows (with dedicated graphics chips). On the affected machines it doesn't matter the display drivers versions, Windows updates or Windows versions 10 or 11, all show the glitch. I suspect it's related to type of hardware, since our tested Desktops don't reproduce the issue.
The bug has been seen for over a year (since 2022). Haven't tested with other Phaser-CE or Pixi versions other than listed above.
More Symptoms
0.0001
) or rendering the text without fill, also avoids the issue\n
)Current Workarounds
text.updateText()
after instantiation, also seems to prevent the glitches (our current workaround)Suspected issues
It could be some memory issue related to
BaseTexture
inupdateTexture
method?I plan to investigate this more, but thought to post it here first to gather some helpful clues or additional things to check or test
The text was updated successfully, but these errors were encountered: