CPP-Renderer/ROADMAP.md

2.1 KiB

🚀 Raytracer Project Roadmap

This roadmap breaks down the essential steps to build your CPU-based raytracer from scratch in C++.


Phase 1: Foundations & Core Engine

  • Set up vector math utilities (vec3): add, subtract, dot, cross, normalize
  • Implement Ray class — origin, direction, basic functions
  • Basic Sphere object — position, radius, material properties
  • Ray-Sphere intersection logic — the core of your renderer
  • Camera setup — generate rays through the viewport
  • Scene structure — manage objects and lights

Objectives:

  • Render a single sphere with basic color
  • Output to a simple PPM file format

Phase 2: Lighting & Shading Basics

  • Diffuse shading (Lambertian reflection) — basic light bounce for realism
  • Implement simple light sources: directional, point lights
  • Shadow rays — cast rays toward lights to check occlusion
  • Basic materials — color, albedo, reflectivity factor

Phase 3: Reflection & Recursion

  • Reflection rays — mirror-like reflections with recursion depth limit
  • (Optional) Refraction — transparent materials like glass
  • Recursive ray tracing — combine reflections & lighting

Phase 4: Image Output & Performance

  • Render to PPM file (or PNG with stb_image_write)
  • Anti-aliasing — supersampling for smooth edges
  • Multi-threading (OpenMP or std::thread) for parallel speedup
  • Optimize math operations — use inline functions, constexpr where possible

Phase 5: Scene & Object Expansion

  • Add more shapes: planes, triangles (for meshes)
  • OBJ file loader — import 3D models
  • Material system — metals, dielectrics, diffuse, emissive lights
  • Texture mapping (UV mapping) — add realistic surface detail
  • Multiple light sources with falloff

Phase 6: Advanced Features (Flex Mode ON)

  • Global Illumination / Path Tracing (big brain mode)
  • Depth of field camera effect
  • Motion blur
  • HDR environment maps for reflections and lighting
  • GUI or real-time preview (super ambitious)