Skip to content

Commit 685a059

Browse files
committed
tr_image: add a comment saying the current fog image implementation in linear pipeline is a hack
1 parent 48b6684 commit 685a059

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/engine/renderer/tr_image.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2448,6 +2448,13 @@ static void R_CreateFogImage()
24482448

24492449
tr.fogImageNaive = R_CreateImage( "_fogNaive", ( const byte ** ) &data, FOG_S, FOG_T, 1, imageParams );
24502450

2451+
/* HACK: The previous fog image generator was calibrated for the
2452+
naive pipeline that was unaware of colorspaces. We need a new fog
2453+
image generator calibrated for the linear pipeline. It happens that
2454+
applying an sRGB-to-linear conversion of the alpha channel luckily
2455+
produces some good-enough results, and since we optimize the alpha
2456+
channel by storing it in a red-only image, this is very cheap to do.
2457+
A non-hacky implementation is welcome. */
24512458
imageParams.bits = IF_NOPICMIP | IF_SRGB;
24522459
imageParams.bits |= glConfig2.textureSrgbR8Available ? IF_RED : 0;
24532460

0 commit comments

Comments
 (0)