You can use the backdrop-filter USS property to apply filter effects to the area behind a visual element. Unlike the filter property, which processes the element and its children, backdrop-filter processes what’s rendered behind the element. This is useful for effects such as frosted-glass panels, where the content behind a panel appears blurred. The backdrop-filter property is similar to the CSS backdrop-filter property.
When an element has a backdrop filter, UI Toolkit captures the content already rendered behind the element, applies the filter functions to it, and draws the result under the element. The result is clipped to the element’s shape, including its rounded corners. The captured content includes other visual elements rendered behind the element and, for runtime panels that render as a screen overlay, the camera output behind the UI.
The element’s own background, border, and content render on top of the filtered backdrop and aren’t affected by the filter. To keep the filtered backdrop visible, use a transparent or semi-transparent background color for the element.
Important: The Universal Render Pipeline (URP) is the only render pipeline that supports backdrop filters. In the Built-In Render Pipeline and the High Definition Render Pipeline (HDRP), UI Toolkit ignores the property.
The backdrop-filter property supports the same built-in filter functions as the filter property:
backdrop-filter: blur(<length>) | grayscale(<number>) | invert(<number>) | opacity(<number>) | sepia(<number>) | tint(<color>) | hue-rotate(<angle>) | contrast(<number>) | drop-shadow(<offset-x> <offset-y> <blur-radius> <color>)
You can combine multiple filter functions in a single backdrop-filter declaration. Filters work as a sequential pipeline where each pass processes the output from the previous pass.
The backdrop-filter property also supports custom filters. Use the same filter function that you use with the filter property, and reference the path to the custom filter asset:
.custom-backdrop {
backdrop-filter: filter("/Assets/Filters/CustomFilter.asset" 10px);
}
You can apply backdrop filters to visual elements in UI Builder, USS, or C# code.
To apply a backdrop filter to a visual element in UI Builder:
To apply a backdrop filter to a visual element, use the backdrop-filter property in a USS file. The following example creates a frosted-glass panel that blurs the content behind it:
.frosted-panel {
backdrop-filter: blur(10px);
background-color: rgba(255, 255, 255, 0.2);
border-radius: 15px;
}
To combine multiple filter functions, list them in the same declaration:
.frosted-panel-desaturated {
backdrop-filter: blur(10px) grayscale(50%);
}
If multiple classes each define a backdrop-filter and you apply them to the same element, the filter applied last takes precedence over the earlier ones instead of combining the effects. For more information, refer to Selector precedence.
To apply backdrop filters to a visual element in C# code, create a list of FilterFunction objects and assign it to the visual element’s style.backdropFilter property. For example:
// Create a blur filter using the built-in blur filter function.
var blur = new FilterFunction(FilterFunctionType.Blur);
blur.AddParameter(new FilterParameter(10.0f));
// Apply the blur to the area behind the element.
element.style.backdropFilter = new List<FilterFunction> { blur };
To apply a custom filter, create the FilterFunction from a FilterFunctionDefinition asset and add the parameters that the filter expects:
// Create a filter function from a custom filter function definition.
var swirl = new FilterFunction(functionDef);
swirl.AddParameter(new FilterParameter(58.9f)); // Angle
swirl.AddParameter(new FilterParameter(2.3f)); // Radius
// Apply the swirl to the area behind the element.
element.style.backdropFilter = new List<FilterFunction> { swirl };
The backdrop-filter property has the following limitations:
backdrop-filter.