Interface StudioCreateViewParams

Parameters for studio.viewManager.createView. Extends the SDK's ViewParams with demo-specific knobs.

interface StudioCreateViewParams {
    autoLayers?: boolean;
    backgroundColor?: FloatArrayParam;
    backgroundColorFromAmbientLight?: boolean;
    camera?: CameraParams;
    effects?: EffectsParams;
    elementId?: string;
    floating?: boolean | Omit<ViewPanelParams, "onClose">;
    highlightMaterial?: EffectParams;
    htmlElement?: HTMLCanvasElement;
    id?: string;
    layers?: ViewLayerParams[];
    lights?: LightsParams;
    pointsMaterial?: PointsMaterialParams;
    premultipliedAlpha?: boolean;
    renderMode?: number;
    resolutionScale?: ResolutionScaleParams;
    sectionPlanes?: SectionPlaneParams[];
    selectedMaterial?: EffectParams;
    transparent?: boolean;
    xrayMaterial?: EffectParams;
}

Hierarchy (View Summary)

Properties

autoLayers?: boolean

Whether the View will automatically create ViewLayer | ViewLayers on-demand as ViewObject | ViewObjects are created.

When true (default), the View will automatically create ViewLayer | ViewLayers as needed for each new SceneObject.layerId encountered, including a "default" ViewLayer for ViewerObjects corresponding to SceneObjects that have no layerId. This default setting therefore ensures that a ViewObject is created in the View for every SceneObject that is created.

If you set this false, however, then the View will only create ViewObject | ViewObjects for SceneObjects that have a SceneObject.layerId that matches the ID of some ViewLayer that you explicitly created earlier with View.createLayer.

Setting this parameter false enables a View to contain only the ViewObjects that it actually needs to show, i.e. to represent only SceneObjects that it needs to view. This enables a View to avoid wastefully creating and maintaining ViewObjects for SceneObjects that it never needs to show.

Default value is true.

backgroundColor?: FloatArrayParam

RGB clear color for the View | View's canvas.

Only works when canvas is not transparent.

Default value is [1,1,1].

backgroundColorFromAmbientLight?: boolean

Set true to attempt to derive the View | View's canvas RGB clear color from any AmbientLight | AmbientLights defined in the View .

Only works when canvas is not transparent.

Falls back on View.backgroundColor |

Default value is [1,1,1].

camera?: CameraParams

Parameters for the View's Camera.

effects?: EffectsParams

Parameters for the View's renderer-effect components, Effects — covering SAO, Edges, Bloom, Tonemap, AntiAliasing, and Shadows.

elementId?: string

ID of an HTMLCanvasElement in the DOM.

floating?: boolean | Omit<ViewPanelParams, "onClose">

Open the new View inside a ViewPanel — a floating, draggable panel with the same chrome (header, close button, reopen pill, layout persistence) as the other demo panels.

  • false / omitted — append the View's canvas to the shared layout container, tiled alongside any other auto-laid-out Views (the legacy behaviour).
  • true — wrap the canvas in a ViewPanel using default panel parameters (title "View — {id}", 480 × 360 initial size).
  • ViewPanelParams — wrap and forward the supplied panel parameters (title, initial size, container).

Ignored when elementId or htmlElement is set, since the caller is supplying their own DOM target.

highlightMaterial?: EffectParams

Parameters for the appearance of ViewObject | ViewObjects in the View when they are highlighted.

htmlElement?: HTMLCanvasElement

An HTMLElement in the DOM.

Overrides ViewParams.elementId

id?: string

Optional ID, genarated automatically by Viewer.createView if omitted.

layers?: ViewLayerParams[]

Parameters for the View's ViewLayer | ViewLayers.

lights?: LightsParams

Parameters for the View's environment-illumination components, Lights — covering both IBL (cubemap) and HemisphereAmbient (analytical hemispheric).

pointsMaterial?: PointsMaterialParams

Parameters for the View | View's PointsMaterial.

premultipliedAlpha?: boolean

Whether the View | View performs alpha composition with premultiplied alpha. Highlighting and selection works best when this is false.

Default value is false.

renderMode?: number

Configures which rendering mode the View is in.

Default is DetailedRender.

resolutionScale?: ResolutionScaleParams

Paramaters the View's ResolutionScale.

sectionPlanes?: SectionPlaneParams[]

Paramaters for the View's SectionPlane | SectionPlanes.

selectedMaterial?: EffectParams

Parameters for the appearance of ViewObject | ViewObjects in the View when they are selected.

transparent?: boolean

Configures whether the View | View's canvas is transparent.

Default value is false.

xrayMaterial?: EffectParams

Parameters for the appearance of ViewObject | ViewObjects in the View when they are X-rayed.