diff --git a/.github/workflows/codeql-code-scanning.yml b/.github/workflows/codeql-code-scanning.yml index 8b89c07bfa1311..89413aac676ec4 100644 --- a/.github/workflows/codeql-code-scanning.yml +++ b/.github/workflows/codeql-code-scanning.yml @@ -30,16 +30,16 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@38697555549f1db7851b81482ff19f1fa5c4fedc # v4 + uses: github/codeql-action/init@c10b8064de6f491fea524254123dbe5e09572f13 # v4 with: languages: ${{ matrix.language }} config-file: ./.github/codeql-config.yml queries: security-and-quality - name: Autobuild - uses: github/codeql-action/autobuild@38697555549f1db7851b81482ff19f1fa5c4fedc # v4 + uses: github/codeql-action/autobuild@c10b8064de6f491fea524254123dbe5e09572f13 # v4 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@38697555549f1db7851b81482ff19f1fa5c4fedc # v4 + uses: github/codeql-action/analyze@c10b8064de6f491fea524254123dbe5e09572f13 # v4 with: category: "/language:${{matrix.language}}" diff --git a/package-lock.json b/package-lock.json index 442cf5855de149..f7b71cad5d149f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1818,9 +1818,9 @@ } }, "node_modules/eslint-plugin-jsdoc": { - "version": "62.8.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-62.8.0.tgz", - "integrity": "sha512-hu3r9/6JBmPG6wTcqtYzgZAnjEG2eqRUATfkFscokESg1VDxZM21ZaMire0KjeMwfj+SXvgB4Rvh5LBuesj92w==", + "version": "62.8.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-62.8.1.tgz", + "integrity": "sha512-e9358PdHgvcMF98foNd3L7hVCw70Lt+YcSL7JzlJebB8eT5oRJtW6bHMQKoAwJtw6q0q0w/fRIr2kwnHdFDI6A==", "dev": true, "license": "BSD-3-Clause", "dependencies": { diff --git a/src/nodes/lighting/ShadowNode.js b/src/nodes/lighting/ShadowNode.js index 1564f372a7d668..19578e04d92700 100644 --- a/src/nodes/lighting/ShadowNode.js +++ b/src/nodes/lighting/ShadowNode.js @@ -1,5 +1,5 @@ import ShadowBaseNode, { shadowPositionWorld } from './ShadowBaseNode.js'; -import { float, vec2, vec3, int, Fn } from '../tsl/TSLBase.js'; +import { float, vec2, vec3, vec4, int, Fn } from '../tsl/TSLBase.js'; import { reference } from '../accessors/ReferenceNode.js'; import { texture, textureLoad } from '../accessors/TextureNode.js'; import { cubeTexture } from '../accessors/CubeTextureNode.js'; @@ -21,6 +21,8 @@ import { getShadowMaterial, disposeShadowMaterial, BasicShadowFilter, PCFShadowF import ChainMap from '../../renderers/common/ChainMap.js'; import { textureSize } from '../accessors/TextureSizeNode.js'; import { uv } from '../accessors/UV.js'; +import { positionLocal } from '../accessors/Position.js'; +import { uniform } from '../core/UniformNode.js'; // @@ -506,7 +508,27 @@ class ShadowNode extends ShadowBaseNode { const shadowIntensity = reference( 'intensity', 'float', shadow ).setGroup( renderGroup ); const normalBias = reference( 'normalBias', 'float', shadow ).setGroup( renderGroup ); - const shadowPosition = lightShadowMatrix( light ).mul( shadowPositionWorld.add( normalWorld.mul( normalBias ) ) ); + const shadowMatrix = lightShadowMatrix( light ); + const shadowNormalBias = normalWorld.mul( normalBias ); + + let shadowPosition; + + if ( ! renderer.highPrecision || builder.material.receivedShadowPositionNode || builder.context.shadowPositionWorld ) { + + shadowPosition = shadowMatrix.mul( shadowPositionWorld.add( shadowNormalBias ) ); + + } else { + + const highpShadowModelMatrix = uniform( 'mat4' ).onObjectUpdate( ( { object }, self ) => { + + return self.value.multiplyMatrices( shadowMatrix.value, object.matrixWorld ); + + } ); + + shadowPosition = highpShadowModelMatrix.mul( positionLocal ).add( shadowMatrix.mul( vec4( shadowNormalBias, 0 ) ) ); + + } + const shadowCoord = this.setupShadowCoord( builder, shadowPosition ); //