<p>You can combine Oren-Nayar with GGX, if your normalize the result. A BRDF is defined by two properties: Helmholtz reciprocity and energy conservation.</p>

<p>$f(l_i, l,_o) = f(l_o, l_i)$</p>

<p>$f(l_i, l_o) \leq 1$</p>

<p>Your Oren-Nayar is the diffuse part $f_d(l_i, l_o)$ and your GGX is your specular part $f_s(l_i, l_o)$. If both are energy conserving, then both are at most $1$, but combined they may be $\geq 1$ and here lies your problem. Oren-Nayar has been combined with specular terms before (see for example <a href="http://www.crytek.com/download/2014_03_25_CRYENGINE_GDC_Schultz.pdf" rel="noreferrer">The Rendering of Ryze from Crytek</a>, you should have a look at how others did it. If you combine them, keep in mind that you need two different roughness values. The ones of Oren-Nayar and GGX don't match (which by the looks of it you know already) but neither can you convert from one to the other via an algorithm.</p>

<p>A better solution imo is to use a different diffuse term. Have a look at the papers <a href="https://disney-animation.s3.amazonaws.com/library/s2012_pbs_disney_brdf_notes_v2.pdf" rel="noreferrer">Physically Based Shading at Disney by Brent Burley</a> and <a href="https://www.gdcvault.com/play/1024478/PBR-Diffuse-Lighting-for-GGX" rel="noreferrer">PBR diffuse Lighting for GGX+Smith Microsurfaces by Earl Hammon Jr.</a>. Physically Based Shading discusses several diffuse lighting BRDFs, including Oren-Nayar and then goes on to introduce an own diffuse BRDF which can use the same roughness value as GGX (be careful, as the roughness here is squared before using, iirc, because that was easier to use for artists). This resulting BRDF is not energy conserving, which was accepted by the author, since</p>

<blockquote>
  <p>This seems to provide a reasonable match to the MERL data and was also found to be artistically pleasing.</p>
</blockquote>

<p>A solution for this was introduced by <a href="https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf" rel="noreferrer">Sebastien Lagarde and Charles de Rousiers in Moving Frostbite to Physocally Based Rendering</a>, they renormalized the entire BRDF.</p>

<p>PBR diffuse Lighting for GGX+Smith Microsurfaces by Earl Hammon takes a different approach, he calculates an approximation like Oren and Nayar did, only he did it for GGX NDF and Smith shadowing/masking. Both the Disney Diffuse and Hammon's Diffuse BRDF can easily be combined with the GGX specular term and are visually more pleasing than Lambert.</p>

CC BY-SA 3.0
2018-02-01T06:21:05.257Z
Sorry for all the layout errors... Was typing this on my phone without any preview. I'll correct that knce I'm at my pc.
Tare
CC BY-SA 3.0
2018-02-22T23:53:32.453Z
Sorry for the wait...ended up getting caught up with bdpt and forgetting about materials for a while :). It sounds like GGX/Smith is a strictly specular NDF and Oren-Nayar is a strictly diffuse NDF (i.e. it's meaningless to expect diffuse illumination from GGX/Smith or specular illumination from Oren-Nayar, even if you swap out the underlying macrosurfaces), is that right?
Paul Ferris
CC BY-SA 3.0
2018-02-23T06:35:48.447Z
Yes, that is (mostly) correct. One thing about Oren-Nayar is that it incorporates some aspect of specular lights, because it has some view dependency. However, there are no real highlights, there is just a shadowing effect where $n \cdot v \rightarrow 0$ (with $n$ is surface normale and $v$ is view vector), so I'd not go as far and say that that effect is real specular lighting effect.
Tare
CC BY-SA 3.0
2018-02-23T13:08:25.943Z
Great, thank you! My mostly-unfinished materials system defines a "material" as a vector of BRDF probabilities; would I get reasonable results if I had two randomly-selected + separate specular/diffuse microfacet BRDFs (given distinct specular/diffuse roughnesses + PDFs for the individual BRDFs)?
Paul Ferris
CC BY-SA 3.0
2018-02-23T13:37:22.687Z
I am not entirely sure, how you are doing this. If you want to know, if you can reasonable results by combining an arbitrary diffuse BRDF with an arbitrary specular BRDF, then yes, it is possible. In fact, if you look through somewhat modern games and papers, that's what people have been doing for quite some time - they choose one BRDF for diffuse and one for specular lighting and then manually tweak the properties until the result looks good. The combinations are up to the teams: A lot of people used GGX+Lambert, but also Beckmann+Lamber or either specular BRDF with Oren-Nayar has been used.
Tare
CC BY-SA 3.0
2018-02-23T19:40:33.560Z
Suppose I only want to deal in combinations of pure BXDFs (mostly for code simplicity). Each axis of the material probability vector stores the chance of selecting one of these pure BXDFs (e.g. 40% of the rays incident with $(0.4, 0.6)$ will be processed with a pure difffuse BRDF), and I render the material by accumulating as many samples as possible and using the probabilities of each BRDF to weigh their value appropriately.
Paul Ferris
CC BY-SA 3.0
2018-02-23T19:49:04.033Z
So my question is, will this work if the pure diffuse/pure specular contributors are microfacet BRDFs? From the sounds of your comment (+ the note about blending being possible so long as the result is normalized) it sounds like it will, but I just want to make sure anyways
Paul Ferris
CC BY-SA 3.0
2018-02-01T06:19:35.653Z
2018-02-05T09:12:31.940Z
2018-02-05T09:12:31.940Z
Tare
<p>I recently replaced the Lambertian BRDF in my path-tracer with Oren-Nayar, under the assumption that I could adjust it to use the GGX distribution model with appropriate masking/shadowing. </p>

<p>PBR suggests this is't viable, though - Oren-Nayar is formulated without any clear $D$/$F$/$G$ parameters, and a note under the Torrance-Sparrow model states that "one of the nice things about the Torrance-Sparrow model is that <strong>the derivation doesn't depend on the particular microfacet distribution being used</strong>" (implying this isn't the case for Oren-Nayar).</p>

<p>If Oren-Nayar <em>is</em> extensible, how would I do that? I suspect I could replace my $\sigma$ values with an NDF taking some $\alpha$ parameter (effectively convolving against the implicit Gaussian in the Oren-Nayar definition), and multiply the evaluated Oren-Nayar function against $G$ to capture masked segments of $dA$, but won't this clash with assumptions made by the derivation? PBR states that the function natively accounts for Gaussian-distributed masking, so applying another function over the top should result in over-darkening...</p>

<p>If it isn't extensible, can I adjust Torrance-Sparrow instead? Locking $F(\omega_o)$ to $1$ should remove Fresnel effects, and the specular assumption can be negated by extracting the $d\omega_h = \frac{d\omega_o}{4\cos\theta_o}$ relationship to create the modified BRDF $f(\omega_o, \omega_i) = \frac{D(\omega_h)G(\omega_o,\ \omega_i)d\omega_h}{d\omega_o\cos\theta_o}$ </p>

<mathematics><brdf><pbr><shading>
Microfacet shading for diffuse materials
Paul Ferris
# Microfacet shading for diffuse materials

(Asked by: username_0 on 2018-01-27)

I recently replaced the Lambertian BRDF in my path-tracer with Oren-Nayar, under the assumption that I could adjust it to use the GGX distribution model with appropriate masking/shadowing.

PBR suggests this is't viable, though - Oren-Nayar is formulated without any clear $D$/$F$/$G$ parameters, and a note under the Torrance-Sparrow model states that "one of the nice things about the Torrance-Sparrow model is that **the derivation doesn't depend on the particular microfacet distribution being used**" (implying this isn't the case for Oren-Nayar).

If Oren-Nayar *is* extensible, how would I do that? I suspect I could replace my $\sigma$ values with an NDF taking some $\alpha$ parameter (effectively convolving against the implicit Gaussian in the Oren-Nayar definition), and multiply the evaluated Oren-Nayar function against $G$ to capture masked segments of $dA$, but won't this clash with assumptions made by the derivation? PBR states that the function natively accounts for Gaussian-distributed masking, so applying another function over the top should result in over-darkening...

If it isn't extensible, can I adjust Torrance-Sparrow instead? Locking $F(\omega\_o)$ to $1$ should remove Fresnel effects, and the specular assumption can be negated by extracting the $d\omega\_h = \frac{d\omega\_o}{4\cos\theta\_o}$ relationship to create the modified BRDF $f(\omega\_o, \omega\_i) = \frac{D(\omega\_h)G(\omega\_o,\ \omega\_i)d\omega\_h}{d\omega\_o\cos\theta\_o}$

**Tags:** mathematics, brdf, pbr, shading


---

## 1 answers

### Answer by username_1 on 2018-02-01. Score: 6 | Accepted answer

You can combine Oren-Nayar with GGX, if your normalize the result. A BRDF is defined by two properties: Helmholtz reciprocity and energy conservation.

$f(l\_i, l,\_o) = f(l\_o, l\_i)$

$f(l\_i, l\_o) \leq 1$

Your Oren-Nayar is the diffuse part $f\_d(l\_i, l\_o)$ and your GGX is your specular part $f\_s(l\_i, l\_o)$. If both are energy conserving, then both are at most $1$, but combined they may be $\geq 1$ and here lies your problem. Oren-Nayar has been combined with specular terms before (see for example [The Rendering of Ryze from Crytek](http://www.crytek.com/download/2014_03_25_CRYENGINE_GDC_Schultz.pdf), you should have a look at how others did it. If you combine them, keep in mind that you need two different roughness values. The ones of Oren-Nayar and GGX don't match (which by the looks of it you know already) but neither can you convert from one to the other via an algorithm.

A better solution imo is to use a different diffuse term. Have a look at the papers [Physically Based Shading at Disney by Brent Burley](https://disney-animation.s3.amazonaws.com/library/s2012_pbs_disney_brdf_notes_v2.pdf) and [PBR diffuse Lighting for GGX+Smith Microsurfaces by Earl Hammon Jr.](https://www.gdcvault.com/play/1024478/PBR-Diffuse-Lighting-for-GGX). Physically Based Shading discusses several diffuse lighting BRDFs, including Oren-Nayar and then goes on to introduce an own diffuse BRDF which can use the same roughness value as GGX (be careful, as the roughness here is squared before using, iirc, because that was easier to use for artists). This resulting BRDF is not energy conserving, which was accepted by the author, since

> This seems to provide a reasonable match to the MERL data and was also found to be artistically pleasing.

A solution for this was introduced by [Sebastien Lagarde and Charles de Rousiers in Moving Frostbite to Physocally Based Rendering](https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf), they renormalized the entire BRDF.

PBR diffuse Lighting for GGX+Smith Microsurfaces by Earl Hammon takes a different approach, he calculates an approximation like Oren and Nayar did, only he did it for GGX NDF and Smith shadowing/masking. Both the Disney Diffuse and Hammon's Diffuse BRDF can easily be combined with the GGX specular term and are visually more pleasing than Lambert.

> **Comments:**
> **username_1**: Sorry for all the layout errors... Was typing this on my phone without any preview. I'll correct that knce I'm at my pc.  
> **username_0**: Sorry for the wait...ended up getting caught up with bdpt and forgetting about materials for a while :). It sounds like GGX/Smith is a strictly specular NDF and Oren-Nayar is a strictly diffuse NDF (i.e. it's meaningless to expect diffuse illumination from GGX/Smith or specular illumination from Oren-Nayar, even if you swap out the underlying macrosurfaces), is that right?  
> **username_1**: Yes, that is (mostly) correct. One thing about Oren-Nayar is that it incorporates some aspect of specular lights, because it has some view dependency. However, there are no real highlights, there is just a shadowing effect where $n \cdot v \rightarrow 0$ (with $n$ is surface normale and $v$ is view vector), so I'd not go as far and say that that effect is real specular lighting effect.  
> **username_0**: Great, thank you! My mostly-unfinished materials system defines a "material" as a vector of BRDF probabilities; would I get reasonable results if I had two randomly-selected + separate specular/diffuse microfacet BRDFs (given distinct specular/diffuse roughnesses + PDFs for the individual BRDFs)?  
> **username_1**: I am not entirely sure, how you are doing this. If you want to know, if you can reasonable results by combining an arbitrary diffuse BRDF with an arbitrary specular BRDF, then yes, it is possible. In fact, if you look through somewhat modern games and papers, that's what people have been doing for quite some time - they choose one BRDF for diffuse and one for specular lighting and then manually tweak the properties until the result looks good. The combinations are up to the teams: A lot of people used GGX+Lambert, but also Beckmann+Lamber or either specular BRDF with Oren-Nayar has been used.  
> **username_0**: Suppose I only want to deal in combinations of pure BXDFs (mostly for code simplicity). Each axis of the material probability vector stores the chance of selecting one of these pure BXDFs (e.g. 40% of the rays incident with $(0.4, 0.6)$ will be processed with a pure difffuse BRDF), and I render the material by accumulating as many samples as possible and using the probabilities of each BRDF to weigh their value appropriately.  
> **username_0**: So my question is, will this work if the pure diffuse/pure specular contributors are microfacet BRDFs? From the sounds of your comment (+ the note about blending being possible so long as the result is normalized) it sounds like it will, but I just want to make sure anyways  

---

