3D shaders in a pixel shader
Three-dimensional scenes drawn entirely by a fragment shader: lighting, shadows and shapes from signed distance functions.
There are 9 shaders here. Open one to see the target picture, the techniques it uses and a step-by-step approach, then write it yourself in HLSL (Unity, Unreal), GLSL (Shadertoy, three.js), WGSL (WebGPU), Metal or Godot.
- Checker globe Medium

- Gas giant Medium

- Moon Medium

- Spinning torus Medium

- Tumbling rounded box Medium

- Metaballs (smooth union) Hard

- Bouncing ball on a checker floor Hard

- Endless sphere field Hard

- Black hole lensing Hard

More shader topics
Visual effect shaders · Fire, cloud and nature shaders · Procedural pattern shaders · 2D shape shaders · Post-processing and filter shaders · Water shaders · Ray marching shaders · Game effect shaders · Rasterizer, ray tracer and planet shaders · Mesh, vertex and toon shaders