summaryrefslogtreecommitdiffstats
path: root/src/extras/shaders/es3/light.inc.frag
blob: 9d03fca54b2cc9afd5187273ef6cead1b0895fd2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
const int MAX_LIGHTS = 8;
const int TYPE_POINT = 0;
const int TYPE_DIRECTIONAL = 1;
const int TYPE_SPOT = 2;
struct Light {
    int type;
    vec3 position;
    vec3 color;
    float intensity;
    vec3 direction;
    float constantAttenuation;
    float linearAttenuation;
    float quadraticAttenuation;
    float cutOffAngle;
};
uniform Light lights[MAX_LIGHTS];
uniform int lightCount;

// Pre-convolved environment maps
struct EnvironmentLight {
    highp samplerCube irradiance; // For diffuse contribution
    highp samplerCube specular; // For specular contribution
};
uniform EnvironmentLight envLight;
uniform int envLightCount;