Hasty Briefsbeta

Code golfing a tiny demo using maths and a pinch of insanity

15 hours ago
  • #Ray Marching
  • #Procedural Generation
  • #GLSL
  • The article describes a compact GLSL demo that fits into 464 characters, showcasing procedural mathematical art.
  • The demo uses a fragment shader to generate a 3D scene with mountains, clouds, and fog without textures or meshes.
  • Key techniques include noise generation using sine waves, ray-marching for volumetric effects, and camera setup.
  • The noise function is optimized for performance and size, using accumulated sine waves for mountains and clouds.
  • Ray-marching is used for both solid objects (mountains) and volumetric effects (clouds and fog).
  • The camera setup is simplified to minimize code, using a normalized ray direction for rendering.
  • Color and lighting effects are added to enhance the visual appeal, including tone mapping with tanh().
  • The article details the step-by-step optimization process to reduce the code to its minimal form.
  • The final code combines all elements into a single, highly optimized loop for maximum compactness.