Passing vec* variables to shaders + "vector" props
Posted: Tue May 28, 2013 3:39 pm
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).
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).