<p>It'd be hell a lot easier if this were on graphicsexchange, since I can't use latex here but anyways.</p>

<p>In the first pass of Photon Mapping you don't need to use the Flux form of rendering equation. You just divide the original flux coming from the light source among the N photons, then for each photon you use Russian Roulette to determine whether it reflects, transmits or gets absorbed and store the incoming flux.</p>

<p>In the second pass you need to find radiance but you have information in Flux form. The rendering equation can be simply transformed. </p>

<p><a href="https://i.sstatic.net/qrXgH.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/qrXgH.png" alt="enter image description here"></a>
<a href="https://i.sstatic.net/firlX.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/firlX.png" alt="enter image description here"></a>
<a href="https://i.sstatic.net/DqmCY.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/DqmCY.png" alt="enter image description here"></a></p>

<p>So all you need to do is divide the flux stored for each photon by the area. Note that the Area is often denoted as <code>A= pi r^2</code> Since we are concerned with a hemisphere and the underlying area is just a circle.</p>

<p>About your 2nd point, I don't think the BRDF needs to be re-normalized or whatsoever since the equation is essentially the same. Note that the second term in the last equation is still a radiance written in flux form. (BRDF has units of inverse solid angle thus making the whole term radiance).</p>

CC BY-SA 4.0
2018-12-19T09:22:03.930Z
Hmm my bad, I misunderstood your question but I still don't get what you mean by  " The RR is one of possible many algorithms to approximate some underlying physical formula". Isn't RR just a way to terminate paths with negligible wieghts without introducing bias. What sort of "underlying physical formula" are you talking about?
gallickgunner
CC BY-SA 4.0
2018-12-20T12:41:39.243Z
Ok it seems you think that RR is a sort of approximate solution to something when it isn't afaik. RR was introduced as early as in 1960s and was used to terminate paths in MC methods used to simulate Neutron Transport without introducing bias. Arvo and Kirk were the first ones to adapt RR being used in Physics and engg. to here in monte carlo path tracing etc.

Try moving this over to the graphicsexchange as it's mostly a theoretical question and maybe someone there can answer better.
gallickgunner
CC BY-SA 4.0
2018-12-21T06:29:15.560Z
you can either flag it describing it needs to be moved or maybe just re-ask it as you said.
gallickgunner
CC BY-SA 4.0
2018-12-19T07:34:36.780Z
2018-12-19T07:34:36.780Z
gallickgunner
<p>I am trying to understand the mathematical/physical foundations of photon mapping better.</p>

<p>In the forward photon tracing step it is established, that the rays are carrying portions of total power (flux) rather than radiance as it is typically done in other types of ray-tracing algorithms.</p>

<p>However, in all articles and tutorials I could never find a precise explanation how such flux-carrying path interacts with materials? In other words - what is the rendering equation for interaction between flux-path and a surface?</p>

<p>What I typically found is an algorithm, based on Russian Roulette, for building a light path. But not a foundation equation that lead to that algorithm.</p>

<p>In particular, I am interested in:</p>

<ul>
<li><p>Should the equation include the cosine of the incident angle or not? I suspect it shouldn't be there, as the power remains constant, but it is spread over a bigger area (thus reducing the radiance at each point, but not total flux).</p></li>
<li><p>Should the BRDF function be somehow (re)normalized? For example, for a perfect diffusive material, the BRDF is a constant not greater than 1/pi, so that it is energy conserving. But for a flux-based equation, assuming it is different, energy conservation may set a different maximum value.</p></li>
</ul>

<hr>

<p>Note, the very similar question:</p>

<p><a href="https://stackoverflow.com/questions/13713580/rendering-equation-for-photon-mapping">Rendering equation for Photon Mapping</a></p>

<p>refers to a different step of the photon mapping algorithm. It asks for the rendering equation where the radiance is being estimated based on the nearest stored photons. Instead, I am asking for the flux-surface interaction in an earlier stage of the algorithm, when photons are being generated and propagated.</p>

