Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved configurations for X-Ray #175

Open
xeolabs opened this issue Mar 18, 2024 · 0 comments
Open

Improved configurations for X-Ray #175

xeolabs opened this issue Mar 18, 2024 · 0 comments

Comments

@xeolabs
Copy link
Member

xeolabs commented Mar 18, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant