Skip to guide
Rainbow Lab/Documentation

Glass Foundry

Performance

The world is rendered once. One blur pyramid per active source is reused by all of its panels. Panels use one shared source material, with their appearance stored in mesh vertices. Unity creates extra stencil materials where masks require them. Each panel is a four-vertex quad.

Include Background UI adds a background copy and a UI composition pass when there are participating graphics. UI draws are repeated into a transient full-resolution colour/stencil target, then use the existing shared blur and clear captures. It does not render the world again or create a camera per panel. Each captured UI renderer has a cached mesh and material; unchanged standard Graphic geometry is reused. Changing a Graphic, transform or fade updates its cached geometry. Disabling the option releases these cached resources on the next capture; disabling the source releases them immediately. Off, frozen and no-visible-panel paths skip the UI drawing work. More background graphics and higher capture resolutions cost more, even when many glass panels share the result.

UniText's additional renderers reuse cached capture meshes and materials. Their glyph vertices are copied at each capture because text can update those meshes without a standard Graphic dirty notification. This adds work in proportion to the captured glyph count, without adding blur passes. Frozen captures skip that work too.

The output texture persists between updates. Intermediate pyramid textures are managed by URP Render Graph. Clarity allocates one shared half-resolution RGBA16F texture on demand and adds one copy pass per capture when a visible panel requests it. A 1920 x 1080 camera needs about 4 MiB for that extra texture. The next capture releases it when unused. Intermediate Clarity values sample both clear and blurred textures; Dispersion adds two colour-separated lookups. These effects have a cost even when they share a capture. Resolution changes recreate the output; disabling the source releases both captures. Runtime code does not read pixels back to the CPU. Frozen captures and sources with no visible consumers skip blur work. Ordinary uGUI overdraw and masking still have a cost.

Fully transparent panels and empty rectangles do not request captures. For gradients, either visible colour endpoint can keep the panel active. A Tint amount of zero still captures: it means uncoloured glass, not an invisible panel. Standard Mask and RectMask2D clipping are supported; glass used as a Mask keeps its stencil materials bound to the current capture when resolution changes.

Edit mode preview retains the background until it needs refreshing. Camera movement, recorded world-object edits, lighting/environment changes and source settings request a new capture. Hovering the Inspector or resizing/restyling glass does not render the world again. Clear-capture allocation can still require one refresh when changing Clarity. Changes are coalesced at up to 10 Hz; idle sources do not submit camera renders or force view repaints. Refresh capture handles custom editor-driven background changes that do not publish change notifications. Runtime capture rate remains controlled by Updates per second. This uses an additional reusable camera target in the Editor; it is released on Play transitions, scene unload and assembly reload. This Editor-only work is excluded from player performance measurements. The Game view is the reference for the source camera's blur; the Scene view can use a different camera position and framing.

Start with Quarter, three steps and 30 Hz. Try Eighth and a lower rate on slower devices. Judge motion as well as a still image: a low capture rate can be visible when the camera moves. Profile your scene on the hardware you plan to support, especially when glass covers much of the screen or captures a large UI hierarchy.