mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 01:12:48 +02:00
correct order of mixes
This commit is contained in:
parent
fb3cdabd87
commit
8431b3b0c1
9 changed files with 13 additions and 13 deletions
|
@ -18,8 +18,8 @@
|
|||
|
||||
float color_scalar_sRGBToLinear(float value) {
|
||||
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) {
|
||||
|
|
|
@ -29,7 +29,7 @@ layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
|
|||
|
||||
void main(void) {
|
||||
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;
|
||||
|
||||
packDeferredFragment(
|
||||
|
|
|
@ -41,9 +41,9 @@ void main(void) {
|
|||
applyFade(fadeParams, _positionWS.xyz, fadeEmissive);
|
||||
|
||||
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.a = abs(_color.a);
|
||||
texel.a *= abs(_color.a);
|
||||
|
||||
const float ALPHA_THRESHOLD = 0.999;
|
||||
if (texel.a < ALPHA_THRESHOLD) {
|
||||
|
|
|
@ -29,9 +29,9 @@ layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
|
|||
|
||||
void main(void) {
|
||||
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.a = abs(_color.a);
|
||||
texel.a *= abs(_color.a);
|
||||
|
||||
const float ALPHA_THRESHOLD = 0.999;
|
||||
if (texel.a < ALPHA_THRESHOLD) {
|
||||
|
|
|
@ -41,9 +41,9 @@ void main(void) {
|
|||
applyFade(fadeParams, _positionWS.xyz, fadeEmissive);
|
||||
|
||||
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.a = abs(_color.a);
|
||||
texel.a *= abs(_color.a);
|
||||
|
||||
const float ALPHA_THRESHOLD = 0.999;
|
||||
if (texel.a < ALPHA_THRESHOLD) {
|
||||
|
|
|
@ -29,7 +29,7 @@ layout(location=RENDER_UTILS_ATTR_TEXCOORD01) in vec4 _texCoord01;
|
|||
|
||||
void main(void) {
|
||||
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.a *= abs(_color.a);
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ void main(void) {
|
|||
applyFade(fadeParams, _positionWS.xyz, fadeEmissive);
|
||||
|
||||
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.a *= abs(_color.a);
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ layout(location=0) out vec4 _fragColor0;
|
|||
|
||||
void main(void) {
|
||||
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.a *= abs(_color.a);
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ void main(void) {
|
|||
applyFade(fadeParams, _positionWS.xyz, fadeEmissive);
|
||||
|
||||
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.a *= abs(_color.a);
|
||||
|
||||
|
|
Loading…
Reference in a new issue