I am using CZML to draw dynamic paths and use the ‘path’ attribute, but I do not like the polylineOutline material provided in ‘path’. Is there any way for me to customize shader materials in CZML?
Hi @Zeng-Fan-Yi, thanks for the question.
CZML entites can be created with a range of materials other than just polylineOutline
, for example a solidColor
.
These can be applied in the CZML itself:
const czml = [
//...
{
id: "test-path",
name: "test path",
path: {
material: {
solidColor: {
color: {
rgba: [0, 0, 255, 255],
},
},
},
},
// ...
Or applied after it’s loaded
const testPath = dataSource.entities.getById("test-path");
testPath.path.material = Cesium.Color.fromRandom({ alpha: 1.0 });
the CZML Polyline and CZML Rectangle Sandcastles show some other examples of modifying the material in the CZML itself. The Geometry and Appearances sandcastle shows how to create some other materials using the Cesium API.
Hopefully that helps you get started