Comparison of each Cubism SDK

[Last updated: 02/16/2022]

  Cubism SDK for Unity Cubism SDK for Native Cubism SDK for Web
Mask Sharing Share MaskTexture specified in CubismMaskController Use mask textures shared only within the model Same as on the left
Number of masks 64 masks by default 36 masks by default
* Limitations can be removed by activating the high-definition mask.
See “Mask Preprocessing Method (Native)” for details.
36 masks by default
How to remove the mask Fixed mask size
Composed of a square that can encompass the masking side
Automatic resizing
With a rectangle that can contain the masked side
compose a full to mask shape
Same as on the left
How to draw Drawing order (ascending descending), Z value (ascending descending) Only in ascending order of drawing order Same as on the left
OW Pose Function Yes (R11 beta1-) Yes Same as on the left
OW expression function Yes (R11 beta1-) Yes Same as on the left
Motion Management Convert Unity's motion3.json to an AnimationClip and
do it with Mecanim
Doing it with Cubism SDK for Native Doing it with Cubism SDK for Web
Languages used by the SDK C# C++ Type Script
Live2D placement on the GUI above the code Same as on the left
Destination Platform Windows, macOS, iOS, Android, WebGL,
PlayStation 4, Nintendo Switch
Windows, macOS, Linux, iOS, Android,
PlayStation 4, Nintendo Switch
Web Browser

 

Difference in mask characteristics

Cubism SDK for Unity

In Unity, mask images are shared on a MaskTexture basis as specified in the CubismMaskController.
Multiple MaskTextures can be created, and even models of the same type will be used separately if different MaskTextures are specified.
It is not possible to use multiple MaskTextures within a single model.

 

The number of masks handled per texture can be changed by changing the Subdivisions item in MaskTexture.
The value of Subdivisions is the number of masks handled per axis, and the number of masks handled varies as shown in the table below.

Subdivisions 1 2 3 4 5
Number of masks 4 16 64 256 1024

There is no standard function to adjust Subdivisions for the number of masks handled.
Care should be taken when working with models that require detailed masks.

 

The figure above shows a GloabalMaskTexture's RenderTexture used in Unity, drawn with the model.
The black area in the lower right is the RenderTexture drawn, and the sequence is as follows from the lower left to the top.

Mark1's eyes, Mark1's eyes, Mark1's mouth, the glasses of Natori,
the right eye of Natori, the left eye of the great steward, the eye of Mark 2, the eye of Mark 2,
Mark2 mouth

 

Masks generated from the same ArtMesh are merged.
This is not looking at the number used for the mask, but comparing it with the instantiated Drawable object.
Therefore, if there are multiple instances of the same model data, the mask is consumed by the number of instances.

When the mask limit is reached, the mask is applied to the entire surface, starting from the one registered later, and disappears from the display.

Also, since the shape is taken by a square that encompasses the side to be masked, it is difficult to distort a large ArtMesh by masking it with a small ArtMesh.

 

* Caution when converting to AssetBundle

There is a specification that the RenderTexture of GloabalMaskTexture is not released when it is converted to AssetBundle.
To avoid memory leaks, check the tutorial “Memory Leak Problems and Countermeasures when Using Models from AssetBundle”.

 

Cubism SDK for Native, Cubism SDK for Web

Masks in Cubism SDK for Native and Cubism SDK for Web are prepared at the beginning of each model.
For details, please refer to “Mask Preparation Methods”.

Since Cubism SDK for Native only has the ability to draw each model in the order in which it is drawn in the model, masks are shared on a per-model basis.
Like Unity, identical masks will be integrated. Comparisons are made only by Drawable number.
The maximum number of masks handled is 36, and the size is automatically adjusted according to the number of masks.

 

The above figure shows a clipping texture from Cubism SDK for Native drawn horizontally. (Similar results are obtained with Cubism SDK for Web)
Note that in Cubism SDK for Native and Cubism SDK for Web, unlike Cubism SDK for Unity, the top and bottom are reversed and the darker mask is drawn.
The three paintings depicted are Mark's right eye, left eye, and mouth.

 

Unlike the Cubism SDK for Unity, the masked side is generated as a rectangle that contains the masked side so that it is not affected by adjacent mask buffers.
Therefore, in a model where a large ArtMesh is covered by a small mask with many segments, the mask area may be collapsed and the drawing result may be affected.
The same is true when a small mask is applied to multiple ArtMeshes that are separated from each other.
If the mask area is crushed, increasing the size of the mask buffer may improve the problem.
(Ref.: Dynamic resizing of mask buffer)

Cubism SDK for Native also offers the ability to use high-definition masks in exchange for performance.
See “Mask preprocessing method (Native)#Switch mask processing to high-definition method” for enabling high-definition masks.

 

Stroke order management

Cubism SDK for Unity

Cubism SDK for Unity uses Unity functions and scripts to manage the drawing order.

There are four methods. There are two main methods.

• Z adjustment (Back To Front Z, Front To Back Z)

This is a method of shifting the Z position of a Drawable in a model and modifying the drawing order by Z-sorting.
If the camera is set to Perspective or the model's Tramsform is rotated, the display may be distorted.
Rotating 180 degrees reverses the drawing order.
The same drawing order is applied to all Drawables.

• Order adjustment (Back To Front Order, Front To Back Order)

This is a method of modifying the order in which the Drawables are drawn in the model by shifting the drawing order itself one by one.
The display is not disturbed by camera settings or model rotation. Even on the reverse side, the drawing order is the same toward the camera.
If the Order In Layer of the CubismRenderController is not sufficiently empty for each model,
the drawing order is mixed and switches finely.
If the number of DrawCalls increases or their display position is covered, the Drawable may be displayed mixed.

Conversely, by inserting Unity objects or other objects into the drawing of the model, it can be made to appear as if the model has objects.

 

Cubism SDK for Native, Cubism SDK for Web

Cubism SDK for Native and Cubism SDK for Web sort the rendering order by the contents of the Renderer associated with the model.

Displays are not mixed between models.
Between models, the one drawn first is displayed later.

 

Motion Management

The Cubism SDK for Unity manages motion using two types of components: Mecanim, a Unity function, and “CubismMotionController”, a component included with the SDK that uses Unity's Playable API.
Mecanim allows you to design motion combinations visually in a graphical environment.
CubismMotionController allows you to play back all motions from scripts without worrying about their state.

In Cubism SDK for Native and Cubism SDK for Web, motion management is performed by the SDK on the Live2D side.
Although the operation is done directly by code, it is similar to Cubism 2.1, such as the pose function.

For more information on the differences between the SDKs for motion, see “Differences in Motion Creation with the SDKs”.

 

© 2010 - 2022 Live2D Inc.