Friday, October 12, 2012

Path Tracer--Got basic features right

  • Anti-aliasing:
Added a random offset when each ray is generated.


   
I don't know why there are white lines on the white sphere.


  • Depth of Field:
 Get the focused plane and shake the camera certain random amount in X and Y direction.

  • Short Demo: 

Path tracer--Got the color right

I made mistakes in the Accumulate function for color accumulation.
Here is the corrected one rendered scene I got:

Tuesday, October 9, 2012

Path Tracer -- Always get flat shading


I implemented:
  • calculateBSDF
  • calculateFresnel
  • calculateTransmissionDirection.
  • stream compaction
But the rendered picture I got is always flat shading. And the color doesn't looks right.

The problem is that in remove_if function I accidentally remove all the rays that need to continue tracing. For the colors, that is because I used plus instead of multiply.

Correctted that I got this:

Error : expected an identifier

 error : expected an identifier    C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\include\thrust\device_ptr.h    286

the problem turned out to be with the inclusion of the thrust headers themselves. Even just including thrust/device_ptr.h threw up errors. For some reason, the thrust headers have to be included before all the other 'C' headers in this project.

Sunday, September 30, 2012

Pushing to Git returning Error Code 403 fatal

Pushing to Git returning Error Code 403 fatal: HTTP request failed

Why:
Github seems only supports ssh way to read&write the repo, although https way also displayed 'Read&Write'. So you need to change your repo config on your PC to ssh way:

Solution:
  1.  Manually edit .git/config file under your repo directory. Find url=entry under section [remote "origin"]. Change all the texts before @ symbol to ssh://git. Save config file and quit. now you could use git push origin master to sync your repo on GitHub
  2.  Another solution is just use shell command:
git remote set-url origin ssh://git@github.com/username/projectName.git

Interactive Camera and specular reflection

  • Interactive Camera
Interactive camera is done. Now the camera position can be controled by keyboard input.
Keys:
      'W': move forward(in Z direction)
      'S': move backward(in Z direction)
      'A': move to left
      'D': move to right
      'U': up
      'I': down

  •  Specular Relection
Specular not correct, still working on it.


Reflection not right:

Without reflection:

Wierd Pattern on the Back Wall

Feautures implemented:
  • Raycasting from a camera into a scenen through a pixel grid
  • Phong lighting for one point light source
  • Diffuse lambertian surfaces
  • Raytraced shadows
  • Cube intersection testing
  • Sphere surface point sampling
I don't know what happened to that wall. The diffuse and  ambient


Finally, I found out why. It is because I used EPSILON in the box-ray intersection set when the ray parrelle with one plane. EPSILON is defined as 0.000000001, which seems too small for a float number camparation. I have changed it to 0.001. 
Now, the picutre looks like this: