Skip to content

Conversation

@slipher
Copy link
Member

@slipher slipher commented Oct 18, 2025

Depends on: #1866

Use the lightMapping GLSL shader instead of generic to render BSP surfaces that are vertex-lit due to an explicit rgbGen vertex. This makes them use the same code path as BSP surfaces where vertex lighting is automatically selected due to the absence of a lightmap.So now it is possible to render realtime lights on explicitly vertex-lit surfaces, though they are still not as bright as they should be due to #1415.

A good chunk of code has been removed/simplified since we no longer need a duplicate code path for vertex lighting in the generic shader. In the future the newly added RSF_BSP shader flag could also help to simplify things since we could use that instead of plumbing 'is BSP surface' conditions through various places in the engine.

This targets 0.56 because it has the same effect as #1417 on the station15 plants, since the lightMapping shader never had the compatibility regression that generic did w.r.t alpha discard.

I have run my screenshot test suite against the shaders from master of https://github.com/UnvanquishedAssets/map-station15_src.dpkdir (and other maps as normal) and found no regressions.

@illwieckz
Copy link
Member

Thanks a lot! That is very appreciated. I wanted that so much!

Not only it is good that vertex lit surfaces also receive dynamic lights, but it's better when things are deduplicated and having multiple code paths to lit a surface was annoying.

In the same way I hope that in the future we will be able to feed all the light styles to the lightmapping shader, that would allow us to enable deluxe mapping on light styles stages…

Take pointer to stage instead of pointer to shader plus stage type.
Use the lightMapping GLSL shader instead of `generic` to render BSP
surfaces that are vertex-lit due to an explicit `rgbGen vertex`. This
makes them use the same code path as BSP surfaces where vertex lighting
is automatically selected due to the absence of a lightmap.

So now it is possible to render realtime lights on explicitly vertex-lit
surfaces, though they are still not as bright as they should be due to
DaemonEngine#1415.

In the following commit, this will let us remove some ugly code used for
applying the overbright factor to the `generic` shader.
This is unused following the previous commit which make shaders that
need overbright with `rgbGen vertex` run on the `lightMapping` shader
instead of `generic`.

Note: IS_LIGHT_STYLE was misnamed. It actually meant vertex overbright
@slipher
Copy link
Member Author

slipher commented Nov 2, 2025

In the same way I hope that in the future we will be able to feed all the light styles to the lightmapping shader, that would allow us to enable deluxe mapping on light styles stages…

Do those extra lightmaps for light styles actually have corresponding deluxe maps?

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.

3 participants