diff --git a/code/renderergl1/tr_shader.c b/code/renderergl1/tr_shader.c index a6b3c6ff..a21404cb 100644 --- a/code/renderergl1/tr_shader.c +++ b/code/renderergl1/tr_shader.c @@ -705,7 +705,7 @@ static qboolean ParseStage( shaderStage_t *stage, char **text ) } num = stage->bundle[0].numImageAnimations; if ( num < MAX_IMAGE_ANIMATIONS ) { - imgFlags_t flags = IMGFLAG_SRGB; + imgFlags_t flags = IMGFLAG_NONE; if (!shader.noMipMaps) flags |= IMGFLAG_MIPMAP; @@ -1245,6 +1245,7 @@ static void ParseSkyParms( char **text ) { static char *suf[6] = {"rt", "bk", "lf", "ft", "up", "dn"}; char pathname[MAX_QPATH]; int i; + imgFlags_t imgFlags = IMGFLAG_MIPMAP | IMGFLAG_PICMIP; // outerbox token = COM_ParseExt( text, qfalse ); @@ -1256,7 +1257,7 @@ static void ParseSkyParms( char **text ) { for (i=0 ; i<6 ; i++) { Com_sprintf( pathname, sizeof(pathname), "%s_%s.tga" , token, suf[i] ); - shader.sky.outerbox[i] = R_FindImageFile( ( char * ) pathname, IMGTYPE_COLORALPHA, IMGFLAG_SRGB | IMGFLAG_MIPMAP | IMGFLAG_PICMIP | IMGFLAG_CLAMPTOEDGE ); + shader.sky.outerbox[i] = R_FindImageFile( ( char * ) pathname, IMGTYPE_COLORALPHA, imgFlags | IMGFLAG_CLAMPTOEDGE ); if ( !shader.sky.outerbox[i] ) { shader.sky.outerbox[i] = tr.defaultImage; @@ -1287,7 +1288,7 @@ static void ParseSkyParms( char **text ) { for (i=0 ; i<6 ; i++) { Com_sprintf( pathname, sizeof(pathname), "%s_%s.tga" , token, suf[i] ); - shader.sky.innerbox[i] = R_FindImageFile( ( char * ) pathname, IMGTYPE_COLORALPHA, IMGFLAG_SRGB | IMGFLAG_MIPMAP | IMGFLAG_PICMIP ); + shader.sky.innerbox[i] = R_FindImageFile( ( char * ) pathname, IMGTYPE_COLORALPHA, imgFlags ); if ( !shader.sky.innerbox[i] ) { shader.sky.innerbox[i] = tr.defaultImage; } diff --git a/code/renderergl2/tr_shader.c b/code/renderergl2/tr_shader.c index baf1c48e..11e9267a 100644 --- a/code/renderergl2/tr_shader.c +++ b/code/renderergl2/tr_shader.c @@ -756,7 +756,7 @@ static qboolean ParseStage( shaderStage_t *stage, char **text ) } num = stage->bundle[0].numImageAnimations; if ( num < MAX_IMAGE_ANIMATIONS ) { - imgFlags_t flags = IMGFLAG_SRGB; + imgFlags_t flags = IMGFLAG_NONE; if (!shader.noMipMaps) flags |= IMGFLAG_MIPMAP; @@ -764,6 +764,9 @@ static qboolean ParseStage( shaderStage_t *stage, char **text ) if (!shader.noPicMip) flags |= IMGFLAG_PICMIP; + if (r_srgb->integer) + flags |= IMGFLAG_SRGB; + stage->bundle[0].image[num] = R_FindImageFile( token, IMGTYPE_COLORALPHA, flags ); if ( !stage->bundle[0].image[num] ) { @@ -1376,6 +1379,10 @@ static void ParseSkyParms( char **text ) { static char *suf[6] = {"rt", "bk", "lf", "ft", "up", "dn"}; char pathname[MAX_QPATH]; int i; + imgFlags_t imgFlags = IMGFLAG_MIPMAP | IMGFLAG_PICMIP; + + if (r_srgb->integer) + imgFlags |= IMGFLAG_SRGB; // outerbox token = COM_ParseExt( text, qfalse ); @@ -1387,7 +1394,7 @@ static void ParseSkyParms( char **text ) { for (i=0 ; i<6 ; i++) { Com_sprintf( pathname, sizeof(pathname), "%s_%s.tga" , token, suf[i] ); - shader.sky.outerbox[i] = R_FindImageFile( ( char * ) pathname, IMGTYPE_COLORALPHA, IMGFLAG_SRGB | IMGFLAG_MIPMAP | IMGFLAG_PICMIP | IMGFLAG_CLAMPTOEDGE ); + shader.sky.outerbox[i] = R_FindImageFile( ( char * ) pathname, IMGTYPE_COLORALPHA, imgFlags | IMGFLAG_CLAMPTOEDGE ); if ( !shader.sky.outerbox[i] ) { shader.sky.outerbox[i] = tr.defaultImage; @@ -1418,7 +1425,7 @@ static void ParseSkyParms( char **text ) { for (i=0 ; i<6 ; i++) { Com_sprintf( pathname, sizeof(pathname), "%s_%s.tga" , token, suf[i] ); - shader.sky.innerbox[i] = R_FindImageFile( ( char * ) pathname, IMGTYPE_COLORALPHA, IMGFLAG_SRGB | IMGFLAG_MIPMAP | IMGFLAG_PICMIP ); + shader.sky.innerbox[i] = R_FindImageFile( ( char * ) pathname, IMGTYPE_COLORALPHA, imgFlags ); if ( !shader.sky.innerbox[i] ) { shader.sky.innerbox[i] = tr.defaultImage; }