Daemon icon indicating copy to clipboard operation
Daemon copied to clipboard

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

Open illwieckz opened this issue 9 months ago • 3 comments

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

illwieckz avatar May 11 '24 10:05 illwieckz

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

DolceTriade avatar May 11 '24 11:05 DolceTriade

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 avatar May 11 '24 11:05 illwieckz

Got it, thanks

DolceTriade avatar May 11 '24 18:05 DolceTriade