Giter VIP home page Giter VIP logo

software-raytracer's Introduction

CPU Raytracer

A CPU raytracer made during the Graphics Programming 1 cource at DAE.
By Elise Briers


Concept

We where tasked with writing a software raytracer using C++. The project featured very mathematical coding where performance was very important. I decided to challange myself and make the code relatively performant.

Basic features

As it remains a school project, there where some feature requirements set by the teachers:

  • Moveable camera
  • Rendering of the following objects:
    • Plane
    • Sphere
    • Triabngle
    • Mesh
  • Directional light and point light
  • PBR rendering

Extra features

I wanted to go a bit beyond the minimum asked by the teachers, partially out of personal interest and partially to teach myself valuable topics. These are the extras I wanted to implement in this project:

  • Usage of the Pareto principle to optimize the code
  • Fast and bug-free multithreading using a thread-pool

Screenshots

Scene 1 Scene 1

Running and using the project

The project can be build using a recent version of visual studio, I recommend running the project in release mode for better performance.

The camera can be controlled in the following way:

  • Holing the right mouse button: looking around like in a first person game
  • Holding the left mouse button: forwards/backwards movement + look left/right
  • WASD: movement
  • q/e: up and down movement

Extra controls are explained in the console.

Conclusion

I really enjoyed working on this project. Using the 80/20 rule to optimize the code is a very setifying process that will equip me to write faster code into the future while focussing on the code that will yield most benefits. While other cources covered the topic of multithreading, they did not go nearly as deep into the topic as I did here. I learned how to write fast multithreaded code while avoiding common bugs like race conditions. This project has tought me a lot of valuable skills related to performance. I am certain these skills will be useful later on regardless of what type of project I'm working on.

software-raytracer's People

Contributors

elisebriers 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.