indigo
indigo copied to clipboard
Improve uniform syntax and API experience
Allows you to express:
Batch(
UniformBlock(
"MutantData",
Batch(
Uniform("MOVE_TO") -> vec2.fromPoint(position),
Uniform("SCALE_TO") -> vec2.fromVector2(scale),
Uniform("ALPHA") -> float(alpha)
)
)
as (using import indigo.syntax.shaders.*
):
UniformBlock(
"MutantData".uniformBlockName,
position.asVec2,
scale.asVec2,
alpha.asFloat
)
This won't always be desirable, sometimes you will want the Uniform("MOVE_TO")
stuff as a reference point to help you align with your GLSL code.