Skip to content

robkau/go-raytrace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-raytrace

This repository implements a ray tracer in Go by following The Ray Tracer Challenge book

  • The book lays out a language-agnostic TDD plan for implementing a ray tracer from scratch
  • Window rendering and input handling provided by Go library ebiten
  • I highly recommend the book. 5 stars!

Controls

W: Zoom in
S: Zoom out
A/D/Q/E/Z/C: Move camera position (wip)
LeftArrow/UpArrow/RightArrow/DownArrow: Move camera focal point (wip)
N: next scene
M: next camera position
Numpad plus: Increase ray bounces
Numpad minus: Decrease ray bounces
Numpad multiply (*): Increase rendering goroutines
Numpad divide (/): Decrease rendering goroutines

Examples

Bonus online chapters: Soft shadows, Bounding Volume Hierarchies, UV texture mapping, Skyboxes Example 1 Example 2 http://www.raytracerchallenge.com/bonus/area-light.html
http://raytracerchallenge.com/bonus/bounding-boxes.html
http://www.raytracerchallenge.com/bonus/texture-mapping.html

Chapter 15: Triangles & Meshes & Parse .obj files. Bonus feature: parse .rpl Toribash replay files
Chapter 15 example

Scene pictures one of my Toribash fight replays immortalized into seven glass marbles. With T-posing mesh reptilians in a staring contest.
Toribash replays only capture keyframes with the engine simulating the rest in between, some frames are lost in the render.
Send me a replay file if you want a scene of your own!

  • Add .obj file parsing. Creates raytracing triangle natives from mesh description.
  • Add .rpl Toribash replay file parsing. Creates raytracing natives from replay keyframes.

Chapter 14: Groups

Chapter 14 example

Chapter 13: Cylinders and cones

Chapter 13 example

Chapter 11: Spheres and mirror

Chapter 11 example

Chapter 11: Hollow glass sphere against checkerboard

Chapter 11 example

Chapter 11: Submerged spheres in water

Chapter 11 example

Chapter 4: Rendering shapes

Chapter 4 example

About

Implementing a CPU raytracer in Go.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages