Skip to content

Assignments for Computer Graphics course

License

Notifications You must be signed in to change notification settings

ihsingh2/ray-tracing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Brief

Implementation of Pixel Subsampling, Area Lighting and Importance Sampling.

Pixel Subsampling

$$\textbf{p}_{xy} = \textbf{t}_l + \left( \cfrac{x + \xi}{i_w} \right) \cdot (v_w \textbf{u}) + \left( \cfrac{y + \xi}{i_h} \right) (-v_h \textbf{v})$$

Importance Sampling

  • Uniform Hemisphere Sampling
$$\langle L_o (\textbf{x}, \boldsymbol{\omega}_o) \rangle = \cfrac{2 \pi}{N} \sum_{i = 1}^N f(\textbf{x}, \boldsymbol{\omega}_o, \boldsymbol{\omega}_i) L_i(\textbf{x}, \boldsymbol{\omega}_i) \cos \theta$$
  • Cosine Sampling
$$\langle L_o (\textbf{x}, \boldsymbol{\omega}_o) \rangle = \cfrac{\pi}{N} \sum_{i = 1}^N f(\textbf{x}, \boldsymbol{\omega}_o, \boldsymbol{\omega}_i) L_i(\textbf{x}, \boldsymbol{\omega}_i)$$
  • Area Light Sampling
$$\langle L_o (\textbf{p}, \boldsymbol{\omega}_o) \rangle = \cfrac{\lvert A \rvert}{N} \sum_{i = 1}^N \cfrac{ f(\textbf{p}, \boldsymbol{\omega}_o, \boldsymbol{\omega}_i) L_i(\textbf{p}, \boldsymbol{\omega}_i) \cos \theta \cos \theta_l }{ r^2 }$$

Instructions

Steps to build

git clone --recursive https://github.com/ihsingh2/simple_renderer
mkdir build
cd build
cmake ..
make -j8

Steps to run

git clone https://github.com/ihsingh2/scenes
./build/render <scene_path> <out_path> <num_samples> <sampling_strategy>

About

Assignments for Computer Graphics course

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •