Improved the opacity shader.

This commit is contained in:
Leon Styhre 2020-09-13 09:57:00 +02:00
parent a34bc45e56
commit d1adb313e6

View file

@ -28,9 +28,8 @@ varying vec2 vTexCoord;
void main() void main()
{ {
vec4 color = texture2D(myTexture, vTexCoord); vec4 color = texture2D(myTexture, vTexCoord);
float alpha = clamp(color.a-(1-opacity), 0.0, 1.0);
gl_FragColor = vec4(color.rgb, alpha); gl_FragColor = vec4(color.rgb, color.a * opacity);
} }
#endif #endif