简体   繁体   中英

Viewer quality settings (for one viewer on the page)

I have two viewers on the same page. And I want to set performance settings for only one viewer with following code:

this.viewer.setQualityLevel(false, false);
this.viewer.setGroundShadow(false);
this.viewer.setGroundReflection(false);
this.viewer.setProgressiveRendering(true);

BUT (!) settings are applied for both viewers for some reason. Is there any way to apply them only for one viewer on the page?

EDIT

Also try the Profile API to persist settings - you can get the current profile with:

viewer.profile

I was unable to replicate the issue unfortunately ... looking at your code did you assign two viewers to the same handle? can you post your code to initialize viewers? what version of viewer btw?

在此处输入图片说明

The viewer settings are kept in localStorage , so changing them using methods like viewer.setQualityLevel probably propagates the updates to other viewer instances as well. Let me discuss this behavior with the dev team as (I think) it could be considered a bug.

In the meantime, if you need to change settings for a single instance of the viewer, consider using "lower level" methods that don't use the local storage. For example, instead of viewer.setQualityLevel(useSAO, useFXAA) you could use viewer.impl.togglePostProcess(useSAO, useFXAA) , and instead of viewer.setGroundShadow(bool) you could use viewer.impl.toggleGroundShadow(bool) .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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