[Botw] contrasty remove custom tone mapping

not mess with it before understanding what the original does
This commit is contained in:
NAVras-Z 2017-10-20 12:23:51 +08:00
parent b2b3bbbb83
commit fa2ff586bd

View File

@ -6,9 +6,6 @@
//----------------------------settings-------------------------------------
#define tone_mapping 0
//0 is game original, 1 is ACES Filmic, 2 is from SweetFX, -1 disable (not recommended).
#define only_adjustbloom 0
//0 false, 1 true: all features except 'adjustable bloom' in contrasty will be disabled. -1 disable all of the contrasty.
@ -86,7 +83,6 @@ R126f.z = fColour.z;
PV0f.xyz = fColour;
#endif
#if (tone_mapping == 0)
// 1
tempf.x = dot(vec4(PV0f.x,PV0f.y,PV0f.z,-0.0),vec4(intBitsToFloat(0x3e99096c),intBitsToFloat(0x3f162b6b),intBitsToFloat(0x3dea4a8c),0.0));
PV1f.x = tempf.x;
@ -170,38 +166,6 @@ PV1f.w = R123f.w;
R0f.x = (mul_nonIEEE(R126f.x,R125f.w) + PV1f.w);
R0f.y = (mul_nonIEEE(R126f.x,R127f.z) + PV1f.w);
R0f.z = (mul_nonIEEE(R126f.x,R126f.y) + PV1f.w);
#endif
#if (tone_mapping == 1)
R0f.xyz = PV0f.xyz * intBitsToFloat(0x3f2aaaab);
R0f.xyz = (R0f.xyz*(2.51*R0f.xyz+0.03))/(R0f.xyz*(2.43*R0f.xyz+0.59)+0.14);
R0f.xyz = clamp(R0f.xyz,0.0,1.0);
#endif
#if (tone_mapping == 2)
//dummy
const float Saturation = 0.00; // [-1.0 ~ 1.0] Saturates Colors
const float Bleach = 0.0;
vec3 color = PV0f.xyz;
color *= intBitsToFloat(0x3f2aaaab); // Exposure
const vec3 coefLuma = vec3(intBitsToFloat(0x3e99096c),intBitsToFloat(0x3f162b6b),intBitsToFloat(0x3dea4a8c));
float lum = dot(coefLuma, color);
float L = clamp(10.0 * (lum - 0.45), 0.0, 1.0);
vec3 A2 = Bleach * color;
vec3 result1 = 2.0f * color * lum;
vec3 result2 = 1.0f - 2.0f * (1.0f - lum) * (1.0f - color);
vec3 newColor = mix(result1, result2, L);
vec3 mixRGB = A2 * newColor;
color += ((1.0f - A2) * mixRGB);
vec3 middlegray = vec3(dot(color, vec3(1.0 / 3.0)));
vec3 diffcolor = color - middlegray;
R0f.xyz = (color + diffcolor * Saturation) / (1 + (diffcolor * Saturation)); // Saturation
#endif
// export
passPixelColor0 = vec4(R0f.x, R0f.y, R0f.z, R0f.w);