Is there a way to set the transparency of the component? For example, if you modify the component material or add a transparent material, let the Viewer render it.
天蓬老师2017-07-05 11:05:28
According to my experience, when Forge Viewer loads a model, it will help the model establish its surrounding layer (BVH). At this time, there will be an internal parameter used to calculate the transparency of the geometry fragment (fragment), and this parameter is for Ensure the rendering order of semi-transparent and fully transparent components. Generally, fully transparent components will be rendered first.
When we modify the component material transparency, this order will not be updated. This is because the Viewer will not rebuild the BVH after we fix it, so we see some opaque components being hidden. And my debugging experience shows that there is no way to rebuild BVH in Viewer, so this problem cannot be solved at present.
But here are some examples of modifying materials and transparency for your reference:
Autodesk.ADN.Viewing.Extension.Material
Forge Viewer Custom Shaders - Part 1
Forge Viewer Custom Shaders - Part 2
Custom transparent meshes with View & Data API
Hope this helps you
Reference source: https://stackoverflow.com/que...