Skip to content
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

Fix: TilingSprite gaps when mipmapping enabled #7792

Merged
merged 6 commits into from
Sep 20, 2021

Conversation

ShukantPal
Copy link
Member

@ShukantPal ShukantPal commented Sep 13, 2021

Fixes #7625

Description of change

I added a comment in the issue describing the underlying problem. In this fix, I create two versions of the tiling sprite shader (leaving the "simple" variant alone):

  • WebGL 1: GL_EXT_shader_texture_lod is used, when available, to sample the LOD 0 when texel is clamped to a different values (i.e. at the boundary of the texture, outside of the clamping region)
  • WebGL 2: texture2DLodEXT is not available in WebGL 2. Instead, I use texture with a very negative LOD-bias when sampling at the boundary of the tiled texture.

NOTE: The GL_EXT_shader_texture_lod extension is not available on macOS Safari (WebGL 1). You can't test this fix on that! Enabling it in experimental features won't work for replit.com too.

Please see this reproduction and test whether the issue remains.

@eXponenta
Copy link
Contributor

Screenshot_2021-09-13-10-38-33-347_com android chrome

Android 11, Webgl2 (Adreno 330), DPI 2.5

@Bouh
Copy link
Contributor

Bouh commented Sep 13, 2021

The gaps are still visible to me on Android 9 with Webgl2 on the mobile version of the website, but not on the desktop mode of the website

Gaps are gone on the PC 👍

@ShukantPal
Copy link
Member Author

ShukantPal commented Sep 13, 2021

@eXponenta It may be because I hardcoded the DPI to 2 in the reproduction, and your device's DPI is 2.5

@bigtimebuddy bigtimebuddy added this to the v6.2.0 milestone Sep 14, 2021
@bigtimebuddy bigtimebuddy added the ✅ Ready To Merge Helpful when issues are in the queue waiting to get merged. This means the PR is completed and has t label Sep 20, 2021
@bigtimebuddy bigtimebuddy merged commit df79943 into dev Sep 20, 2021
@bigtimebuddy bigtimebuddy deleted the fix/tiling-sprite-gaps branch September 20, 2021 20:11
@bigtimebuddy
Copy link
Member

Thanks @ShukantPal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✅ Ready To Merge Helpful when issues are in the queue waiting to get merged. This means the PR is completed and has t
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TilingSprite is showing a gap
6 participants