Skip to content

ronnieholm/Ray-tracing-in-one-weekend-CSharp

Repository files navigation

Ray-tracing-in-one-weekend-CSharp

A C# port of Peter Shirley's Ray Tracing in One Weekend (book, version 1.55 and C++ code available for free).

Running the application generates a random scene:

Random scene If you feel a bit rusty on the math, you may want to start with a few posts I wrote while working through the book:

Getting started

$ git clone https://github.com/ronnieholm/Ray-tracing-in-one-weekend-CSharp.git
$ dotnet run -c release > out.ppm
$ display out.ppm

On my Intel Core i7-7560U CPU @ 2.40GHz laptop running Linux and .NET, ray tracing takes about two minutes.

Benchmarking

For benchmarking, writing to standard output should be disabled in Program.cs:

.NET 8 (Linux)

real    0m59,088s
user    0m59,415s
sys     0m0,224s

See also

  • Live coding implementation in C++ (part 1, part 2, part 3, part 4). Adds commentary and derives equations that the books glosses over.

About

C# implementation of Ray Tracing in One Weekend by Peter Shirley.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages