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.

Revisions

  1. mattebb created this gist Mar 9, 2022.
    30 changes: 30 additions & 0 deletions wn uniforms.glsl
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,30 @@
    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];
    };