Skip to content

Conversation

YohannVaastUnity
Copy link
Contributor

@YohannVaastUnity YohannVaastUnity commented Dec 6, 2021

/!\ This PR is a draft, just a proposition for the HDRP team. /!\

Reminder of the Rotated Shadow Map technique:
https://drive.google.com/file/d/18_Px85w9-_VxRXKBoo1UnVy1OUpN1Ri_/view?usp=sharing

Here's a link to the prototype we developed. Also, this technique has been used in several Disney projects (Big Hero / Baymax) and Sherman (1 & 2), proving it's efficiency.
https://github.com/YohannVaastUnity/HDRP_RotatedShadowMap/pull/1

Here's a quick gif of the accumulation process:
RSM

Regarding the PR

- The callback is used to change the View matrix (of the Spotlight shadow request) outside of the HDRP package. In the future, it will be integrated in the Recorder package (so the Recorder package will use this callback).
- We are rotating this matrix (based on the `visibleLight.localToWorldMatrix`), applying our RSM technique.
- It's as simple as that.
- I don't know if HDRP has a norm regarding callback or anything else, explaining why this PR is a draft.

Thanks!

@github-actions
Copy link

github-actions bot commented Dec 6, 2021

Hi! This comment will help you figure out which jobs to run before merging your PR. The suggestions are dynamic based on what files you have changed.
Link to Yamato: https://unity-ci.cds.internal.unity3d.com/project/902/
Search for your PR branch using the search bar at the top, then add the following segment(s) to the end of the URL (you may need multiple tabs depending on how many packages you change)

HDRP
/jobDefinition/.yamato%2Fall-hdrp.yml%23PR_HDRP_trunk
With changes to HDRP packages, you should also run
/jobDefinition/.yamato%2Fall-lightmapping.yml%23PR_Lightmapping_trunk

Depending on the scope of your PR, you may need to run more jobs than what has been suggested. Please speak to your lead or a Graphics SDET (#devs-graphics-automation) if you are unsure.

Copy link

@clusty clusty left a comment

Choose a reason for hiding this comment

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

Looks simple enough for me

}

public delegate Matrix4x4 CustomViewCallback(Matrix4x4 lightLocalToWorldMatrix);
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 :)

@sebastienlagarde sebastienlagarde marked this pull request as ready for review December 15, 2021 20:28
@sebastienlagarde sebastienlagarde merged commit 9454325 into master Dec 16, 2021
@sebastienlagarde sebastienlagarde deleted the prototype/rotated-shadow-map-callback branch December 16, 2021 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants