Skip to content

Plume Triangle

App: apps/plume_triangle/

The minimal graphics example: load a shader, create a single colored triangle mesh (LÖVE-style vertices [x, y, z, r, g, b, a]), and draw it each frame.

Terminal window
% ./plume3d plume_triangle

or

Terminal window
% ./../plume3d .
  • Graphics.loadShader("shaders/triangle") — loads the triangle shader.
  • Graphics.newMesh(vertices, "triangles", _shader) — three vertices (red, green, blue corners).
  • Graphics.drawMesh(_mesh) in draw().
  • GraphicsloadShader, useShader (implicit when passing shader to newMesh), newMesh, drawMesh.
  • Mesh — used as returned from newMesh.

Vertices are lists of 7 numbers: [x, y, z, r, g, b, a]. The demo uses a custom shader in shaders/ (see shaders/src/triangle.slang and compile.sh).