GithubHelp home page GithubHelp logo

mvp18 / ray-tracer Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 223.44 MB

Ray Tracer Implemented for the Computer Graphics-I course at UdS (Winter 2022-23)

License: MIT License

CMake 1.11% C++ 61.82% C 37.07%

ray-tracer's Introduction

Course Webpage

https://graphics.cg.uni-saarland.de/courses/cg1-2022/index.html

Setup

Installing build tools and libraries

Ubuntu

sudo apt update # update package index
sudo apt install -y build-essential git cmake # install build tools
sudo apt install -y xorg-dev libglu1-mesa- dev zlib1g- dev zenity # install dependencies for tev
sudo apt install -y libpng-dev # install the PNG library required by our framework

macOS

brew install cmake # install CMake
brew install libpng # install the PNG library required by our framework

Installing VSCode

Ubuntu

sudo snap install --classic code

Alternatively, you can download a .deb from https://code.visualstudio.com/#alt-downloads and run:

sudo dpkg -i ~/Downloads/code_*.deb # path to downloaded .deb file

macOS

brew install visual-studio-code

Installing tev (image viewer, optional)

Ubuntu

Tev needs to be installed from source, which is luckily a straightforward process

git clone --recursive https://github.com/Tom94/tev.git
mkdir tev/build && cd tev/build
cmake ..
sudo make -j i nstall

macOS

Go to https://github.com/Tom94/tev/releases and download the latest tev.dmg. Open the dmg file and move tev to your Applications folder. For security reasons, the first time you run tev you must right click on the application and click “Open”.

Build

You would need to install 2 extensions in VSCode:

  • The “CMake Tools” extension to be able to build your project
  • The “C/C++” extension enables intelligent code completion and debugging.

CMakeLists.txt allows you to use any build system. The respective assignment-xx.cmake lists all files that were added with a particular assignment. On Linux libpng-dev is required for the build and should be automatically detected.

By invoking:

mkdir build_debug && cd build_debug # create and enter a build directory for CMake
cmake -DCMAKE BUILD TYPE=Debug .. # configure the project in debug mode
cmake --build . # compile the project, producing executable cgray

For release mode use cmake -DCMAKE BUILD TYPE=Release .. in a different build release directory respectively.

Features

Cameras

  • Perspective Camera: rt/camera/perspective.h
  • Depth of Field Perspective Camera: rt/camera/dofperspective.h
  • Orthographic Camera: rt/camera/orthographic.h
  • Fish Eye Camera: rt/camera/fisheye.h
  • Environment Camera: rt/camera/environment.h

Solids

  • Sphere: rt/solids/sphere.h
  • Axis-Aligned Bounding Box: rt/solids/aabox.h
  • Triangle: rt/solids/triangle.h
  • Smooth Triangle: rt/solids/striangle.h
  • Disc: rt/solids/disc.h
  • Plane: rt/solids/infiniteplane.h
  • Quad: rt/solids/quad.h
  • Environment Solid: rt/solids/environmentsolid.h

Acceleration Structures

  • Bounding Volume Hierarchy: rt/groups/bvh.h

Materials

  • Conductors: rt/materials/conductor.h
  • Fuzzy Conductor: rt/materials/fuzzyconductor.h
  • Dielectrics: rt/materials/dielectric.h
  • Flat Material: rt/materials/flatmaterial.h
  • Lambertian: rt/materials/lambertian.h
  • Phong: rt/materials/phong.h
  • Combined Material: rt/materials/combine.h

Lights

  • Point Light: rt/lights/pointlight.h
  • Directional Light: rt/lights/directional.h
  • Spot Light: rt/lights/spotlight.h
  • Area Light: rt/lights/arealight.h
  • Ambient Light: rt/lights/ambientlight.h

Textures

  • Constant Texture: rt/textures/constant.h
  • Image Texture: rt/textures/imagetex.h
  • Checkerboard Texture: rt/textures/checkerboard.h
  • Perlin Noise: rt/textures/perlin.h

Coordinate Mappers

  • World Mapper: rt/coordmappers/world.h
  • Plane Mapper: rt/coordmappers/plane.h
  • Cylinder Mapper: rt/coordmappers/cylindrical.h
  • Spherical Mapper: rt/coordmappers/spherical.h
  • Triangle Mapper: rt/coordmappers/tmapper.h
  • Environment Map: rt/coordmappers/environment.h
  • Quad Mapper: rt/coordmappers/quadmapper.h

Sample Images

The rendered images for each assignment and also the rendering competition are stored in the images folder. Models required for main/a_RC.cpp can be found here. You can find further details about our submission for the rendering competition here.

References

ray-tracer's People

Contributors

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