The defaultFunctions are functions already incorporated onto the shaders you create, so you can call them without import.

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.

Use the base example as reference: examples/base/vert.js

Source:
core/defaultFunctions.js, line 1

Members

staticconstantdefaultVertexBody string

The defaultVertexBody is used as a drop-in replacement of the vertex shader content.
This is not required, but useful if you plan to use the default parameters of the library.
All the examples in the examples directory use this function in their vert.js file.

Default function for the Vertex shader that takes charge of automating the creation of a few variables that are commonly used.

Source:
core/defaultFunctions.js, line 33
Example
return defaultVertexBody(position, color, uv);
Inside the main vertex function add this

MIT

Documentation generated by JSDoc 4.0.4 using Docolatte theme on