Browse Source

Examples: `webgpu_shadertoy` and `webgpu_tsl_*` screenshots (#27105)

* webgpu_shadertoy screenshot

* cleanup

* add fallback if available

* add ignored webgpu list
sunag 1 year ago
parent
commit
c5fc9edc8c

BIN
examples/screenshots/webgpu_shadertoy.jpg


BIN
examples/screenshots/webgpu_tsl_editor.jpg


BIN
examples/screenshots/webgpu_tsl_transpiler.jpg


+ 1 - 1
examples/webgpu_sprites.html

@@ -45,7 +45,7 @@
 
 				if ( WebGPU.isAvailable() === false && WebGL.isWebGL2Available() === false ) {
 
-				document.body.appendChild( WebGPU.getErrorMessage() );
+					document.body.appendChild( WebGPU.getErrorMessage() );
 
 					throw new Error( 'No WebGPU or WebGL2 support' );
 

+ 4 - 2
examples/webgpu_tsl_editor.html

@@ -54,6 +54,8 @@
 			import * as Nodes 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';
 			import WGSLNodeBuilder from 'three/addons/renderers/webgpu/nodes/WGSLNodeBuilder.js';
 			import GLSLNodeBuilder from 'three/addons/renderers/webgl/nodes/GLSLNodeBuilder.js';
@@ -65,11 +67,11 @@
 
 			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' );
 
 				}
 

+ 5 - 3
test/e2e/puppeteer.js

@@ -122,11 +122,13 @@ const exceptionList = [
 	'webgpu_materials',
 	'webgpu_materials_video',
 	'webgpu_sandbox',
-	'webgpu_shadertoy',
 	'webgpu_sprites',
+	'webgpu_video_panorama',
+
+	// WebGPURenderer: Unknown problem
+	'webgpu_shadertoy',
 	'webgpu_tsl_editor',
-	'webgpu_tsl_transpiler',
-	'webgpu_video_panorama'
+	'webgpu_tsl_transpiler'
 
 ];