Skip to content

Instantly share code, notes, and snippets.

@rdb
Forked from tobspr/UBOs.py
Last active August 29, 2015 14:03
Show Gist options
  • Save rdb/0493e77d52841e8a67df to your computer and use it in GitHub Desktop.
Save rdb/0493e77d52841e8a67df to your computer and use it in GitHub Desktop.
class Light:
def __init__(self):
self.pos = ParamVector3f(0)
self.color = ParamVector3f(1,1,0)
self.mvp = ParamMatrix4f(0)
self.struct = StructParameter()
array = ArrayParameter()
array.append(lights[0].struct)
array.append(lights[1].struct)
node.setShaderInput("lights", array)
Shader:
struct Light {
vec3 pos;
vec3 color;
mat4 mvp;
...
};
Lights lights[1024];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment