System.IDisposable AddHookAfterTransparent( string debugName, int order, System.Action<SceneCamera> renderEffect )

book_4_sparkGenerated
code_blocksInput

Description

The AddHookAfterTransparent method allows you to add a custom rendering hook to the camera's rendering pipeline, specifically after the transparent objects have been rendered. This can be useful for applying post-processing effects or other custom rendering logic that should occur after transparent objects are drawn.

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 logic to be executed. The method returns an IDisposable object, which can be used to remove the hook when it is no longer needed.

Example

// Example usage of AddHookAfterTransparent
CameraComponent cameraComponent = new CameraComponent();

IDisposable hook = cameraComponent.AddHookAfterTransparent(
    "MyCustomEffect",
    10,
    (sceneCamera) => {
        // Custom rendering logic here
        // Example: Apply a post-processing effect
    }
);

// Later, when you want to remove the hook
hook.Dispose();