fix normals for sprite lighting
This commit is contained in:
parent
a7b20183f1
commit
b862adb747
9 changed files with 48 additions and 25 deletions
|
|
@ -280,7 +280,7 @@ void HWDrawInfo::GetDynSpriteLightList(AActor *self, FDynLightData &modellightda
|
|||
|
||||
ActorTraceStaticLight staticLight(self);
|
||||
|
||||
if (gl_spritelight > 0 || ActorTraceStaticLight::TraceSunVisibility(x, y, z, (self ? &self->StaticLightsTraceCache : nullptr), (self ? staticLight.ActorMoved : false)))
|
||||
if ((level.lightmaps && gl_spritelight > 0) || ActorTraceStaticLight::TraceSunVisibility(x, y, z, (self ? &self->StaticLightsTraceCache : nullptr), (self ? staticLight.ActorMoved : false)))
|
||||
{
|
||||
AddSunLightToList(modellightdata, x, y, z, self->Level->SunDirection, self->Level->SunColor * self->Level->SunIntensity, gl_spritelight > 0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -305,6 +305,7 @@ void HWSprite::DrawSprite(HWDrawInfo *di, FRenderState &state, bool translucent)
|
|||
state.SetDepthBias(-1, -128);
|
||||
}
|
||||
|
||||
state.SetLightNoNormals(true);
|
||||
state.SetLightIndex(dynlightindex);
|
||||
state.Draw(DT_TriangleStrip, vertexindex, 4);
|
||||
state.SetLightIndex(-1);
|
||||
|
|
@ -318,6 +319,7 @@ void HWSprite::DrawSprite(HWDrawInfo *di, FRenderState &state, bool translucent)
|
|||
state.Draw(DT_TriangleStrip, vertexindex, 4);
|
||||
state.SetTextureMode(TM_NORMAL);
|
||||
}
|
||||
state.SetLightNoNormals(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue