Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions com.unity.render-pipelines.high-definition/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Added a button in the Probe Volume Baking window to open the Probe Volume debug panel.
- Added importance sampling of the sky in path tracing (aka environment sampling).
- Added the overlay render queue to custom passes.
- Added a callback to override the View matrix of Spot Lights.
- Added Expose SSR parameters to control speed rejection from Motion Vector including computing Motion Vector in World Space.

### Fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1979,6 +1979,12 @@ public int areaLightEmissiveMeshLayer
}
}

/// <summary> A callback allowing the creation of a new Matrix4x4 based on the lightLocalToWorld matrix </summary>
public delegate Matrix4x4 CustomViewCallback(Matrix4x4 lightLocalToWorldMatrix);

/// <summary> Change the View matrix for Spot Light </summary>
public CustomViewCallback CustomViewCallbackEvent;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add documentation for public API :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • add a changelog

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added :)


void OnDestroy()
{
if (lightIdxForCachedShadows >= 0) // If it is within the cached system we need to evict it.
Expand Down Expand Up @@ -2224,6 +2230,10 @@ internal void UpdateShadowRequestData(HDCamera hdCamera, HDShadowManager manager
out shadowRequest.view, out invViewProjection, out shadowRequest.projection,
out shadowRequest.deviceProjection, out shadowRequest.deviceProjectionYFlip, out shadowRequest.splitData
);
if (CustomViewCallbackEvent != null)
{
shadowRequest.view = CustomViewCallbackEvent(visibleLight.localToWorldMatrix);
}
break;
case HDLightType.Directional:
UpdateDirectionalShadowRequest(manager, shadowSettings, visibleLight, cullResults, viewportSize, shadowIndex, lightIndex, cameraPos, shadowRequest, out invViewProjection);
Expand Down