Kansei engine
Examples
Small scenes made with Kansei. Each one needs a browser with WebGPU. Every row is one example; its buttons open the builds of it that exist. TS runs the TypeScript engine, whose pages are in examples/. WASM runs Kansei's Rust core compiled to WebAssembly, the engine's active line, from rust/kansei-wasm/examples and demos; most take the URL parameters listed in their READMEs. Where both exist they show the same scene unless the row says otherwise. Dashed buttons open a variant: other parameters or a sibling page.
This server has no Rust/WASM builds (they come with the site build, pnpm bundle-examples, or a local
scripts/build-wasm-examples.sh), so their buttons open kansei.graphics.
Rendering
- Hello scene The smallest complete scene: a floor, a spinning box and a sphere in the stock lit material, a sun and two point lights, shadows and an orbit camera TS WASM
- Instancing A clone of square.felixmartinez.dev: a ball ploughs through a carpet of 16 384 cubes in one draw call, a compute shader moving each cube in the instance buffer it is drawn from TS WASM
- Flowing cubes A swarm of textured cubes flowing on nested trigonometry, through SSAO, god rays and depth of field TS
- Compute particles 300 000 particles moved by a compute shader and pushed around by the mouse TS
Lighting and shadows
- Cascaded shadows 4 000 instanced trees under a low sun, shadowed by four 2048² cascades with contact-hardening penumbrae, culled per cascade on the GPU TS WASM
- Spot lights A car's headlights in a night forest: photometric spot lights with contact-hardening shadows from an atlas, shaded through clustered light lists and scattered in the fog TS WASM
Global illumination and ray tracing
- Path-traced Cornell box The Stanford dragon in a Cornell box, path traced on the GPU against a BVH: in TS a hybrid tracer over the raster GBuffer, with compute-driven trails or a voxelized scene to trace instead TS WASM Reference Trails Voxels
- GI Path traced Cornell A Cornell box under one downlight, its diffuse light path traced through a grid of the room's triangles (one ray for each 2 x 2 pixels, denoised), with a chrome ball and a glass ball ray traced through the same grid: reflection, refraction through both surfaces, frosted glass and rough chrome. Its panel switches to voxel GI, screen-space GI or a path-traced reference, and has the distance field, probes and the balls' roughness and index of refraction TS WASM Voxel + SSGI Voxel + SSGI
- Outdoor GI The Raggare intro's forest, its 26 390 procedural spruces and birches, road and terrain fetched from raggare.kansei.graphics, under a low sun: voxel GI in a clipmap round the camera, screen-space GI or the hybrid ray-traced GI TS WASM Into the trees Into the trees
- Voxel GI on particles Spheres of an SPH fluid raining into a lightbox under an emissive panel, splatted into a voxel volume and cone traced for their light, glowing ones lighting the rest over a glossy floor; the same demo in TS and Rust. Ray traced turns some into mirrors and glass, with depth of field TS WASM Ray traced Ray traced
Atmosphere and fog
- Sky atmosphere A physically based sky from noon to dusk: Hillaire's LUTs, aerial perspective on distant hills, sky-lit surfaces and reflections of its prefiltered cubemap; the Rust one adds volumetric clouds TS WASM
- Volumetric fog A grove of pillars under a low sun: froxel fog with shafts through the directional shadow, a lamp's cube shadow and a dim sky TS WASM
- Curl volumetric Curl-noise particle trails through volumetric fog, in a Cornell box or over a scrolling noise terrain TS
Post-processing
- Post-processing Spheres in volumetric fog with shadows and a filmic tone map, bloom on emissive surfaces, plus path-traced GI, depth of field and colour grading to switch on TS
- Film look A dusk path in physical light units through fog, bloom and the tone mapper: EV100 exposure, filmic curves, vignette and grain TS WASM
- Temporal AA Thin trunks, power lines, 12 000 swaying grass cards and a passing car: motion vectors and temporal anti-aliasing on a single-sample GBuffer; the Rust one can upscale and motion blur TS WASM
- Depth of field Physical depth of field through a camera lens, two layers and scattered bokeh: in TS a scrolling field of noise-driven columns, some tops glowing, in Rust trunks, leaf cards and strings of lights TS WASM
Visibility, LOD and reflections
- Occlusion culling 60 000 spruces in three LODs, culled on the GPU per view by frustum, LOD band and, for the camera, a two-phase depth pyramid TS WASM
- Impostors A lake ringed by 40 000 spruces whose far LOD is an octahedral impostor baked at start-up, mirrored in the water TS WASM
- Cluster LOD A field of rocks drawn three ways: cluster LOD cut per cluster on the GPU, discrete LODs from the same graph, or the full mesh TS WASM Field
- Meshlet inspector The Stanford dragon's 871 000 triangles in clusters, coloured by cluster, level, group or error against the budget, with the cut frozen while the camera flies TS
- Planar reflection A lake at dusk mirroring the far shore, a lit cottage and a searchlight's beam in the mist: a mirrored view with an oblique clip plane, rippled and blurred by roughness; the Rust one has a screen-space mirror to compare TS WASM
Fluid
- Fluid A GPU particle fluid you can stir with the mouse, meshed by marching cubes and refracted TS WASM Nozzle
- Lake Water held by a shaped bed and shore, stirred by a mill wheel's paddles, its surface drawn from a surface field; the Rust demo adds a course of boxes and a water cannon TS WASM
- Fluid text 2D fluid particles that gather into letters TS
- Fluid clock The time of day formed out of an SPH fluid, its digits pulling particles into extruded glyphs WASM
- Steering text About 1 600 words flocking in 3D as boids, their letters trailing on distance constraints WASM
Animation
- Skinning A ring of procedurally rigged tentacles skinned in their materials' vertex shaders, casting bending shadows TS
- Motion matching A character controller over a course of boxes. The TS page needs a local animation pack (none ships) and shows the course alone without one; the live one on raggare.kansei.graphics walks, runs, jumps and wades through a fluid lake TS Live ↗
Loaders, text and tools
- KTX2 textures ETC1S and UASTC textures and a glTF through KHR_texture_basisu, transcoded to the best format this device samples, with sizes and timings TS WASM
- MSDF text Signed-distance-field text, animated by a compute shader TS
- Video texture The webcam as an external video texture across 250 stacked instanced planes (asks for camera access) TS