mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-14 08:30:58 +00:00
Improve depth fighting mitigation for floor aligned sprites.
git-svn-id: https://svn.eduke32.com/eduke32@5403 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
c57be0fbdd
commit
5b24fc4f42
1 changed files with 9 additions and 6 deletions
|
@ -4500,13 +4500,16 @@ void polymost_drawsprite(int32_t snum)
|
||||||
|
|
||||||
// Project rotated 3D points to screen
|
// Project rotated 3D points to screen
|
||||||
|
|
||||||
const int foff_sign = (tspr->z > globalposz) ? -1 : 1;
|
int fadjust = 0;
|
||||||
float fadjust = 0.f;
|
|
||||||
|
|
||||||
if (tspr->z == sec->ceilingz) tspr->z++, fadjust = .001f * tspr->owner;
|
// unfortunately, offsetting by only 1 isn't enough on most Android devices
|
||||||
if (tspr->z == sec->floorz) tspr->z--, fadjust = .001f * tspr->owner;
|
if (tspr->z == sec->ceilingz || tspr->z == sec->ceilingz + 1)
|
||||||
|
tspr->z = sec->ceilingz + 2, fadjust = (tspr->owner & 31);
|
||||||
|
|
||||||
float f = (fadjust + (float) (tspr->z - globalposz) + foff_sign) * gyxscale;
|
if (tspr->z == sec->floorz || tspr->z == sec->floorz - 1)
|
||||||
|
tspr->z = sec->floorz - 2, fadjust = -((tspr->owner & 31));
|
||||||
|
|
||||||
|
float f = (float)(tspr->z - globalposz + fadjust) * gyxscale;
|
||||||
|
|
||||||
for (int j = 0; j < npoints; j++)
|
for (int j = 0; j < npoints; j++)
|
||||||
{
|
{
|
||||||
|
@ -4518,7 +4521,7 @@ void polymost_drawsprite(int32_t snum)
|
||||||
// gd? Copied from floor rendering code
|
// gd? Copied from floor rendering code
|
||||||
|
|
||||||
xtex.d = 0;
|
xtex.d = 0;
|
||||||
ytex.d = gxyaspect / (double)(tspr->z - globalposz + foff_sign);
|
ytex.d = gxyaspect / (double)(tspr->z - globalposz + fadjust);
|
||||||
otex.d = -ghoriz * ytex.d;
|
otex.d = -ghoriz * ytex.d;
|
||||||
|
|
||||||
// copied&modified from relative alignment
|
// copied&modified from relative alignment
|
||||||
|
|
Loading…
Reference in a new issue