Browse Source

indent updates

Garrett Johnson 5 years ago
parent
commit
1c8fecf7d1
2 changed files with 272 additions and 272 deletions
  1. 114 114
      examples/js/shaders/OceanShaders.js
  2. 158 158
      examples/js/shaders/SMAAShader.js

+ 114 - 114
examples/js/shaders/OceanShaders.js

@@ -28,8 +28,8 @@ THREE.OceanShaders[ 'ocean_sim_vertex' ] = {
 		'varying vec2 vUV;',
 
 		'void main (void) {',
-			'vUV = position.xy * 0.5 + 0.5;',
-			'gl_Position = vec4(position, 1.0 );',
+		'	vUV = position.xy * 0.5 + 0.5;',
+		'	gl_Position = vec4(position, 1.0 );',
 		'}'
 	].join( '\n' )
 };
@@ -52,34 +52,34 @@ THREE.OceanShaders[ 'ocean_subtransform' ] = {
 		'varying vec2 vUV;',
 
 		'vec2 multiplyComplex (vec2 a, vec2 b) {',
-			'return vec2(a[0] * b[0] - a[1] * b[1], a[1] * b[0] + a[0] * b[1]);',
+		'	return vec2(a[0] * b[0] - a[1] * b[1], a[1] * b[0] + a[0] * b[1]);',
 		'}',
 
 		'void main (void) {',
-			'#ifdef HORIZONTAL',
-			'float index = vUV.x * u_transformSize - 0.5;',
-			'#else',
-			'float index = vUV.y * u_transformSize - 0.5;',
-			'#endif',
+		'	#ifdef HORIZONTAL',
+		'	float index = vUV.x * u_transformSize - 0.5;',
+		'	#else',
+		'	float index = vUV.y * u_transformSize - 0.5;',
+		'	#endif',
 
-			'float evenIndex = floor(index / u_subtransformSize) * (u_subtransformSize * 0.5) + mod(index, u_subtransformSize * 0.5);',
+		'	float evenIndex = floor(index / u_subtransformSize) * (u_subtransformSize * 0.5) + mod(index, u_subtransformSize * 0.5);',
 
 			//transform two complex sequences simultaneously
-			'#ifdef HORIZONTAL',
-			'vec4 even = texture2D(u_input, vec2(evenIndex + 0.5, gl_FragCoord.y) / u_transformSize).rgba;',
-			'vec4 odd = texture2D(u_input, vec2(evenIndex + u_transformSize * 0.5 + 0.5, gl_FragCoord.y) / u_transformSize).rgba;',
-			'#else',
-			'vec4 even = texture2D(u_input, vec2(gl_FragCoord.x, evenIndex + 0.5) / u_transformSize).rgba;',
-			'vec4 odd = texture2D(u_input, vec2(gl_FragCoord.x, evenIndex + u_transformSize * 0.5 + 0.5) / u_transformSize).rgba;',
-			'#endif',
+		'	#ifdef HORIZONTAL',
+		'	vec4 even = texture2D(u_input, vec2(evenIndex + 0.5, gl_FragCoord.y) / u_transformSize).rgba;',
+		'	vec4 odd = texture2D(u_input, vec2(evenIndex + u_transformSize * 0.5 + 0.5, gl_FragCoord.y) / u_transformSize).rgba;',
+		'	#else',
+		'	vec4 even = texture2D(u_input, vec2(gl_FragCoord.x, evenIndex + 0.5) / u_transformSize).rgba;',
+		'	vec4 odd = texture2D(u_input, vec2(gl_FragCoord.x, evenIndex + u_transformSize * 0.5 + 0.5) / u_transformSize).rgba;',
+		'	#endif',
 
-			'float twiddleArgument = -2.0 * PI * (index / u_subtransformSize);',
-			'vec2 twiddle = vec2(cos(twiddleArgument), sin(twiddleArgument));',
+		'	float twiddleArgument = -2.0 * PI * (index / u_subtransformSize);',
+		'	vec2 twiddle = vec2(cos(twiddleArgument), sin(twiddleArgument));',
 
-			'vec2 outputA = even.xy + multiplyComplex(twiddle, odd.xy);',
-			'vec2 outputB = even.zw + multiplyComplex(twiddle, odd.zw);',
+		'	vec2 outputA = even.xy + multiplyComplex(twiddle, odd.xy);',
+		'	vec2 outputB = even.zw + multiplyComplex(twiddle, odd.zw);',
 
-			'gl_FragColor = vec4(outputA, outputB);',
+		'	gl_FragColor = vec4(outputA, outputB);',
 		'}'
 	].join( '\n' )
 };
