- fixed voxel lighting.

In all that impenetrable voodoo math from Polymost it picked the wrong vector to calculate the depth of the scene and since I apparently removed the compensation math for the broken shader on the C++ side the calculated value was no longer correct.
That Polymost renderer really needs to go away. :(
This commit is contained in:
Christoph Oelckers 2019-12-19 17:51:33 +01:00
parent a38077a17e
commit ee93c6e366
3 changed files with 14 additions and 11 deletions

View file

@ -3995,17 +3995,21 @@ void polymost_drawsprite(int32_t snum)
break; // else, render as flat sprite
}
if (r_voxels && (tspr->cstat & 48) != 48 && tiletovox[tspr->picnum] >= 0 && voxmodels[tiletovox[tspr->picnum]])
if (r_voxels)
{
if (polymost_voxdraw(voxmodels[tiletovox[tspr->picnum]], tspr)) return;
break; // else, render as flat sprite
if ((tspr->cstat & 48) != 48 && tiletovox[tspr->picnum] >= 0 && voxmodels[tiletovox[tspr->picnum]])
{
if (polymost_voxdraw(voxmodels[tiletovox[tspr->picnum]], tspr)) return;
break; // else, render as flat sprite
}
if ((tspr->cstat & 48) == 48 && voxmodels[tspr->picnum])
{
polymost_voxdraw(voxmodels[tspr->picnum], tspr);
return;
}
}
if ((tspr->cstat & 48) == 48 && voxmodels[tspr->picnum])
{
polymost_voxdraw(voxmodels[tspr->picnum], tspr);
return;
}
break;
}

View file

@ -1091,8 +1091,7 @@ int32_t polymost_voxdraw(voxmodel_t *m, tspriteptr_t const tspr)
GLInterface.EnableBlend(true); // else GLInterface.EnableBlend(false);
}
else pc[3] = 1.f;
GLInterface.SetFadeDisable(true); // disable depth fading. The voxel code is somewhat broken and messes this up.
GLInterface.SetShade(0, numshades);
GLInterface.SetShade(std::max(0, globalshade), numshades);
//------------
//transform to Build coords

View file

@ -35,5 +35,5 @@ void main()
v_fogCoord = abs(eyeCoordPosition.z);
v_color = i_color;
v_distance = i_vertPos.z;
v_distance = eyeCoordPosition.z;
}