     vec3 sky = vec3(0.0);
     const material mat = getMaterial();
     sky += max(0.0, pow(dot(mat.normal, -sunDirection), 200.0)) * sunColor * 1000000.0;
-    sky += mat.albedo * 0.5;
+    sky += mat.albedo;
     return sky;
 }
 

    return rand(s) * 2.0 - 1.0;
}

void cosHemiUV(vec3 N, out vec3 u, out vec3 v){
    if(abs(N.x) > 0.1)
        u = cross(vec3(0.0, 1.0, 0.0), N);
    else
        u = cross(vec3(1.0, 0.0, 0.0), N);
    u = normalize(u);
    v = cross(N, u);
}

vec3 cosHemi(vec3 N, vec3 u, vec3 v, inout uint s){
    float r1 = 3.141592 * 2.0 * rand(s);
    float r2 = rand(s);
    float r2s = sqrt(r2);
    return normalize(
        u * cos(r1) * r2s 
        + v * sin(r1) * r2s 
        + N * sqrt(1.0 - r2)
        );
}

material getMaterial(){
    material mat;

vec3 indirect_lighting(inout uint s){
    const material mat = getMaterial();
    const vec3 V = normalize(eye - P);
    vec3 T, B;
    findBasis(mat.normal, T, B);
    
    const float samples = 6.0;
    const float scaling = 1.0 / samples;

    vec3 light = vec3(0.0);
    for(float x = 0.0; x < samples; ++x){
        for(float y = 0.0; y < samples; ++y){
            const vec2 X = vec2(stratRand(x, scaling, s), stratRand(y, scaling, s));
            const vec3 N = GGXPDF(mat.roughness, X, T, B, mat.normal);
            const vec3 L = reflect(-V, N);
            const vec3 radiance = environment_cubemap(L);
            light += pbr_lighting(V, L, mat, radiance);
        }
    }

    light *= (scaling * scaling);

    return light;
}
