Skip to content

Instantly share code, notes, and snippets.

@mattebb
Created March 9, 2022 01:40
Show Gist options
  • Save mattebb/2777a0db5fbcd52a104c4192a28f94ab to your computer and use it in GitHub Desktop.
Save mattebb/2777a0db5fbcd52a104c4192a28f94ab to your computer and use it in GitHub Desktop.
Scene data glsl uniforms in Wandering Nets
struct Light {
float intensity;
vec3 colour;
vec3 pa;
vec3 pb;
float w;
vec3 L;
vec3 nL;
};
struct Sphere {
float r;
vec3 P;
};
#define MAX_LIGHTS 20
uniform int u_numLights;
uniform Lights
{
Light lights[MAX_LIGHTS];
};
#define MAX_SPHERES 6
uniform int u_numSpheres;
uniform Spheres
{
Sphere spheres[MAX_SPHERES];
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment