- made the new Build light mode operational
This commit is contained in:
parent
45210efb91
commit
b20de184a0
5 changed files with 17 additions and 4 deletions
|
|
@ -146,8 +146,16 @@ void HWDrawInfo::StartScene(FRenderViewpoint &parentvp, HWViewpointUniforms *uni
|
|||
VPUniforms.mViewMatrix.loadIdentity();
|
||||
VPUniforms.mNormalViewMatrix.loadIdentity();
|
||||
VPUniforms.mViewHeight = viewheight;
|
||||
VPUniforms.mGlobVis = (float)R_GetGlobVis(r_viewwindow, r_visibility) / 32.f;
|
||||
VPUniforms.mPalLightLevels = static_cast<int>(gl_bandedswlight) | (static_cast<int>(gl_fogmode) << 8) | ((int)lightmode << 16);
|
||||
if (gl_lightmode == 5)
|
||||
{
|
||||
VPUniforms.mGlobVis = 1 / 64.f;
|
||||
VPUniforms.mPalLightLevels = 32 | (static_cast<int>(gl_fogmode) << 8) | ((int)lightmode << 16);
|
||||
}
|
||||
else
|
||||
{
|
||||
VPUniforms.mGlobVis = (float)R_GetGlobVis(r_viewwindow, r_visibility) / 32.f;
|
||||
VPUniforms.mPalLightLevels = static_cast<int>(gl_bandedswlight) | (static_cast<int>(gl_fogmode) << 8) | ((int)lightmode << 16);
|
||||
}
|
||||
VPUniforms.mClipLine.X = -10000000.0f;
|
||||
VPUniforms.mShadowmapFilter = gl_shadowmap_filter;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -185,7 +185,7 @@ float HWDrawInfo::GetFogDensity(int lightlevel, PalEntry fogcolor, int sectorfog
|
|||
else if ((fogcolor.d & 0xffffff) == 0)
|
||||
{
|
||||
// case 2: black fog
|
||||
if ((!isSoftwareLighting() || blendfactor > 0) && !(Level->flags3 & LEVEL3_NOLIGHTFADE))
|
||||
if ((!isDoomSoftwareLighting() || blendfactor > 0) && !(Level->flags3 & LEVEL3_NOLIGHTFADE))
|
||||
{
|
||||
density = distfogtable[lightmode != ELightMode::LinearStandard][hw_ClampLight(lightlevel)];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -135,6 +135,10 @@ void HWDrawInfo::SetFog(FRenderState &state, int lightlevel, int rellight, bool
|
|||
float light = (float)CalcLightLevel(lightlevel, rellight, false, cmap->BlendFactor);
|
||||
SetShaderLight(state, light, lightlevel);
|
||||
}
|
||||
else if (lightmode == ELightMode::Build)
|
||||
{
|
||||
state.SetLightParms(0.2f * fogdensity, 1.f / 31.f);
|
||||
}
|
||||
else
|
||||
{
|
||||
state.SetLightParms(1.f, 0.f);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue