Giter Club home page Giter Club logo

iridium's Introduction

Iridium


Iridium is a simple, lightweight, and portable ray-tracer written in C++.

Features

  • Support for various primitives
    • Spheres
    • Triangles
    • Planes (parallelograms)
  • Complex objects from .off files
  • Support for custom materials
  • Acceleration structures (bounding volume hierarchy)
  • Point lights with various colours and intensities
  • Support for various camera types
    • Perspective
    • Orthographic
  • Arbitrary camera transformations
  • Support for multiple image formats
    • PNG
    • PPM (no compression, but handles extremely large renders better)
  • Support for various rendering techniques
    • Blinn-Phong shading
    • Shadows
    • Reflections
    • Depth of field
  • Scene mechanism to configure object positions, materials, and lights
  • Multithreaded rendering

Compiling

Create build directory

mkdir build
cd build

On Linux

On Linux, you will need a C++ compiler, CMake, and Make. For Debian-based distributions, you can install them with:

sudo apt install build-essential cmake

Generate CMake files

# For debug builds, use:
cmake ..

# For release builds, use:
cmake -DCMAKE_BUILD_TYPE=Release ..

Build the project

# Replace 32 with the number of threads you want to use to compile the project
make -j 32

On Windows

On Windows, you will need Visual Studio with the "Desktop development with C++" workload, as well as CMake. You can find the latest version of CMake here. You can find the latest version of Visual Studio here.

With Ninja

With Ninja, you will need to ensure that Ninja is in your PATH and that it is the default toolchain.

Generate CMake files

# For debug builds, use:
cmake -GNinja ..

# For release builds, use:
cmake -GNinja -DCMAKE_BUILD_TYPE=Release ..

If the detected toolchain is GNU (perhaps from having MinGW installed), you can force Ninja to use the MSVC toolchain by running the vcvarsall.bat script from the Visual Studio installation directory before running CMake. For Visual Studio Enterprise 2022, this file is located at C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat.

Build the project.

# Replace 32 with the number of threads you want to use to compile the project
cmake --build . -j 32

With Visual Studio

With Visual Studio, the build configuration is specified during the build phase. To generate the solution files, run:

cmake ..

Build the project

# For debug builds, use:
cmake --build . --config Debug

# For release builds, use:
cmake --build . --config Release

Usage

Iridium is a command-line program. The parameters can be configured using a YAML-based scene file. By default, Iridium will look for data/scene.yaml. To override this, simply pass the path to the scene file as the first argument.

# If on Windows, don't forget to append .exe!
Iridium

Example

Iridium data/scene.yml

Gallery

combined The default scene that is generated when run without any parameters. This corresponds to data/scene.yml.

iridium's People

Contributors

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