Browse Source

Examples: More clean up. (#31696)

Michael Herzog 6 months ago
parent
commit
65104cef5a

+ 2 - 0
examples/webgpu_compute_birds.html

@@ -130,6 +130,8 @@
 				}
 
 			}
+
+			// TODO: Fix example with WebGL backend
 			
 			if ( WebGPU.isAvailable() === false ) {
 

+ 2 - 0
examples/webgpu_compute_cloth.html

@@ -68,6 +68,8 @@
 				sheenColor: 0xffffff // sRGB
 			};
 
+			// TODO: Fix example with WebGL backend
+			
 			if ( WebGPU.isAvailable() === false ) {
 
 				document.body.appendChild( WebGPU.getErrorMessage() );

+ 11 - 0
examples/webgpu_compute_water.html

@@ -37,6 +37,7 @@
 
 			import { GUI } from 'three/addons/libs/lil-gui.module.min.js';
 			import Stats from 'three/addons/libs/stats.module.js';
+			import WebGPU from 'three/addons/capabilities/WebGPU.js';
 
 			// Dimensions of simulation grid.
 			const WIDTH = 128;
@@ -81,6 +82,16 @@
 
 			const simplex = new SimplexNoise();
 
+			// TODO: Fix example with WebGL backend
+			
+			if ( WebGPU.isAvailable() === false ) {
+
+				document.body.appendChild( WebGPU.getErrorMessage() );
+
+				throw new Error( 'No WebGPU support' );
+
+			}
+
 			init();
 
 			function noise( x, y ) {

粤ICP备19079148号