Skip to content

Hdrp Improved Depth Of Field #965

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 13 commits into from
Jun 19, 2020
Merged

Conversation

pmavridis
Copy link
Contributor

@pmavridis pmavridis commented Jun 18, 2020

Purpose of this PR

With this PR we introduce a more accurate (physically based) DoF implementation. For now is disabled by default until all remaining issues are resolved.

Current status:
Quality: there are no halos or leaking between far/near layers anymore or any discontinuities, but (interleaved gradient) noise is introduced to hide under sampling which might look worse/noisy in some cases.
Performance: it is about 2 times faster than the "high" preset of standard DoF, but this might change as we further tweak the new algorithm.

TODO:

  • Optimizations: there was no effort to optimize the code yet.
  • There are a few alternative code paths right now, need to decide which one gives the best results.
  • Use a median filter to hide undersampling
  • Handle TAA properly (change samples per-frame, investigate flickering issues)
  • Introduce medium/low settings with reduced sample count + pre-filtered mip-maps (we don't do it for the high settings)

Testing status

I have verified that no shader warnings are introduced by deleting the Library folder.

@pmavridis pmavridis marked this pull request as ready for review June 18, 2020 13:08
@sebastienlagarde sebastienlagarde merged commit 8feddb4 into HDRP/staging Jun 19, 2020
@sebastienlagarde sebastienlagarde deleted the HDRP/improved_dof branch June 19, 2020 10:24
sebastienlagarde added a commit that referenced this pull request Jun 19, 2020
* WIP for enabling valid graphics tests with Render Graph.

Fixed a lot of gcalloc.

* Fixed more GCAlloc and added an option for a test to not be run if render graph is enabled.

* First batch of disabled tests.

* Fixed decal rendering

* Implemented ColorGrading and Uber Post (fixes a lot of small diff due to Color Grading not being 100% neutral)

* Revert "First batch of disabled tests."

This reverts commit 505924b.

* Temp "texture not bound" error fix until bloom is implemented.

* Fixed an error when using a stale invalid renderer list handle.

Reduced error message spam when encountering an execution error.

* Add some debug info to compiled passes and removed wrong refCount++ on passes.

* Added possibility to disallow pass pruning

Fixed a number of pass pruning issues.

* Small fixes

* temporarily removed pruning of passes without product

* Fixed HDRP asset for test 5009

* Implement alpha copy for post processes

* Small render graph error fix for motion vector pass.

* Disabled for render graph tests that are currently broken.

* Updated yamato with new render graph configurations

* Fixed lens distortion

* Reenabled 4021

* Added an option to ignore tests when render graph is enabled.

* Disabled for render graph tests that are currently broken.

* Reenabled 4021

* Updated yamato script to add the RenderGraph pipeline.

* Revert "Reenabled 4021"

This reverts commit 76a7c00.

* Revert "Updated yamato with new render graph configurations"

This reverts commit 7b8acc0.

* Revert "Disabled for render graph tests that are currently broken."

This reverts commit 84467f6.

* Reverted HDRP test framework files (will go to another PR)

* Revert "Fixed HDRP asset for test 5009"

This reverts commit 95952b0.

* Fixed HDRP asset for test 5009

* Adding purge of unused resources in render graph.

* Revert unrelated yml files changes due to old configuration (#714)

* Fixed an issue with not unregistering render graph debug.

Disabled test 9401 for render graph after merge conflict.

* Disabled 9800 for render graph

* Revert hdrp asset for 5009

* WIP Creation of compute buffers through render graph.

* Refactoring internal resource management to share more code (WIP)

# Conflicts:
#	com.unity.render-pipelines.core/Runtime/RenderGraph/RenderGraphResourceRegistry.cs

* Share most of the code between compute buffers and textures.

* Restored internal API for tests and fixed unit tests.

* need to switch repo

* switching repo again :-)

* Post merge fix

* Added APIs to create compute buffers through render graph.

* sync point (but it's broken :) )

* Refactor Light List build to use render graph created compute buffers.

* Small rewrite to facilitate implementing Probe Volume Light lists.

* Porting most to static fn pattern

* revert some bits of exposure (broken)

* Refactored handle to include an intermediate ResourceHandle struct (necessary to keep track of validity of the handles internally)

* Fixed light list binding for forward passes.

* Removed usless SetGlobals

* Correctly bind cluster buffers for transparent forward passes.

* Fixed light list build (wrong light count)

* Last touches

* Rename h to hlsl

* changelog

* Fixed tile/cluster debug.

* Ported coarse stencil buffer to render graph.

* revert misalignment

* Moved decal property mask buffer to render graph created buffer.

* Fixed reset size of width/height

* Fix small issue when resizing window and improve compile time for debug exposure considerably

* Revert compile time improvement... warning still there, makes no sense.

This reverts commit 8e7aca7.

* Fixed size of dbuffer property mask buffer.

* avoid warning and prevent unrolling (improve compile time)

* Added scene view camera doc

* Update TableOfContents.md

* Add test scene for transparent depth pre & post pass

As a bonus, texts are now ordered to be after post process, and I also added an arra placer utility

* Fixed unit tests

* Fixed Receive SSR transparent nullref

* Fixed terrain and axf nullref

* Updated changelog

* Hdrp Improved Depth Of Field (#965)

* Initial unoptimized physically based DoF implementation

* Minor fixes

* Fix compilation of inactive per,utations

* Add interleaved noise

* Add alpha support

* Add adaptive gather radius

* always use the old DoF for now

* take gatefit into account

* Add a couple more levels in the CoC pyramid

* Fix some inactive code paths

* Fix CoC pyramid for near field

* Rename Cycle Of Confusion to Circle Of Confusion

Co-authored-by: sebastienlagarde <sebastien@unity3d.com>

Co-authored-by: Julien Ignace <julien@unity3d.com>
Co-authored-by: Theo Penavaire <theo.penavaire@gmail.com>
Co-authored-by: FrancescoC-Unity <francescoc@unity3d.com>
Co-authored-by: Lewis Jordan <lewis.jordan@hotmail.co.uk>
Co-authored-by: Remy Maetz <remym@unity3d.com>
Co-authored-by: Antoine Lelièvre <antoinel@unity3d.com>
Co-authored-by: Pavlos Mavridis <pavlos.mavridis@unity3d.com>
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.

2 participants