The Unlit shader must be set to Transparent. I found it in this thread on the Unity forums. This method uses the HDRP > Unlit shader on an Image component in the UI, as the caption says. Also, ensure that Distortion is enabled in the HDRenderPipelineAsset and ensure that Lens Distortion is enabled in the Camera’s Frame Settings. In newer versions, I believe it’s called Rough Distortion. * In case you’re having problems with this method, ensure Rough Refraction is enabled in your frame settings on older versions of HDRP. For “Screen Space - Camera” UI rendering mode, I’d recommend one of the other methods below (which can almost act like Overlay mode, as we’ll see). If you want UI panel blur for “Screen Space - Overlay”, this is the only easy solution I’ve found so far, but there will be a performance cost to it. I did find both of those statements to be true in my testing.
The developer pointed out that by increasing the grid sample size in the shader, you can achieve smoother blur, but at a heavy performance penalty. The HDRP devs included Custom Pass functionality as well as the new Compositor feature as alternate solutions to the old way of working.Īlso, at lower iterations, the blur looks fine, but if going for extreme blurring, higher iterations introduce rectangular artifacts in the blur. There have been questions about render texture performance in HDRP on the Unity forums. This is not the fault of the asset, but rather because HDRP currently isn’t efficient when rendering multiple cameras (as confirmed by the asset developer), and you need a second camera to output to a render texture. I found that in comparison to the other methods, there was anywhere from a 3 to 4ms higher cost per frame to this method on the CPU and GPU in an actual build at 2560x1440. The big issue for me, though, is that there is a very high performance cost to this render technique with multiple blurred panels or a very large panel.
For world space UI, this technique isn’t required (and I couldn’t get it to work with limited attempts), as we can use one of the other methods described later.
Of the three methods I’ve found, this is the only one that works in “Screen Space - Overlay” currently. This asset works in both Screen Space - Camera and Screen Space - Overlay rendering modes. It works by using another camera to render a texture, and then using that texture in a custom blur shader on a UI component. I purchased that also, and found that it does what it says. When converting my project to use HDRP, I saw that the same developer created a GaussianBlur_HDRP asset. In the new Scriptable Rendering Pipelines (SRP) in Unity, GrabPass is no longer possible, presumably because there is a high performance cost to it. When I was using the soon-to-be legacy built-in pipeline, I purchased this asset which allowed me to have UI panel blur (which also blurred other panels behind it) using GrabPass functionality. Perhaps it could be used in combination with one of the above methods for UI blur, but I haven’t tried it out yet. New! Unity HDRP devs have linked to the following GitHub repository for an example of HDRP UI Camera Stacking: This method works in Screen Space - Camera mode, can potentially have much better performance than method 4 (depending on settings), but has some issues when resizing the screen that I’m not able to resolve. Use a Custom Pass Gaussian Blur which is output to a render texture, and use the render texture on an Unlit Shader Graph material. This one works in Screen Space - Camera mode, solves the problems with method #3, but has a high performance cost. Use Method 3 but with the Graphics Compositor instead of Custom Passes. This one does not work in Screen Space - Overlay, and leads to the before-post-processed scene color being blurred in order to prevent the UI being affected by post-processing. Use Shader Graph to create an HDRP Unlit shader that uses the LOD property on the HD Scene Color node for blur, in combination with one or more Custom Passes. This one does not work in Screen Space - Overlay, won’t work in a Custom Pass, will work in the Graphics Compositor, but currently renders UI elements behind the blur. Use HDRP’s included Unlit shader with distortion enabled, on an Image component. This one works in both screen space modes, but can have a huge performance cost. Use another camera to output to a render texture, and use that render texture in a custom blur shader attached to an Image component. I’m listing it just to make others aware of it. Since I haven’t tested it out, there is no dedicated instructions for it here. Update: I added a 6th method below as I just found out about it. I’ll describe them briefly here, then dedicate entire sections with instructions for each.
There are 5 methods I’ve found (so far) on how to do a Unity UI panel blur in HDRP.