createEdgeDetectionStage
Creates a post-process stage that detects edges.
Writes the color to the output texture with alpha set to 1.0 when it is on an edge.
This stage has the following uniforms: color and length
coloris the color of the highlighted edge. The default is Color.BLACK.lengthis the length of the edges in pixels. The default is0.5.
This stage is not supported in 2D.
// multiple silhouette effects
const yellowEdge = PostProcessStageLibrary.createEdgeDetectionStage();
yellowEdge.uniforms.color = Color.YELLOW;
yellowEdge.selected = [feature0];
const greenEdge = PostProcessStageLibrary.createEdgeDetectionStage();
greenEdge.uniforms.color = Color.LIME;
greenEdge.selected = [feature1];
// draw edges around feature0 and feature1
postProcessStages.add(PostProcessStageLibrary.createSilhouetteStage([yellowEdge, greenEdge]);Content copied to clipboard
Return
A post-process stage that applies an edge detection effect.