xeokit-sdk icon indicating copy to clipboard operation
xeokit-sdk copied to clipboard

Regression of selected object's color when its opacity is 0

Open hamza-hajji opened this issue 2 years ago • 4 comments

Describe the bug New version 2.4.2-beta-14 has different behavior than 2.3.x when setting a 0 opacity entity to selected

To Reproduce Steps to reproduce the behavior:

  1. Use the xkt_dtx_Schependomlaan example
  2. Set IfcSpace default opacity to 0
   const sceneModel = xktLoader.load({
      id: "myModel",
      src: "../../assets/models/xkt/v8/ifc/Schependomlaan.ifc.xkt",
      saoEnabled: true,
      edges: false,
      dtxEnabled: true,
      objectDefaults: {
        IfcSpace: {
          opacity: 0,
        },
      },
    });
  1. Select the Ifc spaces and select them

image

The material is deifferent from 2.3.9 behavior

Expected behavior

This is a screenshot after using the 2.3.9 build, using the same script as above

image

hamza-hajji avatar Nov 27 '23 15:11 hamza-hajji

Seems OK in @xeokit/xeokit-sdk 2.4.2-beta-20 .. could you try again with this version?

xeolabs avatar Nov 27 '23 16:11 xeolabs

I used 2.4.2-beta-20, now they have white borders

image

hamza-hajji avatar Nov 27 '23 16:11 hamza-hajji

That's intentional (see https://github.com/xeokit/xeokit-sdk/pull/1253).

Note that the appearance of the selected objects, including the white borders, is configurable, eg:

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

 viewer.scene.selectedMaterial.fillColor = [0.0, 1.0, 0.0];
 viewer.scene.selectedMaterial.fillAlpha= 0.5;
 viewer.scene.selectedMaterial.edges = true;
 viewer.scene.selectedMaterial.edgeColor = [1.0, 1.0, 1.0];
 viewer.scene.selectedMaterial.edgeAlpha= 1.0;
 viewer.scene.selectedMaterial.edgeWidth= 1;
 viewer.scene.selectedMaterial.glowThrough = true;

xeolabs avatar Nov 27 '23 16:11 xeolabs

@xeolabs the original issue wasn't with the edges, it's about entities with opacity=0 not being filled when selected, it actually used to be filled in version 2.3.9

image

hamza-hajji avatar Dec 11 '23 16:12 hamza-hajji