Skip to content

Commit

Permalink
fix(ColorLayer): wrong white to opacity effect.
Browse files Browse the repository at this point in the history
  • Loading branch information
gchoqueux committed Jan 11, 2021
1 parent 7fcbb3a commit 9666822
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Renderer/Shader/Chunk/color_layers_pars_fragment.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@ float getBorderDistance(vec2 uv) {
return min(p2.x, p2.y);
}

float tolerance = 0.99;

vec4 applyWhiteToInvisibleEffect(vec4 color, float intensity) {
float a = dot(color.rgb, vec3(0.333333333));
color.a *= 1.0 - pow(abs(a), intensity);
if (a >= tolerance) {
color.a *= 1.0 - pow(abs(a), intensity);
}
return color;
}

Expand Down

0 comments on commit 9666822

Please sign in to comment.