Skip to content

gt

const gt: DualFn<<T>(lhs, rhs) => ToBool<ToBool<T>>>

Defined in: packages/typegpu/src/std/boolean.ts:163

Checks component-wise whether lhs > rhs. This function does not return bool, for that use-case, wrap the result in all.

gt(vec2f(0.0, 0.0), vec2f(0.0, 1.0)) // returns vec2b(false, false)
gt(vec3u(0, 1, 2), vec3u(2, 1, 0)) // returns vec3b(false, false, true)
all(gt(vec4i(2, 3, 4, 5), vec4i(1, 2, 3, 4))) // returns true