All Projects → Dalamar42 → Rayt

Dalamar42 / Rayt

Licence: mit
Monte Carlo ray tracer developed using Rust

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to Rayt

50yearsofraytracing
以历史的发展的眼光来看光线追踪技术,1968年至2018年重点论文相关算法复现。
Stars: ✭ 90 (-51.35%)
Mutual labels:  raytracing, ray-tracing
Diligentcore
Core functionality of Diligent Engine
Stars: ✭ 263 (+42.16%)
Mutual labels:  raytracing, ray-tracing
Unreal-Development-Guides-and-Tips
High-level concept explanations, detailed tutorials, performance considerations, shortcuts and other useful content that aims to improve your Unreal Engine 4 development journey.
Stars: ✭ 118 (-36.22%)
Mutual labels:  raytracing, ray-tracing
Vanilla-Raytraced
Official repository of Vanilla Raytraced resources pack.
Stars: ✭ 25 (-86.49%)
Mutual labels:  raytracing, ray-tracing
Sort
Simple Open-source Ray Tracer
Stars: ✭ 485 (+162.16%)
Mutual labels:  raytracing, ray-tracing
awesome-rtx
Curated collection of projects leveraging NVIDIA RTX technology (OptiX, DXR, VKR)
Stars: ✭ 73 (-60.54%)
Mutual labels:  raytracing, ray-tracing
Monte carlo ray tracer
A program with an implemented Monte Carlo Ray Tracer algorithm for global illumination of a virtual 3D scene.
Stars: ✭ 90 (-51.35%)
Mutual labels:  raytracing, ray-tracing
Photon-v2
A program that takes photographs of a virtual world.
Stars: ✭ 75 (-59.46%)
Mutual labels:  raytracing, ray-tracing
Awesome Ray Tracing
Curated list of ray tracing resources
Stars: ✭ 414 (+123.78%)
Mutual labels:  raytracing, ray-tracing
Raytracing.github.io
Main Web Site (Online Books)
Stars: ✭ 4,485 (+2324.32%)
Mutual labels:  raytracing, ray-tracing
RayTracedGGX
Ray tracing sample using GGX reflection model, 1spp with spatial-temporal denoiser. Acceleration structure build uses async compute.
Stars: ✭ 43 (-76.76%)
Mutual labels:  raytracing, ray-tracing
Luxcore
LuxCore source repository
Stars: ✭ 601 (+224.86%)
Mutual labels:  raytracing, ray-tracing
ProtoTracer
3D rendering and animation engine for multifaceted displays on microcontrollers
Stars: ✭ 80 (-56.76%)
Mutual labels:  raytracing, ray-tracing
Diligentengine
A modern cross-platform low-level graphics library and rendering framework
Stars: ✭ 2,142 (+1057.84%)
Mutual labels:  raytracing, ray-tracing
ray-tracer
A simple ray tracing engine
Stars: ✭ 27 (-85.41%)
Mutual labels:  raytracing, ray-tracing
webrays
WebRays - Ray Tracing on the Web
Stars: ✭ 38 (-79.46%)
Mutual labels:  raytracing, ray-tracing
Plotoptix
Data visualisation in Python based on OptiX 7.2 ray tracing framework.
Stars: ✭ 252 (+36.22%)
Mutual labels:  raytracing, ray-tracing
LumillyRender
Monte Carlo path tracing implementation on Rust
Stars: ✭ 36 (-80.54%)
Mutual labels:  raytracing, ray-tracing
C Ray
C-Ray is a small, simple path tracer written in C
Stars: ✭ 323 (+74.59%)
Mutual labels:  raytracing, ray-tracing
Voxel Cone Tracing
A real-time global illumination implementation using voxel cone tracing. Implemented in C++ and GLSL.
Stars: ✭ 555 (+200%)
Mutual labels:  raytracing, ray-tracing

Rayt

This is a Rust implementation of the ray-tracer from Peter Shirley's excellent books, Ray Tracing in One Weekend, Ray Tracing: The Next Week, and Ray Tracing: The Rest of Your Life.

This is not by any means a fully featured ray-tracer. Rather, this is something I built in order to learn Rust and ray-tracing. I am sharing it in case it is useful to others trying to do the same.

Functionality

Rayt stores and reads scene data in its own format using yaml files. Those are nothing more than a yaml serialisation of the corresponding Rust objects.

There are two modes of operation described in more detail in the next section.

  • generate which will generate the yaml file for a scene based on presets in the code
  • render which will render the scene in the given yaml

Various examples from the books are provided in the form of scenes. The generate mode can be used to quickly regenerate the config files after making changes to them in the code, but for small scenes the files can be easily directly edited as well.

How to run

This code was developed and tested using Rust 1.42, however it is not using any bleeding edge features of the language so any reasonably recent stable version should be enough to compile it.

To install the binary in your local environment:

cargo install --path ${PATH_TO_THIS_REPO} 

Help:

rayt --help
rayt generate --help
rayt render --help

Generate the Cornell box scene yaml file:

rayt --config config/cornell_box.yaml generate --scene CornellBox

To render the Cornell box:

rayt --config config/cornell_box.yaml \
    render --width 512 --rays 1000 --threads 8 --output output/cornell_box.png

Some scenes use assets as textures, for example the final scene from the Ray Tracing: The Next Week book. These assets can be passed in using --asset:

rayt --config config/next_week_final.yaml \
    render --width 512 --rays 1000 --threads 8 --asset assets/earth.jpg --output output/next_week_final.png

The option --threads can be used to control how many threads the renderer should use and the option --rays will determine how many rays (samples) will be taken for each pixel. Approximately 1000 samples should be enough to produce a decent image with some noise from the provided scenes, but more are needed for a clear image. The rendering times will increase quite significantly with the number of samples selected and the size of the image. On my machine rendering next_week_final.yaml with 5000 samples, and a width of 1024 pixels took around 9 hours. Conversely, the cornell_box.yaml with a 1000 samples, and a width of 512 finishes in a few minutes.

A Makefile is included with some convenience targets:

  • make regenerate-scenes will create all the scene config yaml files
  • make render-test will render all scenes using a moderate resolution and number of rays and put the generated images in output/test
  • make cornell-test is the same as make render-test, but only for the Cornell box
  • make regenerate-samples will create high-resolution / high-ray-count versions of the Cornell box and the final image from book 2 and put them in output/samples

Samples

The directory samples contains images generated with a high number of rays, specifically 5000 rays per pixel, to showcase what kinds of images rayt can render.

Assets

The included assets were taken from the following sources:

License

See the LICENSE file that is included with this repository.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].