   Photon Mapping : Direct Illumination
  So far I have been doing direct visualisation of the photon map. I am wondering how to go about using it only for indirect illumination. I will be using distributed raytracing to randomly sample light sources with shadow rays for direct illumination. This will give me a value for the direct lighting contribution of each light... But how about indirect illumination? Jensen seems to be suggesting that there are no modifications to make to the photon map. It would seem to me, however, that one would want to store only photons from the second hit and up, to actually filter the direct illumination *out* of the photon map, no?Also, about direct illumination. Supposing I have a rectangular light source, and I sample it at 30 random points. Do I simply take the number X of points that deliver light to the current surface point, and say that the light power received by the surface point is X/30 * LightPower , or do I have to account, for each point, of the probability of emitting a ray in that direction, by multiplying the ray's power by the cosine of the ray direction and light surface normal. If so, is it still necessary to multiply the light power by the cosine of the ray direction and the surface normal (for the lambertian radiance).   
  If you followed Jensen correctly, you will have three separate photon maps:  A direct map, an indirect map, and a caustic map.  To use regular whitted style raytracing for direct illumination, simply don't use your direct photon map.Quote:Also, about direct illumination. Supposing I have a rectangular light source, and I sample it at 30 random points. Do I simply take the number X of points that deliver light to the current surface point, and say that the light power received by the surface point is X/30 * LightPower , or do I have to account, for each point, of the probability of emitting a ray in that direction, by multiplying the ray's power by the cosine of the ray direction and light surface normal. If so, is it still necessary to multiply the light power by the cosine of the ray direction and the surface normal (for the lambertian radiance).I suggest brushing up on the theory of Monte Carlo integration.  If your samples are uniformly distributed, then it is simply X/30 * LightPower.  If your samples are pulled from a cosine weighted distribution, then you need to account for that in your integration.  Here's the best reference I could find doing a quick google run:Monte Carlo Integration and Importance Sampling