mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-26 08:50:55 +00:00
Polymost sky Z buffer hack from Nuke.YKT
git-svn-id: https://svn.eduke32.com/eduke32@7415 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
4522a8902b
commit
483fbe4cd6
1 changed files with 22 additions and 1 deletions
|
@ -2822,7 +2822,7 @@ void polymost_setupglowtexture(const int32_t texunits, const int32_t tex)
|
||||||
// +4 means it's a sprite, so wraparound isn't needed
|
// +4 means it's a sprite, so wraparound isn't needed
|
||||||
|
|
||||||
// drawpoly's hack globals
|
// drawpoly's hack globals
|
||||||
static int32_t pow2xsplit = 0, skyclamphack = 0;
|
static int32_t pow2xsplit = 0, skyclamphack = 0, skyzbufferhack = 0;
|
||||||
static float drawpoly_alpha = 0.f;
|
static float drawpoly_alpha = 0.f;
|
||||||
static uint8_t drawpoly_blend = 0;
|
static uint8_t drawpoly_blend = 0;
|
||||||
|
|
||||||
|
@ -3348,6 +3348,8 @@ static void polymost_drawpoly(vec2f_t const * const dpxy, int32_t const n, int32
|
||||||
; /* do nothing */
|
; /* do nothing */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int32_t skyzbufferhack_pass = 0;
|
||||||
|
|
||||||
if (!waloff[globalpicnum])
|
if (!waloff[globalpicnum])
|
||||||
{
|
{
|
||||||
glEnable(GL_BLEND);
|
glEnable(GL_BLEND);
|
||||||
|
@ -3409,6 +3411,9 @@ static void polymost_drawpoly(vec2f_t const * const dpxy, int32_t const n, int32
|
||||||
|
|
||||||
globaltinting_apply(pc);
|
globaltinting_apply(pc);
|
||||||
|
|
||||||
|
if (skyzbufferhack_pass)
|
||||||
|
pc[3] = 0.01f;
|
||||||
|
|
||||||
glColor4f(pc[0], pc[1], pc[2], pc[3]);
|
glColor4f(pc[0], pc[1], pc[2], pc[3]);
|
||||||
|
|
||||||
//POGOTODO: remove this, replace it with a shader implementation
|
//POGOTODO: remove this, replace it with a shader implementation
|
||||||
|
@ -3681,6 +3686,16 @@ do
|
||||||
globalshade = shade;
|
globalshade = shade;
|
||||||
fullbright_pass = 0;
|
fullbright_pass = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (skyzbufferhack && skyzbufferhack_pass == 0)
|
||||||
|
{
|
||||||
|
vec3d_t const bxtex = xtex, bytex = ytex, botex = otex;
|
||||||
|
xtex = xtex2, ytex = ytex2, otex = otex2;
|
||||||
|
skyzbufferhack_pass++;
|
||||||
|
polymost_drawpoly(dpxy, n, DAMETH_MASK);
|
||||||
|
xtex = bxtex, ytex = bytex, otex = botex;
|
||||||
|
skyzbufferhack_pass--;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -5063,6 +5078,8 @@ static void polymost_drawalls(int32_t const bunch)
|
||||||
if (dapskyoff[i] != dapskyoff[i-1])
|
if (dapskyoff[i] != dapskyoff[i-1])
|
||||||
{ skyclamphack = r_parallaxskyclamping; break; }
|
{ skyclamphack = r_parallaxskyclamping; break; }
|
||||||
|
|
||||||
|
skyzbufferhack = 1;
|
||||||
|
|
||||||
if (!usehightile || !hicfindskybox(globalpicnum, globalpal))
|
if (!usehightile || !hicfindskybox(globalpicnum, globalpal))
|
||||||
{
|
{
|
||||||
float const dd = fxdimen*.0000001f; //Adjust sky depth based on screen size!
|
float const dd = fxdimen*.0000001f; //Adjust sky depth based on screen size!
|
||||||
|
@ -5353,6 +5370,7 @@ static void polymost_drawalls(int32_t const bunch)
|
||||||
}
|
}
|
||||||
|
|
||||||
skyclamphack = 0;
|
skyclamphack = 0;
|
||||||
|
skyzbufferhack = 0;
|
||||||
if (!nofog)
|
if (!nofog)
|
||||||
polymost_setFogEnabled(true);
|
polymost_setFogEnabled(true);
|
||||||
}
|
}
|
||||||
|
@ -5409,6 +5427,8 @@ static void polymost_drawalls(int32_t const bunch)
|
||||||
if (dapskyoff[i] != dapskyoff[i-1])
|
if (dapskyoff[i] != dapskyoff[i-1])
|
||||||
{ skyclamphack = r_parallaxskyclamping; break; }
|
{ skyclamphack = r_parallaxskyclamping; break; }
|
||||||
|
|
||||||
|
skyzbufferhack = 1;
|
||||||
|
|
||||||
if (!usehightile || !hicfindskybox(globalpicnum, globalpal))
|
if (!usehightile || !hicfindskybox(globalpicnum, globalpal))
|
||||||
{
|
{
|
||||||
float const dd = fxdimen*.0000001f; //Adjust sky depth based on screen size!
|
float const dd = fxdimen*.0000001f; //Adjust sky depth based on screen size!
|
||||||
|
@ -5699,6 +5719,7 @@ static void polymost_drawalls(int32_t const bunch)
|
||||||
}
|
}
|
||||||
|
|
||||||
skyclamphack = 0;
|
skyclamphack = 0;
|
||||||
|
skyzbufferhack = 0;
|
||||||
if (!nofog)
|
if (!nofog)
|
||||||
polymost_setFogEnabled(true);
|
polymost_setFogEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue