Skip to content

Commit 089edce

Browse files
committed
Add guard against empty clipping geometry
1 parent 9349dc0 commit 089edce

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

packages/engine/Source/Scene/Model/ModelSceneGraph.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,11 @@ ModelSceneGraph.prototype.configurePipeline = function (frameState) {
735735
modelPipelineStages.push(ModelClippingPlanesPipelineStage);
736736
}
737737

738-
if (model.isClippingPolygonsEnabled()) {
738+
// Even if a model has a clipping polygon collection, the polygons may not overlap the model geometry,
739+
// in which case the clipping polygon pipeline stage should not be added.
740+
const hasClippingPolygonGeometry =
741+
(model._clippingPolygonData?.polygonRings.length ?? 0) > 0;
742+
if (model.isClippingPolygonsEnabled() && hasClippingPolygonGeometry) {
739743
modelPipelineStages.push(ModelClippingPolygonsPipelineStage);
740744
}
741745

0 commit comments

Comments
 (0)