@@ -91,7 +91,7 @@ THREE.OceanShaders[ 'ocean_initial_spectrum' ] = {
 	},
 	vertexShader: [
 		'void main (void) {',
-			'gl_Position = vec4(position, 1.0);',
+		'	gl_Position = vec4(position, 1.0);',
 		'}'
 	].join( '\n' ),
 	fragmentShader: [
@@ -107,62 +107,62 @@ THREE.OceanShaders[ 'ocean_initial_spectrum' ] = {
 		'uniform float u_size;',
 
 		'float omega (float k) {',
-			'return sqrt(G * k * (1.0 + pow2(k / KM)));',
+		'	return sqrt(G * k * (1.0 + pow2(k / KM)));',
 		'}',
 
 		'#if __VERSION__ == 100',
 		'float tanh (float x) {',
-			'return (1.0 - exp(-2.0 * x)) / (1.0 + exp(-2.0 * x));',
+		'	return (1.0 - exp(-2.0 * x)) / (1.0 + exp(-2.0 * x));',
 		'}',
 		'#endif',
 
 		'void main (void) {',
-			'vec2 coordinates = gl_FragCoord.xy - 0.5;',
+		'	vec2 coordinates = gl_FragCoord.xy - 0.5;',
 
-			'float n = (coordinates.x < u_resolution * 0.5) ? coordinates.x : coordinates.x - u_resolution;',
-			'float m = (coordinates.y < u_resolution * 0.5) ? coordinates.y : coordinates.y - u_resolution;',
+		'	float n = (coordinates.x < u_resolution * 0.5) ? coordinates.x : coordinates.x - u_resolution;',
+		'	float m = (coordinates.y < u_resolution * 0.5) ? coordinates.y : coordinates.y - u_resolution;',
 
-			'vec2 K = (2.0 * PI * vec2(n, m)) / u_size;',
-			'float k = length(K);',
+		'	vec2 K = (2.0 * PI * vec2(n, m)) / u_size;',
+		'	float k = length(K);',
 
-			'float l_wind = length(u_wind);',
+		'	float l_wind = length(u_wind);',
 
-			'float Omega = 0.84;',
-			'float kp = G * pow2(Omega / l_wind);',
+		'	float Omega = 0.84;',
+		'	float kp = G * pow2(Omega / l_wind);',
 
-			'float c = omega(k) / k;',
-			'float cp = omega(kp) / kp;',
+		'	float c = omega(k) / k;',
+		'	float cp = omega(kp) / kp;',
 
-			'float Lpm = exp(-1.25 * pow2(kp / k));',
-			'float gamma = 1.7;',
-			'float sigma = 0.08 * (1.0 + 4.0 * pow(Omega, -3.0));',
-			'float Gamma = exp(-pow2(sqrt(k / kp) - 1.0) / 2.0 * pow2(sigma));',
-			'float Jp = pow(gamma, Gamma);',
-			'float Fp = Lpm * Jp * exp(-Omega / sqrt(10.0) * (sqrt(k / kp) - 1.0));',
-			'float alphap = 0.006 * sqrt(Omega);',
-			'float Bl = 0.5 * alphap * cp / c * Fp;',
+		'	float Lpm = exp(-1.25 * pow2(kp / k));',
+		'	float gamma = 1.7;',
+		'	float sigma = 0.08 * (1.0 + 4.0 * pow(Omega, -3.0));',
+		'	float Gamma = exp(-pow2(sqrt(k / kp) - 1.0) / 2.0 * pow2(sigma));',
+		'	float Jp = pow(gamma, Gamma);',
+		'	float Fp = Lpm * Jp * exp(-Omega / sqrt(10.0) * (sqrt(k / kp) - 1.0));',
+		'	float alphap = 0.006 * sqrt(Omega);',
+		'	float Bl = 0.5 * alphap * cp / c * Fp;',
 
-			'float z0 = 0.000037 * pow2(l_wind) / G * pow(l_wind / cp, 0.9);',
-			'float uStar = 0.41 * l_wind / log(10.0 / z0);',
-			'float alpham = 0.01 * ((uStar < CM) ? (1.0 + log(uStar / CM)) : (1.0 + 3.0 * log(uStar / CM)));',
-			'float Fm = exp(-0.25 * pow2(k / KM - 1.0));',
-			'float Bh = 0.5 * alpham * CM / c * Fm * Lpm;',
+		'	float z0 = 0.000037 * pow2(l_wind) / G * pow(l_wind / cp, 0.9);',
+		'	float uStar = 0.41 * l_wind / log(10.0 / z0);',
+		'	float alpham = 0.01 * ((uStar < CM) ? (1.0 + log(uStar / CM)) : (1.0 + 3.0 * log(uStar / CM)));',
+		'	float Fm = exp(-0.25 * pow2(k / KM - 1.0));',
+		'	float Bh = 0.5 * alpham * CM / c * Fm * Lpm;',
 
-			'float a0 = log(2.0) / 4.0;',
-			'float am = 0.13 * uStar / CM;',
-			'float Delta = tanh(a0 + 4.0 * pow(c / cp, 2.5) + am * pow(CM / c, 2.5));',
+		'	float a0 = log(2.0) / 4.0;',
+		'	float am = 0.13 * uStar / CM;',
+		'	float Delta = tanh(a0 + 4.0 * pow(c / cp, 2.5) + am * pow(CM / c, 2.5));',
 
-			'float cosPhi = dot(normalize(u_wind), normalize(K));',
+		'	float cosPhi = dot(normalize(u_wind), normalize(K));',
 
-			'float S = (1.0 / (2.0 * PI)) * pow(k, -4.0) * (Bl + Bh) * (1.0 + Delta * (2.0 * cosPhi * cosPhi - 1.0));',
+		'	float S = (1.0 / (2.0 * PI)) * pow(k, -4.0) * (Bl + Bh) * (1.0 + Delta * (2.0 * cosPhi * cosPhi - 1.0));',
 
-			'float dk = 2.0 * PI / u_size;',
-			'float h = sqrt(S / 2.0) * dk;',
+		'	float dk = 2.0 * PI / u_size;',
+		'	float h = sqrt(S / 2.0) * dk;',
 
-			'if (K.x == 0.0 && K.y == 0.0) {',
-				'h = 0.0;', //no DC term
-			'}',
-			'gl_FragColor = vec4(h, 0.0, 0.0, 0.0);',
+		'	if (K.x == 0.0 && K.y == 0.0) {',
+		'		h = 0.0;', //no DC term
+		'	}',
+		'	gl_FragColor = vec4(h, 0.0, 0.0, 0.0);',
 		'}'
 	].join( '\n' )
 };
