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.
Declaration
struct BloomComponentOverview
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 BloomSettingsComponent
Example Code:
// 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 settings component to the root.
// Set strength 1 for a bright effect and threshold 0 so that
// everything blooms no matter how dim.
var bloomSettingsComponent = BloomSettingsComponent()
bloomSettingsComponent.strength = 1
bloomSettingsComponent.threshold = 0
self.root.components.set(bloomSettingsComponent)