From: divverent Date: Fri, 2 Sep 2011 18:25:53 +0000 (+0000) Subject: enable offsetmapping permutations only if a normalmap exists and no bias is set X-Git-Tag: xonotic-v0.6.0~163^2~233 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=62b9ee6963aae02abb921ef7f451c6313b69b894;p=xonotic%2Fdarkplaces.git enable offsetmapping permutations only if a normalmap exists and no bias is set git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11319 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/gl_rmain.c b/gl_rmain.c index bcd76446..24ea8ffa 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -2184,7 +2184,7 @@ void R_SetupShader_Surface(const vec3_t lightcolorbase, qboolean modellighting, } else if (rsurfacepass == RSURFPASS_DEFERREDGEOMETRY) { - if (r_glsl_offsetmapping.integer) + if (r_glsl_offsetmapping.integer && (rsurface.texture->nmaptexture != r_texture_blanknormalmap || rsurface.texture->offsetbias != 0.0f)) { switch(rsurface.texture->offsetmapping) { @@ -2205,7 +2205,7 @@ void R_SetupShader_Surface(const vec3_t lightcolorbase, qboolean modellighting, } else if (rsurfacepass == RSURFPASS_RTLIGHT) { - if (r_glsl_offsetmapping.integer) + if (r_glsl_offsetmapping.integer && (rsurface.texture->nmaptexture != r_texture_blanknormalmap || rsurface.texture->offsetbias != 0.0f)) { switch(rsurface.texture->offsetmapping) { @@ -2251,7 +2251,7 @@ void R_SetupShader_Surface(const vec3_t lightcolorbase, qboolean modellighting, } else if (rsurface.texture->currentmaterialflags & MATERIALFLAG_FULLBRIGHT) { - if (r_glsl_offsetmapping.integer) + if (r_glsl_offsetmapping.integer && (rsurface.texture->nmaptexture != r_texture_blanknormalmap || rsurface.texture->offsetbias != 0.0f)) { switch(rsurface.texture->offsetmapping) { @@ -2304,7 +2304,7 @@ void R_SetupShader_Surface(const vec3_t lightcolorbase, qboolean modellighting, } else if (rsurface.texture->currentmaterialflags & MATERIALFLAG_MODELLIGHT_DIRECTIONAL) { - if (r_glsl_offsetmapping.integer) + if (r_glsl_offsetmapping.integer && (rsurface.texture->nmaptexture != r_texture_blanknormalmap || rsurface.texture->offsetbias != 0.0f)) { switch(rsurface.texture->offsetmapping) { @@ -2367,7 +2367,7 @@ void R_SetupShader_Surface(const vec3_t lightcolorbase, qboolean modellighting, } else if (rsurface.texture->currentmaterialflags & MATERIALFLAG_MODELLIGHT) { - if (r_glsl_offsetmapping.integer) + if (r_glsl_offsetmapping.integer && (rsurface.texture->nmaptexture != r_texture_blanknormalmap || rsurface.texture->offsetbias != 0.0f)) { switch(rsurface.texture->offsetmapping) { @@ -2427,7 +2427,7 @@ void R_SetupShader_Surface(const vec3_t lightcolorbase, qboolean modellighting, } else { - if (r_glsl_offsetmapping.integer) + if (r_glsl_offsetmapping.integer && (rsurface.texture->nmaptexture != r_texture_blanknormalmap || rsurface.texture->offsetbias != 0.0f)) { switch(rsurface.texture->offsetmapping) {