Skip to content

Commit

Permalink
Update to Cubism 5 SDK for Native R1
Browse files Browse the repository at this point in the history
  • Loading branch information
wada-at-live2d-com committed Mar 26, 2024
1 parent 88d13ad commit 7671506
Show file tree
Hide file tree
Showing 115 changed files with 1,332 additions and 915 deletions.
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,32 @@ 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] - 2024-03-26

### Added

* Add x86_64 architecture to target platforms in Android.

### Changed

* Rename "rootDirectory" to "executeAbsolutePath".
* The log function was changed because it was ambiguous whether or not a newline was inserted.
* Change so that `LAppSprite` is not depend on `LAppDelegate` in D3D11 and D3D9, Metal, Vulkan.
* Some function arguments in `LAppSprite` are changed in D3D11 and D3D9, Metal, Vulkan.

### Fixed

* Fixed undefined behavior and memory leak in `LAppPal`.
* Modify code to more closely resemble Java coding style.
* Fix model drawing disappearing when defining `USE_RENDER_TARGET` and `USE_MODEL_RENDER_TARGET`.
* Fix an issue where the OpenGL sample for Visual Studio 2013 was not functioning correctly.
* Fix shader build error when running nmake in Vulkan.

### Removed

* Remove unnecessary pre-API 21 processing.


## [5-r.1-beta.4] - 2024-01-25

### Added
Expand Down Expand Up @@ -32,6 +58,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
* Fix an issue that caused incorrect selection of depth format in Vulkan.
* Fix errors that occurs when building with x86 in vulkan.


## [5-r.1-beta.3] - 2023-10-12

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


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


## 2024-03-26

### Remove

* [Unity] Remove built with Emscripten 1.38.48.
* Unity 2021.2 or later uses only Core under `Assets/Live2D/Cubism/Plugins/Experimental/Emscripten/latest`.


## 2023-09-28

### Remove
Expand Down
2 changes: 1 addition & 1 deletion Framework
Submodule Framework updated 34 files
+34 −0 CHANGELOG.md
+1 −1 README.ja.md
+1 −1 README.md
+11 −11 src/Effect/CubismPose.hpp
+5 −4 src/Id/CubismId.hpp
+24 −0 src/Math/CubismMath.cpp
+9 −0 src/Math/CubismMath.hpp
+2 −2 src/Model/CubismModel.cpp
+30 −15 src/Motion/ACubismMotion.cpp
+20 −13 src/Motion/ACubismMotion.hpp
+18 −24 src/Motion/CubismExpressionMotion.cpp
+16 −3 src/Motion/CubismExpressionMotion.hpp
+17 −3 src/Motion/CubismExpressionMotionManager.cpp
+12 −0 src/Motion/CubismExpressionMotionManager.hpp
+1 −1 src/Motion/CubismMotionManager.cpp
+34 −0 src/Motion/CubismMotionQueueManager.cpp
+12 −0 src/Motion/CubismMotionQueueManager.hpp
+5 −5 src/Rendering/Cocos2d/CubismRenderer_Cocos2dx.hpp
+67 −65 src/Rendering/Cocos2d/CubismShader_Cocos2dx.cpp
+44 −0 src/Rendering/Cocos2d/CubismShader_Cocos2dx.hpp
+108 −102 src/Rendering/D3D11/CubismRenderer_D3D11.cpp
+54 −0 src/Rendering/D3D11/CubismRenderer_D3D11.hpp
+72 −65 src/Rendering/D3D9/CubismRenderer_D3D9.cpp
+43 −0 src/Rendering/D3D9/CubismRenderer_D3D9.hpp
+5 −5 src/Rendering/Metal/CubismRenderer_Metal.hpp
+33 −0 src/Rendering/Metal/CubismShader_Metal.hpp
+66 −91 src/Rendering/Metal/CubismShader_Metal.mm
+2 −24 src/Rendering/Metal/MetalShaderTypes.h
+10 −10 src/Rendering/Metal/MetalShaders.metal
+61 −65 src/Rendering/OpenGL/CubismShader_OpenGLES2.cpp
+42 −0 src/Rendering/OpenGL/CubismShader_OpenGLES2.hpp
+86 −64 src/Rendering/Vulkan/CubismRenderer_Vulkan.cpp
+28 −1 src/Rendering/Vulkan/CubismRenderer_Vulkan.hpp
+3 −3 src/Rendering/Vulkan/Shaders/CMakeLists.txt
21 changes: 21 additions & 0 deletions NOTICE.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,27 @@

