float
Converts various inputs (like booleans, integers, vectors) into a single floating-point value, or creates a float constant. It is a fundamental node for ensuring type safety in the shader graph.
Core Advantages
Automates type conversion, preventing shader compilation errors from type mismatches. It abstracts low-level GLSL casting syntax into a node, simplifying logic, and provides a standardized way to 'reduce' multi-dimensional vectors (like vec2, vec3) to a single value by default (taking the .x or .r component).
Common Uses
Creating numerical constants: `float(3.14)`
Converting booleans to mix factors: `mix(colorA, colorB, float(frontFacing))`
Extracting a single component from a vector: `float(uv())` automatically gets the x-component of UV coordinates
Acting as a dynamically controllable driver for effect intensity
How to adjust
It acts like a universal knob. By connecting a float node to an effect parameter (e.g., opacity, glitch strength, dissolve threshold) and then modifying its `.value` property at runtime (e.g., from 0.0 to 1.0), you can directly control the visual intensity of that effect, from non-existent to subtle to strong.
Code Examples
1// Convert the boolean frontFacing (true/false) to a float (1.0/0.0)
2// to use as a mix factor for showing different colors on front and back faces.
3const finalColor = mix( frontColor, backColor, float( frontFacing ) );