浏览代码

Rename CSM uniforms

Popov72 5 年之前
父节点
当前提交
c906302e5f
共有 2 个文件被更改,包括 5 次插入6 次删除
  1. 2 3
      src/Materials/materialHelper.ts
  2. 3 3
      src/Shaders/ShadersInclude/shadowsVertex.fx

+ 2 - 3
src/Materials/materialHelper.ts

@@ -484,9 +484,8 @@ export class MaterialHelper {
         samplersList.push("depthSampler" + lightIndex);
 
         uniformsList.push(
-            "lightMatrixCSM" + lightIndex,
-            "camViewMatCSM" + lightIndex,
-            "viewFrustumZCSM" + lightIndex,
+            "viewFrustumZ" + lightIndex,
+            "splitBlendFactor" + lightIndex,
         );
 
         if (projectedLightTexture) {

+ 3 - 3
src/Shaders/ShadersInclude/shadowsVertex.fx

@@ -1,9 +1,9 @@
 #ifdef SHADOWS
 	#if defined(SHADOWCSM{X})
-		vPositionFromCameraCSM{X} = camViewMatCSM{X} * worldPos;
+		vPositionFromCamera{X} = view * worldPos;
 		for (int i = 0; i < SHADOWCSMNUM_CASCADES{X}; i++) {
-			vPositionFromLightCSM{X}[i] = lightMatrixCSM{X}[i] * worldPos;
-			vDepthMetricCSM{X}[i] = ((vPositionFromLightCSM{X}[i].z + light{X}.depthValues.x) / (light{X}.depthValues.y));
+			vPositionFromLight{X}[i] = lightMatrix{X}[i] * worldPos;
+			vDepthMetric{X}[i] = ((vPositionFromLight{X}[i].z + light{X}.depthValues.x) / (light{X}.depthValues.y));
 		}
 	#elif defined(SHADOW{X}) && !defined(SHADOWCUBE{X})
 		vPositionFromLight{X} = lightMatrix{X} * worldPos;