简体   繁体   English

Autodesk forge 自定义几何图形

[英]Autodesk forge custom geometry

I am currently facing the problem that rendering custom geometry into my forge is allocation a huge amount of memory.我目前面临的问题是,将自定义几何图形渲染到我的锻造中分配了大量的 memory。 I am using the technique suggested on the autodesk website: https://forge.autodesk.com/en/docs/viewer/v7/developers_guide/advanced_options/custom-geometry/ .我正在使用 Autodesk 网站上建议的技术: https://forge.autodesk.com/en/docs/viewer/v7/developers_guide/advanced_options/custom-geometry/ I need to render up to 300 custom geometrys into my viewer but by trying to do so the site is simply crashing and my memory jumps over 5 GB.我需要将多达 300 个自定义几何图形渲染到我的查看器中,但如果尝试这样做,网站只会崩溃,我的 memory 会超过 5 GB。 Is there any good way to render a large amount on custom geometry into the forge and keeping the performance up to a usefull level?有没有什么好的方法可以将大量自定义几何图形渲染到锻造中并将性能保持在有用的水平?

Thx, JT谢谢,JT

I'm afraid this is not something Forge Viewer will be able to help with.恐怕这不是 Forge Viewer 能够提供的帮助。 Here's why:原因如下:

The viewer contains many interesting optimizations for efficient loading and rendering of a single complex model .查看器包含许多有趣的优化,用于有效加载和渲染单个复杂 model For example, it builds a special BVH of all the geometries in a model so that they can be traversed and rendered in an efficient way.例如,它在 model 中构建所有几何图形的特殊 BVH,以便可以有效地遍历和渲染它们。 The viewer can also handle very complex models by moving their geometry data in and out of the GPU to make room for others.查看器还可以通过将几何数据移入和移出 GPU 为其他模型腾出空间来处理非常复杂的模型。 But again, all this assumes that there's just one (or only a few) models in the scene.但同样,所有这些都假设场景中只有一个(或几个)模型。 If you try and add hundreds of models into the scene instead, many of these optimizations cannot be applied anymore, and in some cases they can even make things worse (imagine that the viewer suddenly has to traverse 300 BVHs instead of a single one).如果您尝试将数百个模型添加到场景中,其中许多优化将无法再应用,在某些情况下它们甚至会使事情变得更糟(想象一下,观众突然不得不遍历 300 个 BVH 而不是一个)。

So what I would recommend would be: try and avoid situations where you would have hundreds of separate models in the scene.所以我的建议是:尽量避免场景中有数百个单独模型的情况。 If possible, consider "consolidating" them into a single model.如果可能,考虑将它们“合并”成一个 model。 For example, if the 300 models were Inventor assemblies that you need to place at specific positions, you could:例如,如果 300 个模型是您需要放置在特定位置的 Inventor 装配体,您可以:

  • aggregate all the assemblies using Design Automation for Inventor, and convert the result into a single Forge model, or使用 Design Automation for Inventor 聚合所有组件,并将结果转换为单个 Forge model,或
  • create a single Forge model with all 300 geometries, and then move them around during runtime using the Viewer APIs创建具有所有 300 个几何图形的单个 Forge model,然后在运行时使用查看器 API 移动它们

If none of these options work for you, you could also take a look at the new format called SVF2 ( https://forge.autodesk.com/blog/svf2-public-beta-new-optimized-viewer-format ) which significantly reduces the memory footprint.如果这些选项都不适合您,您还可以查看名为 SVF2 的新格式 ( https://forge.autodesk.com/blog/svf2-public-beta-new-optimized-viewer-format )减少了 memory 占用空间。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM