<p>This may simply be a typo or oversight. Note that in the previous section they've been discussing the <em>microsurface</em> BxDFs $f^m_r(\mathbf{i},\mathbf{o},\mathbf{m})$ and $f^m_t(\mathbf{i},\mathbf{o},\mathbf{m})$, which are naturally evaluated at a microsurface normal, but in this section they've moved on to talking about <em>macrosurface</em> BxDFs, which have the microsurface integrated out.</p>

<p>AFAICT, the intent of equation 19 is just to say that the total BSDF is a sum of reflection and transmission parts, so it doesn't really matter ($\mathbf{m}$ is a free variable there and could be named anything), but to be less confusing it should probably have been $\mathbf{n}$. Maybe they just forgot to update it during a round of edits, or something.</p>

<p>Yes, you can evaluate a BRDF/BSDF with any combination of input and output directions and it should give the correct answer.</p>

CC BY-SA 3.0
2017-01-10T02:01:08.383Z
2017-01-10T02:01:08.383Z
Nathan Reed
<p>I have been trying to implement the GGX shader in my path tracer based on this paper: <a href="http://www.cs.cornell.edu/~srm/publications/EGSR07-btdf.pdf" rel="nofollow noreferrer">Microfacet Models for Refraction through Rough Surfaces</a>
It's pretty clear how the importance sampling works, but I would also like to do next event estimation (direct lighting) for when the object is more rough and acts close to a diffuse shader.</p>

<p>The part that is really confusing to me is equation [19] and [20]:</p>

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

<p>I don't understand why in [19] they use the microsurface normal, but in [20] they use the macrosurface normal. The transmission term I don't need because I'm just working on the reflectance, but I still don't get why it's <strong>m</strong> on [19] and <strong>n</strong> on [20]. Is it possible to use any incident direction and outgoing direction and get back a proper BRDF? Or does the scatter direction "<strong>o</strong>" have to match where the microsurface normal makes it bounce to? In direct lighting the directions would need to be independent of each other for it to work since you're grabbing a from the hit point to the light, and from the hit point to the camera. </p>

<raytracing><shader><3d><pathtracing>
How to properly direct light sample GGX in path tracing
Henry Bergin
# How to properly direct light sample GGX in path tracing

(Asked by: username_0 on 2017-01-10)

I have been trying to implement the GGX shader in my path tracer based on this paper: [Microfacet Models for Refraction through Rough Surfaces](http://www.cs.cornell.edu/~srm/publications/EGSR07-btdf.pdf)
It's pretty clear how the importance sampling works, but I would also like to do next event estimation (direct lighting) for when the object is more rough and acts close to a diffuse shader.

The part that is really confusing to me is equation [19] and [20]:

[![enter image description here](https://i.sstatic.net/58HCg.png)](https://i.sstatic.net/58HCg.png)

I don't understand why in [19] they use the microsurface normal, but in [20] they use the macrosurface normal. The transmission term I don't need because I'm just working on the reflectance, but I still don't get why it's **m** on [19] and **n** on [20]. Is it possible to use any incident direction and outgoing direction and get back a proper BRDF? Or does the scatter direction "**o**" have to match where the microsurface normal makes it bounce to? In direct lighting the directions would need to be independent of each other for it to work since you're grabbing a from the hit point to the light, and from the hit point to the camera.

**Tags:** raytracing, shader, 3d, pathtracing


---

## 1 answers

### Answer by username_1 on 2017-01-10. Score: 4 | Accepted answer

This may simply be a typo or oversight. Note that in the previous section they've been discussing the *microsurface* BxDFs $f^m\_r(\mathbf{i},\mathbf{o},\mathbf{m})$ and $f^m\_t(\mathbf{i},\mathbf{o},\mathbf{m})$, which are naturally evaluated at a microsurface normal, but in this section they've moved on to talking about *macrosurface* BxDFs, which have the microsurface integrated out.

AFAICT, the intent of equation 19 is just to say that the total BSDF is a sum of reflection and transmission parts, so it doesn't really matter ($\mathbf{m}$ is a free variable there and could be named anything), but to be less confusing it should probably have been $\mathbf{n}$. Maybe they just forgot to update it during a round of edits, or something.

Yes, you can evaluate a BRDF/BSDF with any combination of input and output directions and it should give the correct answer.


---

