Skip to content

Improved configurations for X-Ray #175

@xeolabs

Description

@xeolabs

Two changes to xeokit SDK Viewer configs give us better X-Ray in BIMViewer.

Disable Depth masking:

const viewer = new Viewer({
            localeService: cfg.localeService,
            canvasElement: canvasElement,
            keyboardEventsElement: cfg.keyboardEventsElement,
            transparent: false,
            backgroundColor: [1, 1, 1],
            backgroundColorFromAmbientLight: false,
            saoEnabled: true,
            pbrEnabled: false,
            colorTextureEnabled: true,
            alphaDepthMask: false,  <<--------------------- Disable depth masking
            numCachedSectionPlanes :4
        });

Improved X-Ray material configs:

 _customizeViewer() {
        const scene = this.viewer.scene;
        scene.xrayMaterial.fill = true;
        scene.xrayMaterial.fillAlpha = 0.1;
        scene.xrayMaterial.fillColor = [0.5, 0.5, 0.5];
        scene.xrayMaterial.edges = true;
        scene.xrayMaterial.edgeAlpha = 0.2;
        scene.xrayMaterial.edgeColor = [0.3, 0.3, 0.3];

Much better X-Ray effect as a result:

Screenshot from 2024-03-18 05-18-10

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions