Skip to content

GabriellaQiong/Project4-Rasterizer

 
 

Repository files navigation


CIS565: Project 4: CUDA Rasterizer

Fall 2013

Qiong Wang


INTRODUCTION:

This is a course project based on CUDA for CIS 565 GPU Programming. The standard rasterization pipeline was implemented as the following steps:

  1. Vertex Shader;
  2. Primitive Assembly;
  3. Rasterization(including basic back face culling);
  4. Fragment Shader;
  5. Rendering(including anti-aliasing)
  6. Write to framebuffer

IMPLEMENTED FEATURES:

Basic Graphics Pipeline and Features:

  • Vertex Shading
  • Primitive Assembly with support for triangle VBOs/IBOs
  • Perspective Transformation
  • Rasterization through either a scanline or a tiled approach
  • Fragment Shading
  • A depth buffer for storing and depth testing fragments
  • Fragment to framebuffer writing
  • A simple lighting/shading scheme with Lambert and Blinn-Phong in the fragment shader

Additional Features:

  • Transformation feedback
  • Back-face culling
  • Atomic Compare and Swap for depth test
  • Color interpretation between points on a primitive
  • Anti-aliasing
  • Both mouse-based and keyboard-based interactive camera support
  • Multi-color lighting

OPERATION INSTRUCTION

In 22nd line of rasterizeKernels.h, the flag can be changed to 1 to use anti-aliasing mode as default.

#define ANTIALIASING 0

Mouse Interaction

Operation Function
Left and right click drag rotate around y-axis
Up and down click drag rotate around x-axis

Keyboard Interaction

Operation Function
up-arrow zoom in along view direction
down-arrow zoom out along view direction
left-arrow rotate from right to left
left-arrow rotate from left to right
'[' rotate from down to up
']' rotate from up to down
'd' depth mode or not
'f' flat-color mode or not
'`' white color in flat-color mode
'1' red color in flat-color mode
'2' green color in flat-color mode
'3' blue color in flat-color mode
'4' purple color in flat-color mode

SCREENSHOTS OF RESULTS

  • Depth in z-axis

ScreenShot

  • Transformation Feedback

ScreenShot

  • Color Interpolation

ScreenShot

  • Color Interpolation with Back Face Culling

ScreenShot

  • Flat Color with diffusion and specular reflection

ScreenShot

ScreenShot

ScreenShot

ScreenShot

  • Anti-aliasing

Without anti-aliasing

ScreenShot

With anti-aliasing

ScreenShot

  • Multi-color Lighting

ScreenShot


VIDEOS OF RESULTS

This is the video of my CUDA rasterizer including mouse interaction and keyboard interaction

ScreenShot

The youtube links are here if you cannot open the video in the markdown file: http://www.youtube.com/watch?v=rb--TBxSOmw


PERFORMANCE EVALUATION

Here is the table for the performance evaluation when adding different features to the rasterized cow.

Feature approximate fps
Color Intepolation 7~8
Z-depth 9~10
Anti-aliasing 5~6
Multi-color Lighting 4~5
Back Face Culling 8~9

Note: the color interpolation without backface culling here is the default mode the z-depth mode and anti-aliasing and multi-color lighting all based on the color interpolation mode.

We can see that the back-face culling increase the frame per second a little bit while other features such as anti-aliasing, multi-color lighting all decrease the frame rate somehow.


REFERENCES


ACKNOWLEDGEMENT

Thanks a lot to Patrick and Liam for the preparation of this project. Thank you :)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 53.4%
  • C++ 46.4%
  • Other 0.2%