Class MaskedPostProcessRunner
- Namespace
- Gamelogic.Fx.BuiltIn.PostProcessing
- Assembly
- Gamelogic.Fx.BuiltIn.dll
Runs all post-processes found in children of a given root on the Camera this script is attached to, but applies a mask and effect strength.
[ExecuteInEditMode]
public sealed class MaskedPostProcessRunner : GLMonoBehaviour
- Inheritance
-
GLMonoBehaviourMaskedPostProcessRunner
- Inherited Members
-
GLMonoBehaviour.FindObjectsOfInterface<TInterface>()GLMonoBehaviour.FindRequiredObjectOfType<T>()GLMonoBehaviour.GetRequiredComponent<T>()GLMonoBehaviour.GetRequiredComponentInChildren<T>()MonoBehaviour.IsInvoking()MonoBehaviour.StopCoroutine(Coroutine)MonoBehaviour.StopAllCoroutines()MonoBehaviour.runInEditModeComponent.GetComponent<T>()Component.GetComponentInChildren<T>()Component.GetComponentsInChildren<T>()Component.GetComponentsInParent<T>()Component.GetComponentIndex()Component.transformComponent.gameObjectComponent.tagObject.InstantiateAsync<T>(T)Object.InstantiateAsync<T>(T, Transform)Object.InstantiateAsync<T>(T, Vector3, Quaternion)Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)Object.InstantiateAsync<T>(T, InstantiateParameters)Object.InstantiateAsync<T>(T, Vector3, Quaternion, InstantiateParameters)Object.Instantiate(Object, Vector3, Quaternion)Object.Instantiate(Object)Object.Instantiate<T>(T, InstantiateParameters)Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)Object.Instantiate(Object, Transform)Object.Instantiate<T>(T)Object.Instantiate<T>(T, Vector3, Quaternion, Transform)Object.Instantiate<T>(T, Transform)Object.Destroy(Object)Object.DestroyImmediate(Object)Object.DestroyObject(Object)Object.FindObjectsOfType<T>()Object.nameObject.hideFlags
Remarks
Intended for the built-in render pipeline.
This script should be placed on a Camera. It calls OnRenderImage(RenderTexture, RenderTexture)
on all children with components that implement IPostProcess of the postProcessRoot configured in this inspector.
This allows you to have post-processes in separate objects and make it easier to manage if you are experimenting
with many processes at the same time.
So to add a post process to your camera:
- Add this script to the camera.
- Add an empty GameObject in your scene and call it PostEffects (or similar).
- Add a child object for each post process you want to add (e.g. AdjustGammaPostProcess), and add the post process script to it. Any script that implements IPostProcess will work.
This class can also be used to group a stack of effects as a single IPostProcess, so it can be used by effects that require an IPostProcess. In this case, you need not add the script to a camera (an empty game object will do fine). In this case, the OnRenderImage method will be called by the effect that requires this IPostProcess.
Properties
Shader
The resolved shader used by this runner's blend pass, for the shader variant collector.
public Shader Shader { get; }
Property Value
Methods
GetActiveShaderFeatureKeywords()
Gets the shader_feature keywords currently active on this runner, for the shader
variant collector.
public IEnumerable<string> GetActiveShaderFeatureKeywords()
Returns
Remarks
TODO: this component doesn't fit the ShaderProperties/BaseProperties pattern used by PostProcess and the URP renderer features (IGNORE_OVERLAY_ALPHA is unconditional and USE_MASK is inferred from a texture reference rather than an explicit keyword field), so the shader variant collector special-cases it directly via Shader and this method instead of going through that mechanism. Worth pulling into a shared interface if another odd-one-out like this shows up.
OnDisable()
public void OnDisable()
OnEnable()
public void OnEnable()
OnRenderImage(RenderTexture, RenderTexture)
public void OnRenderImage(RenderTexture sourceTexture, RenderTexture destinationTexture)
Parameters
sourceTextureRenderTexturedestinationTextureRenderTexture