Setting uniform struct array in shader


#1

Consider the following shader:

class MyShader extends DisplayObjectShader {
@:glFragmentSource('#pragma header
uniform struct
{
    vec2 pos;
    float radius;
} lights[10];

void main()
{
    #pragma body
    /* ... */
}')
    public function new()
    {
        super();
    }
}

How would I go about setting lights[0].pos, etc?


#2

We don’t support struct yet in our custom shader system, but this looks cool, this is the first time I’ve heard of it in GLSL :slight_smile: