David `Deltakosh` Catuhe 5 年之前
父节点
当前提交
64bb21c736
共有 3 个文件被更改,包括 12 次插入15 次删除
  1. 6 15
      src/Lights/spotLight.ts
  2. 二进制
      tests/validation/ReferenceImages/advancedShadows2.png
  3. 6 0
      tests/validation/config.json

+ 6 - 15
src/Lights/spotLight.ts

@@ -383,21 +383,12 @@ export class SpotLight extends ShadowLight {
             normalizeDirection = Vector3.Normalize(this.direction);
         }
 
-        if (this.getScene().useRightHandedSystem) {
-            this._uniformBuffer.updateFloat4("vLightDirection",
-                -normalizeDirection.x,
-                -normalizeDirection.y,
-                -normalizeDirection.z,
-                this._cosHalfAngle,
-                lightIndex);
-        } else {
-            this._uniformBuffer.updateFloat4("vLightDirection",
-                normalizeDirection.x,
-                normalizeDirection.y,
-                normalizeDirection.z,
-                this._cosHalfAngle,
-                lightIndex);
-        }
+        this._uniformBuffer.updateFloat4("vLightDirection",
+            normalizeDirection.x,
+            normalizeDirection.y,
+            normalizeDirection.z,
+            this._cosHalfAngle,
+            lightIndex);
 
         this._uniformBuffer.updateFloat4("vLightFalloff",
             this.range,

二进制
tests/validation/ReferenceImages/advancedShadows2.png


+ 6 - 0
tests/validation/config.json

@@ -367,6 +367,12 @@
             "referenceImage": "advancedShadows.png"
         },
         {
+            "title": "Advanced shadows (right handed)",
+            "renderCount": 20,
+            "playgroundId": "#B48X7G#32",
+            "referenceImage": "advancedShadows2.png"
+        },
+        {
             "title": "point light shadows",
             "playgroundId": "#XDNVAY#1",
             "referenceImage": "pointLightShadows.png"