Browse Source

code cleanup.

Ben Houston 9 years ago
parent
commit
d62f7f0cc7

+ 5 - 8
src/renderers/shaders/ShaderChunk/cube_uv_reflection_fragment.glsl

@@ -108,6 +108,7 @@ vec4 textureCubeUV(vec3 reflectedDirection, float roughness, float textureSize)
     level1 = level1 > 5.0 ? 5.0 : level1;
     level1 = level1 > 5.0 ? 5.0 : level1;
 
 
 #if defined( DISABLE_CUBE_UV_MIPMAP_INTERPOLATION )
 #if defined( DISABLE_CUBE_UV_MIPMAP_INTERPOLATION )
+    // round to nearest mipmap if we are not interpolating.
     level0 += min( floor( s + 0.5 ), 5.0 );
     level0 += min( floor( s + 0.5 ), 5.0 );
 #endif
 #endif
 
 
@@ -118,7 +119,7 @@ vec4 textureCubeUV(vec3 reflectedDirection, float roughness, float textureSize)
     vec2 uv_20 = getCubeUV(reflectedDirection, r2, level0, textureSize);
     vec2 uv_20 = getCubeUV(reflectedDirection, r2, level0, textureSize);
     vec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));
     vec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));
 
 
-    vec4 result = mix(color10 , color20,  t);
+    vec4 result = mix(color10, color20, t);
 
 
 #if ! defined( DISABLE_CUBE_UV_MIPMAP_INTERPOLATION )
 #if ! defined( DISABLE_CUBE_UV_MIPMAP_INTERPOLATION )
 
 
@@ -128,16 +129,12 @@ vec4 textureCubeUV(vec3 reflectedDirection, float roughness, float textureSize)
     vec2 uv_21 = getCubeUV(reflectedDirection, r2, level1, textureSize);
     vec2 uv_21 = getCubeUV(reflectedDirection, r2, level1, textureSize);
     vec4 color21 = envMapTexelToLinear(texture2D(envMap, uv_21));
     vec4 color21 = envMapTexelToLinear(texture2D(envMap, uv_21));
 
 
-    vec4 c2 = mix(color11 , color21,  t);
-    result = mix(result , c2,  s);
+    vec4 c2 = mix(color11, color21, t);
+    result = mix(result, c2, s);
 
 
 #endif
 #endif
-/*
-    vec4 c1 = mix(color10 , color11,  s);
-    vec4 c2 = mix(color20 , color21,  s);
-    vec4 c3 = mix(c1 , c2,  t);*/
 
 
-    return vec4( result.rgb, 1.0);
+    return vec4(result.rgb, 1.0);
 }
 }
 
 
 #endif
 #endif