Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Logopolis · Apr 23, 2020 at 08:42 PM · renderingpost processingpost-process-effectpostprocessdepth of field

How to get quality Depth Of Field effect with Post Processing Stack V2?

When using the Post Processing Stack V2 Depth Of Field effect in my game, I'm finding that at a certain distance objects abruptly transition from no blur at all, to very heavy blur (see attached image). The blur does not increase gradually with distance from the camera as expected.

I've played with the Aperture, Focal Length and Max Blur Size settings, but haven't found a way to fix this immediate transition from no blur to heavy blur.

Has anyone else encountered this problem and found a way to get a more natural blur transition out of this effect?

(I also tried the Universal Render Pipeline's Depth of Field effect, and it doesn't have this problem -- it works beautifully. However, the URP's motion blur effect doesn't blur objects that are in motion (just camera motion), so switching to URP is not an option for my game.)

image of depth of field effect

screenshot-670-2.jpg (207.1 kB)
Comment
Add comment · Show 4
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Namey5 · Apr 25, 2020 at 07:02 AM 0
Share

I won't put this as an answer, because it is very objective, but I personally don't think you can get quality DOF with the post-processing stack's default effects. They have a really wide linear blend that looks horrible, combined with the realistic CoC calculation means that most regions will be somewhere inbetween blurred and clear. The legacy image effect's depth of field handled this really well by running two filters - one at low res, and a cheaper one at full res such that the blend was impossible to see, but those have been deprecated and cannot be accessed anymore (also probably wouldn't be compatible with the rest of the stack). I personally use my own depth of field for this exact reason, but that isn't really an option for most people as these kinds of effects are not easy to write and have very little documentation. Catlike coding has a great DOF tutorial as a starting place, but it's purpose is literally to recreate this exact effect, so you would need to modify it (mainly just reduce the range over which blending occurs);

https://catlikecoding.com/unity/tutorials/advanced-rendering/depth-of-field/

avatar image Logopolis Namey5 · Apr 28, 2020 at 08:23 PM 0
Share

@Namey5 Thanks for the info! The catlikecoding tutorial looks potentially useful. I don't suppose you would be interested in selling your custom DoF solution on the asset store?

avatar image Namey5 Logopolis · Apr 29, 2020 at 01:41 AM 0
Share

I have always planned on doing so (here's a video of it from a year ago where I say that), but it still requires a decent amount of optimisation and quality work. I'm currently in the middle of updating it and also transitioning to the post-processing stack (as that wasn't customisable when I first wrote it). I also wrote a cheap gaussian DOF a couple of weeks ago as a test effect for the stack that I would be happy to put up on github (although it only handles blur from near or far plane, not both simultaneously).

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Logopolis · May 12, 2020 at 01:57 AM

Update for anyone else having a similar problem:

After trying several alternatives I found the Beautify 2 asset (https://assetstore.unity.com/packages/vfx/shaders/fullscreen-camera-effects/beautify-2-163949). It includes a fast, high quality, mobile friendly depth of field effect (as well as a bunch of other post processing effects). I chose to turn off its default effects that amp up saturation, contrast and sharpness. It's worth the price for the depth of field effect alone.

Here's an example of a similar scene to above, but using Beautify 2's depth of field instead of the post processing V2 effect. Notice that the transition from sharp to blurry is gradual. Also note that it has the option to blur near objects as well as far objects.

alt text


screenshot-674.jpg (126.7 kB)
Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

147 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Modify values on VolumeProfile URP. 1 Answer

How to properly use RTHandles in HDRP for post effects 0 Answers

Custom post processing 0 Answers

(Unity 2019.2) Post Processing errors with Deferred Rendering Path 1 Answer

Custom URP Postprocessing 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges