Autodesk / standard-surface

White paper describing the Autodesk Standard Surface shader.
Apache License 2.0
341 stars 25 forks source link

Clearcoat layering lerp #2

Open Da-Krunch opened 5 years ago

Da-Krunch commented 5 years ago

I have seen a few people getting stomped on the clearcoat layering logic.

Here are a few thougths:

  1. This regards the doc only: lerp(t, a, b) is not typical. Osl's mix(), glsl's mix(), MDL's lerp all have the syntax as lerp(a, b, t). It's a small change in the doc but might help simplify a bit.

  2. if coat_affect_color default to 0.0 and is "optional", then coat_color should be optional too, because in the simplified model it will have no effect at all and confuse users.

  3. I realize it might be late for this, but the name coat_color is a bit misleading as most of the time a color associated to a lobe should affect the lobe, while here it's affecting everything BUT the lobe. "coat_filter_color" or something more intuitive could have helped.

iliyang commented 5 years ago

Good finds, thanks!

  1. This regards the doc only: lerp(t, a, b) is not typical. Osl's mix(), glsl's mix(), MDL's lerp all have the syntax as lerp(a, b, t). It's a small change in the doc but might help simplify a bit.

Fixed.

  1. if coat_affect_color default to 0.0 and is "optional", then coat_color should be optional too, because in the simplified model it will have no effect at all and confuse users.

The spec wasn't absolutely clear that all layers below the coat are indeed tinted by coat_color and that the coat_affect_color parameter applies additional modulation to the diffuse reflection and subsurface scattering color saturation. So coat_color is independent of coat_affect_color. Fixed the spec to be more clear about this. Perhaps coat_affect_color is not the best name, we'll consider renaming it.

  1. I realize it might be late for this, but the name coat_color is a bit misleading as most of the time a color associated to a lobe should affect the lobe, while here it's affecting everything BUT the lobe. "coat_filter_color" or something more intuitive could have helped.

Indeed, coat_filter_color or something like that would be more clear. Thanks, we will consider renaming it.