Monster skins go all weird at certain angles (sometimes the texture dissapears completely) also model lighting on those seems to be affected making them flash wildly.
World and viewmodel textures seem unaffected
![Shocked :shock:](./images/smilies/icon_shocked.gif)
Any ideas what may cause this ?
Code: Select all
void R_DrawAliasModelFrame(aliashdr_t *paliashdr, entity_t *e, int pose1, int pose2, int distance)
{
int i, j;
float l, lerpfrac;
vec3_t interpolated_verts;
aliasmesh_t *mesh;
trivertx_t *vert;
trivertx_t *lvert;
mesh = (aliasmesh_t *)((byte *)paliashdr + paliashdr->meshverts);
vert = (trivertx_t *)((byte *)paliashdr + paliashdr->vertexes + paliashdr->framevertexsize * pose1);
lvert = (trivertx_t *)((byte *)paliashdr + paliashdr->vertexes + paliashdr->framevertexsize * pose2);
if (r_modelalpha < 1.0f)
{
glEnable(GL_BLEND);
}
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_COLOR_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glVertexPointer(3, GL_FLOAT, sizeof(aliasmesh_t), mesh->v);
glColorPointer(4, GL_FLOAT, sizeof(aliasmesh_t), mesh->color);
glTexCoordPointer(2, GL_FLOAT, sizeof(aliasmesh_t), mesh->st);
for (i = 0; i < paliashdr->numverts; i++, mesh++)
{
trivertx_t *trivert = &vert[mesh->vertindex];
trivertx_t *ltrivert = &lvert[mesh->vertindex];
// normals and vertexes come from the frame list
// blend the light intensity from the two frames together
lerpfrac = VectorL2Compare(trivert->v, ltrivert->v, distance) ? e->frame_lerp : 1.0f;
if (gl_vertexlights.value && !e->drawfullbright)
{
l = R_VertexLight(anorm_pitch[trivert->lightnormalindex],
anorm_yaw[trivert->lightnormalindex],
anorm_pitch[ltrivert->lightnormalindex],
anorm_yaw[ltrivert->lightnormalindex], lerpfrac, apitch, ayaw);
l = min(1.0f, l);
// square it cause it looks pretty
l *= l;
for (j = 0; j < 3; j++)
{
mesh->color[j] = lightcolor[j] / 256 + l;
}
mesh->color[3] = r_modelalpha;
}
else
{
// normals and vertexes come from the frame list
// blend the light intensity from the two frames together
l = FloatInterpolate(shadedots[trivert->lightnormalindex], lerpfrac, shadedots[ltrivert->lightnormalindex]);
l = (l * shadelight + ambientlight) / 256;
l = min(1.0f, l);
// square it cause it looks pretty
l *= l;
for (j = 0; j < 3; j++)
{
mesh->color[i] = l;
}
mesh->color[3] = r_modelalpha;
}
VectorInterpolate(trivert->v, lerpfrac, ltrivert->v, interpolated_verts);
mesh->v[0] = interpolated_verts[0];
mesh->v[1] = interpolated_verts[1];
mesh->v[2] = interpolated_verts[2];
}
glDrawElements(GL_TRIANGLES, paliashdr->numindexes, GL_UNSIGNED_SHORT, (unsigned short *)((byte *)paliashdr + paliashdr->indexes));
glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_COLOR_ARRAY);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
if (r_modelalpha < 1.0f)
{
glDisable(GL_BLEND);
}
}
Code: Select all
glBlendEquation (GL_MAX);
glBlendFunc (GL_ONE, GL_ONE);