I need to render a polyline after click something. I create a new primitive like this.
dataSource = new PrimitiveCollection();
viewer.scene.primitives.add(dataSource);
let polyline = new Primitive({
geometryInstances: new GeometryInstance({
geometry: new PolylineGeometry({
positions: line,
width: 3,
vertexFormat: PolylineMaterialAppearance.VERTEX_FORMAT,
}),
}),
appearance: new PolylineMaterialAppearance({
material: Material.fromType('Color', {
color: Color.fromCssColorString('#fbbe11'),
}),
}),
releaseGeometryInstances: true,
asynchronous: true,
});
dataSource.add(polyline);
Every time i open a new html page, it can work successfully.
BUT when i refresh the page, there is a runtime error.
message: “Vertex texture fetch support is required to render primitives with per-instance attributes. The maximum number of vertex texture image units must be greater than zero.”
stack: “Error
at new RuntimeError (http://localhost:3000/node_modules/.vite/cesium.js?v=4347aaee:2601:11)
at Primitive.update (http://localhost:3000/node_modules/.vite/cesium.js?v=4347aaee:58082:13)
at PrimitiveCollection.update (http://localhost:3000/node_modules/.vite/cesium.js?v=4347aaee:116525:20)
at Os.update (http://localhost:3000/Cesium/Cesium3.js:5346:108009)
at o0e (http://localhost:3000/Cesium/Cesium3.js:8741:33746)
at Jg (http://localhost:3000/Cesium/Cesium3.js:8741:30566)
at Li.updateAndExecuteCommands (http://localhost:3000/Cesium/Cesium3.js:8741:27834)
at aa.pick (http://localhost:3000/Cesium/Cesium3.js:8054:14892)
at Li.pick (http://localhost:3000/Cesium/Cesium3.js:8741:41128)
at Y0e (http://localhost:3000/Cesium/Cesium3.js:8771:72626)”
Does someone know about that? Thanks very much.