|
@@ -31,6 +31,8 @@
|
|
|
import * as THREE from 'three';
|
|
|
|
|
|
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';
|
|
|
|
|
|
import IESSpotLight from 'three/addons/lights/IESSpotLight.js';
|
|
@@ -44,11 +46,11 @@
|
|
|
|
|
|
async function init() {
|
|
|
|
|
|
- if ( WebGPU.isAvailable() === false ) {
|
|
|
+ if ( WebGPU.isAvailable() === false && WebGL.isWebGL2Available() === false ) {
|
|
|
|
|
|
document.body.appendChild( WebGPU.getErrorMessage() );
|
|
|
|
|
|
- throw new Error( 'No WebGPU support' );
|
|
|
+ throw new Error( 'No WebGPU or WebGL2 support' );
|
|
|
|
|
|
}
|
|
|
|