all
Checks if all components of a boolean vector (bvec) are true, aggregating multiple parallel vector comparison results into a single boolean value.
Core Advantages
Aggregates vectorized multi-conditional checks into a final result in the most concise and readable way. It maps directly to the efficient, native GLSL `all()` function, making it a fundamental tool for vector comparison logic.
Common Uses
Performing geometric bounding box checks to see if a point is within a specified range on the X, Y, and Z axes simultaneously.
Implementing color range selection or chroma keying by checking if a pixel's R, G, and B values all fall within a specified interval.
Validating that all components of a divisor vector are non-zero before performing vector division.
How to adjust
Adjust by changing the comparison conditions that generate the boolean vector. In the bounding box example, `all` acts as a strict gatekeeper; as soon as the model crosses a boundary on even one axis, a `false` appears in the comparison result, causing the `all` output to flip to `false` and the effect to disappear instantly.
Code Examples
1// isAboveMin and isBelowMax are both bvec3
2const isAboveMin = greaterThan(positionWorld, vec3(-1.0));
3const isBelowMax = lessThan(positionWorld, vec3(1.0));
4
5// A point is inside the box only if its x,y,z satisfy all boundary conditions
6const isInBox = all(isAboveMin).and(all(isBelowMax));