⚡ v0.125.0 VRMShaders の整理
https://github.com/vrm-c/UniVRM/releases/tag/v0.125.0
https://github.com/vrm-c/UniVRM/milestone/90?closed=1
Updates
v0.125.0 に含まれる更新
https://github.com/vrm-c/UniVRM/issues/2337
`// Packages/manifest.json
{
"dependencies": {
// v0.125.0 から com.vrmc.vrmshaders の記述は不要になります。
"com.vrmc.vrmshaders": "https://github.com/vrm-c/UniVRM.git?path=/Assets/VRMShaders#v0.124.2",
}
}
VRMC_springBone_extended_collider
spec version 1.0
Breaking Changes
Resources
ディレクトリからのシェーダ移動にともなう対応
アプリケーションのビルド時間短縮・ビルドサイズ削減のため、UniVRM の Resources
ディレクトリからシェーダを移動しました。
これに伴い、いくつかのシェーダを Unity プロジェクトに登録する必要があります。
詳しくは以下のページを参照してください。
glTF ファイルを扱うアプリの場合
RenderPipeline に応じて以下のシェーダを Project Settings の Always Included Shaders に追加してください。
Built-in RP | URP | |
---|---|---|
Standard | ✅ | - |
Univesal Render Pipeline/Lit | - | ✅ |
UniGLTF/UniUnlit | ✅ | ✅ |
VRM 0.X ファイルを扱うアプリの場合
RenderPipeline に応じて以下のシェーダを Project Settings の Always Included Shaders に追加してください。
Built-in RP | URP | |
---|---|---|
Standard | ✅ | - |
Univesal Render Pipeline/Lit | - | ✅ |
UniGLTF/UniUnlit | ✅ | ✅ |
VRM/MToon | ✅ | - |
URP用 MToon シェーダ(未実装) | - | - |
VRM 1.0 ファイルを扱うアプリの場合
RenderPipeline に応じて以下のシェーダを Project Settings の Always Included Shaders に追加してください。
Built-in RP | URP | |
---|---|---|
Standard | ✅ | - |
Univesal Render Pipeline/Lit | - | ✅ |
UniGLTF/UniUnlit | ✅ | ✅ |
VRM10/MToon10 | ✅ | - |
VRM10/Universal Render Pipeline/MToon10 | - | ✅ |
com.vrmc.vrmshaders
UPM パッケージの廃止にともなう対応
UPM Package を利用している場合の更新手順
Packages/manifest.json
からcom.vrmc.vrmshaders
の記述を削除してください。Packages/manifest.json
のcom.vrmc.*
パッケージの指定バージョンをv0.125.0
に更新してください。
Before
{
"dependencies": {
"com.vrmc.vrmshaders": "https://github.com/vrm-c/UniVRM.git?path=/Assets/VRMShaders#v0.124.2",
"com.vrmc.gltf": "https://github.com/vrm-c/UniVRM.git?path=/Assets/UniGLTF#v0.124.2",
"com.vrmc.univrm": "https://github.com/vrm-c/UniVRM.git?path=/Assets/VRM#v0.124.2",
"com.vrmc.vrm": "https://github.com/vrm-c/UniVRM.git?path=/Assets/VRM10#v0.124.2"
// ...
}
}
After
{
"dependencies": {
"com.vrmc.gltf": "https://github.com/vrm-c/UniVRM.git?path=/Assets/UniGLTF#v0.125.0",
"com.vrmc.univrm": "https://github.com/vrm-c/UniVRM.git?path=/Assets/VRM#v0.125.0",
"com.vrmc.vrm": "https://github.com/vrm-c/UniVRM.git?path=/Assets/VRM10#v0.125.0"
// ...
}
}
UnityPackage を利用している場合の更新手順
- UniVRM のフォルダをすべて削除してください。
- UniVRM v0.125.0 の UnityPackage をインポートしてください。
該当のフォルダ
Assets/VRMShaders
Assets/UniGLTF
Assets/VRM
Assets/VRM10
UniVRM の Assembly Definition を参照している場合
以下の Assembly Definition を参照している場合は変更が必要です。
before | after |
---|---|
VRMShaders.GLTF.IO.Runtime.asmdef | UniGLTF.asmdef |
VRMShaders.GLTF.IO.Editor.asmdef | UniGLTF.Editor.asmdef |
VRMShaders.GLTF.IO.Tests.asmdef | UniGLTF.Tests.asmdef |
VRMShaders.GLTF.UniUnlit.Runtime.asmdef | VRMShaders.GLTF.UniUnlit.asmdef |
VRMShaders.GLTF.UniUnlit.Editor.asmdef | UniGLTF.UniUnlit.Editor.asmdef |
VRMShaders.VRM.IO.Runtime.asmdef | VRM.asmdef |
VRMShaders.VRM10.Format.Runtime.asmdef | VRM10.asmdef |
VRMShaders.VRM10.MToon10.Runtime.asmdef | VRM10.MToon10.asmdef |
VRMShaders.VRM10.MToon10.Editor.asmdef | VRM10.MToon10.Editor.asmdef |
VRMShaders.VRM10.MToon10.Tests.asmdef | VRM10.MToon10.Tests.asmdef |
UniVRM の VRMShaders 名前空間の型を参照している場合
以下の VRMShaders.*
名前空間の型を参照している場合は変更が必要です。
before | after |
---|---|
VRMShaders.* | UniGLTF.* |
UniGLTF.ShaderPropExporter.* | VRM.* |
VRMShaders.VRM10.MToon10.Runtime.* | VRM10.MToon10.* |
VRMShaders.VRM10.MToon10.Editor.* | VRM10.MToon10.Editor.* |
IMaterialDescriptorGenerator
のシグネチャ変更にともなう対応
glTF, VRM0.X, VRM1.0 ファイルを独自のシェーダを用いて Import する機能を実装している場合は、以下の変更に対応してください。
before
public interface IMaterialDescriptorGenerator
{
MaterialDescriptor Get(GltfData data, int i);
MaterialDescriptor GetGltfDefault();
}
after
public interface IMaterialDescriptorGenerator
{
MaterialDescriptor Get(GltfData data, int i);
MaterialDescriptor GetGltfDefault(string materialName = null);
}
Vrm10Exporter
のシグネチャ変更にともなう対応
VRM 1.0 の Export 機能を独自に実装している場合は、以下の変更に対応してください。
before
public class Vrm10Exporter : IDisposable
{
public Vrm10Exporter(
ITextureSerializer textureSerializer,
GltfExportSettings settings);
public static byte[] Export(
GameObject go,
ITextureSerializer textureSerializer = null,
VRM10ObjectMeta vrmMeta = null);
}
after
public class Vrm10Exporter : IDisposable
{
public Vrm10Exporter(
GltfExportSettings settings,
IMaterialExporter materialExporter = null,
ITextureSerializer textureSerializer = null);
public static byte[] Export(
GameObject go,
IMaterialExporter materialExporter = null,
ITextureSerializer textureSerializer = null,
VRM10ObjectMeta vrmMeta = null);
}