One Logo Pool Ball
RealityFoundation · IOS API REFERENCE

BloomComponent

struct · iOS 27.0+ · SDK 27.1

struct BloomComponent

The `BloomComponent` adds a luminous glow effect around bright objects in the scene by extracting and blurring the brightest parts of the image, then combining them back with the original rendering. If scope is set to `unbounded` Bloom will be computed on the entire screen. If scope is set to `hierarchical` multiple Bloom Components can be used to opt in only the regions around certain objects for blooming. Bloom is available on devices with Apple7 GPU family feature support. Note: On visionOS, Bloom only works in an immersive space and will have no effect in a shared space. To adjust the appearance of the bloom effect, you also need a `BloomOptionsComponent` Example Code: ``` swift // Add the bloom component to the root and set it to unbounded. // This enables bloom in the scene with default parameters var bloomComponent = BloomComponent() bloomComponent.scope = .unbounded self.root.components.set(bloomComponent) // Add the bloom options component to the root. // Set strength 1 for a bright effect and threshold 0 so that // everything blooms no matter how dim. var bloomOptionsComponent = BloomOptionsComponent() bloomOptionsComponent.strength = 1 bloomOptionsComponent.threshold = 0 self.root.components.set(bloomOptionsComponent) ``` ## Performance and thermal state Bloom is a screen-space effect, so its cost scales with how much of the screen it touches. There are two distinct contributions to keep in mind: - **Applying the bloom** is proportional to the on-screen size of the bloomers — the bright regions that exceed the ``BloomOptionsComponent/threshold``. Larger and brighter bloomers and a larger ``BloomOptionsComponent/blurRadius`` increase this cost. - **Searching for bloom** is a separate step with a large cost that is proportional to the portion of the screen scanned for bright pixels. With ``BloomScope/unbounded`` this scans the entire screen regardless of how much of the scene actually blooms. You can shrink the searched region — and therefore this large cost — by using ``BloomScope/hierarchical`` and attaching a `BloomComponent` to the entities that should bloom. Bloom is then only searched for and applied within the screen-space bounds of those entity hierarchies. Prefer ``BloomScope/hierarchical`` whenever you know which objects bloom; reserve ``BloomScope/unbounded`` for cases where bright pixels can appear anywhere on screen. Excessive bloom may contribute to user-noticeable frame drops and can cause the device to heat up in graphically demanding scenes. Monitor the thermal state and shrink the bloom region (prefer ``BloomScope/hierarchical`` over ``BloomScope/unbounded``), lower the ``BloomOptionsComponent/blurRadius``, raise the ``BloomOptionsComponent/threshold``, or disable bloom entirely if necessary. To stay responsive to the device's available thermal headroom, read `ProcessInfo.processInfo.thermalState` and observe [`ProcessInfo.thermalStateDidChangeNotification`](https://developer.apple.com/documentation/foundation/processinfo/thermalstatedidchangenotification) to react when it changes. As the reported state moves from `.fair` toward `.serious` and `.critical`, reduce bloom's footprint.

Members (4)

init · iOS 27.0+

init

TypeScript
static initScope(scope?: BloomComponent_BloomScope): BloomComponent
Swift declaration
init(scope: BloomComponent.BloomScope = .unbounded)

Creates a BloomComponent with the specified scope. - Parameter scope: The bloom scope. Defaults to ``BloomScope/unbounded``.

get · iOS 27.0+

scope

TypeScript
get scope(): BloomComponent_BloomScope
Swift declaration
var scope: BloomComponent.BloomScope

The scope of where bloom will be computed If set to unbounded, bloom will be computed on the entire screen. If set to hierarchical, bloom will only be computed in regions near the entity hierarchy beneath all bloom components. This is useful to reduce the cost of bloom, but can create artifacts if something bright enough to bloom is not contained within the hierarchy.

set · iOS 27.0+

scope

TypeScript
set scope(value: BloomComponent_BloomScope)
Swift declaration
var scope: BloomComponent.BloomScope

The scope of where bloom will be computed If set to unbounded, bloom will be computed on the entire screen. If set to hierarchical, bloom will only be computed in regions near the entity hierarchy beneath all bloom components. This is useful to reduce the cost of bloom, but can create artifacts if something bright enough to bloom is not contained within the hierarchy.

init · iOS 27.0+

init

TypeScript
static init(): BloomComponent
Swift declaration
init()

Creates a Bloom Component. Default scope is .unbounded

Skipped declarations

No declarations were skipped in this snapshot.

All RealityFoundation types →