Category: Shaders
Syntax:
b2dSetShaderInt:Void(shader:Int, name:String, value:Int)
Void
Sets one integer parameter on a screen shader.
Takes shader, name (the slot number as a string) and value.
Returns nothing.
The value is stored BITWISE, not converted. The parameter slots are floats, so the shader must read it back with floatBitsToInt() - reading it as a float gives nonsense. This matches the Windows edition, which uses asint() for the same reason.
name is a parameter SLOT NUMBER given as a string - "0" through "63". It is read with the equivalent of atoi(), so a descriptive name such as "intensity" is not looked up: it parses as 0 and lands in slot 0. In the shader the slots are params[0..63], also available as param0 through param63.
View detailed documentation online
b2dSetShaderInt(crt, "1", 3) ; and in the GLSL shader: ; int mode = floatBitsToInt(params[1]);
BambooBasic © 2026 Michael Denathorn