Parcourir la source

More examples clean up.

Mr.doob il y a 10 ans
Parent
commit
f4c0f657ab

+ 11 - 11
examples/webgl_buffergeometry_instancing.html

@@ -70,16 +70,16 @@
 		varying vec3 vPosition;
 		varying vec4 vColor;
 
-		void main()	{
+		void main(){
 
-		vPosition = offset * max(abs(sineTime * 2.0 + 1.0), 0.5) + position;
-		vec4 orientation = normalize(mix(orientationStart, orientationEnd, sineTime));
-		vec3 vcV = cross(orientation.xyz, vPosition);
-		vPosition = vcV * (2.0 * orientation.w) + (cross(orientation.xyz, vcV) * 2.0 + vPosition);
+			vPosition = offset * max(abs(sineTime * 2.0 + 1.0), 0.5) + position;
+			vec4 orientation = normalize(mix(orientationStart, orientationEnd, sineTime));
+			vec3 vcV = cross(orientation.xyz, vPosition);
+			vPosition = vcV * (2.0 * orientation.w) + (cross(orientation.xyz, vcV) * 2.0 + vPosition);
 
-		vColor = color;
+			vColor = color;
 
-		gl_Position = projectionMatrix * modelViewMatrix * vec4( vPosition, 1.0 );
+			gl_Position = projectionMatrix * modelViewMatrix * vec4( vPosition, 1.0 );
 
 		}
 
@@ -94,12 +94,12 @@
 		varying vec3 vPosition;
 		varying vec4 vColor;
 
-		void main()	{
+		void main() {
 
-		vec4 color = vec4( vColor );
-		color.r += sin( vPosition.x * 10.0 + time ) * 0.5;
+			vec4 color = vec4( vColor );
+			color.r += sin( vPosition.x * 10.0 + time ) * 0.5;
 
-		gl_FragColor = color;
+			gl_FragColor = color;
 
 		}
 

+ 2 - 2
examples/webgl_buffergeometry_instancing_billboards.html

@@ -67,7 +67,7 @@
 		varying vec2 vUv;
 		varying vec3 vColor;
 
-		void main()	{
+		void main() {
 
 			vec4 mvPosition = modelViewMatrix * vec4( translate, 1.0 );
 
@@ -89,7 +89,7 @@
 		varying vec2 vUv;
 		varying vec3 vColor;
 
-		void main()	{
+		void main() {
 
 			vec4 diffuseColor = texture2D( map, vUv );
 			gl_FragColor = vec4( diffuseColor.xyz * vColor, diffuseColor.w );

+ 8 - 8
examples/webgl_buffergeometry_instancing_dynamic.html

@@ -66,15 +66,15 @@
 
 		varying vec2 vUv;
 
-		void main()	{
+		void main() {
 
-		vec3 vPosition = position;
-		vec3 vcV = cross(orientation.xyz, vPosition);
-		vPosition = vcV * (2.0 * orientation.w) + (cross(orientation.xyz, vcV) * 2.0 + vPosition);
+			vec3 vPosition = position;
+			vec3 vcV = cross(orientation.xyz, vPosition);
+			vPosition = vcV * (2.0 * orientation.w) + (cross(orientation.xyz, vcV) * 2.0 + vPosition);
 
-		vUv = uv;
+			vUv = uv;
 
-		gl_Position = projectionMatrix * modelViewMatrix * vec4( offset + vPosition, 1.0 );
+			gl_Position = projectionMatrix * modelViewMatrix * vec4( offset + vPosition, 1.0 );
 
 		}
 
@@ -87,9 +87,9 @@
 
 		varying vec2 vUv;
 
-		void main()	{
+		void main() {
 
-		gl_FragColor = texture2D(map, vUv);
+			gl_FragColor = texture2D(map, vUv);
 
 		}
 

+ 8 - 8
examples/webgl_buffergeometry_instancing_interleaved_dynamic.html

@@ -66,15 +66,15 @@
 
 		varying vec2 vUv;
 
-		void main()	{
+		void main() {
 
-		vec3 vPosition = position;
-		vec3 vcV = cross(orientation.xyz, vPosition);
-		vPosition = vcV * (2.0 * orientation.w) + (cross(orientation.xyz, vcV) * 2.0 + vPosition);
+			vec3 vPosition = position;
+			vec3 vcV = cross(orientation.xyz, vPosition);
+			vPosition = vcV * (2.0 * orientation.w) + (cross(orientation.xyz, vcV) * 2.0 + vPosition);
 
-		vUv = uv;
+			vUv = uv;
 
-		gl_Position = projectionMatrix * modelViewMatrix * vec4( offset + vPosition, 1.0 );
+			gl_Position = projectionMatrix * modelViewMatrix * vec4( offset + vPosition, 1.0 );
 
 		}
 
@@ -87,9 +87,9 @@
 
 		varying vec2 vUv;
 
-		void main()	{
+		void main() {
 
-		gl_FragColor = texture2D(map, vUv);
+			gl_FragColor = texture2D(map, vUv);
 
 		}