- p->loc_Texture_Normal = qglGetUniformLocationARB(p->program, "Texture_Normal");
- p->loc_Texture_Color = qglGetUniformLocationARB(p->program, "Texture_Color");
- p->loc_Texture_Gloss = qglGetUniformLocationARB(p->program, "Texture_Gloss");
- p->loc_Texture_Cube = qglGetUniformLocationARB(p->program, "Texture_Cube");
- p->loc_Texture_Attenuation = qglGetUniformLocationARB(p->program, "Texture_Attenuation");
- p->loc_Texture_FogMask = qglGetUniformLocationARB(p->program, "Texture_FogMask");
- p->loc_Texture_Pants = qglGetUniformLocationARB(p->program, "Texture_Pants");
- p->loc_Texture_Shirt = qglGetUniformLocationARB(p->program, "Texture_Shirt");
- p->loc_Texture_Lightmap = qglGetUniformLocationARB(p->program, "Texture_Lightmap");
- p->loc_Texture_Deluxemap = qglGetUniformLocationARB(p->program, "Texture_Deluxemap");
- p->loc_Texture_Glow = qglGetUniformLocationARB(p->program, "Texture_Glow");
- p->loc_Texture_Refraction = qglGetUniformLocationARB(p->program, "Texture_Refraction");
- p->loc_Texture_Reflection = qglGetUniformLocationARB(p->program, "Texture_Reflection");
- p->loc_FogColor = qglGetUniformLocationARB(p->program, "FogColor");
- p->loc_LightPosition = qglGetUniformLocationARB(p->program, "LightPosition");
- p->loc_EyePosition = qglGetUniformLocationARB(p->program, "EyePosition");
- p->loc_LightColor = qglGetUniformLocationARB(p->program, "LightColor");
- p->loc_Color_Pants = qglGetUniformLocationARB(p->program, "Color_Pants");
- p->loc_Color_Shirt = qglGetUniformLocationARB(p->program, "Color_Shirt");
- p->loc_FogRangeRecip = qglGetUniformLocationARB(p->program, "FogRangeRecip");
- p->loc_AmbientScale = qglGetUniformLocationARB(p->program, "AmbientScale");
- p->loc_DiffuseScale = qglGetUniformLocationARB(p->program, "DiffuseScale");
- p->loc_SpecularPower = qglGetUniformLocationARB(p->program, "SpecularPower");
- p->loc_SpecularScale = qglGetUniformLocationARB(p->program, "SpecularScale");
- p->loc_GlowScale = qglGetUniformLocationARB(p->program, "GlowScale");
- p->loc_SceneBrightness = qglGetUniformLocationARB(p->program, "SceneBrightness");
- p->loc_OffsetMapping_Scale = qglGetUniformLocationARB(p->program, "OffsetMapping_Scale");
- p->loc_TintColor = qglGetUniformLocationARB(p->program, "TintColor");
- p->loc_AmbientColor = qglGetUniformLocationARB(p->program, "AmbientColor");
- p->loc_DiffuseColor = qglGetUniformLocationARB(p->program, "DiffuseColor");
- p->loc_SpecularColor = qglGetUniformLocationARB(p->program, "SpecularColor");
- p->loc_LightDir = qglGetUniformLocationARB(p->program, "LightDir");
- p->loc_ContrastBoostCoeff = qglGetUniformLocationARB(p->program, "ContrastBoostCoeff");
+ p->loc_Texture_Normal = qglGetUniformLocationARB(p->program, "Texture_Normal");
+ p->loc_Texture_Color = qglGetUniformLocationARB(p->program, "Texture_Color");
+ p->loc_Texture_Gloss = qglGetUniformLocationARB(p->program, "Texture_Gloss");
+ p->loc_Texture_Glow = qglGetUniformLocationARB(p->program, "Texture_Glow");
+ p->loc_Texture_FogMask = qglGetUniformLocationARB(p->program, "Texture_FogMask");
+ p->loc_Texture_Pants = qglGetUniformLocationARB(p->program, "Texture_Pants");
+ p->loc_Texture_Shirt = qglGetUniformLocationARB(p->program, "Texture_Shirt");
+ p->loc_Texture_Lightmap = qglGetUniformLocationARB(p->program, "Texture_Lightmap");
+ p->loc_Texture_Deluxemap = qglGetUniformLocationARB(p->program, "Texture_Deluxemap");
+ p->loc_Texture_Refraction = qglGetUniformLocationARB(p->program, "Texture_Refraction");
+ p->loc_Texture_Reflection = qglGetUniformLocationARB(p->program, "Texture_Reflection");
+ p->loc_Texture_Attenuation = qglGetUniformLocationARB(p->program, "Texture_Attenuation");
+ p->loc_Texture_Cube = qglGetUniformLocationARB(p->program, "Texture_Cube");
+ p->loc_FogColor = qglGetUniformLocationARB(p->program, "FogColor");
+ p->loc_LightPosition = qglGetUniformLocationARB(p->program, "LightPosition");
+ p->loc_EyePosition = qglGetUniformLocationARB(p->program, "EyePosition");
+ p->loc_LightColor = qglGetUniformLocationARB(p->program, "LightColor");
+ p->loc_Color_Pants = qglGetUniformLocationARB(p->program, "Color_Pants");
+ p->loc_Color_Shirt = qglGetUniformLocationARB(p->program, "Color_Shirt");
+ p->loc_FogRangeRecip = qglGetUniformLocationARB(p->program, "FogRangeRecip");
+ p->loc_AmbientScale = qglGetUniformLocationARB(p->program, "AmbientScale");
+ p->loc_DiffuseScale = qglGetUniformLocationARB(p->program, "DiffuseScale");
+ p->loc_SpecularPower = qglGetUniformLocationARB(p->program, "SpecularPower");
+ p->loc_SpecularScale = qglGetUniformLocationARB(p->program, "SpecularScale");
+ p->loc_GlowScale = qglGetUniformLocationARB(p->program, "GlowScale");
+ p->loc_SceneBrightness = qglGetUniformLocationARB(p->program, "SceneBrightness");
+ p->loc_OffsetMapping_Scale = qglGetUniformLocationARB(p->program, "OffsetMapping_Scale");
+ p->loc_TintColor = qglGetUniformLocationARB(p->program, "TintColor");
+ p->loc_AmbientColor = qglGetUniformLocationARB(p->program, "AmbientColor");
+ p->loc_DiffuseColor = qglGetUniformLocationARB(p->program, "DiffuseColor");
+ p->loc_SpecularColor = qglGetUniformLocationARB(p->program, "SpecularColor");
+ p->loc_LightDir = qglGetUniformLocationARB(p->program, "LightDir");
+ p->loc_ContrastBoostCoeff = qglGetUniformLocationARB(p->program, "ContrastBoostCoeff");
- if (p->loc_Texture_Normal >= 0) qglUniform1iARB(p->loc_Texture_Normal, 0);
- if (p->loc_Texture_Color >= 0) qglUniform1iARB(p->loc_Texture_Color, 1);
- if (p->loc_Texture_Gloss >= 0) qglUniform1iARB(p->loc_Texture_Gloss, 2);
- if (p->loc_Texture_Cube >= 0) qglUniform1iARB(p->loc_Texture_Cube, 3);
- if (p->loc_Texture_FogMask >= 0) qglUniform1iARB(p->loc_Texture_FogMask, 4);
- if (p->loc_Texture_Pants >= 0) qglUniform1iARB(p->loc_Texture_Pants, 5);
- if (p->loc_Texture_Shirt >= 0) qglUniform1iARB(p->loc_Texture_Shirt, 6);
- if (p->loc_Texture_Lightmap >= 0) qglUniform1iARB(p->loc_Texture_Lightmap, 7);
- if (p->loc_Texture_Deluxemap >= 0) qglUniform1iARB(p->loc_Texture_Deluxemap, 8);
- if (p->loc_Texture_Glow >= 0) qglUniform1iARB(p->loc_Texture_Glow, 9);
- if (p->loc_Texture_Attenuation >= 0) qglUniform1iARB(p->loc_Texture_Attenuation, 10);
- if (p->loc_Texture_Refraction >= 0) qglUniform1iARB(p->loc_Texture_Refraction, 11);
- if (p->loc_Texture_Reflection >= 0) qglUniform1iARB(p->loc_Texture_Reflection, 12);
+ if (p->loc_Texture_Normal >= 0) qglUniform1iARB(p->loc_Texture_Normal , GL20TU_NORMAL);
+ if (p->loc_Texture_Color >= 0) qglUniform1iARB(p->loc_Texture_Color , GL20TU_COLOR);
+ if (p->loc_Texture_Gloss >= 0) qglUniform1iARB(p->loc_Texture_Gloss , GL20TU_GLOSS);
+ if (p->loc_Texture_Glow >= 0) qglUniform1iARB(p->loc_Texture_Glow , GL20TU_GLOW);
+ if (p->loc_Texture_Pants >= 0) qglUniform1iARB(p->loc_Texture_Pants , GL20TU_PANTS);
+ if (p->loc_Texture_Shirt >= 0) qglUniform1iARB(p->loc_Texture_Shirt , GL20TU_SHIRT);
+ if (p->loc_Texture_FogMask >= 0) qglUniform1iARB(p->loc_Texture_FogMask , GL20TU_FOGMASK);
+ if (p->loc_Texture_Lightmap >= 0) qglUniform1iARB(p->loc_Texture_Lightmap , GL20TU_LIGHTMAP);
+ if (p->loc_Texture_Deluxemap >= 0) qglUniform1iARB(p->loc_Texture_Deluxemap , GL20TU_DELUXEMAP);
+ if (p->loc_Texture_Attenuation >= 0) qglUniform1iARB(p->loc_Texture_Attenuation , GL20TU_ATTENUATION);
+ if (p->loc_Texture_Cube >= 0) qglUniform1iARB(p->loc_Texture_Cube , GL20TU_CUBE);
+ if (p->loc_Texture_Refraction >= 0) qglUniform1iARB(p->loc_Texture_Refraction , GL20TU_REFRACTION);
+ if (p->loc_Texture_Reflection >= 0) qglUniform1iARB(p->loc_Texture_Reflection , GL20TU_REFLECTION);
- R_Mesh_TexBind(0, R_GetTexture(rsurface.texture->currentskinframe->nmap));
- R_Mesh_TexBind(1, R_GetTexture(rsurface.texture->basetexture));
- R_Mesh_TexBind(2, R_GetTexture(rsurface.texture->glosstexture));
- R_Mesh_TexBind(4, R_GetTexture(r_texture_fogattenuation));
- R_Mesh_TexBind(5, R_GetTexture(rsurface.texture->currentskinframe->pants));
- R_Mesh_TexBind(6, R_GetTexture(rsurface.texture->currentskinframe->shirt));
- if (rsurface.texture->currentmaterialflags & MATERIALFLAG_FULLBRIGHT)
- {
- R_Mesh_TexBind(7, R_GetTexture(r_texture_grey128));
- R_Mesh_TexBind(8, R_GetTexture(r_texture_blanknormalmap));
- R_Mesh_ColorPointer(NULL, 0, 0);
- }
- else if (rsurface.uselightmaptexture)
- {
- R_Mesh_TexBind(7, R_GetTexture(texturesurfacelist[0]->lightmaptexture));
- R_Mesh_TexBind(8, R_GetTexture(texturesurfacelist[0]->deluxemaptexture));
+ R_Mesh_TexBind(GL20TU_NORMAL, R_GetTexture(rsurface.texture->currentskinframe->nmap));
+ R_Mesh_TexBind(GL20TU_COLOR, R_GetTexture(rsurface.texture->basetexture));
+ R_Mesh_TexBind(GL20TU_GLOSS, R_GetTexture(rsurface.texture->glosstexture));
+ R_Mesh_TexBind(GL20TU_GLOW, R_GetTexture(rsurface.texture->currentskinframe->glow));
+ R_Mesh_TexBind(GL20TU_PANTS, R_GetTexture(rsurface.texture->currentskinframe->pants));
+ R_Mesh_TexBind(GL20TU_SHIRT, R_GetTexture(rsurface.texture->currentskinframe->shirt));
+ R_Mesh_TexBind(GL20TU_FOGMASK, R_GetTexture(r_texture_fogattenuation));
+ if (rsurface.uselightmaptexture || (rsurface.texture->currentmaterialflags & MATERIALFLAG_FULLBRIGHT))
R_Mesh_TexCoordPointer(2, 3, rsurface.tvector3f, rsurface.tvector3f_bufferobject, rsurface.tvector3f_bufferoffset);
R_Mesh_TexCoordPointer(3, 3, rsurface.normal3f, rsurface.normal3f_bufferobject, rsurface.normal3f_bufferoffset);
R_Mesh_TexCoordPointer(4, 2, rsurface.modeltexcoordlightmap2f, rsurface.modeltexcoordlightmap2f_bufferobject, rsurface.modeltexcoordlightmap2f_bufferoffset);
R_Mesh_TexCoordPointer(2, 3, rsurface.tvector3f, rsurface.tvector3f_bufferobject, rsurface.tvector3f_bufferoffset);
R_Mesh_TexCoordPointer(3, 3, rsurface.normal3f, rsurface.normal3f_bufferobject, rsurface.normal3f_bufferoffset);
R_Mesh_TexCoordPointer(4, 2, rsurface.modeltexcoordlightmap2f, rsurface.modeltexcoordlightmap2f_bufferobject, rsurface.modeltexcoordlightmap2f_bufferoffset);