cesium 开发记录报错:DeveloperError: Appearance/Geometry mismatch.
cesium 开发记录报错:DeveloperError: Appearance/Geometry mismatch.
The appearance requires vertex shader attribute input ‘compressedAttributes’, which was not computed as part of the Geometry. Use the appearance’s vertexFormat property when constructing the geometry.
DeveloperError: Appearance/Geometry mismatch.
The appearance requires vertex shader attribute input 'compressedAttributes',
which was not computed as part of the Geometry. Use the appearance's vertexFormat property when constructing the geometry.
cesium开发时,使用geometryInstances添加实体时报错:
let geometry = Cesium.BoxOutlineGeometry.fromDimensions({dimensions: this._dimensions});let modelMatrix = this.computerModelMatrix(this._centerPoint)let instance = new Cesium.GeometryInstance({geometry: geometry,modelMatrix: Cesium.Matrix4.multiplyByTranslation(modelMatrix, offset,new Cesium.Matrix4()),attributes: {color: Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA)}, });this._geometryInstances.push(instance)scene.primitives.add(new Cesium.Primitive({geometryInstances: this._geometryInstances,appearance: new Cesium.PerInstanceColorAppearance( )}));
错误大意是定点属性和材质的不匹配,后来才知道是因为BoxOutlineGeometry不能使用光照,在appearance中将flat属性设为true,即关闭关照,即可。
若是BoxGeometry则无需关闭光照。
原官网该错误回答链接:Default PerInstanceColorAppearance doesn’t work with BoxOutlineGeometry
本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!
