├── .gitattributes
├── LICENSE
├── LICENSE.meta
├── README.md
├── README.md.meta
├── UnityPMXImporterSample.unitypackage.meta
├── UnityPMXRuntimeLoader.meta
├── UnityPMXRuntimeLoader.unitypackage
├── UnityPMXRuntimeLoader.unitypackage.meta
├── UnityPMXRuntimeLoader
├── LICENSE
├── LICENSE.meta
├── LibMMD.meta
├── LibMMD
│ ├── Extension.meta
│ ├── Extension
│ │ ├── Texture2DExtension.cs
│ │ └── Texture2DExtension.cs.meta
│ ├── Material.meta
│ ├── Material
│ │ ├── MMDMaterial.cs
│ │ ├── MMDMaterial.cs.meta
│ │ ├── MMDTexture.cs
│ │ └── MMDTexture.cs.meta
│ ├── Model.meta
│ ├── Model
│ │ ├── Bone.cs
│ │ ├── Bone.cs.meta
│ │ ├── Joint.cs
│ │ ├── Joint.cs.meta
│ │ ├── MMDRigidBody.cs
│ │ ├── MMDRigidBody.cs.meta
│ │ ├── Morph.cs
│ │ ├── Morph.cs.meta
│ │ ├── Part.cs
│ │ ├── Part.cs.meta
│ │ ├── RawMMDModel.cs
│ │ ├── RawMMDModel.cs.meta
│ │ ├── SkinningOperator.cs
│ │ ├── SkinningOperator.cs.meta
│ │ ├── Vertex.cs
│ │ └── Vertex.cs.meta
│ ├── Plugins.meta
│ ├── Plugins
│ │ ├── I18N.CJK.dll
│ │ └── I18N.CJK.dll.meta
│ ├── Reader.meta
│ ├── Reader
│ │ ├── ByteArrayReader.cs
│ │ ├── ByteArrayReader.cs.meta
│ │ ├── MMDFileParseException.cs
│ │ ├── MMDFileParseException.cs.meta
│ │ ├── ModelReadConfig.cs
│ │ ├── ModelReadConfig.cs.meta
│ │ ├── ModelReader.cs
│ │ ├── ModelReader.cs.meta
│ │ ├── PMDReader.cs
│ │ ├── PMDReader.cs.meta
│ │ ├── PMXReader.cs
│ │ └── PMXReader.cs.meta
│ ├── Resources.meta
│ ├── Resources
│ │ ├── LibMmd.meta
│ │ ├── LibMmd
│ │ │ ├── SysToon.meta
│ │ │ └── SysToon
│ │ │ │ ├── toon0.bmp
│ │ │ │ ├── toon0.bmp.meta
│ │ │ │ ├── toon01.bmp
│ │ │ │ ├── toon01.bmp.meta
│ │ │ │ ├── toon02.bmp
│ │ │ │ ├── toon02.bmp.meta
│ │ │ │ ├── toon03.bmp
│ │ │ │ ├── toon03.bmp.meta
│ │ │ │ ├── toon04.bmp
│ │ │ │ ├── toon04.bmp.meta
│ │ │ │ ├── toon05.bmp
│ │ │ │ ├── toon05.bmp.meta
│ │ │ │ ├── toon06.bmp
│ │ │ │ ├── toon06.bmp.meta
│ │ │ │ ├── toon07.bmp
│ │ │ │ ├── toon07.bmp.meta
│ │ │ │ ├── toon08.bmp
│ │ │ │ ├── toon08.bmp.meta
│ │ │ │ ├── toon09.bmp
│ │ │ │ ├── toon09.bmp.meta
│ │ │ │ ├── toon10.bmp
│ │ │ │ └── toon10.bmp.meta
│ │ ├── Prefabs.meta
│ │ ├── Prefabs
│ │ │ ├── MMDGameObject.prefab
│ │ │ └── MMDGameObject.prefab.meta
│ │ ├── Shaders.meta
│ │ └── Shaders
│ │ │ ├── MeshPmdMaterial-CullBack-NoCastShadow.shader
│ │ │ ├── MeshPmdMaterial-CullBack-NoCastShadow.shader.meta
│ │ │ ├── MeshPmdMaterial-CullBack.shader
│ │ │ ├── MeshPmdMaterial-CullBack.shader.meta
│ │ │ ├── MeshPmdMaterial-NoCastShadow.shader
│ │ │ ├── MeshPmdMaterial-NoCastShadow.shader.meta
│ │ │ ├── MeshPmdMaterial-Trans-CullBack-NoCastShadow.shader
│ │ │ ├── MeshPmdMaterial-Trans-CullBack-NoCastShadow.shader.meta
│ │ │ ├── MeshPmdMaterial-Trans-CullBack.shader
│ │ │ ├── MeshPmdMaterial-Trans-CullBack.shader.meta
│ │ │ ├── MeshPmdMaterial-Trans-NoCastShadow.shader
│ │ │ ├── MeshPmdMaterial-Trans-NoCastShadow.shader.meta
│ │ │ ├── MeshPmdMaterial-Trans.shader
│ │ │ ├── MeshPmdMaterial-Trans.shader.meta
│ │ │ ├── MeshPmdMaterial.shader
│ │ │ ├── MeshPmdMaterial.shader.meta
│ │ │ ├── MeshPmdMaterialDummy.shader
│ │ │ ├── MeshPmdMaterialDummy.shader.meta
│ │ │ ├── MeshPmdMaterialOutline-CullBack-NoCastShadow.shader
│ │ │ ├── MeshPmdMaterialOutline-CullBack-NoCastShadow.shader.meta
│ │ │ ├── MeshPmdMaterialOutline-CullBack.shader
│ │ │ ├── MeshPmdMaterialOutline-CullBack.shader.meta
│ │ │ ├── MeshPmdMaterialOutline-NoCastShadow.shader
│ │ │ ├── MeshPmdMaterialOutline-NoCastShadow.shader.meta
│ │ │ ├── MeshPmdMaterialOutline-Trans-CullBack-NoCastShadow.shader
│ │ │ ├── MeshPmdMaterialOutline-Trans-CullBack-NoCastShadow.shader.meta
│ │ │ ├── MeshPmdMaterialOutline-Trans-CullBack.shader
│ │ │ ├── MeshPmdMaterialOutline-Trans-CullBack.shader.meta
│ │ │ ├── MeshPmdMaterialOutline-Trans-NoCastShadow.shader
│ │ │ ├── MeshPmdMaterialOutline-Trans-NoCastShadow.shader.meta
│ │ │ ├── MeshPmdMaterialOutline-Trans.shader
│ │ │ ├── MeshPmdMaterialOutline-Trans.shader.meta
│ │ │ ├── MeshPmdMaterialOutline.shader
│ │ │ ├── MeshPmdMaterialOutline.shader.meta
│ │ │ ├── MeshPmdMaterialShadowVertFrag.cginc
│ │ │ ├── MeshPmdMaterialShadowVertFrag.cginc.meta
│ │ │ ├── MeshPmdMaterialSurface.cginc
│ │ │ ├── MeshPmdMaterialSurface.cginc.meta
│ │ │ ├── MeshPmdMaterialVertFrag.cginc
│ │ │ └── MeshPmdMaterialVertFrag.cginc.meta
│ ├── Unity3D.meta
│ ├── Unity3D
│ │ ├── AvatarMaker.cs
│ │ ├── AvatarMaker.cs.meta
│ │ ├── ImageLoader.meta
│ │ ├── ImageLoader
│ │ │ ├── BitmapLoader.cs
│ │ │ ├── BitmapLoader.cs.meta
│ │ │ ├── DDSLoader.cs
│ │ │ ├── DDSLoader.cs.meta
│ │ │ ├── TargaImage.cs
│ │ │ ├── TargaImage.cs.meta
│ │ │ ├── TextureImage.cs
│ │ │ └── TextureImage.cs.meta
│ │ ├── MMDModel.cs
│ │ ├── MMDModel.cs.meta
│ │ ├── MMDUnityConfig.cs
│ │ ├── MMDUnityConfig.cs.meta
│ │ ├── MaterialLoader.cs
│ │ ├── MaterialLoader.cs.meta
│ │ ├── MaterialMorphRemover.cs
│ │ ├── MaterialMorphRemover.cs.meta
│ │ ├── ModelPart.cs
│ │ ├── ModelPart.cs.meta
│ │ ├── PMXModelLoader.cs
│ │ ├── PMXModelLoader.cs.meta
│ │ ├── TextureLoader.cs
│ │ ├── TextureLoader.cs.meta
│ │ ├── TextureScale.cs
│ │ ├── TextureScale.cs.meta
│ │ ├── Utils.cs
│ │ └── Utils.cs.meta
│ ├── Util.meta
│ ├── Util
│ │ ├── BlockingQueue.cs
│ │ ├── BlockingQueue.cs.meta
│ │ ├── LogUtil.cs
│ │ ├── LogUtil.cs.meta
│ │ ├── MMDReaderUtil.cs
│ │ ├── MMDReaderUtil.cs.meta
│ │ ├── MMDTextureUtil.cs
│ │ ├── MMDTextureUtil.cs.meta
│ │ ├── MathUtil.cs
│ │ ├── MathUtil.cs.meta
│ │ ├── MatrixExtensions.cs
│ │ ├── MatrixExtensions.cs.meta
│ │ ├── SynchronizedQueue.cs
│ │ ├── SynchronizedQueue.cs.meta
│ │ ├── Tools.cs
│ │ ├── Tools.cs.meta
│ │ ├── TransformExtensions.cs
│ │ └── TransformExtensions.cs.meta
│ ├── libmmd-for-unity LICENSE.txt
│ └── libmmd-for-unity LICENSE.txt.meta
├── README.md
├── README.md.meta
├── VRM.meta
├── VRM
│ ├── UniVRM LICENSE.txt
│ ├── UniVRM LICENSE.txt.meta
│ ├── UniVRM.meta
│ └── UniVRM
│ │ ├── Resources.meta
│ │ └── Resources
│ │ ├── Shaders.meta
│ │ └── Shaders
│ │ ├── VRMShaders.shadervariants
│ │ ├── VRMShaders.shadervariants.meta
│ │ ├── VRMUnlitCutout.shader
│ │ ├── VRMUnlitCutout.shader.meta
│ │ ├── VRMUnlitTexture.shader
│ │ ├── VRMUnlitTexture.shader.meta
│ │ ├── VRMUnlitTransparent.shader
│ │ ├── VRMUnlitTransparent.shader.meta
│ │ ├── VRMUnlitTransparentZWrite.shader
│ │ └── VRMUnlitTransparentZWrite.shader.meta
├── VoidShader.meta
└── VoidShader
│ ├── CustomVoidShader.shader
│ └── CustomVoidShader.shader.meta
└── UnityPMXRuntimeLoaderSample.unitypackage
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 hobosore
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/LICENSE.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 0a73a014f15c72c428c0954bec7da7ed
3 | DefaultImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # UnityPMXRuntimeLoader
2 |
3 | pmxファイル(mmdのモデルファイル)をUnityに直接(変換なしに、動的に、スクリプトから)読み込むためのコード。
4 | PMXModelLoader.LoadPMXModel(string path)
5 | でモデルを読み込めます。
6 | 剛体とジョイントをサポート~~しています~~しようとしていました。
7 | また、人モデルの場合アバターを自動生成します。
8 |
9 |
10 | 使用に特に制限は設けませんが、公序良俗の範囲でお願いします。
11 | また、このコードを使用して生じた問題について制作者は責任を負いません。
12 | 答えられるかはわかりませんが、不具合や要望があれば遠慮なくご連絡ください。
13 |
14 | **MIT License**
15 |
16 | Hobosore@hobosore
17 | hobosore@gmail.com
18 |
--------------------------------------------------------------------------------
/README.md.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: b425c8f392f2f83498e092b7bcded2e9
3 | TextScriptImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/UnityPMXImporterSample.unitypackage.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d3475dc25252ff94db27502f3f7d0226
3 | DefaultImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 4764e6b71c398c84c89691fc908d8dd9
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader.unitypackage:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hobosore/UnityPMXRuntimeLoader/3b97fe0a4db15311794ee30996bfacaf6a9b07be/UnityPMXRuntimeLoader.unitypackage
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader.unitypackage.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: f1b4460b24bb3f445a07bafc63d636d7
3 | DefaultImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 hobosore
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LICENSE.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 35aeaadcbad6b854a802ff3599f97f74
3 | DefaultImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: aa28e550e06110d46a2730835d37116e
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Extension.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: eda5c0d55dec76c489bd59a4e8998ada
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Extension/Texture2DExtension.cs:
--------------------------------------------------------------------------------
1 | using System.Collections;
2 | using System.Collections.Generic;
3 | using UnityEngine;
4 |
5 | public static class Texture2DExtension
6 | {
7 | public static Texture2D CreateReadabeTexture2D(this Texture2D texture2d)
8 | {
9 | RenderTexture renderTexture = RenderTexture.GetTemporary(
10 | texture2d.width,
11 | texture2d.height,
12 | 0,
13 | RenderTextureFormat.Default,
14 | RenderTextureReadWrite.Linear);
15 |
16 | Graphics.Blit(texture2d, renderTexture);
17 | RenderTexture previous = RenderTexture.active;
18 | RenderTexture.active = renderTexture;
19 | Texture2D readableTextur2D = new Texture2D(texture2d.width, texture2d.height);
20 | readableTextur2D.ReadPixels(new Rect(0, 0, renderTexture.width, renderTexture.height), 0, 0);
21 | readableTextur2D.Apply();
22 | RenderTexture.active = previous;
23 | RenderTexture.ReleaseTemporary(renderTexture);
24 | return readableTextur2D;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Extension/Texture2DExtension.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 3b8cc2a385b1d5c4fb754bc89a35af77
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Material.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 99947f5bd2591ae4085f2494567a6621
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Material/MMDMaterial.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 |
3 | namespace LibMMD.Material
4 | {
5 | public class MMDMaterial
6 | {
7 | public enum SubTextureTypeEnum : byte
8 | {
9 | MatSubTexOff = 0,
10 | MatSubTexSph = 1,
11 | MatSubTexSpa = 2,
12 | MatSubTexSub = 3
13 | }
14 |
15 | public string Name { get; set; }
16 | public string NameEn { get; set; }
17 |
18 | public Color DiffuseColor { get; set; }
19 | public Color SpecularColor { get; set; }
20 | public Color AmbientColor { get; set; }
21 |
22 | public float Shiness { get; set; }
23 |
24 | public bool DrawDoubleFace { get; set; }
25 | public bool DrawGroundShadow { get; set; }
26 | public bool CastSelfShadow { get; set; }
27 | public bool DrawSelfShadow { get; set; }
28 | public bool DrawEdge { get; set; }
29 |
30 | public Color EdgeColor { get; set; }
31 | public float EdgeSize { get; set; }
32 |
33 | public MMDTexture Toon { get; set; }
34 | public MMDTexture Texture { get; set; }
35 | public MMDTexture SubTexture { get; set; }
36 | public SubTextureTypeEnum SubTextureType { get; set; }
37 |
38 |
39 | public string MetaInfo { get; set; }
40 | }
41 | }
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Material/MMDMaterial.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 439296348e1847745b21029b3e124fb3
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Material/MMDTexture.cs:
--------------------------------------------------------------------------------
1 | namespace LibMMD.Material
2 | {
3 | public class MMDTexture
4 | {
5 | public string TexturePath { get; set; }
6 |
7 | public MMDTexture(string texturePath)
8 | {
9 | TexturePath = texturePath;
10 | }
11 |
12 | protected bool Equals(MMDTexture other)
13 | {
14 | return string.Equals(TexturePath, other.TexturePath);
15 | }
16 |
17 | public override bool Equals(object obj)
18 | {
19 | if (ReferenceEquals(null, obj)) return false;
20 | if (ReferenceEquals(this, obj)) return true;
21 | if (obj.GetType() != this.GetType()) return false;
22 | return Equals((MMDTexture) obj);
23 | }
24 |
25 | public override int GetHashCode()
26 | {
27 | return TexturePath != null ? TexturePath.GetHashCode() : 0;
28 | }
29 |
30 | private MMDTexture()
31 | {
32 |
33 | }
34 | }
35 | }
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Material/MMDTexture.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 748fb3d767b3fb84faabacb9d3899280
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Model.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: e8dd6dee04f840d43985c9bddcdbf3e1
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Model/Bone.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using UnityEngine;
4 |
5 | namespace LibMMD.Model
6 | {
7 | public class Bone
8 | {
9 | public class IkLink
10 | {
11 | public int LinkIndex { get; set; }
12 | public bool HasLimit { get; set; }
13 | public Vector3 LoLimit { get; set; }
14 | public Vector3 HiLimit { get; set; }
15 |
16 | public static IkLink CopyOf(IkLink ikLink)
17 | {
18 | return new IkLink
19 | {
20 | LinkIndex = ikLink.LinkIndex,
21 | HasLimit = ikLink.HasLimit,
22 | LoLimit = ikLink.LoLimit,
23 | HiLimit = ikLink.HiLimit
24 | };
25 | }
26 | }
27 |
28 | public class ChildBone
29 | {
30 | public bool ChildUseId { get; set; }
31 | public Vector3 Offset { get; set; }
32 | public int Index { get; set; }
33 |
34 | public static ChildBone CopyOf(ChildBone childBone)
35 | {
36 | return new ChildBone
37 | {
38 | ChildUseId = childBone.ChildUseId,
39 | Offset = childBone.Offset,
40 | Index = childBone.Index
41 | };
42 | }
43 | }
44 |
45 |
46 | public class AppendBone
47 | {
48 | public int Index { get; set; }
49 | public float Ratio { get; set; }
50 |
51 | public static AppendBone CopyOf(AppendBone appendBone)
52 | {
53 | return new AppendBone
54 | {
55 | Index = appendBone.Index,
56 | Ratio = appendBone.Ratio
57 | };
58 | }
59 | }
60 |
61 | public class IkInfo
62 | {
63 | public int IkTargetIndex { get; set; }
64 | public int CcdIterateLimit { get; set; }
65 | public float CcdAngleLimit { get; set; }
66 | public IkLink[] IkLinks { get; set; }
67 |
68 | public static IkInfo CopyOf(IkInfo ikInfo)
69 | {
70 | var ikLinksCopy = new IkLink[ikInfo.IkLinks.Length];
71 | ikInfo.IkLinks.CopyTo(ikLinksCopy, 0);
72 | return new IkInfo
73 | {
74 | IkTargetIndex = ikInfo.IkTargetIndex,
75 | CcdIterateLimit = ikInfo.CcdIterateLimit,
76 | CcdAngleLimit = ikInfo.CcdAngleLimit,
77 | IkLinks = ikLinksCopy
78 | };
79 | }
80 | }
81 |
82 | public class LocalAxis
83 | {
84 | public Vector3 AxisX { get; set; }
85 | public Vector3 AxisY { get; set; }
86 | public Vector3 AxisZ { get; set; }
87 |
88 | public static LocalAxis CopyOf(LocalAxis localAxis)
89 | {
90 | return new LocalAxis
91 | {
92 | AxisX = localAxis.AxisX,
93 | AxisY = localAxis.AxisY,
94 | AxisZ = localAxis.AxisZ
95 | };
96 | }
97 | }
98 |
99 | public Bone()
100 | {
101 | ChildBoneVal = new ChildBone();
102 | AppendBoneVal = new AppendBone();
103 | LocalAxisVal = new LocalAxis();
104 | }
105 |
106 | public string Name { get; set; }
107 | public string NameEn { get; set; }
108 | public Vector3 Position { get; set; }
109 | public int ParentIndex { get; set; }
110 | public int TransformLevel { get; set; }
111 | public bool Rotatable { get; set; }
112 | public bool Movable { get; set; }
113 | public bool Visible { get; set; }
114 | public bool Controllable { get; set; }
115 | public bool HasIk { get; set; }
116 | public bool AppendRotate { get; set; }
117 | public bool AppendTranslate { get; set; }
118 | public bool RotAxisFixed { get; set; }
119 | public bool UseLocalAxis { get; set; }
120 | public bool PostPhysics { get; set; }
121 | public bool ReceiveTransform { get; set; }
122 | public ChildBone ChildBoneVal { get; set; }
123 | public AppendBone AppendBoneVal { get; set; }
124 | public Vector3 RotAxis { get; set; }
125 | public LocalAxis LocalAxisVal { get; set; }
126 | public int ExportKey { get; set; }
127 | public IkInfo IkInfoVal { get; set; }
128 |
129 | public static Bone CopyOf(Bone bone)
130 | {
131 | return new Bone
132 | {
133 | Name = bone.Name,
134 | NameEn = bone.NameEn,
135 | Position = bone.Position,
136 | ParentIndex = bone.ParentIndex,
137 | TransformLevel = bone.TransformLevel,
138 | Rotatable = bone.Rotatable,
139 | Movable = bone.Movable,
140 | Visible = bone.Visible,
141 | Controllable = bone.Controllable,
142 | HasIk = bone.HasIk,
143 | AppendRotate = bone.AppendRotate,
144 | AppendTranslate = bone.AppendTranslate,
145 | RotAxisFixed = bone.RotAxisFixed,
146 | UseLocalAxis = bone.UseLocalAxis,
147 | PostPhysics = bone.PostPhysics,
148 | ReceiveTransform = bone.ReceiveTransform,
149 | ChildBoneVal = ChildBone.CopyOf(bone.ChildBoneVal),
150 | AppendBoneVal = AppendBone.CopyOf(bone.AppendBoneVal),
151 | RotAxis = bone.RotAxis,
152 | LocalAxisVal = LocalAxis.CopyOf(bone.LocalAxisVal),
153 | ExportKey = bone.ExportKey,
154 | IkInfoVal = IkInfo.CopyOf(bone.IkInfoVal),
155 | };
156 | }
157 |
158 |
159 | }
160 | }
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Model/Bone.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 0cd3fbcfbcc9edc4a8ba7660a838d4dc
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Model/Joint.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 |
3 | namespace LibMMD.Model
4 | {
5 | public class Joint
6 | {
7 | public Joint()
8 | {
9 | AssociatedRigidBodyIndex = new int[2];
10 | }
11 |
12 | public string Name { get; set; }
13 | public string NameEn { get; set; }
14 | public int[] AssociatedRigidBodyIndex { get; set; }
15 | public Vector3 Position { get; set; }
16 | public Vector3 Rotation { get; set; }
17 | public Vector3 PositionLowLimit { get; set; }
18 | public Vector3 PositionHiLimit { get; set; }
19 | public Vector3 RotationLowLimit { get; set; }
20 | public Vector3 RotationHiLimit { get; set; }
21 | public Vector3 SpringTranslate { get; set; }
22 | public Vector3 SpringRotate { get; set; }
23 | }
24 | }
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Model/Joint.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 10f6db9a9b776f341bfd7b5aabda88ae
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Model/MMDRigidBody.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 |
3 | namespace LibMMD.Model
4 | {
5 | public class MMDRigidBody
6 | {
7 | public enum RigidBodyShape : byte
8 | {
9 | RigidShapeSphere = 0x00,
10 | RigidShapeBox = 0x01,
11 | RigidShapeCapsule = 0x02
12 | }
13 |
14 | public enum RigidBodyType : byte
15 | {
16 | RigidTypeKinematic = 0x00,
17 | RigidTypePhysics = 0x01,
18 | RigidTypePhysicsStrict = 0x02,
19 | RigidTypePhysicsGhost = 0x03
20 | }
21 |
22 | public string Name { get; set; }
23 | public string NameEn { get; set; }
24 | public int AssociatedBoneIndex { get; set; }
25 | public int CollisionGroup { get; set; }
26 | public ushort CollisionMask { get; set; }
27 | public RigidBodyShape Shape { get; set; }
28 | public Vector3 Dimemsions { get; set; }
29 | public Vector3 Position { get; set; }
30 | public Vector3 Rotation { get; set; }
31 | public float Mass { get; set; }
32 | public float TranslateDamp { get; set; }
33 | public float RotateDamp { get; set; }
34 | public float Restitution { get; set; }
35 | public float Friction { get; set; }
36 | public RigidBodyType Type { get; set; }
37 | }
38 | }
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Model/MMDRigidBody.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 395400370dc114b4bbe68e03a1c99a0c
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Model/Morph.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using LibMMD.Util;
3 | using UnityEngine;
4 |
5 | namespace LibMMD.Model
6 | {
7 | public class Morph
8 | {
9 | public enum MorphCategory : byte
10 | {
11 | MorphCatSystem = 0x00,
12 | MorphCatEyebrow = 0x01,
13 | MorphCatEye = 0x02,
14 | MorphCatMouth = 0x03,
15 | MorphCatOther = 0x04
16 | }
17 |
18 | public enum MorphType : byte
19 | {
20 | MorphTypeGroup = 0x00,
21 | MorphTypeVertex = 0x01,
22 | MorphTypeBone = 0x02,
23 | MorphTypeUv = 0x03,
24 | MorphTypeExtUv1 = 0x04,
25 | MorphTypeExtUv2 = 0x05,
26 | MorphTypeExtUv3 = 0x06,
27 | MorphTypeExtUv4 = 0x07,
28 | MorphTypeMaterial = 0x08
29 | }
30 |
31 | public abstract class MorphData
32 | {
33 | }
34 |
35 | public class GroupMorphData : MorphData
36 | {
37 | public int MorphIndex { get; set; }
38 | public float MorphRate { get; set; }
39 | }
40 |
41 | public class VertexMorphData : MorphData
42 | {
43 | public int VertexIndex { get; set; }
44 | public Vector3 Offset { get; set; }
45 | }
46 |
47 | public class BoneMorphData : MorphData
48 | {
49 | public int BoneIndex { get; set; }
50 | public Vector3 Translation { get; set; }
51 | public Quaternion Rotation { get; set; }
52 | }
53 |
54 | public class UvMorphData : MorphData
55 | {
56 | public int VertexIndex { get; set; }
57 | public Vector4 Offset { get; set; }
58 | }
59 |
60 | public class MaterialMorphData : MorphData
61 | {
62 | public enum MaterialMorphMethod : byte {
63 | MorphMatMul = 0x00,
64 | MorphMatAdd = 0x01
65 | }
66 |
67 | public int MaterialIndex { get; set; }
68 | public bool Global { get; set; }
69 | public MaterialMorphMethod Method { get; set; }
70 | public Color Diffuse { get; set; }
71 | public Color Specular { get; set; }
72 | public Color Ambient { get; set; }
73 | public float Shiness { get; set; }
74 | public Color EdgeColor { get; set; }
75 | public float EdgeSize { get; set; }
76 | public Vector4 Texture { get; set; }
77 | public Vector4 SubTexture { get; set; }
78 | public Vector4 ToonTexture { get; set; }
79 | }
80 |
81 | public string Name { get; set; }
82 | public string NameEn { get; set; }
83 | public MorphCategory Category { get; set; }
84 | public MorphType Type { get; set; }
85 | public MorphData[] MorphDatas { get; set; }
86 | }
87 | }
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Model/Morph.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: f7f998f4d72211a4bbfa615fed8ceacb
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Model/Part.cs:
--------------------------------------------------------------------------------
1 | namespace LibMMD.Model
2 | {
3 | public class Part
4 | {
5 | public Material.MMDMaterial Material { get; set; }
6 | public int BaseShift { get; set; } //注意这个和libmmd里的含义不同,这里是三角形顶点数
7 | public int TriangleIndexNum { get; set; }
8 | }
9 | }
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Model/Part.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d0fb693cf5950c84499b613bb97a23eb
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Model/RawMMDModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace LibMMD.Model
4 | {
5 | public class RawMMDModel
6 | {
7 | public string Name { get; set; }
8 | public string NameEn { get; set; }
9 | public string Description { get; set; }
10 | public string DescriptionEn { get; set; }
11 | public Vertex[] Vertices { get; set; }
12 | public int ExtraUvNumber { get; set; }
13 | public int[] TriangleIndexes { get; set; }
14 | public Part[] Parts { get; set; }
15 | public Bone[] Bones { get; set; }
16 | public Morph[] Morphs { get; set; }
17 | public MMDRigidBody[] Rigidbodies { get; set; }
18 | public Joint[] Joints { get; set; }
19 |
20 | public void Normalize()
21 | {
22 | foreach (var vertex in Vertices)
23 | {
24 | switch (vertex.SkinningOperator.Type)
25 | {
26 | case SkinningOperator.SkinningType.SkinningBdef2:
27 | {
28 | var oldBdef2 = (SkinningOperator.Bdef2) vertex.SkinningOperator.Param;
29 | var weight = oldBdef2.BoneWeight;
30 | if (Math.Abs(weight) < 0.000001f)
31 | {
32 | var bdef1 = new SkinningOperator.Bdef1 {BoneId = oldBdef2.BoneId[1]};
33 | vertex.SkinningOperator.Param = bdef1;
34 | vertex.SkinningOperator.Type = SkinningOperator.SkinningType.SkinningBdef1;
35 | }
36 | else if (Math.Abs(weight - 1.0f) < 0.00001f)
37 | {
38 | var bdef1 = new SkinningOperator.Bdef1 {BoneId = oldBdef2.BoneId[0]};
39 | vertex.SkinningOperator.Param = bdef1;
40 | vertex.SkinningOperator.Type = SkinningOperator.SkinningType.SkinningBdef1;
41 | }
42 | break;
43 | }
44 | case SkinningOperator.SkinningType.SkinningSdef:
45 | {
46 | var oldSdef = (SkinningOperator.Sdef) vertex.SkinningOperator.Param;
47 | var bone0 = oldSdef.BoneId[0];
48 | var bone1 = oldSdef.BoneId[1];
49 | var weight = oldSdef.BoneWeight;
50 | if (
51 | Bones[bone0].ParentIndex != bone1 &&
52 | Bones[bone1].ParentIndex != bone0
53 | )
54 | {
55 | if (Math.Abs(weight) < 0.000001f)
56 | {
57 | var bdef1 = new SkinningOperator.Bdef1 {BoneId = bone1};
58 | vertex.SkinningOperator.Param = bdef1;
59 | vertex.SkinningOperator.Type = SkinningOperator.SkinningType.SkinningBdef1;
60 | }
61 | else if (Math.Abs(weight - 1.0f) < 0.00001f)
62 | {
63 | var bdef1 = new SkinningOperator.Bdef1 {BoneId = bone0};
64 | vertex.SkinningOperator.Param = bdef1;
65 | vertex.SkinningOperator.Type = SkinningOperator.SkinningType.SkinningBdef1;
66 | }
67 | else
68 | {
69 | var bdef2 = new SkinningOperator.Bdef2();
70 | bdef2.BoneId[0] = bone0;
71 | bdef2.BoneId[1] = bone1;
72 | bdef2.BoneWeight = weight;
73 | vertex.SkinningOperator.Param = bdef2;
74 | vertex.SkinningOperator.Type = SkinningOperator.SkinningType.SkinningBdef2;
75 | }
76 | }
77 | break;
78 | }
79 | }
80 | }
81 | }
82 | }
83 | }
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Model/RawMMDModel.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 05367ea617bee1747a4786e33ec02123
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Model/SkinningOperator.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 |
3 | namespace LibMMD.Model
4 | {
5 | public class SkinningOperator
6 | {
7 | public enum SkinningType : byte
8 | {
9 | SkinningBdef1 = 0,
10 | SkinningBdef2 = 1,
11 | SkinningBdef4 = 2,
12 | SkinningSdef = 3
13 | }
14 |
15 | public abstract class SkinningParam
16 | {
17 | }
18 |
19 | public class Bdef1 : SkinningParam
20 | {
21 | public int BoneId { get; set; }
22 | }
23 |
24 | public class Bdef2 : SkinningParam
25 | {
26 | public Bdef2()
27 | {
28 | BoneId = new int[2];
29 | }
30 |
31 | public int[] BoneId { get; set; }
32 | public float BoneWeight { get; set; }
33 | }
34 |
35 | public class Bdef4 : SkinningParam
36 | {
37 | public Bdef4()
38 | {
39 | BoneId = new int[4];
40 | BoneWeight = new float[4];
41 | }
42 |
43 | public int[] BoneId { get; set; }
44 | public float[] BoneWeight { get; set; }
45 | }
46 |
47 | public class Sdef : SkinningParam
48 | {
49 | public Sdef()
50 | {
51 | BoneId = new int[2];
52 | }
53 |
54 | public int[] BoneId { get; set; }
55 | public float BoneWeight { get; set; }
56 | public Vector3 C { get; set; }
57 | public Vector3 R0 { get; set; }
58 | public Vector3 R1 { get; set; }
59 | }
60 |
61 | public SkinningType Type { get; set; }
62 | public SkinningParam Param { get; set; }
63 | }
64 | }
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Model/SkinningOperator.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: fcf11bb8f382aff4d8e67cd1d879439e
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Model/Vertex.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 |
3 | namespace LibMMD.Model
4 | {
5 | public class Vertex
6 | {
7 | public Vector3 Coordinate { get; set; }
8 | public Vector3 Normal { get; set; }
9 | public Vector2 UvCoordinate { get; set; }
10 | public Vector4[] ExtraUvCoordinate { get; set; }
11 | public SkinningOperator SkinningOperator { get; set; }
12 | public float EdgeScale { get; set; }
13 | }
14 | }
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Model/Vertex.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: a8dee8727f3427b4eab957bef13ea4b6
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Plugins.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 27c0d4868d4bac7489c1bccaf869f2b1
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Plugins/I18N.CJK.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hobosore/UnityPMXRuntimeLoader/3b97fe0a4db15311794ee30996bfacaf6a9b07be/UnityPMXRuntimeLoader/LibMMD/Plugins/I18N.CJK.dll
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Plugins/I18N.CJK.dll.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 205a44a895c5dcb45ad11ecea68179f2
3 | PluginImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | iconMap: {}
7 | executionOrder: {}
8 | defineConstraints: []
9 | isPreloaded: 0
10 | isOverridable: 0
11 | isExplicitlyReferenced: 0
12 | validateReferences: 1
13 | platformData:
14 | - first:
15 | Any:
16 | second:
17 | enabled: 1
18 | settings: {}
19 | - first:
20 | Editor: Editor
21 | second:
22 | enabled: 0
23 | settings:
24 | DefaultValueInitialized: true
25 | - first:
26 | Windows Store Apps: WindowsStoreApps
27 | second:
28 | enabled: 0
29 | settings:
30 | CPU: AnyCPU
31 | userData:
32 | assetBundleName:
33 | assetBundleVariant:
34 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Reader.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 880762e0e6c9b294894eb766068a3dad
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Reader/ByteArrayReader.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace LibMMD.Unity3D
4 | {
5 | public class ByteArrayReader
6 | {
7 | public static int ReadInt(byte[] data, ref int offset) {
8 | var ret = BitConverter.ToInt32(data, offset);
9 | offset += 4;
10 | return ret;
11 | }
12 |
13 | public static uint ReadUInt(byte[] data, ref int offset) {
14 | var ret = BitConverter.ToUInt32(data, offset);
15 | offset += 4;
16 | return ret;
17 | }
18 |
19 | public static short ReadShort(byte[] data, ref int offset) {
20 | var ret = BitConverter.ToInt16(data, offset);
21 | offset += 2;
22 | return ret;
23 | }
24 |
25 | public static ushort ReadUShort(byte[] data, ref int offset) {
26 | var ret = BitConverter.ToUInt16(data, offset);
27 | offset += 2;
28 | return ret;
29 | }
30 | }
31 | }
32 |
33 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Reader/ByteArrayReader.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 644ea355b01ce9e4a9bc31a2e4b08131
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Reader/MMDFileParseException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace LibMMD.Reader
4 | {
5 | public class MMDFileParseException : Exception
6 | {
7 | public MMDFileParseException(string message) : base(message)
8 | {
9 | }
10 | }
11 | }
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Reader/MMDFileParseException.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 7ca57088506381e4bb6d98196ff14be2
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Reader/ModelReadConfig.cs:
--------------------------------------------------------------------------------
1 | namespace LibMMD.Reader
2 | {
3 | public class ModelReadConfig
4 | {
5 | public string GlobalToonPath { get; set; }
6 | }
7 | }
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Reader/ModelReadConfig.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: beb1a7fbb7deca44c9cf8f9f4b0c2b10
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Reader/ModelReader.cs:
--------------------------------------------------------------------------------
1 | using System.IO;
2 | using LibMMD.Model;
3 |
4 | namespace LibMMD.Reader
5 | {
6 | public abstract class ModelReader
7 | {
8 | public RawMMDModel Read(string path, ModelReadConfig config)
9 | {
10 | using (var fileStream = new FileStream(path, FileMode.Open))
11 | {
12 | using (var bufferedStream = new BufferedStream(fileStream)) {
13 | using (var binaryReader = new BinaryReader(bufferedStream))
14 | {
15 | return Read(binaryReader, config);
16 | }
17 | }
18 | }
19 | }
20 |
21 | public abstract RawMMDModel Read(BinaryReader reader, ModelReadConfig config);
22 |
23 | public static RawMMDModel LoadMmdModel(string path, ModelReadConfig config)
24 | {
25 | var fileExt = new FileInfo(path).Extension.ToLower();
26 | if (".pmd".Equals(fileExt))
27 | {
28 | return new PMDReader().Read(path, config);
29 | }
30 | if (".pmx".Equals(fileExt))
31 | {
32 | return new PMXReader().Read(path, config);
33 | }
34 | throw new MMDFileParseException("File " + path +
35 | " is not a MMD model file. File name should ends with \"pmd\" or \"pmx\".");
36 | }
37 |
38 | }
39 | }
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Reader/ModelReader.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: c21137d135f1bba43b2de5ae8f7d0f45
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Reader/PMDReader.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 719b4729c95822f45aff8f670135851b
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Reader/PMXReader.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 3b0fb3bed9b8b8743bc9152bd6cea3ac
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: f16b59dd6d99a5e4fa38e2b672e92353
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/LibMmd.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 660944cfede8de84d8945cc950ba37f2
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/LibMmd/SysToon.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 1de5827113caaf740b55336c1719eaa1
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/LibMmd/SysToon/toon0.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hobosore/UnityPMXRuntimeLoader/3b97fe0a4db15311794ee30996bfacaf6a9b07be/UnityPMXRuntimeLoader/LibMMD/Resources/LibMmd/SysToon/toon0.bmp
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/LibMmd/SysToon/toon0.bmp.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d64ba096e6df12e45a4b226a99353ef2
3 | TextureImporter:
4 | internalIDToNameTable: []
5 | externalObjects: {}
6 | serializedVersion: 10
7 | mipmaps:
8 | mipMapMode: 0
9 | enableMipMap: 1
10 | sRGBTexture: 1
11 | linearTexture: 0
12 | fadeOut: 0
13 | borderMipMap: 0
14 | mipMapsPreserveCoverage: 0
15 | alphaTestReferenceValue: 0.5
16 | mipMapFadeDistanceStart: 1
17 | mipMapFadeDistanceEnd: 3
18 | bumpmap:
19 | convertToNormalMap: 0
20 | externalNormalMap: 0
21 | heightScale: 0.25
22 | normalMapFilter: 0
23 | isReadable: 1
24 | streamingMipmaps: 0
25 | streamingMipmapsPriority: 0
26 | grayScaleToAlpha: 0
27 | generateCubemap: 6
28 | cubemapConvolution: 0
29 | seamlessCubemap: 0
30 | textureFormat: 1
31 | maxTextureSize: 2048
32 | textureSettings:
33 | serializedVersion: 2
34 | filterMode: -1
35 | aniso: -1
36 | mipBias: -100
37 | wrapU: -1
38 | wrapV: -1
39 | wrapW: -1
40 | nPOTScale: 1
41 | lightmap: 0
42 | compressionQuality: 50
43 | spriteMode: 0
44 | spriteExtrude: 1
45 | spriteMeshType: 1
46 | alignment: 0
47 | spritePivot: {x: 0.5, y: 0.5}
48 | spritePixelsToUnits: 100
49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0}
50 | spriteGenerateFallbackPhysicsShape: 1
51 | alphaUsage: 1
52 | alphaIsTransparency: 0
53 | spriteTessellationDetail: -1
54 | textureType: 0
55 | textureShape: 1
56 | singleChannelComponent: 0
57 | maxTextureSizeSet: 0
58 | compressionQualitySet: 0
59 | textureFormatSet: 0
60 | platformSettings:
61 | - serializedVersion: 2
62 | buildTarget: DefaultTexturePlatform
63 | maxTextureSize: 2048
64 | resizeAlgorithm: 0
65 | textureFormat: -1
66 | textureCompression: 1
67 | compressionQuality: 50
68 | crunchedCompression: 0
69 | allowsAlphaSplitting: 0
70 | overridden: 0
71 | androidETC2FallbackOverride: 0
72 | - serializedVersion: 2
73 | buildTarget: Standalone
74 | maxTextureSize: 2048
75 | resizeAlgorithm: 0
76 | textureFormat: -1
77 | textureCompression: 1
78 | compressionQuality: 50
79 | crunchedCompression: 0
80 | allowsAlphaSplitting: 0
81 | overridden: 0
82 | androidETC2FallbackOverride: 0
83 | - serializedVersion: 2
84 | buildTarget: Android
85 | maxTextureSize: 2048
86 | resizeAlgorithm: 0
87 | textureFormat: -1
88 | textureCompression: 1
89 | compressionQuality: 50
90 | crunchedCompression: 0
91 | allowsAlphaSplitting: 0
92 | overridden: 0
93 | androidETC2FallbackOverride: 0
94 | spriteSheet:
95 | serializedVersion: 2
96 | sprites: []
97 | outline: []
98 | physicsShape: []
99 | bones: []
100 | spriteID:
101 | internalID: 0
102 | vertices: []
103 | indices:
104 | edges: []
105 | weights: []
106 | secondaryTextures: []
107 | spritePackingTag:
108 | pSDRemoveMatte: 0
109 | pSDShowRemoveMatteOption: 0
110 | userData:
111 | assetBundleName:
112 | assetBundleVariant:
113 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/LibMmd/SysToon/toon01.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hobosore/UnityPMXRuntimeLoader/3b97fe0a4db15311794ee30996bfacaf6a9b07be/UnityPMXRuntimeLoader/LibMMD/Resources/LibMmd/SysToon/toon01.bmp
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/LibMmd/SysToon/toon01.bmp.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 255c68c702fc8ff4b8796b43eebc15d5
3 | TextureImporter:
4 | internalIDToNameTable: []
5 | externalObjects: {}
6 | serializedVersion: 10
7 | mipmaps:
8 | mipMapMode: 0
9 | enableMipMap: 1
10 | sRGBTexture: 1
11 | linearTexture: 0
12 | fadeOut: 0
13 | borderMipMap: 0
14 | mipMapsPreserveCoverage: 0
15 | alphaTestReferenceValue: 0.5
16 | mipMapFadeDistanceStart: 1
17 | mipMapFadeDistanceEnd: 3
18 | bumpmap:
19 | convertToNormalMap: 0
20 | externalNormalMap: 0
21 | heightScale: 0.25
22 | normalMapFilter: 0
23 | isReadable: 1
24 | streamingMipmaps: 0
25 | streamingMipmapsPriority: 0
26 | grayScaleToAlpha: 0
27 | generateCubemap: 6
28 | cubemapConvolution: 0
29 | seamlessCubemap: 0
30 | textureFormat: 1
31 | maxTextureSize: 2048
32 | textureSettings:
33 | serializedVersion: 2
34 | filterMode: -1
35 | aniso: -1
36 | mipBias: -100
37 | wrapU: -1
38 | wrapV: -1
39 | wrapW: -1
40 | nPOTScale: 1
41 | lightmap: 0
42 | compressionQuality: 50
43 | spriteMode: 0
44 | spriteExtrude: 1
45 | spriteMeshType: 1
46 | alignment: 0
47 | spritePivot: {x: 0.5, y: 0.5}
48 | spritePixelsToUnits: 100
49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0}
50 | spriteGenerateFallbackPhysicsShape: 1
51 | alphaUsage: 1
52 | alphaIsTransparency: 0
53 | spriteTessellationDetail: -1
54 | textureType: 0
55 | textureShape: 1
56 | singleChannelComponent: 0
57 | maxTextureSizeSet: 0
58 | compressionQualitySet: 0
59 | textureFormatSet: 0
60 | platformSettings:
61 | - serializedVersion: 2
62 | buildTarget: DefaultTexturePlatform
63 | maxTextureSize: 2048
64 | resizeAlgorithm: 0
65 | textureFormat: -1
66 | textureCompression: 1
67 | compressionQuality: 50
68 | crunchedCompression: 0
69 | allowsAlphaSplitting: 0
70 | overridden: 0
71 | androidETC2FallbackOverride: 0
72 | - serializedVersion: 2
73 | buildTarget: Standalone
74 | maxTextureSize: 2048
75 | resizeAlgorithm: 0
76 | textureFormat: -1
77 | textureCompression: 1
78 | compressionQuality: 50
79 | crunchedCompression: 0
80 | allowsAlphaSplitting: 0
81 | overridden: 0
82 | androidETC2FallbackOverride: 0
83 | - serializedVersion: 2
84 | buildTarget: Android
85 | maxTextureSize: 2048
86 | resizeAlgorithm: 0
87 | textureFormat: -1
88 | textureCompression: 1
89 | compressionQuality: 50
90 | crunchedCompression: 0
91 | allowsAlphaSplitting: 0
92 | overridden: 0
93 | androidETC2FallbackOverride: 0
94 | spriteSheet:
95 | serializedVersion: 2
96 | sprites: []
97 | outline: []
98 | physicsShape: []
99 | bones: []
100 | spriteID:
101 | internalID: 0
102 | vertices: []
103 | indices:
104 | edges: []
105 | weights: []
106 | secondaryTextures: []
107 | spritePackingTag:
108 | pSDRemoveMatte: 0
109 | pSDShowRemoveMatteOption: 0
110 | userData:
111 | assetBundleName:
112 | assetBundleVariant:
113 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/LibMmd/SysToon/toon02.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hobosore/UnityPMXRuntimeLoader/3b97fe0a4db15311794ee30996bfacaf6a9b07be/UnityPMXRuntimeLoader/LibMMD/Resources/LibMmd/SysToon/toon02.bmp
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/LibMmd/SysToon/toon02.bmp.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 32fa5d23e3c479e48a9cbbd0bb690a6f
3 | TextureImporter:
4 | internalIDToNameTable: []
5 | externalObjects: {}
6 | serializedVersion: 10
7 | mipmaps:
8 | mipMapMode: 0
9 | enableMipMap: 1
10 | sRGBTexture: 1
11 | linearTexture: 0
12 | fadeOut: 0
13 | borderMipMap: 0
14 | mipMapsPreserveCoverage: 0
15 | alphaTestReferenceValue: 0.5
16 | mipMapFadeDistanceStart: 1
17 | mipMapFadeDistanceEnd: 3
18 | bumpmap:
19 | convertToNormalMap: 0
20 | externalNormalMap: 0
21 | heightScale: 0.25
22 | normalMapFilter: 0
23 | isReadable: 1
24 | streamingMipmaps: 0
25 | streamingMipmapsPriority: 0
26 | grayScaleToAlpha: 0
27 | generateCubemap: 6
28 | cubemapConvolution: 0
29 | seamlessCubemap: 0
30 | textureFormat: 1
31 | maxTextureSize: 2048
32 | textureSettings:
33 | serializedVersion: 2
34 | filterMode: -1
35 | aniso: -1
36 | mipBias: -100
37 | wrapU: -1
38 | wrapV: -1
39 | wrapW: -1
40 | nPOTScale: 1
41 | lightmap: 0
42 | compressionQuality: 50
43 | spriteMode: 0
44 | spriteExtrude: 1
45 | spriteMeshType: 1
46 | alignment: 0
47 | spritePivot: {x: 0.5, y: 0.5}
48 | spritePixelsToUnits: 100
49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0}
50 | spriteGenerateFallbackPhysicsShape: 1
51 | alphaUsage: 1
52 | alphaIsTransparency: 0
53 | spriteTessellationDetail: -1
54 | textureType: 0
55 | textureShape: 1
56 | singleChannelComponent: 0
57 | maxTextureSizeSet: 0
58 | compressionQualitySet: 0
59 | textureFormatSet: 0
60 | platformSettings:
61 | - serializedVersion: 2
62 | buildTarget: DefaultTexturePlatform
63 | maxTextureSize: 2048
64 | resizeAlgorithm: 0
65 | textureFormat: -1
66 | textureCompression: 1
67 | compressionQuality: 50
68 | crunchedCompression: 0
69 | allowsAlphaSplitting: 0
70 | overridden: 0
71 | androidETC2FallbackOverride: 0
72 | - serializedVersion: 2
73 | buildTarget: Standalone
74 | maxTextureSize: 2048
75 | resizeAlgorithm: 0
76 | textureFormat: -1
77 | textureCompression: 1
78 | compressionQuality: 50
79 | crunchedCompression: 0
80 | allowsAlphaSplitting: 0
81 | overridden: 0
82 | androidETC2FallbackOverride: 0
83 | - serializedVersion: 2
84 | buildTarget: Android
85 | maxTextureSize: 2048
86 | resizeAlgorithm: 0
87 | textureFormat: -1
88 | textureCompression: 1
89 | compressionQuality: 50
90 | crunchedCompression: 0
91 | allowsAlphaSplitting: 0
92 | overridden: 0
93 | androidETC2FallbackOverride: 0
94 | spriteSheet:
95 | serializedVersion: 2
96 | sprites: []
97 | outline: []
98 | physicsShape: []
99 | bones: []
100 | spriteID:
101 | internalID: 0
102 | vertices: []
103 | indices:
104 | edges: []
105 | weights: []
106 | secondaryTextures: []
107 | spritePackingTag:
108 | pSDRemoveMatte: 0
109 | pSDShowRemoveMatteOption: 0
110 | userData:
111 | assetBundleName:
112 | assetBundleVariant:
113 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/LibMmd/SysToon/toon03.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hobosore/UnityPMXRuntimeLoader/3b97fe0a4db15311794ee30996bfacaf6a9b07be/UnityPMXRuntimeLoader/LibMMD/Resources/LibMmd/SysToon/toon03.bmp
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/LibMmd/SysToon/toon03.bmp.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: ec1f8bdff911c8a41b8bed7c8335d4f2
3 | TextureImporter:
4 | internalIDToNameTable: []
5 | externalObjects: {}
6 | serializedVersion: 10
7 | mipmaps:
8 | mipMapMode: 0
9 | enableMipMap: 1
10 | sRGBTexture: 1
11 | linearTexture: 0
12 | fadeOut: 0
13 | borderMipMap: 0
14 | mipMapsPreserveCoverage: 0
15 | alphaTestReferenceValue: 0.5
16 | mipMapFadeDistanceStart: 1
17 | mipMapFadeDistanceEnd: 3
18 | bumpmap:
19 | convertToNormalMap: 0
20 | externalNormalMap: 0
21 | heightScale: 0.25
22 | normalMapFilter: 0
23 | isReadable: 1
24 | streamingMipmaps: 0
25 | streamingMipmapsPriority: 0
26 | grayScaleToAlpha: 0
27 | generateCubemap: 6
28 | cubemapConvolution: 0
29 | seamlessCubemap: 0
30 | textureFormat: 1
31 | maxTextureSize: 2048
32 | textureSettings:
33 | serializedVersion: 2
34 | filterMode: -1
35 | aniso: -1
36 | mipBias: -100
37 | wrapU: -1
38 | wrapV: -1
39 | wrapW: -1
40 | nPOTScale: 1
41 | lightmap: 0
42 | compressionQuality: 50
43 | spriteMode: 0
44 | spriteExtrude: 1
45 | spriteMeshType: 1
46 | alignment: 0
47 | spritePivot: {x: 0.5, y: 0.5}
48 | spritePixelsToUnits: 100
49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0}
50 | spriteGenerateFallbackPhysicsShape: 1
51 | alphaUsage: 1
52 | alphaIsTransparency: 0
53 | spriteTessellationDetail: -1
54 | textureType: 0
55 | textureShape: 1
56 | singleChannelComponent: 0
57 | maxTextureSizeSet: 0
58 | compressionQualitySet: 0
59 | textureFormatSet: 0
60 | platformSettings:
61 | - serializedVersion: 2
62 | buildTarget: DefaultTexturePlatform
63 | maxTextureSize: 2048
64 | resizeAlgorithm: 0
65 | textureFormat: -1
66 | textureCompression: 1
67 | compressionQuality: 50
68 | crunchedCompression: 0
69 | allowsAlphaSplitting: 0
70 | overridden: 0
71 | androidETC2FallbackOverride: 0
72 | - serializedVersion: 2
73 | buildTarget: Standalone
74 | maxTextureSize: 2048
75 | resizeAlgorithm: 0
76 | textureFormat: -1
77 | textureCompression: 1
78 | compressionQuality: 50
79 | crunchedCompression: 0
80 | allowsAlphaSplitting: 0
81 | overridden: 0
82 | androidETC2FallbackOverride: 0
83 | - serializedVersion: 2
84 | buildTarget: Android
85 | maxTextureSize: 2048
86 | resizeAlgorithm: 0
87 | textureFormat: -1
88 | textureCompression: 1
89 | compressionQuality: 50
90 | crunchedCompression: 0
91 | allowsAlphaSplitting: 0
92 | overridden: 0
93 | androidETC2FallbackOverride: 0
94 | spriteSheet:
95 | serializedVersion: 2
96 | sprites: []
97 | outline: []
98 | physicsShape: []
99 | bones: []
100 | spriteID:
101 | internalID: 0
102 | vertices: []
103 | indices:
104 | edges: []
105 | weights: []
106 | secondaryTextures: []
107 | spritePackingTag:
108 | pSDRemoveMatte: 0
109 | pSDShowRemoveMatteOption: 0
110 | userData:
111 | assetBundleName:
112 | assetBundleVariant:
113 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/LibMmd/SysToon/toon04.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hobosore/UnityPMXRuntimeLoader/3b97fe0a4db15311794ee30996bfacaf6a9b07be/UnityPMXRuntimeLoader/LibMMD/Resources/LibMmd/SysToon/toon04.bmp
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/LibMmd/SysToon/toon04.bmp.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 43591bdde4bdc474492bf0aa6f2e2ae1
3 | TextureImporter:
4 | internalIDToNameTable: []
5 | externalObjects: {}
6 | serializedVersion: 10
7 | mipmaps:
8 | mipMapMode: 0
9 | enableMipMap: 1
10 | sRGBTexture: 1
11 | linearTexture: 0
12 | fadeOut: 0
13 | borderMipMap: 0
14 | mipMapsPreserveCoverage: 0
15 | alphaTestReferenceValue: 0.5
16 | mipMapFadeDistanceStart: 1
17 | mipMapFadeDistanceEnd: 3
18 | bumpmap:
19 | convertToNormalMap: 0
20 | externalNormalMap: 0
21 | heightScale: 0.25
22 | normalMapFilter: 0
23 | isReadable: 1
24 | streamingMipmaps: 0
25 | streamingMipmapsPriority: 0
26 | grayScaleToAlpha: 0
27 | generateCubemap: 6
28 | cubemapConvolution: 0
29 | seamlessCubemap: 0
30 | textureFormat: 1
31 | maxTextureSize: 2048
32 | textureSettings:
33 | serializedVersion: 2
34 | filterMode: -1
35 | aniso: -1
36 | mipBias: -100
37 | wrapU: -1
38 | wrapV: -1
39 | wrapW: -1
40 | nPOTScale: 1
41 | lightmap: 0
42 | compressionQuality: 50
43 | spriteMode: 0
44 | spriteExtrude: 1
45 | spriteMeshType: 1
46 | alignment: 0
47 | spritePivot: {x: 0.5, y: 0.5}
48 | spritePixelsToUnits: 100
49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0}
50 | spriteGenerateFallbackPhysicsShape: 1
51 | alphaUsage: 1
52 | alphaIsTransparency: 0
53 | spriteTessellationDetail: -1
54 | textureType: 0
55 | textureShape: 1
56 | singleChannelComponent: 0
57 | maxTextureSizeSet: 0
58 | compressionQualitySet: 0
59 | textureFormatSet: 0
60 | platformSettings:
61 | - serializedVersion: 2
62 | buildTarget: DefaultTexturePlatform
63 | maxTextureSize: 2048
64 | resizeAlgorithm: 0
65 | textureFormat: -1
66 | textureCompression: 1
67 | compressionQuality: 50
68 | crunchedCompression: 0
69 | allowsAlphaSplitting: 0
70 | overridden: 0
71 | androidETC2FallbackOverride: 0
72 | - serializedVersion: 2
73 | buildTarget: Standalone
74 | maxTextureSize: 2048
75 | resizeAlgorithm: 0
76 | textureFormat: -1
77 | textureCompression: 1
78 | compressionQuality: 50
79 | crunchedCompression: 0
80 | allowsAlphaSplitting: 0
81 | overridden: 0
82 | androidETC2FallbackOverride: 0
83 | - serializedVersion: 2
84 | buildTarget: Android
85 | maxTextureSize: 2048
86 | resizeAlgorithm: 0
87 | textureFormat: -1
88 | textureCompression: 1
89 | compressionQuality: 50
90 | crunchedCompression: 0
91 | allowsAlphaSplitting: 0
92 | overridden: 0
93 | androidETC2FallbackOverride: 0
94 | spriteSheet:
95 | serializedVersion: 2
96 | sprites: []
97 | outline: []
98 | physicsShape: []
99 | bones: []
100 | spriteID:
101 | internalID: 0
102 | vertices: []
103 | indices:
104 | edges: []
105 | weights: []
106 | secondaryTextures: []
107 | spritePackingTag:
108 | pSDRemoveMatte: 0
109 | pSDShowRemoveMatteOption: 0
110 | userData:
111 | assetBundleName:
112 | assetBundleVariant:
113 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/LibMmd/SysToon/toon05.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hobosore/UnityPMXRuntimeLoader/3b97fe0a4db15311794ee30996bfacaf6a9b07be/UnityPMXRuntimeLoader/LibMMD/Resources/LibMmd/SysToon/toon05.bmp
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/LibMmd/SysToon/toon05.bmp.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 15cbcd5fb2371d041a1097e22d6d1d19
3 | TextureImporter:
4 | internalIDToNameTable: []
5 | externalObjects: {}
6 | serializedVersion: 10
7 | mipmaps:
8 | mipMapMode: 0
9 | enableMipMap: 1
10 | sRGBTexture: 1
11 | linearTexture: 0
12 | fadeOut: 0
13 | borderMipMap: 0
14 | mipMapsPreserveCoverage: 0
15 | alphaTestReferenceValue: 0.5
16 | mipMapFadeDistanceStart: 1
17 | mipMapFadeDistanceEnd: 3
18 | bumpmap:
19 | convertToNormalMap: 0
20 | externalNormalMap: 0
21 | heightScale: 0.25
22 | normalMapFilter: 0
23 | isReadable: 1
24 | streamingMipmaps: 0
25 | streamingMipmapsPriority: 0
26 | grayScaleToAlpha: 0
27 | generateCubemap: 6
28 | cubemapConvolution: 0
29 | seamlessCubemap: 0
30 | textureFormat: 1
31 | maxTextureSize: 2048
32 | textureSettings:
33 | serializedVersion: 2
34 | filterMode: -1
35 | aniso: -1
36 | mipBias: -100
37 | wrapU: -1
38 | wrapV: -1
39 | wrapW: -1
40 | nPOTScale: 1
41 | lightmap: 0
42 | compressionQuality: 50
43 | spriteMode: 0
44 | spriteExtrude: 1
45 | spriteMeshType: 1
46 | alignment: 0
47 | spritePivot: {x: 0.5, y: 0.5}
48 | spritePixelsToUnits: 100
49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0}
50 | spriteGenerateFallbackPhysicsShape: 1
51 | alphaUsage: 1
52 | alphaIsTransparency: 0
53 | spriteTessellationDetail: -1
54 | textureType: 0
55 | textureShape: 1
56 | singleChannelComponent: 0
57 | maxTextureSizeSet: 0
58 | compressionQualitySet: 0
59 | textureFormatSet: 0
60 | platformSettings:
61 | - serializedVersion: 2
62 | buildTarget: DefaultTexturePlatform
63 | maxTextureSize: 2048
64 | resizeAlgorithm: 0
65 | textureFormat: -1
66 | textureCompression: 1
67 | compressionQuality: 50
68 | crunchedCompression: 0
69 | allowsAlphaSplitting: 0
70 | overridden: 0
71 | androidETC2FallbackOverride: 0
72 | - serializedVersion: 2
73 | buildTarget: Standalone
74 | maxTextureSize: 2048
75 | resizeAlgorithm: 0
76 | textureFormat: -1
77 | textureCompression: 1
78 | compressionQuality: 50
79 | crunchedCompression: 0
80 | allowsAlphaSplitting: 0
81 | overridden: 0
82 | androidETC2FallbackOverride: 0
83 | - serializedVersion: 2
84 | buildTarget: Android
85 | maxTextureSize: 2048
86 | resizeAlgorithm: 0
87 | textureFormat: -1
88 | textureCompression: 1
89 | compressionQuality: 50
90 | crunchedCompression: 0
91 | allowsAlphaSplitting: 0
92 | overridden: 0
93 | androidETC2FallbackOverride: 0
94 | spriteSheet:
95 | serializedVersion: 2
96 | sprites: []
97 | outline: []
98 | physicsShape: []
99 | bones: []
100 | spriteID:
101 | internalID: 0
102 | vertices: []
103 | indices:
104 | edges: []
105 | weights: []
106 | secondaryTextures: []
107 | spritePackingTag:
108 | pSDRemoveMatte: 0
109 | pSDShowRemoveMatteOption: 0
110 | userData:
111 | assetBundleName:
112 | assetBundleVariant:
113 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/LibMmd/SysToon/toon06.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hobosore/UnityPMXRuntimeLoader/3b97fe0a4db15311794ee30996bfacaf6a9b07be/UnityPMXRuntimeLoader/LibMMD/Resources/LibMmd/SysToon/toon06.bmp
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/LibMmd/SysToon/toon06.bmp.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 0ae4097b717681340b3b41b997154405
3 | TextureImporter:
4 | internalIDToNameTable: []
5 | externalObjects: {}
6 | serializedVersion: 10
7 | mipmaps:
8 | mipMapMode: 0
9 | enableMipMap: 1
10 | sRGBTexture: 1
11 | linearTexture: 0
12 | fadeOut: 0
13 | borderMipMap: 0
14 | mipMapsPreserveCoverage: 0
15 | alphaTestReferenceValue: 0.5
16 | mipMapFadeDistanceStart: 1
17 | mipMapFadeDistanceEnd: 3
18 | bumpmap:
19 | convertToNormalMap: 0
20 | externalNormalMap: 0
21 | heightScale: 0.25
22 | normalMapFilter: 0
23 | isReadable: 1
24 | streamingMipmaps: 0
25 | streamingMipmapsPriority: 0
26 | grayScaleToAlpha: 0
27 | generateCubemap: 6
28 | cubemapConvolution: 0
29 | seamlessCubemap: 0
30 | textureFormat: 1
31 | maxTextureSize: 2048
32 | textureSettings:
33 | serializedVersion: 2
34 | filterMode: -1
35 | aniso: -1
36 | mipBias: -100
37 | wrapU: -1
38 | wrapV: -1
39 | wrapW: -1
40 | nPOTScale: 1
41 | lightmap: 0
42 | compressionQuality: 50
43 | spriteMode: 0
44 | spriteExtrude: 1
45 | spriteMeshType: 1
46 | alignment: 0
47 | spritePivot: {x: 0.5, y: 0.5}
48 | spritePixelsToUnits: 100
49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0}
50 | spriteGenerateFallbackPhysicsShape: 1
51 | alphaUsage: 1
52 | alphaIsTransparency: 0
53 | spriteTessellationDetail: -1
54 | textureType: 0
55 | textureShape: 1
56 | singleChannelComponent: 0
57 | maxTextureSizeSet: 0
58 | compressionQualitySet: 0
59 | textureFormatSet: 0
60 | platformSettings:
61 | - serializedVersion: 2
62 | buildTarget: DefaultTexturePlatform
63 | maxTextureSize: 2048
64 | resizeAlgorithm: 0
65 | textureFormat: -1
66 | textureCompression: 1
67 | compressionQuality: 50
68 | crunchedCompression: 0
69 | allowsAlphaSplitting: 0
70 | overridden: 0
71 | androidETC2FallbackOverride: 0
72 | - serializedVersion: 2
73 | buildTarget: Standalone
74 | maxTextureSize: 2048
75 | resizeAlgorithm: 0
76 | textureFormat: -1
77 | textureCompression: 1
78 | compressionQuality: 50
79 | crunchedCompression: 0
80 | allowsAlphaSplitting: 0
81 | overridden: 0
82 | androidETC2FallbackOverride: 0
83 | - serializedVersion: 2
84 | buildTarget: Android
85 | maxTextureSize: 2048
86 | resizeAlgorithm: 0
87 | textureFormat: -1
88 | textureCompression: 1
89 | compressionQuality: 50
90 | crunchedCompression: 0
91 | allowsAlphaSplitting: 0
92 | overridden: 0
93 | androidETC2FallbackOverride: 0
94 | spriteSheet:
95 | serializedVersion: 2
96 | sprites: []
97 | outline: []
98 | physicsShape: []
99 | bones: []
100 | spriteID:
101 | internalID: 0
102 | vertices: []
103 | indices:
104 | edges: []
105 | weights: []
106 | secondaryTextures: []
107 | spritePackingTag:
108 | pSDRemoveMatte: 0
109 | pSDShowRemoveMatteOption: 0
110 | userData:
111 | assetBundleName:
112 | assetBundleVariant:
113 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/LibMmd/SysToon/toon07.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hobosore/UnityPMXRuntimeLoader/3b97fe0a4db15311794ee30996bfacaf6a9b07be/UnityPMXRuntimeLoader/LibMMD/Resources/LibMmd/SysToon/toon07.bmp
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/LibMmd/SysToon/toon07.bmp.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: b32dd17f1a671c245927bd16f85569e1
3 | TextureImporter:
4 | internalIDToNameTable: []
5 | externalObjects: {}
6 | serializedVersion: 10
7 | mipmaps:
8 | mipMapMode: 0
9 | enableMipMap: 1
10 | sRGBTexture: 1
11 | linearTexture: 0
12 | fadeOut: 0
13 | borderMipMap: 0
14 | mipMapsPreserveCoverage: 0
15 | alphaTestReferenceValue: 0.5
16 | mipMapFadeDistanceStart: 1
17 | mipMapFadeDistanceEnd: 3
18 | bumpmap:
19 | convertToNormalMap: 0
20 | externalNormalMap: 0
21 | heightScale: 0.25
22 | normalMapFilter: 0
23 | isReadable: 1
24 | streamingMipmaps: 0
25 | streamingMipmapsPriority: 0
26 | grayScaleToAlpha: 0
27 | generateCubemap: 6
28 | cubemapConvolution: 0
29 | seamlessCubemap: 0
30 | textureFormat: 1
31 | maxTextureSize: 2048
32 | textureSettings:
33 | serializedVersion: 2
34 | filterMode: -1
35 | aniso: -1
36 | mipBias: -100
37 | wrapU: -1
38 | wrapV: -1
39 | wrapW: -1
40 | nPOTScale: 1
41 | lightmap: 0
42 | compressionQuality: 50
43 | spriteMode: 0
44 | spriteExtrude: 1
45 | spriteMeshType: 1
46 | alignment: 0
47 | spritePivot: {x: 0.5, y: 0.5}
48 | spritePixelsToUnits: 100
49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0}
50 | spriteGenerateFallbackPhysicsShape: 1
51 | alphaUsage: 1
52 | alphaIsTransparency: 0
53 | spriteTessellationDetail: -1
54 | textureType: 0
55 | textureShape: 1
56 | singleChannelComponent: 0
57 | maxTextureSizeSet: 0
58 | compressionQualitySet: 0
59 | textureFormatSet: 0
60 | platformSettings:
61 | - serializedVersion: 2
62 | buildTarget: DefaultTexturePlatform
63 | maxTextureSize: 2048
64 | resizeAlgorithm: 0
65 | textureFormat: -1
66 | textureCompression: 1
67 | compressionQuality: 50
68 | crunchedCompression: 0
69 | allowsAlphaSplitting: 0
70 | overridden: 0
71 | androidETC2FallbackOverride: 0
72 | - serializedVersion: 2
73 | buildTarget: Standalone
74 | maxTextureSize: 2048
75 | resizeAlgorithm: 0
76 | textureFormat: -1
77 | textureCompression: 1
78 | compressionQuality: 50
79 | crunchedCompression: 0
80 | allowsAlphaSplitting: 0
81 | overridden: 0
82 | androidETC2FallbackOverride: 0
83 | - serializedVersion: 2
84 | buildTarget: Android
85 | maxTextureSize: 2048
86 | resizeAlgorithm: 0
87 | textureFormat: -1
88 | textureCompression: 1
89 | compressionQuality: 50
90 | crunchedCompression: 0
91 | allowsAlphaSplitting: 0
92 | overridden: 0
93 | androidETC2FallbackOverride: 0
94 | spriteSheet:
95 | serializedVersion: 2
96 | sprites: []
97 | outline: []
98 | physicsShape: []
99 | bones: []
100 | spriteID:
101 | internalID: 0
102 | vertices: []
103 | indices:
104 | edges: []
105 | weights: []
106 | secondaryTextures: []
107 | spritePackingTag:
108 | pSDRemoveMatte: 0
109 | pSDShowRemoveMatteOption: 0
110 | userData:
111 | assetBundleName:
112 | assetBundleVariant:
113 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/LibMmd/SysToon/toon08.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hobosore/UnityPMXRuntimeLoader/3b97fe0a4db15311794ee30996bfacaf6a9b07be/UnityPMXRuntimeLoader/LibMMD/Resources/LibMmd/SysToon/toon08.bmp
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/LibMmd/SysToon/toon08.bmp.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 8b21f503f5fe1a64cb351891db627bb7
3 | TextureImporter:
4 | internalIDToNameTable: []
5 | externalObjects: {}
6 | serializedVersion: 10
7 | mipmaps:
8 | mipMapMode: 0
9 | enableMipMap: 1
10 | sRGBTexture: 1
11 | linearTexture: 0
12 | fadeOut: 0
13 | borderMipMap: 0
14 | mipMapsPreserveCoverage: 0
15 | alphaTestReferenceValue: 0.5
16 | mipMapFadeDistanceStart: 1
17 | mipMapFadeDistanceEnd: 3
18 | bumpmap:
19 | convertToNormalMap: 0
20 | externalNormalMap: 0
21 | heightScale: 0.25
22 | normalMapFilter: 0
23 | isReadable: 1
24 | streamingMipmaps: 0
25 | streamingMipmapsPriority: 0
26 | grayScaleToAlpha: 0
27 | generateCubemap: 6
28 | cubemapConvolution: 0
29 | seamlessCubemap: 0
30 | textureFormat: 1
31 | maxTextureSize: 2048
32 | textureSettings:
33 | serializedVersion: 2
34 | filterMode: -1
35 | aniso: -1
36 | mipBias: -100
37 | wrapU: -1
38 | wrapV: -1
39 | wrapW: -1
40 | nPOTScale: 1
41 | lightmap: 0
42 | compressionQuality: 50
43 | spriteMode: 0
44 | spriteExtrude: 1
45 | spriteMeshType: 1
46 | alignment: 0
47 | spritePivot: {x: 0.5, y: 0.5}
48 | spritePixelsToUnits: 100
49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0}
50 | spriteGenerateFallbackPhysicsShape: 1
51 | alphaUsage: 1
52 | alphaIsTransparency: 0
53 | spriteTessellationDetail: -1
54 | textureType: 0
55 | textureShape: 1
56 | singleChannelComponent: 0
57 | maxTextureSizeSet: 0
58 | compressionQualitySet: 0
59 | textureFormatSet: 0
60 | platformSettings:
61 | - serializedVersion: 2
62 | buildTarget: DefaultTexturePlatform
63 | maxTextureSize: 2048
64 | resizeAlgorithm: 0
65 | textureFormat: -1
66 | textureCompression: 1
67 | compressionQuality: 50
68 | crunchedCompression: 0
69 | allowsAlphaSplitting: 0
70 | overridden: 0
71 | androidETC2FallbackOverride: 0
72 | - serializedVersion: 2
73 | buildTarget: Standalone
74 | maxTextureSize: 2048
75 | resizeAlgorithm: 0
76 | textureFormat: -1
77 | textureCompression: 1
78 | compressionQuality: 50
79 | crunchedCompression: 0
80 | allowsAlphaSplitting: 0
81 | overridden: 0
82 | androidETC2FallbackOverride: 0
83 | - serializedVersion: 2
84 | buildTarget: Android
85 | maxTextureSize: 2048
86 | resizeAlgorithm: 0
87 | textureFormat: -1
88 | textureCompression: 1
89 | compressionQuality: 50
90 | crunchedCompression: 0
91 | allowsAlphaSplitting: 0
92 | overridden: 0
93 | androidETC2FallbackOverride: 0
94 | spriteSheet:
95 | serializedVersion: 2
96 | sprites: []
97 | outline: []
98 | physicsShape: []
99 | bones: []
100 | spriteID:
101 | internalID: 0
102 | vertices: []
103 | indices:
104 | edges: []
105 | weights: []
106 | secondaryTextures: []
107 | spritePackingTag:
108 | pSDRemoveMatte: 0
109 | pSDShowRemoveMatteOption: 0
110 | userData:
111 | assetBundleName:
112 | assetBundleVariant:
113 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/LibMmd/SysToon/toon09.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hobosore/UnityPMXRuntimeLoader/3b97fe0a4db15311794ee30996bfacaf6a9b07be/UnityPMXRuntimeLoader/LibMMD/Resources/LibMmd/SysToon/toon09.bmp
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/LibMmd/SysToon/toon09.bmp.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 269ec9a189789e94eb0b75624ac058da
3 | TextureImporter:
4 | internalIDToNameTable: []
5 | externalObjects: {}
6 | serializedVersion: 10
7 | mipmaps:
8 | mipMapMode: 0
9 | enableMipMap: 1
10 | sRGBTexture: 1
11 | linearTexture: 0
12 | fadeOut: 0
13 | borderMipMap: 0
14 | mipMapsPreserveCoverage: 0
15 | alphaTestReferenceValue: 0.5
16 | mipMapFadeDistanceStart: 1
17 | mipMapFadeDistanceEnd: 3
18 | bumpmap:
19 | convertToNormalMap: 0
20 | externalNormalMap: 0
21 | heightScale: 0.25
22 | normalMapFilter: 0
23 | isReadable: 1
24 | streamingMipmaps: 0
25 | streamingMipmapsPriority: 0
26 | grayScaleToAlpha: 0
27 | generateCubemap: 6
28 | cubemapConvolution: 0
29 | seamlessCubemap: 0
30 | textureFormat: 1
31 | maxTextureSize: 2048
32 | textureSettings:
33 | serializedVersion: 2
34 | filterMode: -1
35 | aniso: -1
36 | mipBias: -100
37 | wrapU: -1
38 | wrapV: -1
39 | wrapW: -1
40 | nPOTScale: 1
41 | lightmap: 0
42 | compressionQuality: 50
43 | spriteMode: 0
44 | spriteExtrude: 1
45 | spriteMeshType: 1
46 | alignment: 0
47 | spritePivot: {x: 0.5, y: 0.5}
48 | spritePixelsToUnits: 100
49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0}
50 | spriteGenerateFallbackPhysicsShape: 1
51 | alphaUsage: 1
52 | alphaIsTransparency: 0
53 | spriteTessellationDetail: -1
54 | textureType: 0
55 | textureShape: 1
56 | singleChannelComponent: 0
57 | maxTextureSizeSet: 0
58 | compressionQualitySet: 0
59 | textureFormatSet: 0
60 | platformSettings:
61 | - serializedVersion: 2
62 | buildTarget: DefaultTexturePlatform
63 | maxTextureSize: 2048
64 | resizeAlgorithm: 0
65 | textureFormat: -1
66 | textureCompression: 1
67 | compressionQuality: 50
68 | crunchedCompression: 0
69 | allowsAlphaSplitting: 0
70 | overridden: 0
71 | androidETC2FallbackOverride: 0
72 | - serializedVersion: 2
73 | buildTarget: Standalone
74 | maxTextureSize: 2048
75 | resizeAlgorithm: 0
76 | textureFormat: -1
77 | textureCompression: 1
78 | compressionQuality: 50
79 | crunchedCompression: 0
80 | allowsAlphaSplitting: 0
81 | overridden: 0
82 | androidETC2FallbackOverride: 0
83 | - serializedVersion: 2
84 | buildTarget: Android
85 | maxTextureSize: 2048
86 | resizeAlgorithm: 0
87 | textureFormat: -1
88 | textureCompression: 1
89 | compressionQuality: 50
90 | crunchedCompression: 0
91 | allowsAlphaSplitting: 0
92 | overridden: 0
93 | androidETC2FallbackOverride: 0
94 | spriteSheet:
95 | serializedVersion: 2
96 | sprites: []
97 | outline: []
98 | physicsShape: []
99 | bones: []
100 | spriteID:
101 | internalID: 0
102 | vertices: []
103 | indices:
104 | edges: []
105 | weights: []
106 | secondaryTextures: []
107 | spritePackingTag:
108 | pSDRemoveMatte: 0
109 | pSDShowRemoveMatteOption: 0
110 | userData:
111 | assetBundleName:
112 | assetBundleVariant:
113 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/LibMmd/SysToon/toon10.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hobosore/UnityPMXRuntimeLoader/3b97fe0a4db15311794ee30996bfacaf6a9b07be/UnityPMXRuntimeLoader/LibMMD/Resources/LibMmd/SysToon/toon10.bmp
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/LibMmd/SysToon/toon10.bmp.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: bfe46bb09f22414458a9f626f2f047cc
3 | TextureImporter:
4 | internalIDToNameTable: []
5 | externalObjects: {}
6 | serializedVersion: 10
7 | mipmaps:
8 | mipMapMode: 0
9 | enableMipMap: 1
10 | sRGBTexture: 1
11 | linearTexture: 0
12 | fadeOut: 0
13 | borderMipMap: 0
14 | mipMapsPreserveCoverage: 0
15 | alphaTestReferenceValue: 0.5
16 | mipMapFadeDistanceStart: 1
17 | mipMapFadeDistanceEnd: 3
18 | bumpmap:
19 | convertToNormalMap: 0
20 | externalNormalMap: 0
21 | heightScale: 0.25
22 | normalMapFilter: 0
23 | isReadable: 1
24 | streamingMipmaps: 0
25 | streamingMipmapsPriority: 0
26 | grayScaleToAlpha: 0
27 | generateCubemap: 6
28 | cubemapConvolution: 0
29 | seamlessCubemap: 0
30 | textureFormat: 1
31 | maxTextureSize: 2048
32 | textureSettings:
33 | serializedVersion: 2
34 | filterMode: -1
35 | aniso: -1
36 | mipBias: -100
37 | wrapU: -1
38 | wrapV: -1
39 | wrapW: -1
40 | nPOTScale: 1
41 | lightmap: 0
42 | compressionQuality: 50
43 | spriteMode: 0
44 | spriteExtrude: 1
45 | spriteMeshType: 1
46 | alignment: 0
47 | spritePivot: {x: 0.5, y: 0.5}
48 | spritePixelsToUnits: 100
49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0}
50 | spriteGenerateFallbackPhysicsShape: 1
51 | alphaUsage: 1
52 | alphaIsTransparency: 0
53 | spriteTessellationDetail: -1
54 | textureType: 0
55 | textureShape: 1
56 | singleChannelComponent: 0
57 | maxTextureSizeSet: 0
58 | compressionQualitySet: 0
59 | textureFormatSet: 0
60 | platformSettings:
61 | - serializedVersion: 2
62 | buildTarget: DefaultTexturePlatform
63 | maxTextureSize: 2048
64 | resizeAlgorithm: 0
65 | textureFormat: -1
66 | textureCompression: 1
67 | compressionQuality: 50
68 | crunchedCompression: 0
69 | allowsAlphaSplitting: 0
70 | overridden: 0
71 | androidETC2FallbackOverride: 0
72 | - serializedVersion: 2
73 | buildTarget: Standalone
74 | maxTextureSize: 2048
75 | resizeAlgorithm: 0
76 | textureFormat: -1
77 | textureCompression: 1
78 | compressionQuality: 50
79 | crunchedCompression: 0
80 | allowsAlphaSplitting: 0
81 | overridden: 0
82 | androidETC2FallbackOverride: 0
83 | - serializedVersion: 2
84 | buildTarget: Android
85 | maxTextureSize: 2048
86 | resizeAlgorithm: 0
87 | textureFormat: -1
88 | textureCompression: 1
89 | compressionQuality: 50
90 | crunchedCompression: 0
91 | allowsAlphaSplitting: 0
92 | overridden: 0
93 | androidETC2FallbackOverride: 0
94 | spriteSheet:
95 | serializedVersion: 2
96 | sprites: []
97 | outline: []
98 | physicsShape: []
99 | bones: []
100 | spriteID:
101 | internalID: 0
102 | vertices: []
103 | indices:
104 | edges: []
105 | weights: []
106 | secondaryTextures: []
107 | spritePackingTag:
108 | pSDRemoveMatte: 0
109 | pSDShowRemoveMatteOption: 0
110 | userData:
111 | assetBundleName:
112 | assetBundleVariant:
113 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/Prefabs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 88abb39375d5da0469fb7aeb358ae504
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/Prefabs/MMDGameObject.prefab:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!1 &177590
4 | GameObject:
5 | m_ObjectHideFlags: 0
6 | m_PrefabParentObject: {fileID: 0}
7 | m_PrefabInternal: {fileID: 100100000}
8 | serializedVersion: 5
9 | m_Component:
10 | - component: {fileID: 417552}
11 | - component: {fileID: 3310420}
12 | - component: {fileID: 114787368994509120}
13 | - component: {fileID: 137932525872769078}
14 | m_Layer: 0
15 | m_Name: MMDGameObject
16 | m_TagString: Untagged
17 | m_Icon: {fileID: 0}
18 | m_NavMeshLayer: 0
19 | m_StaticEditorFlags: 0
20 | m_IsActive: 1
21 | --- !u!4 &417552
22 | Transform:
23 | m_ObjectHideFlags: 1
24 | m_PrefabParentObject: {fileID: 0}
25 | m_PrefabInternal: {fileID: 100100000}
26 | m_GameObject: {fileID: 177590}
27 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
28 | m_LocalPosition: {x: 0, y: 0, z: 0}
29 | m_LocalScale: {x: 1, y: 1, z: 1}
30 | m_Children: []
31 | m_Father: {fileID: 0}
32 | m_RootOrder: 0
33 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
34 | --- !u!33 &3310420
35 | MeshFilter:
36 | m_ObjectHideFlags: 1
37 | m_PrefabParentObject: {fileID: 0}
38 | m_PrefabInternal: {fileID: 100100000}
39 | m_GameObject: {fileID: 177590}
40 | m_Mesh: {fileID: 0}
41 | --- !u!1001 &100100000
42 | Prefab:
43 | m_ObjectHideFlags: 1
44 | serializedVersion: 2
45 | m_Modification:
46 | m_TransformParent: {fileID: 0}
47 | m_Modifications:
48 | - target: {fileID: 0}
49 | propertyPath: m_CastShadows
50 | value: 1
51 | objectReference: {fileID: 0}
52 | - target: {fileID: 0}
53 | propertyPath: m_StaticEditorFlags
54 | value: 0
55 | objectReference: {fileID: 0}
56 | - target: {fileID: 0}
57 | propertyPath: m_LocalScale.x
58 | value: 1
59 | objectReference: {fileID: 0}
60 | - target: {fileID: 0}
61 | propertyPath: m_LocalScale.y
62 | value: 1
63 | objectReference: {fileID: 0}
64 | - target: {fileID: 0}
65 | propertyPath: m_LocalScale.z
66 | value: 1
67 | objectReference: {fileID: 0}
68 | - target: {fileID: 0}
69 | propertyPath: m_FadeMode
70 | value: 0
71 | objectReference: {fileID: 0}
72 | - target: {fileID: 0}
73 | propertyPath: m_ReceiveShadows
74 | value: 1
75 | objectReference: {fileID: 0}
76 | - target: {fileID: 0}
77 | propertyPath: m_UseLightProbes
78 | value: 0
79 | objectReference: {fileID: 0}
80 | - target: {fileID: 0}
81 | propertyPath: m_ReflectionProbeUsage
82 | value: 0
83 | objectReference: {fileID: 0}
84 | m_RemovedComponents: []
85 | m_ParentPrefab: {fileID: 0}
86 | m_RootGameObject: {fileID: 177590}
87 | m_IsPrefabParent: 1
88 | --- !u!114 &114787368994509120
89 | MonoBehaviour:
90 | m_ObjectHideFlags: 1
91 | m_PrefabParentObject: {fileID: 0}
92 | m_PrefabInternal: {fileID: 100100000}
93 | m_GameObject: {fileID: 177590}
94 | m_Enabled: 1
95 | m_EditorHideFlags: 0
96 | m_Script: {fileID: 11500000, guid: 9addb051abdb431f8fafe04b8c4388a3, type: 3}
97 | m_Name:
98 | m_EditorClassIdentifier:
99 | AutoPhysicsStepLength: 1
100 | Playing: 0
101 | PhysicsCacheFrameSize: 60
102 | PhysicsMode: 2
103 | --- !u!137 &137932525872769078
104 | SkinnedMeshRenderer:
105 | m_ObjectHideFlags: 1
106 | m_PrefabParentObject: {fileID: 0}
107 | m_PrefabInternal: {fileID: 100100000}
108 | m_GameObject: {fileID: 177590}
109 | m_Enabled: 1
110 | m_CastShadows: 1
111 | m_ReceiveShadows: 1
112 | m_MotionVectors: 1
113 | m_LightProbeUsage: 0
114 | m_ReflectionProbeUsage: 0
115 | m_Materials: []
116 | m_StaticBatchInfo:
117 | firstSubMesh: 0
118 | subMeshCount: 0
119 | m_StaticBatchRoot: {fileID: 0}
120 | m_ProbeAnchor: {fileID: 0}
121 | m_LightProbeVolumeOverride: {fileID: 0}
122 | m_ScaleInLightmap: 1
123 | m_PreserveUVs: 0
124 | m_IgnoreNormalsForChartDetection: 0
125 | m_ImportantGI: 0
126 | m_SelectedEditorRenderState: 3
127 | m_MinimumChartSize: 4
128 | m_AutoUVMaxDistance: 0.5
129 | m_AutoUVMaxAngle: 89
130 | m_LightmapParameters: {fileID: 0}
131 | m_SortingLayerID: 0
132 | m_SortingLayer: 0
133 | m_SortingOrder: 0
134 | serializedVersion: 2
135 | m_Quality: 4
136 | m_UpdateWhenOffscreen: 0
137 | m_SkinnedMotionVectors: 0
138 | m_Mesh: {fileID: 0}
139 | m_Bones: []
140 | m_BlendShapeWeights: []
141 | m_RootBone: {fileID: 0}
142 | m_AABB:
143 | m_Center: {x: 0, y: 0, z: 0}
144 | m_Extent: {x: 0, y: 0, z: 0}
145 | m_DirtyAABB: 1
146 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/Prefabs/MMDGameObject.prefab.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 70b1f02c41a9a3042b808297ca23f687
3 | PrefabImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/Shaders.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 1ef162dda4227e94ab1c4e4e22b46c31
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/Shaders/MeshPmdMaterial-CullBack-NoCastShadow.shader:
--------------------------------------------------------------------------------
1 | /*
2 | * MMD Shader for Unity
3 | *
4 | * Copyright 2012 Masataka SUMI, Takahiro INOUE
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | Shader "MMD/PMDMaterial-CullBack-NoCastShadow"
19 | {
20 | Properties
21 | {
22 | _Color("拡散色", Color) = (1,1,1,1)
23 | _SpecularColor("反射色", Color) = (1,1,1)
24 | _AmbColor("環境色", Color) = (1,1,1)
25 | _Shininess("反射強度", Float) = 0
26 | _MainTex("テクスチャ", 2D) = "white" {}
27 | _ToonTex("トゥーン", 2D) = "white" {}
28 | _SphereAddTex("スフィア(加算)", 2D) = "black" {}
29 | _SphereMulTex("スフィア(乗算)", 2D) = "white" {}
30 | }
31 |
32 | SubShader
33 | {
34 | // Settings
35 | Tags
36 | {
37 | "ForceNoShadowCasting" = "True"
38 | }
39 |
40 | // First Pass
41 | Pass
42 | {
43 | Cull Back
44 | }
45 |
46 | // Surface Shader
47 | CGPROGRAM
48 | #pragma surface surf MMD
49 | #pragma multi_compile SELFSHADOW_OFF SELFSHADOW_ON
50 | #include "MeshPmdMaterialSurface.cginc"
51 | ENDCG
52 | }
53 |
54 | // Other Environment
55 | Fallback "Diffuse"
56 | }
57 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/Shaders/MeshPmdMaterial-CullBack-NoCastShadow.shader.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 9c0dae108095f084dac4a04ea82dd207
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/Shaders/MeshPmdMaterial-CullBack.shader:
--------------------------------------------------------------------------------
1 | /*
2 | * MMD Shader for Unity
3 | *
4 | * Copyright 2012 Masataka SUMI, Takahiro INOUE
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | Shader "MMD/PMDMaterial-CullBack"
19 | {
20 | Properties
21 | {
22 | _Color("拡散色", Color) = (1,1,1,1)
23 | _SpecularColor("反射色", Color) = (1,1,1)
24 | _AmbColor("環境色", Color) = (1,1,1)
25 | _Shininess("反射強度", Float) = 0
26 | _MainTex("テクスチャ", 2D) = "white" {}
27 | _ToonTex("トゥーン", 2D) = "white" {}
28 | _SphereAddTex("スフィア(加算)", 2D) = "black" {}
29 | _SphereMulTex("スフィア(乗算)", 2D) = "white" {}
30 | }
31 |
32 | SubShader
33 | {
34 | // First Pass
35 | Pass
36 | {
37 | Cull Back
38 | }
39 |
40 | // Surface Shader
41 | CGPROGRAM
42 | #pragma surface surf MMD
43 | #pragma multi_compile SELFSHADOW_OFF SELFSHADOW_ON
44 | #include "MeshPmdMaterialSurface.cginc"
45 | ENDCG
46 |
47 | // ShadowCast Pass
48 | Pass
49 | {
50 | Tags
51 | {
52 | "LightMode" = "ShadowCaster"
53 | }
54 | Cull Off
55 | Lighting Off
56 | //Offset [_ShadowBias], [_ShadowBiasSlope] //使えない様なのでコメントアウト
57 | AlphaTest Greater 0.25
58 |
59 | CGPROGRAM
60 | #pragma vertex shadow_vert
61 | #pragma fragment shadow_frag
62 | #include "UnityCG.cginc"
63 | #include "MeshPmdMaterialShadowVertFrag.cginc"
64 | ENDCG
65 | }
66 | }
67 |
68 | // Other Environment
69 | Fallback "Diffuse"
70 | }
71 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/Shaders/MeshPmdMaterial-CullBack.shader.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: b878465034ca5b84892787cd959ae37f
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/Shaders/MeshPmdMaterial-NoCastShadow.shader:
--------------------------------------------------------------------------------
1 | /*
2 | * MMD Shader for Unity
3 | *
4 | * Copyright 2012 Masataka SUMI, Takahiro INOUE
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | Shader "MMD/PMDMaterial-NoCastShadow"
19 | {
20 | Properties
21 | {
22 | _Color("拡散色", Color) = (1,1,1,1)
23 | _SpecularColor("反射色", Color) = (1,1,1)
24 | _AmbColor("環境色", Color) = (1,1,1)
25 | _Shininess("反射強度", Float) = 0
26 | _MainTex("テクスチャ", 2D) = "white" {}
27 | _ToonTex("トゥーン", 2D) = "white" {}
28 | _SphereAddTex("スフィア(加算)", 2D) = "black" {}
29 | _SphereMulTex("スフィア(乗算)", 2D) = "white" {}
30 | }
31 |
32 | SubShader
33 | {
34 | // Settings
35 | Tags
36 | {
37 | "ForceNoShadowCasting" = "True"
38 | }
39 |
40 | // First Pass
41 | Pass
42 | {
43 | Cull Off
44 | }
45 |
46 | // Surface Shader
47 | CGPROGRAM
48 | #pragma surface surf MMD
49 | #pragma multi_compile SELFSHADOW_OFF SELFSHADOW_ON
50 | #include "MeshPmdMaterialSurface.cginc"
51 | ENDCG
52 | }
53 |
54 | // Other Environment
55 | Fallback "Diffuse"
56 | }
57 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/Shaders/MeshPmdMaterial-NoCastShadow.shader.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 6e4e659cc5a17a64bbd02a96dde31fe6
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/Shaders/MeshPmdMaterial-Trans-CullBack-NoCastShadow.shader:
--------------------------------------------------------------------------------
1 | /*
2 | * MMD Shader for Unity
3 | *
4 | * Copyright 2012 Masataka SUMI, Takahiro INOUE
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | Shader "MMD/Transparent/PMDMaterial-CullBack-NoCastShadow"
19 | {
20 | Properties
21 | {
22 | _Color("拡散色", Color) = (1,1,1,1)
23 | _Opacity("不透明度", Float) = 1.0
24 | _SpecularColor("反射色", Color) = (1,1,1)
25 | _AmbColor("環境色", Color) = (1,1,1)
26 | _Shininess("反射強度", Float) = 0
27 | _MainTex("テクスチャ", 2D) = "white" {}
28 | _ToonTex("トゥーン", 2D) = "white" {}
29 | _SphereAddTex("スフィア(加算)", 2D) = "black" {}
30 | _SphereMulTex("スフィア(乗算)", 2D) = "white" {}
31 | }
32 |
33 | SubShader
34 | {
35 | // Settings
36 | Tags
37 | {
38 | "Queue" = "Geometry+2"
39 | "RenderType" = "Transparent"
40 | }
41 |
42 | // Surface Shader
43 | Cull Back
44 | ZWrite On
45 | Blend SrcAlpha OneMinusSrcAlpha
46 | AlphaTest Greater 0.0
47 | CGPROGRAM
48 | #pragma surface surf MMD keepalpha
49 | #pragma multi_compile SELFSHADOW_OFF SELFSHADOW_ON
50 | #include "MeshPmdMaterialSurface.cginc"
51 | ENDCG
52 |
53 | }
54 |
55 | // Other Environment
56 | Fallback "Transparent/Diffuse"
57 | }
58 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/Shaders/MeshPmdMaterial-Trans-CullBack-NoCastShadow.shader.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: bc3f4ca3abc77df4dbc26041c0c93134
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/Shaders/MeshPmdMaterial-Trans-CullBack.shader:
--------------------------------------------------------------------------------
1 | /*
2 | * MMD Shader for Unity
3 | *
4 | * Copyright 2012 Masataka SUMI, Takahiro INOUE
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | Shader "MMD/Transparent/PMDMaterial-CullBack"
19 | {
20 | Properties
21 | {
22 | _Color("拡散色", Color) = (1,1,1,1)
23 | _Opacity("不透明度", Float) = 1.0
24 | _SpecularColor("反射色", Color) = (1,1,1)
25 | _AmbColor("環境色", Color) = (1,1,1)
26 | _Shininess("反射強度", Float) = 0
27 | _MainTex("テクスチャ", 2D) = "white" {}
28 | _ToonTex("トゥーン", 2D) = "white" {}
29 | _SphereAddTex("スフィア(加算)", 2D) = "black" {}
30 | _SphereMulTex("スフィア(乗算)", 2D) = "white" {}
31 | }
32 |
33 | SubShader
34 | {
35 | // Settings
36 | Tags
37 | {
38 | "Queue" = "Geometry+2"
39 | "RenderType" = "Transparent"
40 | }
41 |
42 | // Surface Shader
43 | Cull Back
44 | ZWrite On
45 | Blend SrcAlpha OneMinusSrcAlpha
46 | AlphaTest Greater 0.0
47 | CGPROGRAM
48 | #pragma surface surf MMD keepalpha
49 | #pragma multi_compile SELFSHADOW_OFF SELFSHADOW_ON
50 | #include "MeshPmdMaterialSurface.cginc"
51 | ENDCG
52 |
53 | // ShadowCast Pass
54 | Pass
55 | {
56 | Tags
57 | {
58 | "LightMode" = "ShadowCaster"
59 | }
60 | Cull Off
61 | Lighting Off
62 | //Offset [_ShadowBias], [_ShadowBiasSlope] //使えない様なのでコメントアウト
63 | AlphaTest Greater 0.25
64 |
65 | CGPROGRAM
66 | #pragma vertex shadow_vert
67 | #pragma fragment shadow_frag
68 | #include "UnityCG.cginc"
69 | #include "MeshPmdMaterialShadowVertFrag.cginc"
70 | ENDCG
71 | }
72 |
73 | }
74 |
75 | // Other Environment
76 | Fallback "Transparent/Diffuse"
77 | }
78 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/Shaders/MeshPmdMaterial-Trans-CullBack.shader.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 131572510e2098449ad2c0d3ac4c0221
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/Shaders/MeshPmdMaterial-Trans-NoCastShadow.shader:
--------------------------------------------------------------------------------
1 | /*
2 | * MMD Shader for Unity
3 | *
4 | * Copyright 2012 Masataka SUMI, Takahiro INOUE
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | Shader "MMD/Transparent/PMDMaterial-NoCastShadow"
19 | {
20 | Properties
21 | {
22 | _Color("拡散色", Color) = (1,1,1,1)
23 | _Opacity("不透明度", Float) = 1.0
24 | _SpecularColor("反射色", Color) = (1,1,1)
25 | _AmbColor("環境色", Color) = (1,1,1)
26 | _Shininess("反射強度", Float) = 0
27 | _MainTex("テクスチャ", 2D) = "white" {}
28 | _ToonTex("トゥーン", 2D) = "white" {}
29 | _SphereAddTex("スフィア(加算)", 2D) = "black" {}
30 | _SphereMulTex("スフィア(乗算)", 2D) = "white" {}
31 | }
32 |
33 | SubShader
34 | {
35 | // Settings
36 | Tags
37 | {
38 | "Queue" = "Geometry+2"
39 | "RenderType" = "Transparent"
40 | }
41 |
42 | // Surface Shader
43 | Cull Front
44 | ZWrite Off
45 | Blend SrcAlpha OneMinusSrcAlpha
46 | AlphaTest Greater 0.0
47 | CGPROGRAM
48 | #pragma surface surf MMD keepalpha
49 | #pragma multi_compile SELFSHADOW_OFF SELFSHADOW_ON
50 | #include "MeshPmdMaterialSurface.cginc"
51 | ENDCG
52 |
53 | // Surface Shader
54 | Cull Back
55 | ZWrite On
56 | Blend SrcAlpha OneMinusSrcAlpha
57 | AlphaTest Greater 0.0
58 | CGPROGRAM
59 | #pragma surface surf MMD keepalpha
60 | #include "MeshPmdMaterialSurface.cginc"
61 | ENDCG
62 |
63 | }
64 |
65 | // Other Environment
66 | Fallback "Transparent/Diffuse"
67 | }
68 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/Shaders/MeshPmdMaterial-Trans-NoCastShadow.shader.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 4d4e93a8f67f71347878527ffa14f1da
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/Shaders/MeshPmdMaterial-Trans.shader:
--------------------------------------------------------------------------------
1 | /*
2 | * MMD Shader for Unity
3 | *
4 | * Copyright 2012 Masataka SUMI, Takahiro INOUE
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | Shader "MMD/Transparent/PMDMaterial"
19 | {
20 | Properties
21 | {
22 | _Color("拡散色", Color) = (1,1,1,1)
23 | _Opacity("不透明度", Float) = 1.0
24 | _SpecularColor("反射色", Color) = (1,1,1)
25 | _AmbColor("環境色", Color) = (1,1,1)
26 | _Shininess("反射強度", Float) = 0
27 | _MainTex("テクスチャ", 2D) = "white" {}
28 | _ToonTex("トゥーン", 2D) = "white" {}
29 | _SphereAddTex("スフィア(加算)", 2D) = "black" {}
30 | _SphereMulTex("スフィア(乗算)", 2D) = "white" {}
31 | }
32 |
33 | SubShader
34 | {
35 | // Settings
36 | Tags
37 | {
38 | "Queue" = "Geometry+2"
39 | "RenderType" = "Transparent"
40 | }
41 |
42 | // Surface Shader
43 | Cull Front
44 | ZWrite Off
45 | Blend SrcAlpha OneMinusSrcAlpha
46 | AlphaTest Greater 0.0
47 | CGPROGRAM
48 | #pragma surface surf MMD keepalpha
49 | #pragma multi_compile SELFSHADOW_OFF SELFSHADOW_ON
50 | #include "MeshPmdMaterialSurface.cginc"
51 | ENDCG
52 |
53 | // Surface Shader
54 | Cull Back
55 | ZWrite On
56 | Blend SrcAlpha OneMinusSrcAlpha
57 | AlphaTest Greater 0.0
58 | CGPROGRAM
59 | #pragma surface surf MMD keepalpha
60 | #include "MeshPmdMaterialSurface.cginc"
61 | ENDCG
62 |
63 | // ShadowCast Pass
64 | Pass
65 | {
66 | Tags
67 | {
68 | "LightMode" = "ShadowCaster"
69 | }
70 | Cull Off
71 | Lighting Off
72 | //Offset [_ShadowBias], [_ShadowBiasSlope] //使えない様なのでコメントアウト
73 | AlphaTest Greater 0.25
74 |
75 | CGPROGRAM
76 | #pragma vertex shadow_vert
77 | #pragma fragment shadow_frag
78 | #include "UnityCG.cginc"
79 | #include "MeshPmdMaterialShadowVertFrag.cginc"
80 | ENDCG
81 | }
82 |
83 | }
84 |
85 | // Other Environment
86 | Fallback "Transparent/Diffuse"
87 | }
88 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/Shaders/MeshPmdMaterial-Trans.shader.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 850c72c94eaa31b45b4ded8ad3951eaf
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/Shaders/MeshPmdMaterial.shader:
--------------------------------------------------------------------------------
1 | /*
2 | * MMD Shader for Unity
3 | *
4 | * Copyright 2012 Masataka SUMI, Takahiro INOUE
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | Shader "MMD/PMDMaterial"
19 | {
20 | Properties
21 | {
22 | _Color("拡散色", Color) = (1,1,1,1)
23 | _SpecularColor("反射色", Color) = (1,1,1)
24 | _AmbColor("環境色", Color) = (1,1,1)
25 | _Shininess("反射強度", Float) = 0
26 | _MainTex("テクスチャ", 2D) = "white" {}
27 | _ToonTex("トゥーン", 2D) = "white" {}
28 | _SphereAddTex("スフィア(加算)", 2D) = "black" {}
29 | _SphereMulTex("スフィア(乗算)", 2D) = "white" {}
30 | }
31 |
32 | SubShader
33 | {
34 | // First Pass
35 | Pass
36 | {
37 | Cull Off
38 | }
39 |
40 | // Surface Shader
41 | CGPROGRAM
42 | #pragma surface surf MMD
43 | #pragma multi_compile SELFSHADOW_OFF SELFSHADOW_ON
44 | #include "MeshPmdMaterialSurface.cginc"
45 | ENDCG
46 |
47 | // ShadowCast Pass
48 | Pass
49 | {
50 | Tags
51 | {
52 | "LightMode" = "ShadowCaster"
53 | }
54 | Cull Off
55 | Lighting Off
56 | //Offset [_ShadowBias], [_ShadowBiasSlope] //使えない様なのでコメントアウト
57 | AlphaTest Greater 0.25
58 |
59 | CGPROGRAM
60 | #pragma vertex shadow_vert
61 | #pragma fragment shadow_frag
62 | #include "UnityCG.cginc"
63 | #include "MeshPmdMaterialShadowVertFrag.cginc"
64 | ENDCG
65 | }
66 | }
67 |
68 | // Other Environment
69 | Fallback "Diffuse"
70 | }
71 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/Shaders/MeshPmdMaterial.shader.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: ec7b78b42916c9b4c894b3e4a3e2f8c0
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/Shaders/MeshPmdMaterialDummy.shader:
--------------------------------------------------------------------------------
1 | /*
2 | * MMD Shader for Unity
3 | *
4 | * Copyright 2012 Masataka SUMI, Takahiro INOUE
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | Shader "MMD/Dummy"
19 | {
20 | Properties
21 | {
22 | _Color("拡散色", Color) = (1,1,1,1)
23 | _Opacity("不透明度", Float) = 1.0
24 | _SpecularColor("反射色", Color) = (1,1,1)
25 | _AmbColor("環境色", Color) = (1,1,1)
26 | _Shininess("反射強度", Float) = 0
27 | _OutlineColor("エッジ色", Color) = (0,0,0,1)
28 | _OutlineWidth("エッジ幅", Range(0,1)) = 0.2
29 | _MainTex("テクスチャ", 2D) = "white" {}
30 | _ToonTex("トゥーン", 2D) = "white" {}
31 | _SphereAddTex("スフィア(加算)", 2D) = "black" {}
32 | _SphereMulTex("スフィア(乗算)", 2D) = "white" {}
33 |
34 | _DummyColor("ダミー色", Color) = (1,0,1,1)
35 | _DummyOriginalShaderType("オリジナルシェーダータイプ", Float) = 0
36 | }
37 |
38 | SubShader
39 | {
40 | // First Pass
41 | Pass
42 | {
43 | Color[_DummyColor]
44 | Lighting Off
45 | Cull Off
46 | ZWrite On
47 | ZTest LEqual
48 | Offset 0, 0
49 | AlphaTest Greater 0.0
50 | }
51 | }
52 |
53 | // Other Environment
54 | Fallback "Diffuse"
55 | }
56 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/Shaders/MeshPmdMaterialDummy.shader.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 6e403e015449f7b4ba8c501578489f0c
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/Shaders/MeshPmdMaterialOutline-CullBack-NoCastShadow.shader:
--------------------------------------------------------------------------------
1 | /*
2 | * MMD Shader for Unity
3 | *
4 | * Copyright 2012 Masataka SUMI, Takahiro INOUE
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | Shader "MMD/PMDMaterial-with-Outline-CullBack-NoCastShadow"
19 | {
20 | Properties
21 | {
22 | _Color("拡散色", Color) = (1,1,1,1)
23 | _SpecularColor("反射色", Color) = (1,1,1)
24 | _AmbColor("環境色", Color) = (1,1,1)
25 | _Shininess("反射強度", Float) = 0
26 | _OutlineColor("エッジ色", Color) = (0,0,0,1)
27 | _OutlineWidth("エッジ幅", Range(0,1)) = 0.2
28 | _MainTex("テクスチャ", 2D) = "white" {}
29 | _ToonTex("トゥーン", 2D) = "white" {}
30 | _SphereAddTex("スフィア(加算)", 2D) = "black" {}
31 | _SphereMulTex("スフィア(乗算)", 2D) = "white" {}
32 | }
33 |
34 | SubShader
35 | {
36 | // Settings
37 | Tags
38 | {
39 | "ForceNoShadowCasting" = "True"
40 | }
41 |
42 | // Surface Shader
43 | Cull Back
44 | CGPROGRAM
45 | #pragma surface surf MMD
46 | #pragma multi_compile SELFSHADOW_OFF SELFSHADOW_ON
47 | #include "MeshPmdMaterialSurface.cginc"
48 | ENDCG
49 |
50 | // Outline Pass
51 | Pass
52 | {
53 | Cull Front
54 | Lighting Off
55 |
56 | CGPROGRAM
57 | #pragma vertex vert
58 | #pragma fragment frag
59 | #include "UnityCG.cginc"
60 | #include "MeshPmdMaterialVertFrag.cginc"
61 | ENDCG
62 | }
63 | }
64 |
65 | // Other Environment
66 | Fallback "Diffuse"
67 | }
68 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/Shaders/MeshPmdMaterialOutline-CullBack-NoCastShadow.shader.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 0f3f49635e17095438204bb6b2a66f2c
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/Shaders/MeshPmdMaterialOutline-CullBack.shader:
--------------------------------------------------------------------------------
1 | /*
2 | * MMD Shader for Unity
3 | *
4 | * Copyright 2012 Masataka SUMI, Takahiro INOUE
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | Shader "MMD/PMDMaterial-with-Outline-CullBack"
19 | {
20 | Properties
21 | {
22 | _Color("拡散色", Color) = (1,1,1,1)
23 | _SpecularColor("反射色", Color) = (1,1,1)
24 | _AmbColor("環境色", Color) = (1,1,1)
25 | _Shininess("反射強度", Float) = 0
26 | _OutlineColor("エッジ色", Color) = (0,0,0,1)
27 | _OutlineWidth("エッジ幅", Range(0,1)) = 0.2
28 | _MainTex("テクスチャ", 2D) = "white" {}
29 | _ToonTex("トゥーン", 2D) = "white" {}
30 | _SphereAddTex("スフィア(加算)", 2D) = "black" {}
31 | _SphereMulTex("スフィア(乗算)", 2D) = "white" {}
32 | }
33 |
34 | SubShader
35 | {
36 | // Surface Shader
37 | Cull Back
38 | CGPROGRAM
39 | #pragma surface surf MMD
40 | #pragma multi_compile SELFSHADOW_OFF SELFSHADOW_ON
41 | #include "MeshPmdMaterialSurface.cginc"
42 | ENDCG
43 |
44 | // Outline Pass
45 | Pass
46 | {
47 | Cull Front
48 | Lighting Off
49 |
50 | CGPROGRAM
51 | #pragma vertex vert
52 | #pragma fragment frag
53 | #include "UnityCG.cginc"
54 | #include "MeshPmdMaterialVertFrag.cginc"
55 | ENDCG
56 | }
57 |
58 | // ShadowCast Pass
59 | Pass
60 | {
61 | Tags
62 | {
63 | "LightMode" = "ShadowCaster"
64 | }
65 | Cull Off
66 | Lighting Off
67 | //Offset [_ShadowBias], [_ShadowBiasSlope] //使えない様なのでコメントアウト
68 | AlphaTest Greater 0.25
69 |
70 | CGPROGRAM
71 | #pragma vertex shadow_vert
72 | #pragma fragment shadow_frag
73 | #include "UnityCG.cginc"
74 | #include "MeshPmdMaterialShadowVertFrag.cginc"
75 | ENDCG
76 | }
77 | }
78 |
79 | // Other Environment
80 | Fallback "Diffuse"
81 | }
82 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/Shaders/MeshPmdMaterialOutline-CullBack.shader.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: bfee4751c7c365f4a98e3e1deaaffcf2
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/Shaders/MeshPmdMaterialOutline-NoCastShadow.shader:
--------------------------------------------------------------------------------
1 | /*
2 | * MMD Shader for Unity
3 | *
4 | * Copyright 2012 Masataka SUMI, Takahiro INOUE
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | Shader "MMD/PMDMaterial-with-Outline-NoCastShadow"
19 | {
20 | Properties
21 | {
22 | _Color("拡散色", Color) = (1,1,1,1)
23 | _SpecularColor("反射色", Color) = (1,1,1)
24 | _AmbColor("環境色", Color) = (1,1,1)
25 | _Shininess("反射強度", Float) = 0
26 | _OutlineColor("エッジ色", Color) = (0,0,0,1)
27 | _OutlineWidth("エッジ幅", Range(0,1)) = 0.2
28 | _MainTex("テクスチャ", 2D) = "white" {}
29 | _ToonTex("トゥーン", 2D) = "white" {}
30 | _SphereAddTex("スフィア(加算)", 2D) = "black" {}
31 | _SphereMulTex("スフィア(乗算)", 2D) = "white" {}
32 | }
33 |
34 | SubShader
35 | {
36 | // Settings
37 | Tags
38 | {
39 | "ForceNoShadowCasting" = "True"
40 | }
41 |
42 | // Surface Shader
43 | Cull Off
44 | CGPROGRAM
45 | #pragma surface surf MMD
46 | #pragma multi_compile SELFSHADOW_OFF SELFSHADOW_ON
47 | #include "MeshPmdMaterialSurface.cginc"
48 | ENDCG
49 |
50 | // Outline Pass
51 | Pass
52 | {
53 | Cull Front
54 | Lighting Off
55 |
56 | CGPROGRAM
57 | #pragma vertex vert
58 | #pragma fragment frag
59 | #include "UnityCG.cginc"
60 | #include "MeshPmdMaterialVertFrag.cginc"
61 | ENDCG
62 | }
63 | }
64 |
65 | // Other Environment
66 | Fallback "Diffuse"
67 | }
68 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/Shaders/MeshPmdMaterialOutline-NoCastShadow.shader.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d36802937c7c6ea45b93a5032211415f
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/Shaders/MeshPmdMaterialOutline-Trans-CullBack-NoCastShadow.shader:
--------------------------------------------------------------------------------
1 | /*
2 | * MMD Shader for Unity
3 | *
4 | * Copyright 2012 Masataka SUMI, Takahiro INOUE
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | Shader "MMD/Transparent/PMDMaterial-with-Outline-CullBack-NoCastShadow"
19 | {
20 | Properties
21 | {
22 | _Color("拡散色", Color) = (1,1,1,1)
23 | _Opacity("不透明度", Float) = 1.0
24 | _SpecularColor("反射色", Color) = (1,1,1)
25 | _AmbColor("環境色", Color) = (1,1,1)
26 | _Shininess("反射強度", Float) = 0
27 | _OutlineColor("エッジ色", Color) = (0,0,0,1)
28 | _OutlineWidth("エッジ幅", Range(0,1)) = 0.2
29 | _MainTex("テクスチャ", 2D) = "white" {}
30 | _ToonTex("トゥーン", 2D) = "white" {}
31 | _SphereAddTex("スフィア(加算)", 2D) = "black" {}
32 | _SphereMulTex("スフィア(乗算)", 2D) = "white" {}
33 | }
34 |
35 | SubShader
36 | {
37 | // Settings
38 | Tags
39 | {
40 | "Queue" = "Geometry+2"
41 | "RenderType" = "Transparent"
42 | }
43 |
44 | // Surface Shader Pass
45 | Cull Back
46 | ZWrite On
47 | Blend SrcAlpha OneMinusSrcAlpha
48 | AlphaTest Greater 0.0
49 | CGPROGRAM
50 | #pragma surface surf MMD keepalpha
51 | #pragma multi_compile SELFSHADOW_OFF SELFSHADOW_ON
52 | #include "MeshPmdMaterialSurface.cginc"
53 | ENDCG
54 |
55 | // Outline Pass
56 | Pass
57 | {
58 | Cull Front
59 | Lighting Off
60 | CGPROGRAM
61 | #pragma vertex vert
62 | #pragma fragment frag
63 | #include "UnityCG.cginc"
64 | #include "MeshPmdMaterialVertFrag.cginc"
65 | ENDCG
66 | }
67 |
68 | }
69 |
70 | // Other Environment
71 | Fallback "Transparent/Diffuse"
72 | }
73 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/Shaders/MeshPmdMaterialOutline-Trans-CullBack-NoCastShadow.shader.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 22dcf7f6054975948a2561f9cc3113a5
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/Shaders/MeshPmdMaterialOutline-Trans-CullBack.shader:
--------------------------------------------------------------------------------
1 | /*
2 | * MMD Shader for Unity
3 | *
4 | * Copyright 2012 Masataka SUMI, Takahiro INOUE
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | Shader "MMD/Transparent/PMDMaterial-with-Outline-CullBack"
19 | {
20 | Properties
21 | {
22 | _Color("拡散色", Color) = (1,1,1,1)
23 | _Opacity("不透明度", Float) = 1.0
24 | _SpecularColor("反射色", Color) = (1,1,1)
25 | _AmbColor("環境色", Color) = (1,1,1)
26 | _Shininess("反射強度", Float) = 0
27 | _OutlineColor("エッジ色", Color) = (0,0,0,1)
28 | _OutlineWidth("エッジ幅", Range(0,1)) = 0.2
29 | _MainTex("テクスチャ", 2D) = "white" {}
30 | _ToonTex("トゥーン", 2D) = "white" {}
31 | _SphereAddTex("スフィア(加算)", 2D) = "black" {}
32 | _SphereMulTex("スフィア(乗算)", 2D) = "white" {}
33 | }
34 |
35 | SubShader
36 | {
37 | // Settings
38 | Tags
39 | {
40 | "Queue" = "Geometry+2"
41 | "RenderType" = "Transparent"
42 | }
43 |
44 | // Surface Shader Pass
45 | Cull Back
46 | ZWrite On
47 | Blend SrcAlpha OneMinusSrcAlpha
48 | AlphaTest Greater 0.0
49 | CGPROGRAM
50 | #pragma surface surf MMD alpha keepalpha
51 | #pragma multi_compile SELFSHADOW_OFF SELFSHADOW_ON
52 | #include "MeshPmdMaterialSurface.cginc"
53 | ENDCG
54 |
55 | // Outline Pass
56 | Pass
57 | {
58 | Cull Front
59 | Lighting Off
60 | CGPROGRAM
61 | #pragma vertex vert
62 | #pragma fragment frag
63 | #include "UnityCG.cginc"
64 | #include "MeshPmdMaterialVertFrag.cginc"
65 | ENDCG
66 | }
67 |
68 | // ShadowCast Pass
69 | Pass
70 | {
71 | Tags
72 | {
73 | "LightMode" = "ShadowCaster"
74 | }
75 | Cull Off
76 | Lighting Off
77 | //Offset [_ShadowBias], [_ShadowBiasSlope] //使えない様なのでコメントアウト
78 | AlphaTest Greater 0.25
79 |
80 | CGPROGRAM
81 | #pragma vertex shadow_vert
82 | #pragma fragment shadow_frag
83 | #include "UnityCG.cginc"
84 | #include "MeshPmdMaterialShadowVertFrag.cginc"
85 | ENDCG
86 | }
87 |
88 | }
89 |
90 | // Other Environment
91 | Fallback "Transparent/Diffuse"
92 | }
93 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/Shaders/MeshPmdMaterialOutline-Trans-CullBack.shader.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: fd87ac48bd4e44349a164ed7c5b12494
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/Shaders/MeshPmdMaterialOutline-Trans-NoCastShadow.shader:
--------------------------------------------------------------------------------
1 | /*
2 | * MMD Shader for Unity
3 | *
4 | * Copyright 2012 Masataka SUMI, Takahiro INOUE
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | Shader "MMD/Transparent/PMDMaterial-with-Outline-NoCastShadow"
19 | {
20 | Properties
21 | {
22 | _Color("拡散色", Color) = (1,1,1,1)
23 | _Opacity("不透明度", Float) = 1.0
24 | _SpecularColor("反射色", Color) = (1,1,1)
25 | _AmbColor("環境色", Color) = (1,1,1)
26 | _Shininess("反射強度", Float) = 0
27 | _OutlineColor("エッジ色", Color) = (0,0,0,1)
28 | _OutlineWidth("エッジ幅", Range(0,1)) = 0.2
29 | _MainTex("テクスチャ", 2D) = "white" {}
30 | _ToonTex("トゥーン", 2D) = "white" {}
31 | _SphereAddTex("スフィア(加算)", 2D) = "black" {}
32 | _SphereMulTex("スフィア(乗算)", 2D) = "white" {}
33 | }
34 |
35 | SubShader
36 | {
37 | // Settings
38 | Tags
39 | {
40 | "Queue" = "Geometry+2"
41 | "RenderType" = "Transparent"
42 | }
43 |
44 | // Surface Shader Pass ( Back )
45 | Cull Front
46 | ZWrite On
47 | Blend SrcAlpha OneMinusSrcAlpha
48 | AlphaTest Greater 0.0
49 | CGPROGRAM
50 | #pragma surface surf MMD keepalpha
51 | #pragma multi_compile SELFSHADOW_OFF SELFSHADOW_ON
52 | #include "MeshPmdMaterialSurface.cginc"
53 | ENDCG
54 |
55 | // Surface Shader Pass
56 | Cull Back
57 | ZWrite On
58 | Blend SrcAlpha OneMinusSrcAlpha
59 | AlphaTest Greater 0.0
60 | CGPROGRAM
61 | #pragma surface surf MMD keepalpha
62 | #include "MeshPmdMaterialSurface.cginc"
63 | ENDCG
64 |
65 | // Outline Pass
66 | Pass
67 | {
68 | Cull Front
69 | Lighting Off
70 | CGPROGRAM
71 | #pragma vertex vert
72 | #pragma fragment frag
73 | #include "UnityCG.cginc"
74 | #include "MeshPmdMaterialVertFrag.cginc"
75 | ENDCG
76 | }
77 |
78 | }
79 |
80 | // Other Environment
81 | Fallback "Transparent/Diffuse"
82 | }
83 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/Shaders/MeshPmdMaterialOutline-Trans-NoCastShadow.shader.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 7dd9e14aec0d8a34085ea0307e35d348
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/Shaders/MeshPmdMaterialOutline-Trans.shader:
--------------------------------------------------------------------------------
1 | /*
2 | * MMD Shader for Unity
3 | *
4 | * Copyright 2012 Masataka SUMI, Takahiro INOUE
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | Shader "MMD/Transparent/PMDMaterial-with-Outline"
19 | {
20 | Properties
21 | {
22 | _Color("拡散色", Color) = (1,1,1,1)
23 | _SpecularColor("反射色", Color) = (1,1,1)
24 | _AmbColor("環境色", Color) = (1,1,1)
25 | _Shininess("反射強度", Float) = 0
26 | _OutlineColor("エッジ色", Color) = (0,0,0,1)
27 | _OutlineWidth("エッジ幅", Range(0,1)) = 0.2
28 | _MainTex("テクスチャ", 2D) = "white" {}
29 | _ToonTex("トゥーン", 2D) = "white" {}
30 | _SphereAddTex("スフィア(加算)", 2D) = "black" {}
31 | _SphereMulTex("スフィア(乗算)", 2D) = "white" {}
32 | }
33 |
34 | SubShader
35 | {
36 | // Settings
37 | Tags
38 | {
39 | "Queue" = "Geometry+2"
40 | "RenderType" = "Transparent"
41 | }
42 |
43 | // Surface Shader Pass ( Back )
44 | Cull Front
45 | ZWrite On
46 | Blend SrcAlpha OneMinusSrcAlpha
47 | AlphaTest Greater 0.0
48 | CGPROGRAM
49 | #pragma surface surf MMD keepalpha
50 | #include "MeshPmdMaterialSurface.cginc"
51 | ENDCG
52 |
53 | // Surface Shader Pass
54 | Cull Back
55 | ZWrite On
56 | Blend SrcAlpha OneMinusSrcAlpha
57 | AlphaTest Greater 0.0
58 | CGPROGRAM
59 | #pragma surface surf MMD keepalpha
60 | #pragma multi_compile SELFSHADOW_OFF SELFSHADOW_ON
61 | #include "MeshPmdMaterialSurface.cginc"
62 | ENDCG
63 |
64 | // Outline Pass
65 | Pass
66 | {
67 | Cull Front
68 | Lighting Off
69 | CGPROGRAM
70 | #pragma vertex vert
71 | #pragma fragment frag
72 | #include "UnityCG.cginc"
73 | #include "MeshPmdMaterialVertFrag.cginc"
74 | ENDCG
75 | }
76 |
77 | // ShadowCast Pass
78 | Pass
79 | {
80 | Tags
81 | {
82 | "LightMode" = "ShadowCaster"
83 | }
84 | Cull Off
85 | Lighting Off
86 | //Offset [_ShadowBias], [_ShadowBiasSlope] //使えない様なのでコメントアウト
87 | AlphaTest Greater 0.25
88 |
89 | CGPROGRAM
90 | #pragma vertex shadow_vert
91 | #pragma fragment shadow_frag
92 | #include "UnityCG.cginc"
93 | #include "MeshPmdMaterialShadowVertFrag.cginc"
94 | ENDCG
95 | }
96 |
97 | }
98 |
99 | // Other Environment
100 | Fallback "Transparent/Diffuse"
101 | }
102 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/Shaders/MeshPmdMaterialOutline-Trans.shader.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 58e8b0999450953478f32ee5bcaf2723
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/Shaders/MeshPmdMaterialOutline.shader:
--------------------------------------------------------------------------------
1 | /*
2 | * MMD Shader for Unity
3 | *
4 | * Copyright 2012 Masataka SUMI, Takahiro INOUE
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | Shader "MMD/PMDMaterial-with-Outline"
19 | {
20 | Properties
21 | {
22 | _Color("拡散色", Color) = (1,1,1,1)
23 | _SpecularColor("反射色", Color) = (1,1,1)
24 | _AmbColor("環境色", Color) = (1,1,1)
25 | _Shininess("反射強度", Float) = 0
26 | _OutlineColor("エッジ色", Color) = (0,0,0,1)
27 | _OutlineWidth("エッジ幅", Range(0,1)) = 0.2
28 | _MainTex("テクスチャ", 2D) = "white" {}
29 | _ToonTex("トゥーン", 2D) = "white" {}
30 | _SphereAddTex("スフィア(加算)", 2D) = "black" {}
31 | _SphereMulTex("スフィア(乗算)", 2D) = "white" {}
32 | }
33 |
34 | SubShader
35 | {
36 | // Surface Shader
37 | Cull Off
38 | CGPROGRAM
39 | #pragma surface surf MMD
40 | #pragma multi_compile SELFSHADOW_OFF SELFSHADOW_ON
41 | #include "MeshPmdMaterialSurface.cginc"
42 | ENDCG
43 |
44 | // Outline Pass
45 | Pass
46 | {
47 | Cull Front
48 | Lighting Off
49 |
50 | CGPROGRAM
51 | #pragma vertex vert
52 | #pragma fragment frag
53 | #include "UnityCG.cginc"
54 | #include "MeshPmdMaterialVertFrag.cginc"
55 | ENDCG
56 | }
57 | // ShadowCast Pass
58 | Pass
59 | {
60 | Tags
61 | {
62 | "LightMode" = "ShadowCaster"
63 | }
64 | Cull Off
65 | Lighting Off
66 | //Offset [_ShadowBias], [_ShadowBiasSlope] //使えない様なのでコメントアウト
67 | AlphaTest Greater 0.25
68 |
69 | CGPROGRAM
70 | #pragma vertex shadow_vert
71 | #pragma fragment shadow_frag
72 | #include "UnityCG.cginc"
73 | #include "MeshPmdMaterialShadowVertFrag.cginc"
74 | ENDCG
75 | }
76 | }
77 |
78 | // Other Environment
79 | Fallback "Diffuse"
80 | }
81 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/Shaders/MeshPmdMaterialOutline.shader.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: ab8920688200fc04b87e365997f5ea78
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/Shaders/MeshPmdMaterialShadowVertFrag.cginc:
--------------------------------------------------------------------------------
1 | // Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
2 |
3 | /*
4 | * MMD Shader for Unity
5 | *
6 | * Copyright 2012 Masataka SUMI, Takahiro INOUE
7 | *
8 | * Licensed under the Apache License, Version 2.0 (the "License");
9 | * you may not use this file except in compliance with the License.
10 | * You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | float _Opacity;
21 | sampler2D _MainTex;
22 | float4 _MainTex_ST;
23 |
24 | struct v2f
25 | {
26 | float4 pos : SV_POSITION;
27 | float2 uv : TEXCOORD0;
28 | };
29 |
30 | v2f shadow_vert( appdata_img v )
31 | {
32 | v2f o;
33 | o.pos = UnityObjectToClipPos(v.vertex);
34 | o.uv = TRANSFORM_TEX(v.texcoord, _MainTex);
35 | return o;
36 | }
37 |
38 | half4 shadow_frag( v2f i ) : COLOR
39 | {
40 | float4 tex_color = tex2D(_MainTex, i.uv);
41 | return half4(0, 0, 0, tex_color.a * _Opacity);
42 | }
43 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/Shaders/MeshPmdMaterialShadowVertFrag.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 60f01af13c880e54baa11c86da0c2ed5
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/Shaders/MeshPmdMaterialSurface.cginc:
--------------------------------------------------------------------------------
1 | /*
2 | * MMD Shader for Unity
3 | *
4 | * Copyright 2012 Masataka SUMI, Takahiro INOUE
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 | float4 _Color;
19 | float _Opacity;
20 | float4 _AmbColor;
21 | float4 _SpecularColor;
22 | float _Shininess;
23 | sampler2D _MainTex;
24 | sampler2D _ToonTex;
25 | sampler2D _SphereAddTex;
26 | sampler2D _SphereMulTex;
27 |
28 | struct EditorSurfaceOutput
29 | {
30 | half3 Albedo;
31 | half3 Normal;
32 | half3 Emission;
33 | half3 Gloss;
34 | half Specular;
35 | half Alpha;
36 | half4 Custom;
37 | };
38 |
39 | inline half4 LightingMMD (EditorSurfaceOutput s, half3 lightDir, half3 viewDir, half atten)
40 | {
41 | // Specular
42 | float specularStrength = s.Specular;
43 | float dirDotNormalHalf = max(0, dot(s.Normal, normalize(lightDir + viewDir)));
44 | float dirSpecularWeight = pow( dirDotNormalHalf, _Shininess );
45 | float4 dirSpecular = _SpecularColor * _LightColor0 * dirSpecularWeight;
46 | // ToonMap
47 | #ifdef SELFSHADOW_ON
48 | float lightStrength = atten;
49 | #else
50 | float lightStrength = dot(lightDir, s.Normal) * 0.5 + 0.5;
51 | #endif
52 | float4 toon = tex2D( _ToonTex, float2( specularStrength, lightStrength ) );
53 | // Output
54 | float4 color = saturate( _AmbColor + ( _Color * _LightColor0 ) );
55 | color *= s.Custom;
56 | color += saturate(dirSpecular);
57 | color *= toon;
58 | color.a = s.Alpha;
59 | return color;
60 | }
61 |
62 | struct Input
63 | {
64 | float2 uv_MainTex;
65 | };
66 |
67 | void surf (Input IN, inout EditorSurfaceOutput o)
68 | {
69 | // Defaults
70 | o.Albedo = 0.0;
71 | o.Emission = 0.0;
72 | o.Gloss = 0.0;
73 | o.Specular = 0.0;
74 |
75 | // Diffuse Map
76 | float2 uv_coord = float2( IN.uv_MainTex.x, IN.uv_MainTex.y );
77 | float4 tex_color = tex2D( _MainTex, uv_coord );
78 | // Sphere Map
79 | //float3 viewNormal = normalize( mul( UNITY_MATRIX_MV, float4(normalize(o.Normal), 0.0) ).xyz );//部分机型上这个不支持
80 | float3 viewNormal = normalize(UnityObjectToViewPos(normalize(o.Normal)) - UnityObjectToViewPos(float3(0.0,0.0,0.0)));
81 | float2 sphereUv = viewNormal.xy * 0.5 + 0.5;
82 | float4 sphereAdd = tex2D( _SphereAddTex, sphereUv );
83 | float4 sphereMul = tex2D( _SphereMulTex, sphereUv );
84 |
85 | // Output
86 | o.Custom = tex_color; // DiffuseTex Default:White
87 | o.Custom += sphereAdd; // SphereAddTex Default:Black
88 | o.Custom *= sphereMul; // SphereMulTex Default:White
89 | o.Custom.a = 1.0;
90 | o.Alpha = _Opacity * tex_color.a;
91 | }
92 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/Shaders/MeshPmdMaterialSurface.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 4288033d0e2c0bc4c9546e35b2ff4bf7
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/Shaders/MeshPmdMaterialVertFrag.cginc:
--------------------------------------------------------------------------------
1 | // Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
2 |
3 | /*
4 | * MMD Shader for Unity
5 | *
6 | * Copyright 2012 Masataka SUMI, Takahiro INOUE
7 | *
8 | * Licensed under the Apache License, Version 2.0 (the "License");
9 | * you may not use this file except in compliance with the License.
10 | * You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | float4 _Color;
21 | float _Opacity;
22 | float4 _OutlineColor;
23 | float _OutlineWidth;
24 |
25 | struct v2f
26 | {
27 | float4 pos : SV_POSITION;
28 | float2 uv : TEXCOORD0;
29 | };
30 |
31 | v2f vert( appdata_base v )
32 | {
33 | v2f o;
34 | float4 pos = UnityObjectToClipPos(v.vertex);
35 | float4 normal = UnityObjectToClipPos(float4(v.normal, 0.0));
36 | float width = _OutlineWidth / 1024.0; //目コピ調整値(算術根拠無し)
37 | float depth_offset = pos.z / 4194304.0; //僅かに奥に移動(floatの仮数部は23bitなので(1<<21)程度で割った値は丸めに入らないが非常に小さな値の筈)
38 | o.pos = pos + normal * float4(width, width, 0.0, 0.0) + float4(0.0, 0.0, depth_offset, 0.0);
39 |
40 | return o;
41 | }
42 | half4 frag( v2f i ) : COLOR
43 | {
44 | return half4( _OutlineColor.rgb, _OutlineColor.a * _Opacity );
45 | }
46 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Resources/Shaders/MeshPmdMaterialVertFrag.cginc.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: e4d61815c76a6744d9339fa5c04160e2
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Unity3D.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 9eaaff87a13992541aa12e9ae8328e68
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Unity3D/AvatarMaker.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: aeeb8df58d0fdc04dbcf0663109f4148
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Unity3D/ImageLoader.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: a260ddf6d9b05734fa2dad314acaad9a
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Unity3D/ImageLoader/BitmapLoader.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using UnityEngine;
4 |
5 | namespace LibMMD.Unity3D.ImageLoader
6 | {
7 | public class BitmapLoader
8 | {
9 | /* BMPPallete: pallete for BMP */
10 | private struct BmpPallete {
11 | public byte B;
12 | public byte G;
13 | public byte R;
14 | public byte A;
15 | };
16 |
17 | /* BMPHeader: header for BMP */
18 | private struct BmpHeader {
19 | public ushort BfType;
20 | public uint BfSize;
21 | public ushort BfReserved1;
22 | public ushort BfReserved2;
23 | public uint BfOffBits;
24 | }
25 |
26 | /* BMPInfo: info for BMP */
27 | struct BmpInfo {
28 | public uint BiSize;
29 | public int BiWidth;
30 | public int BiHeight;
31 | public ushort BiPlanes;
32 | public ushort BiBitCount;
33 | public uint BiCompression;
34 | public uint BiSizeImage;
35 | public uint BiXPelsPerMeter;
36 | public uint BiYPelsPerMeter;
37 | public uint BiClrUsed;
38 | public uint BiClrImportant;
39 | };
40 |
41 | public static TextureImage LoadFromFile(string path)
42 | {
43 | var data = File.ReadAllBytes (path);
44 | if (data [0] != 'B' || data [1] != 'M') {
45 | return null;
46 | }
47 | var offset = 0;
48 | var bmpHeader = ReadBmpHeader (data, ref offset);
49 | var bodyOffset = bmpHeader.BfOffBits;
50 | var len = BitConverter.ToInt64 (data, offset);
51 | if (len == 12) {
52 | return null;
53 | }
54 | var bmpinfo = ReadBmpInfo (data, ref offset);
55 | var width = bmpinfo.BiWidth;
56 | var reversed = false;
57 | int height;
58 | if (bmpinfo.BiHeight < 0) {
59 | height = -bmpinfo.BiHeight;
60 | } else {
61 | height = bmpinfo.BiHeight;
62 | reversed = true;
63 | }
64 | var bit = bmpinfo.BiBitCount;
65 | if (bmpinfo.BiCompression != 0) {
66 | Debug.LogWarningFormat ("not support compressed bitmap {0}", bmpinfo.BiCompression);
67 | return null;
68 | }
69 | Color[] pallette = null;
70 | if (bit <= 8) {
71 | pallette = ReadBmpPallete (data, ref offset, GetPalletteColorCount (bmpinfo.BiClrUsed, bit));
72 | }
73 | var pixels = ReadBmpBody (data, (int) bodyOffset, width, height, bit, reversed, pallette);
74 | return pixels == null ? null : new TextureImage (width, height, pixels);
75 | }
76 |
77 | private static BmpHeader ReadBmpHeader(byte[] data, ref int offset) {
78 | var ret = new BmpHeader
79 | {
80 | BfType = ByteArrayReader.ReadUShort(data, ref offset),
81 | BfSize = ByteArrayReader.ReadUInt(data, ref offset),
82 | BfReserved1 = ByteArrayReader.ReadUShort(data, ref offset),
83 | BfReserved2 = ByteArrayReader.ReadUShort(data, ref offset),
84 | BfOffBits = ByteArrayReader.ReadUInt(data, ref offset)
85 | };
86 | return ret;
87 | }
88 |
89 | private static BmpInfo ReadBmpInfo(byte[] data, ref int offset) {
90 | var ret = new BmpInfo
91 | {
92 | BiSize = ByteArrayReader.ReadUInt(data, ref offset),
93 | BiWidth = ByteArrayReader.ReadInt(data, ref offset),
94 | BiHeight = ByteArrayReader.ReadInt(data, ref offset),
95 | BiPlanes = ByteArrayReader.ReadUShort(data, ref offset),
96 | BiBitCount = ByteArrayReader.ReadUShort(data, ref offset),
97 | BiCompression = ByteArrayReader.ReadUInt(data, ref offset),
98 | BiSizeImage = ByteArrayReader.ReadUInt(data, ref offset),
99 | BiXPelsPerMeter = ByteArrayReader.ReadUInt(data, ref offset),
100 | BiYPelsPerMeter = ByteArrayReader.ReadUInt(data, ref offset),
101 | BiClrUsed = ByteArrayReader.ReadUInt(data, ref offset),
102 | BiClrImportant = ByteArrayReader.ReadUInt(data, ref offset)
103 | };
104 | return ret;
105 | }
106 |
107 | private static Color[] ReadBmpPallete(byte[] data, ref int offset, uint count) {
108 | var ret = new Color[count];
109 | const float maxColorVal = 255.0f;
110 | for (uint i = 0; i < count; i++) {
111 | ret [i].b = data [offset] / maxColorVal;
112 | ret [i].g = data [offset + 1] / maxColorVal;
113 | ret [i].r = data [offset + 2] / maxColorVal;
114 | ret [i].a = data [offset + 3] / maxColorVal;
115 | offset += 4;
116 | }
117 | return ret;
118 | }
119 |
120 | private static uint GetPalletteColorCount(uint nClr, ushort nBit) {
121 | if (nClr != 0) {
122 | return nClr;
123 | }
124 | return ((uint)1) >> nBit;
125 | }
126 |
127 | private static Color[] ReadBmpBody(byte[] data, int offset, int width, int height,int bit, bool reversed, Color[] pallete) {
128 | const float maxByte = 255.0f;
129 | var ret = new Color[width * height];
130 | var lineByte = (width * bit) / 8;
131 | if ((lineByte % 4) != 0) {
132 | lineByte = ((lineByte / 4) + 1) * 4; //force 4-byte alignment
133 | }
134 | var t = 0;
135 | for (var h = 0; h < height; h++) {
136 | int tl;
137 | if (reversed) {
138 | tl = offset + h * lineByte;
139 | } else {
140 | tl = offset + (height - h - 1) * lineByte;
141 | }
142 | for (var w = 0; w < width; w++)
143 | {
144 | byte ci;
145 | switch (bit) {
146 | case 1: {
147 | ci = data[tl + w / 8];
148 | var mod = w % 8;
149 | var bitmask = (mod == 0) ? 0x80 : (0x80 >> mod);
150 | ci = (ci & bitmask) != 0 ? (byte)1 : (byte)0;
151 | ret[t] = pallete[ci];
152 | t++;
153 | }
154 | break;
155 | case 4: {
156 | ci = data [tl + w / 2];
157 | if (w % 2 == 0)
158 | ci = (byte)((ci >> 4) & 0x0f);
159 | else
160 | ci = (byte)(ci & 0x0f);
161 | ret[t] = pallete[ci];
162 | t++;
163 | }
164 | break;
165 | case 8: {
166 | ci = data [tl + w];
167 | ret[t] = pallete[ci];
168 | t++;
169 | }
170 | break;
171 | case 24:
172 | /* BGR -> RGB */
173 | ret [t].r = data [tl + w * 3 + 2] / maxByte;
174 | ret [t].g = data [tl + w * 3 + 1] / maxByte;
175 | ret [t].b = data [tl + w * 3] / maxByte;
176 | ret [t].a = 1.0f;
177 | t++;
178 | break;
179 | case 32:
180 | ret [t].r = data [tl + w * 4 + 2] / maxByte;
181 | ret [t].g = data [tl + w * 4 + 1] / maxByte;
182 | ret [t].b = data [tl + w * 4] / maxByte;
183 | //ret [t].a = data [tl + w * 4 + 3] / maxByte; //有些bmp会变成全透明的orz
184 | ret [t].a = 1.0f;
185 | t++;
186 | break;
187 | default:
188 | return null;
189 | }
190 | }
191 | }
192 | return ret;
193 | }
194 |
195 | }
196 | }
197 |
198 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Unity3D/ImageLoader/BitmapLoader.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: ae95b04f1bc41da4abfa6ba6aacbd19a
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Unity3D/ImageLoader/DDSLoader.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: fdc931497f191fa4e81c010dee1c43b2
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Unity3D/ImageLoader/TargaImage.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: c3917c9113eb16f4a804239cdcbeade2
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Unity3D/ImageLoader/TextureImage.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 |
3 | namespace LibMMD.Unity3D.ImageLoader
4 | {
5 | public class TextureImage
6 | {
7 | private readonly int width;
8 | private readonly int height;
9 | private readonly Color[] pixels;
10 |
11 | public int Width {
12 | get {
13 | return width;
14 | }
15 | }
16 |
17 | public int Height {
18 | get {
19 | return height;
20 | }
21 | }
22 |
23 | public Color[] Pixels {
24 | get {
25 | return pixels;
26 | }
27 | }
28 |
29 | public TextureImage (int width, int height, Color[] pixels)
30 | {
31 | this.width = width;
32 | this.height = height;
33 | this.pixels = pixels;
34 | }
35 | }
36 | }
37 |
38 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Unity3D/ImageLoader/TextureImage.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d15bd2e8f26ad1d49a28da77c1ae253d
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Unity3D/MMDModel.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 3d691346906868a42b19a716a0ca2ee3
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Unity3D/MMDUnityConfig.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace LibMMD.Unity3D
4 | {
5 | public enum MMDConfigSwitch
6 | {
7 | AsConfig = 0,
8 | ForceTrue = 1,
9 | ForceFalse = 2
10 | }
11 |
12 | public class MMDUnityConfig
13 | {
14 | public MMDConfigSwitch EnableDrawSelfShadow;
15 | public MMDConfigSwitch EnableCastShadow;
16 | public MMDConfigSwitch EnableEdge;
17 |
18 | public static bool DealSwitch(MMDConfigSwitch switchVal, bool configVal)
19 | {
20 | switch (switchVal)
21 | {
22 | case MMDConfigSwitch.AsConfig:
23 | return configVal;
24 | case MMDConfigSwitch.ForceTrue:
25 | return true;
26 | case MMDConfigSwitch.ForceFalse:
27 | return false;
28 | default:
29 | throw new ArgumentOutOfRangeException("switchVal", switchVal, null);
30 | }
31 | }
32 | }
33 | }
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Unity3D/MMDUnityConfig.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 43735cc6fa2ef754296beb18361c4b93
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Unity3D/MaterialLoader.cs:
--------------------------------------------------------------------------------
1 | // ------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Mono Runtime Version: 4.0.30319.1
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | // ------------------------------------------------------------------------------
10 |
11 | using System;
12 | using System.Text;
13 | using LibMMD.Material;
14 | using UnityEngine;
15 |
16 | namespace LibMMD.Unity3D
17 | {
18 | public class MaterialLoader : IDisposable
19 | {
20 |
21 | private readonly TextureLoader _textureLoader;
22 |
23 | public MaterialLoader(TextureLoader textureLoader) {
24 | _textureLoader = textureLoader;
25 | }
26 |
27 | public UnityEngine.Material LoadMaterial(MMDMaterial mmdMaterial, MMDUnityConfig config) {
28 | var mainTexture = _textureLoader.LoadTexture(mmdMaterial.Texture);
29 | var isTransparent = mmdMaterial.DiffuseColor.a < 0.9999f || mmdMaterial.EdgeColor.a < 0.9999f ||
30 | IsTextireTransparent(mainTexture);
31 | var material = new UnityEngine.Material (GetShader (mmdMaterial, config, isTransparent));
32 | ConfigMaterial(mmdMaterial, config, material, mainTexture);
33 | return material;
34 | }
35 | public void RefreshMaterialConfig(MMDMaterial mmdMaterial,MMDUnityConfig config, UnityEngine.Material material)
36 | {
37 | var mainTexture = _textureLoader.LoadTexture(mmdMaterial.Texture);
38 | var isTransparent = mmdMaterial.DiffuseColor.a < 0.9999f || mmdMaterial.EdgeColor.a < 0.9999f ||
39 | IsTextireTransparent(mainTexture);
40 | var shaderName = BuildShaderName(mmdMaterial, config, isTransparent);
41 | if (!material.shader.name.Equals(shaderName))
42 | {
43 | material.shader = Shader.Find(shaderName);
44 | }
45 | ConfigMaterial(mmdMaterial, config, material,mainTexture);
46 | }
47 |
48 | private void ConfigMaterial(MMDMaterial mmdMaterial, MMDUnityConfig config, UnityEngine.Material material, Texture mainTexture)
49 | {
50 | material.SetColor("_Color", mmdMaterial.DiffuseColor);
51 | material.SetFloat("_Opacity", mmdMaterial.DiffuseColor.a);
52 | material.SetColor("_AmbColor", mmdMaterial.AmbientColor);
53 | material.SetColor("_SpecularColor", mmdMaterial.SpecularColor);
54 | material.SetFloat("_Shininess", mmdMaterial.Shiness);
55 | material.SetFloat("_OutlineWidth", mmdMaterial.EdgeSize);
56 | material.SetColor("_OutlineColor", mmdMaterial.EdgeColor);
57 | if (mainTexture != null)
58 | {
59 | material.mainTexture = mainTexture;
60 | material.mainTextureScale = new Vector2(1, 1);
61 | }
62 |
63 |
64 | if (mmdMaterial.SubTextureType != MMDMaterial.SubTextureTypeEnum.MatSubTexOff)
65 | {
66 | var additionalTexture =
67 | mmdMaterial.SubTexture == null ? null : _textureLoader.LoadTexture(mmdMaterial.SubTexture);
68 | if (additionalTexture != null)
69 | {
70 | additionalTexture.wrapMode = TextureWrapMode.Clamp;
71 | switch (mmdMaterial.SubTextureType)
72 | {
73 | case MMDMaterial.SubTextureTypeEnum.MatSubTexSpa:
74 | material.SetTexture("_SphereAddTex", additionalTexture);
75 | material.SetTextureScale("_SphereAddTex", new Vector2(1, 1));
76 | break;
77 | case MMDMaterial.SubTextureTypeEnum.MatSubTexSph:
78 | material.SetTexture("_SphereMulTex", additionalTexture);
79 | material.SetTextureScale("_SphereMulTex", new Vector2(1, 1));
80 | break;
81 | }
82 | }
83 | }
84 |
85 | RefreshShaderKeywords(mmdMaterial, config, material);
86 |
87 | var toonTexture = _textureLoader.LoadTexture(mmdMaterial.Toon);
88 | if (toonTexture != null)
89 | {
90 | toonTexture.wrapMode = TextureWrapMode.Clamp;
91 | material.SetTexture("_ToonTex", toonTexture);
92 | material.SetTextureScale("_ToonTex", new Vector2(1, 1));
93 | }
94 | }
95 |
96 | private void RefreshShaderKeywords(MMDMaterial mmdMaterial, MMDUnityConfig config, UnityEngine.Material material)
97 | {
98 | RefreshDrawSelfShadowKeyword(MMDUnityConfig.DealSwitch(config.EnableDrawSelfShadow, mmdMaterial.DrawSelfShadow),
99 | material);
100 | }
101 |
102 | private void RefreshDrawSelfShadowKeyword(bool drawSelfshadow, UnityEngine.Material material)
103 | {
104 | if (drawSelfshadow)
105 | {
106 | material.EnableKeyword("SELFSHADOW_ON");
107 | material.DisableKeyword("SELFSHADOW_OFF");
108 | }
109 | else
110 | {
111 | material.DisableKeyword("SELFSHADOW_ON");
112 | material.EnableKeyword("SELFSHADOW_OFF");
113 | }
114 | }
115 |
116 | public void Dispose ()
117 | {
118 | if (_textureLoader != null) {
119 | _textureLoader.Dispose ();
120 | }
121 | }
122 |
123 | private static Shader GetShader(MMDMaterial mmdMaterial, MMDUnityConfig config, bool isTransparent)
124 | {
125 | //"MMD/Transparent/PMDMaterial-with-Outline-CullBack-NoCastShadow"
126 | var shaderName = BuildShaderName(mmdMaterial, config, isTransparent);
127 | var ret = Shader.Find (shaderName);
128 | if (ret == null) {
129 | Debug.LogWarning("Can't find shader "+ shaderName);
130 | }
131 | return ret;
132 | }
133 |
134 | private static string BuildShaderName(MMDMaterial mmdMaterial, MMDUnityConfig config, bool isTransparent)
135 | {
136 | var shaderNameBuilder = new StringBuilder();
137 | shaderNameBuilder.Append("VRM/");
138 | if (isTransparent)
139 | {
140 | shaderNameBuilder.Append("UnlitTransparentZWrite");
141 | }
142 | else
143 | {
144 | shaderNameBuilder.Append("UnlitTexture");
145 | }
146 |
147 | var shaderName = shaderNameBuilder.ToString();
148 | return shaderName;
149 | }
150 |
151 | private static bool IsTextireTransparent(Texture texture) {
152 | try {
153 | var tex2D = texture as Texture2D;
154 | if (tex2D == null) {
155 | return false;
156 | }
157 | var pixels = tex2D.GetPixels ();
158 | foreach (var color in pixels) {
159 | if (color.a < 0.99f) {
160 | return true;
161 | }
162 | }
163 | } catch {
164 |
165 | }
166 | return false;
167 | }
168 | }
169 |
170 | }
171 |
172 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Unity3D/MaterialLoader.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: c96bc2c33987dc744a12399c9e4af3ce
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Unity3D/MaterialMorphRemover.cs:
--------------------------------------------------------------------------------
1 | using System.Collections;
2 | using System.Collections.Generic;
3 | using UnityEngine;
4 |
5 | namespace LibMMD.Unity3D
6 | {
7 | public class MaterialMorphRemover
8 | {
9 | public static void HideMaterialMorphs(MMDModel mmdModel)
10 | {
11 | foreach (UnityEngine.Material material in mmdModel.SkinnedMeshRenderer.sharedMaterials)
12 | {
13 | if (mmdModel.MaterialMorphNames.Contains(material.name))
14 | {
15 | material.shader = Shader.Find("Custom/VoidShader");
16 | }
17 | }
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Unity3D/MaterialMorphRemover.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 1a4d8655d04c12a45be046f9d8cd31de
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Unity3D/ModelPart.cs:
--------------------------------------------------------------------------------
1 | // ------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Mono Runtime Version: 4.0.30319.1
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | // ------------------------------------------------------------------------------
10 |
11 | using UnityEngine;
12 |
13 | namespace LibMMD.Unity3D
14 | {
15 | public class ModelPart
16 | {
17 | public enum SubTextureTypeEnum {
18 | MatSubTexOff,
19 | MatSubTexSph,
20 | MatSubTexSpa,
21 | MatSubTexSub
22 | };
23 | public string ToonPath { get; set;}
24 | public string TexturePath { get; set;}
25 | public string SubTexturePath { get; set;}
26 | public int TriangleNum { get; set;}
27 | public int BaseShift { get; set;}
28 | public Color DiffuseColor { get; set;}
29 | public Color SpecularColor { get; set;}
30 | public Color AmbientColor { get; set;}
31 | public float Shininess { get; set;}
32 | public bool DrawDoubleFace { get; set;}
33 | public bool DrawGroundShadow { get; set;}
34 | public bool CastSelfShadow { get; set;}
35 | public bool DastSelfShadow { get; set;}
36 | public bool DrawSelfShadow { get; set;}
37 | public bool DrawEdge { get; set;}
38 | public Color EdgeColor { get; set;}
39 | public float EdgeSize { get; set;}
40 | public SubTextureTypeEnum SubTextureType { get; set;}
41 | }
42 | }
43 |
44 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Unity3D/ModelPart.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 29488fac476a8cf44ae86fb0c0ccb5e9
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Unity3D/PMXModelLoader.cs:
--------------------------------------------------------------------------------
1 | using LibMMD.Unity3D;
2 | using System;
3 | using System.Collections;
4 | using System.Collections.Generic;
5 | using System.Diagnostics;
6 | using System.IO;
7 | using System.Threading.Tasks;
8 | using UnityEngine;
9 |
10 | public class PMXModelLoader
11 | {
12 | public async static Task LoadPMXModel(string path, RuntimeAnimatorController runtimeAnimatorController, Transform parent, bool autoShowModel = true)
13 | {
14 | if (!File.Exists(path))
15 | {
16 | UnityEngine.Debug.Log(path);
17 | UnityEngine.Debug.Log("与えられたパスにファイルが存在ません");
18 | return null;
19 | }
20 |
21 | MMDModel mmdModel = null;
22 | try
23 | {
24 | mmdModel = await MMDModel.ImportModel(path, autoShowModel);
25 | }
26 | catch (Exception ex)
27 | {
28 | UnityEngine.Debug.Log(ex.Message);
29 | return null;
30 | }
31 |
32 | if (mmdModel == null) { return null; }
33 |
34 | try
35 | {
36 | AvatarMaker avaterMaker = mmdModel.gameObject.AddComponent();
37 | avaterMaker.Prepare(mmdModel, runtimeAnimatorController);
38 | await avaterMaker.MakeAvatar();
39 |
40 | #if UNITY_EDITOR
41 | GameObject.DestroyImmediate(avaterMaker);
42 | #else
43 | GameObject.Destroy(avaterMaker);
44 | #endif
45 |
46 | }
47 | catch (Exception ex)
48 | {
49 | UnityEngine.Debug.Log("アバターの作成に失敗しました");
50 | UnityEngine.Debug.Log(path);
51 |
52 | AvatarMaker avaterMaker = mmdModel.gameObject.GetComponent();
53 |
54 | #if UNITY_EDITOR
55 | if (avaterMaker != null)
56 | {
57 | GameObject.DestroyImmediate(avaterMaker);
58 | }
59 | #else
60 | if (avaterMaker != null)
61 | {
62 | GameObject.Destroy(avaterMaker);
63 | }
64 | #endif
65 |
66 | mmdModel.transform.parent = parent;
67 | mmdModel.transform.localPosition = Vector3.zero;
68 | mmdModel.transform.localRotation = Quaternion.identity;
69 |
70 | return mmdModel.transform;
71 | }
72 |
73 | mmdModel.transform.parent = parent;
74 | mmdModel.transform.localPosition = Vector3.zero;
75 | mmdModel.transform.localRotation = Quaternion.identity;
76 |
77 | return mmdModel.transform;
78 | }
79 |
80 | public async static Task LoadPMXModel(string path, RuntimeAnimatorController runtimeAnimatorController, bool autoShowModel = true)
81 | {
82 | return await LoadPMXModel(path, runtimeAnimatorController, null, autoShowModel);
83 | }
84 |
85 | public async static Task LoadPMXModel(string path, RuntimeAnimatorController runtimeAnimatorController)
86 | {
87 | return await LoadPMXModel(path, runtimeAnimatorController, null);
88 | }
89 |
90 | public async static Task LoadPMXModel(string path, bool autoShowModel = true)
91 | {
92 | return await LoadPMXModel(path, null, null, autoShowModel);
93 | }
94 | }
95 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Unity3D/PMXModelLoader.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 39b14547e60be694ea7d26990aa49e91
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Unity3D/TextureLoader.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using LibMMD.Material;
5 | using LibMMD.Unity3D.ImageLoader;
6 | using UnityEngine;
7 | using Object = UnityEngine.Object;
8 |
9 | namespace LibMMD.Unity3D
10 | {
11 | public class TextureLoader : IDisposable
12 | {
13 | private const string SysToonPath = "LibMmd/SysToon/";
14 |
15 | private readonly string _relativePath;
16 |
17 | private readonly int _maxTextureSize;
18 |
19 | private static readonly HashSet SysToonNames = new HashSet();
20 |
21 | private readonly Dictionary _textureMap = new Dictionary();
22 |
23 | static TextureLoader()
24 | {
25 | SysToonNames.Add("toon0.bmp");
26 | for (var i = 1; i < 9; i++)
27 | {
28 | SysToonNames.Add("toon0" + i + ".bmp");
29 | }
30 | SysToonNames.Add("toon10.bmp");
31 | }
32 |
33 | public TextureLoader(string relativePath, int maxTextureSize = 0)
34 | {
35 | _relativePath = relativePath + Path.DirectorySeparatorChar;
36 | _maxTextureSize = maxTextureSize;
37 | }
38 |
39 | public Texture LoadTexture(MMDTexture mmdTexture)
40 | {
41 | return mmdTexture == null ? null : LoadTexture(mmdTexture.TexturePath);
42 | }
43 |
44 | private Texture LoadTexture(string path)
45 | {
46 | if (string.IsNullOrEmpty(path))
47 | {
48 | return null;
49 | }
50 | path = ReplaceFileSeperator(path);
51 | Texture ret;
52 | if (_textureMap.TryGetValue(path, out ret))
53 | {
54 | return ret;
55 | }
56 | ret = DoLoadTexture(path);
57 | if (ret != null)
58 | {
59 | _textureMap.Add(path, ret);
60 | }
61 | return ret;
62 | }
63 |
64 | public void Dispose()
65 | {
66 | foreach (var entry in _textureMap)
67 | {
68 | if (SysToonNames.Contains(entry.Key))
69 | {
70 | continue;
71 | }
72 | var tex2D = entry.Value as Texture2D;
73 | if (tex2D == null)
74 | {
75 | continue;
76 | }
77 | Object.Destroy(tex2D);
78 | }
79 | }
80 |
81 | private string ReplaceFileSeperator(string path)
82 | {
83 | if (Path.DirectorySeparatorChar.Equals('/'))
84 | {
85 | path = path.Replace('\\', '/');
86 | }
87 | else if (Path.DirectorySeparatorChar.Equals('\\'))
88 | {
89 | path = path.Replace('/', '\\');
90 | }
91 | return path;
92 | }
93 |
94 | private Texture DoLoadTexture(string path)
95 | {
96 | if (SysToonNames.Contains(path))
97 | {
98 | var filename = Path.GetFileNameWithoutExtension(path);
99 | return Resources.Load(SysToonPath + filename) as Texture;
100 | }
101 | if (!File.Exists(path))
102 | {
103 | path = _relativePath + path;
104 | }
105 | if (!File.Exists(path))
106 | {
107 | Debug.LogFormat("texture file not exists {0}", path);
108 | return null;
109 | }
110 | try
111 | {
112 | var extension = Path.GetExtension(path);
113 | if (extension != null)
114 | {
115 | var ext = extension.ToLower();
116 | Texture ret;
117 | if (".jpg".Equals(ext) || ".jpeg".Equals(ext))
118 | {
119 | ret = LoadJpg(path);
120 | }
121 | else if (".png".Equals(ext))
122 | {
123 | ret = LoadPng(path);
124 | }
125 | else if (".bmp".Equals(ext))
126 | {
127 | ret = LoadBmp(path);
128 | }
129 | else if (".tga".Equals(ext))
130 | {
131 | ret = LoadTga(path);
132 | }
133 | else if (".dds".Equals(ext))
134 | {
135 | ret = LoadDds(path);
136 | }
137 | else
138 | {
139 | ret = TryLoadWithAllFormats(path);
140 | }
141 | var tex2D = ret as Texture2D;
142 | if (tex2D != null)
143 | {
144 | RescaleLargeTexture(tex2D);
145 | //tex2D.Compress(false);
146 | ret.name = Path.GetFileName(path);
147 | }
148 | return ret;
149 | }
150 | }
151 | catch (Exception e)
152 | {
153 | Debug.LogWarningFormat("failed to load texture {0}, {1}", path, e);
154 | }
155 | return null;
156 | }
157 |
158 | private void RescaleLargeTexture(Texture2D tex)
159 | {
160 | if (_maxTextureSize <= 0)
161 | {
162 | return;
163 | }
164 | if (tex.width <= _maxTextureSize && tex.height <= _maxTextureSize)
165 | {
166 | return;
167 | }
168 | try
169 | {
170 | TextureScale.Bilinear(tex, Math.Min(tex.width, _maxTextureSize), Math.Min(tex.height, _maxTextureSize));
171 | }
172 | catch (Exception e)
173 | {
174 | Debug.LogWarningFormat("Resize texture failed. {0}", e);
175 | }
176 | }
177 |
178 | private Texture DoLoadCubemap(string path)
179 | {
180 | var tex2D = DoLoadTexture(path) as Texture2D;
181 | return tex2D == null ? null : Texture2DToCubeMap(tex2D);
182 | }
183 |
184 | private static Cubemap Texture2DToCubeMap(Texture2D texture2D)
185 | {
186 | if (texture2D.width != texture2D.height)
187 | {
188 | Debug.LogWarning("Can't convert a Texture2D to Cubemap when width and height are different");
189 | return null;
190 | }
191 | var ret = new Cubemap(texture2D.width, texture2D.format, false);
192 | var texPixels = texture2D.GetPixels();
193 | ret.SetPixels(texPixels, CubemapFace.NegativeX);
194 | ret.SetPixels(texPixels, CubemapFace.NegativeY);
195 | ret.SetPixels(texPixels, CubemapFace.NegativeZ);
196 | ret.SetPixels(texPixels, CubemapFace.PositiveX);
197 | ret.SetPixels(texPixels, CubemapFace.PositiveY);
198 | ret.SetPixels(texPixels, CubemapFace.PositiveZ);
199 | ret.Apply();
200 | return ret;
201 | }
202 |
203 | private static Texture TryLoadWithAllFormats(string path)
204 | {
205 | var ret = LoadBmp(path);
206 | if (ret != null)
207 | {
208 | return ret;
209 | }
210 | ret = LoadPng(path);
211 | if (ret != null)
212 | {
213 | return ret;
214 | }
215 | ret = LoadJpg(path);
216 | return ret;
217 | }
218 |
219 | private static Texture LoadJpg(string path)
220 | {
221 | return LoadWithUnity(path);
222 | }
223 |
224 | private static Texture LoadPng(string path)
225 | {
226 | return LoadWithUnity(path);
227 | }
228 |
229 | private static Texture LoadBmp(string path)
230 | {
231 | var img = BitmapLoader.LoadFromFile(path);
232 | if (img == null)
233 | {
234 | return null;
235 | }
236 | var ret = new Texture2D(img.Width, img.Height, TextureFormat.ARGB32, false);
237 | ret.SetPixels(img.Pixels);
238 | ret.Apply();
239 | return ret;
240 | }
241 |
242 | private static Texture LoadTga(string path)
243 | {
244 | return TargaImage.LoadTargaImage(path);
245 | }
246 |
247 | private static Texture LoadDds(string path)
248 | {
249 | var bytes = File.ReadAllBytes(path);
250 | var width = DdsLoader.DdsGetWidth(bytes);
251 | var height = DdsLoader.DdsGetHeight(bytes);
252 | var nMipmap = DdsLoader.DdsGetMipmap(bytes);
253 | var hasMipmap = nMipmap > 1;
254 | var ret = new Texture2D(width, height, TextureFormat.ARGB32, hasMipmap);
255 | if (hasMipmap)
256 | {
257 | for (var i = 0; i < nMipmap; i++)
258 | {
259 | var intColors = DdsLoader.DdsRead(bytes, DdsLoader.DdsReaderArgb, i);
260 | ret.SetPixels(IntsArgbToColorUpsideDown(intColors, width / (1 << i), height / (1 << i)), i);
261 | }
262 | }
263 | else
264 | {
265 | var intColors = DdsLoader.DdsRead(bytes, DdsLoader.DdsReaderArgb, 0);
266 | ret.SetPixels(IntsArgbToColorUpsideDown(intColors, width, height));
267 | }
268 | ret.Apply();
269 | return ret;
270 | }
271 |
272 | public static Color[] IntsArgbToColorUpsideDown(int[] ints, int width, int height)
273 | {
274 | var ret = new Color[ints.Length];
275 | for (var i = 0; i < height; i++)
276 | {
277 | for (var j = 0; j < width; j++)
278 | {
279 | var intColor = ints[i * width + j];
280 | var dstIndex = (height - 1 - i) * width + j;
281 | ret[dstIndex].b = (intColor & 0xFF) / 255.0f;
282 | ret[dstIndex].g = ((intColor >> 8) & 0xFF) / 255.0f;
283 | ret[dstIndex].r = ((intColor >> 16) & 0xFF) / 255.0f;
284 | ret[dstIndex].a = ((intColor >> 24) & 0xFF) / 255.0f;
285 | }
286 | }
287 | return ret;
288 | }
289 |
290 | private static Texture LoadWithUnity(string path)
291 | {
292 | if (!File.Exists(path)) return null;
293 | var fileData = File.ReadAllBytes(path);
294 | var tex = new Texture2D(2, 2);
295 | tex.LoadImage(fileData);
296 | return tex;
297 | }
298 | }
299 | }
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Unity3D/TextureLoader.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 1f3af3954c1f52a4f9be720b11a77a5c
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Unity3D/TextureScale.cs:
--------------------------------------------------------------------------------
1 | // Only works on ARGB32, RGB24 and Alpha8 textures that are marked readable
2 |
3 | using System.Threading;
4 | using UnityEngine;
5 | using Object = System.Object;
6 |
7 | namespace LibMMD.Unity3D
8 | {
9 | public class TextureScale
10 | {
11 | public class ThreadData
12 | {
13 | public int Start;
14 | public int End;
15 | public ThreadData (int s, int e) {
16 | Start = s;
17 | End = e;
18 | }
19 | }
20 |
21 | private static Color[] _texColors;
22 | private static Color[] _newColors;
23 | private static int _w;
24 | private static float _ratioX;
25 | private static float _ratioY;
26 | private static int _w2;
27 | private static int _finishCount;
28 | private static Mutex _mutex;
29 |
30 | public static void Point (Texture2D tex, int newWidth, int newHeight)
31 | {
32 | ThreadedScale (tex, newWidth, newHeight, false);
33 | }
34 |
35 | public static void Bilinear (Texture2D tex, int newWidth, int newHeight)
36 | {
37 | ThreadedScale (tex, newWidth, newHeight, true);
38 | }
39 |
40 | private static void ThreadedScale (Texture2D tex, int newWidth, int newHeight, bool useBilinear)
41 | {
42 | _texColors = tex.GetPixels();
43 | _newColors = new Color[newWidth * newHeight];
44 | if (useBilinear)
45 | {
46 | _ratioX = 1.0f / ((float)newWidth / (tex.width-1));
47 | _ratioY = 1.0f / ((float)newHeight / (tex.height-1));
48 | }
49 | else {
50 | _ratioX = ((float)tex.width) / newWidth;
51 | _ratioY = ((float)tex.height) / newHeight;
52 | }
53 | _w = tex.width;
54 | _w2 = newWidth;
55 | var cores = Mathf.Min(SystemInfo.processorCount, newHeight);
56 | var slice = newHeight/cores;
57 |
58 | _finishCount = 0;
59 | if (_mutex == null) {
60 | _mutex = new Mutex(false);
61 | }
62 | if (cores > 1)
63 | {
64 | int i;
65 | ThreadData threadData;
66 | for (i = 0; i < cores-1; i++) {
67 | threadData = new ThreadData(slice * i, slice * (i + 1));
68 | var ts = useBilinear ? new ParameterizedThreadStart(BilinearScale) : new ParameterizedThreadStart(PointScale);
69 | var thread = new Thread(ts);
70 | thread.Start(threadData);
71 | }
72 | threadData = new ThreadData(slice*i, newHeight);
73 | if (useBilinear)
74 | {
75 | BilinearScale(threadData);
76 | }
77 | else
78 | {
79 | PointScale(threadData);
80 | }
81 | while (_finishCount < cores)
82 | {
83 | Thread.Sleep(1);
84 | }
85 | }
86 | else
87 | {
88 | ThreadData threadData = new ThreadData(0, newHeight);
89 | if (useBilinear)
90 | {
91 | BilinearScale(threadData);
92 | }
93 | else
94 | {
95 | PointScale(threadData);
96 | }
97 | }
98 |
99 | tex.Resize(newWidth, newHeight);
100 | tex.SetPixels(_newColors);
101 | tex.Apply();
102 | }
103 |
104 | public static void BilinearScale (Object obj)
105 | {
106 | var threadData = (ThreadData) obj;
107 | for (var y = threadData.Start; y < threadData.End; y++)
108 | {
109 | var yFloor = (int)Mathf.Floor(y * _ratioY);
110 | var y1 = yFloor * _w;
111 | var y2 = (yFloor+1) * _w;
112 | var yw = y * _w2;
113 |
114 | for (var x = 0; x < _w2; x++) {
115 | var xFloor = (int)Mathf.Floor(x * _ratioX);
116 | var xLerp = x * _ratioX-xFloor;
117 | _newColors[yw + x] = ColorLerpUnclamped(ColorLerpUnclamped(_texColors[y1 + xFloor], _texColors[y1 + xFloor+1], xLerp),
118 | ColorLerpUnclamped(_texColors[y2 + xFloor], _texColors[y2 + xFloor+1], xLerp),
119 | y*_ratioY-yFloor);
120 | }
121 | }
122 |
123 | _mutex.WaitOne();
124 | _finishCount++;
125 | _mutex.ReleaseMutex();
126 | }
127 |
128 | public static void PointScale (object obj)
129 | {
130 | var threadData = (ThreadData) obj;
131 | for (var y = threadData.Start; y < threadData.End; y++)
132 | {
133 | var thisY = (int)(_ratioY * y) * _w;
134 | var yw = y * _w2;
135 | for (var x = 0; x < _w2; x++) {
136 | _newColors[yw + x] = _texColors[(int)(thisY + _ratioX*x)];
137 | }
138 | }
139 |
140 | _mutex.WaitOne();
141 | _finishCount++;
142 | _mutex.ReleaseMutex();
143 | }
144 |
145 | private static Color ColorLerpUnclamped (Color c1, Color c2, float value)
146 | {
147 | return new Color (c1.r + (c2.r - c1.r)*value,
148 | c1.g + (c2.g - c1.g)*value,
149 | c1.b + (c2.b - c1.b)*value,
150 | c1.a + (c2.a - c1.a)*value);
151 | }
152 | }
153 | }
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Unity3D/TextureScale.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: c343dd8f2f3826b46aae4a5a03d11559
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Unity3D/Utils.cs:
--------------------------------------------------------------------------------
1 | // ------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Mono Runtime Version: 4.0.30319.1
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | // ------------------------------------------------------------------------------
10 |
11 | using System;
12 | using System.Collections.Generic;
13 | using UnityEngine;
14 | using Object = UnityEngine.Object;
15 |
16 | namespace LibMMD.Unity3D
17 | {
18 | public class Utils
19 | {
20 | public static void UpdateFloatsToVector3(float[] f, Vector3[] dst) {
21 | var size = f.Length / 3;
22 | for (var i=0; i ArrayToList(T[] src, int srcIndex, int length) {
54 | var ret = new List (length);
55 | var endPos = srcIndex + length;
56 | for (var i=srcIndex; i
10 | {
11 | private int _count;
12 |
13 | private readonly Queue _queue = new Queue();
14 |
15 | private readonly int _maxSize;
16 |
17 | public BlockingQueue(int maxSize = int.MaxValue)
18 | {
19 | _maxSize = maxSize;
20 | }
21 |
22 | public int MaxSize
23 | {
24 | get { return _maxSize; }
25 | }
26 |
27 | public int Count
28 | {
29 | get
30 | {
31 | lock (_queue)
32 | {
33 | return _count;
34 | }
35 | }
36 | }
37 |
38 | public T DequeueNonBlocking()
39 | {
40 | lock (_queue)
41 | {
42 | if (_count <= 0)
43 | {
44 | return default(T);
45 | }
46 |
47 | _count--;
48 |
49 | var ret = _queue.Dequeue();
50 | Monitor.PulseAll(_queue);
51 | return ret;
52 | }
53 | }
54 |
55 | public T Dequeue()
56 | {
57 | lock (_queue)
58 | {
59 | // If we have items remaining in the queue, skip over this.
60 | while (_count <= 0)
61 | {
62 | Monitor.Wait(_queue);
63 | }
64 |
65 | _count--;
66 |
67 | var ret = _queue.Dequeue();
68 | Monitor.PulseAll(_queue);
69 | return ret;
70 | }
71 | }
72 |
73 | public int Enqueue(T data)
74 | {
75 | if (data == null)
76 | {
77 | throw new ArgumentNullException("data is null");
78 | }
79 |
80 | lock (_queue)
81 | {
82 | while (_count >= _maxSize)
83 | {
84 | Monitor.Wait(_queue);
85 | }
86 |
87 | _queue.Enqueue(data);
88 |
89 | _count++;
90 |
91 | Monitor.PulseAll(_queue);
92 | return _count;
93 | }
94 | }
95 | }
96 | }
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Util/BlockingQueue.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: ee362629fc8ffc94b9188285001e0ce2
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Util/LogUtil.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace LibMMD.Util
4 | {
5 | public static class LogUtil
6 | {
7 | public static void Debug(string format, params object[] args)
8 | {
9 |
10 | }
11 |
12 | public static void Info(string format, params object[] args)
13 | {
14 |
15 | }
16 |
17 | public static void Warn(string format, params object[] args)
18 | {
19 |
20 | }
21 |
22 | public static void Error(string format, params object[] args)
23 | {
24 |
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Util/LogUtil.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: babd7022c37a7544989f502bd0f3e8d7
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Util/MMDReaderUtil.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using System.Text;
4 | using LibMMD.Reader;
5 | using UnityEngine;
6 |
7 | namespace LibMMD.Util
8 | {
9 | public static class MMDReaderUtil
10 | {
11 | const float WorldSizeAmplifier = 0.08f;
12 |
13 | public static string ReadStringFixedLength(BinaryReader reader, int length, Encoding encoding)
14 | {
15 | if (length < 0)
16 | {
17 | throw new MMDFileParseException("pmx string length is negative");
18 | }
19 | if (length == 0)
20 | {
21 | return "";
22 | }
23 | var bytes = reader.ReadBytes(length);
24 | var str = encoding.GetString(bytes);
25 | var end = str.IndexOf("\0", StringComparison.Ordinal);
26 | if (end >= 0)
27 | {
28 | str = str.Substring(0, end);
29 | }
30 | return str;
31 | }
32 |
33 | public static string ReadSizedString(BinaryReader reader, Encoding encoding)
34 | {
35 | var length = reader.ReadInt32();
36 | return ReadStringFixedLength(reader, length, encoding);
37 | }
38 |
39 | public static Vector4 ReadVector4(BinaryReader reader)
40 | {
41 | var ret = new Vector4();
42 | ret[0] = MathUtil.NanToZero(reader.ReadSingle());
43 | ret[1] = MathUtil.NanToZero(reader.ReadSingle());
44 | ret[2] = MathUtil.NanToZero(reader.ReadSingle());
45 | ret[3] = MathUtil.NanToZero(reader.ReadSingle());
46 | return ret;
47 | }
48 |
49 | public static Quaternion ReadQuaternion(BinaryReader reader)
50 | {
51 | var ret = new Quaternion();
52 | ret.x = -MathUtil.NanToZero(reader.ReadSingle());
53 | ret.y = MathUtil.NanToZero(reader.ReadSingle());
54 | ret.z = -MathUtil.NanToZero(reader.ReadSingle());
55 | ret.w = MathUtil.NanToZero(reader.ReadSingle());
56 | return ret;
57 | }
58 |
59 | public static Vector3 ReadVector3(BinaryReader reader)
60 | {
61 | return ReadAmpVector3(reader, WorldSizeAmplifier);
62 | }
63 |
64 | public static Vector3 ReadAmpVector3(BinaryReader reader, float amp)
65 | {
66 | var ret = new Vector3();
67 | ret[0] = -MathUtil.NanToZero(reader.ReadSingle()) * amp;
68 | ret[1] = MathUtil.NanToZero(reader.ReadSingle()) * amp;
69 | ret[2] = -MathUtil.NanToZero(reader.ReadSingle()) * amp;
70 | return ret;
71 | }
72 |
73 | public static Vector3 ReadRawCoordinateVector3(BinaryReader reader)
74 | {
75 | var ret = new Vector3();
76 | ret[0] = MathUtil.NanToZero(reader.ReadSingle()) * WorldSizeAmplifier;
77 | ret[1] = MathUtil.NanToZero(reader.ReadSingle()) * WorldSizeAmplifier;
78 | ret[2] = MathUtil.NanToZero(reader.ReadSingle()) * WorldSizeAmplifier;
79 | return ret;
80 | }
81 |
82 |
83 | public static Vector2 ReadVector2(BinaryReader reader)
84 | {
85 | var ret = new Vector2();
86 | ret[0] = MathUtil.NanToZero(reader.ReadSingle());
87 | ret[1] = MathUtil.NanToZero(reader.ReadSingle());
88 | return ret;
89 | }
90 |
91 | public static int ReadIndex(BinaryReader reader, int size)
92 | {
93 | switch (size)
94 | {
95 | case 1:
96 | return reader.ReadSByte();
97 | case 2:
98 | return reader.ReadUInt16();
99 | case 4:
100 | return reader.ReadInt32();
101 | default:
102 | throw new MMDFileParseException("invalid index size: " + size);
103 | }
104 | }
105 |
106 | public static Color ReadColor(BinaryReader reader, bool readA)
107 | {
108 | var ret = new Color
109 | {
110 | r = reader.ReadSingle(),
111 | g = reader.ReadSingle(),
112 | b = reader.ReadSingle(),
113 | a = readA ? reader.ReadSingle() : 1.0f
114 | };
115 | return ret;
116 | }
117 |
118 | public static bool Eof(BinaryReader binaryReader)
119 | {
120 | var bs = binaryReader.BaseStream;
121 | return (bs.Position == bs.Length);
122 | }
123 |
124 | }
125 | }
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Util/MMDReaderUtil.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 09e79f8045c6b81438f0b24590059aea
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Util/MMDTextureUtil.cs:
--------------------------------------------------------------------------------
1 | using LibMMD.Material;
2 |
3 | namespace LibMMD.Util
4 | {
5 | public static class MMDTextureUtil
6 | {
7 | private static readonly string[] GlobalToonNames =
8 | {
9 | "toon0.bmp",
10 | "toon01.bmp",
11 | "toon02.bmp",
12 | "toon03.bmp",
13 | "toon04.bmp",
14 | "toon05.bmp",
15 | "toon06.bmp",
16 | "toon07.bmp",
17 | "toon08.bmp",
18 | "toon09.bmp",
19 | "toon10.bmp"
20 | };
21 |
22 | public static MMDTexture GetGlobalToon(int index, string rootPath)
23 | {
24 | if (index >= 0 && index < GlobalToonNames.Length - 1)
25 | {
26 | return new MMDTexture(GlobalToonNames[index + 1]);
27 | }
28 | return null;
29 | }
30 | }
31 | }
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Util/MMDTextureUtil.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 62a8a9476e1c6cb4591487bbb1cbcb7c
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Util/MathUtil.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 6530efcfb90ab7a4a979a57a9b4bfe7e
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Util/MatrixExtensions.cs:
--------------------------------------------------------------------------------
1 | namespace LibMMD.Util
2 | {
3 | using UnityEngine;
4 |
5 | public static class MatrixExtensions
6 | {
7 | public static Quaternion ExtractRotation(this Matrix4x4 matrix)
8 | {
9 | Vector3 forward;
10 | forward.x = matrix.m02;
11 | forward.y = matrix.m12;
12 | forward.z = matrix.m22;
13 |
14 | Vector3 upwards;
15 | upwards.x = matrix.m01;
16 | upwards.y = matrix.m11;
17 | upwards.z = matrix.m21;
18 |
19 | return Quaternion.LookRotation(forward, upwards);
20 | }
21 |
22 | public static Vector3 ExtractPosition(this Matrix4x4 matrix)
23 | {
24 | Vector3 position;
25 | position.x = matrix.m03;
26 | position.y = matrix.m13;
27 | position.z = matrix.m23;
28 | return position;
29 | }
30 |
31 | public static Vector3 ExtractScale(this Matrix4x4 matrix)
32 | {
33 | Vector3 scale;
34 | scale.x = new Vector4(matrix.m00, matrix.m10, matrix.m20, matrix.m30).magnitude;
35 | scale.y = new Vector4(matrix.m01, matrix.m11, matrix.m21, matrix.m31).magnitude;
36 | scale.z = new Vector4(matrix.m02, matrix.m12, matrix.m22, matrix.m32).magnitude;
37 | return scale;
38 | }
39 | }
40 | }
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Util/MatrixExtensions.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d6aa1afffc18d7442a0868b263a9649c
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Util/SynchronizedQueue.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace LibMMD.Util
4 | {
5 | public class SynchronizedQueue
6 | {
7 | private readonly Queue _queue = new Queue();
8 |
9 | public void Enqueue(T val)
10 | {
11 | lock (_queue)
12 | {
13 | _queue.Enqueue(val);
14 | }
15 | }
16 |
17 | public T Take()
18 | {
19 | lock (_queue)
20 | {
21 | return _queue.Count <= 0 ? default(T) : _queue.Dequeue();
22 | }
23 | }
24 |
25 | public int Count()
26 | {
27 | lock (_queue)
28 | {
29 | return _queue.Count;
30 | }
31 | }
32 | }
33 | }
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Util/SynchronizedQueue.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 173dfc038c2acc847922d19569b1fc38
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Util/Tools.cs:
--------------------------------------------------------------------------------
1 | using System.Text;
2 |
3 | namespace LibMMD.Util
4 | {
5 | public static class Tools
6 | {
7 | public static readonly Encoding JapaneseEncoding = Encoding.GetEncoding(932);
8 | public const float MmdMathConstEps = (float) 1.0e-7;
9 | }
10 | }
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Util/Tools.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: c38c1832b9c7a004f8cc6624b772ee32
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Util/TransformExtensions.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 |
3 | namespace LibMMD.Util
4 | {
5 | public static class TransformExtensions
6 | {
7 | public static void FromMatrix(this Transform transform, Matrix4x4 matrix)
8 | {
9 | transform.localScale = matrix.ExtractScale();
10 | transform.rotation = matrix.ExtractRotation();
11 | transform.position = matrix.ExtractPosition();
12 | }
13 | }
14 | }
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/Util/TransformExtensions.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 8f9aee4e9b09a134c8bc6e55f76f6df1
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/libmmd-for-unity LICENSE.txt:
--------------------------------------------------------------------------------
1 | BSD 3-Clause License
2 |
3 | Copyright (c) 2017, x3bits (x3bits@sina.com)
4 | All rights reserved.
5 |
6 | Redistribution and use in source and binary forms, with or without
7 | modification, are permitted provided that the following conditions are met:
8 |
9 | * Redistributions of source code must retain the above copyright notice, this
10 | list of conditions and the following disclaimer.
11 |
12 | * Redistributions in binary form must reproduce the above copyright notice,
13 | this list of conditions and the following disclaimer in the documentation
14 | and/or other materials provided with the distribution.
15 |
16 | * Neither the name of the copyright holder nor the names of its
17 | contributors may be used to endorse or promote products derived from
18 | this software without specific prior written permission.
19 |
20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/LibMMD/libmmd-for-unity LICENSE.txt.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 008cecd1ac3cfb54693659eed2a5d9cc
3 | TextScriptImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/README.md:
--------------------------------------------------------------------------------
1 | # UnityPMXImporter
2 |
3 | pmxファイル(mmdのモデルファイル)をUnityに直接(変換なしに、動的に、スクリプトから)読み込むためのコード
4 |
5 |
6 | 使用に特に制限は設けませんが、公序良俗の範囲でお願いします。
7 | また、このコードを使用して生じた問題について制作者は責任を負いません。
8 | 答えられるかはわかりませんが、不具合や要望があれば軽々しくご連絡ください。
9 |
10 |
11 | Hobosore@hobosore
12 | hobosore@gmail.com
13 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/README.md.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 3eaf017b535b8d240a646990b613a01b
3 | TextScriptImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/VRM.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: b66aa35b290568844987f3015a66339c
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/VRM/UniVRM LICENSE.txt:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 DWANGO Co., Ltd. for UniVRM
4 | Copyright (c) 2018 ousttrue for UniGLTF, UniHumanoid
5 | Copyright (c) 2018 Masataka SUMI for MToon
6 |
7 | Permission is hereby granted, free of charge, to any person obtaining a copy
8 | of this software and associated documentation files (the "Software"), to deal
9 | in the Software without restriction, including without limitation the rights
10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | copies of the Software, and to permit persons to whom the Software is
12 | furnished to do so, subject to the following conditions:
13 |
14 | The above copyright notice and this permission notice shall be included in all
15 | copies or substantial portions of the Software.
16 |
17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 | SOFTWARE.
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/VRM/UniVRM LICENSE.txt.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 782e3aab60332484d9f499182cc213c8
3 | TextScriptImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/VRM/UniVRM.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: b41579dc46366974386ef7e1172b3b6c
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/VRM/UniVRM/Resources.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: bd4a0ab53875864449abe274b3171acb
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/VRM/UniVRM/Resources/Shaders.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 43c3eeb93005cb3438391ddcdf5e651c
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/VRM/UniVRM/Resources/Shaders/VRMShaders.shadervariants:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!200 &20000000
4 | ShaderVariantCollection:
5 | m_ObjectHideFlags: 0
6 | m_PrefabParentObject: {fileID: 0}
7 | m_PrefabInternal: {fileID: 0}
8 | m_Name: VRMShaders
9 | m_Shaders:
10 | data:
11 | first: {fileID: 4800000, guid: 1a70c9898704e1a4691843883f5101af, type: 3}
12 | second:
13 | variants: []
14 | data:
15 | first: {fileID: 4800000, guid: 429a3203ab2959741aab76fa2856b450, type: 3}
16 | second:
17 | variants: []
18 | data:
19 | first: {fileID: 4800000, guid: 4c9ce97af40038f45811fc4b0975a483, type: 3}
20 | second:
21 | variants: []
22 | data:
23 | first: {fileID: 4800000, guid: 8c17b56f4bf084c47872edcb95237e4a, type: 3}
24 | second:
25 | variants: []
26 | data:
27 | first: {fileID: 4800000, guid: df359ad0838642d4fa0339514fcbbb2d, type: 3}
28 | second:
29 | variants: []
30 | data:
31 | first: {fileID: 4800000, guid: 1a97144e4ad27a04aafd70f7b915cedb, type: 3}
32 | second:
33 | variants: []
34 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/VRM/UniVRM/Resources/Shaders/VRMShaders.shadervariants.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 486ebb794ada0de41be4f35c56876f82
3 | timeCreated: 1520840003
4 | licenseType: Free
5 | NativeFormatImporter:
6 | mainObjectFileID: 20000000
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/VRM/UniVRM/Resources/Shaders/VRMUnlitCutout.shader:
--------------------------------------------------------------------------------
1 | Shader "VRM/UnlitCutout"
2 | {
3 | Properties {
4 | _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
5 | _Cutoff ("Alpha cutoff", Range(0,1)) = 0.5
6 | }
7 | SubShader {
8 | Tags {"Queue"="AlphaTest" "IgnoreProjector"="True" "RenderType"="TransparentCutout"}
9 | LOD 100
10 |
11 | Lighting Off
12 |
13 | Pass {
14 | CGPROGRAM
15 | #pragma vertex vert
16 | #pragma fragment frag
17 | #pragma target 2.0
18 | #pragma multi_compile_fog
19 |
20 | #include "UnityCG.cginc"
21 |
22 | struct appdata_t {
23 | float4 vertex : POSITION;
24 | float2 texcoord : TEXCOORD0;
25 | UNITY_VERTEX_INPUT_INSTANCE_ID
26 | };
27 |
28 | struct v2f {
29 | float4 vertex : SV_POSITION;
30 | float2 texcoord : TEXCOORD0;
31 | UNITY_FOG_COORDS(1)
32 | UNITY_VERTEX_OUTPUT_STEREO
33 | };
34 |
35 | sampler2D _MainTex;
36 | float4 _MainTex_ST;
37 | fixed _Cutoff;
38 |
39 | v2f vert (appdata_t v)
40 | {
41 | v2f o;
42 | UNITY_SETUP_INSTANCE_ID(v);
43 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
44 | o.vertex = UnityObjectToClipPos(v.vertex);
45 | o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex);
46 | UNITY_TRANSFER_FOG(o,o.vertex);
47 | return o;
48 | }
49 |
50 | fixed4 frag (v2f i) : SV_Target
51 | {
52 | fixed4 col = tex2D(_MainTex, i.texcoord);
53 | clip(col.a - _Cutoff);
54 | UNITY_APPLY_FOG(i.fogCoord, col);
55 | return col;
56 | }
57 | ENDCG
58 | }
59 | }
60 |
61 | }
62 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/VRM/UniVRM/Resources/Shaders/VRMUnlitCutout.shader.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 4c9ce97af40038f45811fc4b0975a483
3 | timeCreated: 1522661614
4 | licenseType: Free
5 | ShaderImporter:
6 | defaultTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/VRM/UniVRM/Resources/Shaders/VRMUnlitTexture.shader:
--------------------------------------------------------------------------------
1 | Shader "VRM/UnlitTexture"
2 | {
3 | Properties
4 | {
5 | _MainTex ("Texture", 2D) = "white" {}
6 | }
7 | SubShader
8 | {
9 | Tags { "RenderType"="Opaque" }
10 | LOD 100
11 |
12 | Pass
13 | {
14 | CGPROGRAM
15 | #pragma vertex vert
16 | #pragma fragment frag
17 | // make fog work
18 | #pragma multi_compile_fog
19 |
20 | #include "UnityCG.cginc"
21 |
22 | struct appdata
23 | {
24 | float4 vertex : POSITION;
25 | float2 uv : TEXCOORD0;
26 | };
27 |
28 | struct v2f
29 | {
30 | float2 uv : TEXCOORD0;
31 | UNITY_FOG_COORDS(1)
32 | float4 vertex : SV_POSITION;
33 | };
34 |
35 | sampler2D _MainTex;
36 | float4 _MainTex_ST;
37 |
38 | v2f vert (appdata v)
39 | {
40 | v2f o;
41 | o.vertex = UnityObjectToClipPos(v.vertex);
42 | o.uv = TRANSFORM_TEX(v.uv, _MainTex);
43 | UNITY_TRANSFER_FOG(o,o.vertex);
44 | return o;
45 | }
46 |
47 | fixed4 frag (v2f i) : SV_Target
48 | {
49 | // sample the texture
50 | fixed4 col = tex2D(_MainTex, i.uv);
51 | // apply fog
52 | UNITY_APPLY_FOG(i.fogCoord, col);
53 | return col;
54 | }
55 | ENDCG
56 | }
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/VRM/UniVRM/Resources/Shaders/VRMUnlitTexture.shader.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 1a70c9898704e1a4691843883f5101af
3 | timeCreated: 1522661614
4 | licenseType: Free
5 | ShaderImporter:
6 | defaultTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/VRM/UniVRM/Resources/Shaders/VRMUnlitTransparent.shader:
--------------------------------------------------------------------------------
1 | Shader "VRM/UnlitTransparent"
2 | {
3 | Properties {
4 | _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
5 | }
6 |
7 | SubShader {
8 | Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
9 | LOD 100
10 |
11 | ZWrite Off
12 | Blend SrcAlpha OneMinusSrcAlpha
13 | BlendOp Add, Max
14 |
15 | Pass {
16 | CGPROGRAM
17 | #pragma vertex vert
18 | #pragma fragment frag
19 | #pragma target 2.0
20 | #pragma multi_compile_fog
21 |
22 | #include "UnityCG.cginc"
23 |
24 | struct appdata_t {
25 | float4 vertex : POSITION;
26 | float2 texcoord : TEXCOORD0;
27 | UNITY_VERTEX_INPUT_INSTANCE_ID
28 | };
29 |
30 | struct v2f {
31 | float4 vertex : SV_POSITION;
32 | float2 texcoord : TEXCOORD0;
33 | UNITY_FOG_COORDS(1)
34 | UNITY_VERTEX_OUTPUT_STEREO
35 | };
36 |
37 | sampler2D _MainTex;
38 | float4 _MainTex_ST;
39 |
40 | v2f vert (appdata_t v)
41 | {
42 | v2f o;
43 | UNITY_SETUP_INSTANCE_ID(v);
44 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
45 | o.vertex = UnityObjectToClipPos(v.vertex);
46 | o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex);
47 | UNITY_TRANSFER_FOG(o,o.vertex);
48 | return o;
49 | }
50 |
51 | fixed4 frag (v2f i) : SV_Target
52 | {
53 | fixed4 col = tex2D(_MainTex, i.texcoord);
54 | UNITY_APPLY_FOG(i.fogCoord, col);
55 | return col;
56 | }
57 | ENDCG
58 | }
59 | }
60 |
61 | }
62 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/VRM/UniVRM/Resources/Shaders/VRMUnlitTransparent.shader.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: df359ad0838642d4fa0339514fcbbb2d
3 | timeCreated: 1522661614
4 | licenseType: Free
5 | ShaderImporter:
6 | defaultTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/VRM/UniVRM/Resources/Shaders/VRMUnlitTransparentZWrite.shader:
--------------------------------------------------------------------------------
1 | Shader "VRM/UnlitTransparentZWrite"
2 | {
3 | Properties {
4 | _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
5 | }
6 |
7 | SubShader {
8 | Tags {"Queue"="AlphaTest+150" "IgnoreProjector"="True" "RenderType"="Transparent"}
9 | LOD 100
10 |
11 | ZWrite On
12 | Blend SrcAlpha OneMinusSrcAlpha
13 | BlendOp Add, Max
14 |
15 | Pass {
16 | CGPROGRAM
17 | #pragma vertex vert
18 | #pragma fragment frag
19 | #pragma target 2.0
20 | #pragma multi_compile_fog
21 |
22 | #include "UnityCG.cginc"
23 |
24 | struct appdata_t {
25 | float4 vertex : POSITION;
26 | float2 texcoord : TEXCOORD0;
27 | UNITY_VERTEX_INPUT_INSTANCE_ID
28 | };
29 |
30 | struct v2f {
31 | float4 vertex : SV_POSITION;
32 | float2 texcoord : TEXCOORD0;
33 | UNITY_FOG_COORDS(1)
34 | UNITY_VERTEX_OUTPUT_STEREO
35 | };
36 |
37 | sampler2D _MainTex;
38 | float4 _MainTex_ST;
39 |
40 | v2f vert (appdata_t v)
41 | {
42 | v2f o;
43 | UNITY_SETUP_INSTANCE_ID(v);
44 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
45 | o.vertex = UnityObjectToClipPos(v.vertex);
46 | o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex);
47 | UNITY_TRANSFER_FOG(o,o.vertex);
48 | return o;
49 | }
50 |
51 | fixed4 frag (v2f i) : SV_Target
52 | {
53 | fixed4 col = tex2D(_MainTex, i.texcoord);
54 | UNITY_APPLY_FOG(i.fogCoord, col);
55 | return col;
56 | }
57 | ENDCG
58 | }
59 | }
60 |
61 | }
62 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/VRM/UniVRM/Resources/Shaders/VRMUnlitTransparentZWrite.shader.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 429a3203ab2959741aab76fa2856b450
3 | timeCreated: 1522661614
4 | licenseType: Free
5 | ShaderImporter:
6 | defaultTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/VoidShader.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: a98762fc92e6e2343be7299617b72380
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/VoidShader/CustomVoidShader.shader:
--------------------------------------------------------------------------------
1 | Shader "Custom/VoidShader"
2 | {
3 | SubShader
4 | {
5 | Colormask 0 Zwrite Off
6 | Pass{}
7 | }
8 | }
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoader/VoidShader/CustomVoidShader.shader.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: b863df65a439dcb44a22a21360e2053f
3 | ShaderImporter:
4 | externalObjects: {}
5 | defaultTextures: []
6 | nonModifiableTextures: []
7 | userData:
8 | assetBundleName:
9 | assetBundleVariant:
10 |
--------------------------------------------------------------------------------
/UnityPMXRuntimeLoaderSample.unitypackage:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hobosore/UnityPMXRuntimeLoader/3b97fe0a4db15311794ee30996bfacaf6a9b07be/UnityPMXRuntimeLoaderSample.unitypackage
--------------------------------------------------------------------------------