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:
RayTracerproject: 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.Testsproject: It implements all the unit tests described in the book.RayTracer.Demosproject: It implements, as a class library, all the demos of the solution. It makes use of theRayTracerproject. It is shared between the C# console applications and Blazor WebAssembly application.RayTracer.Demos.Testsprojects: It implements some unit tests that make sure that some needed constraints are followed.Demosfolder: Contains several projects implementing theRayTracer.Demosdemos as C# console applications. These demos make use of theRayTracerandRayTracer.Demosprojects.RayTracer.Demos.Browser: It is a C# console application used as a container to execute all the demos. It makes use ofRayTracerandRayTracer.Demosprojects.RayTracer.BlazorProject: It is the Blazor WebAssembly implementation of the demos inRayTracer.Demosproject. It makes use ofRayTracerandRayTracer.Demosprojects.Mazes.ServicesProject: 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!
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |



















