Right now "visualizations" are added via on before compile which makes it difficult to add multiple visualizations on top of eachother and clean up when a plugin is removed (see fade, topo, overlays, user shaders, etc). This also makes users or plugins replacing shaders more difficult to deal with since we don't know when they're added or removed. A built in chaining / material mixin registration system would allow this to work more cleanly.
tiles.registerMaterialLayer( {
uniforms: {},
defines: {},
onBeforeCompile: () => {},
customCacheKey: () => {},
name: 'TOPO_MATERIAL_LAYER',
order: 0,
} );
tiles.unregisterMaterialLayer( layer );
Node materials will likely also need a similar kind of mechanism.
Right now "visualizations" are added via on before compile which makes it difficult to add multiple visualizations on top of eachother and clean up when a plugin is removed (see fade, topo, overlays, user shaders, etc). This also makes users or plugins replacing shaders more difficult to deal with since we don't know when they're added or removed. A built in chaining / material mixin registration system would allow this to work more cleanly.
Node materials will likely also need a similar kind of mechanism.