Webgl / clarify premultiplied alpha handling

By default, alpha premultiplying should be done by the initial rendering
(eg quads) and not the final post processing pass.

The default post processing pass expects premultiplied color values and
will not do this operation itself.
This commit is contained in:
Olivier Guyot
2019-04-02 22:12:45 +02:00
parent b955579a9c
commit c6a859d1ed
3 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -238,7 +238,7 @@ class Heatmap extends VectorLayer {
float sqRadius = texCoord.x * texCoord.x + texCoord.y * texCoord.y;
float value = (1.0 - sqrt(sqRadius)) * u_blurSlope;
float alpha = smoothstep(0.0, 1.0, value) * v_opacity;
gl_FragColor = vec4(1.0, 1.0, 1.0, alpha);
gl_FragColor = vec4(alpha, alpha, alpha, alpha);
}`,
uniforms: {
u_size: function() {