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
Section titled “Type Parameters”N extends Attributes = Attributes
E extends Attributes = Attributes
G extends Attributes = Attributes
Parameters
Section titled “Parameters”string[]
options
Section titled “options”getWeight?
Section titled “getWeight?”(node) => number
radius
Section titled “radius”number
zoomToRadiusRatioFunction
Section titled “zoomToRadiusRatioFunction”(ratio) => number
coloring
Section titled “coloring”cacheUniforms
Section titled “cacheUniforms”(programInfo) => void
definition
Section titled “definition”setCameraUniforms?
Section titled “setCameraUniforms?”(params, programInfo) => void
Returns
Section titled “Returns”WebGLLayerProgramType<N, E, G>