Anyone has a clue to fix this?
Here is the code:
pickedFeatureStyle: () => {
const handler = new ScreenSpaceEventHandler(scene.canvas);
if (PostProcessStageLibrary.isSilhouetteSupported(scene)) {
const silhouetteBlue = PostProcessStageLibrary.createEdgeDetectionStage();
silhouetteBlue.uniforms.color = Color.ROYALBLUE;
silhouetteBlue.uniforms.length = 2;
silhouetteBlue.selected = [];
scene.postProcessStages.add(
PostProcessStageLibrary.createSilhouetteStage([
silhouetteBlue
])
);
handler.setInputAction((movement) => {
silhouetteBlue.selected = [];
const pickedFeature = scene.pick(movement.position);
if (silhouetteBlue.selected[0] === pickedFeature) {
return;
}
silhouetteBlue.selected = [pickedFeature];
}, ScreenSpaceEventType.LEFT_CLICK);
} else {
console.warn('Silhouette for object is not supported');
}
},
And here is the result: