Skip to content

Instantly share code, notes, and snippets.

@jose-villegas
Created December 18, 2014 16:53
Show Gist options
  • Save jose-villegas/8cbc5d03f880fc51088a to your computer and use it in GitHub Desktop.
Save jose-villegas/8cbc5d03f880fc51088a to your computer and use it in GitHub Desktop.
// Rendering Constrains
const int MAX_LIGHTS = 4;
// Shared Structures
struct Matrix {
mat4 modelViewProjection;
mat4 modelView;
mat4 model;
mat4 view;
mat4 projection;
mat3 normal;
};
struct Light {
vec3 position;
vec3 direction; // For Directional
vec3 color;
float intensity;
float attenuation;
// Spot Light
float innerConeAngle;
float outerConeAngle;
// Control parameters
int lightType;
};
struct Material {
vec3 ka;
vec3 kd;
vec3 ks;
float shininess;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment