Compose geometry
Trace spheres, planes, triangles, and quads through a BVH.
Deterministic path tracing · Ruby
A pure Ruby path tracer and teaching example for cameras, materials, textures, and acceleration.
gem install caustics
Build scenes from small parts, render repeatable samples, and compare backends.
Trace spheres, planes, triangles, and quads through a BVH.
Use Lambertian, metal, dielectric, emission, and image textures.
Deterministic sampling, depth of field, and process workers where fork exists.
A small first step
Install the gem, then follow the project guide for platform requirements and the full API.
require "caustics"
scene = Caustics::Scene.build do
sphere center: [0, 0, 0], radius: 0.5,
material: lambertian([0.8, 0.2, 0.2])
end
Caustics.render(scene, width: 320, height: 180,
spp: 16, workers: 4).write("out.png")