浏览代码

correct initial blending state and update screenshot (#27009)

Co-authored-by: aardgoose <[email protected]>
aardgoose 1 年之前
父节点
当前提交
5ad1a2075d
共有 3 个文件被更改,包括 6 次插入4 次删除
  1. 1 1
      examples/jsm/renderers/webgl/utils/WebGLState.js
  2. 二进制
      examples/screenshots/webgpu_sprites.jpg
  3. 5 3
      examples/webgpu_sprites.html

+ 1 - 1
examples/jsm/renderers/webgl/utils/WebGLState.js

@@ -21,7 +21,7 @@ class WebGLState {
 		this.currentFlipSided = null;
 		this.currentCullFace = null;
 		this.currentProgram = null;
-		this.currentBlendingEnabled = null;
+		this.currentBlendingEnabled = false;
 		this.currentBlending = null;
 		this.currentBlendSrc = null;
 		this.currentBlendDst = null;

二进制
examples/screenshots/webgpu_sprites.jpg


+ 5 - 3
examples/webgpu_sprites.html

@@ -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' );
 
 				}