Reference cameraInputs

cameraInputs

A shader hook block that adjusts vertex properties from the perspective of the camera. This hook can be used inside buildMaterialShader() and similar shader modify() calls to customize vertex positions, normals, texture coordinates, and colors before rendering. "Camera space" refers to the coordinate system of the 3D scene after transformations have been applied, seen relative to the camera.

cameraInputs has the following properties:

  • position: a three-component vector representing the position after camera transformation.
  • normal: a three-component vector representing the normal after camera transformation.
  • 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!

Related References