Use TONE_MAPPING_ACES constant for CC_TONE_MAPPING_TYPE check, skip ACESToneMap in linear mode. (#196)

This commit is contained in:
徐兵
2026-07-20 14:13:02 +08:00
committed by GitHub
parent 187387b03f
commit 2d2bbe6731
5 changed files with 14 additions and 6 deletions
@@ -10,7 +10,7 @@ vec3 HDRToLDR(vec3 color)
#endif
{
// linear exposure has already applied to light intensity
#if CC_TONE_MAPPING_TYPE == HDR_TONE_MAPPING_ACES
#if CC_TONE_MAPPING_TYPE == TONE_MAPPING_ACES
color.rgb = ACESToneMap(color.rgb);
#endif
}
@@ -79,8 +79,12 @@ vec4 saturate(vec4 value) { return clamp(value, vec4(0.0), vec4(1.0)); }
#define IS_RANGED_DIRECTIONAL_LIGHT(light_type) equalf_lowp(light_type, LIGHT_TYPE_RANGED_DIRECTIONAL)
// CC_TONE_MAPPING_TYPE Values
#define TONE_MAPPING_ACES 0
#define TONE_MAPPING_LINEAR 1
#ifndef TONE_MAPPING_ACES
#define TONE_MAPPING_ACES 0
#endif
#ifndef TONE_MAPPING_LINEAR
#define TONE_MAPPING_LINEAR 1
#endif
// Material
#define SURFACES_MAX_TRANSMIT_DEPTH_VALUE 999999.0
@@ -7,7 +7,7 @@ vec4 CCFragOutput (vec4 color) {
#if CC_USE_RGBE_OUTPUT
color = packRGBE(color.rgb);
#elif !CC_USE_FLOAT_OUTPUT
#if CC_USE_HDR && CC_TONE_MAPPING_TYPE == HDR_TONE_MAPPING_ACES
#if CC_USE_HDR && CC_TONE_MAPPING_TYPE == TONE_MAPPING_ACES
color.rgb = ACESToneMap(color.rgb);
#endif
color.rgb = LinearToSRGB(color.rgb);
+3 -1
View File
@@ -70,7 +70,9 @@ CCProgram smaa-edge-fs %{
vec3 ToLDR(vec3 color) {
#if CC_USE_HDR
color *= cc_exposure.x * FP_SCALE_INV;
color = ACESToneMap(color);
#if CC_TONE_MAPPING_TYPE == TONE_MAPPING_ACES
color = ACESToneMap(color);
#endif
color = LinearToSRGB(color);
#endif
return color;
@@ -55,7 +55,9 @@ CCProgram tonemap-fs %{
vec3 ToLDR(vec3 color) {
#if CC_USE_HDR
color *= cc_exposure.x * FP_SCALE_INV;
color = ACESToneMap(color);
#if CC_TONE_MAPPING_TYPE == TONE_MAPPING_ACES
color = ACESToneMap(color);
#endif
color = LinearToSRGB(color);
#endif
return color;