Samples
These examples cover rendering and compute, from a single triangle to interactive applications and diagnostic tools.
Running the examples
Run the ZenithTutorials project and choose an example from its console menu.
Hello Triangle
A triangle with smoothly blended vertex colors introduces the basic graphics pipeline.
HelloTriangleRenderer.cs · HelloTriangle.slang · Complete tutorial
Spinning Cube
A rotating cube introduces indexed geometry, 3D transformations, and depth testing.
SpinningCubeRenderer.cs · SpinningCube.slang
Compute Shader
A compute shader converts a color image to grayscale, demonstrating GPU image processing.
ComputeShaderRenderer.cs · ComputeShader.slang
Indirect Drawing
A grid of rotating, individually colored cubes demonstrates indirect drawing from a buffer of draw arguments.
IndirectDrawingRenderer.cs · IndirectDrawing.slang
Ray Tracing
This sample uses ray queries to render reflective spheres and shadows on a checkerboard floor. Requires ray tracing support.
RayTracingRenderer.cs · RayTracing.slang
Mesh Shading
This sample uses task and mesh shaders to render a grid of colored spheres, skipping spheres outside the camera's view. Requires mesh shading support.
MeshShadingRenderer.cs · MeshShading.slang
Applications and utilities
The Zenith.NET repository's Experiments directory contains these applications and utilities.
|
Example
|
Description
|
|
CornellBox
|
An interactive room scene for exploring lighting and reflections. Requires ray tracing support.
|
|
FluidTank
|
A water simulation in a tank, with surface and particle views.
|
|
InkCanvas
|
A canvas for drawing and erasing freehand strokes.
|
|
PlatformDetection
|
A console tool that reports graphics API availability and device features.
|