Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project 4: Liam Dugan #27

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
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
45 changes: 37 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,47 @@
CUDA Rasterizer
===============
**University of Pennsylvania, CIS 565: GPU Programming and Architecture, Project 4 - Rasterizer**

[CLICK ME FOR INSTRUCTION OF THIS PROJECT](./INSTRUCTION.md)
* Liam Dugan
* [LinkedIn](https://www.linkedin.com/in/liam-dugan-95a961135/), [personal website](http://liamdugan.com/)
* Tested on: Windows 10, Ryzen 5 1600 @ 3.20GHz 16GB, GTX 1070 16GB (Personal Computer)

**University of Pennsylvania, CIS 565: GPU Programming and Architecture, Project 4**
![](images/duck.gif)

* (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)
What is Rasterization?
=============

### (TODO: Your README)
<img align="right" src="images/rasterization.png">

*DO NOT* leave the README to the last minute! It is a crucial part of the
project, and we will not be able to grade you without a good README.
Rasterization, unlike path or ray tracing has no concept of light rays and is therefore a much faster method of rendering 3D models to the screen.

A rasterizer pipeline has 5 basic stages:
1. **Vertex Shader** -- Transforms the vertices to the correct coordinates
2. **Primitive Assembly** -- Assembles the vertices into triangles
3. **Rasterization** -- Determine what pixels on the screen correspond to each triangle
4. **Fragment Shader** -- For each pixel, determine the color and lighting effect to use
5. **Output** -- Write the color values for each pixel to the output

Each of these stages is **Embarassingly Parallel** so rasterization is sped up greatly with the help of the GPU.

For example, instead of looping over each pixel for every triangle in a scene sequentially, we can instead create one thread per triangle and have all threads loop over only their own triangle's bounding box. This allows rasterization to give smooth real time rendering of 3D models.

Extra Features
=============

UV texture mapping & Super-Sample Antialiasing
-------

![](images/truck.png)

By interpolating between the texture coordinates of each vector we are able to get a mapping from a texture onto our model. Additionally, if we render the model at x4 resolution and then scale it down, we can get an image that is of much higher quality and has much fewer artifacts.

Color interpolation
-------
![](images/cowGray.png)
![](images/cowMulti.png)

By assigning the color of a given pixel to be equal to it's barycentric coordinate with respect to a triangle, we get a very nice multicolor effect that shows off how many triangles there are in these models.


### Credits
Expand Down
Binary file added images/cowGray.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/cowMulti.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/duck.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/rasterization.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/truck.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ set(SOURCE_FILES

cuda_add_library(src
${SOURCE_FILES}
OPTIONS -arch=sm_20
OPTIONS -arch=sm_61
)
Loading