Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions src/renderers/opengl/tr_backend.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand Down Expand Up @@ -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();

Expand Down
62 changes: 16 additions & 46 deletions src/renderers/opengl/tr_bsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
Expand Down
13 changes: 0 additions & 13 deletions src/renderers/vulkan/tr_backend.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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();

Expand Down
62 changes: 16 additions & 46 deletions src/renderers/vulkan/tr_bsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
Expand Down
Loading