Phaton gathering
#1
Posted 12 March 2012 - 01:04 AM
#2
Posted 12 March 2012 - 01:26 AM
#3
Posted 12 March 2012 - 01:57 AM
Reedbeta, on 12 March 2012 - 01:26 AM, said:
So then I need to use TotalFlux/(PI*Radius*Radius) instead?
#4
Posted 12 March 2012 - 03:25 AM
#5
Posted 12 March 2012 - 04:09 PM
One more thing!
Do I also have to save the "light" direction and the normal for each photons, then when gathering them, take into consideration the normal and "light" direction, and distance? If so, does this looks right?...
for each photon in radius do {
a = dot(photon.ray.dir, photon.object.normal) ;
b = dot(photon.ray.dir, surfaceNormal) ;
c = a/b;
d = photon.dist * radius;
flux += photon.flux * c * d;
}
flux = flux/(PI*radius*radius);
#6
Posted 12 March 2012 - 04:52 PM
However, the N . L factor is NOT in the BRDF and should not be included. It will be taken care of by the geometry - fewer photons per unit area will naturally land on the surface when it is at a greater angle to the light source. Likewise, you do not need to attenuate the photons based on distance from the light source. That is also taken care of by the geometry, since fewer photons per unit area will naturally land on an object far from the light.
You should pick up Henrik Wann Jensen's book on photon mapping if you're interested in this - it explains everything in much greater detail.
#7
Posted 12 March 2012 - 05:22 PM
What I meant by distance was the distance of the photon within the radius. For example, when I shoot a ray from the camera to the scene and land on a surface, I take all the photons within a radius from that hit point. So I was wondering if the photons within this radius needs to be attenuated the farther away they are from the hit point? (not from the light source)
#8
Posted 12 March 2012 - 06:18 PM
#9
Posted 12 March 2012 - 08:15 PM
#10
Posted 12 March 2012 - 08:45 PM
}:+()___ (Smile), on 12 March 2012 - 08:15 PM, said:
oh! I see what you mean. Thanks!
#11
Posted 12 March 2012 - 09:26 PM
As for attenuating photons by distance to the center of the search, that would help you get smoother results so it could indeed be a good idea. I don't remember off the top of my head whether HWJ does this sort of thing or not. Anyway, if you do attenuate them, just make sure you normalize by the sum of the weights, as usual with any weighted average. You could use any attenutation function you choose, whatever looks best.
#12
Posted 12 March 2012 - 09:42 PM
Reedbeta, on 12 March 2012 - 09:26 PM, said:
As for attenuating photons by distance to the center of the search, that would help you get smoother results so it could indeed be a good idea. I don't remember off the top of my head whether HWJ does this sort of thing or not. Anyway, if you do attenuate them, just make sure you normalize by the sum of the weights, as usual with any weighted average. You could use any attenutation function you choose, whatever looks best.
Good idea about the ellipsoid! thanks!
What do you mean by "normalize by the sum of the weights"?
#13
Posted 12 March 2012 - 09:44 PM
#14
Posted 12 March 2012 - 10:10 PM
Reedbeta, on 12 March 2012 - 09:44 PM, said:
oh ok thanks
#15
Posted 13 March 2012 - 10:04 AM
totalweight=0
for each photon
{
weight = computeWeight(photon);
flux += computeFlux(photon) * weight;
totalweight += weight;
}
flux /= totalweight
#16
Posted 13 March 2012 - 01:03 PM
#17
Posted 13 March 2012 - 09:25 PM
}:+()___ (Smile), on 13 March 2012 - 01:03 PM, said:
What do you suggest? I'm using the photon map as direct viewing, I do not use raytrace for direct illumination, and do not use caustic/indirect illumination photon maps.
#18
Posted 14 March 2012 - 06:02 PM
#19
Posted 14 March 2012 - 11:39 PM
#20
Posted 15 March 2012 - 02:01 AM
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users












