kcoley / gltf2usd

command-line utility for converting glTF 2.0 models to USD
MIT License
264 stars 38 forks source link

Addition of opacityThreshold for USD Preview Surface #176

Open ShantanuSriv opened 5 years ago

ShantanuSriv commented 5 years ago

I think in the usd_material class we have not added opacityThreshold parameter which was introduced recently. It would be nice to have this feature included in the usd_material class because seems like this is performing the same operation as what alphaCutoff does in glTF.

USD Preview Surface - https://graphics.pixar.com/usd/docs/UsdPreviewSurface-Proposal.html

danlee-lils commented 4 years ago

I have made this change. This change requires minor change in gltf material.py and making sure to add the opacityThreshold when blend mode is set to mask. Just a sidenote, Apple's quicklook at this point does not support opacityThreshold. Ping me and I can share it with you. One question that I would love to hear from kcoley is that I am not sure if I have to connect opacityThreshold to any kind of source... if you look at usd_material, opacity is connected to texture_shader source with 'a'. I am not sure if opacityThreshold needs a connection.