Showing posts with label Tracer. Show all posts
Showing posts with label Tracer. Show all posts

Tuesday, May 7, 2013

Progressive Photon Mapper

During the past few weeks I've been trying to write a new tracer. After careful consideration I choose to implement a progressive photon mapping integrator within my own architecture, which I simplified and customized based on the one in PRBT book.

Right now I have only a simple scene to show the result of the integrator, later I'll focus more on the other part of the tracer (bsdf, weighting system, sampling, performance etc).

Here's a comparison image of the PPM integrator

First one has only one photon gathering pass, and second with 10 photon gathering pass. Each pass has 200K photons.

Direct lighting and indirect light are not decoupled, which makes the most mathematical sense to me.
pass 1

pass 10

Well I just realized this is not convincing enough. I should do a comparison between 200K photons per pass with 10 pass and 2M photon with 1 pass, and that would be my next post with other features added.


Friday, September 14, 2012

New demo for the GPU tracer

the image rendered with tone mapping satisfied me a lot. So I made a new demo for the tracer. I turned off the antweak bar and the fps viewer for less distraction.

Here's the new demo:

Monday, September 10, 2012

Tone mapping

I made a slight change to my GPU path tracer in color transferring.

Previous I was using gamma correction, with gamma equals 2.2, now I'm using the tone mapping operator proposed by Paul Debevec. 

The difference is shown as following:

In the 1st comparison group I turned off the depth of field, just in order to focus on the color difference. And the render time is only 150s, no sufficient for full convergence but good enough for color comparison.
 Image rendered with tone mapping operator
Image rendered with Gamma correction

In the 2nd comparison group I kept all the features on and take 600s for the image to be fully converged.

Image rendered with tone mapping operator

Image rendered with Gamma correction

For the gamma correction group I'm using radiance 16 for the light, but for the tone mapping group I'm using 75 for light.

Personally speaking I prefer tone mapping. It's not that shiny and looks way much better!

New tracer

Based on the fact that I got stuck in implementing the GPU KD-tree paper, I decided to turn to something else.

I've been reading things related to HDR and found it's pretty interesting, and I'm not satisfied with my previous two tracers. So I want to re-write my tracer.

The plan could be like:

Step 1: set up the all the openGL stuff. Rendering everything on to a frame buffer and display the frame buffer with time. Setting up the basic scene is necessary for this step, including camera and the most simple ray trace function(could be just returning a color based on the pixel coordinates).

Step 2: enrich the scene. Setting up objects class and material class. Implement basic ray trace algorithm, which is easy. The material class should be compatible with the HDR, cause that's what I'm trying to focus on for this project. The result of this step is ray-traced image of a simple scene(could be a cornell box with a single sphere).

Step 3: build a CPU kd-tree for complicated objects like stanford bunny or armadillo. Change ray trace with monte carlo path trace. My implementation of material class have to be changed to be better modulized to used BRDF. The result of this one should be a nice rendered image which could function as reference image. Yet the process must be really slow.

Step 4: try implementing the GPU kd-tree paper again and ship everything onto GPU, or try implement photon mapping in the tracer. Haven't thought about that far yet.

Hopefully this project could keep me busy for a while. I'll keep the progress updated.

Sunday, May 20, 2012

GPU Path Tracer

Path tracing algorithm is extremely suitable for GPU implementation. So I made a GPU path tracer using C++ and CUDA.

The whole process is tracked in another blog of mine here: http://xingdugpu.blogspot.com/
And the final result is the first post.

My first step is to build a GPU ray tracer. I could build path tracer or photon mapping tracer with such a basic framework. All the preparation stuffs are done in this part, like how to upload the scene to GPU using a texture, and how to display a texture in the view port.
Here's a demo showing the result of the simple GPU ray tracer.

The next step is turn it into a path tracer. The algorithm actually is more simple for path tracing. For each hit point, no matter it is diffuse or reflective or refractive, one secondary ray has to be generated. The only difference lies in the BRDF, so it's more uniformed and more suitable for GPU implementation. A rough result could be seen from the following images.
Yet, the refraction is not correct. Not only because I used a low max depth, but also because no fresnel reflection is included. To make it right, fresnel reflection is added. Also the depth of field is included by changing the camera model and doing a distributed ray tracing, and it is for free in path tracing. Images below shows the result adding depth of field and fresnel reflection.

The last step is tuning the color. The radiance gathering process is using radiance instead of rgb values. A gamma correction is used here to generate more mild images as below:

Other available resources about the project are listed here. 
The paper's my favorite.