       break;
     }
     vec2 Xi = Hammersley( i, uNumSamples );
-    vec3 H = ImportanceSampleGGX( Xi, Roughness, N );
+    vec3 H = ImportanceSampleGGX( Xi, roughness, N );
     vec3 L = 2.0 * dot( V, H ) * H - V;
     float NoL = saturate( dot( N, L ) );
     if( NoL > 0.0 ) {


  //Tangent to World Space
  return tangent * H.x + bitangent * H.y + N * H.z;

  //
  //vec3 n = N;
  //float aa = 1.0 / (1.0 + n.z);
  //float b = -n.x * n.y * aa;
  //vec3 b1 = vec3(1.0 - n.x * n.x * aa, b, -n.x);
  //vec3 b2 = vec3(b, 1.0 - n.y * n.y * aa, -n.y);
  //mat3 vecSpace = mat3(b1, b2, n);
  //return normalize(mix(vecSpace * H, N, 1.0 - Roughness));
}

//TODO: optimize this using sign()

  return texture2D(uSource, uv);
}

vec3 PrefilterEnvMap( float roughness, vec3 R ) {
  vec3 N = R;
  vec3 V = R;
  vec3 PrefilteredColor = vec3(0.0);
