I want to reproduce the simple example as shown in the Cesium silhouette example. But I am not able to add a silhouette and receive the error message:
DeveloperError {name: ‘DeveloperError’, message: ‘czm_silhouette has already been added to the collection or does not have a unique name.’, stack: ‘Error\n at new DeveloperError (/static/js/bundle.js:78893:11)’}
Here is my code snippet:
import { PostProcessStageLibrary } from "cesium";
import { useCesium } from "resium";
export default function TestSilhouette() {
const Cesium = useCesium();
const viewer = Cesium.viewer;
const silhouetteBlue = PostProcessStageLibrary.createEdgeDetectionStage();
silhouetteBlue.uniforms.color = Color.BLUE;
silhouetteBlue.uniforms.length = 0.01;
silhouetteBlue.selected = [];
const silhouetteGreen = PostProcessStageLibrary.createEdgeDetectionStage();
silhouetteGreen.uniforms.color = Color.LIME;
silhouetteGreen.uniforms.length = 0.01;
silhouetteGreen.selected = [];
viewer.scene.postProcessStages.add(
PostProcessStageLibrary.createSilhouetteStage([
silhouetteBlue,
silhouetteGreen,
])
);
return(<></>);
Furthermore, I can find nothing related to this error message.