diff options
-rw-r--r-- | src/renderergl2/tr_bsp.c | 4 | ||||
-rw-r--r-- | src/renderergl2/tr_glsl.c | 4 | ||||
-rw-r--r-- | src/renderergl2/tr_init.c | 2 | ||||
-rw-r--r-- | src/renderergl2/tr_local.h | 1 |
4 files changed, 7 insertions, 4 deletions
diff --git a/src/renderergl2/tr_bsp.c b/src/renderergl2/tr_bsp.c index 4aac6de0..94c42e1c 100644 --- a/src/renderergl2/tr_bsp.c +++ b/src/renderergl2/tr_bsp.c @@ -272,7 +272,7 @@ static void R_LoadLightmaps( lump_t *l, lump_t *surfs ) { if (r_hdr->integer) { - if (glRefConfig.textureFloat && glRefConfig.halfFloatPixel) + if (glRefConfig.textureFloat && glRefConfig.halfFloatPixel && r_floatLightmap->integer) textureInternalFormat = GL_RGBA16F_ARB; else textureInternalFormat = GL_RGBA8; @@ -411,7 +411,7 @@ static void R_LoadLightmaps( lump_t *l, lump_t *surfs ) { VectorScale(color, lightScale, color); - if (glRefConfig.textureFloat && glRefConfig.halfFloatPixel) + if (glRefConfig.textureFloat && glRefConfig.halfFloatPixel && r_floatLightmap->integer) ColorToRGBA16F(color, (unsigned short *)(&image[j*8])); else ColorToRGBM(color, &image[j*4]); diff --git a/src/renderergl2/tr_glsl.c b/src/renderergl2/tr_glsl.c index 93884b91..54b05dc5 100644 --- a/src/renderergl2/tr_glsl.c +++ b/src/renderergl2/tr_glsl.c @@ -905,7 +905,7 @@ void GLSL_InitGPUShaders(void) if (i & GENERICDEF_USE_LIGHTMAP) Q_strcat(extradefines, 1024, "#define USE_LIGHTMAP\n"); - if (r_hdr->integer && !(glRefConfig.textureFloat && glRefConfig.halfFloatPixel)) + if (r_hdr->integer && !(glRefConfig.textureFloat && glRefConfig.halfFloatPixel && r_floatLightmap->integer)) Q_strcat(extradefines, 1024, "#define RGBM_LIGHTMAP\n"); if (!GLSL_InitGPUShader(&tr.genericShader[i], "generic", attribs, qtrue, extradefines, qtrue, fallbackShader_generic_vp, fallbackShader_generic_fp)) @@ -1034,7 +1034,7 @@ void GLSL_InitGPUShaders(void) Q_strcat(extradefines, 1024, "#define SWIZZLE_NORMALMAP\n"); } - if (r_hdr->integer && !(glRefConfig.textureFloat && glRefConfig.halfFloatPixel)) + if (r_hdr->integer && !(glRefConfig.textureFloat && glRefConfig.halfFloatPixel && r_floatLightmap->integer)) Q_strcat(extradefines, 1024, "#define RGBM_LIGHTMAP\n"); if (i & LIGHTDEF_LIGHTTYPE_MASK) diff --git a/src/renderergl2/tr_init.c b/src/renderergl2/tr_init.c index 8707d794..8da2b617 100644 --- a/src/renderergl2/tr_init.c +++ b/src/renderergl2/tr_init.c @@ -111,6 +111,7 @@ cvar_t *r_cameraExposure; cvar_t *r_softOverbright; cvar_t *r_hdr; +cvar_t *r_floatLightmap; cvar_t *r_postProcess; cvar_t *r_toneMap; @@ -1100,6 +1101,7 @@ void R_Register( void ) r_softOverbright = ri.Cvar_Get( "r_softOverbright", "1", CVAR_ARCHIVE | CVAR_LATCH ); r_hdr = ri.Cvar_Get( "r_hdr", "1", CVAR_ARCHIVE | CVAR_LATCH ); + r_floatLightmap = ri.Cvar_Get( "r_floatLightmap", "0", CVAR_ARCHIVE | CVAR_LATCH ); r_postProcess = ri.Cvar_Get( "r_postProcess", "1", CVAR_ARCHIVE ); r_toneMap = ri.Cvar_Get( "r_toneMap", "1", CVAR_ARCHIVE | CVAR_LATCH ); diff --git a/src/renderergl2/tr_local.h b/src/renderergl2/tr_local.h index 394f7893..1c97df7d 100644 --- a/src/renderergl2/tr_local.h +++ b/src/renderergl2/tr_local.h @@ -1961,6 +1961,7 @@ extern cvar_t *r_mergeLeafSurfaces; extern cvar_t *r_softOverbright; extern cvar_t *r_hdr; +extern cvar_t *r_floatLightmap; extern cvar_t *r_postProcess; extern cvar_t *r_toneMap; |