@@ -188,21 +188,21 @@ THREE.OceanShaders[ 'ocean_phase' ] = {
 		'uniform float u_size;',
 
 		'float omega (float k) {',
-			'return sqrt(G * k * (1.0 + k * k / KM * KM));',
+		'	return sqrt(G * k * (1.0 + k * k / KM * KM));',
 		'}',
 
 		'void main (void) {',
-			'float deltaTime = 1.0 / 60.0;',
-			'vec2 coordinates = gl_FragCoord.xy - 0.5;',
-			'float n = (coordinates.x < u_resolution * 0.5) ? coordinates.x : coordinates.x - u_resolution;',
-			'float m = (coordinates.y < u_resolution * 0.5) ? coordinates.y : coordinates.y - u_resolution;',
-			'vec2 waveVector = (2.0 * PI * vec2(n, m)) / u_size;',
+		'	float deltaTime = 1.0 / 60.0;',
+		'	vec2 coordinates = gl_FragCoord.xy - 0.5;',
+		'	float n = (coordinates.x < u_resolution * 0.5) ? coordinates.x : coordinates.x - u_resolution;',
+		'	float m = (coordinates.y < u_resolution * 0.5) ? coordinates.y : coordinates.y - u_resolution;',
+		'	vec2 waveVector = (2.0 * PI * vec2(n, m)) / u_size;',
 
-			'float phase = texture2D(u_phases, vUV).r;',
-			'float deltaPhase = omega(length(waveVector)) * u_deltaTime;',
-			'phase = mod(phase + deltaPhase, 2.0 * PI);',
+		'	float phase = texture2D(u_phases, vUV).r;',
+		'	float deltaPhase = omega(length(waveVector)) * u_deltaTime;',
+		'	phase = mod(phase + deltaPhase, 2.0 * PI);',
 
-			'gl_FragColor = vec4(phase, 0.0, 0.0, 0.0);',
+		'	gl_FragColor = vec4(phase, 0.0, 0.0, 0.0);',
 		'}'
 	].join( '\n' )
 };
@@ -230,43 +230,43 @@ THREE.OceanShaders[ 'ocean_spectrum' ] = {
 		'uniform sampler2D u_initialSpectrum;',
 
 		'vec2 multiplyComplex (vec2 a, vec2 b) {',
-			'return vec2(a[0] * b[0] - a[1] * b[1], a[1] * b[0] + a[0] * b[1]);',
+		'	return vec2(a[0] * b[0] - a[1] * b[1], a[1] * b[0] + a[0] * b[1]);',
 		'}',
 
 		'vec2 multiplyByI (vec2 z) {',
-			'return vec2(-z[1], z[0]);',
+		'	return vec2(-z[1], z[0]);',
 		'}',
 
 		'float omega (float k) {',
-			'return sqrt(G * k * (1.0 + k * k / KM * KM));',
+		'	return sqrt(G * k * (1.0 + k * k / KM * KM));',
 		'}',
 
 		'void main (void) {',
-			'vec2 coordinates = gl_FragCoord.xy - 0.5;',
-			'float n = (coordinates.x < u_resolution * 0.5) ? coordinates.x : coordinates.x - u_resolution;',
-			'float m = (coordinates.y < u_resolution * 0.5) ? coordinates.y : coordinates.y - u_resolution;',
-			'vec2 waveVector = (2.0 * PI * vec2(n, m)) / u_size;',
+		'	vec2 coordinates = gl_FragCoord.xy - 0.5;',
+		'	float n = (coordinates.x < u_resolution * 0.5) ? coordinates.x : coordinates.x - u_resolution;',
+		'	float m = (coordinates.y < u_resolution * 0.5) ? coordinates.y : coordinates.y - u_resolution;',
+		'	vec2 waveVector = (2.0 * PI * vec2(n, m)) / u_size;',
 
-			'float phase = texture2D(u_phases, vUV).r;',
-			'vec2 phaseVector = vec2(cos(phase), sin(phase));',
+		'	float phase = texture2D(u_phases, vUV).r;',
+		'	vec2 phaseVector = vec2(cos(phase), sin(phase));',
 
-			'vec2 h0 = texture2D(u_initialSpectrum, vUV).rg;',
-			'vec2 h0Star = texture2D(u_initialSpectrum, vec2(1.0 - vUV + 1.0 / u_resolution)).rg;',
-			'h0Star.y *= -1.0;',
+		'	vec2 h0 = texture2D(u_initialSpectrum, vUV).rg;',
+		'	vec2 h0Star = texture2D(u_initialSpectrum, vec2(1.0 - vUV + 1.0 / u_resolution)).rg;',
+		'	h0Star.y *= -1.0;',
 
-			'vec2 h = multiplyComplex(h0, phaseVector) + multiplyComplex(h0Star, vec2(phaseVector.x, -phaseVector.y));',
+		'	vec2 h = multiplyComplex(h0, phaseVector) + multiplyComplex(h0Star, vec2(phaseVector.x, -phaseVector.y));',
 
-			'vec2 hX = -multiplyByI(h * (waveVector.x / length(waveVector))) * u_choppiness;',
-			'vec2 hZ = -multiplyByI(h * (waveVector.y / length(waveVector))) * u_choppiness;',
+		'	vec2 hX = -multiplyByI(h * (waveVector.x / length(waveVector))) * u_choppiness;',
+		'	vec2 hZ = -multiplyByI(h * (waveVector.y / length(waveVector))) * u_choppiness;',
 
 			//no DC term
-			'if (waveVector.x == 0.0 && waveVector.y == 0.0) {',
-				'h = vec2(0.0);',
-				'hX = vec2(0.0);',
-				'hZ = vec2(0.0);',
-			'}',
+		'	if (waveVector.x == 0.0 && waveVector.y == 0.0) {',
+		'		h = vec2(0.0);',
+		'		hX = vec2(0.0);',
+		'		hZ = vec2(0.0);',
+		'	}',
 
-			'gl_FragColor = vec4(hX + multiplyByI(h), hZ);',
+		'	gl_FragColor = vec4(hX + multiplyByI(h), hZ);',
 		'}'
 	].join( '\n' )
 };
