Skip to content

nnorm/cpu_rtx

Repository files navigation

CPU RTX

Description

This is my C++11 implementation of a CPU software raytracer that outputs PPM files.
It is based off Peter Shirley's raytracing book series, available here for free.
One of the goal is to try to implement something usable to get reference images for various physically-based stuff. As such I might use PBRT for that. For now it is simple but it could become a more complicated path-tracer.

Philosophy

This is me trying to write yet-another-raytracer with minimal dependencies.
Although I try to make it compilable somewhere else, I don't plan on writting support for other platforms than Win32. You could probably write a makefile that compiles this pretty fast.

Task list

Following "RT In One Weekend" (sort of)

  • Output PPM files of any size and filename
  • Build a ray class
  • Create the main raytracing loop
  • Add background support
  • Make a ray-sphere intersection
    • basic intersection
    • normal computation
  • Re-factoring
    • Put stuff into structs
    • Generalize raytracing spheres
    • Put some of the structs into separate files
    • Decouple raytracing from writting files
  • Add very basic material support
    • albedo (RGB)
  • Add a proper camera
  • Anti-aliasing/better sampling
    • basic random
    • uniform random
  • Ambient/Diffuse Lighting basics
  • Specular Lighting basics
  • Re-factoring
    • Shading ray generation in the material
    • Fix progress bar
    • Move utility functions somewhere else
    • General clean-up and documentation
  • Add plane primitive
  • Postionable camera
  • Depth-of-Field
  • Improving performance and quality
    • Add binary PPM support
    • Simple multi-threading
    • Try better noise?
    • Work on the "correctness" of the mathematical aspect of lighting
    • More robust values for camera (preferably with units?)
    • Improve recursive ray generation (early stop?)
  • Refraction support
  • Box primitive support
  • Emissive object support
  • Triangle primitive support
  • Mesh loading
  • Refactoring
    • Better handling of materials
    • Tidying utilities

Side Tasks

  • Generalization of per-pixel effect (aka pixel "shader")
    • use a lambda-typedef
  • Build a cornel box
  • Find a simple scene description/config format
    • json is a popular choice
    • Write a cornel box scene to test
    • Add terminal UI to input a test scene path before raytracing

Result so far

Resolution: 3840x2160
Sample per-pixel: 32
Rays per sample: 4

4K render

Releases

No releases published

Packages

No packages published