glTF model clippingPlanes removeall error
Cesium version : 1.68
chrome version : 80.0.3987.149
when excute glTFModel.clippingPlanes.removeAll() i got a rendering error : gltf_clippingPlanes UniformSampler value is undefined
I've tried other models . I think the multi Bounding Volume model has this problem.
model link : https://sketchfab.com/3d-models/white-silver-green-residence-ec516ba32f03403f97954472c5d4b2cf#download

window.viewer = new Cesium.Viewer("cesiumContainer", {
// terrainProvider: createWorldTerrain()
imageryProvider: false,
animation: false,
baseLayerPicker: false,
geocoder: false,
timeline: false,
sceneModePicker: false,
navigationHelpButton: false,
infoBox: false,
fullscreenButton: false,
homeButton: false,
selectionIndicator: false,
navigationInstructionsInitiallyVisible: false,
shouldAnimate: true,
});
const options = {
id: "example-model",
// url: '/model/Duck.glb',
// scale:400000,
/*-------------------------------------------------------- */
url: "/model/white_silver_green_residence/scene.gltf",
scale: 400,
position: [108.947048, 34.259415],
};
window.model = Cesium.Model.fromGltf({
modelMatrix: Cesium.Transforms.headingPitchRollToFixedFrame(
Cesium.Cartesian3.fromDegrees.call(null, ...options.position),
new Cesium.HeadingPitchRoll(
Cesium.Math.toRadians(0),
Cesium.Math.toRadians(0),
Cesium.Math.toRadians(0)
)
),
...options,
url: options.url,
clippingPlanes: new Cesium.ClippingPlaneCollection({
edgeWidth: 1,
planes: [new Cesium.ClippingPlane(new Cesium.Cartesian3(-1, 0, 0), 0)],
}),
});
viewer.scene.primitives.add(model);
viewer.camera.setView({
destination: new Cesium.Cartesian3(
-1953829.2409311095,
6618724.811636659,
3227893.906284791
),
orientation: {
heading: 0.24165191356149585,
pitch: -0.9933975711287646,
roll: 6.283006645076183,
},
});
There does seem to be something about this model that causes the renderer to be in an invalid state when the clipping plane is removed. Running it myself I get a different stack trace sometimes:
TypeError: Cannot read property '6' of undefined
TypeError: Cannot read property '6' of undefined
at regenerateShaders (http://localhost:8080/Source/Scene/Model.js:4981:49)
at Model.update (http://localhost:8080/Source/Scene/Model.js:4835:17)
at PrimitiveCollection.update (http://localhost:8080/Source/Scene/PrimitiveCollection.js:374:27)
at updateAndRenderPrimitives (http://localhost:8080/Source/Scene/Scene.js:3010:27)
at executeCommandsInViewport (http://localhost:8080/Source/Scene/Scene.js:2836:13)
at Scene.updateAndExecuteCommands (http://localhost:8080/Source/Scene/Scene.js:2644:13)
at render (http://localhost:8080/Source/Scene/Scene.js:3319:15)
at tryAndCatchError (http://localhost:8080/Source/Scene/Scene.js:3338:13)
at Scene.render (http://localhost:8080/Source/Scene/Scene.js:3413:13)
at CesiumWidget.render (http://localhost:8080/Source/Widgets/CesiumWidget/CesiumWidget.js:704:25)
I think it is related. There is a list of uniforms out of which there is one UniformSampler named "model_clipping_planes" with value as undefined.

@prasuncct or @changqingom could you check if this is fixed for you in the latest release CesiumJS 1.97? We refactored the model loading code and this may have been fixed.
@lilleyse I am not loading the gltfmodel but the pointcloud (las). It does not seem to be fixed yet.

Point clouds and glTF models now use the same Model class under the hood so the behavior should be similar.
Would you be able to put together a sandcastle that demonstrates the problem?
Point clouds and glTF models now use the same
Modelclass under the hood so the behavior should be similar.Would you be able to put together a sandcastle that demonstrates the problem?
@lilleyse Can you see this sandcastle? Click the removeAll button twice , all types fail
This could be related to https://github.com/CesiumGS/cesium/issues/10811. CC @j9liu