Class ScriptableRendererFeature
You can add a ScriptableRendererFeature
to the ScriptableRenderer
. Use this scriptable renderer feature to inject render passes into the renderer.
Inherited Members
Namespace: UnityEngine.Rendering.Universal
Syntax
[ExcludeFromPreset]
public abstract class ScriptableRendererFeature : ScriptableObject, IDisposable
Properties
isActive
Returns the state of the ScriptableRenderFeature (true: the feature is active, false: the feature is inactive). Use the method ScriptableRenderFeature.SetActive to change the value of this variable.
Declaration
public bool isActive { get; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
AddRenderPasses(ScriptableRenderer, ref RenderingData)
Injects one or multiple ScriptableRenderPass
in the renderer.
Declaration
public abstract void AddRenderPasses(ScriptableRenderer renderer, ref RenderingData renderingData)
Parameters
Type | Name | Description |
---|---|---|
ScriptableRenderer | renderer | Renderer used for adding render passes. |
RenderingData | renderingData | Rendering state. Use this to setup render passes. |
Create()
Initializes this feature's resources. This is called every time serialization happens.
Declaration
public abstract void Create()
Dispose()
Disposable pattern implementation.
Declaration
public void Dispose()
Implements
Dispose(Boolean)
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
Boolean | disposing |
OnCameraPreCull(ScriptableRenderer, CameraData)
Callback before cull happens in renderer.
Declaration
public virtual void OnCameraPreCull(ScriptableRenderer renderer, in CameraData cameraData)
Parameters
Type | Name | Description |
---|---|---|
ScriptableRenderer | renderer | Renderer of callback. |
CameraData | cameraData | CameraData contains all relevant render target information for the camera. |
SetActive(Boolean)
Sets the state of ScriptableRenderFeature (true: the feature is active, false: the feature is inactive). If the feature is active, it is added to the renderer it is attached to, otherwise the feature is skipped while rendering.
Declaration
public void SetActive(bool active)
Parameters
Type | Name | Description |
---|---|---|
Boolean | active | The true value activates the ScriptableRenderFeature and the false value deactivates it. |