Skip to content

Commit 89025ea

Browse files
committed
tr_image: store the fogNaive image as GL_RED, and fogLinear as GL_SR8_ET when available
1 parent 2bc9ae2 commit 89025ea

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

src/engine/renderer/tr_image.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2442,18 +2442,15 @@ static void R_CreateFogImage()
24422442
// the border color at the edges. OpenGL 1.2 has clamp-to-edge, which does
24432443
// what we want.
24442444
imageParams_t imageParams = {};
2445-
imageParams.bits = IF_NOPICMIP;
2445+
imageParams.bits = IF_NOPICMIP | IF_RED;
24462446
imageParams.filterType = filterType_t::FT_DEFAULT;
24472447
imageParams.wrapType = wrapTypeEnum_t::WT_CLAMP;
24482448

2449-
if ( glConfig2.textureSrgbR8Available )
2450-
{
2451-
imageParams.bits |= IF_RED;
2452-
}
2453-
24542449
tr.fogImageNaive = R_CreateImage( "_fogNaive", ( const byte ** ) &data, FOG_S, FOG_T, 1, imageParams );
24552450

2456-
imageParams.bits |= IF_SRGB;
2451+
imageParams.bits = IF_NOPICMIP | IF_SRGB;
2452+
imageParams.bits |= glConfig2.textureSrgbR8Available ? IF_RED : 0;
2453+
24572454
tr.fogImageLinear = R_CreateImage( "_fogLinear", ( const byte ** ) &data, FOG_S, FOG_T, 1, imageParams );
24582455

24592456
ri.Hunk_FreeTempMemory( data );

src/engine/renderer/tr_local.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,7 @@ enum class ssaoMode {
476476
IF_DEPTH32 = BIT( 11 ),
477477
IF_PACKED_DEPTH24_STENCIL8 = BIT( 12 ),
478478
IF_LIGHTMAP = BIT( 13 ),
479+
IF_RED = BIT( 14 ),
479480
IF_RGBE = BIT( 15 ),
480481
IF_ALPHATEST = BIT( 16 ), // FIXME: this is unused
481482
IF_ALPHA = BIT( 17 ),

0 commit comments

Comments
 (0)