Browse Source

Fix more indents

Garrett Johnson 5 years ago
parent
commit
5e2f24c8c6

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

@@ -23,8 +23,8 @@ THREE.DOFMipMapShader = {
 
 		"void main() {",
 
-			"vUv = uv;",
-			"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+		"	vUv = uv;",
+		"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
 
 		"}"
 
@@ -42,14 +42,14 @@ THREE.DOFMipMapShader = {
 
 		"void main() {",
 
-			"vec4 depth = texture2D( tDepth, vUv );",
+		"	vec4 depth = texture2D( tDepth, vUv );",
 
-			"float factor = depth.x - focus;",
+		"	float factor = depth.x - focus;",
 
-			"vec4 col = texture2D( tColor, vUv, 2.0 * maxblur * abs( focus - depth.x ) );",
+		"	vec4 col = texture2D( tColor, vUv, 2.0 * maxblur * abs( focus - depth.x ) );",
 
-			"gl_FragColor = col;",
-			"gl_FragColor.a = 1.0;",
+		"	gl_FragColor = col;",
+		"	gl_FragColor.a = 1.0;",
 
 		"}"
 

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

@@ -24,8 +24,8 @@ THREE.DotScreenShader = {
 
 		"void main() {",
 
-			"vUv = uv;",
-			"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+		"	vUv = uv;",
+		"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
 
 		"}"
 
@@ -44,22 +44,22 @@ THREE.DotScreenShader = {
 
 		"float pattern() {",
 
-			"float s = sin( angle ), c = cos( angle );",
+		"	float s = sin( angle ), c = cos( angle );",
 
-			"vec2 tex = vUv * tSize - center;",
-			"vec2 point = vec2( c * tex.x - s * tex.y, s * tex.x + c * tex.y ) * scale;",
+		"	vec2 tex = vUv * tSize - center;",
+		"	vec2 point = vec2( c * tex.x - s * tex.y, s * tex.x + c * tex.y ) * scale;",
 
-			"return ( sin( point.x ) * sin( point.y ) ) * 4.0;",
+		"	return ( sin( point.x ) * sin( point.y ) ) * 4.0;",
 
 		"}",
 
 		"void main() {",
 
-			"vec4 color = texture2D( tDiffuse, vUv );",
+		"	vec4 color = texture2D( tDiffuse, vUv );",
 
-			"float average = ( color.r + color.g + color.b ) / 3.0;",
+		"	float average = ( color.r + color.g + color.b ) / 3.0;",
 
-			"gl_FragColor = vec4( vec3( average * 10.0 - 5.0 + pattern() ), color.a );",
+		"	gl_FragColor = vec4( vec3( average * 10.0 - 5.0 + pattern() ), color.a );",
 
 		"}"
 

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

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

+ 28 - 28
examples/js/shaders/FocusShader.js

@@ -24,8 +24,8 @@ THREE.FocusShader = {
 
 		"void main() {",
 
-			"vUv = uv;",
-			"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+		"	vUv = uv;",
+		"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
 
 		"}"
 
@@ -44,45 +44,45 @@ THREE.FocusShader = {
 
 		"void main() {",
 
-			"vec4 color, org, tmp, add;",
-			"float sample_dist, f;",
-			"vec2 vin;",
-			"vec2 uv = vUv;",
+		"	vec4 color, org, tmp, add;",
+		"	float sample_dist, f;",
+		"	vec2 vin;",
+		"	vec2 uv = vUv;",
 
-			"add = color = org = texture2D( tDiffuse, uv );",
+		"	add = color = org = texture2D( tDiffuse, uv );",
 
-			"vin = ( uv - vec2( 0.5 ) ) * vec2( 1.4 );",
-			"sample_dist = dot( vin, vin ) * 2.0;",
+		"	vin = ( uv - vec2( 0.5 ) ) * vec2( 1.4 );",
+		"	sample_dist = dot( vin, vin ) * 2.0;",
 
-			"f = ( waveFactor * 100.0 + sample_dist ) * sampleDistance * 4.0;",
+		"	f = ( waveFactor * 100.0 + sample_dist ) * sampleDistance * 4.0;",
 
-			"vec2 sampleSize = vec2(  1.0 / screenWidth, 1.0 / screenHeight ) * vec2( f );",
+		"	vec2 sampleSize = vec2(  1.0 / screenWidth, 1.0 / screenHeight ) * vec2( f );",
 
-			"add += tmp = texture2D( tDiffuse, uv + vec2( 0.111964, 0.993712 ) * sampleSize );",
-			"if( tmp.b < color.b ) color = tmp;",
+		"	add += tmp = texture2D( tDiffuse, uv + vec2( 0.111964, 0.993712 ) * sampleSize );",
+		"	if( tmp.b < color.b ) color = tmp;",
 
-			"add += tmp = texture2D( tDiffuse, uv + vec2( 0.846724, 0.532032 ) * sampleSize );",
-			"if( tmp.b < color.b ) color = tmp;",
+		"	add += tmp = texture2D( tDiffuse, uv + vec2( 0.846724, 0.532032 ) * sampleSize );",
+		"	if( tmp.b < color.b ) color = tmp;",
 
-			"add += tmp = texture2D( tDiffuse, uv + vec2( 0.943883, -0.330279 ) * sampleSize );",
-			"if( tmp.b < color.b ) color = tmp;",
+		"	add += tmp = texture2D( tDiffuse, uv + vec2( 0.943883, -0.330279 ) * sampleSize );",
+		"	if( tmp.b < color.b ) color = tmp;",
 
-			"add += tmp = texture2D( tDiffuse, uv + vec2( 0.330279, -0.943883 ) * sampleSize );",
-			"if( tmp.b < color.b ) color = tmp;",
+		"	add += tmp = texture2D( tDiffuse, uv + vec2( 0.330279, -0.943883 ) * sampleSize );",
+		"	if( tmp.b < color.b ) color = tmp;",
 
-			"add += tmp = texture2D( tDiffuse, uv + vec2( -0.532032, -0.846724 ) * sampleSize );",
-			"if( tmp.b < color.b ) color = tmp;",
+		"	add += tmp = texture2D( tDiffuse, uv + vec2( -0.532032, -0.846724 ) * sampleSize );",
+		"	if( tmp.b < color.b ) color = tmp;",
 
-			"add += tmp = texture2D( tDiffuse, uv + vec2( -0.993712, -0.111964 ) * sampleSize );",
-			"if( tmp.b < color.b ) color = tmp;",
+		"	add += tmp = texture2D( tDiffuse, uv + vec2( -0.993712, -0.111964 ) * sampleSize );",
+		"	if( tmp.b < color.b ) color = tmp;",
 
-			"add += tmp = texture2D( tDiffuse, uv + vec2( -0.707107, 0.707107 ) * sampleSize );",
-			"if( tmp.b < color.b ) color = tmp;",
+		"	add += tmp = texture2D( tDiffuse, uv + vec2( -0.707107, 0.707107 ) * sampleSize );",
+		"	if( tmp.b < color.b ) color = tmp;",
 
-			"color = color * vec4( 2.0 ) - ( add / vec4( 8.0 ) );",
-			"color = color + ( add / vec4( 8.0 ) - color ) * ( vec4( 1.0 ) - vec4( sample_dist * 0.5 ) );",
+		"	color = color * vec4( 2.0 ) - ( add / vec4( 8.0 ) );",
+		"	color = color + ( add / vec4( 8.0 ) - color ) * ( vec4( 1.0 ) - vec4( sample_dist * 0.5 ) );",
 
-			"gl_FragColor = vec4( color.rgb * color.rgb * vec3( 0.95 ) + color.rgb, 1.0 );",
+		"	gl_FragColor = vec4( color.rgb * color.rgb * vec3( 0.95 ) + color.rgb, 1.0 );",
 
 		"}"
 

+ 34 - 34
examples/js/shaders/FreiChenShader.js

@@ -21,8 +21,8 @@ THREE.FreiChenShader = {
 
 		"void main() {",
 
-			"vUv = uv;",
-			"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
+		"	vUv = uv;",
+		"	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
 
 		"}"
 
@@ -55,38 +55,38 @@ THREE.FreiChenShader = {
 		"void main(void)",
 		"{",
 
-			"G[0] = g0,",
-			"G[1] = g1,",
-			"G[2] = g2,",
-			"G[3] = g3,",
-			"G[4] = g4,",
-			"G[5] = g5,",
-			"G[6] = g6,",
-			"G[7] = g7,",
-			"G[8] = g8;",
-
-			"mat3 I;",
-			"float cnv[9];",
-			"vec3 sample;",
-
-			/* fetch the 3x3 neighbourhood and use the RGB vector's length as intensity value */
-			"for (float i=0.0; i<3.0; i++) {",
-				"for (float j=0.0; j<3.0; j++) {",
-					"sample = texture2D(tDiffuse, vUv + texel * vec2(i-1.0,j-1.0) ).rgb;",
-					"I[int(i)][int(j)] = length(sample);",
-				"}",
-			"}",
-
-			/* calculate the convolution values for all the masks */
-			"for (int i=0; i<9; i++) {",
-				"float dp3 = dot(G[i][0], I[0]) + dot(G[i][1], I[1]) + dot(G[i][2], I[2]);",
-				"cnv[i] = dp3 * dp3;",
-			"}",
-
-			"float M = (cnv[0] + cnv[1]) + (cnv[2] + cnv[3]);",
-			"float S = (cnv[4] + cnv[5]) + (cnv[6] + cnv[7]) + (cnv[8] + M);",
-
-			"gl_FragColor = vec4(vec3(sqrt(M/S)), 1.0);",
+		"	G[0] = g0,",
+		"	G[1] = g1,",
+		"	G[2] = g2,",
+		"	G[3] = g3,",
+		"	G[4] = g4,",
+		"	G[5] = g5,",
+		"	G[6] = g6,",
+		"	G[7] = g7,",
+		"	G[8] = g8;",
+
+		"	mat3 I;",
+		"	float cnv[9];",
+		"	vec3 sample;",
+
+		/* fetch the 3x3 neighbourhood and use the RGB vector's length as intensity value */
+		"	for (float i=0.0; i<3.0; i++) {",
+		"		for (float j=0.0; j<3.0; j++) {",
+		"			sample = texture2D(tDiffuse, vUv + texel * vec2(i-1.0,j-1.0) ).rgb;",
+		"			I[int(i)][int(j)] = length(sample);",
+		"		}",
+		"	}",
+
+		/* calculate the convolution values for all the masks */
+		"	for (int i=0; i<9; i++) {",
+		"		float dp3 = dot(G[i][0], I[0]) + dot(G[i][1], I[1]) + dot(G[i][2], I[2]);",
+		"		cnv[i] = dp3 * dp3;",
+		"	}",
+
+		"	float M = (cnv[0] + cnv[1]) + (cnv[2] + cnv[3]);",
+		"	float S = (cnv[4] + cnv[5]) + (cnv[6] + cnv[7]) + (cnv[8] + M);",
+
+		"	gl_FragColor = vec4(vec3(sqrt(M/S)), 1.0);",
 		"}"
 
 	].join( "\n" )