|
@@ -27,6 +27,8 @@
|
|
|
import { texture, uv, userData, rangeFog, color, SpriteNodeMaterial } from 'three/nodes';
|
|
|
|
|
|
import WebGPU from 'three/addons/capabilities/WebGPU.js';
|
|
|
+ import WebGL from 'three/addons/capabilities/WebGL.js';
|
|
|
+
|
|
|
import WebGPURenderer from 'three/addons/renderers/webgpu/WebGPURenderer.js';
|
|
|
|
|
|
let camera, scene, renderer;
|
|
@@ -41,11 +43,11 @@
|
|
|
|
|
|
function init() {
|
|
|
|
|
|
- if ( WebGPU.isAvailable() === false ) {
|
|
|
+ if ( WebGPU.isAvailable() === false && WebGL.isWebGL2Available() === false ) {
|
|
|
|
|
|
- document.body.appendChild( WebGPU.getErrorMessage() );
|
|
|
+ document.body.appendChild( WebGPU.getErrorMessage() );
|
|
|
|
|
|
- throw new Error( 'No WebGPU support' );
|
|
|
+ throw new Error( 'No WebGPU or WebGL2 support' );
|
|
|
|
|
|
}
|
|
|
|