AcademySoftwareFoundation / OpenPBR

Specification and reference implementation for the OpenPBR Surface shading model
Apache License 2.0
407 stars 18 forks source link

Update anisotropy in reference graph #156

Closed jstone-lucasfilm closed 5 months ago

jstone-lucasfilm commented 5 months ago

This changelist updates the anisotropy logic in the OpenPBR reference graph to match the specification.

To improve clarity and encapsulation, the new logic has been added as an 'open_pbr_anisotropy' node, which is then leveraged in the shading model graph as needed.

jstone-lucasfilm commented 5 months ago

In order to provide a visual sense of the new behavior, here is a render sequence of a brushed metal material with specular roughness 0.3, with the specular anisotropy ranging from 0.3 to 0.9:

Specular Anisotropy 0.3 BrushedMetal_Anisotropy_0 3

Specular Anisotropy 0.5 BrushedMetal_Anisotropy_0 5

Specular Anisotropy 0.7 BrushedMetal_Anisotropy_0 7

Specular Anisotropy 0.9 BrushedMetal_Anisotropy_0 9

jstone-lucasfilm commented 5 months ago

Fixes #153

portsmouth commented 5 months ago

Looks correct to me, provided that invert(x) computes 1-x.

Also note that in the spec, we refer to $\alpha_t, \alpha_b$, not $\alpha_x, \alpha_y$, though it's clear enough.

(I'm sure you're aware, but it's generally extremely difficult/inconvenient to author -- or check -- any non-trivial formulas in this XML form without making mistakes. It seems like really the XML ought to be generated via some compilation stage, from an expression in some more easily authorable language, e.g. Python).

jstone-lucasfilm commented 5 months ago

@portsmouth We're definitely open to contributions of Python-to-MaterialX scripts, though so far we've been more focused on MaterialX graph editors such as LookdevX (Autodesk), Solaris (SideFX) and QuiltiX (open-source), which can be use for both artist content and BSDF math. I love the idea of a Python-to-MaterialX converter, though, and I'd be happy to provide guidance if a developer is interested in taking on this project.