Quick answer: Godot 4 shader uniform showing scrambled values when set from GDScript? Vector3 is passed as 16-byte aligned - declare the uniform as vec4 or split into separate floats.
material.set_shader_parameter("wind", Vector3(1,0,0)) shows up in-shader as (0, 0, 1). Looks like endianness; it's std140 layout.
Use vec4 in the shader
uniform vec4 wind;Set it as Vector4(x, y, z, 0) from GDScript. The std140 padding is invisible at the shader level but real on the GPU side.
Or pass scalars
Three separate uniform floats avoid alignment entirely. Slightly more boilerplate, but immune to silent reordering.
Validate with RenderDoc
Open the captured frame's pipeline state. The constant buffer dump shows you exactly what your shader sees - 3-float uniforms padded with a stray value are obvious there.
“GPU memory has alignment opinions. Your uniforms learn to live with them.”
Treat anything that looks like 'random scrambling' in a shader as 'alignment mismatch' until proven otherwise.