Description
The AddHookAfterTransparent
method allows you to add a custom rendering hook that executes after the transparent rendering phase in the camera's rendering pipeline. This can be useful for applying custom post-processing effects or other rendering operations that need to occur after transparent objects have been rendered.
Usage
To use this method, provide a debugName
for identifying the hook, an order
to determine the execution sequence among multiple hooks, and a renderEffect
action that defines the rendering operations to be performed. The method returns an IDisposable
object, which can be used to remove the hook when it is no longer needed.
Example
// Example of using AddHookAfterTransparent
CameraComponent cameraComponent = new CameraComponent();
IDisposable hook = cameraComponent.AddHookAfterTransparent(
"MyCustomEffect",
10,
(sceneCamera) => {
// Custom rendering logic here
// Example: Apply a custom shader effect
}
);
// To remove the hook when done
hook.Dispose();