Skip to content

Assignment developed during the Photorealistic Computer Graphics course @ Computer Science studies @ University of Wrocław.

Notifications You must be signed in to change notification settings

pawel5z/photorealistic_cgfx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

photorealistic_cgfx

Path tracer developed during the Photorealistic Computer Graphics course @ Computer Science studies @ University of Wrocław.

Features

  • Fast ray-triangle intersection computation using k-d tree.
  • Output in EXR format.
  • Adjustable number of threads used during the rendering.
  • Adjustable render resolution and camera parameters using RTC (Rendering Task Configuration) file.
  • Scene preview with option to set new camera position.

RTC (Rendering Task Configuration) file format

Source: https://ii.uni.wroc.pl/~anl/dyd/RGK/.

RTC file consists of the following lines. The first seven are mandatory.

comment line
obj/file/path
output/file/path
k (recursion level)
xres yres (image resolution)
VPx VPy VPz (camera position)
LAx LAy LAz (point for camera to look at)
UPx UPy UPz (camera's up direction, optional)
yview (image height to focal length ratio, optional)

In absence of UP vector, one will be inferred from VP and LA. yview defaults to 1.0.

Example
#
CornellBox-Original.obj
CornellBox-Original.exr
16
600 400
0.0 1.0 3.0
0.0 1.0 0.0
0 1 0
1

Example renders

💖🎆🌟🎇 CLICK TO VIEW 💖🎆🌟🎇

bmw-16384

CornellBox-Original-4096

CornellBox-Glossy-16384

conference-8192-0

Usage

Usage: ./raytrace [OPTION...] RTC_FILE
Render scene specified in RTC_FILE using ray tracing.
Options:
  -h [ --help ]                Print this help message.
  -n [ --threads ] arg (=-1)   Number of threads used for rendering. -1 
                               (default) means number of available CPU cores.
  -s [ --samples ] arg (=1024) Number of samples per pixel.
  -p [ --preview ]             Preview scene.
                               Controls:
                                LMB+move: look around
                                w: move forward
                                s: move backward
                                a: move left
                                d: move right
                                r: move up
                                f: move down
                                e: roll right
                                q: roll left
                                backspace: reset view
                                left shift: accelerate
                                left ctrl: decelerate
                                enter: overwrite rtc file camera settings with 
                                       current ones
                                space: render current view
                                esc: quit

Requirements

Required libraries

  • Assimp
  • OpenGL
  • GLFW
  • Boost Program Options
  • OpenEXR

On Debian-based distributions, the above can be installed with

sudo apt install libassimp-dev libepoxy-dev libgl-dev libglfw3-dev libboost-program-options-dev libopenexr-dev

About

Assignment developed during the Photorealistic Computer Graphics course @ Computer Science studies @ University of Wrocław.

Topics

Resources

Stars

Watchers

Forks

Languages