DevMaster.net Forums
[[ Home | Forums | 3D Engines Database | Wiki | Articles/Tutorials | Game Dev Jobs | IRC Chat Network | Contact Us ]]

Go Back   DevMaster.net Forums > Programming & Development > Graphics Theory & Programming
User Name
Password
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
Old 10-01-2006, 08:31 AM   #26
Reedbeta
DevMaster Staff
 
Join Date: Oct 2004
Location: Seattle, WA
Posts: 4,015
Default Re: Photon Mapping Questions

Yes, you can do that. Just be sure to use Russian roulette to scale the results. It will make things go a bit faster; of course the tradeoff is that the variance in the image will be higher and you might have to use more photons in the estimate. But if your system only uses the photon map for indirect illumination, then the extra variance might not even be noticeable.
___________________________________________
Currently working at Sucker Punch
reedbeta.com - OpenGL demos and other projects
Luabridge - a lightweight, dependency-free C++/Lua binding library.
CD Lite - an unobtrusive, minimal CD player application for Windows.
Reedbeta is offline   Reply With Quote
Old 10-04-2006, 02:05 PM   #27
flux00
Valued Member
 
Join Date: Jul 2006
Location: New Jersey
Posts: 108
Default Re: Photon Mapping Questions

If I weighted the random choice by the RGB weight, I wouldn't have to scale the result right?

Photons: 500,000; search radius: 100:
http://img424.imageshack.us/img424/806/render2uh1.png

Sorry, but I have more questions. I really did read Jensen's book, but I got lost on some of the specifics, particularly color bleeding and the caustics map.

Jensen spoke as if the irradiance was gathered based on the number of photons wanted for the estimate, not on the search radius, contrary to his implementation. I think that would result in better estimates of concentrated photons, like in the caustics map. I know in order to build a caustics map, one should concentrate photons toward objects that generate caustics, but how do you render it without blurring? Would using a filter have that much of a dramatic effect on the irradiance estimate?

As far as re-emitting photons after they strike a diffuse surface, should standard ray-tracing checks be done so neither the recursion goes to deep, nor the weight gets too small?
flux00 is offline   Reply With Quote
Old 10-04-2006, 03:35 PM   #28
Reedbeta
DevMaster Staff
 
Join Date: Oct 2004
Location: Seattle, WA
Posts: 4,015
Default Re: Photon Mapping Questions

Quote:
Originally Posted by flux00
If I weighted the random choice by the RGB weight, I wouldn't have to scale the result right?

Sorry, I assumed that weighting the random choice by the weights of the BRDFs went without saying. You should definitely do that, and no, it doesn't mean you can get out of scaling the result. The result has to be divided by the weight to compensate for the fact that you're only computing one of the BRDFs. (Just to clarify: this division would cancel out the multiplication by the weight that you would ordinarily do if you were going to compute with all the BRDFs. So you end up not multiplying the result by anything. But from a theory standpoint that division is important.)

Quote:
Jensen spoke as if the irradiance was gathered based on the number of photons wanted for the estimate, not on the search radius, contrary to his implementation. I think that would result in better estimates of concentrated photons, like in the caustics map. I know in order to build a caustics map, one should concentrate photons toward objects that generate caustics, but how do you render it without blurring? Would using a filter have that much of a dramatic effect on the irradiance estimate?

Yes, the book talks about extracting a particular number of photons in the radiance estimate. However, a kd-tree doesn't let you directly extract the n nearest photons to a particular point. In order to get this, you have to make an estimate of how large a search radius you want and look for photons within a sphere (or other shape). Then you modify the search radius so as to get approximately the correct number of photons (density estimation).

Rendering a photon map involves "blurring" the photons; that's just how it works. After all, a photon map stores individual, discrete photons, but that's not what you want to see when you render something - you want to see the impression of continuous light. The idea with a caustic map is that by concentrating a lot of photons toward the specular objects you'll generate a map that has a lot of concentrated photons in the areas where the caustics are, so you'll get a lot of photons to work with in even a small radius. As for filters, they do have a visible effect on the image, and choosing the right one can make the image look a lot better. Jensen's book talks about this on pages 80-83.

Quote:
As far as re-emitting photons after they strike a diffuse surface, should standard ray-tracing checks be done so neither the recursion goes to deep, nor the weight gets too small?

