Skip to content

Commit

Permalink
Fixed shadows not going past the camera at default settings
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelsakharov committed Apr 12, 2024
1 parent 53e9eef commit 9099469
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Prowl.Runtime/Components/Lights/DirectionalLight.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@ public void UpdateShadowmap()

// Compute the MVP matrix from the light's point of view
//Graphics.MatDepthProjection = Matrix4x4.CreateOrthographicOffCenter(-25, 25, -25, 25, 1, 256);
Graphics.MatDepthProjection = Matrix4x4.CreateOrthographic(shadowDistance, shadowDistance, 0, shadowDistance);
Graphics.MatDepthProjection = Matrix4x4.CreateOrthographic(shadowDistance, shadowDistance, 0, shadowDistance*2);

var forward = GameObject.transform.forward;
Graphics.MatDepthView = Matrix4x4.CreateLookToLeftHanded(-forward * 50, -forward, GameObject.transform.up);
Graphics.MatDepthView = Matrix4x4.CreateLookToLeftHanded(-forward * shadowDistance, -forward, GameObject.transform.up);

depthMVP = Matrix4x4.Identity;
depthMVP = Matrix4x4.Multiply(depthMVP, Graphics.MatDepthView);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ public class DepthOfFieldNode : RenderPassNode
public override string Title => "Depth Of Field";
public override float Width => 125;

public override int Downsample => 1;

[Input(ShowBackingValue.Never), SerializeIgnore] public RenderTexture RenderTexture;

public float FocusStrength = 150f;
Expand Down

0 comments on commit 9099469

Please sign in to comment.