Sets 4-component vector uniform in text shader (stored as name.x/y/z/w in floatParams, uploaded to GPU during text rendering).
Takes shader (shader handle), name (uniform base name, string), x (first component, double converted to float), y (second component, double converted to float), z (third component, double converted to float), w (fourth component, double converted to float).
Returns nothing.
Shaders
Parameters & Returns
Parameters
shaderInt
nameString
xDouble
yDouble
zDouble
wDouble
Returns
Void
Quick Summary
Sets 4-component vector uniform in text shader (stored as name.x/y/z/w in floatParams, uploaded to GPU during text rendering).
Takes shader (shader handle), name (uniform base name, string), x (first component, double converted to float), y (second component, double converted to float), z (third component, double converted to float), w (fourth component, double converted to float).
Returns nothing.
Technical Exegesis...
Sets 4-component vector uniform in text shader (stored as name.x/y/z/w in floatParams, uploaded to GPU during text rendering). Takes shader (shader handle), name (uniform base name, string), x (first component, double converted to float), y (second component, double converted to float), z (third component, double converted to float), w (fourth component, double converted to float). Returns nothing. Stores as four separate float entries (shader.floatParams[name+".x"]=x, shader.floatParams[name+".
Sets 4-component vector uniform in text shader (stored as name.x/y/z/w in floatParams, uploaded to GPU during text rendering). Takes shader (shader handle), name (uniform base name, string), x (first component, double converted to float), y (second component, double converted to float), z (third component, double converted to float), w (fourth component, double converted to float). Returns nothing. Stores as four separate float entries (shader.floatParams[name+".x"]=x, shader.floatParams[name+".y"]=y, shader.floatParams[name+".z"]=z, shader.floatParams[name+".w"]=w), uploaded to constant buffer during text draw (packed into cbuffer, sent to GPU with text draw command). Use for RGBA colors (text color with alpha), rectangles (x,y,width,height), quaternions (orientation/rotation), or XYZW parameters (four related values). Parameter storage: CPU map (four entries name.x, name.y, name.z, name.w in floatParams), uploaded on use (when text with this shader drawn, params packed to cbuffer), persistent (remains until changed, survives across frames). Use cases: (1) RGBA outline color (b2dSetTextShaderFloat4(shader,"outlineColor",r,g,b,a) colored text outline with transparency), (2) Rectangle bounds (b2dSetTextShaderFloat4(shader,"clipRect",x,y,w,h) text clipping region), (3) Gradient colors (b2dSetTextShaderFloat4(gradShader,"startColor",r1,g1,b1,a1): b2dSetTextShaderFloat4(gradShader,"endColor",r2,g2,b2,a2) gradient text), (4) Shadow properties (b2dSetTextShaderFloat4(shadowShader,"shadow",offsetX,offsetY,blur,opacity) configurable shadow). HLSL access: declare uniform (float4 outlineColor; in shader OR separate float outlineColor_x; float outlineColor_y; float outlineColor_z; float outlineColor_w;), use in shader (color = outlineColor; OR color = float4(outlineColor_x, outlineColor_y, outlineColor_z, outlineColor_w);), component access (outlineColor.x/y/z/w or .r/.g/.b/.a if using float4). Storage format: decomposed to components (single float4 parameter stored as four separate float entries name.x, name.y, name.z, name.w), shader receives as components (HLSL must access as separate floats or reconstruct float4). Performance: cost zero (four map inserts/updates, no GPU operation until draw), batched upload (all parameters uploaded together during text draw ~0.001ms). Validation: ignores if shader<=0, ignores if name null, silently ignored if not found in shader (HLSL doesn't need to use all set parameters). Related: b2dSetTextShaderFloat (single float), b2dSetTextShaderFloat2/3 (2/3-component vectors), b2dSetTextShaderInt (integer parameters), b2dLoadTextShader (creates shader), b2dText (draws text with shader).