Skip to content

Commit

Permalink
Merge pull request #39 from Live2D/develop
Browse files Browse the repository at this point in the history
Update to Cubism 5 SDK for Native R1 beta1
  • Loading branch information
itoh-at-live2d-com authored Aug 17, 2023
2 parents bd14cff + 07b9e8d commit bb8de3a
Show file tree
Hide file tree
Showing 168 changed files with 16,733 additions and 456 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ end_of_line = crlf

[*.bat]
charset = unset

[*.md]
trim_trailing_whitespace = false
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
!/Samples/**/thirdParty/scripts/*
!/Samples/OpenGL/thirdParty/stb/*
!/Samples/Metal/thirdParty/stb/*
!/Samples/Vulkan/thirdParty/stb/*
# Other files
/build/
.vs/
Expand Down
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,24 @@ 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.1-beta.1] - 2023-08-17

### Added

* Add Wankoromochi as a model bundled with SDK.
* Add the sample for Vulkan API in Windows.

### Changed

* Update third-party libraries.
* Offscreen drawing-related terminology has been unified with "OffscreenSurface".
* Adjusted to automatically search and use models in the Resource folder.

### Fixed

* Fix a bug that premultiplied alpha not works correctly when `PREMULTIPLIED_ALPHA_ENABLE` is not defined in Metal.


## [4-r.7] - 2023-05-25

### Added
Expand Down Expand Up @@ -305,6 +323,7 @@ See [Core Changelog] for details.
* What was `Package.json` is currently being changed to`cubism-info.yml`.


[5-r.1-beta.1]: https://github.com/Live2D/CubismNativeSamples/compare/4-r.7...5-r.1-beta.1
[4-r.7]: https://github.com/Live2D/CubismNativeSamples/compare/4-r.6.2...4-r.7
[4-r.6.2]: https://github.com/Live2D/CubismNativeSamples/compare/4-r.6.1...4-r.6.2
[4-r.6.1]: https://github.com/Live2D/CubismNativeSamples/compare/4-r.6...4-r.6.1
Expand Down
20 changes: 20 additions & 0 deletions Core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,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/).


## 2023-08-17

### Added

* Enhance Blend Shape features.
* Please see [here](https://docs.live2d.com/en/cubism-editor-manual/blend-shape/).

### Changed

* Upgrade Core version to 05.00.0000.


## 2023-05-09

### Changed

* Change the GCC version of the library for Linux from 6.5.0 to 8.3.0.


## 2023-03-16

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion Framework
Submodule Framework updated 88 files
+4 −1 .editorconfig
+29 −1 CHANGELOG.md
+8 −1 README.ja.md
+13 −1 README.md
+117 −0 TRANSLATION.md
+86 −24 src/CubismCdiJson.hpp
+5 −5 src/CubismDefaultParameterId.hpp
+168 −69 src/CubismFramework.hpp
+34 −21 src/CubismFrameworkConfig.hpp
+13 −24 src/CubismJsonHolder.hpp
+224 −80 src/CubismModelSettingJson.hpp
+3 −3 src/Effect/CubismEyeBlink.cpp
+1 −1 src/Effect/CubismEyeBlink.hpp
+14 −21 src/ICubismAllocator.hpp
+89 −79 src/ICubismModelSetting.hpp
+2 −2 src/Live2DCubismCore.hpp
+6 −0 src/Model/CubismModel.cpp
+10 −0 src/Model/CubismModel.hpp
+1 −1 src/Model/CubismUserModel.cpp
+2 −1 src/Model/CubismUserModel.hpp
+21 −13 src/Motion/ACubismMotion.cpp
+10 −0 src/Motion/ACubismMotion.hpp
+2 −0 src/Motion/CMakeLists.txt
+146 −9 src/Motion/CubismExpressionMotion.cpp
+60 −4 src/Motion/CubismExpressionMotion.hpp
+183 −0 src/Motion/CubismExpressionMotionManager.cpp
+109 −0 src/Motion/CubismExpressionMotionManager.hpp
+5 −0 src/Motion/CubismMotionQueueEntry.cpp
+2 −0 src/Motion/CubismMotionQueueEntry.hpp
+5 −0 src/Motion/CubismMotionQueueManager.cpp
+10 −0 src/Motion/CubismMotionQueueManager.hpp
+2 −0 src/Rendering/CMakeLists.txt
+2 −0 src/Rendering/Cocos2d/CMakeLists.txt
+3 −3 src/Rendering/Cocos2d/CubismCommandBuffer_Cocos2dx.cpp
+1 −1 src/Rendering/Cocos2d/CubismCommandBuffer_Cocos2dx.hpp
+13 −13 src/Rendering/Cocos2d/CubismOffscreenSurface_Cocos2dx.cpp
+6 −6 src/Rendering/Cocos2d/CubismOffscreenSurface_Cocos2dx.hpp
+150 −1,616 src/Rendering/Cocos2d/CubismRenderer_Cocos2dx.cpp
+51 −283 src/Rendering/Cocos2d/CubismRenderer_Cocos2dx.hpp
+947 −0 src/Rendering/Cocos2d/CubismShader_Cocos2dx.cpp
+155 −0 src/Rendering/Cocos2d/CubismShader_Cocos2dx.hpp
+155 −0 src/Rendering/CubismClippingManager.hpp
+507 −0 src/Rendering/CubismClippingManager.tpp
+58 −0 src/Rendering/CubismRenderer.cpp
+51 −20 src/Rendering/CubismRenderer.hpp
+12 −12 src/Rendering/D3D11/CubismOffscreenSurface_D3D11.cpp
+6 −6 src/Rendering/D3D11/CubismOffscreenSurface_D3D11.hpp
+377 −858 src/Rendering/D3D11/CubismRenderer_D3D11.cpp
+76 −188 src/Rendering/D3D11/CubismRenderer_D3D11.hpp
+11 −11 src/Rendering/D3D9/CubismOffscreenSurface_D3D9.cpp
+6 −6 src/Rendering/D3D9/CubismOffscreenSurface_D3D9.hpp
+404 −923 src/Rendering/D3D9/CubismRenderer_D3D9.cpp
+81 −176 src/Rendering/D3D9/CubismRenderer_D3D9.hpp
+1 −1 src/Rendering/D3D9/CubismShader_D3D9.hpp
+2 −0 src/Rendering/Metal/CMakeLists.txt
+1 −1 src/Rendering/Metal/CubismCommandBuffer_Metal.hpp
+6 −6 src/Rendering/Metal/CubismOffscreenSurface_Metal.hpp
+13 −13 src/Rendering/Metal/CubismOffscreenSurface_Metal.mm
+55 −275 src/Rendering/Metal/CubismRenderer_Metal.hpp
+156 −1,178 src/Rendering/Metal/CubismRenderer_Metal.mm
+120 −0 src/Rendering/Metal/CubismShader_Metal.hpp
+509 −0 src/Rendering/Metal/CubismShader_Metal.mm
+2 −0 src/Rendering/OpenGL/CMakeLists.txt
+13 −13 src/Rendering/OpenGL/CubismOffscreenSurface_OpenGLES2.cpp
+6 −6 src/Rendering/OpenGL/CubismOffscreenSurface_OpenGLES2.hpp
+134 −1,726 src/Rendering/OpenGL/CubismRenderer_OpenGLES2.cpp
+44 −316 src/Rendering/OpenGL/CubismRenderer_OpenGLES2.hpp
+1,103 −0 src/Rendering/OpenGL/CubismShader_OpenGLES2.cpp
+182 −0 src/Rendering/OpenGL/CubismShader_OpenGLES2.hpp
+9 −0 src/Rendering/Vulkan/CMakeLists.txt
+314 −0 src/Rendering/Vulkan/CubismClass_Vulkan.cpp
+204 −0 src/Rendering/Vulkan/CubismClass_Vulkan.hpp
+141 −0 src/Rendering/Vulkan/CubismOffscreenSurface_Vulkan.cpp
+103 −0 src/Rendering/Vulkan/CubismOffscreenSurface_Vulkan.hpp
+1,515 −0 src/Rendering/Vulkan/CubismRenderer_Vulkan.cpp
+611 −0 src/Rendering/Vulkan/CubismRenderer_Vulkan.hpp
+30 −0 src/Rendering/Vulkan/Shaders/CMakeLists.txt
+16 −0 src/Rendering/Vulkan/Shaders/src/FragShaderSrc.frag
+21 −0 src/Rendering/Vulkan/Shaders/src/FragShaderSrcMask.frag
+21 −0 src/Rendering/Vulkan/Shaders/src/FragShaderSrcMaskInverted.frag
+20 −0 src/Rendering/Vulkan/Shaders/src/FragShaderSrcMaskInvertedPremultipliedAlpha.frag
+20 −0 src/Rendering/Vulkan/Shaders/src/FragShaderSrcMaskPremultipliedAlpha.frag
+14 −0 src/Rendering/Vulkan/Shaders/src/FragShaderSrcPremultipliedAlpha.frag
+17 −0 src/Rendering/Vulkan/Shaders/src/FragShaderSrcSetupMask.frag
+17 −0 src/Rendering/Vulkan/Shaders/src/VertShaderSrc.vert
+20 −0 src/Rendering/Vulkan/Shaders/src/VertShaderSrcMasked.vert
+19 −0 src/Rendering/Vulkan/Shaders/src/VertShaderSrcSetupMask.vert
+12 −0 src/Rendering/Vulkan/Shaders/src/common.glsl
1 change: 1 addition & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ Samples/Resources/Mao
Samples/Resources/Mark
Samples/Resources/Natori
Samples/Resources/Rice
Samples/Resources/Wanko
```

If you use these models, you must agree to the terms of a contract set [here](https://docs.live2d.com/cubism-editor-manual/sample-model/) for each model.
Expand Down
6 changes: 6 additions & 0 deletions NOTICE.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@

# お知らせ

## [注意事項] iOSにおけるMetalとOpenGLの描画差異について (2023-08-17)

以前から発生していたMetalとOpenGLの描画差異について、macOSでの描画差異はCubism 5 SDK for Native R1 Beta1 (5-r.1-beta.1)にて解消いたしました。
iOSでの描画差異は今後のアップデートにて対応する予定です。


## [注意事項] Cocos2d-xセットアップのエラーについて (2022-03-15)

Cocos2d-xサンプルプロジェクトのセットアップ時に実行するsetup-cocos2dバッチにおいてエラーが発生いたします。
Expand Down
6 changes: 6 additions & 0 deletions NOTICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@

# Notices

## [Caution] Differences between Metal and OpenGL rendering on iOS (2023-08-17)

The rendering differences between Metal and OpenGL that have been occurring for some time have been resolved in Cubism 5 SDK for Native R1 Beta1 (5-r.1-beta.1) for macOS.
The rendering difference on iOS will be addressed in a future update.


## [Caution] About Cocos2d-x setup error (2022-03-15)

An error occurs in the setup-cocos2d batch that is executed when setting up the Cocos2d-x sample project.
Expand Down
32 changes: 20 additions & 12 deletions README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# Cubism Native Samples

Live2D Cubism 4 Editor で出力したモデルを表示するアプリケーションのサンプル実装です。
Live2D Cubism Editor で出力したモデルを表示するアプリケーションのサンプル実装です。

Cubism Native Framework および Live2D Cubism Core と組み合わせて使用します。

Expand All @@ -21,6 +21,13 @@ Cubism Native Framework および Live2D Cubism Core と組み合わせて使用
本 SDK を使用する前に [お知らせ](NOTICE.ja.md)をご確認ください。


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

本 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/)をご確認ください。


## ディレクトリ構成

```
Expand All @@ -33,6 +40,7 @@ Cubism Native Framework および Live2D Cubism Core と組み合わせて使用
├─ D3D11 # DirectX 11 のサンプルプロジェクトが含まれるディレクトリ
├─ Metal # Metal のサンプルプロジェクトが含まれるディレクトリ
├─ OpenGL # OpenGL のサンプルプロジェクトが含まれるディレクトリ
├─ Vulkan # Vulkan のサンプルプロジェクトが含まれるディレクトリ
└─ Resources # モデルのファイルや画像などのリソースが含まれるディレクトリ
```

Expand Down Expand Up @@ -99,21 +107,21 @@ Demo

| 開発ツール | バージョン |
| --- | --- |
| Android Studio | Flamingo 2022.2.1 Patch 1 |
| CMake | 3.26.3 |
| Android Studio | Giraffe 2022.3.1 |
| CMake | 3.27.1 |
| Visual Studio 2013 | Update 5 |
| Visual Studio 2015 | Update 3 |
| Visual Studio 2017 | 15.9.54 |
| Visual Studio 2019 | 16.11.26 |
| Visual Studio 2022 | 17.5.5 |
| XCode | 14.3 |
| Visual Studio 2017 | 15.9.56 |
| Visual Studio 2019 | 16.11.29 |
| Visual Studio 2022 | 17.7.0 |
| XCode | 14.3.1 |

### Android

| Android SDK tools | バージョン |
| --- | --- |
| Android NDK | 25.2.9519653 |
| Android SDK | 33.0.2 |
| Android SDK | 34.0.0 |
| CMake | 3.22.1 |

### Linux
Expand All @@ -125,7 +133,7 @@ Demo
| Red Hat | CentOS Stream 8 *1 | `centos:latest` | 8.5.0 |
| Red Hat | CentOS Stream 9 | - | 11.3.1 |
| Debian | Ubuntu 18.04 | `ubuntu:18.04` | 7.5.0 |
| Debian | Ubuntu 22.04.2 | `ubuntu:22.04.2` | 11.3.0 |
| Debian | Ubuntu 22.04.3 | `ubuntu:22.04.3` | 11.3.0 |

*1 CentOS 8はサポートしておりません

Expand All @@ -143,8 +151,8 @@ Demo

| プラットフォーム | バージョン |
| --- | --- |
| iOS / iPadOS | 16.4.1 |
| macOS | 13.3 |
| iOS / iPadOS | 16.6 |
| macOS | 13.5 |
| Windows 10 | 22H2 |
| Windows 11 | 22H2 |

Expand All @@ -162,7 +170,7 @@ Demo
| Red Hat | Amazon Linux | 2 |
| Red Hat | CentOS Stream | 8 |
| Red Hat | CentOS Stream | 9 |
| Debian | Ubuntu | 22.04.2 |
| Debian | Ubuntu | 22.04.3 |

## プロジェクトへの貢献

Expand Down
32 changes: 20 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# Cubism Native Samples

This is a sample implementation of an application that displays models output by Live2D Cubism 4 Editor.
This is a sample implementation of an application that displays models output by Live2D Cubism Editor.

It is used in conjunction with Cubism Native Framework and Live2D Cubism Core.

Expand All @@ -21,6 +21,13 @@ Please check the [license](LICENSE.md) before using this SDK.
Please check the [notices](NOTICE.md) before using this SDK.


## Compatibility with Cubism 5 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/).


## Directory structure

```
Expand All @@ -33,6 +40,7 @@ Please check the [notices](NOTICE.md) before using this SDK.
├─ D3D11 # Directory containing the DirectX 11 sample project
├─ Metal # Directory containing the Metal sample project
├─ OpenGL # Directory containing the OpenGL sample project
├─ Vulkan # Directory containing the Vulkan sample project
└─ Resources # Directory containing resources such as model files and images
```

Expand Down Expand Up @@ -98,21 +106,21 @@ Please refer to [CHANGELOG.md](CHANGELOG.md) for the changelog of this repositor

| Development Tool | Version |
| --- | --- |
| Android Studio | Flamingo 2022.2.1 Patch 1 |
| CMake | 3.26.3 |
| Android Studio | Giraffe 2022.3.1 |
| CMake | 3.27.1 |
| Visual Studio 2013 | Update 5 |
| Visual Studio 2015 | Update 3 |
| Visual Studio 2017 | 15.9.54 |
| Visual Studio 2019 | 16.11.26 |
| Visual Studio 2022 | 17.5.5 |
| XCode | 14.3 |
| Visual Studio 2017 | 15.9.56 |
| Visual Studio 2019 | 16.11.29 |
| Visual Studio 2022 | 17.7.0 |
| XCode | 14.3.1 |

### Android

| Android SDK tools | Version |
| --- | --- |
| Android NDK | 25.2.9519653 |
| Android SDK | 33.0.2 |
| Android SDK | 34.0.0 |
| CMake | 3.22.1 |

### Linux
Expand All @@ -124,7 +132,7 @@ Please refer to [CHANGELOG.md](CHANGELOG.md) for the changelog of this repositor
| Red Hat | CentOS Stream 8 *1 | `centos:latest` | 8.5.0 |
| Red Hat | CentOS Stream 9 | - | 11.3.1 |
| Debian | Ubuntu 18.04 | `ubuntu:18.04` | 7.5.0 |
| Debian | Ubuntu 22.04.1 | `ubuntu:22.04.1` | 11.3.0 |
| Debian | Ubuntu 22.04.3 | `ubuntu:22.04.3` | 11.3.0 |

*1 CentOS 8 is not supported

Expand All @@ -142,8 +150,8 @@ Please refer to [CHANGELOG.md](CHANGELOG.md) for the changelog of this repositor

| Platform | Version |
| --- | --- |
| iOS / iPadOS | 16.4.1 |
| macOS | 13.3 |
| iOS / iPadOS | 16.6 |
| macOS | 13.5 |
| Windows 10 | 22H2 |
| Windows 11 | 22H2 |

Expand All @@ -161,7 +169,7 @@ Please refer to [CHANGELOG.md](CHANGELOG.md) for the changelog of this repositor
| Red Hat | Amazon Linux | 2 |
| Red Hat | CentOS Stream | 8 |
| Red Hat | CentOS Stream | 9 |
| Debian | Ubuntu | 22.04.1 |
| Debian | Ubuntu | 22.04.3 |

## Contributing

Expand Down
4 changes: 4 additions & 0 deletions Samples/Cocos2d-x/Demo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ list(APPEND GAME_SOURCE
${CLASSES_PATH}/LAppView.cpp
${CLASSES_PATH}/SampleScene.cpp
${CLASSES_PATH}/TouchManager.cpp
${CLASSES_PATH}/LAppLive2DManagerInternal.cpp
)

list(APPEND GAME_HEADER
Expand All @@ -82,6 +83,7 @@ list(APPEND GAME_HEADER
${CLASSES_PATH}/LAppView.hpp
${CLASSES_PATH}/SampleScene.h
${CLASSES_PATH}/TouchManager.h
${CLASSES_PATH}/LAppLive2DManagerInternal.h
)

# Add Cubism Core as static library.
Expand Down Expand Up @@ -248,6 +250,7 @@ if(APPLE)
set_target_properties(${APP_NAME} PROPERTIES RESOURCE "${APP_UI_RES}")
if(MACOSX)
set_xcode_property(${APP_NAME} INFOPLIST_FILE "${COCOS2DX_ROOT_PATH}/templates/cpp-template-default/proj.ios_mac/mac/Info.plist")
target_compile_definitions(${APP_NAME} PRIVATE CSM_TARGET_MACOSX)
target_compile_definitions(Framework PUBLIC CSM_TARGET_MAC_GL)
set(COCOS_GLFW3 ${COCOS2DX_ROOT_PATH}/external/glfw3)
target_include_directories(Framework PUBLIC ${COCOS_GLFW3}/include/Mac)
Expand All @@ -262,6 +265,7 @@ if(APPLE)
set_xcode_property(${APP_NAME} TARGETED_DEVICE_FAMILY "1,2")
set_xcode_property(${APP_NAME} ONLY_ACTIVE_ARCH "NO")
set_xcode_property(${APP_NAME} ARCHS "arm64")
target_compile_definitions(${APP_NAME} PRIVATE CSM_TARGET_IOS)
target_compile_definitions(Framework PUBLIC CSM_TARGET_IPHONE_ES2)
target_include_directories(Framework PUBLIC ${COCOS2DX_ROOT_PATH}/cocos)
endif()
Expand Down
12 changes: 0 additions & 12 deletions Samples/Cocos2d-x/Demo/Classes/LAppDefine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,6 @@ namespace LAppDefine {
const csmChar* BackImageName = "back_class_normal.png";

// モデル定義------------------------------------------
// モデルを配置したディレクトリ名の配列
// ディレクトリ名とmodel3.jsonの名前を一致させておくこと
const csmChar* ModelDir[] = {
"Haru",
"Hiyori",
"Mark",
"Natori",
"Rice",
"Mao"
};
const csmInt32 ModelDirSize = sizeof(ModelDir) / sizeof(const csmChar*);

// 外部定義ファイル(json)と合わせる
const csmChar* MotionGroupIdle = "Idle"; // アイドリング
const csmChar* MotionGroupTapBody = "TapBody"; // 体をタップしたとき
Expand Down
3 changes: 0 additions & 3 deletions Samples/Cocos2d-x/Demo/Classes/LAppDefine.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ namespace LAppDefine {
extern const csmChar* BackImageName; ///< 背景画像ファイル

// モデル定義--------------------------------------------
extern const csmChar* ModelDir[]; ///< モデルを配置したディレクトリ名の配列. ディレクトリ名とmodel3.jsonの名前を一致させておく.
extern const csmInt32 ModelDirSize; ///< モデルディレクトリ配列のサイズ

// 外部定義ファイル(json)と合わせる
extern const csmChar* MotionGroupIdle; ///< アイドリング時に再生するモーションのリスト
extern const csmChar* MotionGroupTapBody; ///< 体をタップした時に再生するモーションのリスト
Expand Down
Loading

0 comments on commit bb8de3a

Please sign in to comment.