Generally speaking you shouldn't modify the weights of the photons, but just randomly choose whether to re-emit the photon or not based on the reflectance of the surface. It's better for variance to have the photons all have the same energy as much as possible. Of course, this means every photon will eventually stop by chance (unless you have all 100% albedo surfaces ).
___________________________________________
Currently working at Sucker Punch
reedbeta.com - OpenGL demos and other projects
Luabridge - a lightweight, dependency-free C++/Lua binding library.
CD Lite - an unobtrusive, minimal CD player application for Windows.

Last edited by Reedbeta : 10-04-2006 at 03:38 PM.
Reedbeta is offline   Reply With Quote
Old 10-05-2006, 02:20 PM   #29
flux00
Valued Member
 
Join Date: Jul 2006
Location: New Jersey
Posts: 108
Default Re: Photon Mapping Questions

If I don't scale the BRDF according to the weight, though, how would a red wall be red? I have it set up so the BRDF is independent of the color.

And if I don't modify the weight of a diffusely reflective surface how will simulate things like color bleeding?
flux00 is offline   Reply With Quote
Old 10-05-2006, 05:22 PM   #30
Reedbeta
DevMaster Staff
 
Join Date: Oct 2004
Location: Seattle, WA
Posts: 4,015
Default Re: Photon Mapping Questions

Let me clarify what I'm talking about. For a surface with multiple BRDFs you might have, say three BRDFs called f1, f2, and f3, and the BRDF of the surface could be 0.7*f1 + 0.2*f2 + 0.1*f3. When you choose which one of those BRDFs to sample, you make the choice so that there's a 70% probability of choosing f1, then a 20% probability of choosing f2, then a 10% probability of choosing f3. If you were going to compute the whole compound BRDF, you would then compute the results for all three, then weight them and add them. But if you're doing Russian roulette, you don't weight them. That doesn't have anything to do with the color content of the BRDF, as far as I can see.
___________________________________________
Currently working at Sucker Punch
reedbeta.com - OpenGL demos and other projects
Luabridge - a lightweight, dependency-free C++/Lua binding library.
CD Lite - an unobtrusive, minimal CD player application for Windows.
Reedbeta is offline   Reply With Quote
Old 10-05-2006, 05:39 PM   #31
flux00
Valued Member
 
Join Date: Jul 2006
Location: New Jersey
Posts: 108
Default Re: Photon Mapping Questions

I actually have my BRDF's return a scalar, then have 3 weights per BRDF in the red, green, and blue spectrum respectively. The weight is detached from the BRDF though. For russian-roulette, I take the average weight of each BRDF, and then pick a random BRDF based on that.

It just seemed odd to have a diffuse BRDF with three floats for color, and then an additional float for its contribution.
flux00 is offline   Reply With Quote
Old 10-05-2006, 09:35 PM   #32
Reedbeta
DevMaster Staff
 
Join Date: Oct 2004
Location: Seattle, WA
Posts: 4,015
Default Re: Photon Mapping Questions

Quote:
Originally Posted by flux00
For russian-roulette, I take the average weight of each BRDF, and then pick a random BRDF based on that.

In that case, you should multiply the BRDF output by the red, green and blue weights, then divide all three components by that average weight.
___________________________________________
Currently working at Sucker Punch
reedbeta.com - OpenGL demos and other projects
Luabridge - a lightweight, dependency-free C++/Lua binding library.
CD Lite - an unobtrusive, minimal CD player application for Windows.
Reedbeta is offline   Reply With Quote
Old 10-08-2006, 05:42 PM   #33
flux00
Valued Member
 
Join Date: Jul 2006
Location: New Jersey
Posts: 108
Default Re: Photon Mapping Questions

Should that be done for both the radiance estimate and the re-emission of photons due to diffuse reflection?
flux00 is offline   Reply With Quote
Old 10-08-2006, 06:15 PM   #34
Reedbeta
DevMaster Staff
 
Join Date: Oct 2004
Location: Seattle, WA
Posts: 4,015
Default Re: Photon Mapping Questions

Yes. That's because when doing the radiance estimate, you'll use the incoming photons at a surface, which haven't had the BRDF of that surface applied to them.
___________________________________________
Currently working at Sucker Punch
reedbeta.com - OpenGL demos and other projects
Luabridge - a lightweight, dependency-free C++/Lua binding library.
CD Lite - an unobtrusive, minimal CD player application for Windows.
Reedbeta is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Forum Jump


All times are GMT -7. The time now is 04:35 AM.


Powered by vBulletin
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.