本文介绍了如何设置每个节点的不透明度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

反正有设置模型某些节点的不透明度吗?

Is there anyway to set opacity of some nodes of the model?

例如,创建替代材质并将其在渲染器中用于某些节点而非整个场景.

For instance, create a override material and use it in renderer for some nodes rather than whole scene.

推荐答案

在加载模型时,查看器会构建其内部空间索引结构(BVH),其中考虑的因素之一是不同片段的透明性.这是为了确保在不透明对象之后渲染半透明对象.

When loading a model, the viewer builds its internal spatial indexing structures (BVHs), and one of the factors it takes into account is the transparency of the different fragments. This is in order to ensure that semi-transparent objects are rendered after the opaque ones.

但是,当动态更改片段的材质时(在模型的初始加载之后),订单不会更新,因为查看器无法按需重建BVH,您可以最终会出现诸如由透明对象隐藏的不透明对象之类的东西....我们有一个待处理的更改请求,目的是添加一个API,该API允许开发人员重建BVH,但遗憾的是尚未添加.

However, when changing the material of a fragment on-the-fly (after initial load of your model), the order is not updated because the viewer doesn't have a way to rebuild the BVHs on demand, and you can end up with something like opaque objects hidden by transparent ones ... We have a pending change request in order to add an API that would allow developers to rebuild BVHs, unfortunately it has not yet been added yet.

您可以查看以下资源,例如在查看器中修改材料的示例:

You may take a look at the following resources for example of modifying materials in the viewer:

Autodesk.ADN.Viewing.Extension.Material

Forge Viewer自定义着色器-第1部分

Forge Viewer自定义着色器-第2部分

自定义透明网格与View&数据API

希望有帮助

这篇关于如何设置每个节点的不透明度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 01:13