Depth of field not working properly with World Space Canvas
Hello I use a post FX v2 profile with depth of field, and a world space canvas to show messages (using Dialog System's "bark" messages), and it seems that the world space canvas is only visible and not blurred if it is in front of an object that is not blurred too. For example if objects far away are blurred due to the depth of field effect, and the world space canvas is in front of nothing else than the horizon, it is always blurred no matter how close it is of the camera. If it is in front of an object that is at the right distance of the camera, it is not blurred anymore. It can even be partly blurred, partly not.
Do you have any idea about this? I've seen posts more or less about it, but they all deal with HDRP solutions, though I'm not in HDRP in this project. Also I've tried other UI shaders for the elements of the world space canvas, but no change. Thanks!
Answer by Acrodyn · Jan 21 at 11:36 AM
Hello, @pango!
My fix is done on 2020.3.20f1 and URP 10.6.0.
First I created a new 'worldUI' layer for all world space canvases. The rest of the solution is all inside URP_Renderer asset.
1) Disabled 'worldUI' (or whatever you called the new layer) inside Transparent Layer Mask Filtering
2) Click 'Add Renderer Feature' on the bottom and add 'Render Objects (Experimental)
3) Select 'AfterRenderingPostProcessing' event and at filters select 'Transparent' Queue and your new World UI layer as Layer Mask.
That does it for me! Hope it helps someone. Cheers!
Your answer
Follow this Question
Related Questions
Canvas items using World Space, not Screen Space overlay 0 Answers
How to make an object the root of a prefab, or remove the canvas that is set as the root of a prefab 0 Answers
How to move a UI element using Mouse Position in 3D World Space? 0 Answers