renders: support SURF_N64_UV

This commit is contained in:
Denis Pauk 2024-04-24 23:54:52 +03:00
parent f7ec7d268e
commit 42b4a61794
4 changed files with 24 additions and 0 deletions

View file

@ -196,6 +196,12 @@ LM_BuildPolygonFromSurface(model_t *currentmodel, msurface_t *fa)
t = DotProduct(vec, fa->texinfo->vecs[1]) + fa->texinfo->vecs[1][3];
t /= fa->texinfo->image->height;
if (fa->texinfo->flags & SURF_N64_UV)
{
s *= 0.5;
t *= 0.5;
}
VectorAdd(total, vec, total);
VectorCopy(vec, vert->pos);
vert->texCoord[0] = s;

View file

@ -180,6 +180,12 @@ LM_BuildPolygonFromSurface(gl3model_t *currentmodel, msurface_t *fa)
t = DotProduct(vec, fa->texinfo->vecs[1]) + fa->texinfo->vecs[1][3];
t /= fa->texinfo->image->height;
if (fa->texinfo->flags & SURF_N64_UV)
{
s *= 0.5;
t *= 0.5;
}
VectorAdd(total, vec, total);
VectorCopy(vec, vert->pos);
vert->texCoord[0] = s;

View file

@ -180,6 +180,12 @@ LM_BuildPolygonFromSurface(gl4model_t *currentmodel, msurface_t *fa)
t = DotProduct(vec, fa->texinfo->vecs[1]) + fa->texinfo->vecs[1][3];
t /= fa->texinfo->image->height;
if (fa->texinfo->flags & SURF_N64_UV)
{
s *= 0.5;
t *= 0.5;
}
VectorAdd(total, vec, total);
VectorCopy(vec, vert->pos);
vert->texCoord[0] = s;

View file

@ -179,6 +179,12 @@ LM_BuildPolygonFromSurface(model_t *currentmodel, msurface_t *fa)
t = DotProduct(vec, fa->texinfo->vecs[1]) + fa->texinfo->vecs[1][3];
t /= fa->texinfo->image->height;
if (fa->texinfo->flags & SURF_N64_UV)
{
s *= 0.5;
t *= 0.5;
}
VectorAdd(total, vec, total);
VectorCopy(vec, vert->pos);
vert->texCoord[0] = s;