Skip to content
This is the alpha v4 version website. Looking for the v3 documentation?

createNodeProgram

createNodeProgram<N, E, G>(gl, pickingBuffer, renderer, options): NodeProgramBundle<N, E, G>

Defined in: packages/sigma/src/rendering/nodes/factory.ts:53

Builds a node program suite from SDF shape(s) and fragment layers. The suite is a flat bundle of instances: the node program plus the matching label, backdrop, and label-background programs, alongside the shape registry metadata sigma needs for multi-shape programs.

Supports two modes:

  • Single shape: a program that renders one shape type
  • Multi-shape: a program that can render different shapes per node

Type Parameters

N

N extends Attributes = Attributes

E

E extends Attributes = Attributes

G

G extends Attributes = Attributes

Parameters

gl

WebGL2RenderingContext

pickingBuffer

WebGLFramebuffer | null

renderer

Sigma<N, E, G>

options

NodeProgramOptions

Returns

NodeProgramBundle<N, E, G>

{ nodeProgram, labelProgram, backdropProgram, labelBackgroundProgram, shapeSlug, shapeNameToIndex, shapeGlobalIds }