Pins and Curves Engine is an open-source 2D graphics framework designed to facilitate learning and prototyping. It simplifies GPU programming while maintaining essential GPU concepts, making it accessible for beginners and effective for professionals to quickly prototype graphics pipelines.
Pins and Curves Engine is an innovative open-source 2D graphics framework designed to simplify GPU programming while retaining the essential elements of its architecture. This framework serves as a bridge between the intricacies of WebGL and user-friendly high-level creative coding solutions, making it accessible for both beginners and professionals alike.
This project is currently in the early stages of development, having originated as the rendering engine for Pins and Curves, a motion design editor. Contributions during this formative period are welcomed and encourage a collaborative open-source approach. Interested participants can reach out at martin@pinsandcurves.app.
Here’s a brief coding example illustrating how to define a default triangle using the framework:
function defaultTriangle(height: number) {
const triangle = Vertices(
{
attributes: {
pos: 'vec2',
uv: 'vec2',
}
},
{
triangleCount: 1,
vertices: () => ([
{ pos: [-1,-1], uv: [0,0] },
{ pos: [0,height], uv: [0,1] },
{ pos: [1,-1], uv: [1,0] }
]),
indices: () => ([0, 1, 2,])
},
[height]
);
const outputTexture = Texture(
{
width: 1920,
height: 1080,
},
[
DrawOp(
triangle,
() => `
out vec2 v_uv;
void main() {
gl_Position = vec4(pos,0.,1.);
v_uv = uv;
}
`,
() => `
in vec2 v_uv;
void main() {
outColor = vec4(v_uv, 1.0, 1.0);
}`
)
],
[]
);
return { triangle, outputTexture };
}
gfx.update(defaultTriangle(1));
This code generates a triangle that can be visualized using linked rendering tools.
Explore practical examples of the framework by visiting the playground here.
In summary, the Pins and Curves Engine offers an exceptional opportunity for developers looking to enhance their graphics programming skills or prototype with ease, all while embracing a modern approach to 2D rendering on the web.
No comments yet.
Sign in to be the first to comment.