Drawing interrupt function

Updated: 01/08/2026

This page contains statements regarding the beta version.

Summary

Added in Cubism 5 SDK for Unity R5 beta 3, this function allows you to call any process before or after the drawing process of the model’s drawable objects (Drawable, Offscreen).
Objects with any Renderer and Cubism models can be processed.

Mechanism

When a component with the interface ICubismRenderingInterceptor is registered with the CubismRenderingInterceptorsManager, the process is called before or after the drawing process of the drawable object in a custom render pass.

Cubism SDK for Unity provides a CubismRenderingInterceptController component that extends ICubismRenderingInterceptor for immediate use of the drawing interrupt function.
When the CubismRenderingInterceptController component is used, it is set to be automatically registered with the CubismRenderingInterceptorsManager upon OnEnable().

How to use

Use the prepared component as it is

You can use the CubismRenderingInterceptController component by attaching it to any object.

About variables and functions

InvokeTiming InvokeTimingSetting
An enumerated variable that determines whether processing is performed before or after the drawing process.

InterceptingMode Mode
An enumerated variable that allows you to switch between the following three methods:
 • SortingOrder
  A method that controls the draw order with the SortingOrder value described below.
 • ZDepth
  A method that uses the distance from the camera to control the draw order.
 • Drawable
  A method in which a specific Drawable is specified and processing is performed before or after the drawing process of the specified Drawable, regardless of the draw order.

int GroupSortingOrder
A variable that determines which Grouped Sorting Index to draw at.
If there is no model to be drawn in the specified Grouped Sorting Index, the process is skipped except when InterceptingMode.Drawable is set.

int SortingOrder
A variable that sets the draw order.
This variable is ignored except for InterceptingMode.SortingOrder.

CubismDrawable _targetArtMesh
A drawable referenced when InterceptingMode.Drawable is set.

CubismRenderController _renderController
A CubismRenderController component referenced when attached to a Cubism model object.
OnEnabled() automatically gets the reference.

Renderer_renderer
A Renderer component referenced when attached to an object other than a Cubism model.

Material _material
A material of _renderer.

Using inherited components

There are two ways to do this: inherit from the CubismRenderingInterceptController component or inherit from the interface ICubismRenderingInterceptor.

Inheriting the CubismRenderingInterceptController component

The CubismRenderingInterceptController component inherits from ICubismRenderingInterceptor, ICubismUpdatable, and MonoBehaviour.

Some functions and properties are set to virtual.

int ExecutionOrder
A value that controls the order in which OnLateUpdate() is executed when the component is attached to a Cubism model.

bool NeedsUpdateOnEditing
A flag that indicates whether OnLateUpdate() update processing is performed when the component is attached to a Cubism model and playback is not performed (Edit mode).

void OnLateUpdate()
A function used to perform the update process for each frame.

void OnPreRendering()
A function performed when InvokeTiming.PreRendering is set.

void OnPostRendering()
A function executed when InvokeTiming.PostRendering is set.

Inheriting ICubismRenderingInterceptor

If the interface ICubismRenderingInterceptor is inherited, the functions that must be implemented are OnPreRenderingForPass() and OnPostRenderingForPass().
Registration with CubismRenderingInterceptorsManager must be implemented separately.

void OnPreRenderingForPass()
A function called just before the drawing process in a custom render pass.

void OnPostRenderingForPass()
A function called immediately after the drawing process in a custom render pass.

Was this article helpful?
YesNo
Please let us know what you think about this article.