mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-19 14:52:40 +08:00
Use TONE_MAPPING_ACES constant for CC_TONE_MAPPING_TYPE check, skip ACESToneMap in linear mode. (#196)
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user