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

Make sure uvs for the texture array-based fragment shader are not interpolated #269

Closed
bzm3r opened this issue Sep 14, 2022 · 1 comment · Fixed by #279
Closed

Make sure uvs for the texture array-based fragment shader are not interpolated #269

bzm3r opened this issue Sep 14, 2022 · 1 comment · Fixed by #279
Labels
bug Something isn't working

Comments

@bzm3r
Copy link
Collaborator

bzm3r commented Sep 14, 2022

Currently, we rely on casting uv.z as i32. Does this have any weird edge cases? Better thing would be to add in a flag on the uv that specifies it should not be interpolated. See here for an example of how to do this: https://github.com/bzm3r/doug_renderers/blob/428a400d85ba989e5f78d5d7b4eb9686334bc12c/src/shaders/vpull.wgsl#L43

@StarArawn StarArawn added the bug Something isn't working label Sep 20, 2022
@StarArawn
Copy link
Owner

Turns out this is indeed an issue. It happens when zooming the projection matrix in and out sometimes a tile uv.z can end up being 0.9999 because of interpolation and since we cast to i32 it drops the decimals leaving us with zero instead of one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants