 #endif
 
 #define M_PI 3.14159265359
+#define MIN_ATTENUATION 0.0001
+#define ATTENUATION_THRESHOLD 0.01
 
 uniform int u_graphicsWidth;
 uniform int u_graphicsHeight;
+uniform mat4 u_viewMatrix;
 
 #ifdef lights
     #if lights > 0
         struct Light {
+            int type;
             vec3 position;
             vec3 direction;
             float intensity;

    float k = (r*r) / 8.0;

    float nom = NdotV;
    float denom = NdotV * (1.0 - k) + k;

    return nom / denom;
}

    uniform sampler2D u_roughness;
#endif

#ifdef defNormal
    uniform sampler2D u_normal;
#endif

#ifdef defAmbientOcclusion
    uniform sampler2D u_ambientOcclusion;
#endif

varying vec2 v_texCoord;
varying vec3 v_position;
varying vec3 v_normal;
varying vec3 v_binormal;
varying vec3 v_tangent;

vec3 fresnelSchlick(float cosTheta, vec3 F0) {
    return F0 + (1.0 - F0) * pow(1.0 - cosTheta, 5.0);
