WebGL gl_FragColor alpha behave differently in Chrome with Firefox
问题 Code below draws three triangles alpha value 0.5 with {premultipliedAlpha: false} . const gl = document.querySelector('canvas').getContext('webgl', {premultipliedAlpha: false}); const canvasWidthHeight = 300; gl.clearColor(1, 0, 0, 0.4); // gl.clear(gl.COLOR_BUFFER_BIT); const vertexShaderSource = ` attribute vec2 position; uniform vec2 resolution; // All shaders have a main function void main() { vec2 glSpacePosition = (position / resolution) * 2.0 - 1.0; gl_Position = vec4(glSpacePosition *