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

Texture mapping changes when toggling bilinear filtering #2013

Closed
Richard-L opened this issue Dec 12, 2024 · 3 comments
Closed

Texture mapping changes when toggling bilinear filtering #2013

Richard-L opened this issue Dec 12, 2024 · 3 comments
Assignees
Labels
Support No code changes necessary TR2 Unreleased Applies to things that aren't in a stable release.

Comments

@Richard-L
Copy link
Collaborator

The size of the textures seems to grow by 1-2% when bilinear filtering is on and some image data is lost. Perhaps would this be a placeholder for later edge blending?

2024-12-12.22-20-44-00.00.04.000-00.00.19.161.mp4
@rr-
Copy link
Collaborator

rr- commented Dec 12, 2024

Actually that's intended, and it can be disabled by setting the texel_adjust_mode option to never. (If you use /set, remember to reload the level to see the effect.) But doing this will result in ugly visuals.
20241212_225038_Laras_Home

@rr- rr- moved this to In review in TRX Dev tracker Dec 12, 2024
@rr- rr- added Support No code changes necessary Unreleased Applies to things that aren't in a stable release. labels Dec 12, 2024
@rr- rr- self-assigned this Dec 12, 2024
@Richard-L
Copy link
Collaborator Author

Ah that's unfortunate. I guess the lines can't be fixed straightforwardly.

@rr-
Copy link
Collaborator

rr- commented Dec 13, 2024

Yeah – a texture atlas (called a "page" in the TR lingo) combines multiple smaller textures into one large image. When using corner coordinates for texture mapping, the bilinear sampler may blend pixels from nearby textures, leading to visual artifacts. This happens because the sampler pulls pixel values from areas around the coordinates, which includes parts of adjacent textures. Offseting the corners by half a pixel prevents this from happening and is how it's done in TR1/TombATI.

@rr- rr- closed this as not planned Won't fix, can't repro, duplicate, stale Dec 13, 2024
@github-project-automation github-project-automation bot moved this from In review to Done in TRX Dev tracker Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Support No code changes necessary TR2 Unreleased Applies to things that aren't in a stable release.
Projects
Status: Done
Development

No branches or pull requests

2 participants