Built-in Render Pipeline API
The Built-in Render Pipeline integration attaches HTrace AO directly to a Camera. Settings come from the profile assigned to IPGames.HTraceAO.Runtime.BIRP.HTraceAO.
Public Types
| Type | Namespace | Description |
|---|---|---|
HTraceAO | IPGames.HTraceAO.Runtime.BIRP | Camera component that creates and executes the Built-in Render Pipeline AO command buffers. |
HTraceAOMotionVector | IPGames.HTraceAO.Runtime.BIRP.Services.MotionVectorService | Registers renderers under a moving object with HTrace's motion-vector service. |
HTraceAO
public class HTraceAO : MonoBehaviourAttach the component to the camera that renders HTrace AO. The component reads its camera with GetComponent<Camera>(); placing it on another object is unsupported.
The profile field is serialized but private. Assign it in the Inspector.
In a player build, the Built-in Render Pipeline component does not create a missing profile. An unconfigured component added at runtime has no valid settings source. Author the component and profile in the scene or prefab before building.
Changing Settings
using IPGames.HTraceAO.Runtime.Data.Public;
using IPGames.HTraceAO.Runtime.Globals;
using UnityEngine;
using HTraceAOComponent = IPGames.HTraceAO.Runtime.BIRP.HTraceAO;
public sealed class BuiltInAmbientOcclusionController : MonoBehaviour
{
[SerializeField] private HTraceAOComponent HTrace;
public void SetEnabled(bool Enabled)
{
HTrace.enabled = Enabled;
}
public void SetGTAO(float Intensity)
{
var Profile = HTraceAOSettings.ActiveProfile;
if (Profile == null)
return;
Profile.GeneralSettings.AmbientOcclusionMode = AmbientOcclusionMode.GTAO;
Profile.GeneralSettings.Intensity = Intensity;
Profile.GTAOSettings.Resolution = GTAOResolutionMode.Half;
Profile.GTAOSettings.SliceCount = 2;
Profile.GTAOSettings.StepCount = 16;
Profile.GTAOSettings.Denoising = GTAODenoisingMode.SpatioTemporal;
}
}Disabling the component removes its command buffers and services, but the global ActiveProfile reference is not cleared. Check the component's isActiveAndEnabled state when you need to know whether the effect is running.
Available Functionality
- SSAO and GTAO are the supported AO modes in the Built-in Render Pipeline integration.
- RTAO is filtered out of the Built-in Render Pipeline Inspector. Do not select
AmbientOcclusionMode.RTAOthrough code merely because the common enum andRTAOSettingsclass are present. - URP-only
InjectionPointandReconstructNormalsmembers are not available. - There is no HTrace Volume workflow in the Built-in Render Pipeline.
- Reflection, preview, and orthographic cameras are skipped by the current Built-in Render Pipeline render path.
HTraceAOMotionVector
public class HTraceAOMotionVector : MonoBehaviourAdd this component to the root of an object whose child renderers need HTrace motion-vector tracking. When enabled, it registers all child Renderer components. It unregisters them when disabled or destroyed and rebuilds the registration when the transform's children change.
The component has no public methods or fields. Its API is its Unity component lifecycle.
using IPGames.HTraceAO.Runtime.BIRP.Services.MotionVectorService;
using UnityEngine;
public sealed class RegisterHTraceMotion : MonoBehaviour
{
private void Awake()
{
if (GetComponent<HTraceAOMotionVector>() == null)
gameObject.AddComponent<HTraceAOMotionVector>();
}
}Register the highest practical object root rather than adding the component to every child renderer. If the object hierarchy changes, the component automatically refreshes the renderer list.