<p>I don't understand what's the problem. We want to make a change of variables so that instead of integrating over the range of directions $d\omega_i$ in the upper hemisphere we integrate over patches of area $dA$ of a region $R$.</p>

<p>This whole thing is given in section 5.5 as Hubble said but let me post it again.</p>

<p>We know by definition that,</p>

<p>$\omega = A *  cos(\theta)/r^2$  </p>

<p>Now if you differentiate this, you get</p>

<p>$d\omega = dA * cos(\theta) / r^2$ </p>

<p>where,</p>

<p>$Jacobian = cos(\theta) / r^2$</p>

<p>as Hubble said. I don't know what are you trying to do by calculating Jacobian through determinant but as far as I know, that Jacobian determinant is for multi-variables and involves partial derivatives. For change of variables involving a single variable the Jacobian can be gotten by simply derivating as I did.</p>

<p>Now this might seem the inverse but wait a moment. What you posted in the question is a relation between the PDFs.</p>

<p>Consider a single sample of the rendering equation integrated over the domain of $\omega_i$</p>

<p>$L_s = BRDF * L_f * (\omega_i . n) / p(\omega)  $</p>

<p>After changing the domain by above equations this would become</p>

<p>$L_s = BRDF * L_f * (\omega_i . n) (\omega_i . n_r)\, / \,  (p(A) * r^2)  $</p>

<p>$L_s = BRDF * L_f * (\omega_i . n) * JN\, / \,  p(A) $<br>
where $Jacobian = JN$</p>

<p>This means, 
$ 1 / p(\omega) =  JN/p(A)$</p>

<p>$ p(A) = p(\omega) * JN$</p>

<p>$ p(A) = p(\omega) * cos(\theta)/r^2$</p>

<p>This is what you see above. Simple as ****.</p>

CC BY-SA 4.0
2018-09-08T16:15:33.160Z
2018-09-08T16:15:33.160Z
gallickgunner
<p>In Chapter 14.5.3 of <em>Physically Based Rendering - From Theory to Implementation</em> (3rd edition), the authors claim that a probability density $p_\omega$ according to solid angle can be converted to a density $p_A$ according to area by $$p_A=p_\omega\frac{\left|\cos\theta_i\right|}{\left|p_i-p_{i+1}\right|^2},\tag1$$ where $\theta_i$ is the angle between the surface normal at $p_{i+1}$ and the vector to $p_i$.</p>

<blockquote>
  <p>The problem is: $(1)$ doesn't make sense. If $p_\omega$ is a density with respect to the surface measure on the upper unit hemisphere $\Omega_{p_i}$ over $p_i$, then $p_\omega$ is by definition a function $\Omega_{p_i}\to[0,\infty]$. Analogously, if $p_A$ is supposed to be a density with respect to the surface measure on the manifold $M$ build by all surfaces in the scene, then $p_A$ is by definition a function $M\to[0,\infty]$.</p>
  
  <p>So, there's at least an argument transformation missing. I would really appreciate, if anybody could clarify.</p>
</blockquote>

CC BY-SA 4.0
2018-09-05T18:21:44.350Z
What's wrong with a probability density having values in $[0,+\infty)$? Perhaps you are confusing the [PDF](https://en.wikipedia.org/wiki/Probability_density_function) with the [probability mass function](https://en.wikipedia.org/wiki/Probability_mass_function)?
Hubble
CC BY-SA 4.0
2018-09-05T18:30:08.440Z
@Hubble You've missed the point. The point is that the function on the left-hand side is defined on $\Omega_{p_i}$, while the function on the right-hand side is defined on $M$. And mathematically, the equation $f=g$ for functions $f,g$ only makes sense when both functions have a common domain.
0xbadf00d
CC BY-SA 4.0
2018-09-05T20:51:21.010Z
$p_A$ and $p_\omega$ are not defined on the same domain, but the Jacobian term ensures that you can go from projected solid angle to surface area, and vice versa. Read Section 5.5 of PBRT3, especially Equation 5.6 for more info.
Hubble
CC BY-SA 4.0
2018-09-06T11:49:53.227Z
@Rahul There is a bijection: Let $V_{p_i}$ denote the set of all surface points $q$ such that $p_i$ and $q$ are mutually visible and $D_{p_i}$ denote the set of all $\omega\in\Omega_{p_i}$ such that there is a $t>0$ with $p_i+t\omega\in V_{p_i}$. Then there is obviously a bijection between $V_{p_i}$ and $D_{p_i}$. We can define a transformation $$T:V_{p_i}\to D_{p_i}\;,\;\;\;q\mapsto\frac{q-p_i}{\left|q-p_i\right|},$$ but the determinant of the Jacobian of $T$ is $0$ everywhere and hence the transformation formula can't be applied. Am I missing something?
0xbadf00d
CC BY-SA 4.0
2018-09-06T11:50:56.717Z
@Hubble Is $T$ the transformation you're taking the Jacobian of?
0xbadf00d
CC BY-SA 4.0
2018-09-08T18:03:31.253Z
Why do you say the determinant of the Jacobian is zero everywhere? $T$ is a bijection and a diffeomorphism, so its Jacobian matrix should exist and be invertible everywhere in the domain you've described in your comment. And yes I think you are on the right track in formalizing this with your definition of $T$. We usually leave this kind of detail implicit, for better or worse.
Nathan Reed
CC BY-SA 4.0
2018-09-08T20:26:43.200Z
@NathanReed A direct computation of the determinant shows that it is zero.
0xbadf00d
CC BY-SA 4.0
2018-09-08T20:36:16.027Z
I don't know how you're getting that, but an invertible smooth mapping between two 2D domains certainly does not have zero Jacobian determinant everywhere. That directly contradicts the premise that it is invertible!
Nathan Reed
<raytracing><rendering>
How can we convert a probability density according to solid angle to a density according to area?
0xbadf00d
# How can we convert a probability density according to solid angle to a density according to area?

