Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ trim_trailing_whitespace = true
[*.java]
indent_size = 4

[*.{frag,vert}]
indent_size = 4

[*.gradle]
indent_size = 4

Expand Down
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,26 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).


## [5-r.5-beta.1] - 2026-01-29

### Added

* Add the `ICubismLoadFileFunction` interface to allow users to implement custom file loading logic.
* Add support for Blend mode and Offscreen drawing.
* Add `getMocVersionFromBuffer()`function.
* Support for retrieving MOC version from unsupported new MOC3 files.

### Changed

* Change shader code to be used separately.
* Rename `CubismOffscreenSurfaceAndroid` class to `CubismRenderTargetAndroid`.
* Change the API called to retrieve the drawable render order from `getDrawableRenderOrder()` to `getRenderOrder()` in CubismCore.

### Removed

* Remove unused `CubismShaderPrograms` class following the shader separation refactor.


## [5-r.4.1] - 2025-07-17

### Changed
Expand Down Expand Up @@ -272,6 +292,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
* New released!


[5-r.5-beta.1]: https://github.com/Live2D/CubismJavaFramework/compare/5-r.4.1...5-r.5-beta.1
[5-r.4.1]: https://github.com/Live2D/CubismJavaFramework/compare/5-r.4...5-r.4.1
[5-r.4]: https://github.com/Live2D/CubismJavaFramework/compare/5-r.3...5-r.4
[5-r.3]: https://github.com/Live2D/CubismJavaFramework/compare/5-r.2...5-r.3
Expand Down
8 changes: 4 additions & 4 deletions README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ Live2D Cubism Editor で出力したモデルをアプリケーションで利
本フレームワークを使用する前に、[ライセンス](LICENSE.md)をご確認ください。


## Cubism 5新機能や過去バージョンとの互換性について
## Cubism 5.3新機能や過去バージョンとの互換性について

