Merge pull request #330 from MajorPainTheCactus/megatron_4_4

V4.4 Sony Megatron Shader
This commit is contained in:
hizzlekizzle 2022-11-12 09:27:02 -06:00 committed by GitHub
commit f77f7b3e3c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View file

@ -74,7 +74,8 @@ vec3 WhiteBalance(float temperature, vec3 colour)
float r601ToLinear_1(const float channel) float r601ToLinear_1(const float channel)
{ {
//return (channel >= 0.081f) ? pow((channel + 0.099f) * (1.0f / 1.099f), (1.0f / 0.45f)) : channel * (1.0f / 4.5f); //return (channel >= 0.081f) ? pow((channel + 0.099f) * (1.0f / 1.099f), (1.0f / 0.45f)) : channel * (1.0f / 4.5f);
return (channel >= 0.081f) ? pow((channel + 0.099f) * (1.0f / 1.099f), HCRT_GAMMA_IN) : channel * (1.0f / 4.5f); //return (channel >= 0.081f) ? pow((channel + 0.099f) * (1.0f / 1.099f), HCRT_GAMMA_IN) : channel * (1.0f / 4.5f);
return pow((channel + 0.099f) * (1.0f / 1.099f), HCRT_GAMMA_IN);
} }
vec3 r601ToLinear(const vec3 colour) vec3 r601ToLinear(const vec3 colour)
@ -86,7 +87,8 @@ vec3 r601ToLinear(const vec3 colour)
float r709ToLinear_1(const float channel) float r709ToLinear_1(const float channel)
{ {
//return (channel >= 0.081f) ? pow((channel + 0.099f) * (1.0f / 1.099f), (1.0f / 0.45f)) : channel * (1.0f / 4.5f); //return (channel >= 0.081f) ? pow((channel + 0.099f) * (1.0f / 1.099f), (1.0f / 0.45f)) : channel * (1.0f / 4.5f);
return (channel >= 0.081f) ? pow((channel + 0.099f) * (1.0f / 1.099f), HCRT_GAMMA_IN) : channel * (1.0f / 4.5f); //return (channel >= 0.081f) ? pow((channel + 0.099f) * (1.0f / 1.099f), HCRT_GAMMA_IN) : channel * (1.0f / 4.5f);
return pow((channel + 0.099f) * (1.0f / 1.099f), HCRT_GAMMA_IN);
} }
vec3 r709ToLinear(const vec3 colour) vec3 r709ToLinear(const vec3 colour)

View file

@ -14,7 +14,8 @@ const mat3 kXYZ_to_DCIP3 = mat3 (
float LinearTosRGB_1(const float channel) float LinearTosRGB_1(const float channel)
{ {
return (channel > 0.0031308f) ? (1.055f * pow(channel, 1.0f / HCRT_GAMMA_OUT)) - 0.055f : channel * 12.92f; //return (channel > 0.0031308f) ? (1.055f * pow(channel, 1.0f / HCRT_GAMMA_OUT)) - 0.055f : channel * 12.92f;
return (1.055f * pow(channel, 1.0f / HCRT_GAMMA_OUT)) - 0.055f;
} }
vec3 LinearTosRGB(const vec3 colour) vec3 LinearTosRGB(const vec3 colour)
@ -24,7 +25,8 @@ vec3 LinearTosRGB(const vec3 colour)
float LinearTo709_1(const float channel) float LinearTo709_1(const float channel)
{ {
return (channel >= 0.018f) ? pow(channel * 1.099f, 1.0f / (HCRT_GAMMA_OUT - 0.18f)) - 0.099f : channel * 4.5f; // Gamma: 2.4 - 0.18 = 2.22 //return (channel >= 0.018f) ? pow(channel * 1.099f, 1.0f / (HCRT_GAMMA_OUT - 0.18f)) - 0.099f : channel * 4.5f; // Gamma: 2.4 - 0.18 = 2.22
return pow(channel * 1.099f, 1.0f / (HCRT_GAMMA_OUT - 0.18f)) - 0.099f;
} }
vec3 LinearTo709(const vec3 colour) vec3 LinearTo709(const vec3 colour)