Hasty Briefsbeta

Ray Marching Soft Shadows in 2D

14 days ago
  • #GraphicsProgramming
  • #RayMarching
  • #WebGL
  • The article discusses a graphics project using distance fields for lighting effects.
  • Distance fields are images indicating how far each pixel is from a shape, used to generate shadows.
  • Ray marching is introduced as a technique to efficiently determine shadows by advancing along rays based on distance field values.
  • The article explains a soft-shadow technique that adds a penumbra around hard shadows for aesthetic appeal.
  • Three rules are outlined for computing soft shadows, focusing on proximity to shapes, distance from almost-intersections, and light attenuation.
  • The implementation involves GLSL code snippets for ray marching and shadow computation.
  • Banding artifacts in shadows are addressed with improved approximations and random jitter techniques.
  • The author acknowledges inspiration from Inigo Quilez and seeks feedback for further improvements.