Page **1** of **1**

### Bi-layer, anistropic, multi-scattering microfacets

Posted: **Sat Sep 10, 2016 7:00 pm**

by **atlas**

Just posting a few shots of my pathtracer. The material system is a bi-layer, multi-scattering microfacet model, with anistropic roughness for all material types. The renderer is HDR, with the usual DOF, super-sampling, etc.

You can keep up with my renderer here:

http://www.twitter.com/rove3d

### Re: Bi-layer, anistropic, multi-scattering microfacets

Posted: **Mon Sep 12, 2016 8:57 am**

by **patlefort**

Nice renders

I'm curious by what do you mean by bi-layer, multi-scattering microfacet model?

Is it GPU or CPU?

### Re: Bi-layer, anistropic, multi-scattering microfacets

Posted: **Mon Sep 12, 2016 3:58 pm**

by **atlas**

When sampling a surface, every material type (conductor, dielectric, diffuse) has 2 layers. The top layer is a dielectric BSDF, so we can do things like clearcoats, varnish, etc. Light is either reflected, or transmitted towards the bottom layer. The bottom layer is the main material type. Attenuation is accounted for both going into and going out of these 2 layers. Both layers are microfacet models capable of anistropic or isotropic roughness. The model simulates 2-bounce scattering within the microfacets of the surface, which is more energy-preserving than the typical microfacet model where if a bounce faces the surface normal it is terminated.

It's a GPU renderer using OpenCL,

### Re: Bi-layer, anistropic, multi-scattering microfacets

Posted: **Wed Sep 14, 2016 6:02 am**

by **patlefort**

Coincidentally I was looking at the problem of layers in the last few days trying to improve clear coating. It's possible to account exactly the amount of light reflected by the bottom layer if you assume that the light will hit the same microfacet always, just like you can do with a thin glass material. It's a simple geometric series and I came up with the following formula:

r is the fresnel reflectance from the light exiting the top layer, bottomColor is the reflected color by the bottom layer. prtselect is a function that select the first argument is the 3th argument is true or the 2th if false for each individual components.

Code: Select all

```
inline Color dualLayerRefl(const Color &r, const Color &bottomColor)
{
const auto t = White - r;
const auto bt = bottomColor * t;
return bt +
pow2(bt) * (
r + r * bottomColor * (prtselect(t.reciprocal(), White, t > 0) - White)
);
}
// Then you use it like this: F is the fresnel reflectance from the light entering the top layer
colorReflected = dualLayerRefl(r, bottomColor) * (White - F);
```

*EDIT* I adjusted my function which didn't handle bottomColor value higher than 1.