mirror of
https://github.com/Rezmason/matrix.git
synced 2026-04-21 07:19:30 -07:00
Component now reuses its canvas. regl implementation reuses its regl instance, and caches resources that already loaded.
This commit is contained in:
@@ -37,7 +37,7 @@ const blVert = [1, 0];
|
||||
const brVert = [1, 1];
|
||||
const quadVertices = [tlVert, trVert, brVert, tlVert, brVert, blVert];
|
||||
|
||||
export default ({ regl, config, lkg }) => {
|
||||
export default ({ regl, cache, config, lkg }) => {
|
||||
// The volumetric mode multiplies the number of columns
|
||||
// to reach the desired density, and then overlaps them
|
||||
const volumetric = config.volumetric;
|
||||
@@ -157,10 +157,10 @@ export default ({ regl, config, lkg }) => {
|
||||
);
|
||||
|
||||
// We render the code into an FBO using MSDFs: https://github.com/Chlumsky/msdfgen
|
||||
const glyphMSDF = loadImage(regl, config.glyphMSDFURL);
|
||||
const glintMSDF = loadImage(regl, config.glintMSDFURL);
|
||||
const baseTexture = loadImage(regl, config.baseTextureURL, true);
|
||||
const glintTexture = loadImage(regl, config.glintTextureURL, true);
|
||||
const glyphMSDF = loadImage(cache, regl, config.glyphMSDFURL);
|
||||
const glintMSDF = loadImage(cache, regl, config.glintMSDFURL);
|
||||
const baseTexture = loadImage(cache, regl, config.baseTextureURL, true);
|
||||
const glintTexture = loadImage(cache, regl, config.glintTextureURL, true);
|
||||
const output = makePassFBO(regl, config.useHalfFloat);
|
||||
const renderUniforms = {
|
||||
...commonUniforms,
|
||||
|
||||
Reference in New Issue
Block a user