CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-gl

Creates a WebGL context without a window for headless rendering and server-side graphics

Overall
score

96%

Overview
Eval results
Files

task.mdevals/scenario-6/

WebGL Checkerboard Texture Generator

A utility that creates a WebGL rendering context and generates a checkerboard pattern texture using GPU texture operations.

Capabilities

Creates WebGL context

  • Creates a headless WebGL context with 256x256 dimensions @test

Generates checkerboard texture data

  • Generates an 8x8 checkerboard pattern with alternating black (0,0,0,255) and white (255,255,255,255) squares @test
  • Each square in the checkerboard is 32x32 pixels @test

Uploads texture to GPU

  • Creates a texture object and binds it to TEXTURE_2D @test
  • Uploads the 256x256 RGBA checkerboard data to the GPU using the appropriate texture upload method @test
  • Sets texture filtering to use nearest neighbor (no smoothing) @test

Validates texture upload

  • Reads back the uploaded texture data and verifies it matches the original checkerboard pattern @test

Implementation

@generates

API

/**
 * Creates a WebGL context and generates a checkerboard texture.
 *
 * @returns {Object} An object containing:
 *   - gl: The WebGL context
 *   - texture: The created texture object
 *   - data: The Uint8Array containing the checkerboard pattern (256x256 RGBA)
 */
function createCheckerboardTexture() {
  // IMPLEMENTATION HERE
}

module.exports = {
  createCheckerboardTexture
};

Dependencies { .dependencies }

gl { .dependency }

Provides headless WebGL context creation and rendering capabilities.

@satisfied-by

Install with Tessl CLI

npx tessl i tessl/npm-gl

tile.json