Some (probably related) feature requests:
1. Is there a way to pass uniform variables of type vec* and references to vec* variables to shaders? If not, this feature request is valid; if yes, please explain how. For now, I always use shader variables such as mousePositionX and mousePositionY and in shader code write: vec2 mousePosition = vec2(mousePositionX, mousePositionY); ... this is too cumbersome.
2. It would also be nice to use references to RenderSetColor.Color, Material.Color, Model.Position, etc. (I called them "vector" properties) as uniform shader variables of type vec4 or vec3.
3. In ZGE expressions properties such Material.Color can be assigned to vec4 variables, and vice versa. Also accessing Material.Color[0] can return R value (this was already proposed by Kjell).
Passing vec* variables to shaders + "vector" props
Moderator: Moderators
About 1: Yes you can send vec* variables to shaders.
Assume you have a vec3 variable like this:
<Variable Name="uAttractPos" Type="7"/>
And a ShaderVariable like this:
<ShaderVariable VariableName="AttractPos" VariableRef="uAttractPos"/>
Then you can declare this in your shader:
uniform vec3 AttractPos;
Assume you have a vec3 variable like this:
<Variable Name="uAttractPos" Type="7"/>
And a ShaderVariable like this:
<ShaderVariable VariableName="AttractPos" VariableRef="uAttractPos"/>
Then you can declare this in your shader:
uniform vec3 AttractPos;