Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
96 changes: 90 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,95 @@
<p align="center">
<img src="images/finalgif.gif">
</p>

**University of Pennsylvania, CIS 565: GPU Programming and Architecture,
Project 5 - DirectX Procedural Raytracing**

* (TODO) YOUR NAME HERE
* (TODO) [LinkedIn](), [personal website](), [twitter](), etc.
* Tested on: (TODO) Windows 22, i7-2222 @ 2.22GHz 22GB, GTX 222 222MB (Moore 2222 Lab)
* Author: Chhavi Sharma ([LinkedIn](https://www.linkedin.com/in/chhavi275/))
* Tested on: Windows 10, Intel Xeon CPU E5-2687W v3 @ 3.10GHz 22GB, NVIDIA TITAN V 12GB (SIGLab-VR1)


### Index

- [Introduction]( https://github.com/chhavisharma/Project5-DirectX-Procedural-Raytracing#introduction )
- [Performance Analysis](https://github.com/chhavisharma/Project5-DirectX-Procedural-Raytracing#performance-analysis )
- [Results]( https://github.com/chhavisharma/Project5-DirectX-Procedural-Raytracing#results )
- [Bloopers](https://github.com/chhavisharma/Project5-DirectX-Procedural-Raytracing#bloopers)

### Introduction

In this project, we use Microsoft's DirectX Raytracing API to ray trace procedural geometries. The code is divided into two categories, the CPU pipline for allocation and setup of DXR buffers, and, the the GPU rendering pipeline to execute the ray tracing. Microsoft introduced the DirectX Raytracing (DXR) API to allow ease of use of GPU-accelerated ray tracing in DirectX and also for interoperability with the DirectX rasterization.

*Raytracing*, is a rendering technique for generating an image by tracing the path of light through pixels in an image plane. In ray tracing, a light ray is shot from the camera center through each pixel. It is traced as it intersects different objects in the scene. At each interseciton, the ray is sent to to the light source, and, other rays are generated based on the material properties ( eg. reflection). If the ray interseacts another object on its way to light, then it is categorised as a shadow ray and color is assosiated with it accordingly.

<p align="center">
<img src="https://github.com/CIS565-Fall-2019/Project5-DirectX-Procedural-Raytracing/blob/master/images/raytrace.jpg">
</p>


This diagram summarizes the DXR execution pipeline for each ray:

<p align="center">
<img src="https://github.com/CIS565-Fall-2019/Project5-DirectX-Procedural-Raytracing/blob/master/images/pipeline.png">
</p>

DXR also implements special Acceleration Structures namely `Bottom Level Acceleration Structure` and `Top Level Acceleration Structre` to speed up the intersection search over all objects in the scene. The BLAS hold unique defifnitions of different categories of objects in the scene. The TLAS hold various instantiations of BLAS objects which could be scaled, translated and rotated. Once these buffers are specified, DXR automatically builds optimised search routines using algorithms suck as KD-Tree search to speed up the process.

<p align="center">
<img src="https://github.com/CIS565-Fall-2019/Project5-DirectX-Procedural-Raytracing/blob/master/images/accelexplained.png">
</p>

We implement the [Phong](https://en.wikipedia.org/wiki/Phong_reflection_model) lighting model which is an empirical model of the local illumination of points on a surface using Ambient, Diffuese and Specular lighting. We also implement Schlick's Approximation for Fresnel reflection effects on the objects.

### Performance Analysis

As the recursion depth increases, the frame rate drops. Most of the rays terminate at the light source after a few bounces so there isn't significant FPS drop after depth 6-7. Visibly, there isn't much gain in the the rendering quality therfore recursion depth of 3 is sufficient to render well defined images for the given scene.

<p align="center">
<img src="images/fps_vs_recursion.png">
</p>

### Results

#### Progress Per Section

<p align="center"> Trace Rays | Miss Shaders | Intersection Shaders (Metaballs & AABBS) </p>
<p align="center"> Phong Lighting Model Shading, Schlick's Approximation | Closest Hit Shaders </p>

<p align="center">
<img src="images/1.gif", width=280>
<img src="images/2.gif", width=280>
<img src="images/3.gif", width=280>
</p>
<p align="center">
<img src="images/4.gif", width=280>
<img src="images/5.png", width=280>
<img src="images/6.gif", width=280>
</p>

#### Final Render

<p align="center">
<img src="images/perfect.png">
</p>
<p align="center">
<img src="images/final2.gif", width=430>
<img src="images/final3.gif", width=430>
</p>

### Bloopers

- Error computing Meta-Ball potential, (incorrect range)
<p align="center">
<img src="images/PotentialError.png">
</p>

### (TODO: Your README)
- Error computing Shadow Rays
<p align="center">
<img src="images/Shadows.png">
</p>

Include screenshots, analysis, etc. (Remember, this is public, so don't put
anything here that you don't want to share with the world.)
- Error in color computation
<p align="center">
<img src="images/Color.png">
</p>
Binary file added images/1.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/2.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/3.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/4.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/6.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/682ee0362d09a599269444e90f5fc6ce.mp4
Binary file not shown.
Binary file added images/Color.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/PotentialError.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/Shadows.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/blastlas.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ezgif.com-gif-maker.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/final.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/final2.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/final3.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/finalgif.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/fps_vs_recursion.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/perfect.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/q1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/q12.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/q122.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/q13.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/q133.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/.DS_Store
Binary file not shown.
Loading