如何激活“Autodesk.MemoryLimited"Forge Viewer 中的扩展? [英] How to active "Autodesk.MemoryLimited" Extension in Forge Viewer?

查看:31
本文介绍了如何激活“Autodesk.MemoryLimited"Forge Viewer 中的扩展?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在本地环境 forge 查看器中加载大型模型时遇到问题.

I'm having trouble loading a Large Model in local environment forge viewer.

我已经检查过 Autodesk Forge 查看器指南为大型模型分配内存"(https://forge.autodesk.com/en/docs/viewer/v7/developers_guide/viewer_basics/memory-limit/)

Already I had check Autodesk Forge Viewer Guide "Allocate Memory for Large Models"(https://forge.autodesk.com/en/docs/viewer/v7/developers_guide/viewer_basics/memory-limit/)

我申请了Autodesk.MemoryLimited"查看器配置中的扩展,但没有发生任何事情.指南文件说开发者和用户可以通过验证左下角的加载栏显示为蓝色而不是绿色,但加载栏没有改变(仍然是绿色)来验证该功能是否有效.

and I apply "Autodesk.MemoryLimited" Extension in viewer config but anything isn't happened. Guide document say Developers and users can validate the feature is in action by verifying that the bottom-left loading bar displays in blue instead of green, but loading bar is not changed(still green).

我还加载了Autodesk.Viewing.MemoryLimitedDebug"扩展.

also i load "Autodesk.Viewing.MemoryLimitedDebug" Extension.

您有激活Autodesk.MemoryLimited"的想法吗?扩展?

Do you have an idea to activate "Autodesk.MemoryLimited" Extension?

内存管理器

推荐答案

很遗憾,文档缺少一小部分信息.使用 Autodesk.Viewing.MemoryLimited 扩展时,您必须配置要施加的实际内存限制,例如:

The documentation is missing one small piece of information unfortunately. When using the Autodesk.Viewing.MemoryLimited extension you have to configure the actual memory limit you want to impose, for example, like so:

const config = {
    loaderExtensions: { svf: 'Autodesk.MemoryLimited' },
    memory: {
        limit: 1024
    }
};
const viewer = new Autodesk.Viewing.GuiViewer3D(document.getElementById('preview'), config);

另外,请注意内存限制加载在您的模型大于配置的阈值时启用.如果您想对较小的模型强制进行内存限制加载,请尝试以下操作:

Also, note that the memory-limited loading will only be enabled when your model is larger than the configured threshold. If you want to force the memory-limited loading even for smaller models, try this:

const config = {
    loaderExtensions: { svf: 'Autodesk.MemoryLimited' },
    memory: {
        limit: 1024,
        debug: {
            force: true
        }
    }
};
const viewer = new Autodesk.Viewing.GuiViewer3D(document.getElementById('preview'), config);

编辑

memory.debug 对象可以包含自定义内存限制加载行为的附加属性.这些仅供内部使用,但您也可以对其进行试验:

Edit

The memory.debug object can contain additional properties customizing the behavior of the memory-limited loading. Those are meant for internal use but you could experiment with them as well:

options.debug = {
        // Increase the max page out size. On slow (mobile) devices the scene
        // traversal is a bottle neck and making this larger helps load more
        // pack files earlier in the load.
        maxPageOutSize: 195,                                // Max we will page out in one go
        pixelCullingEnable: this.options.onDemandLoading,   // Useful with on demand loading
        pixelCullingThreshold: avp.PIXEL_CULLING_THRESHOLD,

        occlusionThreshold: 1,
        occlusionTestThreshold: 1,
        startOcclusionTestingPackCount: 8,
        testPackfileCount: 4,
        useOcclusionInstancing: true,
        automaticRefresh: true,
        boxProxyMaxCount: 0, // show this many boxes during a render
        boxProxyMinScreen: 0.4 // if entire render batch is >= 1/10 of the screen in area
    };

这篇关于如何激活“Autodesk.MemoryLimited"Forge Viewer 中的扩展?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