[Cubism SDK Android] Fade in and Fade out effect when the models change

I wonder is there any function to set a fade in and fade out animation when I call the “ChangeScene” function in “LAppLive2DManager.cpp”? I noticed that there are fadein and fadeout settings for motion changing, but is there such things for models changing?

If not, is there any interface function provided which can change the alpha of the model? I noticed that the “SetOpacity” function in “CubismUserModel” is only related to the hit area, not the alpha of the image.

Any suggestions or replies will be appreciated. Thanks.

Hi @guangyu_shan

Thank you for always using our products.
Please let us know the type and version of SDK you are using, as support personnel differ depending on the product.

Best regards.

Thanks! It is CubismSdkForNative-4-r.4, and I am running the demo under the “CubismSdkForNative-4-r.4\Samples\OpenGL\Demo\proj.android.cmake\Full” folder.

Hello, @guangyu_shan

I wonder is there any function to set a fade in and fade out animation when I call the “ChangeScene” function in “LAppLive2DManager.cpp”? I noticed that there are fadein and fadeout settings for motion changing, but is there such things for models changing?

Cubism SDK does not have a fade in/fade out feature when switching models.

If not, is there any interface function provided which can change the alpha of the model?

How about displaying the result of an off-screen rendering of a model as an image and manipulating the opacity of it?

SDK for Native allows you to define either of the following macros in your project to display the result of off-screen rendering of a model as an image on the screen.
USE_RENDER_TARGET : Draw to the target that LAppView has
USE_MODEL_RENDER_TARGET : Draw to the target that each model has

By default, SDK for Native overlaps two models in a semi-transparent state to make it easier to understand that they are displayed as images.
This is handled by LAppLive2DManager::ChangeScene(), so please customize this as necessary.

To set the opacity of the model during off-screen drawing, call LAppSprite::SetColor().
In SDK for Native, opacity is set by LAppView::PostModelDraw() when USE_RENDER_TARGET, and by LAppView::Render() when USE_MODEL_RENDER_TARGET.
In USE_RENDER_TARGET, the opacity of all models is the same, while in USE_MODEL_RENDER_TARGET, the opacity can be set for each model.

Thanks for your detailed suggestions! It fits well with my situation!