bvec3
Converts a 3D vector (like color, position, or normal) into a boolean vector (`bvec3`) component-wise, where 0 becomes `false` and any non-zero value becomes `true`.
Core Advantages
Abstracts the tedious multi-step process (e.g., manually comparing each component and then constructing) into a single, clear node, greatly simplifying logic for 3D data like colors and normals and improving readability.
Common Uses
As a mask for the `mix` function to achieve channel-wise color mixing (glitch art)
Applying effects like snow or moss based on surface orientation (normals)
Visualizing 3D vectors like normals as solid colors for debugging
Creating 3D procedural patterns inside an object (volumetric patterns)
How to adjust
This node's effect is entirely determined by its input node. To change the output boolean pattern, modify the input `vec3`. For example, using `normalWorld` creates an orientation-based mask, while using a noise-driven `vec3` can create random glitch effects.
Code Examples
1// Use a bvec3 mask to mix two colors channel by channel
2const mask = someVec3Node.bvec3();
3const finalColor = mix(colorA, colorB, mask);