Skip to content

Commit 59e1a8b

Browse files
committed
NUKE _quadratic and _randomNormals built-in images
_randomNormals was used by the recently NUKED forward lighting code. I imagine that _quadratic was supposed to be something related to forward lighting too, but it was already unused in the initial commit.
1 parent 7e2659d commit 59e1a8b

File tree

2 files changed

+1
-68
lines changed

2 files changed

+1
-68
lines changed

src/engine/renderer/tr_image.cpp

Lines changed: 1 addition & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -2474,45 +2474,6 @@ static void R_CreateDefaultImage()
24742474
tr.defaultImage = R_CreateImage( "_default", ( const byte ** ) &dataPtr, DEFAULT_SIZE, DEFAULT_SIZE, 1, imageParams );
24752475
}
24762476

2477-
static void R_CreateRandomNormalsImage()
2478-
{
2479-
int x, y;
2480-
byte data[ DEFAULT_SIZE ][ DEFAULT_SIZE ][ 4 ];
2481-
// the default image will be a box, to allow you to see the mapping coordinates
2482-
memset(data, 32, sizeof(data));
2483-
2484-
byte *ptr = &data[0][0][0];
2485-
byte *dataPtr = &data[0][0][0];
2486-
2487-
for ( y = 0; y < DEFAULT_SIZE; y++ )
2488-
{
2489-
for ( x = 0; x < DEFAULT_SIZE; x++ )
2490-
{
2491-
vec3_t n;
2492-
float r, angle;
2493-
2494-
r = random();
2495-
angle = 2.0f * M_PI * r; // / 360.0f;
2496-
2497-
VectorSet( n, cosf( angle ), sinf( angle ), r );
2498-
VectorNormalize( n );
2499-
2500-
ptr[ 0 ] = ( byte )( 128 + 127 * n[ 0 ] );
2501-
ptr[ 1 ] = ( byte )( 128 + 127 * n[ 1 ] );
2502-
ptr[ 2 ] = ( byte )( 128 + 127 * n[ 2 ] );
2503-
ptr[ 3 ] = 255;
2504-
ptr += 4;
2505-
}
2506-
}
2507-
2508-
imageParams_t imageParams = {};
2509-
imageParams.bits = IF_NOPICMIP;
2510-
imageParams.filterType = filterType_t::FT_DEFAULT;
2511-
imageParams.wrapType = wrapTypeEnum_t::WT_REPEAT;
2512-
2513-
tr.randomNormalsImage = R_CreateImage( "_randomNormals", ( const byte ** ) &dataPtr, DEFAULT_SIZE, DEFAULT_SIZE, 1, imageParams );
2514-
}
2515-
25162477
static void R_CreateContrastRenderFBOImage()
25172478
{
25182479
if ( !glConfig2.bloom)
@@ -2749,12 +2710,10 @@ R_CreateBuiltinImages
27492710
*/
27502711
void R_CreateBuiltinImages()
27512712
{
2752-
int x, y;
2713+
int x;
27532714
byte data[ DEFAULT_SIZE ][ DEFAULT_SIZE ][ 4 ];
27542715
byte *dataPtr = &data[0][0][0];
27552716
byte *out;
2756-
float s, value;
2757-
byte intensity;
27582717

27592718
R_CreateDefaultImage();
27602719

@@ -2819,30 +2778,6 @@ void R_CreateBuiltinImages()
28192778
image = R_CreateImage( "_cinematic", ( const byte ** ) &dataPtr, 1, 1, 1, imageParams );
28202779
}
28212780

2822-
out = &data[ 0 ][ 0 ][ 0 ];
2823-
2824-
for ( y = 0; y < DEFAULT_SIZE; y++ )
2825-
{
2826-
for ( x = 0; x < DEFAULT_SIZE; x++, out += 4 )
2827-
{
2828-
s = ( ( ( float ) x + 0.5f ) * ( 2.0f / DEFAULT_SIZE ) - 1.0f );
2829-
2830-
s = Q_fabs( s ) - ( 1.0f / DEFAULT_SIZE );
2831-
2832-
value = 1.0f - ( s * 2.0f ) + ( s * s );
2833-
2834-
intensity = ClampByte( Q_ftol( value * 255.0f ) );
2835-
2836-
out[ 0 ] = intensity;
2837-
out[ 1 ] = intensity;
2838-
out[ 2 ] = intensity;
2839-
out[ 3 ] = intensity;
2840-
}
2841-
}
2842-
2843-
tr.quadraticImage = R_CreateImage( "_quadratic", ( const byte ** ) &dataPtr, DEFAULT_SIZE, DEFAULT_SIZE, 1, imageParams );
2844-
2845-
R_CreateRandomNormalsImage();
28462781
R_CreateFogImage();
28472782
R_CreateContrastRenderFBOImage();
28482783
R_CreateBloomRenderFBOImages();

src/engine/renderer/tr_local.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2534,14 +2534,12 @@ enum class ssaoMode {
25342534
image_t *defaultImage;
25352535
image_t *cinematicImage[ MAX_IN_GAME_VIDEOS ];
25362536
image_t *fogImage;
2537-
image_t *quadraticImage;
25382537
image_t *whiteImage; // full of 0xff
25392538
image_t *blackImage; // full of 0x0
25402539
image_t *redImage;
25412540
image_t *greenImage;
25422541
image_t *blueImage;
25432542
image_t *flatImage; // use this as default normalmap
2544-
image_t *randomNormalsImage;
25452543
image_t *blackCubeImage;
25462544
image_t *whiteCubeImage;
25472545

0 commit comments

Comments
 (0)