- if (texture->textureflags & Q3TEXTUREFLAG_TWOSIDED)
- qglDisable(GL_CULL_FACE);
- else
- qglEnable(GL_CULL_FACE);
- glosstexture = r_texture_black;
- specularscale = 0;
- if (texture->skin.gloss)
- {
- if (r_shadow_gloss.integer >= 1 && r_shadow_glossintensity.value > 0 && r_shadow_rtlight->specularscale > 0)
- {
- glosstexture = texture->skin.gloss;
- specularscale = r_shadow_rtlight->specularscale * r_shadow_glossintensity.value;
- }
- }
- else
- {
- if (r_shadow_gloss.integer >= 2 && r_shadow_gloss2intensity.value > 0 && r_shadow_glossintensity.value > 0 && r_shadow_rtlight->specularscale > 0)
- {
- glosstexture = r_texture_white;
- specularscale = r_shadow_rtlight->specularscale * r_shadow_gloss2intensity.value;
- }
- }
- VectorClear(lightcolorpants);
- VectorClear(lightcolorshirt);
- if (ent->colormap >= 0)
- {
- // 128-224 are backwards ranges
- int b = (ent->colormap & 0xF) << 4;b += (b >= 128 && b < 224) ? 4 : 12;
- if (texture->skin.pants && b < 224)
- {
- qbyte *bcolor = (qbyte *) (&palette_complete[b]);
- lightcolorpants[0] = lightcolorbase[0] * bcolor[0] * (1.0f / 255.0f);
- lightcolorpants[1] = lightcolorbase[1] * bcolor[1] * (1.0f / 255.0f);
- lightcolorpants[2] = lightcolorbase[2] * bcolor[2] * (1.0f / 255.0f);
- }
- // 128-224 are backwards ranges
- b = (ent->colormap & 0xF0);b += (b >= 128 && b < 224) ? 4 : 12;
- if (texture->skin.shirt && b < 224)
- {
- qbyte *bcolor = (qbyte *) (&palette_complete[b]);
- lightcolorshirt[0] = lightcolorbase[0] * bcolor[0] * (1.0f / 255.0f);
- lightcolorshirt[1] = lightcolorbase[1] * bcolor[1] * (1.0f / 255.0f);
- lightcolorshirt[2] = lightcolorbase[2] * bcolor[2] * (1.0f / 255.0f);
- }
- basetexture = texture->skin.base;
- }
- else
- basetexture = texture->skin.merged ? texture->skin.merged : texture->skin.base;
- if ((r_shadow_rtlight->ambientscale + r_shadow_rtlight->diffusescale) * (VectorLength2(lightcolorbase) + VectorLength2(lightcolorpants) + VectorLength2(lightcolorshirt)) + specularscale * VectorLength2(lightcolorbase) < (1.0f / 1048576.0f))
- skip = true;