All Projects â†’ dps â†’ rust-raytracer

dps / rust-raytracer

Licence: BSD-2-Clause license
🔭 A simple ray tracer in Rust 🦀

Programming Languages

rust
11053 projects
shell
77523 projects

Projects that are alternatives of or similar to rust-raytracer

Diligentengine
A modern cross-platform low-level graphics library and rendering framework
Stars: ✭ 2,142 (+1110.17%)
Mutual labels:  raytracing
Wisprenderer
RTX Ray Tracing Renderer, made by Y3 students at Breda University of Applied Science
Stars: ✭ 184 (+3.95%)
Mutual labels:  raytracing
Wickedengine
3D engine focusing on modern rendering techniques and performance.
Stars: ✭ 3,148 (+1678.53%)
Mutual labels:  raytracing
Vk raytracing tutorial
Vulkan ray tracing tutorials
Stars: ✭ 144 (-18.64%)
Mutual labels:  raytracing
Ssrt
Real-time indirect diffuse illuminaton using screen-space information for Unity.
Stars: ✭ 176 (-0.56%)
Mutual labels:  raytracing
Python Raytracer
A basic Ray Tracer that exploits numpy arrays and functions to work fast.
Stars: ✭ 204 (+15.25%)
Mutual labels:  raytracing
Raytracedshadows
This demo implements BVH construction and GPU traversal for rendering hard shadows.
Stars: ✭ 107 (-39.55%)
Mutual labels:  raytracing
raytracing-go
A simple Go library for 3D ray-tracing rendering, implementing the book Ray Tracing in One Weekend. 📸
Stars: ✭ 53 (-70.06%)
Mutual labels:  raytracing
Rayt
Monte Carlo ray tracer developed using Rust
Stars: ✭ 185 (+4.52%)
Mutual labels:  raytracing
Toyrtx
CPU & GPU RTX based on OpenGL
Stars: ✭ 231 (+30.51%)
Mutual labels:  raytracing
Retrace.gl
Create, ray trace & export programatically defined Signed Distance Function CSG geometries with an API suited for generative art - in your browser! 🎉
Stars: ✭ 149 (-15.82%)
Mutual labels:  raytracing
Unitydxrtest
A testbed project for Unity real-time ray tracing features
Stars: ✭ 172 (-2.82%)
Mutual labels:  raytracing
Optix Pathtracer
Simple physically based path tracer based on Nvidia's Optix Ray Tracing Engine
Stars: ✭ 231 (+30.51%)
Mutual labels:  raytracing
Unityraytracinggem
💎 Ray tracing gem shader for Unity
Stars: ✭ 140 (-20.9%)
Mutual labels:  raytracing
Plotoptix
Data visualisation in Python based on OptiX 7.2 ray tracing framework.
Stars: ✭ 252 (+42.37%)
Mutual labels:  raytracing
Bvh
A fast BVH using SAH in rust
Stars: ✭ 108 (-38.98%)
Mutual labels:  raytracing
Ashes
WebGL2.0 3D Engine & ECS & RayTracing
Stars: ✭ 191 (+7.91%)
Mutual labels:  raytracing
LumillyRender
Monte Carlo path tracing implementation on Rust
Stars: ✭ 36 (-79.66%)
Mutual labels:  raytracing
ray-tracing
This is a go implementation of the "Ray Tracing in One Weekend" book
Stars: ✭ 37 (-79.1%)
Mutual labels:  raytracing
Brayns
Visualizer for large-scale and interactive ray-tracing of neurons
Stars: ✭ 232 (+31.07%)
Mutual labels:  raytracing

rust-raytracer

An implementation of a very simple raytracer based on Ray Tracing in One Weekend by Peter Shirley in Rust. I used this project to learn Rust from scratch - the code may not be perfectly idiomatic, or even good, but it does make pretty pictures.

Additional features beyond Shirley's course:

  • Texture mapping (e.g. earth and moon textures below)
  • Lighting
  • Parallel rendering - will use all CPU cores for best performance
  • Read scene data from JSON file
  • Render a sky texture

Example output

Latest output

Example usage

$ cargo build --release
   Compiling raytracer v0.1.0 (/Users/dps/proj/rust-raytracer/raytracer)
    Finished release [optimized] target(s) in 2.57s

$ ./target/release/raytracer data/test_scene.json out.png

Rendering out.png
Frame time: 2840ms

$ ./target/release/raytracer data/cover_scene.json cover.png

Rendering cover.png
Frame time: 27146ms

Texture mapping

cover_alt

Lighting

lighting-recast-final

Parallel rendering - will use all CPU cores for best performance

Original

🚀 ./target/release/raytracer anim/frame
   Compiling raytracer v0.1.0 (/Users/dps/proj/rust-raytracer/raytracer)
    Finished release [optimized] target(s) in 2.21s

Rendering anim/frame_000.png
............................................................
Frame time: 21s

Using rayon

Rendering anim/frame_000.png
Frame time: 2573ms

Render a sky texture

sky_textures

Read scene data from JSON file

Example

{
  "width": 800,
  "height": 600,
  "samples_per_pixel": 128,
  "max_depth": 50,
  "sky": {
    "texture":"data/beach.jpg"
  },
  "camera": {
    "look_from": { "x": -2.0, "y": 0.5, "z": 1.0 },
    "look_at": { "x": 0.0, "y": 0.0, "z": -1.0 },
    "vup": { "x": 0.0, "y": 1.0, "z": 0.0 },
    "vfov": 50.0,
    "aspect": 1.3333333333333333
  },
  "objects": [
    {
      "center": { "x": 0.0, "y": 0.0, "z": -1.0 },
      "radius": 0.5,
      "material": {
        "Texture": {
          "albedo": [
            1.0,
            1.0,
            1.0
          ],
          "pixels": "data/earth.jpg",
          "width": 2048,
          "height": 1024,
          "h_offset": 0.75
        }
      }
    }
  ]
}

Make animation

🚀 ffmpeg -f image2 -framerate 15 -i anim/frame_%03d.png -loop -0 anim.gif

Credits

Earth and moon textures from https://www.solarsystemscope.com/textures/

Extreme lighting example

147705264-c6f439df-f61b-4bcf-b5e6-c2c755b35b1c

Progressive max_depth animation

max_depth_anim

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].