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.5.0~4 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=2579f601bf44e3bb7f6da849e803b22f90a0db3e;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 ::stable-branch::merge=62b9ee6963aae02abb921ef7f451c6313b69b894 --- diff --git a/gl_rmain.c b/gl_rmain.c index 29095574..b2c7e6f9 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -2183,7 +2183,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) { @@ -2204,7 +2204,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) { @@ -2250,7 +2250,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) { @@ -2303,7 +2303,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) { @@ -2366,7 +2366,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) { @@ -2426,7 +2426,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) {