mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-13 07:57:51 +00:00
- only draw visible 3D-lights.
This commit is contained in:
parent
bddad29acb
commit
1ad310e69b
1 changed files with 17 additions and 8 deletions
|
@ -344,14 +344,23 @@ void GLWall::RenderTextured(int rflags)
|
|||
|
||||
for (unsigned i = 0; i < lightlist->Size(); i++)
|
||||
{
|
||||
int thisll = (*lightlist)[i].caster != NULL? gl_ClampLight(*(*lightlist)[i].p_lightlevel) : lightlevel;
|
||||
FColormap thiscm;
|
||||
thiscm.FadeColor = Colormap.FadeColor;
|
||||
thiscm.CopyFrom3DLight(&(*lightlist)[i]);
|
||||
gl_SetColor(thisll, rel, thiscm, absalpha);
|
||||
if (type != RENDERWALL_M2SNF) gl_SetFog(thisll, rel, &thiscm, RenderStyle == STYLE_Add);
|
||||
gl_RenderState.SetSplitPlanes((*lightlist)[i].plane, i == (*lightlist).Size() - 1 ? bottomplane : (*lightlist)[i + 1].plane);
|
||||
RenderWall(rflags);
|
||||
secplane_t &lowplane = i == (*lightlist).Size() - 1 ? bottomplane : (*lightlist)[i + 1].plane;
|
||||
// this must use the exact same calculation method as GLWall::Process etc.
|
||||
float low1 = FIXED2FLOAT(lowplane.ZatPoint(vertexes[0]));
|
||||
float low2 = FIXED2FLOAT(lowplane.ZatPoint(vertexes[1]));
|
||||
|
||||
if (low1 < ztop[0] && low2 < ztop[1])
|
||||
{
|
||||
int thisll = (*lightlist)[i].caster != NULL ? gl_ClampLight(*(*lightlist)[i].p_lightlevel) : lightlevel;
|
||||
FColormap thiscm;
|
||||
thiscm.FadeColor = Colormap.FadeColor;
|
||||
thiscm.CopyFrom3DLight(&(*lightlist)[i]);
|
||||
gl_SetColor(thisll, rel, thiscm, absalpha);
|
||||
if (type != RENDERWALL_M2SNF) gl_SetFog(thisll, rel, &thiscm, RenderStyle == STYLE_Add);
|
||||
gl_RenderState.SetSplitPlanes((*lightlist)[i].plane, lowplane);
|
||||
RenderWall(rflags);
|
||||
}
|
||||
if (low1 <= zbottom[0] && low2 <= zbottom[1]) break;
|
||||
}
|
||||
|
||||
glDisable(GL_CLIP_DISTANCE3);
|
||||
|
|
Loading…
Reference in a new issue