+
Skip to content

gkmngrgn/rayt

Repository files navigation

RAYT

Ray Tracing codes. I follow Peter Shirley's Ray Tracing trilogy. The goal is to have the same output with Python, solving the performance problems.

You can test it from Hugging Face Spaces: https://huggingface.co/spaces/goedev/rayt-web

Note

The project has different solutions of implementing ray tracing. It will not have a stable version, some solutions may be deleted or replaced in future. Take a look at this post for more information.

How to Build

This project uses Python 3.13 and UV package manager.

# Basic rendering (300px wide, CPU engine)
uv run one-weekend --image-width=300 --samples-per-pixel=20 > image_numba.ppm

# High quality rendering, using rust
uv run one-weekend --image-width=1200 --samples-per-pixel=100 --engine=rust > image_rust.ppm

# GPU rendering (if CUDA available)
uv sync --group cuda
uv run one-weekend --image-width=2400 --samples-per-pixel=200 --engine=cuda > image_cuda.ppm

Features

  • CPU Optimization: Numba JIT compilation for fast CPU rendering
  • GPU Acceleration: CUDA support for parallel GPU rendering
  • Depth of Field: Camera blur effects with configurable aperture and focus distance
  • Materials: Lambertian, Metal, and Dielectric (glass) materials
  • CLI Interface: Configurable image dimensions, sampling, and rendering engines

About

Ray Tracing in Python.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Contributors 2

  •  
  •  
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载