PixarAnimationStudios / OpenUSD

Universal Scene Description
http://www.openusd.org
Other
6.11k stars 1.21k forks source link

Transmission color for transparent MaterialX Standard Surface materials not used #2872

Open zicher3d opened 10 months ago

zicher3d commented 10 months ago

Description of Issue

If I define a MaterialX Standard Surface material fully transparent with some transmission color, the result when viewed in usdview is always a fully transparent, uncolored material. The same MaterialX file opened in materialX viewer correctly shows a colored transparent material

Steps to Reproduce

  1. Unzip the attached file
  2. In usdview open "standard_shader_ball_simplified.usda"
  3. The mesh has assigned the material defined in "glass.mtlx"
  4. Mesh looks transparent with no color
  5. In MaterialX Viewer open "glass.mtlx"
  6. The shaderball will look transparent and red, as expected

colored_glass

StandardShaderBall_simplified.zip

jesschimein commented 10 months ago

Filed as internal issue #USD-9097

nicolassavva-autodesk commented 10 months ago

The above difference arises from the MaterialX shadergen option settings between the two viewers:

https://github.com/PixarAnimationStudios/OpenUSD/blob/0b18ad3f840c24eb25e16b795a5b0821cf05126e/pxr/imaging/hdSt/materialXFilter.cpp#L100

The current default MaterialXView option uses the alternative refraction approximation method instead (HwTransmissionRenderMethod::TRANSMISSION_REFRACTION).

That said, the color tint issues HwTransmissionRenderMethod::TRANSMISSION_OPACITY exhibits with the MaterialX shadergen Standard Surface need to be addressed when not using the refraction approximation

ashwinbhat commented 7 months ago

After switching to HwTransmissionRenderMethod::TRANSMISSION_REFRACTION the result might be acceptable, but we are missing transparency (alpha) image