Skip to content

Commit 17645e1

Browse files
author
aardgoose
committed
update examples
1 parent 94c0934 commit 17645e1

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

examples/webgpu_depth_texture.html

+4-2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
import { texture, MeshBasicNodeMaterial } from 'three/nodes';
3030

3131
import WebGPU from 'three/addons/capabilities/WebGPU.js';
32+
import WebGL from 'three/addons/capabilities/WebGL.js';
33+
3234
import WebGPURenderer from 'three/addons/renderers/webgpu/WebGPURenderer.js';
3335

3436
import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
@@ -43,11 +45,11 @@
4345

4446
function init() {
4547

46-
if ( WebGPU.isAvailable() === false ) {
48+
if ( WebGPU.isAvailable() === false && WebGL.isWebGL2Available() === false ) {
4749

4850
document.body.appendChild( WebGPU.getErrorMessage() );
4951

50-
throw new Error( 'No WebGPU support' );
52+
throw new Error( 'No WebGPU or WebGL2 support' );
5153

5254
}
5355

examples/webgpu_rtt.html

+4-2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
import { texture, uniform, vec2, MeshBasicNodeMaterial } from 'three/nodes';
3030

3131
import WebGPU from 'three/addons/capabilities/WebGPU.js';
32+
import WebGL from 'three/addons/capabilities/WebGL.js';
33+
3234
import WebGPURenderer from 'three/addons/renderers/webgpu/WebGPURenderer.js';
3335

3436
let camera, scene, renderer;
@@ -44,11 +46,11 @@
4446

4547
function init() {
4648

47-
if ( WebGPU.isAvailable() === false ) {
49+
if ( WebGPU.isAvailable() === false && WebGL.isWebGL2Available() === false ) {
4850

4951
document.body.appendChild( WebGPU.getErrorMessage() );
5052

51-
throw new Error( 'No WebGPU support' );
53+
throw new Error( 'No WebGPU or WebGL2 support' );
5254

5355
}
5456

0 commit comments

Comments
 (0)