Vertex Shader & Primitive Assembly
I started coding for CUDA rasterizer on Monday this week. But all thanks to Sandy, I lost my power by midnight. BY that time I finished my vertex shader and primitive assembly. They were straight forward.
I used following blogs for the implementation: http://www.opengl-tutorial.org/beginners-tutorials/tutorial-3-matrices/
On thursday morning, yes thats when my light came back, I started working on rasterization step. It took me 2 days to complete it.
The major difficulty I was facing was that my code kept crashing for resolution greater than 200 by 200. Its still not working for more than 400 by 400. Also, when I implemented atomics in the code, Visual studio was not able to recognize any of the atomic functions. The reason was that I was using CUDA 4.2 instead of CUDA 4.0. Hence , I change the setting in projectProperties->CUDA->Device-> code generation to sm_20 instead of sm_10.
Now, I have implemented fragment shader as well.
But the phong highlight is not very apparent from the image. May be due to the resolution. But, I would not worry about the resolution for now. First I will complete the other functionality.
I can set the resolution of 800 by 800 for the cow but not for the cube.
Back Face Culling
Just Implemented Back Face culling.
However, sometimes there is a lag in generating a face while the model is continuously rotating.
I resolved it by increasing the threshold for the dot product comparison.
There is one more issue that it is slow after implementing back face culling. Gives 9 FPS otherwise it is 12 or 13FPS.
The most easiest part of the assignment. Increases the render rate to 15-16FPS.