modelScale
Provides a vec3 whose components represent the object's final scale factors on its local X, Y, and Z axes.
Core Advantages
Automatically provides per-axis scale information, enabling easy correction of texture or pattern distortion on non-uniformly scaled objects and driving deformation-based effects without manual uniform management.
Common Uses
Correcting texture stretching by inversely scaling UV coordinates to keep patterns uniform regardless of scale.
Normalizing the calculation space for procedural details (like bricks or scales) to maintain their size irrespective of object scale.
Driving dynamic effects based on how much an object is stretched along a specific axis, e.g., making it glow brighter as it gets taller.
How to adjust
The output of this node cannot be adjusted with parameters; it is determined entirely by the `.scale` property of the 3D object in the scene. The visual effect is controlled by how you use this `vec3` value in your shader logic, such as dividing UV coordinates with it or using one of its components as a mix factor.
Code Examples
1// Counter-scale UV coordinates to compensate for texture stretching on the model
2const correctedUV = uv().div( modelScale.xy );
3
4// Use the corrected UVs for texture sampling
5const textureColor = texture( myTexture, correctedUV );