Godot version
4.0.alpha
System information
Windows 10
Issue description
Godot should allow any primitive data type other than sampler2D to be passed as varying.
shaders do not allow interpolating non-floating point values. For this reason, non-float varyings are required to be flat. We could do this automatically, or we could display an error message and ask the user to add flat.
See also: #45918 , but allow for all of vertex, fragment and light.
I am in favor of automatically assuming flat if not a floating point type.
Steps to reproduce
- Create a new MeshInstance3D
- Create a new StandardMaterial3D and convert to shader material.
- Declare
varying flat int instance_id;
- Set
instance_id = INSTANCE_ID; in vertex()
- it shows error "Invalid type for varying, only 'float', ..."
Minimal reproduction project
No response
Godot version
4.0.alpha
System information
Windows 10
Issue description
Godot should allow any primitive data type other than sampler2D to be passed as varying.
shaders do not allow interpolating non-floating point values. For this reason, non-float varyings are required to be
flat. We could do this automatically, or we could display an error message and ask the user to add flat.See also: #45918 , but allow for all of vertex, fragment and light.
I am in favor of automatically assuming flat if not a floating point type.
Steps to reproduce
varying flat int instance_id;instance_id = INSTANCE_ID;in vertex()Minimal reproduction project
No response