Git Product home page Git Product logo

epq-raytracer's Introduction

EPQ Raytracer App

A raytracing application, largely based on the Raytracing in One Weekend (Book Series), for my A-Level (2019-2020 Exam) EPQ (Extended Project Qualification, where you can research your own topic/question). The purpose of this application was to teach myself how a raytracing works in a practical situation. It was originally designed only for hard-coding a scene into the program but I had to add UI quite late into the project, as I had to present the program to people who knew little about programming, let alone raytracing.

Note: The program is missing useful, key features since it was my first C# project, created for my A-Level coursework and I haven't worked on it since.

Screenshots



Program rendering the "Cornell Box (Simplified)" scene




Program rendering the "Raytracing In One Weekend Book 1 Cover" scene

Renders

Note: Render times are based on single-threaded performance with my AMD Ryzen 2700x (3.7 GHz) CPU. All below renders where done at 1024x1024px resolution.

Scene Output Samples Render Time
Cornell Box (Simplified) Cornell Box Render 512 1h:15m:48s
Raytracing In One Weekend Book 1 Cover Raytracing In One Weekend Render 64 1h:07m:20s

Helpful/used resources

License

See license here

Known issues

  • I seemed to have used an older edition of the Raytracing in One Weekend (Book Series), which had a few issues with the code (that I attempted to fix)
  • Very little optimisation has been done, hence the very long render times
  • Only supports CPU single-thread rendering as my attempt at multi-threading didn't work properly
  • The UI is missing various key features and isn't very intuitive, since it was added very last minute
  • Sometimes the render will seemingly freeze (the render preview won't update), this is when the UI tries to update the preview but crashes the render thread by accessing the bitmap being used
  • Bounding box/AABB isn't implemented since I couldn't get it to work correctly
  • Some elements of the scene can be edited and affect the output if its currently rendering (eg. camera options)
  • Saving/Loading files isn't implemented since I structured my classes data in an incompatible manner for JSON serialisation and simply didn't have the time to reorganise the code for this functionality (hence the preset scenes via the File menu)

Running/use binary

Download Latest Binary Here

The release binary should run on any x64 Windows device that supports .NET Framework 4.7.2

When running the binary, the UI should show with the cornell box scene pre-loaded. You can choose other built-in scenes by going to File.

You can add new elements to the scene via the Add menu. To remove an element, right click the element in the scene tree and select Delete Element (you can't delete element groups, the camera or scene). You can edit an elements properties by selecting it in the scene tree.

To start the render, select Start Render from the Render menu. You can stop the render whilst its rendering or save the output during/after the render process.

If you enable Progressive Sampling, the renderer will raytrace the scene indefinitely rather than setting a specific sample count per pixel. This option does take longer however.

How to compile from source

Make sure you have the following installed:

  • Visual Studio 2019 (with the .NET Framework 4.7.2 SDK)

Then follow these steps to compile the project:

  1. Clone the repo
  2. In the root folder of the project, open the EPQ_Raytrace_Engine.sln file with Visual Studio 2019
  3. Compile/build the program (Default shortcut: F5)

epq-raytracer's People

Contributors

arcticnoah avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.