-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
HTML5: npot repeated texture nearest-neighbour interpolation is off #48807
Comments
I've confirmed that this doesn't happen with GLES 3. |
This is expected behaviour, although it may not be expected by users (we should probably have a warning to this effect). For hardware that doesn't support non-POT tiling on GLES2 (which includes HTML5, I think we always assume npot tiling not supported), if the texture is imported as repeat it gets resized to POT, as discussed in #44379. With no filtering, that results in ugly aliasing / sampling error. If you turn filtering on at import you get a smoother result. If you reimport with wrapping off, you see it looks fine as no resize has taken place. There is also a shader that will attempt to wrapping in the fragment shader as last ditch if the texture has been imported as non-wrapping, but a wrap flag is used at runtime. But this may have bad effects on some hardware (slowness, artifacts). So really the general advice is, don't use npot textures for tiling on GLES2 or HTML5. |
Good to know. I generally don't build for HTML5, but was trying it out and noticed this artifacting, so thought it'd be worth reporting.
I'm sure, though can be problematic for pixel art :p
FWIW the game I'm working on runs GLES2 on desktop and mobile, and doesn't have these problems - though maybe I just happen to have not tested on any problematic hardware yet. |
Yes, it will potentially have problems if you run on hardware which doesn't support npot tiling, it checks for this capability at startup. |
Do you reckon it's worth adding a gotcha to the docs, specifically HTML5 exports or GLES2 / 3 differences, or should this just be closed? |
Yes certainly there should be something in the docs about it, and probably a warning too at runtime imo. I've changed the tags to reflect this, @clayjohn may chime in later as he's more familiar with this than me. |
Can we print a warning every time such a texture is imported or used? This could be done both at import-time (when using GLES2 and the Repeat flag is enabled) and at run-time. The warning could be made disableable with a project setting for those who only intend to export to desktop platforms. |
Fixed by #48817. |
Godot version:
3.3.1-rc2, though also observed in 3.3
OS/device including version:
Ubuntu Linux 20.04, HTML5, checked in Chromium 90.0.4430.93, Firefox 88.0.1
GTX 1660 super
GLES 2
Issue description:
Specific to HTML5. This doesn't happen in desktop/mobile builds. Possibly related to #44379
Top texture has repetition enabled, bottom doesn't. They're both the same size (320x56):
Steps to reproduce:
Seems as simple as importing a repeating npot texture and exporting to HTML5.
Minimal reproduction project:
bug.zip
The text was updated successfully, but these errors were encountered: