Core SDK WebGPU and WebGL samples
Low-level functionality tests compiled with Emscripten.
Archive with all tests: webgpu-20230515.zip
WebGPU compatible browser is required.
Parallel Fluid 2D
Simple 2D fluid simulation based on Fast Fourier Transformation.
Parallel Radix Sort
Multiple independent sorting algorithms can be dispatched in parallel. There is no overhead in comparision with the single array sort. Additionally, dispatch parameters can be fetched from the indirect buffer.
'1' shows the input data.
'2' activates global sort.
Parallel Spatial Grid
Simple physics simulation with collisions based on the SpatialGrid class. It is the fastest way to collide objects of the same size.
Parallel Spatial Tree
Simple physics simulation with collisions based on the SpatialTree class. The SpatialTree allows collision and intersection tests with any primitive inside BVH.
Forward shading with 16384 dynamic lights. This algorithm is compatible with deferred shading and transparent objects.
A massive meshlets rendering example with Mesh Shader for hardware and Compute Shader for software rasterization.
'1' activates Instancing mode.
'2' activates Mesh Shader mode.
'3' activates Compute rasterization mode.
WebGPU: Mesh Shader mode is not supported. Z-order for Compute rasterization is invalid because WebGPU does not provide read-write or atomic operations for storage images.
Ordered Independent Transparency
Ordered Independent Transparency with atomic buffer operations from the fragment shader.
WebGPU: High resolution is not supported because of limited SSBO size.
Software Ray Tracing Shadows
Software raytracing shadows with simple deferred shading. Compatible with all APIs.
Percentage Closer Filtering Shadow Map
PCF Shadow Maps provides shadow with variable penumbra size based on the distance between the shadow caster and receiver.
Exponential Shadow Maps
Exponential Shadow Maps provides noise-free shadows with a fixed performance cost and constant penumbra size.
Parallax occlusion mapping with self-shadowing for the mesh geometry.
Parallax occlusion mapping with self-shadowing for the analytical sphere.
Mesh Tangent Basis
Mesh tangent basis renormalization at the Fragment Shader. Mesh class can re-create normal and tangent vectors.
MeshModel class creates a rendering model representation for the input Mesh or MeshGeometry with a specified Pipeline layout.
It is possible to inherit MeshModel class and combine multiple meshes into the single Buffer.
This is a basic skinned mesh animation example. Mesh classes give comprehensive access to all mesh data, including Nodes, Animations, Materials, Cameras, and Lights.
Performance and precision difference between 16-bit, 32-bit, and 64-bit floating formats.
'1' activates 64-bit precision.
'2' activates 16-bit precision.
WebGPU: 64-bit and 16-bit modes are not supported.
Dynamic 3D texture created with SIMD CPU instructions.
Command class for basic rendering. Depth Cube texture for omnidirectional shadow map.
Compute class for simple compute shader texture generation.
Multi-GPU N-body simulation with Fence synchronization. A shared buffer is used for data exchange between GPUs.
WebGPU: Single-GPU simulation mode only.
A single-thread dynamic geometry rendering can provide more than 100M triangles per second rate.
Platform Stencil Buffer
Constructive Solid Geometry with the Stencil Buffer. This algorithm is compatible with procedural geometry.
Platform Texture Samples
Writing and reading individual multisample texture samples with active Pipeline sample write mask.
Different CanvasElement classes, including texture filtration, gradients, contour outlines, and SVG rendering.
Different User Interface Control classes in resolution-independent configuration.
A transparent multilayer Controls with variable background blur.
Simple SVG image loading and rendering. CanvasShape class accepts SVG path string as input data.
Custom Controls can be created by simple ControlBase class inheritance. The Control behavior can be completely overridden.
MeshReduce is a simple way to simplify input mesh geometry. Simplification preserves all Mesh Attributes, and it is compatible with Skinning Animation.
'1' shows the original geometry.
MeshRefine refines geometry mesh using Catmull-Clark (for quadrilaterals) or Loop (for triangles) subdivision algorithms. The Crease Attribute allows additional control over the subdivision process.
'1' shows the original geometry.