NEOLearn

Shader examples

The engine's shader examples: what each one shows, whether it runs in a browser and the command that runs it.

Updated October 20, 2026

On this page

Custom materials, shader defs, post-processing passes, compute shaders and lower-level render code. There are 31 examples on this page. For the concepts behind them, see Custom materials and shaders.

Run any of them from the engine core's workspace (the folder of the engine source that holds the neo crate's Cargo.toml); see Run an example.

Shaders#

ExampleWhat it showsWebRun
AnimatedA shader that uses dynamic data like the time since startupYescargo run --example animate_shader
Array TextureA shader that shows how to reuse the core neo PBR shading functionality in a custom material that obtains the base color from an array texture.Yescargo run --example array_texture
Compute - Game of LifeA compute shader that simulates Conway's Game of LifeNocargo run --example compute_shader_game_of_life
Compute Shader MeshA compute shader that generates a mesh that is controlled by a HandleNocargo run --example compute_mesh
Custom phase itemDemonstrates how to enqueue custom draw commands in a render phaseYescargo run --example custom_phase_item
Custom Render PhaseShows how to make a complete render phaseYescargo run --example custom_render_phase
Custom Vertex AttributeA shader that reads a mesh's custom vertex attributeYescargo run --example custom_vertex_attribute
Extended Bindless MaterialDemonstrates bindless ExtendedMaterialNocargo run --example extended_material_bindless
Extended MaterialA custom shader that builds on the standard materialYescargo run --example extended_material
GPU Component Array BufferShows how to expose per-mesh-instance data to the GPUYescargo run --example gpu_component_array_buffer
GPU readbackA very simple compute shader that writes to a buffer that is read by the cpuNocargo run --example gpu_readback
InstancingShows that multiple instances of a cube are automatically instanced in one draw callYescargo run --example automatic_instancing
InstancingA shader that renders a mesh multiple times in one draw call using low level rendering apiYescargo run --example custom_shader_instancing
MaterialA shader and a material that uses itYescargo run --example shader_material
MaterialA shader and a material that uses it on a 2d meshYescargo run --example shader_material_2d
Material - 2D BindlessDemonstrates bindless materials in 2DNocargo run --example shader_material_2d_bindless
Material - BindlessDemonstrates how to make materials that use bindless texturesYescargo run --example shader_material_bindless
Material - Screenspace TextureA shader that samples a texture with view-independent UV coordinatesYescargo run --example shader_material_screenspace_texture
Material PrepassA shader that uses the various textures generated by the prepassNocargo run --example shader_prepass
Pipeline ConstantsDemonstrates pipeline-overridable constants (WGSL override) by compiling the same shader into multiple variants with different posterization levelsYescargo run --example pipeline_constants
Post Processing - Custom Render PassA custom post processing effect, using a custom render pass that runs after the main passYescargo run --example custom_post_processing
Render Depth to TextureDemonstrates how to use depth-only camerasYescargo run --example render_depth_to_texture
Shader DefsA shader that uses "shaders defs" (a neo tool to selectively toggle parts of a shader)Yescargo run --example shader_defs
Specialized Mesh PipelineDemonstrates how to write a specialized mesh pipelineYescargo run --example specialized_mesh_pipeline
Sprite MaterialA custom shader for spritesYescargo run --example sprite_material
Storage BufferA shader that shows how to bind a storage buffer using a custom material.Yescargo run --example storage_buffer
Texture Binding Array (Bindless Textures)A shader that shows how to bind and sample multiple textures as a binding array (a.k.a. bindless textures).Nocargo run --example texture_binding_array

Advanced shaders#

ExampleWhat it showsWebRun
Deferred Gbuffer RaymarchingWrites a raymarched SDF into the deferred gbuffer so it is lit by the standard PBR deferred lighting passYescargo run --example deferred_raymarch --features free_camera
Fullscreen MaterialDemonstrates how to write a fullscreen materialYescargo run --example fullscreen_material
Manual Material ImplementationDemonstrates how to implement a material manually using the mid-level render APIsYescargo run --example manual_material
Mesh Shader IntroductionDemonstrates how to use Task/Amplification/Mesh ShadersNocargo run --example mesh_shader_intro

See also#