A modular WebGL2 rendering library built in JavaScript.
-
Rendering architecture
- Modular, plugin-driven rendering pipeline
- Multi-pass/view rendering support
- Render-time resource and state caching to reduce redundant GPU work
- Extensible shader include/define system
-
Scene and transforms
- Hierarchical scene graph for parent-child object relationships
- Local/world transform propagation
- Traversal utilities for update and render preparation flows
- Support for static and skinned scene objects
-
Geometry and mesh creation
- Ready-to-use procedural geometry builders:
- Plane
- Circle
- Cylinder
- Cuboid
- UV sphere
- Wireframe conversion
- Attribute-based mesh data model (positions, normals, UVs, tangents, skinning data)
- Flexible vertex/index data handling for custom mesh pipelines
- Ready-to-use procedural geometry builders:
-
Materials and shading
- Multiple built-in shading styles:
- Unlit/basic shading
- Lambert diffuse shading
- Phong shading
- Standard physically based shading
- Normal/depth debug shading
- Raw/custom shader paths
- Material properties for color, texture mapping, emissive, metallic and roughness workflows
- Shared shader code modules for common math, color and lighting logic
- Multiple built-in shading styles:
-
Lighting and shadows
- Supported light types:
- Ambient
- Directional
- Point
- Spot
- Shadow rendering support integrated into the render pipeline
- Lighting/material integration for lit and physically based workflows
- Supported light types:
-
Textures and sampling
- Multiple texture formats and usage patterns
- Sampler controls for filtering and wrapping behavior
-
Render targets and offscreen rendering
- Direct rendering to canvas
- Offscreen/image render target support
- Framebuffer-based workflows for multi-step rendering
- Foundations for post-process and texture-to-texture pipelines
-
Asset loading
- Built-in loaders for:
- Image textures
- OBJ models
- glTF scenes/assets
- Async loading with default placeholders while assets stream in
- Asset reuse and clone/copy loading strategies
- glTF material/texture/skeleton parsing paths
- Built-in loaders for:
-
Camera and interaction
- Perspective and orthographic camera projections
- Orbit-style interaction controls for inspection/navigation
- Camera-aware rendering integration through the plugin system
-
Math and low-level utilities
- Core math types and operations for:
- Vectors
- Quaternions
- Matrices/affine transforms
- Buffer/type conversion helpers for GPU upload workflows
- WebGL mapping helpers for vertex formats, attachments and texture formats
- Core math types and operations for:
Use this library if you want lower-level control than full game engines, but still want reusable rendering building blocks for WebGL2 projects.
- Node.js 18+
- npm
- A browser with WebGL2 support
npm installnpm run buildBuild output:
dist/index.umd.jsdist/index.module.js
npx vite .Then open:
http://localhost:5173/examples/index.html
- Create a
WebGLRenderDevicefrom a canvas. - Create a render target (
CanvasTargetorImageTarget). - Create a
WebGLRendererwith the plugins needed by your scene. - Build scene objects (meshes, lights, camera).
- Call
renderer.render(objects, renderDevice)each frame.