- Home /
Wrong depth detection in Depth of field effect
I'm using Post Processing with a depth of field effect, but he isn't working correctly in some ways. My objects in border of mountains get blurred, why its happens?
Answer by Eno-Khaon · Feb 22, 2021 at 08:07 PM
One of the most typical reasons for an object to be blurred "erroneously" like that is because its shader doesn't write to the depth buffer. This typically applies to shaders featuring any amount of transparency, in order to properly allow the objects behind them to receive their intended depth-driven effects themselves.
By extension, since you mention this is using a Post Processing depth of field effect, this means that the depth of field only has one shot at making the effect look as good as it can, since it's not being handled during any interim stage of the rendering process (i.e. before transparent objects are handled)
What this effectively means is that you can either look at changing your implementation of Depth of Field to place it in the middle of the rendering process (in other words, not as part of the Post Processing shaders), or this *could* be possible to alleviate with changes to the shaders on transparent objects, but this would likely result in unblurred background objects instead.
Yes, my shaders are using transparent surface, changing to opaque solve the blur problem, saddly I need the transparency :/ Guess I will need to implement my own effect apart of Post Processing as you said, thanks!
Your answer
Follow this Question
Related Questions
How to blur my background 2 Answers
Post Processing Depth of Field in 2D 0 Answers
[Post Processing] Depth of Field issue on Android & WebGL 1 Answer
Modify values on VolumeProfile URP. 1 Answer
Why is the Universal RP Depth of Field Focal Length value clamped between 0 and 300 in Bokeh mode? 0 Answers