chloengine

chloengine

A real-time rendering engine, documented from first principles

Rendering Pipeline

Vertex Input
Vertex Shader
Rasterizer
Fragment Shader
Frame Buffer

Vertices

The fundamental building blocks of 3D geometry. Each vertex stores position, color, normal, and texture coordinate data in tightly-packed buffer arrays.

1struct Vertex {
2 position: vec3,
3 normal: vec3,
4 uv: vec2,
5 color: vec4,
6}

Shaders

Programmable GPU stages that transform vertices and compute per-fragment color values. The engine supports vertex, fragment, and compute shader programs.

1fn main() {
2 let uv = fragCoord / res;
3 color = mix(a, b, uv.x);
4}

Buffers

Contiguous memory regions on the GPU that store vertex data, index lists, and uniform parameters. Buffer management is central to engine performance.

1let vbo = createBuffer(
2 ARRAY_BUFFER,
3 vertices.byteLength,
4 STATIC_DRAW
5);

Frames

The final output of the rendering pipeline: a complete image composited from all draw calls, post-processing passes, and depth-tested fragment operations.

1fn render(scene, cam) {
2 clear(DEPTH | COLOR);
3 draw(scene.meshes);
4 present(framebuffer);
5}

Live Demo

Interactive wireframe rendering. The cube rotates in real-time using the engine's transformation pipeline.

Getting Started

Installation, configuration, and your first triangle.

API Reference

Complete function reference for all engine modules.

Examples

Annotated demos from basic meshes to deferred shading.

Source Code

Browse the engine source with inline documentation.