CC BY-SA 4.0
2018-12-25T03:28:39.167Z
I thought the Fresnel equation told the probability for a photon to get reflected (instead of refracted). Is that not the case?
Julien Guertault
CC BY-SA 4.0
2018-12-25T19:55:34.867Z
@JulienGuertault Unless we touch quantum effects and discuss individual real photons, there is no randomness in physics of light. Any randomness is our algorithmic approximation to reduce the complexity of computation. Fresnell equations are expressed in terms of irradiance (applicable to radiance as well) and account for the fact that parallel beams of light, after refraction (using Snell's law) are closer to each other (or further apart, depending on the refraction index). This changes radiance, but not flux. Obviously, Fresnell is more, e.g. it also depends on polarisation...
CygnusX1
<raytracing><rendering><physically-based><physics><photon-mapping>
Rendering Equation for photons carrying flux
CygnusX1
# Rendering Equation for photons carrying flux

(Asked by: username_0 on 2018-12-16)

I am trying to understand the mathematical/physical foundations of photon mapping better.

In the forward photon tracing step it is established, that the rays are carrying portions of total power (flux) rather than radiance as it is typically done in other types of ray-tracing algorithms.

However, in all articles and tutorials I could never find a precise explanation how such flux-carrying path interacts with materials? In other words - what is the rendering equation for interaction between flux-path and a surface?

What I typically found is an algorithm, based on Russian Roulette, for building a light path. But not a foundation equation that lead to that algorithm.

In particular, I am interested in:

* Should the equation include the cosine of the incident angle or not? I suspect it shouldn't be there, as the power remains constant, but it is spread over a bigger area (thus reducing the radiance at each point, but not total flux).
* Should the BRDF function be somehow (re)normalized? For example, for a perfect diffusive material, the BRDF is a constant not greater than 1/pi, so that it is energy conserving. But for a flux-based equation, assuming it is different, energy conservation may set a different maximum value.

---

Note, the very similar question:

[Rendering equation for Photon Mapping](https://stackoverflow.com/questions/13713580/rendering-equation-for-photon-mapping)

refers to a different step of the photon mapping algorithm. It asks for the rendering equation where the radiance is being estimated based on the nearest stored photons. Instead, I am asking for the flux-surface interaction in an earlier stage of the algorithm, when photons are being generated and propagated.

**Tags:** raytracing, rendering, physically-based, physics, photon-mapping

> **Comments:**
> **username_1**: I thought the Fresnel equation told the probability for a photon to get reflected (instead of refracted). Is that not the case?  
> **username_0**: @username_1 Unless we touch quantum effects and discuss individual real photons, there is no randomness in physics of light. Any randomness is our algorithmic approximation to reduce the complexity of computation. Fresnell equations are expressed in terms of irradiance (applicable to radiance as well) and account for the fact that parallel beams of light, after refraction (using Snell's law) are closer to each other (or further apart, depending on the refraction index). This changes radiance, but not flux. Obviously, Fresnell is more, e.g. it also depends on polarisation...  

---

## 1 answers

### Answer by username_2 on 2018-12-19. Score: 1

It'd be hell a lot easier if this were on graphicsexchange, since I can't use latex here but anyways.

In the first pass of Photon Mapping you don't need to use the Flux form of rendering equation. You just divide the original flux coming from the light source among the N photons, then for each photon you use Russian Roulette to determine whether it reflects, transmits or gets absorbed and store the incoming flux.

In the second pass you need to find radiance but you have information in Flux form. The rendering equation can be simply transformed.

[![enter image description here](https://i.sstatic.net/qrXgH.png)](https://i.sstatic.net/qrXgH.png)
[![enter image description here](https://i.sstatic.net/firlX.png)](https://i.sstatic.net/firlX.png)
[![enter image description here](https://i.sstatic.net/DqmCY.png)](https://i.sstatic.net/DqmCY.png)

So all you need to do is divide the flux stored for each photon by the area. Note that the Area is often denoted as `A= pi r^2` Since we are concerned with a hemisphere and the underlying area is just a circle.

About your 2nd point, I don't think the BRDF needs to be re-normalized or whatsoever since the equation is essentially the same. Note that the second term in the last equation is still a radiance written in flux form. (BRDF has units of inverse solid angle thus making the whole term radiance).

> **Comments:**
> **username_2**: Hmm my bad, I misunderstood your question but I still don't get what you mean by  " The RR is one of possible many algorithms to approximate some underlying physical formula". Isn't RR just a way to terminate paths with negligible wieghts without introducing bias. What sort of "underlying physical formula" are you talking about?  
> **username_2**: Ok it seems you think that RR is a sort of approximate solution to something when it isn't afaik. RR was introduced as early as in 1960s and was used to terminate paths in MC methods used to simulate Neutron Transport without introducing bias. Arvo and Kirk were the first ones to adapt RR being used in Physics and engg. to here in monte carlo path tracing etc.  Try moving this over to the graphicsexchange as it's mostly a theoretical question and maybe someone there can answer better.  
> **username_2**: you can either flag it describing it needs to be moved or maybe just re-ask it as you said.  

---

