| 1 |
const int MAX_LIGHTS = 8; |
| 2 |
const int TYPE_POINT = 0; |
| 3 |
const int TYPE_DIRECTIONAL = 1; |
| 4 |
const int TYPE_SPOT = 2; |
| 5 |
struct Light { |
| 6 |
int type; |
| 7 |
FP vec3 position; |
| 8 |
FP vec3 color; |
| 9 |
FP float intensity; |
| 10 |
FP vec3 direction; |
| 11 |
FP float constantAttenuation; |
| 12 |
FP float linearAttenuation; |
| 13 |
FP float quadraticAttenuation; |
| 14 |
FP float cutOffAngle; |
| 15 |
}; |
| 16 |
uniform Light lights[MAX_LIGHTS]; |
| 17 |
uniform int lightCount; |
| 18 |
|
| 19 |
// Pre-convolved environment maps |
| 20 |
struct EnvironmentLight { |
| 21 |
highp samplerCube irradiance; // For diffuse contribution |
| 22 |
highp samplerCube specular; // For specular contribution |
| 23 |
int specularMipLevels; |
| 24 |
}; |
| 25 |
uniform EnvironmentLight envLight; |
| 26 |
uniform int envLightCount; |