Skip to content

Ogg-Vorbis/RayTracerChallenge

Repository files navigation

Ray Tracer Challenge

The Ray Tracer Challenge, completed in C#.

ISBN-13: 978-1680502718

Book Description

Brace yourself for a fun challenge: build a photorealistic 3D renderer from scratch! It's easier than you think. In just a couple of weeks, build a ray-tracer that renders beautiful scenes with shadows, reflections, brilliant refraction effects, and subjects composed of various graphics primitives: spheres, cubes, cylinders, triangles, and more. With each chapter, implement another piece of the puzzle and move the renderer that much further forward. Do all of this in whichever language and environment you prefer, and do it entirely test-first, so you know it's correct. Recharge yourself with this project's immense potential for personal exploration, experimentation, and discovery.

The renderer is a ray tracer, which means it simulates the physics of light by tracing the path of light rays around your scene. Each exciting chapter presents a bite-sized piece of the puzzle, building on earlier chapters and setting the stage for later ones. Requirements are given in plain English, which you translate into tests and code. When the project is complete, look back and realize you've built an entire system test-first!

There's no research necessary -- all the necessary formulas and algorithms are presented and illustrated right here. Dive into intriguing topics from fundamental concepts such as vectors and matrices; to the algorithms that simulate the intersection of light rays with spheres, planes, cubes, cylinders, and triangles; to geometric patterns such as checkers and rings. Lighting and shading effects, such as shadows and reflections, make your scenes come to life, and constructive solid geometry (CSG) enables you to combine your graphics primitives in simple ways to produce complex shapes.

Play and experiment as you discover the fun of writing a ray tracer. Accept the challenge today!

Exercise Outputs

Projectile Exercise

Projectile Exercise output

Clock Exercise

Clock Exercise output

Sphere Hits Exercise

My attempt before consulting book

Sphere Hit Exercise My Attempt

Color changes in proportion to the hit's T value

Sphere Hit Exercise Changing color in proporation to Hit.T

Book Solution

Sphere Hit Exercise Book Solution

With Lighting and Shading

Sphere Hit Exercise with Lighting and Shading

Making A Scene Exercise

First Run

Making A Scene Exercise

With Shadows

Making A Scene Exercise

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages