Browse Source

Cascade shadow map : Fix math with FOV

TothBenoit 1 year ago
parent
commit
d505e21a61
1 changed files with 1 additions and 1 deletions
  1. 1 1
      h3d/pass/CascadeShadowMap.hx

+ 1 - 1
h3d/pass/CascadeShadowMap.hx

@@ -66,7 +66,7 @@ class CascadeShadowMap extends DirShadowMap {
 
 
 	public function calcCascadeMatrices() {
 	public function calcCascadeMatrices() {
 		var invCamera = ctx.camera.getInverseView();
 		var invCamera = ctx.camera.getInverseView();
-		var invG = hxd.Math.tan(ctx.camera.fovY / 2.0);
+		var invG = hxd.Math.tan(hxd.Math.degToRad( ctx.camera.fovY ) / 2.0);
 		var sInvG = ctx.camera.screenRatio * invG;
 		var sInvG = ctx.camera.screenRatio * invG;
 		var invLight = lightCamera.getInverseView();
 		var invLight = lightCamera.getInverseView();