-
Notifications
You must be signed in to change notification settings - Fork 62
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
Add RSF_FORCE_LIGHTMAP #1523
Add RSF_FORCE_LIGHTMAP #1523
Conversation
FWIW the
Haven't read the code yet but the approach sounds fine. |
2adfd06
to
552cc35
Compare
552cc35
to
8f395da
Compare
src/engine/renderer/tr_shader.cpp
Outdated
|
||
// TODO: Add lightmap as the first stage if there's a heatHaze stage here? | ||
if ( pStage->type == stageType_t::ST_COLORMAP ) { | ||
pStage->type = stageType_t::ST_DIFFUSEMAP; |
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.
I recall a shader in StarATCS that used realLight
(uselessly, without rgbgen vertex/entity) and also had a lightmap stage. A shader like that would end up with two lightmaps. To avoid this we could restrict the forceLightMap
effect to shaders with only a single stage, or perhaps do it after CollapseStages
(so that it wouldn't have the ST_COLORMAP type anymore).
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.
That shader ends up with 2 stages anyway.
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.
True. So what about limiting the effect to shaders with a single stage?
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.
That seems reasonable. I checked all the shaders for particles with realLight
in the particle directory, and only the staratcs
one has 2 stages. Without the single stage check it ends up with a lightgrid and a regular lightmap stage, with the check it ends up as generic + lightgrid.
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.
Added the check for the amount of stages.
8f395da
to
eac1ff9
Compare
Replaces RSF_NOLIGHTSCALE. If this flag is used when registering a shader, all `ST_COLORMAP` stages will be changed to `ST_DIFFUSEMAP`. This is intended for use with particles and trails, to make them use the lightGrid in the GLSL code.
eac1ff9
to
52395c8
Compare
Stops particle shaders with 2 stages from switching a pattern of `generic + lightgrid` to `lightgrid + lightmap` (relevant for `staratcs`). Also fixes an OOB.
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 modulo comment
Cgame-side pr: Unvanquished/Unvanquished#3306
Replaces RSF_NOLIGHTSCALE.
If this flag is used when registering a shader, all
ST_COLORMAP
stages will be changed toST_DIFFUSEMAP
. This is intended for use with particles and trails, to make them use the lightGrid in the GLSL code.Improves performance with particle systems and trails, e. g. with firebombs, and a massive performance improvement on map https://users.unvanquished.net/~sweet/pkg/map-jota_3.0.dpk in the outside area.
There's for the most part no difference in how the particles/trails look, the only differences are due to the GLSL lightGrid being more precise.