A few signed distance functions.

These are wgsl functions, not js functions. The function is enclosed in a js string constant, to be appended into the code to reference it in the string shader.

Source:
core/sdf.js, line 1

Members

staticconstantsdfCircle String

Creates a circle

Source:
core/sdf.js, line 81
Example
import { sdfCircle } from 'points/sdf';

// wgsl string
${sdfCircle}
let value = sdfCircle(position, radius, feather, uvr);
js

staticconstantsdfLine String

Creates a line with a pixel stroke.

Source:
core/sdf.js, line 53
Example
import { sdfLine } from 'points/sdf';

// wgsl string
${sdfLine}
let value = sdfLine(p1, p2, pixeStroke, uvr);
js

staticconstantsdfLine2 String

Better than sdfLine to create lines

Source:
core/sdf.js, line 143
Example
import { sdfLine2 } from 'points/sdf';

// wgsl string
${sdfLine2}
let value = sdfLine2(p1, p2, feather, uvr);
js

staticconstantsdfSegment String

Function used to create lines. It's a dependency of them.

Source:
core/sdf.js, line 27
Example
import { sdfSegment } from 'points/sdf';

// wgsl string
${sdfSegment}
let value = sdfSegment(uv, point1, point2);
js

staticconstantsdfSmooth String

Special for letters and create an sdf version of a texture

Source:
core/sdf.js, line 165
Example
import { sdfSmooth } from 'points/sdf';

// wgsl string
${sdfSmooth}
let value = sdfSmooth(rgba);
js

staticconstantsdfSquare String

Creates a square

Source:
core/sdf.js, line 107
Example
import { sdfSquare } from 'points/sdf';

// wgsl string
${sdfSquare}
let value = sdfSquare(position, radius, feather, rotation, uvr);
js

MIT

Documentation generated by JSDoc 4.0.4 using Docolatte theme on