Core conceptsFocus proxy

Focus proxy

Make renderer-only objects hittable by PBADOF raycasts by fitting physics box colliders around their visual bounds with the AutoDepthOfFieldFocusProxy component.

What the focus proxy does

HIBIKI entertainment's AutoDepthOfFieldFocusProxy makes renderer-only objects available to PBADOF focus acquisition.

PBADOF focus acquisition uses physics raycasts to find focus targets. Some scene objects have visible renderers but no colliders, including particle systems, custom renderers, UI elements, and mesh-only objects without physics components.

The AutoDepthOfFieldFocusProxy component adds and fits a non-trigger BoxCollider around child renderers. The collider gives the autofocus raycasts a hittable surface without requiring you to add gameplay physics to the object.

Without a focus proxy, a raycast passes through a renderer-only object. The solver cannot detect the object or focus on its visual bounds.

When to use a focus proxy

Use a focus proxy for:

  • Renderer-only objects: Objects with a MeshRenderer or another renderer but no collider.
  • Particle systems: Particles that should influence the focus distance.
  • Custom renderers: Objects rendered through custom passes or decals that need to participate in focus acquisition.
  • Fitted proxies: Objects where the proxy collider should match the visual bounds, with optional padding.

The focus proxy maintains a non-trigger BoxCollider fitted to child renderers. It does not affect gameplay physics. It only provides a hittable surface for the autofocus raycasts.

Adding a focus proxy

Select the renderer-only object

Select the GameObject that has renderers but no collider.

Open the component menu

In the Inspector, click Add Component.

Add the focus proxy

Search for and add AutoDepthOfFieldFocusProxy.

Assign the visual root

Assign VisualRoot if the renderers are on child GameObjects. The component's own GameObject is used by default.

Set the padding

Set Padding to expand or contract the proxy collider relative to the visual bounds.

Fit the collider to the visuals

Click FitToVisuals in the Inspector, or call FitToVisuals() from a script, to rebuild the collider bounds.

Settings reference

SettingTypeDescription
VisualRootTransformThe root transform whose child renderers define the proxy bounds. Defaults to the component's own GameObject.
PaddingVector3Extra space added to the fitted bounds on each axis. Use it to expand the collider slightly beyond the visual edge.
ProxyColliderBoxColliderThe non-trigger BoxCollider created and managed by the proxy. Read-only.

Working with focus proxies from script

Use FitToVisuals() after creating the proxy, changing its padding, or updating the visual object.

// Get or add a focus proxy
var proxy = GetComponent<AutoDepthOfFieldFocusProxy>();
if (proxy == null)
    proxy = gameObject.AddComponent<AutoDepthOfFieldFocusProxy>();

// Fit the proxy to the current visual bounds
proxy.FitToVisuals();

// Adjust padding
proxy.Padding = new Vector3(0.1f, 0.1f, 0.1f);
proxy.FitToVisuals();

Call FitToVisuals() after any visual changes, such as animation, scaling, or mesh swapping. Re-fitting keeps the proxy aligned with the current renderer bounds.

Call FitToVisuals() whenever the visual bounds change, for example after an animation expands an object or a mesh is swapped at runtime. Stale proxy bounds can cause the solver to focus too early or too late.

Focus proxy showcase

The PBADOF showcase includes a dedicated Focus Proxy category that demonstrates renderer-only objects and fitted physics proxies side by side. Open it via Window > HIBIKI entertainment > Depth Of Field > Showcase Launcher.

See Showcases and demos for details.

Next steps

Read about Override volumes to blend focus settings across your scene, or explore the API reference for the full component interface.