@@ -286,21 +286,21 @@ THREE.OceanShaders[ 'ocean_normals' ] = {
 		'uniform float u_size;',
 
 		'void main (void) {',
-			'float texel = 1.0 / u_resolution;',
-			'float texelSize = u_size / u_resolution;',
+		'	float texel = 1.0 / u_resolution;',
+		'	float texelSize = u_size / u_resolution;',
 
-			'vec3 center = texture2D(u_displacementMap, vUV).rgb;',
-			'vec3 right = vec3(texelSize, 0.0, 0.0) + texture2D(u_displacementMap, vUV + vec2(texel, 0.0)).rgb - center;',
-			'vec3 left = vec3(-texelSize, 0.0, 0.0) + texture2D(u_displacementMap, vUV + vec2(-texel, 0.0)).rgb - center;',
-			'vec3 top = vec3(0.0, 0.0, -texelSize) + texture2D(u_displacementMap, vUV + vec2(0.0, -texel)).rgb - center;',
-			'vec3 bottom = vec3(0.0, 0.0, texelSize) + texture2D(u_displacementMap, vUV + vec2(0.0, texel)).rgb - center;',
+		'	vec3 center = texture2D(u_displacementMap, vUV).rgb;',
+		'	vec3 right = vec3(texelSize, 0.0, 0.0) + texture2D(u_displacementMap, vUV + vec2(texel, 0.0)).rgb - center;',
+		'	vec3 left = vec3(-texelSize, 0.0, 0.0) + texture2D(u_displacementMap, vUV + vec2(-texel, 0.0)).rgb - center;',
+		'	vec3 top = vec3(0.0, 0.0, -texelSize) + texture2D(u_displacementMap, vUV + vec2(0.0, -texel)).rgb - center;',
+		'	vec3 bottom = vec3(0.0, 0.0, texelSize) + texture2D(u_displacementMap, vUV + vec2(0.0, texel)).rgb - center;',
 
-			'vec3 topRight = cross(right, top);',
-			'vec3 topLeft = cross(top, left);',
-			'vec3 bottomLeft = cross(left, bottom);',
-			'vec3 bottomRight = cross(bottom, right);',
+		'	vec3 topRight = cross(right, top);',
+		'	vec3 topLeft = cross(top, left);',
+		'	vec3 bottomLeft = cross(left, bottom);',
+		'	vec3 bottomRight = cross(bottom, right);',
 
-			'gl_FragColor = vec4(normalize(topRight + topLeft + bottomLeft + bottomRight), 1.0);',
+		'	gl_FragColor = vec4(normalize(topRight + topLeft + bottomLeft + bottomRight), 1.0);',
 		'}'
 	].join( '\n' )
 };
@@ -331,10 +331,10 @@ THREE.OceanShaders[ 'ocean_main' ] = {
 		'uniform sampler2D u_displacementMap;',
 
 		'void main (void) {',
-			'vec3 newPos = position + texture2D(u_displacementMap, uv).rgb * (u_geometrySize / u_size);',
-			'vPos = newPos;',
-			'vUV = uv;',
-			'gl_Position = u_projectionMatrix * u_viewMatrix * vec4(newPos, 1.0);',
+		'	vec3 newPos = position + texture2D(u_displacementMap, uv).rgb * (u_geometrySize / u_size);',
+		'	vPos = newPos;',
+		'	vUV = uv;',
+		'	gl_Position = u_projectionMatrix * u_viewMatrix * vec4(newPos, 1.0);',
 		'}'
 	].join( '\n' ),
 	fragmentShader: [
@@ -352,22 +352,22 @@ THREE.OceanShaders[ 'ocean_main' ] = {
 		'uniform float u_exposure;',
 
 		'vec3 hdr (vec3 color, float exposure) {',
-			'return 1.0 - exp(-color * exposure);',
+		'	return 1.0 - exp(-color * exposure);',
 		'}',
 
 		'void main (void) {',
-			'vec3 normal = texture2D(u_normalMap, vUV).rgb;',
+		'	vec3 normal = texture2D(u_normalMap, vUV).rgb;',
 
-			'vec3 view = normalize(u_cameraPosition - vPos);',
-			'float fresnel = 0.02 + 0.98 * pow(1.0 - dot(normal, view), 5.0);',
-			'vec3 sky = fresnel * u_skyColor;',
+		'	vec3 view = normalize(u_cameraPosition - vPos);',
+		'	float fresnel = 0.02 + 0.98 * pow(1.0 - dot(normal, view), 5.0);',
+		'	vec3 sky = fresnel * u_skyColor;',
 
-			'float diffuse = clamp(dot(normal, normalize(u_sunDirection)), 0.0, 1.0);',
-			'vec3 water = (1.0 - fresnel) * u_oceanColor * u_skyColor * diffuse;',
+		'	float diffuse = clamp(dot(normal, normalize(u_sunDirection)), 0.0, 1.0);',
+		'	vec3 water = (1.0 - fresnel) * u_oceanColor * u_skyColor * diffuse;',
 
-			'vec3 color = sky + water;',
+		'	vec3 color = sky + water;',
 
-			'gl_FragColor = vec4(hdr(color, u_exposure), 1.0);',
+		'	gl_FragColor = vec4(hdr(color, u_exposure), 1.0);',
 		'}'
 	].join( '\n' )
 };

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

