Light tracing image conversion

Practical and theoretical implementation discussion.
Post Reply
Benjamin-L
Posts: 5
Joined: Wed May 07, 2014 4:50 am

Light tracing image conversion

Post by Benjamin-L » Sat May 10, 2014 4:00 pm

I am attempting to implement bidirectional path tracing in my renderer but I have run into a problem handling the light image. I am able to compute the screen space location of light samples but I still have no way to normalize these samples into a correct image. I have two main problems here. The first is that I am not quite sure how to set it up so that the areas with less samples contribute less light without making the whole image have a different exposure from the path tracing reference. The problem is that when I specifically divide by a constant then the image changes brightness when I change the number of samples but I can't seem to find the right expression that is dependent on the image size and number of samples (I think the size issue might be related to the next problem). The second problem I am having is that I cannot seem to find the right expression for converting the flux into luminance depending on the distance from the camera. The farther that the sample is from the camera the more it should contribute less because the samples are more dense farther away from the camera. I am currently getting images that look like this:
cornell_lightspace.png
cornell_lightspace.png (469.35 KiB) Viewed 6511 times
while a photon mapping reference looks like this (path tracing does not work for the caustics):
cornell_photon.png
cornell_photon.png (349.5 KiB) Viewed 6511 times
Last edited by Benjamin-L on Thu May 15, 2014 2:10 am, edited 3 times in total.

beason
Posts: 52
Joined: Sat Dec 10, 2011 1:58 am
Location: Los Angeles, CA

Re: Light tracing image conversion

Post by beason » Mon May 12, 2014 10:55 pm

I don't see any images

Benjamin-L
Posts: 5
Joined: Wed May 07, 2014 4:50 am

Re: Light tracing image conversion

Post by Benjamin-L » Mon May 12, 2014 11:50 pm

I fixed the images now. The problem was that I was using Google Drive to host them but forgot to make the images public so I saw them because I was logged in but nobody else was able to.

Dade
Posts: 206
Joined: Fri Dec 02, 2011 8:00 am

Re: Light tracing image conversion

Post by Dade » Tue May 13, 2014 8:07 am

Benjamin-L wrote:I fixed the images now. The problem was that I was using Google Drive to host them but forgot to make the images public so I saw them because I was logged in but nobody else was able to.
Nope, you can not share images on forums via Google Drive, it is a known (stupid) limitation. Anyway the images still seem to not have public access rights.

Benjamin-L
Posts: 5
Joined: Wed May 07, 2014 4:50 am

Re: Light tracing image conversion

Post by Benjamin-L » Tue May 13, 2014 11:27 pm

I fixed it (hopefully) correctly this time by uploading the images as attachments. I didn't realize that this was possible originally. The limitation with Google Drive is very strange since I think that I signed out of my account on Google before copying the links. I hope this solves the problem. Sorry that I did not do this in the first place.

Dade
Posts: 206
Joined: Fri Dec 02, 2011 8:00 am

Re: Light tracing image conversion

Post by Dade » Wed May 14, 2014 7:28 am

About your problem: you need 2 image buffers, in the first one, you accumulate the eye path samples (and the weight of each sample), in the second, you accumulate light path samples. When you want to update the screen or save the rendering, you have only to:

1) divide each pixel in the first buffer by the stored weight (i.e. the average of sample values);

2) divide each pixel in the second buffer by the number of light paths traced;

3) merge the 2 buffers.

This is the generic solution that works with any kind of samplers (i.e. Metropolis, etc.) and any number of eye/light path ratio.

P.S. I suggest you to check http://www.smallvcm.com, it can answer to a lot of your questions about BiDir (even if it doesn't use the generic solution described above).

Benjamin-L
Posts: 5
Joined: Wed May 07, 2014 4:50 am

Re: Light tracing image conversion

Post by Benjamin-L » Thu May 15, 2014 2:10 am

Thanks for the SmallVCM resource, that looks very helpful for this. I also realized that I made yet another mistake with the images: I swapped them. That is also fixed now.

Post Reply