Expand description
A multithreaded Monte Carlo path tracing library, that as such has features like:
- Global illumination
- Caustics
- Reflection
- Refraction
- Soft shadows
Additionally, the library has:
- Loading of obj models with included materials
- Multithreaded Bvh creation to greatly speed up rendering
- Post-processing of rendered images by:
- Open Image Denoise
- Bloom filter
- Bump mapping
- Light attenuation
§Example:
let camera = CameraConfig {
vertical_fov_degrees: 20.,
aperture_size: 0.1,
look_from: Vec3::new(0., 0., 4.),
look_at: Vec3::new(0., 0., 0.),
up: Vec3::new(0., 1., 0.),
};
let mut world = Vec::new();
let yellow = Lambertian::new(SolidColor::new(1., 1., 0.), None);
let light = DiffuseLight::new(10., 10., 10., None);
world.push(Sphere::new(Vec3::new(0., 0., 0.), 0.5, yellow));
let scene = Scene {
world: Bvh::new(world),
camera,
background_color: Vec3::new(0.2, 0.3, 0.5),
render_config: RenderConfig::default(),
};
let (output_sender, output_receiver) = channel();
let (_, abort_receiver) = channel();
thread::spawn(move || {
ray_trace(scene, &output_sender, &abort_receiver).unwrap();
});
for render_output in output_receiver {
let _image = render_output.render_image;
}
§Example output
§Credits
The ray tracing is inspired by the excellent Ray Tracing in One Weekend Book Series by Peter Shirley
Modules§
- camera
- Provides a camera used by raytracer to shoot rays into the scene
- geo
- Basic geometric constructs
- hittable
- Objects that are hittable by rays shot by the ray tracer. Some of these hittable objects are containers for other objects
- loader
- Module containing object model loaders
- material
- Materials to be applied to hittable objects
- Probability density functions
- post
- Post processors for applying effects to the raw rendered image
- random
- A wrapper for the random number generator to be used by ray tracer.
- renderer
- The renderer takes a
Scene
as input, renders it and reportsRenderProgress
- util
- Various small helpers used by the raytracer
Macros§
- combine_
aabbs - Combines the given
Aabb
arguments into a singleAabb
encapsulating all
Functions§
- ray_
trace - Executes the ray tracing with the given
Scene
and reportsRenderProgress
on the outputSender
. Listens to abortReceiver
for aborting a started ray trace operation