You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// FIXME: This can be reached if r_vertexLighting == 0 and tess.lightmapNum is invalid which doesn't seem right
Render_vertexLighting_DBS_entity( stage );
}
else
{
Render_vertexLighting_DBS_world( stage );
}
The issue is:
If a bsp model has light map, light mapping is enabled the model is rendered with the same code used to render the whole map in all case, which is good.
But if such bsp model is not a world model (for example a func_rotating entity), if light mapping is disabled, such bsp model is rendered with the c++ code and glsl code for the non-bsp models (like player models, weapons…).
So basically we have this:
kind
world
lm enabled
lm disabled
bsp model
yes
lightmap world
lightgrid world
bsp model
no
lightmap world
lightgrid entity
game model
no
lightgrid entity
lightgrid entity
When bsp models are rendered as game models, such unwanted glsl computation may be done, like rim lighting.
Although, we see non-world bsp model are handled fine by both lightmap, lightgrid world and lightgrid entity shaders, meaning there is maybe not a strong need for so much copypaste (see #301 for ongoing merge effort).
To improve the code I would like to have a reliable way to know if a model is a bsp model or not. I don't think it's reliable to detect if surface has lightmap since map may be built without.
To make the bug obvious, I temporarily modified the lightgrid entity glsl shader (vertexLighting_DBS_entity_fp.glsl) to set red channel to full, this to paint in red every surface rendered by this code.
Light map enabled:
Light map disabled:
Light map enabled:
Light map disabled:
Light map enabled:
Light map disabled:
The text was updated successfully, but these errors were encountered:
illwieckz
changed the title
map bsp models are rendered as game models if light mapping is disabled
need a reliable way to detect if a model is a bsp model
Mar 12, 2020
illwieckz
changed the title
need a reliable way to detect if a model is a bsp model
need a reliable way to detect if a given surface is one of a bsp model
Mar 12, 2020
illwieckz
added a commit
to illwieckz/Daemon
that referenced
this issue
Apr 11, 2020
Render is basically doing this to pick which glsl code to use to render a given texture:
Real code there:
Daemon/src/engine/renderer/tr_shade.cpp
Lines 3058 to 3070 in 42e408a
The issue is:
If a bsp model has light map, light mapping is enabled the model is rendered with the same code used to render the whole map in all case, which is good.
But if such bsp model is not a world model (for example a func_rotating entity), if light mapping is disabled, such bsp model is rendered with the c++ code and glsl code for the non-bsp models (like player models, weapons…).
So basically we have this:
When bsp models are rendered as game models, such unwanted glsl computation may be done, like rim lighting.
Although, we see non-world bsp model are handled fine by both lightmap, lightgrid world and lightgrid entity shaders, meaning there is maybe not a strong need for so much copypaste (see #301 for ongoing merge effort).
To improve the code I would like to have a reliable way to know if a model is a bsp model or not. I don't think it's reliable to detect if surface has lightmap since map may be built without.
To make the bug obvious, I temporarily modified the lightgrid entity glsl shader (
vertexLighting_DBS_entity_fp.glsl
) to set red channel to full, this to paint in red every surface rendered by this code.Light map enabled:
Light map disabled:
Light map enabled:
Light map disabled:
Light map enabled:
Light map disabled:
The text was updated successfully, but these errors were encountered: