Documentation: transparency hints and opacity
Hi, I'm trying to understand how to properly create transparent materials with MaterialX.
My understanding is that the opacity property for both surface_unlit and standard_surface represent what in OpenPBR is called geometry_opacity, and not transmission.
I saw in the docs that there is some sort of "transparency hint" that can be provided by materials, so that the generator knows what kind of shader to emit. However, I haven't found an example of how that works.
In the following sections, I will post images of what I did get to work and what I did not get to work. Here's a file that demonstrates these various cases: CutoutShader.mtlx.zip
Unlit Surface
[Expected] When I naively plug something into "opacity" on surface_unlit, I get a transparent object:
[Not Expected] When I run the same value through smoothstep or ifgreatereq and then plug that into "opacity", I get an opaque object that looks like its trying to be "cutout" (which would make sense) but failing to discard pixels:
Standard Surface
[Not Expected] For standard_surface, in both of these cases I get an opaque object that is not transparent, but instead has black areas where it should be either transparent or cut out:
OpenPBR
[Expected] With OpenPBR, I get transparency in both cases, and am not sure if I can get actual "cutout" behaviour (e.g. rendering opaque but discarding pixels):
UsdPreviewSurface
[Expected] With UsdPreviewSurface, I can get "cutout" explicitly by providing opacityThreshold:
[Not Expected] I believe I should be able to use "opacityMode" to get either transmissive or transparent behaviour with UsdPreviewSurface, but it seems that instead of an enum, it's currently an integer in MaterialXGraphEditor, so I can't test that.