mirror of
https://github.com/overte-org/overte.git
synced 2025-07-15 23:36:39 +02:00
Merge pull request #14548 from SamGondelman/mirrorFix
Case 19473 (#2): Fix Mirror tonemapping
This commit is contained in:
commit
69876bdec2
9 changed files with 13 additions and 13 deletions
|
@ -18,8 +18,8 @@
|
||||||
|
|
||||||
float color_scalar_sRGBToLinear(float value) {
|
float color_scalar_sRGBToLinear(float value) {
|
||||||
const float SRGB_ELBOW = 0.04045;
|
const float SRGB_ELBOW = 0.04045;
|
||||||
|
|
||||||
return (value <= SRGB_ELBOW) ? value / 12.92 : pow((value + 0.055) / 1.055, 2.4);
|
return mix(pow((value + 0.055) / 1.055, 2.4), value / 12.92, float(value <= SRGB_ELBOW));
|
||||||
}
|
}
|
||||||
|
|
||||||
vec3 color_sRGBToLinear(vec3 srgb) {
|
vec3 color_sRGBToLinear(vec3 srgb) {
|
||||||
|
|
|
@ -29,7 +29,7 @@ layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
|
||||||
|
|
||||||
void main(void) {
|
void main(void) {
|
||||||
vec4 texel = texture(originalTexture, _texCoord0);
|
vec4 texel = texture(originalTexture, _texCoord0);
|
||||||
texel = mix(color_sRGBAToLinear(texel), texel, float(_color.a <= 0.0));
|
texel = mix(texel, color_sRGBAToLinear(texel), float(_color.a <= 0.0));
|
||||||
texel.rgb *= _color.rgb;
|
texel.rgb *= _color.rgb;
|
||||||
|
|
||||||
packDeferredFragment(
|
packDeferredFragment(
|
||||||
|
|
|
@ -41,9 +41,9 @@ void main(void) {
|
||||||
applyFade(fadeParams, _positionWS.xyz, fadeEmissive);
|
applyFade(fadeParams, _positionWS.xyz, fadeEmissive);
|
||||||
|
|
||||||
vec4 texel = texture(originalTexture, _texCoord0);
|
vec4 texel = texture(originalTexture, _texCoord0);
|
||||||
texel = mix(color_sRGBAToLinear(texel), texel, float(_color.a <= 0.0));
|
texel = mix(texel, color_sRGBAToLinear(texel), float(_color.a <= 0.0));
|
||||||
texel.rgb *= _color.rgb;
|
texel.rgb *= _color.rgb;
|
||||||
texel.a = abs(_color.a);
|
texel.a *= abs(_color.a);
|
||||||
|
|
||||||
const float ALPHA_THRESHOLD = 0.999;
|
const float ALPHA_THRESHOLD = 0.999;
|
||||||
if (texel.a < ALPHA_THRESHOLD) {
|
if (texel.a < ALPHA_THRESHOLD) {
|
||||||
|
|
|
@ -29,9 +29,9 @@ layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
|
||||||
|
|
||||||
void main(void) {
|
void main(void) {
|
||||||
vec4 texel = texture(originalTexture, _texCoord0);
|
vec4 texel = texture(originalTexture, _texCoord0);
|
||||||
texel = mix(color_sRGBAToLinear(texel), texel, float(_color.a <= 0.0));
|
texel = mix(texel, color_sRGBAToLinear(texel), float(_color.a <= 0.0));
|
||||||
texel.rgb *= _color.rgb;
|
texel.rgb *= _color.rgb;
|
||||||
texel.a = abs(_color.a);
|
texel.a *= abs(_color.a);
|
||||||
|
|
||||||
const float ALPHA_THRESHOLD = 0.999;
|
const float ALPHA_THRESHOLD = 0.999;
|
||||||
if (texel.a < ALPHA_THRESHOLD) {
|
if (texel.a < ALPHA_THRESHOLD) {
|
||||||
|
|
|
@ -41,9 +41,9 @@ void main(void) {
|
||||||
applyFade(fadeParams, _positionWS.xyz, fadeEmissive);
|
applyFade(fadeParams, _positionWS.xyz, fadeEmissive);
|
||||||
|
|
||||||
vec4 texel = texture(originalTexture, _texCoord0);
|
vec4 texel = texture(originalTexture, _texCoord0);
|
||||||
texel = mix(color_sRGBAToLinear(texel), texel, float(_color.a <= 0.0));
|
texel = mix(texel, color_sRGBAToLinear(texel), float(_color.a <= 0.0));
|
||||||
texel.rgb *= _color.rgb;
|
texel.rgb *= _color.rgb;
|
||||||
texel.a = abs(_color.a);
|
texel.a *= abs(_color.a);
|
||||||
|
|
||||||
const float ALPHA_THRESHOLD = 0.999;
|
const float ALPHA_THRESHOLD = 0.999;
|
||||||
if (texel.a < ALPHA_THRESHOLD) {
|
if (texel.a < ALPHA_THRESHOLD) {
|
||||||
|
|
|
@ -29,7 +29,7 @@ layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
|
||||||
|
|
||||||
void main(void) {
|
void main(void) {
|
||||||
vec4 texel = texture(originalTexture, _texCoord0);
|
vec4 texel = texture(originalTexture, _texCoord0);
|
||||||
texel = mix(color_sRGBAToLinear(texel), texel, float(_color.a <= 0.0));
|
texel = mix(texel, color_sRGBAToLinear(texel), float(_color.a <= 0.0));
|
||||||
texel.rgb *= _color.rgb;
|
texel.rgb *= _color.rgb;
|
||||||
texel.a *= abs(_color.a);
|
texel.a *= abs(_color.a);
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ void main(void) {
|
||||||
applyFade(fadeParams, _positionWS.xyz, fadeEmissive);
|
applyFade(fadeParams, _positionWS.xyz, fadeEmissive);
|
||||||
|
|
||||||
vec4 texel = texture(originalTexture, _texCoord0);
|
vec4 texel = texture(originalTexture, _texCoord0);
|
||||||
texel = mix(color_sRGBAToLinear(texel), texel, float(_color.a <= 0.0));
|
texel = mix(texel, color_sRGBAToLinear(texel), float(_color.a <= 0.0));
|
||||||
texel.rgb *= _color.rgb;
|
texel.rgb *= _color.rgb;
|
||||||
texel.a *= abs(_color.a);
|
texel.a *= abs(_color.a);
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ layout(location=0) out vec4 _fragColor0;
|
||||||
|
|
||||||
void main(void) {
|
void main(void) {
|
||||||
vec4 texel = texture(originalTexture, _texCoord0);
|
vec4 texel = texture(originalTexture, _texCoord0);
|
||||||
texel = mix(color_sRGBAToLinear(texel), texel, float(_color.a <= 0.0));
|
texel = mix(texel, color_sRGBAToLinear(texel), float(_color.a <= 0.0));
|
||||||
texel.rgb *= _color.rgb;
|
texel.rgb *= _color.rgb;
|
||||||
texel.a *= abs(_color.a);
|
texel.a *= abs(_color.a);
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ void main(void) {
|
||||||
applyFade(fadeParams, _positionWS.xyz, fadeEmissive);
|
applyFade(fadeParams, _positionWS.xyz, fadeEmissive);
|
||||||
|
|
||||||
vec4 texel = texture(originalTexture, _texCoord0);
|
vec4 texel = texture(originalTexture, _texCoord0);
|
||||||
texel = mix(color_sRGBAToLinear(texel), texel, float(_color.a <= 0.0));
|
texel = mix(texel, color_sRGBAToLinear(texel), float(_color.a <= 0.0));
|
||||||
texel.rgb *= _color.rgb;
|
texel.rgb *= _color.rgb;
|
||||||
texel.a *= abs(_color.a);
|
texel.a *= abs(_color.a);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue