-
Notifications
You must be signed in to change notification settings - Fork 855
[HDRP] Light anchor fixes #5238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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. HDRP SRP Core 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. |
com.unity.render-pipelines.core/Editor/Lighting/LightAnchorEditor.cs
Outdated
Show resolved
Hide resolved
…tor.cs Co-authored-by: Remi Slysz <40034005+RSlysz@users.noreply.github.com>
…hor position override field
…logies/Graphics into hd/fix/light-anchor
Test status: Done I have tested all the parameters using a simple scene where I used spheres for anchor points. Then switched to lights (area and spot) and tried to light Adam to mimic the main use case in real projects. No major issues found only this once ux concern, if its valid. Concerns:
There is a workaround for this, you can create an empty game object and place it where you want the light to look at(for example as child of Adams head). But I dont know what is more common, to focus on Pivot or create these dummy objects to workaround the issue. Screen.Recording.2021-08-30.at.15.56.55.mov |
I would suggest we also add an new "Position offset" under "Anchor Position Override" (indented), for all cases where the pivot of the "Anchor Position Override" is not exactly where it should logically be. For instance, sometimes that pivot of a character is at the heal of the character, but the light should rather orbit the head. So with a Y-offset of roughly 1.6m, the light will be orbiting the right bit of the character. |
Another issue, related to very high distances: it creates a "pivot drift", which does not happen with a custom anchor position override btw. 2021-08-31_17-56-45.mp4 |
Another potential improvement: Can we get the list of all the bones from a gameobject, and let the user pick a bone from this list? Basically, if I pick an "Anchor Position Override" that has bones, we then display a drop down list of all bones attached to it and let the user pick a given bone transform. See here how to get the list: |
So we'll move forward and merge the PR as it is now and do further improvement in a second PR (This PR is already too old :) ) |
Purpose of this PR
https://fogbugz.unity3d.com/f/cases/1345509/
Note that if the anchor position override is not null, the light anchor transform will be updated each time the target transform updates.
Testing status
tested that the light anchor distance works correctly +
distance
andUp direction
handle correctly prefabs.LightAnchor.mp4
LightAnchor2.mp4
Note that there is an issue with Light Anchor prefabs when the distance is reverted, the transform of the gameobject is not updated using the reverted distance value (I'm not sure if we can fix that looking at how the component works currently)
The light angle is now adjusted with the camera position instead of rotation to correct the perspective
LightAnchor4.mp4
https://yamato.cds.internal.unity3d.com/jobs/902-Graphics/tree/hd%252Ffix%252Flight-anchor/.yamato%252Fall-hdrp.yml%2523PR_HDRP_trunk/8484994/job