Autodesk / standard-surface

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

ND_surface should have color opacity #20

Open code-monkey opened 2 years ago

code-monkey commented 2 years ago

Currently opacity is defined as a float in ND_surface. There are many use cases (stained glass) where it would be good to have opacity defined as a color3.

There's even a documented work-around in standard_surface.mtlx to convert the incoming color to a scalar value. Full color opacity is needed to reproduce the standard surface faithfully.

    <!-- Surface construction with opacity -->                                   
    <!-- Node <surface> only supports monochromatic opacity so use the luminance of input opacity color -->
    <luminance name="opacity_luminance" type="color3">  

It's easy to get a scalar value out of a color, it's not possible to get a color out of a scalar.

niklasharrysson commented 2 years ago

Hi Mark,

Thanks for reporting this! I will create an issue for this on the MaterialX github, since it's a limitation in the MaterialX spec. rather than a limitation with the Standard Surface specification. And we can continue the discussion there.