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.
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.
That shader ends up with 2 stages anyway.
There was a problem hiding this comment.
True. So what about limiting the effect to shaders with a single stage?
There was a problem hiding this comment.
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.
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.
Cgame-side pr: Unvanquished/Unvanquished#3306
Replaces RSF_NOLIGHTSCALE.
If this flag is used when registering a shader, all
ST_COLORMAPstages 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.