This API is experimental
Its behavior may change in a future version of p5.js.
A shader hook block to modify the properties of each vertex before any transformations are applied. This hook can be used inside buildMaterialShader() and similar shader modify() calls to customize vertex positions, normals, texture coordinates, and colors before rendering. Modifications happen between the .begin() and .end() methods of the hook. "Object space" refers to the coordinate system of the 3D scene before any transformations, cameras, or projection transformations are applied.
objectInputs has the following properties:
position: a three-component vector representing the original position of the vertex.normal: a three-component vector representing the direction the surface is facing.texCoord: a two-component vector representing the texture coordinates.color: a four-component vector representing the color of the vertex (red, green, blue, alpha).
This hook is available in:
Examples
Notice any errors or typos? Please let us know. Please feel free to edit src/strands/p5.strands.js and open a pull request!