Directly upload the rendering
Go directly to the key code:
Because it is extracted from the SDK, it cannot be run directly. The key lies PolylineMaterialAppearance
in new Material
the configuration in:
var instance = new GeometryInstance({
geometry: new GroundPolylineGeometry({
width:5,
positions: this.points
}),
attributes: {}
});
const materialOpts = {
fabric:{
type : 'PolylineDash',
uniforms:{
color:{
red:1,
green:1,
blue:0,
alpha:1
},
gapColor:{
red:1,
green:1,
blue:1,
alpha:1
},
dashLength:50
}
}
}
this._primitive = this.parent.add(new GroundPolylinePrimitive({
asynchronous: false,
geometryInstances: instance,
appearance :new PolylineMaterialAppearance({
material:new Material(materialOpts)
})
}));
Parsing
Cesium's Material
classes are a powerful feature. Contains a variety of material templates, each material template has a specific configuration. I use PolylineDash
this type here . All configurations are in the fabric
attributes, and the type
material type is identified by sub-attributes . This is all supported material types . Here you can find the internal uniforms
configuration of each material type . On fabric
official file in the example here .