diff --git a/examples/jsm/tsl/display/GodraysNode.js b/examples/jsm/tsl/display/GodraysNode.js index 71f0239ac8a210..86400650b40ae2 100644 --- a/examples/jsm/tsl/display/GodraysNode.js +++ b/examples/jsm/tsl/display/GodraysNode.js @@ -1,4 +1,4 @@ -import { Frustum, Matrix4, RenderTarget, Vector2, RendererUtils, QuadMesh, TempNode, NodeMaterial, NodeUpdateType, Vector3, Plane, WebGPUCoordinateSystem } from 'three/webgpu'; +import { Frustum, Matrix4, RenderTarget, Vector2, RendererUtils, QuadMesh, TempNode, NodeMaterial, NodeUpdateType, Vector3, Plane } from 'three/webgpu'; import { cubeTexture, clamp, viewZToPerspectiveDepth, logarithmicDepthToViewZ, float, Loop, max, Fn, passTexture, uv, dot, uniformArray, If, getViewPosition, uniform, vec4, add, interleavedGradientNoise, screenCoordinate, round, mul, uint, mix, exp, vec3, distance, pow, reference, lightPosition, vec2, bool, texture, perspectiveDepthToViewZ, lightShadowMatrix } from 'three/tsl'; const _quadMesh = /*@__PURE__*/ new QuadMesh(); @@ -351,8 +351,6 @@ class GodraysNode extends TempNode { */ setup( builder ) { - const { renderer } = builder; - const uvNode = uv(); const lightPos = lightPosition( this._light ); @@ -389,15 +387,8 @@ class GodraysNode extends TempNode { const shadowPosition = lightShadowMatrix( this._light ).mul( worldPos ); const shadowCoord = shadowPosition.xyz.div( shadowPosition.w ); - let coordZ = shadowCoord.z; - - if ( renderer.coordinateSystem === WebGPUCoordinateSystem ) { - - coordZ = coordZ.mul( 2 ).sub( 1 ); // WebGPU: Conversion [ 0, 1 ] to [ - 1, 1 ] - - } - return vec3( shadowCoord.x, shadowCoord.y.oneMinus(), coordZ ); + return vec3( shadowCoord.x, shadowCoord.y.oneMinus(), shadowCoord.z ); }; diff --git a/src/renderers/webgpu/nodes/WGSLNodeBuilder.js b/src/renderers/webgpu/nodes/WGSLNodeBuilder.js index 078157a1afe587..936d0a34caf2ca 100644 --- a/src/renderers/webgpu/nodes/WGSLNodeBuilder.js +++ b/src/renderers/webgpu/nodes/WGSLNodeBuilder.js @@ -708,7 +708,7 @@ class WGSLNodeBuilder extends NodeBuilder { isUnfilterable( texture ) { return this.getComponentTypeFromTexture( texture ) !== 'float' || - ( ! this.isAvailable( 'float32Filterable' ) && texture.isDataTexture === true && texture.type === FloatType ) || + ( ! this.isAvailable( 'float32Filterable' ) && texture.type === FloatType ) || ( this.isSampleCompare( texture ) === false && texture.minFilter === NearestFilter && texture.magFilter === NearestFilter ) || this.renderer.backend.utils.getTextureSampleData( texture ).primarySamples > 1; diff --git a/src/renderers/webgpu/utils/WebGPUBindingUtils.js b/src/renderers/webgpu/utils/WebGPUBindingUtils.js index e08aeb5601e28c..2f9488d22deacc 100644 --- a/src/renderers/webgpu/utils/WebGPUBindingUtils.js +++ b/src/renderers/webgpu/utils/WebGPUBindingUtils.js @@ -520,7 +520,7 @@ class WebGPUBindingUtils { } - } else if ( binding.texture.isDataTexture || binding.texture.isDataArrayTexture || binding.texture.isData3DTexture ) { + } else if ( binding.texture.isDataTexture || binding.texture.isDataArrayTexture || binding.texture.isData3DTexture || binding.texture.isStorageTexture ) { const type = binding.texture.type;