-
Notifications
You must be signed in to change notification settings - Fork 67
Always render vertex-lit surfaces with lightMapping shader. Enables realtime lights #1867
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
Conversation
c760380 to
349ddb2
Compare
|
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
349ddb2 to
36f0f4a
Compare
Do those extra lightmaps for light styles actually have corresponding deluxe maps? |
Yes. |
|
When testing this I noticed a regression but it already exists in |
Well, it's just that I didn't use latest station15 master… |
illwieckz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Depends on: #1866
Use the lightMapping GLSL shader instead of
genericto render BSP surfaces that are vertex-lit due to an explicitrgbGen 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
genericshader. In the future the newly addedRSF_BSPshader 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
lightMappingshader never had the compatibility regression thatgenericdid 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.