Skip to content

Commit 7714ca5

Browse files
committed
Fix tonemapping enablement regression
1 parent 48b7b43 commit 7714ca5

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

src/engine/renderer/gl_shader.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,7 @@ struct addedExtension_t {
422422
static const std::vector<addedExtension_t> fragmentVertexAddedExtensions = {
423423
{ glConfig2.gpuShader4Available, 130, "EXT_gpu_shader4" },
424424
{ glConfig2.gpuShader5Available, 400, "ARB_gpu_shader5" },
425+
{ glConfig2.textureFloatAvailable, 130, "ARB_texture_float" },
425426
{ glConfig2.textureGatherAvailable, 400, "ARB_texture_gather" },
426427
{ glConfig2.textureIntegerAvailable, 0, "EXT_texture_integer" },
427428
{ glConfig2.textureRGAvailable, 0, "ARB_texture_rg" },
@@ -869,6 +870,10 @@ static std::string GenEngineConstants() {
869870
AddDefine( str, "r_colorGrading", 1 );
870871
}
871872

873+
if ( r_highPrecisionRendering.Get() ) {
874+
AddDefine( str, "r_highPrecisionRendering", 1 );
875+
}
876+
872877
return str;
873878
}
874879

src/engine/renderer/glsl_source/cameraEffects_fp.glsl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ uniform sampler2D u_CurrentMap;
2828
uniform sampler3D u_ColorMap3D;
2929
#endif
3030

31-
uniform vec4 u_ColorModulate;
32-
uniform float u_GlobalLightFactor; // 1 / tr.identityLight
33-
uniform float u_InverseGamma;
31+
uniform vec4 u_ColorModulate;
32+
uniform float u_GlobalLightFactor; // 1 / tr.identityLight
33+
uniform float u_InverseGamma;
3434

3535
DECLARE_OUTPUT(vec4)
3636

@@ -60,7 +60,9 @@ void main()
6060
color *= u_GlobalLightFactor;
6161

6262
#if defined(r_highPrecisionRendering) && defined(HAVE_ARB_texture_float)
63-
color.rgb = TonemapLottes( color.rgb * u_TonemapExposure );
63+
if( u_Tonemap ) {
64+
color.rgb = TonemapLottes( color.rgb * u_TonemapExposure );
65+
}
6466
#endif
6567

6668
color.rgb = clamp( color.rgb, vec3( 0.0f ), vec3( 1.0f ) );

0 commit comments

Comments
 (0)