diff --git a/src/renderers/opengl/tr_backend.c b/src/renderers/opengl/tr_backend.c index 86de9822b..6a9abe8b3 100644 --- a/src/renderers/opengl/tr_backend.c +++ b/src/renderers/opengl/tr_backend.c @@ -532,15 +532,6 @@ static void RB_BeginDrawingView( void ) { { clearBits |= GL_STENCIL_BUFFER_BIT; } - if ( 0 && r_fastsky->integer && !( backEnd.refdef.rdflags & RDF_NOWORLDMODEL ) ) - { - clearBits |= GL_COLOR_BUFFER_BIT; /* Could clear only if sky shaders used */ -#ifdef _DEBUG - qglClearColor( 0.8f, 0.7f, 0.4f, 1.0f ); /* Debug: could sample sky color */ -#else - qglClearColor( 0.0f, 0.0f, 0.0f, 1.0f ); /* Could sample sky color */ -#endif - } qglClear( clearBits ); if ( backEnd.refdef.rdflags & RDF_HYPERSPACE ) { @@ -1270,10 +1261,6 @@ static const void *RB_DrawSurfs( const void *data ) { VBO_UnBind(); #endif - if ( 0 && r_drawSun->integer ) { /* sun drawing disabled */ - RB_DrawSun( 0.1f, tr.sunShader ); - } - // darken down any stencil shadows RB_ShadowFinish(); diff --git a/src/renderers/opengl/tr_bsp.c b/src/renderers/opengl/tr_bsp.c index afde96f98..bbd41dd8b 100644 --- a/src/renderers/opengl/tr_bsp.c +++ b/src/renderers/opengl/tr_bsp.c @@ -241,54 +241,24 @@ static float R_ProcessLightmap( byte *image, const byte *buf_p, float maxIntensi { int x, y; - if ( 0 && r_lightmap->integer == 2 ) { - int j; - // color code by intensity as development tool (r/g/b from buf_p, clamp output) - for ( j = 0; j < LIGHTMAP_SIZE * LIGHTMAP_SIZE; j++ ) - { - float r = buf_p[j*3+0]; - float g = buf_p[j*3+1]; - float b = buf_p[j*3+2]; - float intensity; - float out[3] = {0.0, 0.0, 0.0}; - - intensity = 0.33f * r + 0.685f * g + 0.063f * b; - - if ( intensity > 255 ) - intensity = 1.0f; - else - intensity /= 255.0f; - - if ( intensity > maxIntensity ) - maxIntensity = intensity; - - HSVtoRGB( intensity, 1.00, 0.50, out ); - - image[j*4+0] = (byte)Com_Clamp( 0.0f, 255.0f, out[0] * 255.0f ); - image[j*4+1] = (byte)Com_Clamp( 0.0f, 255.0f, out[1] * 255.0f ); - image[j*4+2] = (byte)Com_Clamp( 0.0f, 255.0f, out[2] * 255.0f ); - image[j*4+3] = 255; + if ( tr.mergeLightmaps ) { + for ( y = 0 ; y < LIGHTMAP_SIZE; y++ ) { + for ( x = 0 ; x < LIGHTMAP_SIZE; x++ ) { + byte *dst = &image[((y + LIGHTMAP_BORDER) * LIGHTMAP_LEN + x + LIGHTMAP_BORDER) * 4]; + R_ColorShiftLightingBytes( buf_p, dst, qfalse ); + dst[3] = 255; + buf_p += 3; + } } + FillBorders( image ); } else { - if ( tr.mergeLightmaps ) { - for ( y = 0 ; y < LIGHTMAP_SIZE; y++ ) { - for ( x = 0 ; x < LIGHTMAP_SIZE; x++ ) { - byte *dst = &image[((y + LIGHTMAP_BORDER) * LIGHTMAP_LEN + x + LIGHTMAP_BORDER) * 4]; - R_ColorShiftLightingBytes( buf_p, dst, qfalse ); - dst[3] = 255; - buf_p += 3; - } - } - FillBorders( image ); - } else { - // legacy path - for ( y = 0 ; y < LIGHTMAP_SIZE; y++ ) { - for ( x = 0 ; x < LIGHTMAP_SIZE; x++ ) { - byte *dst = &image[(y * LIGHTMAP_SIZE + x) * 4]; - R_ColorShiftLightingBytes( buf_p, dst, qfalse ); - dst[3] = 255; - buf_p += 3; - } + // legacy path + for ( y = 0 ; y < LIGHTMAP_SIZE; y++ ) { + for ( x = 0 ; x < LIGHTMAP_SIZE; x++ ) { + byte *dst = &image[(y * LIGHTMAP_SIZE + x) * 4]; + R_ColorShiftLightingBytes( buf_p, dst, qfalse ); + dst[3] = 255; + buf_p += 3; } } } diff --git a/src/renderers/vulkan/tr_backend.c b/src/renderers/vulkan/tr_backend.c index eb9e32b98..33141b9b9 100644 --- a/src/renderers/vulkan/tr_backend.c +++ b/src/renderers/vulkan/tr_backend.c @@ -563,15 +563,6 @@ static void RB_BeginDrawingView( void ) { { clearBits |= GL_STENCIL_BUFFER_BIT; } - if ( 0 && r_fastsky->integer && !( backEnd.refdef.rdflags & RDF_NOWORLDMODEL ) ) - { - clearBits |= GL_COLOR_BUFFER_BIT; /* Could clear only if sky shaders used */ -#ifdef _DEBUG - qglClearColor( 0.8f, 0.7f, 0.4f, 1.0f ); /* Debug: could sample sky color */ -#else - qglClearColor( 0.0f, 0.0f, 0.0f, 1.0f ); /* Could sample sky color */ -#endif - } qglClear( clearBits ); #endif @@ -1795,10 +1786,6 @@ static const void *RB_DrawSurfs( const void *data ) { VBO_UnBind(); #endif - if ( 0 && r_drawSun->integer ) { /* sun drawing disabled */ - RB_DrawSun( 0.1f, tr.sunShader ); - } - // darken down any stencil shadows RB_ShadowFinish(); diff --git a/src/renderers/vulkan/tr_bsp.c b/src/renderers/vulkan/tr_bsp.c index fa760064a..b786d0837 100644 --- a/src/renderers/vulkan/tr_bsp.c +++ b/src/renderers/vulkan/tr_bsp.c @@ -250,54 +250,24 @@ static float R_ProcessLightmap( byte *image, const byte *buf_p, float maxIntensi { int x, y; - if ( 0 && r_lightmap->integer == 2 ) { - int j; - // color code by intensity as development tool (r/g/b from buf_p, clamp output) - for ( j = 0; j < LIGHTMAP_SIZE * LIGHTMAP_SIZE; j++ ) - { - float r = buf_p[j*3+0]; - float g = buf_p[j*3+1]; - float b = buf_p[j*3+2]; - float intensity; - float out[3] = {0.0, 0.0, 0.0}; - - intensity = 0.33f * r + 0.685f * g + 0.063f * b; - - if ( intensity > 255 ) - intensity = 1.0f; - else - intensity /= 255.0f; - - if ( intensity > maxIntensity ) - maxIntensity = intensity; - - HSVtoRGB( intensity, 1.00, 0.50, out ); - - image[j*4+0] = (byte)Com_Clamp( 0.0f, 255.0f, out[0] * 255.0f ); - image[j*4+1] = (byte)Com_Clamp( 0.0f, 255.0f, out[1] * 255.0f ); - image[j*4+2] = (byte)Com_Clamp( 0.0f, 255.0f, out[2] * 255.0f ); - image[j*4+3] = 255; + if ( tr.mergeLightmaps ) { + for ( y = 0 ; y < LIGHTMAP_SIZE; y++ ) { + for ( x = 0 ; x < LIGHTMAP_SIZE; x++ ) { + byte *dst = &image[((y + LIGHTMAP_BORDER) * LIGHTMAP_LEN + x + LIGHTMAP_BORDER) * 4]; + R_ColorShiftLightingBytes( buf_p, dst, qfalse ); + dst[3] = 255; + buf_p += 3; + } } + FillBorders( image ); } else { - if ( tr.mergeLightmaps ) { - for ( y = 0 ; y < LIGHTMAP_SIZE; y++ ) { - for ( x = 0 ; x < LIGHTMAP_SIZE; x++ ) { - byte *dst = &image[((y + LIGHTMAP_BORDER) * LIGHTMAP_LEN + x + LIGHTMAP_BORDER) * 4]; - R_ColorShiftLightingBytes( buf_p, dst, qfalse ); - dst[3] = 255; - buf_p += 3; - } - } - FillBorders( image ); - } else { - // legacy path - for ( y = 0 ; y < LIGHTMAP_SIZE; y++ ) { - for ( x = 0 ; x < LIGHTMAP_SIZE; x++ ) { - byte *dst = &image[(y * LIGHTMAP_SIZE + x) * 4]; - R_ColorShiftLightingBytes( buf_p, dst, qfalse ); - dst[3] = 255; - buf_p += 3; - } + // legacy path + for ( y = 0 ; y < LIGHTMAP_SIZE; y++ ) { + for ( x = 0 ; x < LIGHTMAP_SIZE; x++ ) { + byte *dst = &image[(y * LIGHTMAP_SIZE + x) * 4]; + R_ColorShiftLightingBytes( buf_p, dst, qfalse ); + dst[3] = 255; + buf_p += 3; } } }