mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-24 10:40:46 +00:00
- added some hackery to render voxels properly again.
Something about their data preparation is not right, their depth looks totally off and causes fog to become to dense. One more reason to reconstruct the renderer in a sane fashion.
This commit is contained in:
parent
e2f9e12efb
commit
2152780806
4 changed files with 15 additions and 4 deletions
|
@ -1098,6 +1098,8 @@ 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);
|
||||
//------------
|
||||
|
||||
//transform to Build coords
|
||||
|
@ -1186,6 +1188,7 @@ int32_t polymost_voxdraw(voxmodel_t *m, tspriteptr_t const tspr)
|
|||
}
|
||||
VSMatrix identity(0);
|
||||
GLInterface.SetMatrix(Matrix_ModelView, &identity);
|
||||
GLInterface.SetFadeDisable(false);
|
||||
GLInterface.SetTinting(0, 0, PalEntry(255, 255, 255));
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -392,6 +392,11 @@ void GLInstance::SetFadeColor(PalEntry color)
|
|||
renderState.FogColor[2] = color.b * (1 / 255.f);
|
||||
};
|
||||
|
||||
void GLInstance::SetFadeDisable(bool on)
|
||||
{
|
||||
renderState.FogColor[3] = on;
|
||||
}
|
||||
|
||||
void GLInstance::SetColorMask(bool on)
|
||||
{
|
||||
glColorMask(on, on, on, on);
|
||||
|
|
|
@ -279,6 +279,7 @@ public:
|
|||
|
||||
void SetDepthFunc(int func);
|
||||
void SetFadeColor(PalEntry color);
|
||||
void SetFadeDisable(bool on);
|
||||
void SetColorMask(bool on);
|
||||
void SetDepthMask(bool on);
|
||||
void SetBlendFunc(int src, int dst);
|
||||
|
|
|
@ -183,10 +183,12 @@ void main()
|
|||
else
|
||||
{
|
||||
color.rgb *= detailColor.rgb;
|
||||
shade = clamp(shade / (u_numShades-2), 0.0, 1.0);
|
||||
// Apply the shade as a linear depth fade ramp.
|
||||
color.rgb = mix(color.rgb, u_fogColor.rgb, shade);
|
||||
|
||||
if (u_fogColor.a == 0.0)
|
||||
{
|
||||
shade = clamp(shade / (u_numShades-2), 0.0, 1.0);
|
||||
// Apply the shade as a linear depth fade ramp.
|
||||
color.rgb = mix(color.rgb, u_fogColor.rgb, shade);
|
||||
}
|
||||
}
|
||||
if (fullbright == 0.0) color.rgb *= v_color.rgb;
|
||||
color.a *= v_color.a;
|
||||
|
|
Loading…
Reference in a new issue