Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
107 lines (81 sloc) 3.14 KB

CUDA Rasterizer

University of Pennsylvania, CIS 565: GPU Programming and Architecture, Project 4

  • Kaixiang Miao
  • Tested on: Windows 7, i7-3630QM @ 2.40GHz 8GB, GTX 660M 2GB (Lenovo Y580 laptop, personal computer)

Screenshot


Perspective-correct Color Interpolation

duck.gltf (Blinn-Phong) cow.gltf (Blinn-Phong) flower.gltf (Lambert)

Bilinear Texture Mapping

duck.gltf CesiumMilkTruck.gltf

Perspective-correct Texture Mapping

Bad Mapping Nice Mapping

Bilinear Texture Mapping

Bilinear Off Bilinear On

Backface Culling

Backface Culling Off Backface Culling On

###Performance Analysis

Kernel Time of Different Stages

The kernel time of different stages of different .gltf files is shown as below. However, in spite of the fixed distance from the object, the objects have different scale factors, which make the stacked chart below less meanningful.

Instead of comparing different objects, different distance from the object duck.gltf to the opsition of the camera is applied.

As the camera getting closer and closer, the rasterizer stage takes up more time. It illustrates that as the object taking up more and more area of the screen, the workload of the rasterizer becomes heavier because of the large area of primitives and more pixels needed to be filled by scanline.

The following graph shows the duration of the fragment shader of duck.gltf. Although the value is increasing, the ratio of this stage is decreasing, because of the steeper increase of the duration of the rasterzier stage. Besides, the duration of the vertex shader, the primitive assembly and the backface culling does not vary much because the number of vertices, primitives and backfaces is not relevant to the distance.

Backface Culling

Backface Culling reduce lots of execution time of both fragment shader and the rasterizer stage.

With no backface culling, the stacked chart appears different from the one shown at the beginning. The rasterizer stage takes up most duration because the rasterizer is shading numerous redundant primitives.

Credits