Skip to content

FastNavPlugin - disables SAO and PBR while camera moving #601

@xeolabs

Description

@xeolabs

FastNavPlugin is a Viewer plugin that improves interactivity by disabling expensive rendering effects while the Camera is moving.

Usage

In the example below, we'll create a Viewer, add a FastNavPlugin, then use an XKTLoaderPlugin to load a model.

This Viewer will only render the model with physically-based rendering (PBR) and scalable ambient obscurance (SAO) when the Camera is not moving.

import {Viewer} from "../src/viewer/Viewer.js";
import {XKTLoaderPlugin} from "../src/plugins/XKTLoaderPlugin/XKTLoaderPlugin.js";
import {FastNavPlugin} from "../src/plugins/FastNavPlugin/FastNavPlugin.js";

const viewer = new Viewer({
     canvasId: "myCanvas",
     transparent: true,
     pbrEnabled: true,
     saoEnabled: true
});

viewer.camera.eye = [7.31, 2.79, 6.12];
viewer.camera.look = [2.80, 0.15, 1.83];
viewer.camera.up = [-0.28, 0.92, -0.26];

new FastNavPlugin(viewer, {});

const xktLoader = new XKTLoaderPlugin(viewer);

const model = xktLoader.load({
      id: "myModel",
      src: "./models/xkt/gearboxPropellorTurbine/gearboxPropellorTurbine.xkt",
      edges: true,
      saoEnabled: true,
      pbrEnabled: true
});

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions