select
constselect:DualFn<{(f,t,cond):boolean; (f,t,cond):number; <T>(f,t,cond):T; }>
Defined in: packages/typegpu/src/std/boolean.ts:319
Returns t if cond is true, and f otherwise.
Component-wise if cond is a vector.
Example
Section titled βExampleβselect(1, 2, false) // returns 1select(1, 2, true) // returns 2select(vec2i(1, 2), vec2i(3, 4), true) // returns vec2i(3, 4)select(vec2i(1, 2), vec2i(3, 4), vec2b(false, true)) // returns vec2i(1, 4)