Skip to content

Sign up to be notified when the ShaderHunt platform is available, along with interactive examples teaching TypeGPU from the ground up.

bool

bool(v?): boolean

Defined in: packages/typegpu/src/data/numeric.ts:56

A schema that represents a boolean value. (equivalent to bool in WGSL)

Can also be called to cast a value to a bool in accordance with WGSL casting rules.

number | boolean

boolean

const value = bool(); // false
const value = bool(0); // false
const value = bool(-0); // false
const value = bool(21.37); // true