Skip to content

Commit

Permalink
tr_image: use half float when r_highPrecisionRendering is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
illwieckz committed May 30, 2024
1 parent df959f6 commit 9474dda
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/engine/renderer/tr_image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2439,7 +2439,9 @@ static void R_CreateDepthRenderImage()
imageParams_t imageParams = {};
imageParams.filterType = filterType_t::FT_NEAREST;
imageParams.wrapType = wrapTypeEnum_t::WT_CLAMP;
imageParams.bits = IF_NOPICMIP | IF_RGBA32F;

imageParams.bits = IF_NOPICMIP;
imageParams.bits |= r_highPrecisionRendering.Get() ? IF_RGBA32F : IF_RGBA16F;

tr.dlightImage = R_CreateImage("_dlightImage", nullptr, w, h, 4, imageParams );
}
Expand Down Expand Up @@ -2468,10 +2470,12 @@ static void R_CreateDepthRenderImage()
int h = (height + TILE_SIZE_STEP1 - 1) >> TILE_SHIFT_STEP1;

imageParams_t imageParams = {};
imageParams.bits = IF_NOPICMIP | IF_RGBA32F;
imageParams.filterType = filterType_t::FT_NEAREST;
imageParams.wrapType = wrapTypeEnum_t::WT_ONE_CLAMP;

imageParams.bits = IF_NOPICMIP;
imageParams.bits |= r_highPrecisionRendering.Get() ? IF_RGBA32F : IF_RGBA16F;

tr.depthtile1RenderImage = R_CreateImage( "_depthtile1Render", nullptr, w, h, 1, imageParams );

w = (width + TILE_SIZE - 1) >> TILE_SHIFT;
Expand Down

0 comments on commit 9474dda

Please sign in to comment.