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

GLSL_NODE_SIZE_TO_PIXELS

const GLSL_NODE_SIZE_TO_PIXELS: ā€œ\nfloat matrixScaleX = length(vec2(u_matrix[0][0], u_matrix[1][0]));\nfloat nodeRadiusGraphSpace = nodeSize * u_correctionRatio / u_sizeRatio * 2.0;\nfloat nodeRadiusNDC = nodeRadiusGraphSpace * matrixScaleX;\nfloat nodeRadiusPixels = nodeRadiusNDC * u_resolution.x / 2.0;\nā€

Defined in: packages/sigma/src/rendering/glsl.ts:34

Converts node size from graph coordinates to screen pixels. Requires uniforms: u_matrix, u_correctionRatio, u_sizeRatio, u_resolution Requires a float nodeSize in scope (e.g. fetched from the node-data texture).