# お知らせ

## [注意事項] Apple社のPrivacy Manifest Policy対応について

Apple社が対応を必要としているPrivacy Manifest Policyについて、本製品では指定されているAPI及びサードパーティ製品を使用しておりません。
もし本製品で対応が必要と判断した場合、今後のアップデートにて順次対応する予定です。
詳しくはApple社が公開しているドキュメントをご確認ください。

* [Privacy updates for App Store submissions](https://developer.apple.com/news/?id=3d8a9yyh)


## [注意事項] Linux OpenGL環境でのWaylandのサポートについて (2024-03-26)

本製品がLinux OpenGL環境で利用している `GLFW 3.4` が、Wayland向けにコンパイルできるようになりました。
しかし、 `GLEW 2.2.0` では現在Wayland(EGL)向けのコンパイルを行うと `glewInit` が正常に動作しない状態であるため、本サンプルはWaylandに対応しておりません。

Linux OpenGL環境をご利用の方は、引き続き通常通りX11向けビルドをご利用ください。

詳しくは以下のissueを参照ください。

* [GLEW issue](https://github.com/nigels-com/glew/issues/172)


## [注意事項] Metal の Mac Catalyst のビルドエラーについて (2024-01-25)

MetalのMac Catalystのビルド時にエラーが発生する場合がございます。
Expand Down
21 changes: 21 additions & 0 deletions NOTICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,27 @@

# Notices

## [Caution] Support for Apple's Privacy Manifest Policy

This product does not use the APIs or third-party products specified in Apple's privacy manifest policy.
This will be addressed in future updates if this product requires such support.
Please check the documentation published by Apple for details.

* [Privacy updates for App Store submissions](https://developer.apple.com/news/?id=3d8a9yyh)


## [Caution] Support for Wayland in Linux OpenGL Environment (2024-03-26)

`GLFW 3.4`, which this product uses in the Linux OpenGL environment, can now be compiled for Wayland.
However, this sample is not compatible with Wayland because `glewInit` is currently not working properly when compiling for Wayland (EGL) in `GLEW 2.2.0`.

If you are using the Linux OpenGL environment, please continue to use the X11 build as usual.

Please refer to the issue below for details.

* [GLEW issue](https://github.com/nigels-com/glew/issues/172)


## [Caution] Mac Catalyst build error for Metal (2024-01-25)

There is an error when building Mac Catalyst for Metal.
Expand Down
36 changes: 20 additions & 16 deletions README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,27 +100,31 @@ Demo

## 変更履歴

当リポジトリの変更履歴については [CHANGELOG.md](CHANGELOG.md) を参照ください。
Samples : [CHANGELOG.md](CHANGELOG.md)

Framework : [CHANGELOG.md](Framework/CHANGELOG.md)

Core : [CHANGELOG.md](Core/CHANGELOG.md)


## 開発環境

| 開発ツール | バージョン |
| --- | --- |
| Android Studio | Hedgehog 2023.1.1 |
| CMake | 3.28.1 |
| Android Studio | Iguana 2023.2.1 |
| CMake | 3.28.3 |
| Visual Studio 2013 | Update 5 |
| Visual Studio 2015 | Update 3 |
| Visual Studio 2017 | 15.9.59 |
| Visual Studio 2019 | 16.11.33 |
| Visual Studio 2022 | 17.8.4 |
| Xcode | 15.1 |
| Visual Studio 2017 | 15.9.60 |
| Visual Studio 2019 | 16.11.34 |
| Visual Studio 2022 | 17.9.4 |
| Xcode | 15.3 |

### Android

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

Expand All @@ -131,9 +135,10 @@ Demo
| Red Hat | Amazon Linux 2 | `amazonlinux:2` | 7.3.1 |
| Red Hat | CentOS 7 | `centos:7` | 4.8.5 |
| Red Hat | CentOS Stream 8 *1 | `centos:latest` | 8.5.0 |
| Red Hat | CentOS Stream 9 | - | 11.3.1 |
| Red Hat | CentOS Stream 9 | - | 12.2.1 |
| Red Hat | AlmaLinux | `almalinux:latest` | 11.4.1 |
| Debian | Ubuntu 18.04 | `ubuntu:18.04` | 7.5.0 |
| Debian | Ubuntu 22.04.3 | `ubuntu:22.04.3` | 11.3.0 |
| Debian | Ubuntu 22.04.4 | `ubuntu:22.04` | 11.4.0 |

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

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

| プラットフォーム | バージョン |
| --- | --- |
| iOS / iPadOS | 16.6.1 |
| macOS | 14.1.1 |
| iOS / iPadOS | 17.4 |
| macOS | 14.4 |
| Windows 10 | 22H2 |
| Windows 11 | 22H2 |

Expand All @@ -168,17 +173,16 @@ Demo
| 系統 | ディストリビューション | バージョン |
| --- | --- | --- |
| Red Hat | Amazon Linux | 2 |
| Red Hat | CentOS Stream | 8 |
| Red Hat | CentOS Stream | 9 |
| Debian | Ubuntu | 22.04.3 |
| Red Hat | AlmaLinux | 9 |
| Debian | Ubuntu | 22.04.4 |

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

プロジェクトに貢献する方法はたくさんあります。バグのログの記録、このGitHubでのプルリクエストの送信、Live2Dコミュニティでの問題の報告と提案の作成です。

### フォークとプルリクエスト

修正、改善、さらには新機能をもたらすかどうかにかかわらず、プルリクエストに感謝します。ただし、ラッパーは可能な限り軽量で浅くなるように設計されているため、バグ修正とメモリ/パフォーマンスの改善のみを行う必要があることに注意してください。メインリポジトリを可能な限りクリーンに保つために、必要に応じて個人用フォークと機能ブランチを作成してください。
修正、改善、さらには新機能をもたらすかどうかにかかわらず、プルリクエストに感謝します。メインリポジトリを可能な限りクリーンに保つために、必要に応じて個人用フォークと機能ブランチを作成してください。

### バグ

Expand Down
36 changes: 20 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,27 +99,31 @@ Please refer to 'LAppLive2DManager.cpp' in the sample directory for details.

## Changelog

Please refer to [CHANGELOG.md](CHANGELOG.md) for the changelog of this repository.
Samples : [CHANGELOG.md](CHANGELOG.md)

Framework : [CHANGELOG.md](Framework/CHANGELOG.md)

Core : [CHANGELOG.md](Core/CHANGELOG.md)


## Development environment

| Development Tool | Version |
| --- | --- |
| Android Studio | Hedgehog 2023.1.1 |
| CMake | 3.28.1 |
| Android Studio | Iguana 2023.2.1 |
| CMake | 3.28.3 |
| Visual Studio 2013 | Update 5 |
| Visual Studio 2015 | Update 3 |
| Visual Studio 2017 | 15.9.59 |
| Visual Studio 2019 | 16.11.33 |
| Visual Studio 2022 | 17.8.4 |
| Xcode | 15.1 |
| Visual Studio 2017 | 15.9.60 |
| Visual Studio 2019 | 16.11.34 |
| Visual Studio 2022 | 17.9.4 |
| Xcode | 15.3 |

### Android

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

Expand All @@ -130,9 +134,10 @@ Please refer to [CHANGELOG.md](CHANGELOG.md) for the changelog of this repositor
| Red Hat | Amazon Linux 2 | `amazonlinux:2` | 7.3.1 |
| Red Hat | CentOS 7 | `centos:7` | 4.8.5 |
| Red Hat | CentOS Stream 8 *1 | `centos:latest` | 8.5.0 |
| Red Hat | CentOS Stream 9 | - | 11.3.1 |
| Red Hat | CentOS Stream 9 | - | 12.2.1 |
| Red Hat | AlmaLinux | `almalinux:latest` | 11.4.1 |
| Debian | Ubuntu 18.04 | `ubuntu:18.04` | 7.5.0 |
| Debian | Ubuntu 22.04.3 | `ubuntu:22.04.3` | 11.3.0 |
| Debian | Ubuntu 22.04.4 | `ubuntu:22.04` | 11.4.0 |

*1 CentOS 8 is not supported

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

| Platform | Version |
| --- | --- |
| iOS / iPadOS | 16.6.1 |
| macOS | 14.1.1 |
| iOS / iPadOS | 17.4 |
| macOS | 14.4 |
| Windows 10 | 22H2 |
| Windows 11 | 22H2 |

Expand All @@ -167,17 +172,16 @@ Please refer to [CHANGELOG.md](CHANGELOG.md) for the changelog of this repositor
| System | Distribution | Version |
| --- | --- | --- |
| Red Hat | Amazon Linux | 2 |
| Red Hat | CentOS Stream | 8 |
| Red Hat | CentOS Stream | 9 |
| Debian | Ubuntu | 22.04.3 |
| Red Hat | AlmaLinux | 9 |
| Debian | Ubuntu | 22.04.4 |

## Contributing

There are many ways to contribute to the project: logging bugs, submitting pull requests on this GitHub, and reporting issues and making suggestions in Live2D Community.

### Forking And Pull Requests

We very much appreciate your pull requests, whether they bring fixes, improvements, or even new features. Note, however, that the wrapper is designed to be as lightweight and shallow as possible and should therefore only be subject to bug fixes and memory/performance improvements. To keep the main repository as clean as possible, create a personal fork and feature branches there as needed.
We very much appreciate your pull requests, whether they bring fixes, improvements, or even new features. To keep the main repository as clean as possible, create a personal fork and feature branches there as needed.

### Bugs

Expand Down
2 changes: 1 addition & 1 deletion Samples/Cocos2d-x/Demo/Classes/AppDelegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ bool AppDelegate::applicationDidFinishLaunching()
register_all_packages();

// prepare for Cubism Framework API.
_cubismOption.LogFunction = LAppPal::PrintMessage;
_cubismOption.LogFunction = LAppPal::PrintMessageLn;
_cubismOption.LoggingLevel = LAppDefine::CubismLoggingLevel;
Csm::CubismFramework::StartUp(&_cubismAllocator, &_cubismOption);

Expand Down
12 changes: 6 additions & 6 deletions Samples/Cocos2d-x/Demo/Classes/LAppLive2DManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ namespace {

void FinishedMotion(ACubismMotion* self)
{
LAppPal::PrintLog("Motion Finished: %x", self);
LAppPal::PrintLogLn("Motion Finished: %x", self);
}

int CompareCsmString(const void* a, const void* b)
Expand Down Expand Up @@ -188,18 +188,18 @@ void LAppLive2DManager::OnDrag(csmFloat32 x, csmFloat32 y) const

void LAppLive2DManager::OnTap(csmFloat32 x, csmFloat32 y)
{
if (DebugLogEnable) LAppPal::PrintLog("[APP]tap point: {x:%.2f y:%.2f}", x, y);
if (DebugLogEnable) LAppPal::PrintLogLn("[APP]tap point: {x:%.2f y:%.2f}", x, y);

for (csmUint32 i = 0; i < _models.GetSize(); i++)
{
if (_models[i]->HitTest(HitAreaNameHead, x, y))
{
if (DebugLogEnable) LAppPal::PrintLog("[APP]hit area: [%s]", HitAreaNameHead);
if (DebugLogEnable) LAppPal::PrintLogLn("[APP]hit area: [%s]", HitAreaNameHead);
_models[i]->SetRandomExpression();
}
else if (_models[i]->HitTest(HitAreaNameBody, x, y))
{
if (DebugLogEnable) LAppPal::PrintLog("[APP]hit area: [%s]", HitAreaNameBody);
if (DebugLogEnable) LAppPal::PrintLogLn("[APP]hit area: [%s]", HitAreaNameBody);
_models[i]->StartRandomMotion(MotionGroupTapBody, PriorityNormal, FinishedMotion);
}
}
Expand All @@ -219,7 +219,7 @@ void LAppLive2DManager::OnUpdate(Csm::Rendering::CubismCommandBuffer_Cocos2dx* c

if (model->GetModel() == NULL)
{
LAppPal::PrintLog("Failed to model->GetModel().");
LAppPal::PrintLogLn("Failed to model->GetModel().");
continue;
}

Expand Down Expand Up @@ -294,7 +294,7 @@ void LAppLive2DManager::NextScene()
void LAppLive2DManager::ChangeScene(Csm::csmInt32 index)
{
_sceneIndex = index;
if (DebugLogEnable) LAppPal::PrintLog("[APP]model index: %d", _sceneIndex);
if (DebugLogEnable) LAppPal::PrintLogLn("[APP]model index: %d", _sceneIndex);

// ModelDir[]に保持したディレクトリ名から
// model3.jsonのパスを決定する.
Expand Down
Loading

0 comments on commit 7671506

Please sign in to comment.