Skip to content

Commit

Permalink
Texture filtering on/off cvar
Browse files Browse the repository at this point in the history
  • Loading branch information
vs-shirokii committed Dec 24, 2023
1 parent 34356e2 commit 828c65d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/common/rendering/rt/rt_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ namespace cvar
RT_CVAR( rt_emis_mapboost, 200.f, "indirect illumination emissiveness" )
RT_CVAR( rt_emis_maxscrcolor, 10.f, "burn on-screen emissive colors" )
RT_CVAR( rt_emis_additive_dflt, 0.5f, "emission value for objects with additive blending" )
RT_CVAR( rt_smoothtextures, false, "enable linear texture filtering" )

RT_CVAR( rt_tnmp_ev100_min, 2.f, "min brightness for auto-exposure" )
RT_CVAR( rt_tnmp_ev100_max, 7.7f, "max brightness for auto-exposure" )
Expand Down Expand Up @@ -736,7 +737,7 @@ class RTHardwareTexture : public IHardwareTexture
.pPixels = texbuffer.mBuffer,
.size = { static_cast< uint32_t >( texbuffer.mWidth ),
static_cast< uint32_t >( texbuffer.mHeight ) },
.filter = RG_SAMPLER_FILTER_NEAREST,
.filter = RG_SAMPLER_FILTER_AUTO,
.addressModeU = RG_SAMPLER_ADDRESS_MODE_REPEAT, // rtclamp_x( clampmode ),
.addressModeV = RG_SAMPLER_ADDRESS_MODE_REPEAT, // rtclamp_y( clampmode ),
};
Expand Down Expand Up @@ -2250,9 +2251,10 @@ void RTFrameBuffer::RT_DrawFrame()
};

auto texture_params = RgDrawFrameTexturesParams{
.sType = RG_STRUCTURE_TYPE_DRAW_FRAME_TEXTURES_PARAMS,
.pNext = &volumetrics_params,
.dynamicSamplerFilter = RG_SAMPLER_FILTER_NEAREST,
.sType = RG_STRUCTURE_TYPE_DRAW_FRAME_TEXTURES_PARAMS,
.pNext = &volumetrics_params,
.dynamicSamplerFilter =
cvar::rt_smoothtextures ? RG_SAMPLER_FILTER_LINEAR : RG_SAMPLER_FILTER_NEAREST,
.normalMapStrength = cvar::rt_normalmap_stren,
.emissionMapBoost = cvar::rt_emis_mapboost,
.emissionMaxScreenColor = cvar::rt_emis_maxscrcolor,
Expand Down

0 comments on commit 828c65d

Please sign in to comment.