Skip to content

radiumyang/Project4-Rasterizer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


CIS565: Project 4: CUDA Rasterizer [Fall 2014]

video demo: http://youtu.be/kjV3lIKWtjY

alt tag alt tag alt tag

INTRODUCTION

In this project, I implemented a simplified CUDA based implementation of a standard rasterized graphics pipeline, including vertex shading, primitive assembly, perspective transformation, rasterization, fragment shading, testing and rendering. This project is based on the basecode provided at class.


FEATURES

I implemented following stages of the 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, such as Lambert or Blinn-Phong, implemented in the fragment shader

Extra features:

  • Back-face culling
  • Scissor test
  • Support for additional primitices
    • Lines
    • Points
  • Anti-aliasing

RUNNING THE CODE

Right click project -> properties -> debugging -> put the obj file here. (obj files must contain v, vn, f)

Screen interation:

  • Press "1": Point Mode (show vertices only)
  • Press "2": Wireframe Mode (show edges only)
  • Press "3": Fragment Shader Mode (show everything)

PERFORMANCE EVALUATION

###PRIMITICES RENDERING MODE

  • Blinn-Phong Shader alt tag

  • Flat alt tag

  • LINE alt tag

  • POINT alt tag To implement Point Mode, when rasterizing the triangle, just show the correspondent triangle vertices, no need to check whether one pixel is inside or outside the triangle. Thus, Point Mode has the highest FPS.

FPS Comparison between different modes:

alt tag

###BACK-FACE CULLING without backcull:

alt tag

with backcull:

alt tag

###ANTI-ALIASING without anti-aliasing:

alt tag

with anti-aliasing:

alt tag

For pixel(i,j), I use the average color value of points from pixel(i-2, j-2) to pixel(i+2, j+2) as the color of current pixel(i,j).

###SCISSOR TEST

The Scissor Test is a Per-Sample Processing operation that discards Fragments that fall outside of a certain rectangular portion of the screen.

When rasterizing the triangles, I set the scissor window as bounding box to limit the pixels that we need to process, which can help save efficiency on checking useless out-of-bound points.

alt tag


References


SUBMISSION

As with the previous project, you should fork this project and work inside of your fork. Upon completion, commit your finished project back to your fork, and make a pull request to the master repository. You should include a README.md file in the root directory detailing the following

  • A brief description of the project and specific features you implemented
  • At least one screenshot of your project running.
  • A link to a video of your raytracer running.
  • Instructions for building and running your project if they differ from the base code.
  • A performance writeup as detailed above.
  • A list of all third-party code used.
  • This Readme file edited as described above in the README section.

About

CUDA GPU Software Rasterizer

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Cuda 48.7%
  • C++ 33.4%
  • C 17.9%