(Asked by: username_0 on 2018-09-05)

In Chapter 14.5.3 of *Physically Based Rendering - From Theory to Implementation* (3rd edition), the authors claim that a probability density $p\_\omega$ according to solid angle can be converted to a density $p\_A$ according to area by $$p\_A=p\_\omega\frac{\left|\cos\theta\_i\right|}{\left|p\_i-p\_{i+1}\right|^2},\tag1$$ where $\theta\_i$ is the angle between the surface normal at $p\_{i+1}$ and the vector to $p\_i$.

> The problem is: $(1)$ doesn't make sense. If $p\_\omega$ is a density with respect to the surface measure on the upper unit hemisphere $\Omega\_{p\_i}$ over $p\_i$, then $p\_\omega$ is by definition a function $\Omega\_{p\_i}\to[0,\infty]$. Analogously, if $p\_A$ is supposed to be a density with respect to the surface measure on the manifold $M$ build by all surfaces in the scene, then $p\_A$ is by definition a function $M\to[0,\infty]$.
>
> So, there's at least an argument transformation missing. I would really appreciate, if anybody could clarify.

**Tags:** raytracing, rendering

> **Comments:**
> **username_1**: What's wrong with a probability density having values in $[0,+\infty)$? Perhaps you are confusing the [PDF](https://en.wikipedia.org/wiki/Probability_density_function) with the [probability mass function](https://en.wikipedia.org/wiki/Probability_mass_function)?  
> **username_0**: @username_1 You've missed the point. The point is that the function on the left-hand side is defined on $\Omega_{p_i}$, while the function on the right-hand side is defined on $M$. And mathematically, the equation $f=g$ for functions $f,g$ only makes sense when both functions have a common domain.  
> **username_1**: $p_A$ and $p_\omega$ are not defined on the same domain, but the Jacobian term ensures that you can go from projected solid angle to surface area, and vice versa. Read Section 5.5 of PBRT3, especially Equation 5.6 for more info.  
> **username_0**: @Rahul There is a bijection: Let $V_{p_i}$ denote the set of all surface points $q$ such that $p_i$ and $q$ are mutually visible and $D_{p_i}$ denote the set of all $\omega\in\Omega_{p_i}$ such that there is a $t>0$ with $p_i+t\omega\in V_{p_i}$. Then there is obviously a bijection between $V_{p_i}$ and $D_{p_i}$. We can define a transformation $$T:V_{p_i}\to D_{p_i}\;,\;\;\;q\mapsto\frac{q-p_i}{\left|q-p_i\right|},$$ but the determinant of the Jacobian of $T$ is $0$ everywhere and hence the transformation formula can't be applied. Am I missing something?  
> **username_0**: @username_1 Is $T$ the transformation you're taking the Jacobian of?  
> **username_2**: Why do you say the determinant of the Jacobian is zero everywhere? $T$ is a bijection and a diffeomorphism, so its Jacobian matrix should exist and be invertible everywhere in the domain you've described in your comment. And yes I think you are on the right track in formalizing this with your definition of $T$. We usually leave this kind of detail implicit, for better or worse.  
> **username_0**: @username_2 A direct computation of the determinant shows that it is zero.  
> **username_2**: I don't know how you're getting that, but an invertible smooth mapping between two 2D domains certainly does not have zero Jacobian determinant everywhere. That directly contradicts the premise that it is invertible!  

---

## 1 answers

### Answer by username_3 on 2018-09-08. Score: 1

I don't understand what's the problem. We want to make a change of variables so that instead of integrating over the range of directions $d\omega\_i$ in the upper hemisphere we integrate over patches of area $dA$ of a region $R$.

This whole thing is given in section 5.5 as username_1 said but let me post it again.

We know by definition that,

$\omega = A \* cos(\theta)/r^2$

Now if you differentiate this, you get

$d\omega = dA \* cos(\theta) / r^2$

where,

$Jacobian = cos(\theta) / r^2$

as username_1 said. I don't know what are you trying to do by calculating Jacobian through determinant but as far as I know, that Jacobian determinant is for multi-variables and involves partial derivatives. For change of variables involving a single variable the Jacobian can be gotten by simply derivating as I did.

Now this might seem the inverse but wait a moment. What you posted in the question is a relation between the PDFs.

Consider a single sample of the rendering equation integrated over the domain of $\omega\_i$

$L\_s = BRDF \* L\_f \* (\omega\_i . n) / p(\omega) $

After changing the domain by above equations this would become

$L\_s = BRDF \* L\_f \* (\omega\_i . n) (\omega\_i . n\_r)\, / \, (p(A) \* r^2) $

$L\_s = BRDF \* L\_f \* (\omega\_i . n) \* JN\, / \, p(A) $  
where $Jacobian = JN$

This means,
$ 1 / p(\omega) = JN/p(A)$

$ p(A) = p(\omega) \* JN$

$ p(A) = p(\omega) \* cos(\theta)/r^2$

This is what you see above. Simple as \*\*\*\*.


---

