Skip to content

Commit 00df355

Browse files
Merge pull request #31 from Live2D/develop
Update to Cubism 5 SDK for Web R5 beta1
2 parents 8df8478 + 020a0dd commit 00df355

28 files changed

Lines changed: 5106 additions & 2562 deletions

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,23 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
66

77

8+
## [5-r.5-beta.1] - 2025-08-26
9+
10+
### Added
11+
12+
* Add `cubismrendertarget_webgl.ts`.
13+
* Define a class `CubismRenderTarget_WebGL` that manages the frame buffer and color buffer.
14+
* Add support for Blend mode and Offscreen drawing.
15+
16+
### Changed
17+
18+
* Change the rendering context requirement in WebGL environments to `WebGL2RenderingContext`.
19+
* In particular, when using the blend modes added in Cubism 5.3 and later, `WebGL2RenderingContext.blitFramebuffer()` is used.
20+
* Change the clipping mask processing uses class `CubismRenderTarget_WebGL`.
21+
* Change the API called to retrieve the drawable render order from `getDrawableRenderOrders()` to `getRenderOrders()` in CubismCore.
22+
* See `CHANGELOG.md` in Core.
23+
24+
825
## [5-r.4] - 2025-05-15
926

1027
### Added
@@ -339,6 +356,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
339356
* Reformat code using Prettier and ESLint.
340357

341358

359+
[5-r.5-beta.1]: https://github.com/Live2D/CubismWebFramework/compare/5-r.4...5-r.5-beta.1
342360
[5-r.4]: https://github.com/Live2D/CubismWebFramework/compare/5-r.3...5-r.4
343361
[5-r.3]: https://github.com/Live2D/CubismWebFramework/compare/5-r.2...5-r.3
344362
[5-r.2]: https://github.com/Live2D/CubismWebFramework/compare/5-r.1...5-r.2

README.ja.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ Cubism 5 Editorに搭載された新機能のSDK対応については [こちら
3030

3131
### Node.js
3232

33-
* 24.0.1
34-
* 22.15.0
33+
* 24.6.0
34+
* 22.18.0
3535

3636

3737
### TypeScript
3838

39-
5.8.3
39+
5.9.2
4040

4141

4242
## 開発環境構築

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ For compatibility with previous versions of Cubism SDK, please refer to [here](h
3030

3131
### Node.js
3232

33-
* 24.0.1
34-
* 22.15.0
33+
* 24.6.0
34+
* 22.18.0
3535

3636

3737
### TypeScript
3838

39-
5.8.3
39+
5.9.2
4040

4141

4242
## Development environment construction
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/**
2+
* Copyright(c) Live2D Inc. All rights reserved.
3+
*
4+
* Use of this source code is governed by the Live2D Open Software license
5+
* that can be found at https://www.live2d.com/eula/live2d-open-software-license-agreement_en.html.
6+
*/
7+
8+
9+
vec4 OverlapRgba(vec3 color, vec3 colorSource, vec3 colorDestination, vec3 parameter)
10+
{
11+
vec3 rgb = color * parameter.x + colorSource * parameter.y + colorDestination * parameter.z;
12+
float alpha = parameter.x + parameter.y + parameter.z;
13+
return vec4(rgb, alpha);
14+
}
15+
16+
#if defined(ALPHA_BLEND_OVER)
17+
vec4 AlphaBlend(vec3 color, vec4 colorSource, vec4 colorDestination)
18+
{
19+
vec3 parameter = vec3(colorSource.a * colorDestination.a, colorSource.a * (1.0 - colorDestination.a), colorDestination.a * (1.0 - colorSource.a));
20+
return OverlapRgba(color, colorSource.rgb, colorDestination.rgb, parameter);
21+
}
22+
23+
#elif defined(ALPHA_BLEND_ATOP)
24+
vec4 AlphaBlend(vec3 color, vec4 colorSource, vec4 colorDestination)
25+
{
26+
vec3 parameter = vec3(colorSource.a * colorDestination.a, 0, colorDestination.a * (1.0 - colorSource.a));
27+
return OverlapRgba(color, colorSource.rgb, colorDestination.rgb, parameter);
28+
}
29+
30+
#elif defined(ALPHA_BLEND_OUT)
31+
vec4 AlphaBlend(vec3 color, vec4 colorSource, vec4 colorDestination)
32+
{
33+
vec3 parameter = vec3(0.0, 0.0, colorDestination.a * (1.0 - colorSource.a));
34+
return OverlapRgba(color, colorSource.rgb, colorDestination.rgb, parameter);
35+
}
36+
37+
#elif defined(ALPHA_BLEND_CONJOINTOVER)
38+
vec4 AlphaBlend(vec3 color, vec4 colorSource, vec4 colorDestination)
39+
{
40+
vec3 parameter = vec3(min(colorSource.a, colorDestination.a), max(colorSource.a - colorDestination.a, 0.0), max(colorDestination.a - colorSource.a, 0.0));
41+
return OverlapRgba(color, colorSource.rgb, colorDestination.rgb, parameter);
42+
}
43+
44+
#elif defined(ALPHA_BLEND_DISJOINTOVER)
45+
vec4 AlphaBlend(vec3 color, vec4 colorSource, vec4 colorDestination)
46+
{
47+
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));
48+
return OverlapRgba(color, colorSource.rgb, colorDestination.rgb, parameter);
49+
}
50+
51+
#else
52+
#error not supported alpha blend function
53+
54+
#endif

0 commit comments

Comments
 (0)