This is my implementation of Jamis Buck's amazing book The Ray Tracer Challenge using C#.
Enjoy the demo here: TheRayTracerChallenge.
- Implement the book as a C# console application.
- Implement the book as a Blazor WebAssembly PWA application.
- Share as much code as possible between the C# console application and the Blazor WebAssembly application.
- Host the Blazor WebAssembly in GitHub Pages: TheRayTracerChallenge.
The source code is in the src
folder, and the demo, TheRayTracerChallenge, is in the docs
folder as required by GitHub Pages.
The solution, as described above, is in the src
folder, and it contains the following important items:
RayTracer
project: It is the most important piece of code as it implements the data structures and algorithms described in the book. It is shared between the C# console applications and Blazor WebAssembly application.RayTracer.Tests
project: It implements all the unit tests described in the book.RayTracer.Demos
project: It implements, as a class library, all the demos of the solution. It makes use of theRayTracer
project. It is shared between the C# console applications and Blazor WebAssembly application.RayTracer.Demos.Tests
projects: It implements some unit tests that make sure that some needed constraints are followed.Demos
folder: Contains several projects implementing theRayTracer.Demos
demos as C# console applications. These demos make use of theRayTracer
andRayTracer.Demos
projects.RayTracer.Demos.Browser
: It is a C# console application used as a container to execute all the demos. It makes use ofRayTracer
andRayTracer.Demos
projects.RayTracer.Blazor
Project: It is the Blazor WebAssembly implementation of the demos inRayTracer.Demos
project. It makes use ofRayTracer
andRayTracer.Demos
projects.Mazes.Services
Project: It implements some services and helper methods used by other projects.Mazes.Services.Test
: It is a C# console applications used as a container of all the demos. It allows us to select and execute any demo.
It has been an awesome experience to share code between the C# the console applications and the Blazor WebAssembly application, making it very straightforward to convert to a web application the implementation of the book with very little effort.
Please, feel free to send issues or pull requests. Any feedback is always welcome!