Răsfoiți Sursa

Examples: Clean up. (#22739)

Michael Herzog 3 ani în urmă
părinte
comite
64c50ef84e
1 a modificat fișierele cu 4 adăugiri și 3 ștergeri
  1. 4 3
      examples/webgl_materials_texture_partialupdate.html

+ 4 - 3
examples/webgl_materials_texture_partialupdate.html

@@ -50,8 +50,8 @@
 				const width = 32;
 				const width = 32;
 				const height = 32;
 				const height = 32;
 
 
-				const data = new Uint8Array( width * height * 3 );
-				dataTexture = new THREE.DataTexture( data, width, height, THREE.RGBFormat );
+				const data = new Uint8Array( width * height * 4 );
+				dataTexture = new THREE.DataTexture( data, width, height );
 
 
 				//
 				//
 
 
@@ -117,11 +117,12 @@
 
 
 				for ( let i = 0; i < size; i ++ ) {
 				for ( let i = 0; i < size; i ++ ) {
 
 
-					const stride = i * 3;
+					const stride = i * 4;
 
 
 					data[ stride ] = r;
 					data[ stride ] = r;
 					data[ stride + 1 ] = g;
 					data[ stride + 1 ] = g;
 					data[ stride + 2 ] = b;
 					data[ stride + 2 ] = b;
+					data[ stride + 3 ] = 1;
 
 
 				}
 				}