Support for Diffuse Models Besides Lambert

There was some code in the shader files that included Burley’s Diffuse as well as Oren-Nayar, but it would be nice to have a way in the engine to specify which diffuse model we’d like to use for the entire project, or if possible, per-material. I know any diffuse model besides Lambert is more expensive, but on surfaces like landscape terrain you cannot rely on GGX specular and reflections to get a decent result: you need a model that highlights the edges and sheen of the surface at glancing angles. I would happily give up specular rendering on landscape if I could use Oren-Nayar, Cook-Torrance, or Burley’s Diffuse.

I also developed a really nice, cheap shader for very rough surfaces (like terrain). If there is a way for us to implement a custom BRDF model that doesn’t involve changing tons of shader files, I’d really appreciate that!

So, I found in the 4.8 Release notes that UE4 already uses Burley’s diffuse as the new default model, just without sheen :\

I think it’s reverted back to lambert in later release.

:expressionless: Well, I’m fine with Lambert for a general model, but it would be nice to have sheen built-into the engine somehow, even as a specialty shader. The light should actually consider the direction of the source and bend around the model. I think the cloth model handles this properly, but lack of documentation and falloff controls doesn’t help.

EDIT: OK, so I can get the Cloth shading model to work for my purposes of altering the diffuse terms. The Fuzz Cloth input is the color used on the cloth at the full cloth setting (typically the lighter appearance at an oblique angle). The Base color is the diffuse texture (typically when viewing cloth head-on). The Cloth input is the actual shading model (typically a Fresnel term). At 0, the shader comes back to the default Lambertian diffuse. At higher values, the model blends towards the cloth shading. Plugging a Fresnel term into the Cloth input will bend the diffuse away from the direction of the light and blend away from the typical Lambert, which is highly desirable for cloth and rough diffuse surfaces. This sheen is what I would like to achieve on a lot of surfaces in my game!

But this shading model is not compatible with mobile at all :frowning:

1 Like