Attributes
Attributes contain information for each vertex.
In order to use attribute information for calculating the color, they have to first be made varying. See the the guide on Varying for how to do this.
Predefined
ThreeJS provides data for each vertex for position, uv, and normal. These can be accessed from the common attributes object.
Transformed value helpers
If a vertex transformation is included in the material, then the attributes passed in to the shaders for each vertex are often less useful. Use these values to refer to the position and normal after vertex transformations. Usually you always want to use these to calculate the amount of light reflected from a surface.
Custom attributes
You can also define your own attributes with attribute node classes.
The following classes exist to define your own attributes and the only constructor argument is the name of the attribute as it is defined when calling setAttribute
on a THREE.BufferGeometry.
Last updated