indigo icon indicating copy to clipboard operation
indigo copied to clipboard

Improve uniform syntax and API experience

Open davesmith00000 opened this issue 2 years ago • 0 comments

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.

davesmith00000 avatar Oct 04 '22 20:10 davesmith00000