Skip to content

angstrom-123/CPU-Raytracing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CPU Raytracing

Toy CPU path tracer written entirely in Java.

Features

  • Physically based path tracing
  • BVH optimisation using axis-aligned bounding boxes
  • Support for Lambertian diffuse, metallic, glass, and emissive materials
  • .obj file format model importing (model and normals only)
  • Texture support
  • Custom image texture support for spheres

Running

Requires an installation of at least JDK-21.

By default, rendered images will attempt to save to a "renders" folder in the current or nearby directory. If this is not found, the default location is the cwd.

Config

Multithreading: Preliminary tests have shown that, on powerful computers, thread count should be equal to the number of high-power CPU cores (such as Intel's "performance cores"). Weaker systems and laptops could experience best performance with just one thread.

Tiling: Tile width width should be left at auto for fastest results as this optimizes the cache. Tile height can be reduced to maintain a higher average thread count throughout the render (as when one tile is finished, the thread can be reassigned).

configMenu

Demos

random balls

glass knight

7559715668385661

emission

cornell

References

"Ray tracing in one weekend" and "Ray tracing the next week" : https://raytracing.github.io/