本 SDK はCubism 5に対応した製品です
Cubism 5 Editorに搭載された新機能のSDK対応については [こちら](https://docs.live2d.com/cubism-sdk-manual/cubism-5-new-functions/)をご確認ください。
過去バージョンのCubism SDKとの互換性については [こちら](https://docs.live2d.com/cubism-sdk-manual/compatibility-with-cubism-5/)をご確認ください。
本 SDK はCubism 5.3に対応した製品です
Cubism 5.3 Editorに搭載された新機能のSDK対応については [こちら](https://docs.live2d.com/cubism-sdk-manual/cubism-5-3-new-functions/)をご確認ください。
過去バージョンのCubism SDKとの互換性については [こちら](https://docs.live2d.com/cubism-sdk-manual/compatibility-with-cubism-5-3/)をご確認ください。


## コンポーネント
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ This framework can be compiled with **Java SE 7** or higher.
Please check the [license](LICENSE.md) before using the framework.


## Compatibility with Cubism 5 new features and previous Cubism SDK versions
## Compatibility with Cubism 5.3 new features and previous Cubism SDK versions

This SDK is compatible with Cubism 5.
For SDK compatibility with new features in Cubism 5 Editor, please refer to [here](https://docs.live2d.com/en/cubism-sdk-manual/cubism-5-new-functions/).
For compatibility with previous versions of Cubism SDK, please refer to [here](https://docs.live2d.com/en/cubism-sdk-manual/compatibility-with-cubism-5/).
This SDK is compatible with Cubism 5.3.
For SDK compatibility with new features in Cubism 5.3 Editor, please refer to [here](https://docs.live2d.com/en/cubism-sdk-manual/cubism-5-3-new-functions/).
For compatibility with previous versions of Cubism SDK, please refer to [here](https://docs.live2d.com/en/cubism-sdk-manual/compatibility-with-cubism-5-3/).


## Components
Expand Down
6 changes: 6 additions & 0 deletions framework/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,10 @@ dependencies {
compileOnly(fileTree(dir: '../../Core/android', include: ['Live2DCubismCore.aar']))

testImplementation 'junit:junit:4.13.2'

androidTestImplementation(fileTree(dir: '../../Core/android', include: ['Live2DCubismCore.aar']))

androidTestImplementation 'androidx.test:runner:1.5.2'
androidTestImplementation 'androidx.test:rules:1.5.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/

#version 100

precision highp float;

varying vec2 v_texCoord; //v2f.texcoord
uniform sampler2D s_texture0; //_MainTex
uniform vec4 u_baseColor; //v2f.color
uniform vec4 u_multiplyColor;
uniform vec4 u_screenColor;

void main()
{
vec4 texColor = texture2D(s_texture0, v_texCoord);
texColor.rgb = texColor.rgb * u_multiplyColor.rgb;
texColor.rgb = texColor.rgb + u_screenColor.rgb - (texColor.rgb * u_screenColor.rgb);
vec4 color = texColor * u_baseColor;
gl_FragColor = vec4(color.rgb * color.a, color.a);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/

#if !defined CSM_ALPHA_BLEND_MODE
#error not define symbol: CSM_ALPHA_BLEND_MODE.

#else
vec4 OverlapRgba(vec3 color, vec3 colorSource, vec3 colorDestination, vec3 parameter)
{
vec3 rgb = color * parameter.x + colorSource * parameter.y + colorDestination * parameter.z;
float alpha = parameter.x + parameter.y + parameter.z;
return vec4(rgb, alpha);
}

#if CSM_ALPHA_BLEND_MODE == 0 // OVER
vec4 AlphaBlend(vec3 color, vec4 colorSource, vec4 colorDestination)
{
vec3 parameter = vec3(colorSource.a * colorDestination.a, colorSource.a * (1.0 - colorDestination.a), colorDestination.a * (1.0 - colorSource.a));
return OverlapRgba(color, colorSource.rgb, colorDestination.rgb, parameter);
}

#elif CSM_ALPHA_BLEND_MODE == 1 // ATOP
vec4 AlphaBlend(vec3 color, vec4 colorSource, vec4 colorDestination)
{
vec3 parameter = vec3(colorSource.a * colorDestination.a, 0, colorDestination.a * (1.0 - colorSource.a));
return OverlapRgba(color, colorSource.rgb, colorDestination.rgb, parameter);
}

#elif CSM_ALPHA_BLEND_MODE == 2 // OUT
vec4 AlphaBlend(vec3 color, vec4 colorSource, vec4 colorDestination)
{
vec3 parameter = vec3(0.0, 0.0, colorDestination.a * (1.0 - colorSource.a));
return OverlapRgba(color, colorSource.rgb, colorDestination.rgb, parameter);
}

#elif CSM_ALPHA_BLEND_MODE == 3 // CONJOINT OVER
vec4 AlphaBlend(vec3 color, vec4 colorSource, vec4 colorDestination)
{
vec3 parameter = vec3(min(colorSource.a, colorDestination.a), max(colorSource.a - colorDestination.a, 0.0), max(colorDestination.a - colorSource.a, 0.0));
return OverlapRgba(color, colorSource.rgb, colorDestination.rgb, parameter);
}

#elif CSM_ALPHA_BLEND_MODE == 4 // DISJOINT OVER
vec4 AlphaBlend(vec3 color, vec4 colorSource, vec4 colorDestination)
{
vec3 parameter = vec3(max(colorSource.a + colorDestination.a - 1.0, 0.0), min(colorSource.a, 1.0 - colorDestination.a), min(colorDestination.a, 1.0 - colorSource.a));
return OverlapRgba(color, colorSource.rgb, colorDestination.rgb, parameter);
}

#else
#error not supported blend function

#endif
#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/

#version 100

precision highp float;

varying vec2 v_texCoord; //v2f.texcoord
varying vec2 v_blendCoord;
uniform sampler2D s_texture0; //_MainTex
uniform sampler2D s_blendTexture;
uniform vec4 u_baseColor; //v2f.color
uniform vec4 u_multiplyColor;
uniform vec4 u_screenColor;

vec4 ConvertPremultipliedToStraight(vec4 source);
vec3 ColorBlend(vec3 colorSource, vec3 colorDestination);
vec4 AlphaBlend(vec3 color, vec4 colorSource, vec4 colorDestination);

void main()
{
vec4 texColor = texture2D(s_texture0, v_texCoord);
texColor.rgb = texColor.rgb * u_multiplyColor.rgb;
texColor.rgb = texColor.rgb + u_screenColor.rgb - (texColor.rgb * u_screenColor.rgb);
vec4 colorSource = texColor * u_baseColor;
vec4 colorDestination = ConvertPremultipliedToStraight(texture2D(s_blendTexture, v_blendCoord));
gl_FragColor = AlphaBlend(ColorBlend(colorSource.rgb, colorDestination.rgb), colorSource, colorDestination);
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/**
* Copyright(c) Live2D Inc. All rights reserved.
*
* Use of this source code is governed by the Live2D Open Software license
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
*/

#version 100
#extension GL_NV_shader_framebuffer_fetch : enable

precision highp float;

varying vec2 v_texCoord; //v2f.texcoord
varying vec2 v_blendCoord;
uniform sampler2D s_texture0; //_MainTex
uniform sampler2D s_blendTexture;
uniform vec4 u_baseColor; //v2f.color
uniform vec4 u_multiplyColor;
uniform vec4 u_screenColor;

vec4 ConvertPremultipliedToStraight(vec4 source);
vec3 ColorBlend(vec3 colorSource, vec3 colorDestination);
vec4 AlphaBlend(vec3 color, vec4 colorSource, vec4 colorDestination);

void main()
{
vec4 texColor = texture2D(s_texture0, v_texCoord);
texColor.rgb = texColor.rgb * u_multiplyColor.rgb;
texColor.rgb = texColor.rgb + u_screenColor.rgb - (texColor.rgb * u_screenColor.rgb);
vec4 colorSource = texColor * u_baseColor;
vec4 colorDestination = ConvertPremultipliedToStraight(texture2D(s_blendTexture, v_blendCoord));
gl_FragColor = AlphaBlend(ColorBlend(colorSource.rgb, colorDestination.rgb), colorSource, colorDestination);
}

Loading