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

WIP: tr_shader: properly flag shader based lightmaps with IF_NOPICMIP and IF_LIGHTMAP #1130

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

illwieckz
Copy link
Member

Properly flag shader based lightmaps with IF_NOPICMIP and IF_LIGHTMAP.

This is a cherry pick from that old branch that have many commits unmerged yet:

@illwieckz illwieckz added T-Improvement Improvement for an existing feature A-Renderer labels May 11, 2024
@DolceTriade
Copy link
Contributor

Could you explain the implications of this for people less familiar with the renderer code.

@illwieckz
Copy link
Member Author

illwieckz commented May 11, 2024

Setting IF_NOPICMIP to an image will prevent the image to be downscaled when image downscaling is enabled.

Lightmaps are precisely aligned with geometry so rescaling a light map makes light bleed, so it is only wanted to resize lightmaps if it's too large for the system, not because the user asked to downscale the images in general.

The external lightmaps used in light styles (blending animated lights like blinking neons) were missing that flag, while the default internal lightmaps were already using it.

The IF_LIGHTMAP flag is, as the name says, telling the image is a lightmap, which makes easier to determine what to do with it. For example the legacy overbright code relies on this flag to multiply the light or not.

That said I have to check that part. That patch had ben sleeping for 4 years and I also have to double-check this. 🤪️

@illwieckz illwieckz marked this pull request as draft May 11, 2024 11:40
@illwieckz illwieckz changed the title tr_shader: properly flag shader based lightmaps with IF_NOPICMIP and IF_LIGHTMAP WIP: tr_shader: properly flag shader based lightmaps with IF_NOPICMIP and IF_LIGHTMAP May 11, 2024
@DolceTriade
Copy link
Contributor

Got it, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Renderer T-Improvement Improvement for an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants