createDensitySplatProgram
createDensitySplatProgram<
N,E,G>(nodes,options,coloring):WebGLLayerProgramType<N,E,G>
Defined in: packages/layer-webgl/src/density-splat-program/index.ts:22
Factory that creates a WebGL layer program class with built-in density splatting.
The splat pass renders each node as a smooth gaussian-like circle into an offscreen R32F texture using additive blending, producing a density field. The coloring pass then reads this density texture and maps it to colors via the provided fragment shader.
Subclasses (contours, heatmap, etc.) only need to provide the coloring strategy:
a fragment shader that reads u_densityTexture and the uniforms to set.
Type Parameters
N
N extends Attributes = Attributes
E
E extends Attributes = Attributes
G
G extends Attributes = Attributes
Parameters
nodes
string[]
options
getWeight?
(node) => number
radius
number
zoomToRadiusRatioFunction
(ratio) => number
coloring
cacheUniforms
(programInfo) => void
definition
setCameraUniforms?
(params, programInfo) => void
Returns
WebGLLayerProgramType<N, E, G>