mirror of
https://github.com/Rezmason/matrix.git
synced 2026-04-21 07:19:30 -07:00
Glyphs now blend additively, and the renderer's output buffer is cleared before it's drawn to.
This commit is contained in:
@@ -277,6 +277,15 @@ export default (regl, config) => {
|
|||||||
|
|
||||||
// We render the code into an FBO using MSDFs: https://github.com/Chlumsky/msdfgen
|
// We render the code into an FBO using MSDFs: https://github.com/Chlumsky/msdfgen
|
||||||
const render = regl({
|
const render = regl({
|
||||||
|
blend: {
|
||||||
|
enable: true,
|
||||||
|
func: {
|
||||||
|
srcRGB: "src alpha",
|
||||||
|
srcAlpha: 1,
|
||||||
|
dstRGB: "dst alpha",
|
||||||
|
dstAlpha: 1
|
||||||
|
}
|
||||||
|
},
|
||||||
vert: `
|
vert: `
|
||||||
precision lowp float;
|
precision lowp float;
|
||||||
attribute vec2 aPosition, aCorner;
|
attribute vec2 aPosition, aCorner;
|
||||||
@@ -394,6 +403,11 @@ export default (regl, config) => {
|
|||||||
},
|
},
|
||||||
resources => {
|
resources => {
|
||||||
update();
|
update();
|
||||||
|
regl.clear({
|
||||||
|
depth: 1,
|
||||||
|
color: [0, 0, 0, 1],
|
||||||
|
framebuffer: output
|
||||||
|
});
|
||||||
render(resources);
|
render(resources);
|
||||||
},
|
},
|
||||||
null,
|
null,
|
||||||
|
|||||||
Reference in New Issue
Block a user