-
How do I start WebGL |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
This site has some infos https://get.webgl.org/ |
Beta Was this translation helpful? Give feedback.
-
Sorry, what I meant to say is how to render in Klecks using WebGL |
Beta Was this translation helpful? Give feedback.
-
Klecks does some WebGL drawing through glfx.js. You can see its usage in filters, e.g. let glCanvas = getSharedFx(); // get the glfx canvas (uses webgl)
let texture = glCanvas.texture(context.canvas); // turn current layer into a webgl texture
glCanvas.draw(texture).toAlpha(sourceId === 'inverted-luminance', selectedRgbaObj).update(); // apply toAlpha operation
// draw result back on layer
context.clearRect(0, 0, context.canvas.width, context.canvas.height);
context.drawImage(glCanvas, 0, 0);
texture.destroy(); // cleanup Glfx code lives in Atm, everything outside of filters is done via CanvasRenderingContext2D. |
Beta Was this translation helpful? Give feedback.
Klecks does some WebGL drawing through glfx.js. You can see its usage in filters, e.g.
src/app/script/klecks/filters/filter-to-alpha.ts
Glfx code lives in
src/app/script-vendor/glfx.ts
.Atm, everything outside of filters is done via CanvasRenderingContext2D.