Skip to content

jeremynewlin/Rasterizer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Software Rasterizer in CUDA

Features

Here's a quick down break down of the 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
  • Back face culling
  • Mouse based interaction
  • Color interpolation

Here is a render! Base PT Image

I'm going to talk about the performance of the system briefly. All times are measured with the dragon file, which is 100,000 triangles.

  • Base code (io really) 0.007 ms total per frame
  • With vertex shader 0.008 ms total per frame
  • With assembly 0.0095 ms total per frame (+18.75%)
  • Rasterization step 0.012 ms total per frame (+26%)
  • Rasterization step with back face culling 0.011 ms total per frame (-19%)
  • Fragment shader 0.013 ms total per frame (+18%)
  • Fragment shader w/color interpolation 0.013 ms total per frame (+18%)
  • Render step 0.014 ms total per frame (+7%)

So, culling unseen faces save you on render pretty substantially! And color interpolation didn't affect things in a noticeable way.

ee Blue is with back face culling, red is without.

And mouse based scrolling obviously doesn't affect anything. in terms of performance.

http://youtu.be/rjKDOhJbNLc

About

CUDA GPU Software Rasterizer

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Cuda 40.7%
  • C++ 37.9%
  • C 21.4%