Skip to content

mchen15/Project4-Rasterizer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


CIS565: Project 4: CUDA Rasterizer

Bunny


OVERVIEW:

In this project, I implemented parts of the opengl rasterization pipeline in CUDA. Namely, vertex shader, vertex assembly with support for triangle VBOs/IBOs, perspective transformation, rasterization, fragment shading, back-face culling, anti-aliasing, and mouse-based interactive camera.

The vertex shader kernel is responsible for converting all coordinates (positions and normals) into the desired coordinate system (screen space or world space). Then, all information is passed to the vertex assembly kernel for constructing each primitive. If back-face culling is enabled, then the primitives will be passed to the back-face culling kernel where faces that are not facing the camera will be discarded. Next, the rasterization kernel will compute fragments colors, positions, and normals based on barycentric coordinates of each primitive and write the result to the depth buffer. The depth buffer is then passed to the fragment shader for simple lambertian shading. The results are then filled into the framebuffer and shown on screen.

Video

Anti-aliasing comparison: Without anti-aliasing: No Anti-Aliasing No Anti-Aliasing

With anti-aliasing: Anti-Aliasing Anti-Aliasing


PERFORMANCE EVALUATION

For the performance analysis, I tested the average rendering time with or without certain features. Below is the running time comparsion

results

As expected, the lighting computation and the anti-aliasing step drastically increases the running time. In this test, I was using 4 light sources with the bunny obj file, which contains 4968 faces and 2503 vertices.


REFERENCES

OpenGL Rendering Pipeline

OpenGL Transformation

OpenGL Projection Matrix

The Viewport Transformation

GLUT Camera Movement

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 53.6%
  • C++ 46.2%
  • CSS 0.2%