Daemon
Daemon copied to clipboard
WIP: tr_shader: properly flag shader based lightmaps with IF_NOPICMIP and IF_LIGHTMAP
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:
- https://github.com/DaemonEngine/Daemon/pull/394
Could you explain the implications of this for people less familiar with the renderer code.
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. 🤪️
Got it, thanks