@@ -29,18 +29,18 @@ THREE.SMAAEdgesShader = {
 		"varying vec4 vOffset[ 3 ];",
 
 		"void SMAAEdgeDetectionVS( vec2 texcoord ) {",
-			"vOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -1.0, 0.0, 0.0,  1.0 );", // WebGL port note: Changed sign in W component
-			"vOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4(  1.0, 0.0, 0.0, -1.0 );", // WebGL port note: Changed sign in W component
-			"vOffset[ 2 ] = texcoord.xyxy + resolution.xyxy * vec4( -2.0, 0.0, 0.0,  2.0 );", // WebGL port note: Changed sign in W component
+		"	vOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -1.0, 0.0, 0.0,  1.0 );", // WebGL port note: Changed sign in W component
+		"	vOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4(  1.0, 0.0, 0.0, -1.0 );", // WebGL port note: Changed sign in W component
+		"	vOffset[ 2 ] = texcoord.xyxy + resolution.xyxy * vec4( -2.0, 0.0, 0.0,  2.0 );", // WebGL port note: Changed sign in W component
 		"}",
 
 		"void main() {",
 
-			"vUv = uv;",
+		"	vUv = uv;",
 
-			"SMAAEdgeDetectionVS( vUv );",
+		"	SMAAEdgeDetectionVS( vUv );",
 
-			"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+		"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
 
 		"}"
 
@@ -54,60 +54,60 @@ THREE.SMAAEdgesShader = {
 		"varying vec4 vOffset[ 3 ];",
 
 		"vec4 SMAAColorEdgeDetectionPS( vec2 texcoord, vec4 offset[3], sampler2D colorTex ) {",
-			"vec2 threshold = vec2( SMAA_THRESHOLD, SMAA_THRESHOLD );",
+		"	vec2 threshold = vec2( SMAA_THRESHOLD, SMAA_THRESHOLD );",
 
 			// Calculate color deltas:
-			"vec4 delta;",
-			"vec3 C = texture2D( colorTex, texcoord ).rgb;",
+		"	vec4 delta;",
+		"	vec3 C = texture2D( colorTex, texcoord ).rgb;",
 
-			"vec3 Cleft = texture2D( colorTex, offset[0].xy ).rgb;",
-			"vec3 t = abs( C - Cleft );",
-			"delta.x = max( max( t.r, t.g ), t.b );",
+		"	vec3 Cleft = texture2D( colorTex, offset[0].xy ).rgb;",
+		"	vec3 t = abs( C - Cleft );",
+		"	delta.x = max( max( t.r, t.g ), t.b );",
 
-			"vec3 Ctop = texture2D( colorTex, offset[0].zw ).rgb;",
-			"t = abs( C - Ctop );",
-			"delta.y = max( max( t.r, t.g ), t.b );",
+		"	vec3 Ctop = texture2D( colorTex, offset[0].zw ).rgb;",
+		"	t = abs( C - Ctop );",
+		"	delta.y = max( max( t.r, t.g ), t.b );",
 
 			// We do the usual threshold:
-			"vec2 edges = step( threshold, delta.xy );",
+		"	vec2 edges = step( threshold, delta.xy );",
 
 			// Then discard if there is no edge:
-			"if ( dot( edges, vec2( 1.0, 1.0 ) ) == 0.0 )",
-				"discard;",
+		"	if ( dot( edges, vec2( 1.0, 1.0 ) ) == 0.0 )",
+		"		discard;",
 
 			// 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 );",
+		"	vec3 Cright = texture2D( colorTex, offset[1].xy ).rgb;",
+		"	t = abs( C - Cright );",
+		"	delta.z = max( max( t.r, t.g ), t.b );",
 
-			"vec3 Cbottom  = texture2D( colorTex, offset[1].zw ).rgb;",
-			"t = abs( C - Cbottom );",
-			"delta.w = max( max( t.r, t.g ), t.b );",
+		"	vec3 Cbottom  = texture2D( colorTex, offset[1].zw ).rgb;",
+		"	t = abs( C - Cbottom );",
+		"	delta.w = max( max( t.r, t.g ), t.b );",
 
 			// Calculate the maximum delta in the direct neighborhood:
-			"float maxDelta = max( max( max( delta.x, delta.y ), delta.z ), delta.w );",
+		"	float maxDelta = max( max( max( delta.x, delta.y ), delta.z ), delta.w );",
 
 			// 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 );",
+		"	vec3 Cleftleft  = texture2D( colorTex, offset[2].xy ).rgb;",
+		"	t = abs( C - Cleftleft );",
+		"	delta.z = max( max( t.r, t.g ), t.b );",
 
-			"vec3 Ctoptop = texture2D( colorTex, offset[2].zw ).rgb;",
-			"t = abs( C - Ctoptop );",
-			"delta.w = max( max( t.r, t.g ), t.b );",
+		"	vec3 Ctoptop = texture2D( colorTex, offset[2].zw ).rgb;",
+		"	t = abs( C - Ctoptop );",
+		"	delta.w = max( max( t.r, t.g ), t.b );",
 
 			// Calculate the final maximum delta:
-			"maxDelta = max( max( maxDelta, delta.z ), delta.w );",
+		"	maxDelta = max( max( maxDelta, delta.z ), delta.w );",
 
 			// Local contrast adaptation in action:
-			"edges.xy *= step( 0.5 * maxDelta, delta.xy );",
+		"	edges.xy *= step( 0.5 * maxDelta, delta.xy );",
 
-			"return vec4( edges, 0.0, 0.0 );",
+		"	return vec4( edges, 0.0, 0.0 );",
 		"}",
 
 		"void main() {",
 
-			"gl_FragColor = SMAAColorEdgeDetectionPS( vUv, vOffset, tDiffuse );",
+		"	gl_FragColor = SMAAColorEdgeDetectionPS( vUv, vOffset, tDiffuse );",
 
 		"}"
 
@@ -144,24 +144,24 @@ THREE.SMAAWeightsShader = {
 		"varying vec2 vPixcoord;",
 
 		"void SMAABlendingWeightCalculationVS( vec2 texcoord ) {",
-			"vPixcoord = texcoord / resolution;",
+		"	vPixcoord = texcoord / resolution;",
 
 			// 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
+		"	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:
-			"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 );",
+		"	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 );",
 
 		"}",
 
 		"void main() {",
 
-			"vUv = uv;",
+		"	vUv = uv;",
 
-			"SMAABlendingWeightCalculationVS( vUv );",
+		"	SMAABlendingWeightCalculationVS( vUv );",
 
-			"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+		"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
 
 		"}"
 
@@ -182,7 +182,7 @@ THREE.SMAAWeightsShader = {
 
 		"#if __VERSION__ == 100",
 		"vec2 round( vec2 x ) {",
-			"return sign( x ) * floor( abs( x ) + 0.5 );",
+		"	return sign( x ) * floor( abs( x ) + 0.5 );",
 		"}",
 		"#endif",
 
@@ -191,8 +191,8 @@ THREE.SMAAWeightsShader = {
 			// 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;",
+		"	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 ) {",
@@ -203,169 +203,169 @@ THREE.SMAAWeightsShader = {
 			* Sampling with different offsets in each direction allows to disambiguate
 			* which edges are active from the four fetched ones.
 			*/
-			"vec2 e = vec2( 0.0, 1.0 );",
+		"	vec2 e = vec2( 0.0, 1.0 );",
 
-			"for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {", // WebGL port note: Changed while to for
-				"e = texture2D( edgesTex, texcoord, 0.0 ).rg;",
-				"texcoord -= vec2( 2.0, 0.0 ) * resolution;",
-				"if ( ! ( texcoord.x > end && e.g > 0.8281 && e.r == 0.0 ) ) break;",
-			"}",
+		"	for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {", // WebGL port note: Changed while to for
+		"		e = texture2D( edgesTex, texcoord, 0.0 ).rg;",
+		"		texcoord -= vec2( 2.0, 0.0 ) * resolution;",
+		"		if ( ! ( texcoord.x > end && e.g > 0.8281 && e.r == 0.0 ) ) break;",
+		"	}",
 
 			// We correct the previous (-0.25, -0.125) offset we applied:
-			"texcoord.x += 0.25 * resolution.x;",
+		"	texcoord.x += 0.25 * resolution.x;",
 
 			// The searches are bias by 1, so adjust the coords accordingly:
-			"texcoord.x += resolution.x;",
+		"	texcoord.x += resolution.x;",
 
 			// 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);",
+		"	texcoord.x += 2.0 * resolution.x;", // Undo last step
+		"	texcoord.x -= resolution.x * SMAASearchLength(searchTex, e, 0.0, 0.5);",
 
-			"return texcoord.x;",
+		"	return texcoord.x;",
 		"}",
 
 		"float SMAASearchXRight( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {",
-			"vec2 e = vec2( 0.0, 1.0 );",
+		"	vec2 e = vec2( 0.0, 1.0 );",
 
-			"for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {", // WebGL port note: Changed while to for
-				"e = texture2D( edgesTex, texcoord, 0.0 ).rg;",
-				"texcoord += vec2( 2.0, 0.0 ) * resolution;",
-				"if ( ! ( texcoord.x < end && e.g > 0.8281 && e.r == 0.0 ) ) break;",
-			"}",
+		"	for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {", // WebGL port note: Changed while to for
+		"		e = texture2D( edgesTex, texcoord, 0.0 ).rg;",
+		"		texcoord += vec2( 2.0, 0.0 ) * resolution;",
+		"		if ( ! ( texcoord.x < end && e.g > 0.8281 && e.r == 0.0 ) ) break;",
+		"	}",
 
-			"texcoord.x -= 0.25 * resolution.x;",
-			"texcoord.x -= resolution.x;",
-			"texcoord.x -= 2.0 * resolution.x;",
-			"texcoord.x += resolution.x * SMAASearchLength( searchTex, e, 0.5, 0.5 );",
+		"	texcoord.x -= 0.25 * resolution.x;",
+		"	texcoord.x -= resolution.x;",
+		"	texcoord.x -= 2.0 * resolution.x;",
+		"	texcoord.x += resolution.x * SMAASearchLength( searchTex, e, 0.5, 0.5 );",
 
-			"return texcoord.x;",
+		"	return texcoord.x;",
 		"}",
 
 		"float SMAASearchYUp( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {",
-			"vec2 e = vec2( 1.0, 0.0 );",
+		"	vec2 e = vec2( 1.0, 0.0 );",
 
-			"for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {", // WebGL port note: Changed while to for
-				"e = texture2D( edgesTex, texcoord, 0.0 ).rg;",
-				"texcoord += vec2( 0.0, 2.0 ) * resolution;", // WebGL port note: Changed sign
-				"if ( ! ( texcoord.y > end && e.r > 0.8281 && e.g == 0.0 ) ) break;",
-			"}",
+		"	for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {", // WebGL port note: Changed while to for
+		"		e = texture2D( edgesTex, texcoord, 0.0 ).rg;",
+		"		texcoord += vec2( 0.0, 2.0 ) * resolution;", // WebGL port note: Changed sign
+		"		if ( ! ( texcoord.y > end && e.r > 0.8281 && e.g == 0.0 ) ) break;",
+		"	}",
 
-			"texcoord.y -= 0.25 * resolution.y;", // WebGL port note: Changed sign
-			"texcoord.y -= resolution.y;", // WebGL port note: Changed sign
-			"texcoord.y -= 2.0 * resolution.y;", // WebGL port note: Changed sign
-			"texcoord.y += resolution.y * SMAASearchLength( searchTex, e.gr, 0.0, 0.5 );", // WebGL port note: Changed sign
+		"	texcoord.y -= 0.25 * resolution.y;", // WebGL port note: Changed sign
+		"	texcoord.y -= resolution.y;", // WebGL port note: Changed sign
+		"	texcoord.y -= 2.0 * resolution.y;", // WebGL port note: Changed sign
+		"	texcoord.y += resolution.y * SMAASearchLength( searchTex, e.gr, 0.0, 0.5 );", // WebGL port note: Changed sign
 
-			"return texcoord.y;",
+		"	return texcoord.y;",
 		"}",
 
 		"float SMAASearchYDown( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {",
-			"vec2 e = vec2( 1.0, 0.0 );",
+		"	vec2 e = vec2( 1.0, 0.0 );",
 
-			"for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {", // WebGL port note: Changed while to for
-				"e = texture2D( edgesTex, texcoord, 0.0 ).rg;",
-				"texcoord -= vec2( 0.0, 2.0 ) * resolution;", // WebGL port note: Changed sign
-				"if ( ! ( texcoord.y < end && e.r > 0.8281 && e.g == 0.0 ) ) break;",
-			"}",
+		"	for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {", // WebGL port note: Changed while to for
+		"		e = texture2D( edgesTex, texcoord, 0.0 ).rg;",
+		"		texcoord -= vec2( 0.0, 2.0 ) * resolution;", // WebGL port note: Changed sign
+		"		if ( ! ( texcoord.y < end && e.r > 0.8281 && e.g == 0.0 ) ) break;",
+		"	}",
 
-			"texcoord.y += 0.25 * resolution.y;", // WebGL port note: Changed sign
-			"texcoord.y += resolution.y;", // WebGL port note: Changed sign
-			"texcoord.y += 2.0 * resolution.y;", // WebGL port note: Changed sign
-			"texcoord.y -= resolution.y * SMAASearchLength( searchTex, e.gr, 0.5, 0.5 );", // WebGL port note: Changed sign
+		"	texcoord.y += 0.25 * resolution.y;", // WebGL port note: Changed sign
+		"	texcoord.y += resolution.y;", // WebGL port note: Changed sign
+		"	texcoord.y += 2.0 * resolution.y;", // WebGL port note: Changed sign
+		"	texcoord.y -= resolution.y * SMAASearchLength( searchTex, e.gr, 0.5, 0.5 );", // WebGL port note: Changed sign
 
-			"return texcoord.y;",
+		"	return texcoord.y;",
 		"}",
 
 		"vec2 SMAAArea( sampler2D areaTex, vec2 dist, float e1, float e2, float offset ) {",
 			// Rounding prevents precision errors of bilinear filtering:
-			"vec2 texcoord = float( SMAA_AREATEX_MAX_DISTANCE ) * round( 4.0 * vec2( e1, e2 ) ) + dist;",
+		"	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:
-			"texcoord = SMAA_AREATEX_PIXEL_SIZE * texcoord + ( 0.5 * SMAA_AREATEX_PIXEL_SIZE );",
+		"	texcoord = SMAA_AREATEX_PIXEL_SIZE * texcoord + ( 0.5 * SMAA_AREATEX_PIXEL_SIZE );",
 
 			// Move to proper place, according to the subpixel offset:
-			"texcoord.y += SMAA_AREATEX_SUBTEX_SIZE * offset;",
+		"	texcoord.y += SMAA_AREATEX_SUBTEX_SIZE * offset;",
 
-			"return texture2D( areaTex, texcoord, 0.0 ).rg;",
+		"	return texture2D( areaTex, texcoord, 0.0 ).rg;",
 		"}",
 
 		"vec4 SMAABlendingWeightCalculationPS( vec2 texcoord, vec2 pixcoord, vec4 offset[ 3 ], sampler2D edgesTex, sampler2D areaTex, sampler2D searchTex, ivec4 subsampleIndices ) {",
-			"vec4 weights = vec4( 0.0, 0.0, 0.0, 0.0 );",
+		"	vec4 weights = vec4( 0.0, 0.0, 0.0, 0.0 );",
 
-			"vec2 e = texture2D( edgesTex, texcoord ).rg;",
+		"	vec2 e = texture2D( edgesTex, texcoord ).rg;",
 
-			"if ( e.g > 0.0 ) {", // Edge at north
-				"vec2 d;",
+		"	if ( e.g > 0.0 ) {", // Edge at north
+		"		vec2 d;",
 
 				// 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;",
+		"		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:
-				"float e1 = texture2D( edgesTex, coords, 0.0 ).r;",
+		"		float e1 = texture2D( edgesTex, coords, 0.0 ).r;",
 
 				// Find the distance to the right:
-				"coords.x = SMAASearchXRight( edgesTex, searchTex, offset[ 0 ].zw, offset[ 2 ].y );",
-				"d.y = coords.x;",
+		"		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):
-				"d = d / resolution.x - pixcoord.x;",
+		"		d = d / resolution.x - pixcoord.x;",
 
 				// SMAAArea below needs a sqrt, as the areas texture is compressed
 				// quadratically:
-				"vec2 sqrt_d = sqrt( abs( d ) );",
+		"		vec2 sqrt_d = sqrt( abs( d ) );",
 
 				// Fetch the right crossing edges:
-				"coords.y -= 1.0 * resolution.y;", // WebGL port note: Added
-				"float e2 = SMAASampleLevelZeroOffset( edgesTex, coords, ivec2( 1, 0 ) ).r;",
+		"		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:
-				"weights.rg = SMAAArea( areaTex, sqrt_d, e1, e2, float( subsampleIndices.y ) );",
-			"}",
+		"		weights.rg = SMAAArea( areaTex, sqrt_d, e1, e2, float( subsampleIndices.y ) );",
+		"	}",
 
-			"if ( e.r > 0.0 ) {", // Edge at west
-				"vec2 d;",
+		"	if ( e.r > 0.0 ) {", // Edge at west
+		"		vec2 d;",
 
 				// Find the distance to the top:
-				"vec2 coords;",
+		"		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;",
+		"		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:
-				"float e1 = texture2D( edgesTex, coords, 0.0 ).g;",
+		"		float e1 = texture2D( edgesTex, coords, 0.0 ).g;",
 
 				// Find the distance to the bottom:
-				"coords.y = SMAASearchYDown( edgesTex, searchTex, offset[ 1 ].zw, offset[ 2 ].w );",
-				"d.y = coords.y;",
+		"		coords.y = SMAASearchYDown( edgesTex, searchTex, offset[ 1 ].zw, offset[ 2 ].w );",
+		"		d.y = coords.y;",
 
 				// We want the distances to be in pixel units:
-				"d = d / resolution.y - pixcoord.y;",
+		"		d = d / resolution.y - pixcoord.y;",
 
 				// SMAAArea below needs a sqrt, as the areas texture is compressed
 				// quadratically:
-				"vec2 sqrt_d = sqrt( abs( d ) );",
+		"		vec2 sqrt_d = sqrt( abs( d ) );",
 
 				// Fetch the bottom crossing edges:
-				"coords.y -= 1.0 * resolution.y;", // WebGL port note: Added
-				"float e2 = SMAASampleLevelZeroOffset( edgesTex, coords, ivec2( 0, 1 ) ).g;",
+		"		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:
-				"weights.ba = SMAAArea( areaTex, sqrt_d, e1, e2, float( subsampleIndices.x ) );",
-			"}",
+		"		weights.ba = SMAAArea( areaTex, sqrt_d, e1, e2, float( subsampleIndices.x ) );",
+		"	}",
 
-			"return weights;",
+		"	return weights;",
 		"}",
 
 		"void main() {",
 
-			"gl_FragColor = SMAABlendingWeightCalculationPS( vUv, vPixcoord, vOffset, tDiffuse, tArea, tSearch, ivec4( 0.0 ) );",
+		"	gl_FragColor = SMAABlendingWeightCalculationPS( vUv, vPixcoord, vOffset, tDiffuse, tArea, tSearch, ivec4( 0.0 ) );",
 
 		"}"
 
@@ -391,17 +391,17 @@ THREE.SMAABlendShader = {
 		"varying vec4 vOffset[ 2 ];",
 
 		"void SMAANeighborhoodBlendingVS( vec2 texcoord ) {",
-			"vOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -1.0, 0.0, 0.0, 1.0 );", // WebGL port note: Changed sign in W component
-			"vOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( 1.0, 0.0, 0.0, -1.0 );", // WebGL port note: Changed sign in W component
+		"	vOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -1.0, 0.0, 0.0, 1.0 );", // WebGL port note: Changed sign in W component
+		"	vOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( 1.0, 0.0, 0.0, -1.0 );", // WebGL port note: Changed sign in W component
 		"}",
 
 		"void main() {",
 
-			"vUv = uv;",
+		"	vUv = uv;",
 
-			"SMAANeighborhoodBlendingVS( vUv );",
+		"	SMAANeighborhoodBlendingVS( vUv );",
 
-			"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+		"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
 
 		"}"
 
@@ -418,48 +418,48 @@ THREE.SMAABlendShader = {
 
 		"vec4 SMAANeighborhoodBlendingPS( vec2 texcoord, vec4 offset[ 2 ], sampler2D colorTex, sampler2D blendTex ) {",
 			// 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;",
+		"	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?
-			"if ( dot(a, vec4( 1.0, 1.0, 1.0, 1.0 )) < 1e-5 ) {",
-				"return texture2D( colorTex, texcoord, 0.0 );",
-			"} else {",
+		"	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:
-				"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
+		"		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:
-				"if ( abs( offset.x ) > abs( offset.y )) {", // horizontal vs. vertical
-					"offset.y = 0.0;",
-				"} else {",
-					"offset.x = 0.0;",
-				"}",
+		"		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:
-				"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 );",
+		"		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
-				"C.xyz = pow(C.xyz, vec3(2.2));",
-				"Cop.xyz = pow(Cop.xyz, vec3(2.2));",
-				"vec4 mixed = mix(C, Cop, s);",
-				"mixed.xyz = pow(mixed.xyz, vec3(1.0 / 2.2));",
+		"		C.xyz = pow(C.xyz, vec3(2.2));",
+		"		Cop.xyz = pow(Cop.xyz, vec3(2.2));",
+		"		vec4 mixed = mix(C, Cop, s);",
+		"		mixed.xyz = pow(mixed.xyz, vec3(1.0 / 2.2));",
 
-				"return mixed;",
-			"}",
+		"		return mixed;",
+		"	}",
 		"}",
 
 		"void main() {",
 
-			"gl_FragColor = SMAANeighborhoodBlendingPS( vUv, vOffset, tColor, tDiffuse );",
+		"	gl_FragColor = SMAANeighborhoodBlendingPS( vUv, vOffset, tColor, tDiffuse );",
 
 		"}"