Skip to content
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

APV touchup volumes #7017

Merged
merged 20 commits into from Feb 10, 2022
Merged

APV touchup volumes #7017

merged 20 commits into from Feb 10, 2022

Conversation

FrancescoC-unity
Copy link
Contributor

An addition for the validity-based occlusion system. This will allow to:

  • Force probes in area as invalid --> not considered when doing occlusion weights computation.
  • Custom dilation threshold per region.

Also moves all the computations for the occlusion weight mask at bake time vs runtime.

These can essentially be thought as a way to artificially inflate the size of thin walls.

It restore validity when invalidation via touchup volume was not necessary (i.e. no occluders in the interpolation grid).

Not entirely finished feature, but want to open a PR before SRP2Core.

Before: Notice the leak where the ceiling is super thin and therefore probes are not marked up as invalid and occlusion weigh
ting is not possible

Unity_n7QGfUzbrp

After: A touchup volume is placed and the issue goes away as we force the probes to be invalid even if not inside actual geoemetry.
Unity_tYZYXUGrwb
Unity_Qdm4HE3LGQ

@github-actions
Copy link

github-actions bot commented Feb 7, 2022

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

SRP Core
You could run ABV on your branch before merging your PR, but it will start A LOT of jobs. Please be responsible about it and run it only when you feel the PR is ready:
/jobDefinition/.yamato%252F_abv.yml%2523all_project_ci_trunk
Be aware that any modifications to the Core package impacts everyone in the Graphics repo so please discuss the PR with your lead.

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.

@github-actions github-actions bot added the SRP label Feb 7, 2022
@github-actions
Copy link

github-actions bot commented Feb 7, 2022

It appears that you made a non-draft PR!
Please convert your PR to draft (button on the right side of the page).
See the PR template for more information.
Thank you!

var touchupBound = touchup.Item1;
var touchupVolume = touchup.Item2;

if (touchupBound.Contains(cell.probePositions[i]))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we expect a lot of touchup volumes? If so, this could get slow I suppose (a bit like the deduplication that takes forever).
Shouldn't we do this outside of the loop and first do a pass to do TouchUpVolume/Cell collision then do the proper TouchUp/Probe tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't expect a large amount of them, but yeah we could at the very prune the list before at cell granularity.

The deduplication is operating on a few order of magnitude difference I- the loop over position is there anyhow, here we just check against a few bounds.

@FrancescoC-unity FrancescoC-unity requested a review from a team February 8, 2022 09:55
Copy link
Contributor

@iM0ve iM0ve left a comment

Choose a reason for hiding this comment

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

Test status: In progress

What's tested:
This was only a quick test as the feature is still in development and needs to land before migration. Some issues/feature requests were noted below but they are not major and can follow in future PRS.

While testing I used 2 projects, HDRP template - only rebaked to check if any unwanted changes occur and ClassRoom where I actually replaced blocker cubes with touchup volumes and tested the feature. In general, I didn't find any regressions and the results of the new touch-up volumes were pretty good (adding showcase below). Further testing will be required when the quality of life features land in a separate pr, also on mac and more complex scenes.

Issues:

  1. [FIXED] There is a Size parameter and Scale is not used. So you can not input numerical values instead of using gizmos
EvaI8K0n6e.mp4
  1. With the default transparency, it is very hard to see the extent of the volumes. No way to adjust it. Can be addressed in a separate PR, but logging to not forget
qB5Ukc1xwV.mp4
  1. Would be good to have a debug mode where you could see what probes are affected by touchup volumes. Same as above can be separate PR

Demo
The touch-up volumes are placed and they take effect when the Probe Volume override is enabled. The scene is lit using APV volumes.

pdpju2SOfV.mp4

DAvLk7mSbx

Unity_6vOd9aAbti

Copy link
Contributor

@iM0ve iM0ve left a comment

Choose a reason for hiding this comment

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

Updated my review

# Conflicts:
#	com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeGIBaking.cs
#	com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeReferenceVolume.cs
#	com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeVolumeAsset.cs
@FrancescoC-unity FrancescoC-unity merged commit 1b343af into master Feb 10, 2022
@FrancescoC-unity FrancescoC-unity deleted the HDRP/touchup-volumes branch February 10, 2022 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants