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

sRGB lightmap #243

Open
illwieckz opened this issue Dec 10, 2019 · 2 comments · May be fixed by #1543
Open

sRGB lightmap #243

illwieckz opened this issue Dec 10, 2019 · 2 comments · May be fixed by #1543
Labels

Comments

@illwieckz
Copy link
Member

q3map2 from NetRadiant already knows to bake them, and we can use Xonotic maps as testbed for this feature.

@illwieckz
Copy link
Member Author

illwieckz commented Feb 2, 2020

It looks like storing lightmap as sRGB is a mistake, since they have to be applied with linear computation.

In any way, q3map2 has option to compute linear lightmap while internally reading lights and textures the sRGB way. This would be the best way to do q3map2 computation right, and by storing them in linear space this would avoid a conversion in engine.

In any way, Xonotic will require those sRGB lightmaps to be supported.

@illwieckz
Copy link
Member Author

It looks like storing lightmap as sRGB is a mistake.

In fact it is not, storing lightmaps as sRGB also allows do distribute color values in a different way to avoids losing precision on some use case (like low lighting). That can be used as a storage trick to avoid requiring HDR lightmaps and requiring high-bit image formats.

When storing lightmaps as sRGB they should just be linearized before applying the linear computations.

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

Successfully merging a pull request may close this issue.

1 participant