瀏覽代碼

update compositingAlphaMode (#23827)

sunag 3 年之前
父節點
當前提交
36706f6ada
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      examples/jsm/renderers/webgpu/WebGPURenderer.js

+ 2 - 1
examples/jsm/renderers/webgpu/WebGPURenderer.js

@@ -172,7 +172,7 @@ class WebGPURenderer {
 		context.configure( {
 		context.configure( {
 			device: device,
 			device: device,
 			format: GPUTextureFormat.BGRA8Unorm, // this is the only valid context format right now (r121)
 			format: GPUTextureFormat.BGRA8Unorm, // this is the only valid context format right now (r121)
-			compositingAlphaMode: 'opaque'
+			compositingAlphaMode: 'premultiplied'
 		} );
 		} );
 
 
 		this._adapter = adapter;
 		this._adapter = adapter;
@@ -957,6 +957,7 @@ class WebGPURenderer {
 				device: device,
 				device: device,
 				format: GPUTextureFormat.BGRA8Unorm,
 				format: GPUTextureFormat.BGRA8Unorm,
 				usage: GPUTextureUsage.RENDER_ATTACHMENT,
 				usage: GPUTextureUsage.RENDER_ATTACHMENT,
+				compositingAlphaMode: 'premultiplied',
 				size: {
 				size: {
 					width: Math.floor( this._width * this._pixelRatio ),
 					width: Math.floor( this._width * this._pixelRatio ),
 					height: Math.floor( this._height * this._pixelRatio ),
 					height: Math.floor( this._height * this._pixelRatio ),