Browse Source

Examples: Fixed webgl2 examples.

Mr.doob 5 years ago
parent
commit
b05b4b9a06

+ 5 - 7
examples/webgl2_buffergeometry_attributes_integer.html

@@ -11,7 +11,7 @@
 		<div id="container"></div>
 		<div id="info"><a href="https://threejs.org" target="_blank" rel="noopener">three.js</a> WebGL 2 - buffergeometry - integer attributes</div>
 
-		<script id="vertexShader" type="x-shader/x-vertex">#version 300 es
+		<script id="vertexShader" type="x-shader/x-vertex">
 			in int textureIndex;
 
 			flat out int vIndex; // "flat" indicates that the value will not be interpolated (required for integer attributes)
@@ -27,19 +27,17 @@
 			}
 		</script>
 
-		<script id="fragmentShader" type="x-shader/x-fragment">#version 300 es
+		<script id="fragmentShader" type="x-shader/x-fragment">
 			flat in int vIndex;
 			in vec2 vUv;
 
 			uniform sampler2D uTextures[ 3 ];
 
-			out vec4 outColor;
-
 			void main()	{
 
-				if ( vIndex == 0 ) outColor = texture( uTextures[ 0 ], vUv );
-				else if ( vIndex == 1 ) outColor = texture( uTextures[ 1 ], vUv );
-				else if ( vIndex == 2 ) outColor = texture( uTextures[ 2 ], vUv );
+				if ( vIndex == 0 ) gl_FragColor = texture( uTextures[ 0 ], vUv );
+				else if ( vIndex == 1 ) gl_FragColor = texture( uTextures[ 1 ], vUv );
+				else if ( vIndex == 2 ) gl_FragColor = texture( uTextures[ 2 ], vUv );
 
 			}
 		</script>

+ 1 - 6
examples/webgl2_materials_texture2darray.html

@@ -7,8 +7,6 @@
 		<link type="text/css" rel="stylesheet" href="main.css">
 	</head>
 	<script id="vs" type="x-shader/x-vertex">
-	#version 300 es
-
 	uniform vec2 size;
 	out vec2 vUv;
 
@@ -25,8 +23,6 @@
 	</script>
 
 	<script id="fs" type="x-shader/x-fragment">
-	#version 300 es
-
 	precision highp float;
 	precision highp int;
 	precision highp sampler2DArray;
@@ -34,14 +30,13 @@
 	uniform sampler2DArray diffuse;
 	in vec2 vUv;
 	uniform int depth;
-	out vec4 out_FragColor;
 
 	void main() {
 
 		vec4 color = texture( diffuse, vec3( vUv, depth ) );
 
 		// lighten a bit
-		out_FragColor = vec4( color.rrr * 1.5, 1.0 );
+		gl_FragColor = vec4( color.rrr * 1.5, 1.0 );
 
 	}
 	</script>