 #pragma glslify: octMapUVToDir = require(./OctMapUVToDir)
 #pragma glslify: encodeRGBM = require(../local_modules/glsl-rgbm/encode)
 #pragma glslify: decodeRGBM = require(../local_modules/glsl-rgbm/decode)
-#pragma glslify: random = require(glsl-random/lowp)
 
 varying vec2 vTexCoord;
 uniform float uTextureSize;


  //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);
