Garrett Johnson 5 anni fa
parent
commit
3bf11863e2

+ 1 - 1
examples/js/shaders/CopyShader.js

@@ -9,7 +9,7 @@ THREE.CopyShader = {
 	uniforms: {
 
 		"tDiffuse": { value: null },
-		"opacity":  { value: 1.0 }
+		"opacity": { value: 1.0 }
 
 	},
 

+ 1 - 1
examples/js/shaders/DigitalGlitch.js

@@ -37,7 +37,7 @@ THREE.DigitalGlitch = {
 	].join( "\n" ),
 
 	fragmentShader: [
-		"uniform int byp;",//should we apply the glitch ?
+		"uniform int byp;", //should we apply the glitch ?
 
 		"uniform sampler2D tDiffuse;",
 		"uniform sampler2D tDisp;",

+ 4 - 4
examples/js/shaders/DotScreenShader.js

@@ -11,10 +11,10 @@ THREE.DotScreenShader = {
 	uniforms: {
 
 		"tDiffuse": { value: null },
-		"tSize":    { value: new THREE.Vector2( 256, 256 ) },
-		"center":   { value: new THREE.Vector2( 0.5, 0.5 ) },
-		"angle":    { value: 1.57 },
-		"scale":    { value: 1.0 }
+		"tSize": { value: new THREE.Vector2( 256, 256 ) },
+		"center": { value: new THREE.Vector2( 0.5, 0.5 ) },
+		"angle": { value: 1.57 },
+		"scale": { value: 1.0 }
 
 	},
 

+ 7 - 7
examples/js/shaders/FilmShader.js

@@ -70,25 +70,25 @@ THREE.FilmShader = {
 
 		"void main() {",
 
-			// sample the source
+		// sample the source
 		"	vec4 cTextureScreen = texture2D( tDiffuse, vUv );",
 
-			// make some noise
+		// make some noise
 		"	float dx = rand( vUv + time );",
 
-			// add noise
+		// add noise
 		"	vec3 cResult = cTextureScreen.rgb + cTextureScreen.rgb * clamp( 0.1 + dx, 0.0, 1.0 );",
 
-			// get us a sine and cosine
+		// get us a sine and cosine
 		"	vec2 sc = vec2( sin( vUv.y * sCount ), cos( vUv.y * sCount ) );",
 
-			// add scanlines
+		// add scanlines
 		"	cResult += cTextureScreen.rgb * vec3( sc.x, sc.y, sc.x ) * sIntensity;",
 
-			// interpolate between source and result by intensity
+		// interpolate between source and result by intensity
 		"	cResult = cTextureScreen.rgb + clamp( nIntensity, 0.0,1.0 ) * ( cResult - cTextureScreen.rgb );",
 
-			// convert to grayscale if desired
+		// convert to grayscale if desired
 		"	if( grayscale ) {",
 
 		"		cResult = vec3( cResult.r * 0.3 + cResult.g * 0.59 + cResult.b * 0.11 );",

+ 2 - 2
examples/js/shaders/HueSaturationShader.js

@@ -43,7 +43,7 @@ THREE.HueSaturationShader = {
 
 		"	gl_FragColor = texture2D( tDiffuse, vUv );",
 
-			// hue
+		// hue
 		"	float angle = hue * 3.14159265;",
 		"	float s = sin(angle), c = cos(angle);",
 		"	vec3 weights = (vec3(2.0 * c, -sqrt(3.0) * s - c, sqrt(3.0) * s - c) + 1.0) / 3.0;",
@@ -54,7 +54,7 @@ THREE.HueSaturationShader = {
 		"		dot(gl_FragColor.rgb, weights.yzx)",
 		"	);",
 
-			// saturation
+		// saturation
 		"	float average = (gl_FragColor.r + gl_FragColor.g + gl_FragColor.b) / 3.0;",
 		"	if (saturation > 0.0) {",
 		"		gl_FragColor.rgb += (average - gl_FragColor.rgb) * (1.0 - 1.0 / (1.001 - saturation));",

+ 2 - 2
examples/js/shaders/LuminosityHighPassShader.js

@@ -31,7 +31,7 @@ THREE.LuminosityHighPassShader = {
 
 		"}"
 
-	].join("\n"),
+	].join( "\n" ),
 
 	fragmentShader: [
 
@@ -59,6 +59,6 @@ THREE.LuminosityHighPassShader = {
 
 		"}"
 
-	].join("\n")
+	].join( "\n" )
 
 };

+ 18 - 18
examples/js/shaders/ParallaxShader.js

@@ -6,7 +6,7 @@
 THREE.ParallaxShader = {
 	// Ordered from fastest to best quality.
 	modes: {
-		none:  "NO_PARALLAX",
+		none: "NO_PARALLAX",
 		basic: "USE_BASIC_PARALLAX",
 		steep: "USE_STEEP_PARALLAX",
 		occlusion: "USE_OCLUSION_PARALLAX", // a.k.a. POM
@@ -36,7 +36,7 @@ THREE.ParallaxShader = {
 
 		"}"
 
-  ].join( "\n" ),
+	].join( "\n" ),
 
 	fragmentShader: [
 		"uniform sampler2D bumpMap;",
@@ -56,10 +56,10 @@ THREE.ParallaxShader = {
 
 		"		float initialHeight = texture2D( bumpMap, vUv ).r;",
 
-				// No Offset Limitting: messy, floating output at grazing angles.
-				//"vec2 texCoordOffset = parallaxScale * V.xy / V.z * initialHeight;",
+		// No Offset Limitting: messy, floating output at grazing angles.
+		//"vec2 texCoordOffset = parallaxScale * V.xy / V.z * initialHeight;",
 
-				// Offset Limiting
+		// Offset Limiting
 		"		vec2 texCoordOffset = parallaxScale * V.xy * initialHeight;",
 		"		return vUv - texCoordOffset;",
 
@@ -69,27 +69,27 @@ THREE.ParallaxShader = {
 
 		"	vec2 parallaxMap( in vec3 V ) {",
 
-				// Determine number of layers from angle between V and N
+		// Determine number of layers from angle between V and N
 		"		float numLayers = mix( parallaxMaxLayers, parallaxMinLayers, abs( dot( vec3( 0.0, 0.0, 1.0 ), V ) ) );",
 
 		"		float layerHeight = 1.0 / numLayers;",
 		"		float currentLayerHeight = 0.0;",
-				// Shift of texture coordinates for each iteration
+		// Shift of texture coordinates for each iteration
 		"		vec2 dtex = parallaxScale * V.xy / V.z / numLayers;",
 
 		"		vec2 currentTextureCoords = vUv;",
 
 		"		float heightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;",
 
-				// while ( heightFromTexture > currentLayerHeight )
-				// Infinite loops are not well supported. Do a "large" finite
-				// loop, but not too large, as it slows down some compilers.
+		// while ( heightFromTexture > currentLayerHeight )
+		// Infinite loops are not well supported. Do a "large" finite
+		// loop, but not too large, as it slows down some compilers.
 		"		for ( int i = 0; i < 30; i += 1 ) {",
 		"			if ( heightFromTexture <= currentLayerHeight ) {",
 		"				break;",
 		"			}",
 		"			currentLayerHeight += layerHeight;",
-					// Shift texture coordinates along vector V
+		// Shift texture coordinates along vector V
 		"			currentTextureCoords -= dtex;",
 		"			heightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;",
 		"		}",
@@ -103,18 +103,18 @@ THREE.ParallaxShader = {
 		"			vec2 deltaTexCoord = dtex / 2.0;",
 		"			float deltaHeight = layerHeight / 2.0;",
 
-					// Return to the mid point of previous layer
+		// Return to the mid point of previous layer
 		"			currentTextureCoords += deltaTexCoord;",
 		"			currentLayerHeight -= deltaHeight;",
 
-					// Binary search to increase precision of Steep Parallax Mapping
+		// Binary search to increase precision of Steep Parallax Mapping
 		"			const int numSearches = 5;",
 		"			for ( int i = 0; i < numSearches; i += 1 ) {",
 
 		"				deltaTexCoord /= 2.0;",
 		"				deltaHeight /= 2.0;",
 		"				heightFromTexture = texture2D( bumpMap, currentTextureCoords ).r;",
-						// Shift along or against vector V
+		// Shift along or against vector V
 		"				if( heightFromTexture > currentLayerHeight ) {", // Below the surface
 
 		"					currentTextureCoords -= deltaTexCoord;",
@@ -134,14 +134,14 @@ THREE.ParallaxShader = {
 
 		"			vec2 prevTCoords = currentTextureCoords + dtex;",
 
-					// Heights for linear interpolation
+		// Heights for linear interpolation
 		"			float nextH = heightFromTexture - currentLayerHeight;",
 		"			float prevH = texture2D( bumpMap, prevTCoords ).r - currentLayerHeight + layerHeight;",
 
-					// Proportions for linear interpolation
+		// Proportions for linear interpolation
 		"			float weight = nextH / ( nextH - prevH );",
 
-					// Interpolation of texture coordinates
+		// Interpolation of texture coordinates
 		"			return prevTCoords * weight + currentTextureCoords * ( 1.0 - weight );",
 
 		"		#else", // NO_PARALLAX
@@ -179,6 +179,6 @@ THREE.ParallaxShader = {
 
 		"}"
 
-  ].join( "\n" )
+	].join( "\n" )
 
 };

+ 49 - 49
examples/js/shaders/SMAAShader.js

@@ -56,7 +56,7 @@ THREE.SMAAEdgesShader = {
 		"vec4 SMAAColorEdgeDetectionPS( vec2 texcoord, vec4 offset[3], sampler2D colorTex ) {",
 		"	vec2 threshold = vec2( SMAA_THRESHOLD, SMAA_THRESHOLD );",
 
-			// Calculate color deltas:
+		// Calculate color deltas:
 		"	vec4 delta;",
 		"	vec3 C = texture2D( colorTex, texcoord ).rgb;",
 
@@ -68,14 +68,14 @@ THREE.SMAAEdgesShader = {
 		"	t = abs( C - Ctop );",
 		"	delta.y = max( max( t.r, t.g ), t.b );",
 
-			// We do the usual threshold:
+		// We do the usual threshold:
 		"	vec2 edges = step( threshold, delta.xy );",
 
-			// Then discard if there is no edge:
+		// Then discard if there is no edge:
 		"	if ( dot( edges, vec2( 1.0, 1.0 ) ) == 0.0 )",
 		"		discard;",
 
-			// Calculate right and bottom deltas:
+		// Calculate right and bottom deltas:
 		"	vec3 Cright = texture2D( colorTex, offset[1].xy ).rgb;",
 		"	t = abs( C - Cright );",
 		"	delta.z = max( max( t.r, t.g ), t.b );",
@@ -84,10 +84,10 @@ THREE.SMAAEdgesShader = {
 		"	t = abs( C - Cbottom );",
 		"	delta.w = max( max( t.r, t.g ), t.b );",
 
-			// Calculate the maximum delta in the direct neighborhood:
+		// Calculate the maximum delta in the direct neighborhood:
 		"	float maxDelta = max( max( max( delta.x, delta.y ), delta.z ), delta.w );",
 
-			// Calculate left-left and top-top deltas:
+		// Calculate left-left and top-top deltas:
 		"	vec3 Cleftleft  = texture2D( colorTex, offset[2].xy ).rgb;",
 		"	t = abs( C - Cleftleft );",
 		"	delta.z = max( max( t.r, t.g ), t.b );",
@@ -96,10 +96,10 @@ THREE.SMAAEdgesShader = {
 		"	t = abs( C - Ctoptop );",
 		"	delta.w = max( max( t.r, t.g ), t.b );",
 
-			// Calculate the final maximum delta:
+		// Calculate the final maximum delta:
 		"	maxDelta = max( max( maxDelta, delta.z ), delta.w );",
 
-			// Local contrast adaptation in action:
+		// Local contrast adaptation in action:
 		"	edges.xy *= step( 0.5 * maxDelta, delta.xy );",
 
 		"	return vec4( edges, 0.0, 0.0 );",
@@ -146,11 +146,11 @@ THREE.SMAAWeightsShader = {
 		"void SMAABlendingWeightCalculationVS( vec2 texcoord ) {",
 		"	vPixcoord = texcoord / resolution;",
 
-			// We will use these offsets for the searches later on (see @PSEUDO_GATHER4):
+		// We will use these offsets for the searches later on (see @PSEUDO_GATHER4):
 		"	vOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -0.25, 0.125, 1.25, 0.125 );", // WebGL port note: Changed sign in Y and W components
 		"	vOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( -0.125, 0.25, -0.125, -1.25 );", // WebGL port note: Changed sign in Y and W components
 
-			// And these for the searches, they indicate the ends of the loops:
+		// And these for the searches, they indicate the ends of the loops:
 		"	vOffset[ 2 ] = vec4( vOffset[ 0 ].xz, vOffset[ 1 ].yw ) + vec4( -2.0, 2.0, -2.0, 2.0 ) * resolution.xxyy * float( SMAA_MAX_SEARCH_STEPS );",
 
 		"}",
@@ -187,16 +187,16 @@ THREE.SMAAWeightsShader = {
 		"#endif",
 
 		"float SMAASearchLength( sampler2D searchTex, vec2 e, float bias, float scale ) {",
-			// Not required if searchTex accesses are set to point:
-			// float2 SEARCH_TEX_PIXEL_SIZE = 1.0 / float2(66.0, 33.0);
-			// e = float2(bias, 0.0) + 0.5 * SEARCH_TEX_PIXEL_SIZE +
-			//     e * float2(scale, 1.0) * float2(64.0, 32.0) * SEARCH_TEX_PIXEL_SIZE;
+		// Not required if searchTex accesses are set to point:
+		// float2 SEARCH_TEX_PIXEL_SIZE = 1.0 / float2(66.0, 33.0);
+		// e = float2(bias, 0.0) + 0.5 * SEARCH_TEX_PIXEL_SIZE +
+		//     e * float2(scale, 1.0) * float2(64.0, 32.0) * SEARCH_TEX_PIXEL_SIZE;
 		"	e.r = bias + e.r * scale;",
 		"	return 255.0 * texture2D( searchTex, e, 0.0 ).r;",
 		"}",
 
 		"float SMAASearchXLeft( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {",
-			/**
+		/**
 			* @PSEUDO_GATHER4
 			* This texcoord has been offset by (-0.25, -0.125) in the vertex shader to
 			* sample between edge, thus fetching four edges in a row.
@@ -211,13 +211,13 @@ THREE.SMAAWeightsShader = {
 		"		if ( ! ( texcoord.x > end && e.g > 0.8281 && e.r == 0.0 ) ) break;",
 		"	}",
 
-			// We correct the previous (-0.25, -0.125) offset we applied:
+		// We correct the previous (-0.25, -0.125) offset we applied:
 		"	texcoord.x += 0.25 * resolution.x;",
 
-			// The searches are bias by 1, so adjust the coords accordingly:
+		// The searches are bias by 1, so adjust the coords accordingly:
 		"	texcoord.x += resolution.x;",
 
-			// Disambiguate the length added by the last step:
+		// Disambiguate the length added by the last step:
 		"	texcoord.x += 2.0 * resolution.x;", // Undo last step
 		"	texcoord.x -= resolution.x * SMAASearchLength(searchTex, e, 0.0, 0.5);",
 
@@ -276,13 +276,13 @@ THREE.SMAAWeightsShader = {
 		"}",
 
 		"vec2 SMAAArea( sampler2D areaTex, vec2 dist, float e1, float e2, float offset ) {",
-			// Rounding prevents precision errors of bilinear filtering:
+		// Rounding prevents precision errors of bilinear filtering:
 		"	vec2 texcoord = float( SMAA_AREATEX_MAX_DISTANCE ) * round( 4.0 * vec2( e1, e2 ) ) + dist;",
 
-			// We do a scale and bias for mapping to texel space:
+		// We do a scale and bias for mapping to texel space:
 		"	texcoord = SMAA_AREATEX_PIXEL_SIZE * texcoord + ( 0.5 * SMAA_AREATEX_PIXEL_SIZE );",
 
-			// Move to proper place, according to the subpixel offset:
+		// Move to proper place, according to the subpixel offset:
 		"	texcoord.y += SMAA_AREATEX_SUBTEX_SIZE * offset;",
 
 		"	return texture2D( areaTex, texcoord, 0.0 ).rg;",
@@ -296,67 +296,67 @@ THREE.SMAAWeightsShader = {
 		"	if ( e.g > 0.0 ) {", // Edge at north
 		"		vec2 d;",
 
-				// Find the distance to the left:
+		// Find the distance to the left:
 		"		vec2 coords;",
 		"		coords.x = SMAASearchXLeft( edgesTex, searchTex, offset[ 0 ].xy, offset[ 2 ].x );",
 		"		coords.y = offset[ 1 ].y;", // offset[1].y = texcoord.y - 0.25 * resolution.y (@CROSSING_OFFSET)
 		"		d.x = coords.x;",
 
-				// Now fetch the left crossing edges, two at a time using bilinear
-				// filtering. Sampling at -0.25 (see @CROSSING_OFFSET) enables to
-				// discern what value each edge has:
+		// Now fetch the left crossing edges, two at a time using bilinear
+		// filtering. Sampling at -0.25 (see @CROSSING_OFFSET) enables to
+		// discern what value each edge has:
 		"		float e1 = texture2D( edgesTex, coords, 0.0 ).r;",
 
-				// Find the distance to the right:
+		// Find the distance to the right:
 		"		coords.x = SMAASearchXRight( edgesTex, searchTex, offset[ 0 ].zw, offset[ 2 ].y );",
 		"		d.y = coords.x;",
 
-				// We want the distances to be in pixel units (doing this here allow to
-				// better interleave arithmetic and memory accesses):
+		// We want the distances to be in pixel units (doing this here allow to
+		// better interleave arithmetic and memory accesses):
 		"		d = d / resolution.x - pixcoord.x;",
 
-				// SMAAArea below needs a sqrt, as the areas texture is compressed
-				// quadratically:
+		// SMAAArea below needs a sqrt, as the areas texture is compressed
+		// quadratically:
 		"		vec2 sqrt_d = sqrt( abs( d ) );",
 
-				// Fetch the right crossing edges:
+		// Fetch the right crossing edges:
 		"		coords.y -= 1.0 * resolution.y;", // WebGL port note: Added
 		"		float e2 = SMAASampleLevelZeroOffset( edgesTex, coords, ivec2( 1, 0 ) ).r;",
 
-				// Ok, we know how this pattern looks like, now it is time for getting
-				// the actual area:
+		// Ok, we know how this pattern looks like, now it is time for getting
+		// the actual area:
 		"		weights.rg = SMAAArea( areaTex, sqrt_d, e1, e2, float( subsampleIndices.y ) );",
 		"	}",
 
 		"	if ( e.r > 0.0 ) {", // Edge at west
 		"		vec2 d;",
 
-				// Find the distance to the top:
+		// Find the distance to the top:
 		"		vec2 coords;",
 
 		"		coords.y = SMAASearchYUp( edgesTex, searchTex, offset[ 1 ].xy, offset[ 2 ].z );",
 		"		coords.x = offset[ 0 ].x;", // offset[1].x = texcoord.x - 0.25 * resolution.x;
 		"		d.x = coords.y;",
 
-				// Fetch the top crossing edges:
+		// Fetch the top crossing edges:
 		"		float e1 = texture2D( edgesTex, coords, 0.0 ).g;",
 
-				// Find the distance to the bottom:
+		// Find the distance to the bottom:
 		"		coords.y = SMAASearchYDown( edgesTex, searchTex, offset[ 1 ].zw, offset[ 2 ].w );",
 		"		d.y = coords.y;",
 
-				// We want the distances to be in pixel units:
+		// We want the distances to be in pixel units:
 		"		d = d / resolution.y - pixcoord.y;",
 
-				// SMAAArea below needs a sqrt, as the areas texture is compressed
-				// quadratically:
+		// SMAAArea below needs a sqrt, as the areas texture is compressed
+		// quadratically:
 		"		vec2 sqrt_d = sqrt( abs( d ) );",
 
-				// Fetch the bottom crossing edges:
+		// Fetch the bottom crossing edges:
 		"		coords.y -= 1.0 * resolution.y;", // WebGL port note: Added
 		"		float e2 = SMAASampleLevelZeroOffset( edgesTex, coords, ivec2( 0, 1 ) ).g;",
 
-				// Get the area for this direction:
+		// Get the area for this direction:
 		"		weights.ba = SMAAArea( areaTex, sqrt_d, e1, e2, float( subsampleIndices.x ) );",
 		"	}",
 
@@ -417,37 +417,37 @@ THREE.SMAABlendShader = {
 		"varying vec4 vOffset[ 2 ];",
 
 		"vec4 SMAANeighborhoodBlendingPS( vec2 texcoord, vec4 offset[ 2 ], sampler2D colorTex, sampler2D blendTex ) {",
-			// Fetch the blending weights for current pixel:
+		// Fetch the blending weights for current pixel:
 		"	vec4 a;",
 		"	a.xz = texture2D( blendTex, texcoord ).xz;",
 		"	a.y = texture2D( blendTex, offset[ 1 ].zw ).g;",
 		"	a.w = texture2D( blendTex, offset[ 1 ].xy ).a;",
 
-			// Is there any blending weight with a value greater than 0.0?
+		// Is there any blending weight with a value greater than 0.0?
 		"	if ( dot(a, vec4( 1.0, 1.0, 1.0, 1.0 )) < 1e-5 ) {",
 		"		return texture2D( colorTex, texcoord, 0.0 );",
 		"	} else {",
-				// Up to 4 lines can be crossing a pixel (one through each edge). We
-				// favor blending by choosing the line with the maximum weight for each
-				// direction:
+		// Up to 4 lines can be crossing a pixel (one through each edge). We
+		// favor blending by choosing the line with the maximum weight for each
+		// direction:
 		"		vec2 offset;",
 		"		offset.x = a.a > a.b ? a.a : -a.b;", // left vs. right
 		"		offset.y = a.g > a.r ? -a.g : a.r;", // top vs. bottom // WebGL port note: Changed signs
 
-				// Then we go in the direction that has the maximum weight:
+		// Then we go in the direction that has the maximum weight:
 		"		if ( abs( offset.x ) > abs( offset.y )) {", // horizontal vs. vertical
 		"			offset.y = 0.0;",
 		"		} else {",
 		"			offset.x = 0.0;",
 		"		}",
 
-				// Fetch the opposite color and lerp by hand:
+		// Fetch the opposite color and lerp by hand:
 		"		vec4 C = texture2D( colorTex, texcoord, 0.0 );",
 		"		texcoord += sign( offset ) * resolution;",
 		"		vec4 Cop = texture2D( colorTex, texcoord, 0.0 );",
 		"		float s = abs( offset.x ) > abs( offset.y ) ? abs( offset.x ) : abs( offset.y );",
 
-				// WebGL port note: Added gamma correction
+		// WebGL port note: Added gamma correction
 		"		C.xyz = pow(C.xyz, vec3(2.2));",
 		"		Cop.xyz = pow(Cop.xyz, vec3(2.2));",
 		"		vec4 mixed = mix(C, Cop, s);",

+ 8 - 8
examples/js/shaders/SobelOperatorShader.js

@@ -40,44 +40,44 @@ THREE.SobelOperatorShader = {
 
 		"	vec2 texel = vec2( 1.0 / resolution.x, 1.0 / resolution.y );",
 
-			// kernel definition (in glsl matrices are filled in column-major order)
+		// kernel definition (in glsl matrices are filled in column-major order)
 
 		"	const mat3 Gx = mat3( -1, -2, -1, 0, 0, 0, 1, 2, 1 );", // x direction kernel
 		"	const mat3 Gy = mat3( -1, 0, 1, -2, 0, 2, -1, 0, 1 );", // y direction kernel
 
-			// fetch the 3x3 neighbourhood of a fragment
+		// fetch the 3x3 neighbourhood of a fragment
 
-			// first column
+		// first column
 
 		"	float tx0y0 = texture2D( tDiffuse, vUv + texel * vec2( -1, -1 ) ).r;",
 		"	float tx0y1 = texture2D( tDiffuse, vUv + texel * vec2( -1,  0 ) ).r;",
 		"	float tx0y2 = texture2D( tDiffuse, vUv + texel * vec2( -1,  1 ) ).r;",
 
-			// second column
+		// second column
 
 		"	float tx1y0 = texture2D( tDiffuse, vUv + texel * vec2(  0, -1 ) ).r;",
 		"	float tx1y1 = texture2D( tDiffuse, vUv + texel * vec2(  0,  0 ) ).r;",
 		"	float tx1y2 = texture2D( tDiffuse, vUv + texel * vec2(  0,  1 ) ).r;",
 
-			// third column
+		// third column
 
 		"	float tx2y0 = texture2D( tDiffuse, vUv + texel * vec2(  1, -1 ) ).r;",
 		"	float tx2y1 = texture2D( tDiffuse, vUv + texel * vec2(  1,  0 ) ).r;",
 		"	float tx2y2 = texture2D( tDiffuse, vUv + texel * vec2(  1,  1 ) ).r;",
 
-			// gradient value in x direction
+		// gradient value in x direction
 
 		"	float valueGx = Gx[0][0] * tx0y0 + Gx[1][0] * tx1y0 + Gx[2][0] * tx2y0 + ",
 		"		Gx[0][1] * tx0y1 + Gx[1][1] * tx1y1 + Gx[2][1] * tx2y1 + ",
 		"		Gx[0][2] * tx0y2 + Gx[1][2] * tx1y2 + Gx[2][2] * tx2y2; ",
 
-			// gradient value in y direction
+		// gradient value in y direction
 
 		"	float valueGy = Gy[0][0] * tx0y0 + Gy[1][0] * tx1y0 + Gy[2][0] * tx2y0 + ",
 		"		Gy[0][1] * tx0y1 + Gy[1][1] * tx1y1 + Gy[2][1] * tx2y1 + ",
 		"		Gy[0][2] * tx0y2 + Gy[1][2] * tx1y2 + Gy[2][2] * tx2y2; ",
 
-			// magnitute of the total gradient
+		// magnitute of the total gradient
 
 		"	float G = sqrt( ( valueGx * valueGx ) + ( valueGy * valueGy ) );",
 

+ 12 - 12
examples/js/shaders/TerrainShader.js

@@ -142,7 +142,7 @@ THREE.TerrainShader = {
 		"	vec3 totalDiffuseLight = vec3( 0.0 );",
 		"	vec3 totalSpecularLight = vec3( 0.0 );",
 
-			// point lights
+		// point lights
 
 		"	#if NUM_POINT_LIGHTS > 0",
 
@@ -168,7 +168,7 @@ THREE.TerrainShader = {
 
 		"	#endif",
 
-			// directional lights
+		// directional lights
 
 		"	#if NUM_DIR_LIGHTS > 0",
 
@@ -192,7 +192,7 @@ THREE.TerrainShader = {
 
 		"	#endif",
 
-			// hemisphere lights
+		// hemisphere lights
 
 		"	#if NUM_HEMI_LIGHTS > 0",
 
@@ -203,14 +203,14 @@ THREE.TerrainShader = {
 
 		"			vec3 lVector = hemisphereLightDirection[ i ];",
 
-					// diffuse
+		// diffuse
 
 		"			float dotProduct = dot( normal, lVector );",
 		"			float hemiDiffuseWeight = 0.5 * dotProduct + 0.5;",
 
 		"			totalDiffuseLight += mix( hemisphereLights[ i ].groundColor, hemisphereLights[ i ].skyColor, hemiDiffuseWeight );",
 
-					// specular (sky light)
+		// specular (sky light)
 
 		"			float hemiSpecularWeight = 0.0;",
 
@@ -218,7 +218,7 @@ THREE.TerrainShader = {
 		"			float hemiDotNormalHalfSky = 0.5 * dot( normal, hemiHalfVectorSky ) + 0.5;",
 		"			hemiSpecularWeight += specularTex.r * max( pow( hemiDotNormalHalfSky, shininess ), 0.0 );",
 
-					// specular (ground light)
+		// specular (ground light)
 
 		"			vec3 lVectorGround = -lVector;",
 
@@ -236,7 +236,7 @@ THREE.TerrainShader = {
 
 		"	gl_FragColor = vec4( outgoingLight, diffuseColor.a );",	// TODO, this should be pre-multiplied to allow for bright highlights on very transparent objects
 
-			THREE.ShaderChunk[ "fog_fragment" ],
+		THREE.ShaderChunk[ "fog_fragment" ],
 
 		"}"
 
@@ -272,20 +272,20 @@ THREE.TerrainShader = {
 
 		"	vNormal = normalize( normalMatrix * normal );",
 
-			// tangent and binormal vectors
+		// tangent and binormal vectors
 
 		"	vTangent = normalize( normalMatrix * tangent.xyz );",
 
 		"	vBinormal = cross( vNormal, vTangent ) * tangent.w;",
 		"	vBinormal = normalize( vBinormal );",
 
-			// texture coordinates
+		// texture coordinates
 
 		"	vUv = uv;",
 
 		"	vec2 uvBase = uv * uRepeatBase;",
 
-			// displacement mapping
+		// displacement mapping
 
 		"	#ifdef VERTEX_TEXTURES",
 
@@ -310,8 +310,8 @@ THREE.TerrainShader = {
 		"	vec3 normalTex = texture2D( tNormal, uvBase ).xyz * 2.0 - 1.0;",
 		"	vNormal = normalMatrix * normalTex;",
 
-			THREE.ShaderChunk[ "shadowmap_vertex" ],
-			THREE.ShaderChunk[ "fog_vertex" ],
+		THREE.ShaderChunk[ "shadowmap_vertex" ],
+		THREE.ShaderChunk[ "fog_vertex" ],
 
 		"}"
 

+ 3 - 3
examples/js/shaders/ToneMapShader.js

@@ -48,16 +48,16 @@ THREE.ToneMapShader = {
 
 		"vec3 ToneMap( vec3 vColor ) {",
 		"	#ifdef ADAPTED_LUMINANCE",
-				// Get the calculated average luminance
+		// Get the calculated average luminance
 		"		float fLumAvg = texture2D(luminanceMap, vec2(0.5, 0.5)).r;",
 		"	#else",
 		"		float fLumAvg = averageLuminance;",
 		"	#endif",
 
-			// Calculate the luminance of the current pixel
+		// Calculate the luminance of the current pixel
 		"	float fLumPixel = linearToRelativeLuminance( vColor );",
 
-			// Apply the modified operator (Eq. 4)
+		// Apply the modified operator (Eq. 4)
 		"	float fLumScaled = (fLumPixel * middleGrey) / max( minLuminance, fLumAvg );",
 
 		"	float fLumCompressed = (fLumScaled * (1.0 + (fLumScaled / (maxLuminance * maxLuminance)))) / (1.0 + fLumScaled);",

+ 1 - 1
examples/js/shaders/TriangleBlurShader.js

@@ -49,7 +49,7 @@ THREE.TriangleBlurShader = {
 
 		"	float total = 0.0;",
 
-			// randomize the lookup values to hide the fixed number of samples
+		// randomize the lookup values to hide the fixed number of samples
 
 		"	float offset = rand( vUv );",
 

+ 1 - 1
examples/js/shaders/VignetteShader.js

@@ -40,7 +40,7 @@ THREE.VignetteShader = {
 
 		"void main() {",
 
-			// Eskil's vignette
+		// Eskil's vignette
 
 		"	vec4 texel = texture2D( tDiffuse, vUv );",
 		"	vec2 uv = ( vUv - vec2( 0.5 ) ) * vec2( offset );",