Skip to content

Instantly share code, notes, and snippets.

@tobspr
Forked from rdb/UBOs.py
Last active August 29, 2015 14:03
Show Gist options
  • Save tobspr/6f817252958809ba1ff0 to your computer and use it in GitHub Desktop.
Save tobspr/6f817252958809ba1ff0 to your computer and use it in GitHub Desktop.
Python:
class Light:
pos = Vec3(0)
color = Vec3(1,1,0)
mvp = Mat4(0)
...
lightArray = ArrayParameter()
lightArray[0] = Light()
lightArray[1] = Light()
...
computeBuffer.setShaderInput("lights", lightArray)
Shader:
struct Light {
vec3 pos;
vec3 color;
mat4 mvp;
...
};
Lights light[1024];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment