Glyphs now blend additively, and the renderer's output buffer is cleared before it's drawn to.

This commit is contained in:
Rezmason
2021-09-03 22:59:35 -07:00
parent 4e2c18d375
commit e570af5bc8

View File

@@ -277,6 +277,15 @@ export default (regl, config) => {
// We render the code into an FBO using MSDFs: https://github.com/Chlumsky/msdfgen
const render = regl({
blend: {
enable: true,
func: {
srcRGB: "src alpha",
srcAlpha: 1,
dstRGB: "dst alpha",
dstAlpha: 1
}
},
vert: `
precision lowp float;
attribute vec2 aPosition, aCorner;
@@ -394,6 +403,11 @@ export default (regl, config) => {
},
resources => {
update();
regl.clear({
depth: 1,
color: [0, 0, 0, 1],
framebuffer: output
});
render(resources);
},
null,