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

Improve the accuracy of downsampled texture colors #388

Merged
merged 1 commit into from
Mar 18, 2024

Conversation

rdw-software
Copy link
Member

@rdw-software rdw-software commented Mar 18, 2024

It seems that some error correction is applied by the fixed-function pipeline when operating on the downsampled (reduced-color) textures? Merely truncating the colors, as previously done, yields visible artifacts with an accumulating error consistent with the dropped precision (1 per 32 for bpp = 5). The base colors would have to be either uint8 or floats, which carry more information after all. The results are otherwise fairly exact, at least on the few maps I tested. This may also apply to lightmaps? (TBD)

It seems that some error correction is applied by the fixed-function pipeline when operating on the downsampled (reduced-color) textures? Merely truncating the colors, as previously done, yields visible artifacts with an accumulating error consistent with the dropped precision (1 per 32 for bpp = 5). The base colors would have to be either uint8 or floats, which carry more information after all. The results are otherwise fairly exact, at least on the few maps I tested. This may also apply to lightmaps? (TBD)
@rdw-software rdw-software force-pushed the downsampling-error-correction branch from d84b025 to 0be1251 Compare March 18, 2024 14:52
@rdw-software rdw-software merged commit bf6fd8a into main Mar 18, 2024
6 checks passed
@rdw-software rdw-software deleted the downsampling-error-correction branch March 18, 2024 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant