Material TerrainMap;
MaterialPtr TerrainMaterialPtr;
...
// load images for material
File terrainfile; terrainfile.read(SpiritsConfig.DataPath + "/Image/Map/world.topo.bathy.png");
Image base0, base1, terrain, specular, alpha, bump, normal, glow;
terrain.ImportPNG(terrainfile);
File specularfile; specularfile.read(SpiritsConfig.DataPath + "/Image/Map/water_8k.png");
specular.ImportPNG(specularfile);
uint bt=CreateBaseTextures(base0, base1, terrain, alpha, bump, normal, specular, glow);
TerrainMap.base_0 = &base0;
TerrainMap.base_1 = &base1;
TerrainMap.validate();
TerrainMaterialPtr = &TerrainMap;
...
Earth.mesh->parts(0).setMaterial( TerrainMaterialPtr, null, null, null );