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

Mipmaps for NPOT textures are broken #24

Open
fgsfdsfgs opened this issue Mar 17, 2018 · 2 comments
Open

Mipmaps for NPOT textures are broken #24

fgsfdsfgs opened this issue Mar 17, 2018 · 2 comments
Labels

Comments

@fgsfdsfgs
Copy link
Contributor

NPOT textures work fine by themselves, but all miplevels higher than 0 seem to contain garbage (other textures seem to bleed into them). Maybe mipmaps are not properly aligned or are generated without taking proper stride into account? Turning on NPOT textures in Xash gives me a large memory usage decrease, so I'm interested in making this work. Both glGenerateMipmap and manual mipmap generation give the same results, which is expected.

2018-03-17-045721

2018-03-17-045736

2018-03-17-050707

@fgsfdsfgs
Copy link
Contributor Author

fgsfdsfgs commented Mar 17, 2018

Turns out each consecutive miplevel needs to be offset from the previous not by its actual size, but by the nearest power of two of its actual size, AND the width/stride for every miplevel has to be aligned by 8 texels. I'll try to fix this tomorrow. Doesn't also save that much memory if you try to do it "correctly".

@Rinnegatamante
Copy link
Owner

Is this still a thing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants