Creates a WebGL context without a window for headless rendering and server-side graphics
Overall
score
96%
Build a simple WebGL renderer that draws a triangle with per-vertex colors using headless rendering.
Create a module that sets up a WebGL context and renders a triangle where each vertex has both position and color data. The triangle should have:
The vertex data should be stored in a single buffer with interleaved position and color attributes. Each vertex should contain:
The module should:
@generates
/**
* Renders a colored triangle and returns the pixel data
* @returns {Uint8Array} RGBA pixel data (256x256x4 bytes)
*/
function renderColoredTriangle();
module.exports = { renderColoredTriangle };Provides headless WebGL context creation and rendering capabilities.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/npm-gldocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10