|
|
@@ -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 ) {
|