]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
enable offsetmapping permutations only if a normalmap exists and no bias is set
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 2 Sep 2011 18:25:53 +0000 (18:25 +0000)
committerRudolf Polzer <divverent@xonotic.org>
Sat, 3 Sep 2011 15:00:54 +0000 (17:00 +0200)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11319 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=62b9ee6963aae02abb921ef7f451c6313b69b894

gl_rmain.c

index 290955741ee86ec4e4e1c194c98ca4e916f608e6..b2c7e6f99623eb419a2b83614e3f918cdfc7770e 100644 (file)
@@ -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)
                        {