-
Notifications
You must be signed in to change notification settings - Fork 850
[XR][URP] Fix issue with vignette location in XR #5471
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
a31f3bc
[XR][URP] Fix issue with vignette location in XR
maloyer-unity 118a617
Updated changelog
maloyer-unity 263cb31
Merge branch 'master' into urp/xr/fix_vignette_xr_center
maloyer-unity 348e23b
Extracted comon XRView code into ComputeEyeCenterUV & Allow more than…
maloyer-unity 9364b7d
Fix vignette movement direction for XR when whe change the vignette "…
maloyer-unity 323a155
Returning to 2 views only for XR vignette.
maloyer-unity 3b89c75
Use "Vector4.zero" instead of "new Vector4(0.0f, 0.0f, 0.0f, 0.0f)"
maloyer-unity 890ee1f
Only set v3 if we are using single pass
maloyer-unity 3c100ed
More improvements
maloyer-unity 875610e
Merge branch 'master' into urp/xr/fix_vignette_xr_center
maloyer-unity 958d05c
Adding a comment to describe what ApplyXRViewCenterOffset does
maloyer-unity 85c3375
Quick fix a comment that is not right anymore after moving the code
maloyer-unity File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Only set v3 if we are using single pass
That variable is only needed if single-pass instancing/multiview is active, so we can simplify the code to only do the asymetric FOV correction when we are in multi-pass mode.
- Loading branch information
commit 890ee1f2ece79791f96989d50fe2a0dd4db3fa3a
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe move the XR specific block into a function, easier to read than bunch of defines.
That function could even be in xrPass.
Something like
vec4 xrPass.applyXREyeOffset(vec2 center); which packs XR eye data into Vec4. Or xrPass.applyEyeOffset( ref vec2 centerAsLeft, out vec2 right);
But just moving this block to SetupVignetteXR() would be tiny bit better IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can extract a good amount of code to the XRPass class, but we still need to do some part of the work in SetupVignette() since when we are rendering in Multi-pass (each eye are rendered completely separately), the center still need to be corrected for each eyes and then placed in v2.xy since AFAIK the shader does not have a variation for "XR enabled, but not single-pass".
I'll see what I can do to reduce the amount of XR specific code in here.