diff --git a/CHANGELOG.md b/CHANGELOG.md index 1947a40..23dda75 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Change Log +## [0.8.2] - 2020-07-04 +- Changed to use VRMShaders (com.vrmc.vrmshaders) of UnityPackageManager (UPM). + ## [0.8.1] - 2020-06-20 - Added Glb import and export from UniGLTF. diff --git a/Documentation~/UniVGO/Installation.ja.md b/Documentation~/UniVGO/Installation.ja.md index 1f83d18..2555fc1 100644 --- a/Documentation~/UniVGO/Installation.ja.md +++ b/Documentation~/UniVGO/Installation.ja.md @@ -22,7 +22,7 @@ ___ |パッケージ名|所有者|リポジトリー|仕様バージョン|プログラム バージョン|リリース日| |:---:|:---:|:---:|:---:|:---:|:---:| |newtonsoft-json-for-unity|jillejr|GitHub|12.0.3|12.0.301|2020年1月20日| -|UniVGO|IzayoiJiichan|GitHub|VGO 0.6|0.8.1|2020年6月20日| +|UniVGO|IzayoiJiichan|GitHub|VGO 0.6|0.8.2|2020年7月4日| ___ ## インストール @@ -85,7 +85,26 @@ Newtonsoft.JSON をパッケージとしてプロジェクトに取り込みま } ``` -#### 3. UniVGO のインストール +#### 3. VRMShaders のインストール + +VRMShaders をパッケージとしてプロジェクトに取り込みます。 +`/Packages/package.json` に以下の記述を行います。 +追加する位置に気を付ける必要があります。 + +```json +{ + "dependencies": { + "com.unity.ugui": "1.0.0", + "com.vrmc.vrmshaders": "https://github.com/vrm-c/UniVRM.git?path=/Assets/VRMShaders#v0.56.1", + "jillejr.newtonsoft.json-for-unity": "12.0.301", + "com.unity.modules.ai": "1.0.0", + ... + "com.unity.modules.xr": "1.0.0" + } +} +``` + +#### 4. UniVGO のインストール UniVGO をプロジェクトに取り込みます。 @@ -99,7 +118,8 @@ AまたはBのいずれかを行ってください。 { "dependencies": { "com.unity.ugui": "1.0.0", - "izayoi.univgo": "https://github.com/izayoijiichan/VGO.git#v0.8.1", + "com.vrmc.vrmshaders": "https://github.com/vrm-c/UniVRM.git?path=/Assets/VRMShaders#v0.56.1", + "izayoi.univgo": "https://github.com/izayoijiichan/VGO.git#v0.8.2", "jillejr.newtonsoft.json-for-unity": "12.0.301", "com.unity.modules.ai": "1.0.0", ... @@ -120,14 +140,11 @@ https://github.com/izayoijiichan/VGO/releases ``` Packages - izayoi.univgo@0.8.1-preview + izayoi.univgo@0.8.2-preview DepthFirstScheduler - MToon - ShaderProperty UniGLTFforUniVgo UniSkybox UniStandardParticle - UniUnlit UniVgo ``` @@ -171,12 +188,13 @@ ___ |UniVgo.Editor|VGO の入出力|-|*| - UniVgo, UniVgo.Editor それぞれについて、依存関係にあるDLLに * を付けています。 -- DepthFirstScheduler, MToon, ShaderProperty, UniUnlit は UniVRM (©vrm-c) に梱包されているプログラムです。 -- UniVRM と UniVGO を併用する場合は、UniVgo を取得した際に梱包されていた 重複するファイル(DepthFirstScheduler, MToon, ShaderProperty, UniUnlit)を削除する必要があります。 +- MToon, ShaderProperty, UniUnlit はVRMShaders (©vrm-c) に梱包されているプログラムです。 +- DepthFirstScheduler は UniVRM (©vrm-c) に梱包されているプログラムです。 +- UniVRM と UniVGO を併用する場合は、UniVgo を取得した際に梱包されていた 重複するファイル(DepthFirstScheduler)を削除する必要があります。 また、それにより UniVgo にてエラーが表示される場合、UniVgo, UniGLTFforUniVgo, UniSkybox, UniStandardParticle を `Assets`フォルダーに移動してください。 ___ -最終更新日:2020年6月20日 +最終更新日:2020年7月4日 編集者:十六夜おじいちゃん *Copyright (C) 2020 Izayoi Jiichan. All Rights Reserved.* diff --git a/Documentation~/UniVGO/Installation.md b/Documentation~/UniVGO/Installation.md index 59e9fbb..3087ae2 100644 --- a/Documentation~/UniVGO/Installation.md +++ b/Documentation~/UniVGO/Installation.md @@ -22,7 +22,7 @@ As of June of 2020, we are developing and confirming in `Unity 2019.4` Windows e |package name|owner|Repository|specification version|program version|release date| |:---:|:---:|:---:|:---:|:---:|:---:| |newtonsoft-json-for-unity|jillejr|GitHub|12.0.3|12.0.301|20 Jan, 2020| -|UniVGO|IzayoiJiichan|GitHub|VGO 0.6|0.8.1|20 Jun, 2020| +|UniVGO|IzayoiJiichan|GitHub|VGO 0.6|0.8.2|4 Jul, 2020| ___ ## Install @@ -85,6 +85,25 @@ You need to be careful where you add them. } ``` +#### 3. Installation of VRMShaders + +Import VRMShaders into your project as a package. +Write the following in `/Packages/package.json`. +You need to be careful where you add them. + +```json +{ + "dependencies": { + "com.unity.ugui": "1.0.0", + "com.vrmc.vrmshaders": "https://github.com/vrm-c/UniVRM.git?path=/Assets/VRMShaders#v0.56.1", + "jillejr.newtonsoft.json-for-unity": "12.0.301", + "com.unity.modules.ai": "1.0.0", + ... + "com.unity.modules.xr": "1.0.0" + } +} +``` + #### 3. Installation of UniVGO Import UniVGO into your project. @@ -99,7 +118,8 @@ Write the following in `/Packages/package.json`. { "dependencies": { "com.unity.ugui": "1.0.0", - "izayoi.univgo": "https://github.com/izayoijiichan/VGO.git#v0.8.1", + "com.vrmc.vrmshaders": "https://github.com/vrm-c/UniVRM.git?path=/Assets/VRMShaders#v0.56.1", + "izayoi.univgo": "https://github.com/izayoijiichan/VGO.git#v0.8.2", "jillejr.newtonsoft.json-for-unity": "12.0.301", "com.unity.modules.ai": "1.0.0", ... @@ -122,12 +142,9 @@ Unzip the file and place it in the `Packages` folder. Packages izayoi.univgo@0.8.1-preview DepthFirstScheduler - MToon - ShaderProperty UniGLTFforUniVgo UniSkybox UniStandardParticle - UniUnlit UniVgo ``` @@ -172,12 +189,13 @@ When the package is installed in the project, the script is automatically compil |UniVgo.Editor|VGO import / export|-|*| - For each of UniVgo, and UniVgo.Editor, * is attached to the dependent DLL. -- DepthFirstScheduler, MToon, ShaderProperty, UniUnlit is a program packed in UniVRM (© vrm-c). -- When using UniVRM and UniVGO together, it is necessary to delete the duplicate files (DepthFirstScheduler, MToon, ShaderProperty, UniUnlit) that were packed when UniVgo was obtained. +- MToon, ShaderProperty, UniUnlit is a program packed in VRMShaders (© vrm-c). +- DepthFirstScheduler is a program packed in UniVRM (© vrm-c). +- When using UniVRM and UniVGO together, it is necessary to delete the duplicate files (DepthFirstScheduler) that were packed when UniVgo was obtained. Also, if the error is displayed by UniVgo, please move UniVgo, UniGLTFforUniVgo, UniSkybox, UniStandardParticle to the `Assets` folder. ___ -Last updated: 20 June, 2020 +Last updated: 4 July, 2020 Editor: Izayoi Jiichan *Copyright (C) 2020 Izayoi Jiichan. All Rights Reserved.* diff --git a/MToon.meta b/MToon.meta deleted file mode 100644 index 1561eda..0000000 --- a/MToon.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: bd324684e5355ad469723cbce9e86fca -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/MToon/Editor.meta b/MToon/Editor.meta deleted file mode 100644 index 59203d1..0000000 --- a/MToon/Editor.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 1b669562c8ecaee4c98c808d3971271b -folderAsset: yes -timeCreated: 1514224760 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/MToon/Editor/EditorUtils.cs b/MToon/Editor/EditorUtils.cs deleted file mode 100644 index 274c5c3..0000000 --- a/MToon/Editor/EditorUtils.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System.IO; -using System.Text.RegularExpressions; -using UnityEditor; -using UnityEngine; - -namespace MToon -{ - public class EditorUtils - { - private static string BasePath { get { return Path.Combine(Application.dataPath, "VRM/MToon"); } } - - private static string ShaderFilePath { get { return Path.Combine(BasePath, "MToon/Resources/Shaders/MToon.shader"); } } - private static string ReadMeFilePath { get { return Path.Combine(BasePath, "README.md"); } } - private static string VersionFilePath { get { return Path.Combine(BasePath, "MToon/Scripts/UtilsVersion.cs"); } } - - - //[MenuItem("VRM/MToon Version Up")] - private static void VerUp(string version) - { - UpdateShaderFile(version); - UpdateReadMeFile(version); - UpdateVersionFile(version); - } - - private static void UpdateShaderFile(string version) - { - var file = File.ReadAllText(ShaderFilePath); - file = Regex.Replace( - file, - "(_MToonVersion \\(\"_MToonVersion\", Float\\) = )(\\d+)", - "${1}" + version - ); - File.WriteAllText(ShaderFilePath, file); - } - - private static void UpdateReadMeFile(string version) - { - version = "v" + version.Substring(0, version.Length - 1) + "." + version[version.Length - 1]; - - var file = File.ReadAllText(ReadMeFilePath); - file = Regex.Replace( - file, - "v(\\d+)\\.(\\d+)", - version - ); - File.WriteAllText(ReadMeFilePath, file); - } - - private static void UpdateVersionFile(string version) - { - var file = File.ReadAllText(VersionFilePath); - file = Regex.Replace( - file, - "(public const int VersionNumber = )(\\d+)(;)", - "${1}" + version + "${3}" - ); - File.WriteAllText(VersionFilePath, file); - - } - } -} \ No newline at end of file diff --git a/MToon/Editor/EditorUtils.cs.meta b/MToon/Editor/EditorUtils.cs.meta deleted file mode 100644 index 334cf67..0000000 --- a/MToon/Editor/EditorUtils.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 531922bb16b74a00b81445116c49b09c -timeCreated: 1559719559 \ No newline at end of file diff --git a/MToon/Editor/MToon.Editor.asmdef b/MToon/Editor/MToon.Editor.asmdef deleted file mode 100644 index e60398d..0000000 --- a/MToon/Editor/MToon.Editor.asmdef +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "MToon.Editor", - "references": [ - "MToon" - ], - "optionalUnityReferences": [], - "includePlatforms": [ - "Editor" - ], - "excludePlatforms": [], - "allowUnsafeCode": false -} \ No newline at end of file diff --git a/MToon/Editor/MToon.Editor.asmdef.meta b/MToon/Editor/MToon.Editor.asmdef.meta deleted file mode 100644 index 57face7..0000000 --- a/MToon/Editor/MToon.Editor.asmdef.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: dddf8398e965f254cae2d7519d7f67d2 -AssemblyDefinitionImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/MToon/Editor/MToonInspector.cs b/MToon/Editor/MToonInspector.cs deleted file mode 100644 index 9705cda..0000000 --- a/MToon/Editor/MToonInspector.cs +++ /dev/null @@ -1,405 +0,0 @@ -using System; -using System.Linq; -using UnityEditor; -using UnityEngine; -using UnityEngine.Rendering; - -namespace MToon -{ - public class MToonInspector : ShaderGUI - { - private static bool isAdvancedLightingPanelFoldout = false; - - private MaterialProperty _version; - private MaterialProperty _blendMode; - private MaterialProperty _bumpMap; - private MaterialProperty _bumpScale; - private MaterialProperty _color; - private MaterialProperty _cullMode; -// private MaterialProperty _outlineCullMode; - private MaterialProperty _cutoff; - - private MaterialProperty _debugMode; - private MaterialProperty _emissionColor; - private MaterialProperty _emissionMap; - private MaterialProperty _lightColorAttenuation; - private MaterialProperty _indirectLightIntensity; - private MaterialProperty _mainTex; - private MaterialProperty _outlineColor; - private MaterialProperty _outlineColorMode; - private MaterialProperty _outlineLightingMix; - private MaterialProperty _outlineWidth; - private MaterialProperty _outlineScaledMaxDistance; - private MaterialProperty _outlineWidthMode; - private MaterialProperty _outlineWidthTexture; - private MaterialProperty _receiveShadowRate; - private MaterialProperty _receiveShadowTexture; - private MaterialProperty _shadingGradeRate; - private MaterialProperty _shadingGradeTexture; - private MaterialProperty _shadeColor; - private MaterialProperty _shadeShift; - private MaterialProperty _shadeTexture; - private MaterialProperty _shadeToony; - private MaterialProperty _sphereAdd; - private MaterialProperty _rimColor; - private MaterialProperty _rimTexture; - private MaterialProperty _rimLightingMix; - private MaterialProperty _rimFresnelPower; - private MaterialProperty _rimLift; - private MaterialProperty _uvAnimMaskTexture; - private MaterialProperty _uvAnimScrollX; - private MaterialProperty _uvAnimScrollY; - private MaterialProperty _uvAnimRotation; - - public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] properties) - { - _version = FindProperty(Utils.PropVersion, properties); - _debugMode = FindProperty(Utils.PropDebugMode, properties); - _outlineWidthMode = FindProperty(Utils.PropOutlineWidthMode, properties); - _outlineColorMode = FindProperty(Utils.PropOutlineColorMode, properties); - _blendMode = FindProperty(Utils.PropBlendMode, properties); - _cullMode = FindProperty(Utils.PropCullMode, properties); -// _outlineCullMode = FindProperty(Utils.PropOutlineCullMode, properties); - _cutoff = FindProperty(Utils.PropCutoff, properties); - _color = FindProperty(Utils.PropColor, properties); - _shadeColor = FindProperty(Utils.PropShadeColor, properties); - _mainTex = FindProperty(Utils.PropMainTex, properties); - _shadeTexture = FindProperty(Utils.PropShadeTexture, properties); - _bumpScale = FindProperty(Utils.PropBumpScale, properties); - _bumpMap = FindProperty(Utils.PropBumpMap, properties); - _receiveShadowRate = FindProperty(Utils.PropReceiveShadowRate, properties); - _receiveShadowTexture = FindProperty(Utils.PropReceiveShadowTexture, properties); - _shadingGradeRate = FindProperty(Utils.PropShadingGradeRate, properties); - _shadingGradeTexture = FindProperty(Utils.PropShadingGradeTexture, properties); - _shadeShift = FindProperty(Utils.PropShadeShift, properties); - _shadeToony = FindProperty(Utils.PropShadeToony, properties); - _lightColorAttenuation = FindProperty(Utils.PropLightColorAttenuation, properties); - _indirectLightIntensity = FindProperty(Utils.PropIndirectLightIntensity, properties); - _rimColor = FindProperty(Utils.PropRimColor, properties); - _rimTexture = FindProperty(Utils.PropRimTexture, properties); - _rimLightingMix = FindProperty(Utils.PropRimLightingMix, properties); - _rimFresnelPower = FindProperty(Utils.PropRimFresnelPower, properties); - _rimLift = FindProperty(Utils.PropRimLift, properties); - _sphereAdd = FindProperty(Utils.PropSphereAdd, properties); - _emissionColor = FindProperty(Utils.PropEmissionColor, properties); - _emissionMap = FindProperty(Utils.PropEmissionMap, properties); - _outlineWidthTexture = FindProperty(Utils.PropOutlineWidthTexture, properties); - _outlineWidth = FindProperty(Utils.PropOutlineWidth, properties); - _outlineScaledMaxDistance = FindProperty(Utils.PropOutlineScaledMaxDistance, properties); - _outlineColor = FindProperty(Utils.PropOutlineColor, properties); - _outlineLightingMix = FindProperty(Utils.PropOutlineLightingMix, properties); - _uvAnimMaskTexture = FindProperty(Utils.PropUvAnimMaskTexture, properties); - _uvAnimScrollX = FindProperty(Utils.PropUvAnimScrollX, properties); - _uvAnimScrollY = FindProperty(Utils.PropUvAnimScrollY, properties); - _uvAnimRotation = FindProperty(Utils.PropUvAnimRotation, properties); - - var materials = materialEditor.targets.Select(x => x as Material).ToArray(); - Draw(materialEditor, materials); - } - - private void Draw(MaterialEditor materialEditor, Material[] materials) - { - EditorGUI.BeginChangeCheck(); - { - _version.floatValue = Utils.VersionNumber; - - EditorGUILayout.LabelField("Rendering", EditorStyles.boldLabel); - EditorGUILayout.BeginVertical(GUI.skin.box); - { - EditorGUILayout.LabelField("Mode", EditorStyles.boldLabel); - if (PopupEnum("Rendering Type", _blendMode, materialEditor)) - { - ModeChanged(materials, isBlendModeChangedByUser: true); - } - - if ((RenderMode) _blendMode.floatValue == RenderMode.TransparentWithZWrite) - { - EditorGUILayout.HelpBox("TransparentWithZWrite mode can cause problems with rendering.", MessageType.Warning); - } - - if (PopupEnum("Cull Mode", _cullMode, materialEditor)) - { - ModeChanged(materials); - } - } - EditorGUILayout.EndVertical(); - EditorGUILayout.Space(); - - EditorGUILayout.LabelField("Color", EditorStyles.boldLabel); - EditorGUILayout.BeginVertical(GUI.skin.box); - { - EditorGUILayout.LabelField("Texture", EditorStyles.boldLabel); - { - materialEditor.TexturePropertySingleLine(new GUIContent("Lit Color, Alpha", "Lit (RGB), Alpha (A)"), - _mainTex, _color); - - materialEditor.TexturePropertySingleLine(new GUIContent("Shade Color", "Shade (RGB)"), _shadeTexture, - _shadeColor); - } - var bm = (RenderMode) _blendMode.floatValue; - if (bm == RenderMode.Cutout) - { - EditorGUILayout.Space(); - EditorGUILayout.LabelField("Alpha", EditorStyles.boldLabel); - { - materialEditor.ShaderProperty(_cutoff, "Cutoff"); - } - } - } - EditorGUILayout.EndVertical(); - EditorGUILayout.Space(); - - EditorGUILayout.LabelField("Lighting", EditorStyles.boldLabel); - EditorGUILayout.BeginVertical(GUI.skin.box); - { - { - materialEditor.ShaderProperty(_shadeToony, - new GUIContent("Shading Toony", - "0.0 is Lambert. Higher value get toony shading.")); - - // Normal - EditorGUI.BeginChangeCheck(); - materialEditor.TexturePropertySingleLine(new GUIContent("Normal Map [Normal]", "Normal Map (RGB)"), - _bumpMap, - _bumpScale); - if (EditorGUI.EndChangeCheck()) - { - materialEditor.RegisterPropertyChangeUndo("BumpEnabledDisabled"); - ModeChanged(materials); - } - } - EditorGUILayout.Space(); - - EditorGUI.indentLevel++; - { - isAdvancedLightingPanelFoldout = EditorGUILayout.Foldout(isAdvancedLightingPanelFoldout, "Advanced Settings", EditorStyles.boldFont); - - if (isAdvancedLightingPanelFoldout) - { - EditorGUILayout.BeginHorizontal(); - EditorGUILayout.HelpBox( - "The default settings are suitable for Advanced Settings if you want to toony result.", - MessageType.Info); - if (GUILayout.Button("Use Default")) - { - _shadeShift.floatValue = 0; - _receiveShadowTexture.textureValue = null; - _receiveShadowRate.floatValue = 1; - _shadingGradeTexture.textureValue = null; - _shadingGradeRate.floatValue = 1; - _lightColorAttenuation.floatValue = 0; - _indirectLightIntensity.floatValue = 0.1f; - } - EditorGUILayout.EndHorizontal(); - - materialEditor.ShaderProperty(_shadeShift, - new GUIContent("Shading Shift", - "Zero is Default. Negative value increase lit area. Positive value increase shade area.")); - materialEditor.TexturePropertySingleLine( - new GUIContent("Shadow Receive Multiplier", - "Texture (R) * Rate. White is Default. Black attenuates shadows."), - _receiveShadowTexture, - _receiveShadowRate); - materialEditor.TexturePropertySingleLine( - new GUIContent("Lit & Shade Mixing Multiplier", - "Texture (R) * Rate. Compatible with UTS2 ShadingGradeMap. White is Default. Black amplifies shade."), - _shadingGradeTexture, - _shadingGradeRate); - materialEditor.ShaderProperty(_lightColorAttenuation, "LightColor Attenuation"); - materialEditor.ShaderProperty(_indirectLightIntensity, "GI Intensity"); - } - } - EditorGUI.indentLevel--; - } - EditorGUILayout.EndVertical(); - EditorGUILayout.Space(); - - EditorGUILayout.LabelField("Emission", EditorStyles.boldLabel); - EditorGUILayout.BeginVertical(GUI.skin.box); - { - TextureWithHdrColor(materialEditor, "Emission", "Emission (RGB)", - _emissionMap, _emissionColor); - - materialEditor.TexturePropertySingleLine(new GUIContent("MatCap", "MatCap Texture (RGB)"), - _sphereAdd); - } - EditorGUILayout.EndVertical(); - EditorGUILayout.Space(); - - EditorGUILayout.LabelField("Rim", EditorStyles.boldLabel); - EditorGUILayout.BeginVertical(GUI.skin.box); - { - TextureWithHdrColor(materialEditor, "Color", "Rim Color (RGB)", - _rimTexture, _rimColor); - - materialEditor.DefaultShaderProperty(_rimLightingMix, "Lighting Mix"); - - materialEditor.ShaderProperty(_rimFresnelPower, - new GUIContent("Fresnel Power", - "If you increase this value, you get sharpness rim light.")); - - materialEditor.ShaderProperty(_rimLift, - new GUIContent("Lift", - "If you increase this value, you can lift rim light.")); - } - EditorGUILayout.EndVertical(); - EditorGUILayout.Space(); - - - EditorGUILayout.LabelField("Outline", EditorStyles.boldLabel); - EditorGUILayout.BeginVertical(GUI.skin.box); - { - // Outline - EditorGUILayout.LabelField("Width", EditorStyles.boldLabel); - { - if (PopupEnum("Mode", _outlineWidthMode, materialEditor)) - { - ModeChanged(materials); - } - - if ((RenderMode) _blendMode.floatValue == RenderMode.Transparent && - (OutlineWidthMode) _outlineWidthMode.floatValue != OutlineWidthMode.None) - { - EditorGUILayout.HelpBox("Outline with Transparent material cause problem with rendering.", MessageType.Warning); - } - - var widthMode = (OutlineWidthMode) _outlineWidthMode.floatValue; - if (widthMode != OutlineWidthMode.None) - { - materialEditor.TexturePropertySingleLine( - new GUIContent("Width", "Outline Width Texture (RGB)"), - _outlineWidthTexture, _outlineWidth); - } - - if (widthMode == OutlineWidthMode.ScreenCoordinates) - { - materialEditor.ShaderProperty(_outlineScaledMaxDistance, "Width Scaled Max Distance"); - } - } - EditorGUILayout.Space(); - - EditorGUILayout.LabelField("Color", EditorStyles.boldLabel); - { - var widthMode = (OutlineWidthMode) _outlineWidthMode.floatValue; - if (widthMode != OutlineWidthMode.None) - { - EditorGUI.BeginChangeCheck(); - - if (PopupEnum("Mode", _outlineColorMode, materialEditor)) - { - ModeChanged(materials); - } - - var colorMode = (OutlineColorMode) _outlineColorMode.floatValue; - - materialEditor.ShaderProperty(_outlineColor, "Color"); - if (colorMode == OutlineColorMode.MixedLighting) - materialEditor.DefaultShaderProperty(_outlineLightingMix, "Lighting Mix"); - } - } - } - EditorGUILayout.EndVertical(); - EditorGUILayout.Space(); - - - EditorGUILayout.LabelField("UV Coordinates", EditorStyles.boldLabel); - EditorGUILayout.BeginVertical(GUI.skin.box); - { - // UV - EditorGUILayout.LabelField("Scale & Offset", EditorStyles.boldLabel); - { - materialEditor.TextureScaleOffsetProperty(_mainTex); - } - EditorGUILayout.Space(); - - EditorGUILayout.LabelField("Auto Animation", EditorStyles.boldLabel); - { - materialEditor.TexturePropertySingleLine(new GUIContent("Mask", "Auto Animation Mask Texture (R)"), _uvAnimMaskTexture); - materialEditor.ShaderProperty(_uvAnimScrollX, "Scroll X (per second)"); - materialEditor.ShaderProperty(_uvAnimScrollY, "Scroll Y (per second)"); - materialEditor.ShaderProperty(_uvAnimRotation, "Rotation (per second)"); - } - } - EditorGUILayout.EndVertical(); - EditorGUILayout.Space(); - - - EditorGUILayout.LabelField("Options", EditorStyles.boldLabel); - EditorGUILayout.BeginVertical(GUI.skin.box); - { - EditorGUILayout.LabelField("Debugging Options", EditorStyles.boldLabel); - { - if (PopupEnum("Visualize", _debugMode, materialEditor)) - { - ModeChanged(materials); - } - } - EditorGUILayout.Space(); - - EditorGUILayout.LabelField("Advanced Options", EditorStyles.boldLabel); - { -#if UNITY_5_6_OR_NEWER -// materialEditor.EnableInstancingField(); - materialEditor.DoubleSidedGIField(); -#endif - EditorGUI.BeginChangeCheck(); - materialEditor.RenderQueueField(); - if (EditorGUI.EndChangeCheck()) - { - ModeChanged(materials); - } - } - } - EditorGUILayout.EndVertical(); - EditorGUILayout.Space(); - } - EditorGUI.EndChangeCheck(); - } - - public override void AssignNewShaderToMaterial(Material material, Shader oldShader, Shader newShader) - { - base.AssignNewShaderToMaterial(material, oldShader, newShader); - - Utils.ValidateProperties(material, isBlendModeChangedByUser: true); - } - - private static void ModeChanged(Material[] materials, bool isBlendModeChangedByUser = false) - { - foreach (var material in materials) - { - Utils.ValidateProperties(material, isBlendModeChangedByUser); - } - } - - private static bool PopupEnum(string name, MaterialProperty property, MaterialEditor editor) where T : struct - { - EditorGUI.showMixedValue = property.hasMixedValue; - EditorGUI.BeginChangeCheck(); - var ret = EditorGUILayout.Popup(name, (int) property.floatValue, Enum.GetNames(typeof(T))); - var changed = EditorGUI.EndChangeCheck(); - if (changed) - { - editor.RegisterPropertyChangeUndo("EnumPopUp"); - property.floatValue = ret; - } - - EditorGUI.showMixedValue = false; - return changed; - } - - private static void TextureWithHdrColor(MaterialEditor materialEditor, string label, string description, - MaterialProperty texProp, MaterialProperty colorProp) - { - materialEditor.TexturePropertyWithHDRColor(new GUIContent(label, description), - texProp, - colorProp, -#if UNITY_2018_1_OR_NEWER -#else - new ColorPickerHDRConfig(minBrightness: 0, maxBrightness: 10, minExposureValue: -10, - maxExposureValue: 10), -#endif - showAlpha: false); - - } - } -} \ No newline at end of file diff --git a/MToon/Editor/MToonInspector.cs.meta b/MToon/Editor/MToonInspector.cs.meta deleted file mode 100644 index cfe6932..0000000 --- a/MToon/Editor/MToonInspector.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 8b43baa9f62f04748bb167ad186f1b1a -timeCreated: 1514224771 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/MToon/LICENSE b/MToon/LICENSE deleted file mode 100644 index 2b51a7f..0000000 --- a/MToon/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2018 Masataka SUMI - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/MToon/LICENSE.meta b/MToon/LICENSE.meta deleted file mode 100644 index 7bba05a..0000000 --- a/MToon/LICENSE.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 455e6a1ad28c94341a88a29164ed7b4c -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/MToon/README.md b/MToon/README.md deleted file mode 100644 index 60394f4..0000000 --- a/MToon/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# MToon -Toon Shader with Unity Global Illumination - -## Tutorial -https://niconare.nicovideo.jp/watch/kn3485 - -## Version -v3.2 - -## Release Note -https://github.com/Santarh/MToon/releases diff --git a/MToon/README.md.meta b/MToon/README.md.meta deleted file mode 100644 index c9d4b26..0000000 --- a/MToon/README.md.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: c14ccd806ab1ddb449000d109875cbdb -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/MToon/Runtime.meta b/MToon/Runtime.meta deleted file mode 100644 index f8e901d..0000000 --- a/MToon/Runtime.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 88551f898b0043c41b202eeb79752973 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/MToon/Runtime/Resources.meta b/MToon/Runtime/Resources.meta deleted file mode 100644 index f1a215f..0000000 --- a/MToon/Runtime/Resources.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 9491ac346386a2b4e9f3c801c6786818 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/MToon/Runtime/Resources/Shaders.meta b/MToon/Runtime/Resources/Shaders.meta deleted file mode 100644 index 09aef81..0000000 --- a/MToon/Runtime/Resources/Shaders.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 221dcd8025c13ab42a51e886d7a7a92e -folderAsset: yes -timeCreated: 1516295202 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/MToon/Runtime/Resources/Shaders/MToon.shader b/MToon/Runtime/Resources/Shaders/MToon.shader deleted file mode 100644 index 48cf589..0000000 --- a/MToon/Runtime/Resources/Shaders/MToon.shader +++ /dev/null @@ -1,162 +0,0 @@ -Shader "VRM/MToon" -{ - Properties - { - _Cutoff ("Alpha Cutoff", Range(0, 1)) = 0.5 - _Color ("Lit Color + Alpha", Color) = (1,1,1,1) - _ShadeColor ("Shade Color", Color) = (0.97, 0.81, 0.86, 1) - [NoScaleOffset] _MainTex ("Lit Texture + Alpha", 2D) = "white" {} - [NoScaleOffset] _ShadeTexture ("Shade Texture", 2D) = "white" {} - _BumpScale ("Normal Scale", Float) = 1.0 - [Normal] _BumpMap ("Normal Texture", 2D) = "bump" {} - _ReceiveShadowRate ("Receive Shadow", Range(0, 1)) = 1 - [NoScaleOffset] _ReceiveShadowTexture ("Receive Shadow Texture", 2D) = "white" {} - _ShadingGradeRate ("Shading Grade", Range(0, 1)) = 1 - [NoScaleOffset] _ShadingGradeTexture ("Shading Grade Texture", 2D) = "white" {} - _ShadeShift ("Shade Shift", Range(-1, 1)) = 0 - _ShadeToony ("Shade Toony", Range(0, 1)) = 0.9 - _LightColorAttenuation ("Light Color Attenuation", Range(0, 1)) = 0 - _IndirectLightIntensity ("Indirect Light Intensity", Range(0, 1)) = 0.1 - [HDR] _RimColor ("Rim Color", Color) = (0,0,0) - [NoScaleOffset] _RimTexture ("Rim Texture", 2D) = "white" {} - _RimLightingMix ("Rim Lighting Mix", Range(0, 1)) = 0 - [PowerSlider(4.0)] _RimFresnelPower ("Rim Fresnel Power", Range(0, 100)) = 1 - _RimLift ("Rim Lift", Range(0, 1)) = 0 - [NoScaleOffset] _SphereAdd ("Sphere Texture(Add)", 2D) = "black" {} - [HDR] _EmissionColor ("Color", Color) = (0,0,0) - [NoScaleOffset] _EmissionMap ("Emission", 2D) = "white" {} - [NoScaleOffset] _OutlineWidthTexture ("Outline Width Tex", 2D) = "white" {} - _OutlineWidth ("Outline Width", Range(0.01, 1)) = 0.5 - _OutlineScaledMaxDistance ("Outline Scaled Max Distance", Range(1, 10)) = 1 - _OutlineColor ("Outline Color", Color) = (0,0,0,1) - _OutlineLightingMix ("Outline Lighting Mix", Range(0, 1)) = 1 - [NoScaleOffset] _UvAnimMaskTexture ("UV Animation Mask", 2D) = "white" {} - _UvAnimScrollX ("UV Animation Scroll X", Float) = 0 - _UvAnimScrollY ("UV Animation Scroll Y", Float) = 0 - _UvAnimRotation ("UV Animation Rotation", Float) = 0 - - [HideInInspector] _MToonVersion ("_MToonVersion", Float) = 32 - [HideInInspector] _DebugMode ("_DebugMode", Float) = 0.0 - [HideInInspector] _BlendMode ("_BlendMode", Float) = 0.0 - [HideInInspector] _OutlineWidthMode ("_OutlineWidthMode", Float) = 0.0 - [HideInInspector] _OutlineColorMode ("_OutlineColorMode", Float) = 0.0 - [HideInInspector] _CullMode ("_CullMode", Float) = 2.0 - [HideInInspector] _OutlineCullMode ("_OutlineCullMode", Float) = 1.0 - [HideInInspector] _SrcBlend ("_SrcBlend", Float) = 1.0 - [HideInInspector] _DstBlend ("_DstBlend", Float) = 0.0 - [HideInInspector] _ZWrite ("_ZWrite", Float) = 1.0 - } - - // for SM 3.0 - SubShader - { - Tags { "RenderType" = "Opaque" "Queue" = "Geometry" } - - // Forward Base - Pass - { - Name "FORWARD_BASE" - Tags { "LightMode" = "ForwardBase" } - - Cull [_CullMode] - Blend [_SrcBlend] [_DstBlend] - ZWrite [_ZWrite] - ZTest LEqual - BlendOp Add, Max - - CGPROGRAM - #pragma target 3.0 - #pragma shader_feature _ MTOON_DEBUG_NORMAL MTOON_DEBUG_LITSHADERATE - #pragma multi_compile _ _NORMALMAP - #pragma multi_compile _ _ALPHATEST_ON _ALPHABLEND_ON - #include "./MToonSM3.cginc" - #pragma vertex vert_forward_base - #pragma fragment frag_forward - #pragma multi_compile_fwdbase - #pragma multi_compile_fog -// #pragma multi_compile_instancing - ENDCG - } - - - // Forward Base Outline Pass - Pass - { - Name "FORWARD_BASE_ONLY_OUTLINE" - Tags { "LightMode" = "ForwardBase" } - - Cull [_OutlineCullMode] - Blend [_SrcBlend] [_DstBlend] - ZWrite [_ZWrite] - ZTest LEqual - Offset 1, 1 - BlendOp Add, Max - - CGPROGRAM - #pragma target 3.0 - #pragma shader_feature _ MTOON_DEBUG_NORMAL MTOON_DEBUG_LITSHADERATE - #pragma multi_compile _ MTOON_OUTLINE_WIDTH_WORLD MTOON_OUTLINE_WIDTH_SCREEN - #pragma multi_compile _ MTOON_OUTLINE_COLOR_FIXED MTOON_OUTLINE_COLOR_MIXED - #pragma multi_compile _ _NORMALMAP - #pragma multi_compile _ _ALPHATEST_ON _ALPHABLEND_ON - #define MTOON_CLIP_IF_OUTLINE_IS_NONE - #include "./MToonSM3.cginc" - #pragma vertex vert_forward_base_outline - #pragma fragment frag_forward - #pragma multi_compile_fwdbase - #pragma multi_compile_fog -// #pragma multi_compile_instancing - ENDCG - } - - - // Forward Add - Pass - { - Name "FORWARD_ADD" - Tags { "LightMode" = "ForwardAdd" } - - Cull [_CullMode] - Blend [_SrcBlend] One - ZWrite Off - ZTest LEqual - BlendOp Add, Max - - CGPROGRAM - #pragma target 3.0 - #pragma shader_feature _ MTOON_DEBUG_NORMAL MTOON_DEBUG_LITSHADERATE - #pragma multi_compile _ _NORMALMAP - #pragma multi_compile _ _ALPHATEST_ON _ALPHABLEND_ON - #define MTOON_FORWARD_ADD - #include "./MToonSM3.cginc" - #pragma vertex vert_forward_add - #pragma fragment frag_forward - #pragma multi_compile_fwdadd_fullshadows - #pragma multi_compile_fog - ENDCG - } - - // Shadow rendering pass - Pass - { - Name "ShadowCaster" - Tags { "LightMode" = "ShadowCaster" } - - Cull [_CullMode] - ZWrite On - ZTest LEqual - - CGPROGRAM - #pragma target 3.0 - #pragma multi_compile _ _ALPHATEST_ON _ALPHABLEND_ON - #pragma multi_compile_shadowcaster - #pragma vertex vertShadowCaster - #pragma fragment fragShadowCaster - #include "UnityStandardShadow.cginc" - ENDCG - } - } - - Fallback "Unlit/Texture" - CustomEditor "MToon.MToonInspector" -} diff --git a/MToon/Runtime/Resources/Shaders/MToon.shader.meta b/MToon/Runtime/Resources/Shaders/MToon.shader.meta deleted file mode 100644 index dfa8450..0000000 --- a/MToon/Runtime/Resources/Shaders/MToon.shader.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 1a97144e4ad27a04aafd70f7b915cedb -timeCreated: 1514111466 -licenseType: Free -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/MToon/Runtime/Resources/Shaders/MToonCore.cginc b/MToon/Runtime/Resources/Shaders/MToonCore.cginc deleted file mode 100644 index 136d9f8..0000000 --- a/MToon/Runtime/Resources/Shaders/MToonCore.cginc +++ /dev/null @@ -1,275 +0,0 @@ -#ifndef MTOON_CORE_INCLUDED -#define MTOON_CORE_INCLUDED - -#include "Lighting.cginc" -#include "AutoLight.cginc" - -half _Cutoff; -fixed4 _Color; -fixed4 _ShadeColor; -sampler2D _MainTex; float4 _MainTex_ST; -sampler2D _ShadeTexture; -half _BumpScale; -sampler2D _BumpMap; -sampler2D _ReceiveShadowTexture; -half _ReceiveShadowRate; -sampler2D _ShadingGradeTexture; -half _ShadingGradeRate; -half _ShadeShift; -half _ShadeToony; -half _LightColorAttenuation; -half _IndirectLightIntensity; -sampler2D _RimTexture; -half4 _RimColor; -half _RimLightingMix; -half _RimFresnelPower; -half _RimLift; -sampler2D _SphereAdd; -half4 _EmissionColor; -sampler2D _EmissionMap; -sampler2D _OutlineWidthTexture; -half _OutlineWidth; -half _OutlineScaledMaxDistance; -fixed4 _OutlineColor; -half _OutlineLightingMix; -sampler2D _UvAnimMaskTexture; -float _UvAnimScrollX; -float _UvAnimScrollY; -float _UvAnimRotation; - -//UNITY_INSTANCING_BUFFER_START(Props) -//UNITY_INSTANCING_BUFFER_END(Props) - -struct v2f -{ - float4 pos : SV_POSITION; - float4 posWorld : TEXCOORD0; - half3 tspace0 : TEXCOORD1; - half3 tspace1 : TEXCOORD2; - half3 tspace2 : TEXCOORD3; - float2 uv0 : TEXCOORD4; - float isOutline : TEXCOORD5; - fixed4 color : TEXCOORD6; - UNITY_FOG_COORDS(7) - SHADOW_COORDS(8) - //UNITY_VERTEX_INPUT_INSTANCE_ID // necessary only if any instanced properties are going to be accessed in the fragment Shader. -}; - -inline v2f InitializeV2F(appdata_full v, float4 projectedVertex, float isOutline) -{ - v2f o; - UNITY_INITIALIZE_OUTPUT(v2f, o); - UNITY_SETUP_INSTANCE_ID(v); - //UNITY_TRANSFER_INSTANCE_ID(v, o); - - o.pos = projectedVertex; - o.posWorld = mul(unity_ObjectToWorld, v.vertex); - o.uv0 = v.texcoord; - half3 worldNormal = UnityObjectToWorldNormal(v.normal); - half3 worldTangent = UnityObjectToWorldDir(v.tangent); - half tangentSign = v.tangent.w * unity_WorldTransformParams.w; - half3 worldBitangent = cross(worldNormal, worldTangent) * tangentSign; - o.tspace0 = half3(worldTangent.x, worldBitangent.x, worldNormal.x); - o.tspace1 = half3(worldTangent.y, worldBitangent.y, worldNormal.y); - o.tspace2 = half3(worldTangent.z, worldBitangent.z, worldNormal.z); - o.isOutline = isOutline; - o.color = v.color; - TRANSFER_SHADOW(o); - UNITY_TRANSFER_FOG(o, o.pos); - return o; -} - -inline float4 CalculateOutlineVertexClipPosition(appdata_full v) -{ - float outlineTex = tex2Dlod(_OutlineWidthTexture, float4(TRANSFORM_TEX(v.texcoord, _MainTex), 0, 0)).r; - - #if defined(MTOON_OUTLINE_WIDTH_WORLD) - float3 worldNormalLength = length(mul((float3x3)transpose(unity_WorldToObject), v.normal)); - float3 outlineOffset = 0.01 * _OutlineWidth * outlineTex * worldNormalLength * v.normal; - float4 vertex = UnityObjectToClipPos(v.vertex + outlineOffset); - #elif defined(MTOON_OUTLINE_WIDTH_SCREEN) - float4 nearUpperRight = mul(unity_CameraInvProjection, float4(1, 1, UNITY_NEAR_CLIP_VALUE, _ProjectionParams.y)); - float aspect = abs(nearUpperRight.y / nearUpperRight.x); - float4 vertex = UnityObjectToClipPos(v.vertex); - float3 viewNormal = mul((float3x3)UNITY_MATRIX_IT_MV, v.normal.xyz); - float3 clipNormal = TransformViewToProjection(viewNormal.xyz); - float2 projectedNormal = normalize(clipNormal.xy); - projectedNormal *= min(vertex.w, _OutlineScaledMaxDistance); - projectedNormal.x *= aspect; - vertex.xy += 0.01 * _OutlineWidth * outlineTex * projectedNormal.xy * saturate(1 - abs(normalize(viewNormal).z)); // ignore offset when normal toward camera - #else - float4 vertex = UnityObjectToClipPos(v.vertex); - #endif - return vertex; -} - -float4 frag_forward(v2f i) : SV_TARGET -{ -#ifdef MTOON_CLIP_IF_OUTLINE_IS_NONE - #ifdef MTOON_OUTLINE_WIDTH_WORLD - #elif MTOON_OUTLINE_WIDTH_SCREEN - #else - clip(-1); - #endif -#endif - - //UNITY_TRANSFER_INSTANCE_ID(v, o); - - // const - const float PI_2 = 6.28318530718; - const float EPS_COL = 0.00001; - - // uv - float2 mainUv = TRANSFORM_TEX(i.uv0, _MainTex); - - // uv anim - half uvAnim = tex2D(_UvAnimMaskTexture, mainUv).r * _Time.y; - // translate uv in bottom-left origin coordinates. - mainUv += float2(_UvAnimScrollX, _UvAnimScrollY) * uvAnim; - // rotate uv counter-clockwise around (0.5, 0.5) in bottom-left origin coordinates. - float rotateRad = _UvAnimRotation * PI_2 * uvAnim; - const float2 rotatePivot = float2(0.5, 0.5); - mainUv = mul(float2x2(cos(rotateRad), -sin(rotateRad), sin(rotateRad), cos(rotateRad)), mainUv - rotatePivot) + rotatePivot; - - // main tex - half4 mainTex = tex2D(_MainTex, mainUv); - - // alpha - half alpha = 1; -#ifdef _ALPHATEST_ON - alpha = _Color.a * mainTex.a; - clip(alpha - _Cutoff); -#endif -#ifdef _ALPHABLEND_ON - alpha = _Color.a * mainTex.a; -#endif - - // normal -#ifdef _NORMALMAP - half3 tangentNormal = UnpackScaleNormal(tex2D(_BumpMap, mainUv), _BumpScale); - half3 worldNormal; - worldNormal.x = dot(i.tspace0, tangentNormal); - worldNormal.y = dot(i.tspace1, tangentNormal); - worldNormal.z = dot(i.tspace2, tangentNormal); -#else - half3 worldNormal = half3(i.tspace0.z, i.tspace1.z, i.tspace2.z); -#endif - float3 worldView = normalize(lerp(_WorldSpaceCameraPos.xyz - i.posWorld.xyz, UNITY_MATRIX_V[2].xyz, unity_OrthoParams.w)); - worldNormal *= step(0, dot(worldView, worldNormal)) * 2 - 1; // flip if projection matrix is flipped - worldNormal *= lerp(+1.0, -1.0, i.isOutline); - worldNormal = normalize(worldNormal); - - // Unity lighting - UNITY_LIGHT_ATTENUATION(shadowAttenuation, i, i.posWorld.xyz); - half3 lightDir = lerp(_WorldSpaceLightPos0.xyz, normalize(_WorldSpaceLightPos0.xyz - i.posWorld.xyz), _WorldSpaceLightPos0.w); - half3 lightColor = _LightColor0.rgb * step(0.5, length(lightDir)); // length(lightDir) is zero if directional light is disabled. - half dotNL = dot(lightDir, worldNormal); -#ifdef MTOON_FORWARD_ADD - half lightAttenuation = 1; -#else - half lightAttenuation = shadowAttenuation * lerp(1, shadowAttenuation, _ReceiveShadowRate * tex2D(_ReceiveShadowTexture, mainUv).r); -#endif - - // Decide albedo color rate from Direct Light - half shadingGrade = 1.0 - _ShadingGradeRate * (1.0 - tex2D(_ShadingGradeTexture, mainUv).r); - half lightIntensity = dotNL; // [-1, +1] - lightIntensity = lightIntensity * 0.5 + 0.5; // from [-1, +1] to [0, 1] - lightIntensity = lightIntensity * lightAttenuation; // receive shadow - lightIntensity = lightIntensity * shadingGrade; // darker - lightIntensity = lightIntensity * 2.0 - 1.0; // from [0, 1] to [-1, +1] - // tooned. mapping from [minIntensityThreshold, maxIntensityThreshold] to [0, 1] - half maxIntensityThreshold = lerp(1, _ShadeShift, _ShadeToony); - half minIntensityThreshold = _ShadeShift; - lightIntensity = saturate((lightIntensity - minIntensityThreshold) / max(EPS_COL, (maxIntensityThreshold - minIntensityThreshold))); - - // Albedo color - half4 shade = _ShadeColor * tex2D(_ShadeTexture, mainUv); - half4 lit = _Color * mainTex; - half3 col = lerp(shade.rgb, lit.rgb, lightIntensity); - - // Direct Light - half3 lighting = lightColor; - lighting = lerp(lighting, max(EPS_COL, max(lighting.x, max(lighting.y, lighting.z))), _LightColorAttenuation); // color atten -#ifdef MTOON_FORWARD_ADD -#ifdef _ALPHABLEND_ON - lighting *= step(0, dotNL); // darken if transparent. Because Unity's transparent material can't receive shadowAttenuation. -#endif - lighting *= 0.5; // darken if additional light. - lighting *= min(0, dotNL) + 1; // darken dotNL < 0 area by using half lambert - lighting *= shadowAttenuation; // darken if receiving shadow -#else - // base light does not darken. -#endif - col *= lighting; - - // Indirect Light -#ifdef MTOON_FORWARD_ADD -#else - half3 toonedGI = 0.5 * (ShadeSH9(half4(0, 1, 0, 1)) + ShadeSH9(half4(0, -1, 0, 1))); - half3 indirectLighting = lerp(toonedGI, ShadeSH9(half4(worldNormal, 1)), _IndirectLightIntensity); - indirectLighting = lerp(indirectLighting, max(EPS_COL, max(indirectLighting.x, max(indirectLighting.y, indirectLighting.z))), _LightColorAttenuation); // color atten - col += indirectLighting * lit; - - col = min(col, lit); // comment out if you want to PBR absolutely. -#endif - - // parametric rim lighting -#ifdef MTOON_FORWARD_ADD - half3 staticRimLighting = 0; - half3 mixedRimLighting = lighting; -#else - half3 staticRimLighting = 1; - half3 mixedRimLighting = lighting + indirectLighting; -#endif - half3 rimLighting = lerp(staticRimLighting, mixedRimLighting, _RimLightingMix); - half3 rim = pow(saturate(1.0 - dot(worldNormal, worldView) + _RimLift), _RimFresnelPower) * _RimColor.rgb * tex2D(_RimTexture, mainUv).rgb; - col += lerp(rim * rimLighting, half3(0, 0, 0), i.isOutline); - - // additive matcap -#ifdef MTOON_FORWARD_ADD -#else - half3 worldCameraUp = normalize(UNITY_MATRIX_V[1].xyz); - half3 worldViewUp = normalize(worldCameraUp - worldView * dot(worldView, worldCameraUp)); - half3 worldViewRight = normalize(cross(worldView, worldViewUp)); - half2 matcapUv = half2(dot(worldViewRight, worldNormal), dot(worldViewUp, worldNormal)) * 0.5 + 0.5; - half3 matcapLighting = tex2D(_SphereAdd, matcapUv); - col += lerp(matcapLighting, half3(0, 0, 0), i.isOutline); -#endif - - // Emission -#ifdef MTOON_FORWARD_ADD -#else - half3 emission = tex2D(_EmissionMap, mainUv).rgb * _EmissionColor.rgb; - col += lerp(emission, half3(0, 0, 0), i.isOutline); -#endif - - // outline -#ifdef MTOON_OUTLINE_COLOR_FIXED - col = lerp(col, _OutlineColor, i.isOutline); -#elif MTOON_OUTLINE_COLOR_MIXED - col = lerp(col, _OutlineColor * lerp(half3(1, 1, 1), col, _OutlineLightingMix), i.isOutline); -#else -#endif - - // debug -#ifdef MTOON_DEBUG_NORMAL - #ifdef MTOON_FORWARD_ADD - return float4(0, 0, 0, 0); - #else - return float4(worldNormal * 0.5 + 0.5, alpha); - #endif -#elif MTOON_DEBUG_LITSHADERATE - #ifdef MTOON_FORWARD_ADD - return float4(0, 0, 0, 0); - #else - return float4(lightIntensity * lighting, alpha); - #endif -#endif - - - half4 result = half4(col, alpha); - UNITY_APPLY_FOG(i.fogCoord, result); - return result; -} - -#endif // MTOON_CORE_INCLUDED diff --git a/MToon/Runtime/Resources/Shaders/MToonCore.cginc.meta b/MToon/Runtime/Resources/Shaders/MToonCore.cginc.meta deleted file mode 100644 index 6b68091..0000000 --- a/MToon/Runtime/Resources/Shaders/MToonCore.cginc.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: ef6682d138947ed4fbc8fbecfe75cd28 -timeCreated: 1514120022 -licenseType: Free -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/MToon/Runtime/Resources/Shaders/MToonSM3.cginc b/MToon/Runtime/Resources/Shaders/MToonSM3.cginc deleted file mode 100644 index cf3a093..0000000 --- a/MToon/Runtime/Resources/Shaders/MToonSM3.cginc +++ /dev/null @@ -1,19 +0,0 @@ -#include "./MToonCore.cginc" - -v2f vert_forward_base(appdata_full v) -{ - v.normal = normalize(v.normal); - return InitializeV2F(v, UnityObjectToClipPos(v.vertex), 0); -} - -v2f vert_forward_base_outline(appdata_full v) -{ - v.normal = normalize(v.normal); - return InitializeV2F(v, CalculateOutlineVertexClipPosition(v), 1); -} - -v2f vert_forward_add(appdata_full v) -{ - v.normal = normalize(v.normal); - return InitializeV2F(v, UnityObjectToClipPos(v.vertex), 0); -} diff --git a/MToon/Runtime/Resources/Shaders/MToonSM3.cginc.meta b/MToon/Runtime/Resources/Shaders/MToonSM3.cginc.meta deleted file mode 100644 index 843b34e..0000000 --- a/MToon/Runtime/Resources/Shaders/MToonSM3.cginc.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 084281ffd8b1b8e4a8605725d3b0760b -timeCreated: 1514120022 -licenseType: Free -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/MToon/Runtime/Resources/Shaders/MToonSM4.cginc b/MToon/Runtime/Resources/Shaders/MToonSM4.cginc deleted file mode 100644 index 538864b..0000000 --- a/MToon/Runtime/Resources/Shaders/MToonSM4.cginc +++ /dev/null @@ -1,37 +0,0 @@ -#include "./MToonCore.cginc" - -appdata_full vert_forward_base_with_outline(appdata_full v) -{ - v.normal = normalize(v.normal); - return v; -} - -v2f vert_forward_add(appdata_full v) -{ - v.normal = normalize(v.normal); - return InitializeV2F(v, UnityObjectToClipPos(v.vertex), 0); -} - -[maxvertexcount(6)] -void geom_forward_base(triangle appdata_full IN[3], inout TriangleStream stream) -{ - v2f o; - -#if defined(MTOON_OUTLINE_WIDTH_WORLD) || defined(MTOON_OUTLINE_WIDTH_SCREEN) - for (int i = 2; i >= 0; --i) - { - appdata_full v = IN[i]; - v2f o = InitializeV2F(v, CalculateOutlineVertexClipPosition(v), 1); - stream.Append(o); - } - stream.RestartStrip(); -#endif - - for (int j = 0; j < 3; ++j) - { - appdata_full v = IN[j]; - v2f o = InitializeV2F(v, UnityObjectToClipPos(v.vertex), 0); - stream.Append(o); - } - stream.RestartStrip(); -} diff --git a/MToon/Runtime/Resources/Shaders/MToonSM4.cginc.meta b/MToon/Runtime/Resources/Shaders/MToonSM4.cginc.meta deleted file mode 100644 index f6bdf05..0000000 --- a/MToon/Runtime/Resources/Shaders/MToonSM4.cginc.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 17d4e0f990fbc794ab41e4fcc196d559 -timeCreated: 1514120022 -licenseType: Free -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/MToon/Runtime/Scripts.meta b/MToon/Runtime/Scripts.meta deleted file mode 100644 index cd2bf72..0000000 --- a/MToon/Runtime/Scripts.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 0ab5610941331be4aa783815ce9ac0c5 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/MToon/Runtime/Scripts/Enums.cs b/MToon/Runtime/Scripts/Enums.cs deleted file mode 100644 index fde05ed..0000000 --- a/MToon/Runtime/Scripts/Enums.cs +++ /dev/null @@ -1,44 +0,0 @@ -namespace MToon -{ - public enum DebugMode - { - None = 0, - Normal = 1, - LitShadeRate = 2, - } - - public enum OutlineColorMode - { - FixedColor = 0, - MixedLighting = 1, - } - - public enum OutlineWidthMode - { - None = 0, - WorldCoordinates = 1, - ScreenCoordinates = 2, - } - - public enum RenderMode - { - Opaque = 0, - Cutout = 1, - Transparent = 2, - TransparentWithZWrite = 3, - } - - public enum CullMode - { - Off = 0, - Front = 1, - Back = 2, - } - - public struct RenderQueueRequirement - { - public int DefaultValue; - public int MinValue; - public int MaxValue; - } -} \ No newline at end of file diff --git a/MToon/Runtime/Scripts/Enums.cs.meta b/MToon/Runtime/Scripts/Enums.cs.meta deleted file mode 100644 index 5149027..0000000 --- a/MToon/Runtime/Scripts/Enums.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 9a3fb070d7eb4114b5cf387e2cd60391 -timeCreated: 1548858571 \ No newline at end of file diff --git a/MToon/Runtime/Scripts/MToon.asmdef b/MToon/Runtime/Scripts/MToon.asmdef deleted file mode 100644 index e5f1f92..0000000 --- a/MToon/Runtime/Scripts/MToon.asmdef +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name": "MToon" -} diff --git a/MToon/Runtime/Scripts/MToon.asmdef.meta b/MToon/Runtime/Scripts/MToon.asmdef.meta deleted file mode 100644 index 4daa4ce..0000000 --- a/MToon/Runtime/Scripts/MToon.asmdef.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: a9bc101fb0471f94a8f99fd242fdd934 -AssemblyDefinitionImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/MToon/Runtime/Scripts/MToonDefinition.cs b/MToon/Runtime/Scripts/MToonDefinition.cs deleted file mode 100644 index 7d208c0..0000000 --- a/MToon/Runtime/Scripts/MToonDefinition.cs +++ /dev/null @@ -1,109 +0,0 @@ -using UnityEngine; - -namespace MToon -{ - public class MToonDefinition - { - public MetaDefinition Meta; - public RenderingDefinition Rendering; - public ColorDefinition Color; - public LightingDefinition Lighting; - public EmissionDefinition Emission; - public MatCapDefinition MatCap; - public RimDefinition Rim; - public OutlineDefinition Outline; - public TextureUvCoordsDefinition TextureOption; - } - - public class MetaDefinition - { - public string Implementation; - public int VersionNumber; - } - - public class RenderingDefinition - { - public RenderMode RenderMode; - public CullMode CullMode; - public int RenderQueueOffsetNumber; - } - - public class ColorDefinition - { - public Color LitColor; - public Texture2D LitMultiplyTexture; - public Color ShadeColor; - public Texture2D ShadeMultiplyTexture; - public float CutoutThresholdValue; - } - - public class LightingDefinition - { - public LitAndShadeMixingDefinition LitAndShadeMixing; - public LightingInfluenceDefinition LightingInfluence; - public NormalDefinition Normal; - } - - public class LitAndShadeMixingDefinition - { - public float ShadingShiftValue; - public float ShadingToonyValue; - public float ShadowReceiveMultiplierValue; - public Texture2D ShadowReceiveMultiplierMultiplyTexture; - public float LitAndShadeMixingMultiplierValue; - public Texture2D LitAndShadeMixingMultiplierMultiplyTexture; - } - - public class LightingInfluenceDefinition - { - public float LightColorAttenuationValue; - public float GiIntensityValue; - } - - public class EmissionDefinition - { - public Color EmissionColor; - public Texture2D EmissionMultiplyTexture; - } - - public class MatCapDefinition - { - public Texture2D AdditiveTexture; - } - - public class RimDefinition - { - public Color RimColor; - public Texture2D RimMultiplyTexture; - public float RimLightingMixValue; - public float RimFresnelPowerValue; - public float RimLiftValue; - } - - public class NormalDefinition - { - public Texture2D NormalTexture; - public float NormalScaleValue; - } - - public class OutlineDefinition - { - public OutlineWidthMode OutlineWidthMode; - public float OutlineWidthValue; - public Texture2D OutlineWidthMultiplyTexture; - public float OutlineScaledMaxDistanceValue; - public OutlineColorMode OutlineColorMode; - public Color OutlineColor; - public float OutlineLightingMixValue; - } - - public class TextureUvCoordsDefinition - { - public Vector2 MainTextureLeftBottomOriginScale; - public Vector2 MainTextureLeftBottomOriginOffset; - public Texture2D UvAnimationMaskTexture; - public float UvAnimationScrollXSpeedValue; - public float UvAnimationScrollYSpeedValue; - public float UvAnimationRotationSpeedValue; - } -} \ No newline at end of file diff --git a/MToon/Runtime/Scripts/MToonDefinition.cs.meta b/MToon/Runtime/Scripts/MToonDefinition.cs.meta deleted file mode 100644 index 47c4a33..0000000 --- a/MToon/Runtime/Scripts/MToonDefinition.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 2849b99d94074fcf9e10c5ca3eab15a8 -timeCreated: 1548857282 \ No newline at end of file diff --git a/MToon/Runtime/Scripts/Utils.cs b/MToon/Runtime/Scripts/Utils.cs deleted file mode 100644 index c4c29e0..0000000 --- a/MToon/Runtime/Scripts/Utils.cs +++ /dev/null @@ -1,115 +0,0 @@ -using System; -using UnityEngine; -using UnityEngine.Rendering; - -namespace MToon -{ - public static partial class Utils - { - public const string ShaderName = "VRM/MToon"; - - public const string PropVersion = "_MToonVersion"; - public const string PropDebugMode = "_DebugMode"; - public const string PropOutlineWidthMode = "_OutlineWidthMode"; - public const string PropOutlineColorMode = "_OutlineColorMode"; - public const string PropBlendMode = "_BlendMode"; - public const string PropCullMode = "_CullMode"; - public const string PropOutlineCullMode = "_OutlineCullMode"; - public const string PropCutoff = "_Cutoff"; - public const string PropColor = "_Color"; - public const string PropShadeColor = "_ShadeColor"; - public const string PropMainTex = "_MainTex"; - public const string PropShadeTexture = "_ShadeTexture"; - public const string PropBumpScale = "_BumpScale"; - public const string PropBumpMap = "_BumpMap"; - public const string PropReceiveShadowRate = "_ReceiveShadowRate"; - public const string PropReceiveShadowTexture = "_ReceiveShadowTexture"; - public const string PropShadingGradeRate = "_ShadingGradeRate"; - public const string PropShadingGradeTexture = "_ShadingGradeTexture"; - public const string PropShadeShift = "_ShadeShift"; - public const string PropShadeToony = "_ShadeToony"; - public const string PropLightColorAttenuation = "_LightColorAttenuation"; - public const string PropIndirectLightIntensity = "_IndirectLightIntensity"; - public const string PropRimColor = "_RimColor"; - public const string PropRimTexture = "_RimTexture"; - public const string PropRimLightingMix = "_RimLightingMix"; - public const string PropRimFresnelPower = "_RimFresnelPower"; - public const string PropRimLift = "_RimLift"; - public const string PropSphereAdd = "_SphereAdd"; - public const string PropEmissionColor = "_EmissionColor"; - public const string PropEmissionMap = "_EmissionMap"; - public const string PropOutlineWidthTexture = "_OutlineWidthTexture"; - public const string PropOutlineWidth = "_OutlineWidth"; - public const string PropOutlineScaledMaxDistance = "_OutlineScaledMaxDistance"; - public const string PropOutlineColor = "_OutlineColor"; - public const string PropOutlineLightingMix = "_OutlineLightingMix"; - public const string PropUvAnimMaskTexture = "_UvAnimMaskTexture"; - public const string PropUvAnimScrollX = "_UvAnimScrollX"; - public const string PropUvAnimScrollY = "_UvAnimScrollY"; - public const string PropUvAnimRotation = "_UvAnimRotation"; - public const string PropSrcBlend = "_SrcBlend"; - public const string PropDstBlend = "_DstBlend"; - public const string PropZWrite = "_ZWrite"; - - public const string KeyNormalMap = "_NORMALMAP"; - public const string KeyAlphaTestOn = "_ALPHATEST_ON"; - public const string KeyAlphaBlendOn = "_ALPHABLEND_ON"; - public const string KeyAlphaPremultiplyOn = "_ALPHAPREMULTIPLY_ON"; - public const string KeyOutlineWidthWorld = "MTOON_OUTLINE_WIDTH_WORLD"; - public const string KeyOutlineWidthScreen = "MTOON_OUTLINE_WIDTH_SCREEN"; - public const string KeyOutlineColorFixed = "MTOON_OUTLINE_COLOR_FIXED"; - public const string KeyOutlineColorMixed = "MTOON_OUTLINE_COLOR_MIXED"; - public const string KeyDebugNormal = "MTOON_DEBUG_NORMAL"; - public const string KeyDebugLitShadeRate = "MTOON_DEBUG_LITSHADERATE"; - - public const string TagRenderTypeKey = "RenderType"; - public const string TagRenderTypeValueOpaque = "Opaque"; - public const string TagRenderTypeValueTransparentCutout = "TransparentCutout"; - public const string TagRenderTypeValueTransparent = "Transparent"; - - public const int DisabledIntValue = 0; - public const int EnabledIntValue = 1; - - public static RenderQueueRequirement GetRenderQueueRequirement(RenderMode renderMode) - { - const int shaderDefaultQueue = -1; - const int firstTransparentQueue = 2501; - const int spanOfQueue = 50; - - switch (renderMode) - { - case RenderMode.Opaque: - return new RenderQueueRequirement() - { - DefaultValue = shaderDefaultQueue, - MinValue = shaderDefaultQueue, - MaxValue = shaderDefaultQueue, - }; - case RenderMode.Cutout: - return new RenderQueueRequirement() - { - DefaultValue = (int) RenderQueue.AlphaTest, - MinValue = (int) RenderQueue.AlphaTest, - MaxValue = (int) RenderQueue.AlphaTest, - }; - case RenderMode.Transparent: - return new RenderQueueRequirement() - { - DefaultValue = (int) RenderQueue.Transparent, - MinValue = (int) RenderQueue.Transparent - spanOfQueue + 1, - MaxValue = (int) RenderQueue.Transparent, - }; - case RenderMode.TransparentWithZWrite: - return new RenderQueueRequirement() - { - DefaultValue = firstTransparentQueue, - MinValue = firstTransparentQueue, - MaxValue = firstTransparentQueue + spanOfQueue - 1, - }; - default: - throw new ArgumentOutOfRangeException("renderMode", renderMode, null); - } - } - - } -} \ No newline at end of file diff --git a/MToon/Runtime/Scripts/Utils.cs.meta b/MToon/Runtime/Scripts/Utils.cs.meta deleted file mode 100644 index bd4175c..0000000 --- a/MToon/Runtime/Scripts/Utils.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 9d2012c170a74b3db0002f7ecda53622 -timeCreated: 1537557325 \ No newline at end of file diff --git a/MToon/Runtime/Scripts/UtilsGetter.cs b/MToon/Runtime/Scripts/UtilsGetter.cs deleted file mode 100644 index a917955..0000000 --- a/MToon/Runtime/Scripts/UtilsGetter.cs +++ /dev/null @@ -1,180 +0,0 @@ -using System; -using UnityEngine; - -namespace MToon -{ - public static partial class Utils - { - public static MToonDefinition GetMToonParametersFromMaterial(Material material) - { - return new MToonDefinition - { - Meta = new MetaDefinition - { - Implementation = Implementation, - VersionNumber = material.GetInt(PropVersion), - }, - Rendering = new RenderingDefinition - { - RenderMode = GetBlendMode(material), - CullMode = GetCullMode(material), - RenderQueueOffsetNumber = GetRenderQueueOffset(material, GetRenderQueueOriginMode(material)), - }, - Color = new ColorDefinition - { - LitColor = GetColor(material, PropColor), - LitMultiplyTexture = GetTexture(material, PropMainTex), - ShadeColor = GetColor(material, PropShadeColor), - ShadeMultiplyTexture = GetTexture(material, PropShadeTexture), - CutoutThresholdValue = GetValue(material, PropCutoff), - }, - Lighting = new LightingDefinition - { - LitAndShadeMixing = new LitAndShadeMixingDefinition - { - ShadingShiftValue = GetValue(material, PropShadeShift), - ShadingToonyValue = GetValue(material, PropShadeToony), - ShadowReceiveMultiplierValue = GetValue(material, PropReceiveShadowRate), - ShadowReceiveMultiplierMultiplyTexture = GetTexture(material, PropReceiveShadowTexture), - LitAndShadeMixingMultiplierValue = GetValue(material, PropShadingGradeRate), - LitAndShadeMixingMultiplierMultiplyTexture = GetTexture(material, PropShadingGradeTexture), - }, - LightingInfluence = new LightingInfluenceDefinition - { - LightColorAttenuationValue = GetValue(material, PropLightColorAttenuation), - GiIntensityValue = GetValue(material, PropIndirectLightIntensity), - }, - Normal = new NormalDefinition - { - NormalTexture = GetTexture(material, PropBumpMap), - NormalScaleValue = GetValue(material, PropBumpScale), - }, - }, - Emission = new EmissionDefinition - { - EmissionColor = GetColor(material, PropEmissionColor), - EmissionMultiplyTexture = GetTexture(material, PropEmissionMap), - }, - MatCap = new MatCapDefinition - { - AdditiveTexture = GetTexture(material, PropSphereAdd), - }, - Rim = new RimDefinition - { - RimColor = GetColor(material, PropRimColor), - RimMultiplyTexture = GetTexture(material, PropRimTexture), - RimLightingMixValue = GetValue(material, PropRimLightingMix), - RimFresnelPowerValue = GetValue(material, PropRimFresnelPower), - RimLiftValue = GetValue(material, PropRimLift), - }, - Outline = new OutlineDefinition - { - OutlineWidthMode = GetOutlineWidthMode(material), - OutlineWidthValue = GetValue(material, PropOutlineWidth), - OutlineWidthMultiplyTexture = GetTexture(material, PropOutlineWidthTexture), - OutlineScaledMaxDistanceValue = GetValue(material, PropOutlineScaledMaxDistance), - OutlineColorMode = GetOutlineColorMode(material), - OutlineColor = GetColor(material, PropOutlineColor), - OutlineLightingMixValue = GetValue(material, PropOutlineLightingMix), - }, - TextureOption = new TextureUvCoordsDefinition - { - MainTextureLeftBottomOriginScale = material.GetTextureScale(PropMainTex), - MainTextureLeftBottomOriginOffset = material.GetTextureOffset(PropMainTex), - UvAnimationMaskTexture = GetTexture(material, PropUvAnimMaskTexture), - UvAnimationScrollXSpeedValue = GetValue(material, PropUvAnimScrollX), - UvAnimationScrollYSpeedValue = GetValue(material, PropUvAnimScrollY), - UvAnimationRotationSpeedValue = GetValue(material, PropUvAnimRotation), - }, - }; - } - - private static float GetValue(Material material, string propertyName) - { - return material.GetFloat(propertyName); - } - - private static Color GetColor(Material material, string propertyName) - { - return material.GetColor(propertyName); - } - - private static Texture2D GetTexture(Material material, string propertyName) - { - return (Texture2D) material.GetTexture(propertyName); - } - - private static RenderMode GetBlendMode(Material material) - { - if (material.IsKeywordEnabled(KeyAlphaTestOn)) - { - return RenderMode.Cutout; - } - else if (material.IsKeywordEnabled(KeyAlphaBlendOn)) - { - switch (material.GetInt(PropZWrite)) - { - case EnabledIntValue: - return RenderMode.TransparentWithZWrite; - case DisabledIntValue: - return RenderMode.Transparent; - default: - Debug.LogWarning("Invalid ZWrite Int Value."); - return RenderMode.Transparent; - } - } - else - { - return RenderMode.Opaque; - } - } - - private static CullMode GetCullMode(Material material) - { - switch ((CullMode) material.GetInt(PropCullMode)) - { - case CullMode.Off: - return CullMode.Off; - case CullMode.Front: - return CullMode.Front; - case CullMode.Back: - return CullMode.Back; - default: - Debug.LogWarning("Invalid CullMode."); - return CullMode.Back; - } - } - - private static OutlineWidthMode GetOutlineWidthMode(Material material) - { - if (material.IsKeywordEnabled(KeyOutlineWidthWorld)) return OutlineWidthMode.WorldCoordinates; - if (material.IsKeywordEnabled(KeyOutlineWidthScreen)) return OutlineWidthMode.ScreenCoordinates; - - return OutlineWidthMode.None; - } - - private static OutlineColorMode GetOutlineColorMode(Material material) - { - if (material.IsKeywordEnabled(KeyOutlineColorFixed)) return OutlineColorMode.FixedColor; - if (material.IsKeywordEnabled(KeyOutlineColorMixed)) return OutlineColorMode.MixedLighting; - - return OutlineColorMode.FixedColor; - } - - private static RenderMode GetRenderQueueOriginMode(Material material) - { - return GetBlendMode(material); - } - - private static int GetRenderQueueOffset(Material material, RenderMode originMode) - { - var rawValue = material.renderQueue; - var requirement = GetRenderQueueRequirement(originMode); - if (rawValue < requirement.MinValue || rawValue > requirement.MaxValue) - { - return 0; - } - return rawValue - requirement.DefaultValue; - } - } -} \ No newline at end of file diff --git a/MToon/Runtime/Scripts/UtilsGetter.cs.meta b/MToon/Runtime/Scripts/UtilsGetter.cs.meta deleted file mode 100644 index db1134a..0000000 --- a/MToon/Runtime/Scripts/UtilsGetter.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 6724aa45c8c349fabd5954a531301aa8 -timeCreated: 1557229569 \ No newline at end of file diff --git a/MToon/Runtime/Scripts/UtilsSetter.cs b/MToon/Runtime/Scripts/UtilsSetter.cs deleted file mode 100644 index c9c25bb..0000000 --- a/MToon/Runtime/Scripts/UtilsSetter.cs +++ /dev/null @@ -1,267 +0,0 @@ -using System; -using UnityEngine; -using UnityEngine.Rendering; - -namespace MToon -{ - public static partial class Utils - { - public static void SetMToonParametersToMaterial(Material material, MToonDefinition parameters) - { - { - var meta = parameters.Meta; - SetValue(material, PropVersion, meta.VersionNumber); - } - { - var rendering = parameters.Rendering; - ValidateBlendMode(material, rendering.RenderMode, isChangedByUser: true); - ValidateCullMode(material, rendering.CullMode); - ValidateRenderQueue(material, offset: rendering.RenderQueueOffsetNumber); - } - { - var color = parameters.Color; - SetColor(material, PropColor, color.LitColor); - SetTexture(material, PropMainTex, color.LitMultiplyTexture); - SetColor(material, PropShadeColor, color.ShadeColor); - SetTexture(material, PropShadeTexture, color.ShadeMultiplyTexture); - SetValue(material, PropCutoff, color.CutoutThresholdValue); - } - { - var lighting = parameters.Lighting; - { - var prop = lighting.LitAndShadeMixing; - SetValue(material, PropShadeShift, prop.ShadingShiftValue); - SetValue(material, PropShadeToony, prop.ShadingToonyValue); - SetValue(material, PropReceiveShadowRate, prop.ShadowReceiveMultiplierValue); - SetTexture(material, PropReceiveShadowTexture, prop.ShadowReceiveMultiplierMultiplyTexture); - SetValue(material, PropShadingGradeRate, prop.LitAndShadeMixingMultiplierValue); - SetTexture(material, PropShadingGradeTexture, prop.LitAndShadeMixingMultiplierMultiplyTexture); - } - { - var prop = lighting.LightingInfluence; - SetValue(material, PropLightColorAttenuation, prop.LightColorAttenuationValue); - SetValue(material, PropIndirectLightIntensity, prop.GiIntensityValue); - } - { - var prop = lighting.Normal; - SetTexture(material, PropBumpMap, prop.NormalTexture); - SetValue(material, PropBumpScale, prop.NormalScaleValue); - } - } - { - var emission = parameters.Emission; - SetColor(material, PropEmissionColor, emission.EmissionColor); - SetTexture(material, PropEmissionMap, emission.EmissionMultiplyTexture); - } - { - var matcap = parameters.MatCap; - SetTexture(material, PropSphereAdd, matcap.AdditiveTexture); - } - { - var rim = parameters.Rim; - SetColor(material, PropRimColor, rim.RimColor); - SetTexture(material, PropRimTexture, rim.RimMultiplyTexture); - SetValue(material, PropRimLightingMix, rim.RimLightingMixValue); - SetValue(material, PropRimFresnelPower, rim.RimFresnelPowerValue); - SetValue(material, PropRimLift, rim.RimLiftValue); - } - { - var outline = parameters.Outline; - SetValue(material, PropOutlineWidth, outline.OutlineWidthValue); - SetTexture(material, PropOutlineWidthTexture, outline.OutlineWidthMultiplyTexture); - SetValue(material, PropOutlineScaledMaxDistance, outline.OutlineScaledMaxDistanceValue); - SetColor(material, PropOutlineColor, outline.OutlineColor); - SetValue(material, PropOutlineLightingMix, outline.OutlineLightingMixValue); - ValidateOutlineMode(material, outline.OutlineWidthMode, outline.OutlineColorMode); - } - { - var textureOptions = parameters.TextureOption; - material.SetTextureScale(PropMainTex, textureOptions.MainTextureLeftBottomOriginScale); - material.SetTextureOffset(PropMainTex, textureOptions.MainTextureLeftBottomOriginOffset); - material.SetTexture(PropUvAnimMaskTexture, textureOptions.UvAnimationMaskTexture); - material.SetFloat(PropUvAnimScrollX, textureOptions.UvAnimationScrollXSpeedValue); - material.SetFloat(PropUvAnimScrollY, textureOptions.UvAnimationScrollYSpeedValue); - material.SetFloat(PropUvAnimRotation, textureOptions.UvAnimationRotationSpeedValue); - } - } - - /// - /// Validate properties and Set hidden properties, keywords. - /// if isBlendModeChangedByUser is true, renderQueue will set specified render mode's default value. - /// - /// - /// - public static void ValidateProperties(Material material, bool isBlendModeChangedByUser = false) - { - ValidateBlendMode(material, (RenderMode) material.GetFloat(PropBlendMode), isBlendModeChangedByUser); - ValidateNormalMode(material, material.GetTexture(PropBumpMap)); - ValidateOutlineMode(material, - (OutlineWidthMode) material.GetFloat(PropOutlineWidthMode), - (OutlineColorMode) material.GetFloat(PropOutlineColorMode)); - ValidateDebugMode(material, (DebugMode) material.GetFloat(PropDebugMode)); - ValidateCullMode(material, (CullMode) material.GetFloat(PropCullMode)); - - var mainTex = material.GetTexture(PropMainTex); - var shadeTex = material.GetTexture(PropShadeTexture); - if (mainTex != null && shadeTex == null) - { - material.SetTexture(PropShadeTexture, mainTex); - } - } - - private static void ValidateDebugMode(Material material, DebugMode debugMode) - { - switch (debugMode) - { - case DebugMode.None: - SetKeyword(material, KeyDebugNormal, false); - SetKeyword(material, KeyDebugLitShadeRate, false); - break; - case DebugMode.Normal: - SetKeyword(material, KeyDebugNormal, true); - SetKeyword(material, KeyDebugLitShadeRate, false); - break; - case DebugMode.LitShadeRate: - SetKeyword(material, KeyDebugNormal, false); - SetKeyword(material, KeyDebugLitShadeRate, true); - break; - } - } - - public static void ValidateBlendMode(Material material, RenderMode renderMode, bool isChangedByUser) - { - switch (renderMode) - { - case RenderMode.Opaque: - material.SetOverrideTag(TagRenderTypeKey, TagRenderTypeValueOpaque); - material.SetInt(PropSrcBlend, (int) BlendMode.One); - material.SetInt(PropDstBlend, (int) BlendMode.Zero); - material.SetInt(PropZWrite, EnabledIntValue); - SetKeyword(material, KeyAlphaTestOn, false); - SetKeyword(material, KeyAlphaBlendOn, false); - SetKeyword(material, KeyAlphaPremultiplyOn, false); - break; - case RenderMode.Cutout: - material.SetOverrideTag(TagRenderTypeKey, TagRenderTypeValueTransparentCutout); - material.SetInt(PropSrcBlend, (int) BlendMode.One); - material.SetInt(PropDstBlend, (int) BlendMode.Zero); - material.SetInt(PropZWrite, EnabledIntValue); - SetKeyword(material, KeyAlphaTestOn, true); - SetKeyword(material, KeyAlphaBlendOn, false); - SetKeyword(material, KeyAlphaPremultiplyOn, false); - break; - case RenderMode.Transparent: - material.SetOverrideTag(TagRenderTypeKey, TagRenderTypeValueTransparent); - material.SetInt(PropSrcBlend, (int) BlendMode.SrcAlpha); - material.SetInt(PropDstBlend, (int) BlendMode.OneMinusSrcAlpha); - material.SetInt(PropZWrite, DisabledIntValue); - SetKeyword(material, KeyAlphaTestOn, false); - SetKeyword(material, KeyAlphaBlendOn, true); - SetKeyword(material, KeyAlphaPremultiplyOn, false); - break; - case RenderMode.TransparentWithZWrite: - material.SetOverrideTag(TagRenderTypeKey, TagRenderTypeValueTransparent); - material.SetInt(PropSrcBlend, (int) BlendMode.SrcAlpha); - material.SetInt(PropDstBlend, (int) BlendMode.OneMinusSrcAlpha); - material.SetInt(PropZWrite, EnabledIntValue); - SetKeyword(material, KeyAlphaTestOn, false); - SetKeyword(material, KeyAlphaBlendOn, true); - SetKeyword(material, KeyAlphaPremultiplyOn, false); - break; - } - - if (isChangedByUser) - { - ValidateRenderQueue(material, offset: 0); - } - else - { - var requirement = GetRenderQueueRequirement(renderMode); - ValidateRenderQueue(material, offset: material.renderQueue - requirement.DefaultValue); - } - } - - private static void ValidateRenderQueue(Material material, int offset) - { - var requirement = GetRenderQueueRequirement(GetBlendMode(material)); - var value = Mathf.Clamp(requirement.DefaultValue + offset, requirement.MinValue, requirement.MaxValue); - material.renderQueue = value; - } - - private static void ValidateOutlineMode(Material material, OutlineWidthMode outlineWidthMode, - OutlineColorMode outlineColorMode) - { - var isFixed = outlineColorMode == OutlineColorMode.FixedColor; - var isMixed = outlineColorMode == OutlineColorMode.MixedLighting; - - switch (outlineWidthMode) - { - case OutlineWidthMode.None: - SetKeyword(material, KeyOutlineWidthWorld, false); - SetKeyword(material, KeyOutlineWidthScreen, false); - SetKeyword(material, KeyOutlineColorFixed, false); - SetKeyword(material, KeyOutlineColorMixed, false); - break; - case OutlineWidthMode.WorldCoordinates: - SetKeyword(material, KeyOutlineWidthWorld, true); - SetKeyword(material, KeyOutlineWidthScreen, false); - SetKeyword(material, KeyOutlineColorFixed, isFixed); - SetKeyword(material, KeyOutlineColorMixed, isMixed); - break; - case OutlineWidthMode.ScreenCoordinates: - SetKeyword(material, KeyOutlineWidthWorld, false); - SetKeyword(material, KeyOutlineWidthScreen, true); - SetKeyword(material, KeyOutlineColorFixed, isFixed); - SetKeyword(material, KeyOutlineColorMixed, isMixed); - break; - } - } - - private static void ValidateNormalMode(Material material, bool requireNormalMapping) - { - SetKeyword(material, KeyNormalMap, requireNormalMapping); - } - - private static void ValidateCullMode(Material material, CullMode cullMode) - { - switch (cullMode) - { - case CullMode.Back: - material.SetInt(PropCullMode, (int) CullMode.Back); - material.SetInt(PropOutlineCullMode, (int) CullMode.Front); - break; - case CullMode.Front: - material.SetInt(PropCullMode, (int) CullMode.Front); - material.SetInt(PropOutlineCullMode, (int) CullMode.Back); - break; - case CullMode.Off: - material.SetInt(PropCullMode, (int) CullMode.Off); - material.SetInt(PropOutlineCullMode, (int) CullMode.Front); - break; - } - } - - private static void SetValue(Material material, string propertyName, float val) - { - material.SetFloat(propertyName, val); - } - - private static void SetColor(Material material, string propertyName, Color color) - { - material.SetColor(propertyName, color); - } - - private static void SetTexture(Material material, string propertyName, Texture2D texture) - { - material.SetTexture(propertyName, texture); - } - - private static void SetKeyword(Material mat, string keyword, bool required) - { - if (required) - mat.EnableKeyword(keyword); - else - mat.DisableKeyword(keyword); - } - } -} \ No newline at end of file diff --git a/MToon/Runtime/Scripts/UtilsSetter.cs.meta b/MToon/Runtime/Scripts/UtilsSetter.cs.meta deleted file mode 100644 index d49b036..0000000 --- a/MToon/Runtime/Scripts/UtilsSetter.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: b24a672e82874c9fbfef9c2b2dfdab42 -timeCreated: 1557304397 \ No newline at end of file diff --git a/MToon/Runtime/Scripts/UtilsVersion.cs b/MToon/Runtime/Scripts/UtilsVersion.cs deleted file mode 100644 index 9e4fd5b..0000000 --- a/MToon/Runtime/Scripts/UtilsVersion.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace MToon -{ - public static partial class Utils - { - public const string Implementation = "Santarh/MToon"; - public const int VersionNumber = 32; - } -} \ No newline at end of file diff --git a/MToon/Runtime/Scripts/UtilsVersion.cs.meta b/MToon/Runtime/Scripts/UtilsVersion.cs.meta deleted file mode 100644 index b2f3ef4..0000000 --- a/MToon/Runtime/Scripts/UtilsVersion.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: 4702d4b2c1414cc08b4382c3762eebab -timeCreated: 1557306172 \ No newline at end of file diff --git a/ShaderProperty.meta b/ShaderProperty.meta deleted file mode 100644 index bd6a875..0000000 --- a/ShaderProperty.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: f9b3124aad2f5a54e95b60232cecb407 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/ShaderProperty/LICENSE.md b/ShaderProperty/LICENSE.md deleted file mode 100644 index 3f1fd54..0000000 --- a/ShaderProperty/LICENSE.md +++ /dev/null @@ -1,23 +0,0 @@ -MIT License - -Copyright (c) 2018 DWANGO Co., Ltd. for UniVRM -Copyright (c) 2018 ousttrue for UniGLTF, UniHumanoid -Copyright (c) 2018 Masataka SUMI for MToon - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/ShaderProperty/LICENSE.md.meta b/ShaderProperty/LICENSE.md.meta deleted file mode 100644 index 6164e07..0000000 --- a/ShaderProperty/LICENSE.md.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 15ee4b816d7104847b1190ad12ba9db3 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/ShaderProperty/Runtime.meta b/ShaderProperty/Runtime.meta deleted file mode 100644 index 12353a9..0000000 --- a/ShaderProperty/Runtime.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: eeafde81bbc52c642aa7cf73e4d96646 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/ShaderProperty/Runtime/GLTF.meta b/ShaderProperty/Runtime/GLTF.meta deleted file mode 100644 index bcab813..0000000 --- a/ShaderProperty/Runtime/GLTF.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: cf7ef378c0ec9e9448a5fa7ba3757956 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/ShaderProperty/Runtime/GLTF/PreExportShaders_GLTF.cs b/ShaderProperty/Runtime/GLTF/PreExportShaders_GLTF.cs deleted file mode 100644 index f6fcb76..0000000 --- a/ShaderProperty/Runtime/GLTF/PreExportShaders_GLTF.cs +++ /dev/null @@ -1,20 +0,0 @@ -namespace UniGLTF.ShaderPropExporter -{ - public static partial class PreExportShaders - { - const string GLTF_FOLDER = "GLTF"; - -#pragma warning disable 414 - [PreExportShaders] - static SupportedShader[] SupportedShaders = new SupportedShader[] - { - new SupportedShader(GLTF_FOLDER, "Standard"), - new SupportedShader(GLTF_FOLDER, "Unlit/Color"), - new SupportedShader(GLTF_FOLDER, "Unlit/Texture"), - new SupportedShader(GLTF_FOLDER, "Unlit/Transparent"), - new SupportedShader(GLTF_FOLDER, "Unlit/Transparent Cutout"), - new SupportedShader(GLTF_FOLDER, "UniGLTF/UniUnlit"), - }; -#pragma warning restore 414 - } -} diff --git a/ShaderProperty/Runtime/GLTF/PreExportShaders_GLTF.cs.meta b/ShaderProperty/Runtime/GLTF/PreExportShaders_GLTF.cs.meta deleted file mode 100644 index fa17b50..0000000 --- a/ShaderProperty/Runtime/GLTF/PreExportShaders_GLTF.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 90dcef1978c51e74386b76d77689dc82 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/ShaderProperty/Runtime/GLTF/Standard.cs b/ShaderProperty/Runtime/GLTF/Standard.cs deleted file mode 100644 index aa5b342..0000000 --- a/ShaderProperty/Runtime/GLTF/Standard.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System.Collections.Generic; - - -namespace UniGLTF.ShaderPropExporter -{ - public static partial class PreShaderPropExporter - { - [PreExportShader] - static KeyValuePair Standard - { - get - { - return new KeyValuePair( - "Standard", - new ShaderProps - { - Properties = new ShaderProperty[]{ -new ShaderProperty("_Color", ShaderPropertyType.Color) -,new ShaderProperty("_MainTex", ShaderPropertyType.TexEnv) -,new ShaderProperty("_Cutoff", ShaderPropertyType.Range) -,new ShaderProperty("_Glossiness", ShaderPropertyType.Range) -,new ShaderProperty("_GlossMapScale", ShaderPropertyType.Range) -,new ShaderProperty("_SmoothnessTextureChannel", ShaderPropertyType.Float) -,new ShaderProperty("_Metallic", ShaderPropertyType.Range) -,new ShaderProperty("_MetallicGlossMap", ShaderPropertyType.TexEnv) -,new ShaderProperty("_SpecularHighlights", ShaderPropertyType.Float) -,new ShaderProperty("_GlossyReflections", ShaderPropertyType.Float) -,new ShaderProperty("_BumpScale", ShaderPropertyType.Float) -,new ShaderProperty("_BumpMap", ShaderPropertyType.TexEnv) -,new ShaderProperty("_Parallax", ShaderPropertyType.Range) -,new ShaderProperty("_ParallaxMap", ShaderPropertyType.TexEnv) -,new ShaderProperty("_OcclusionStrength", ShaderPropertyType.Range) -,new ShaderProperty("_OcclusionMap", ShaderPropertyType.TexEnv) -,new ShaderProperty("_EmissionColor", ShaderPropertyType.Color) -,new ShaderProperty("_EmissionMap", ShaderPropertyType.TexEnv) -,new ShaderProperty("_DetailMask", ShaderPropertyType.TexEnv) -,new ShaderProperty("_DetailAlbedoMap", ShaderPropertyType.TexEnv) -,new ShaderProperty("_DetailNormalMapScale", ShaderPropertyType.Float) -,new ShaderProperty("_DetailNormalMap", ShaderPropertyType.TexEnv) -,new ShaderProperty("_UVSec", ShaderPropertyType.Float) -,new ShaderProperty("_Mode", ShaderPropertyType.Float) -,new ShaderProperty("_SrcBlend", ShaderPropertyType.Float) -,new ShaderProperty("_DstBlend", ShaderPropertyType.Float) -,new ShaderProperty("_ZWrite", ShaderPropertyType.Float) - - } - } - ); - } - } - } -} diff --git a/ShaderProperty/Runtime/GLTF/Standard.cs.meta b/ShaderProperty/Runtime/GLTF/Standard.cs.meta deleted file mode 100644 index abf6b6c..0000000 --- a/ShaderProperty/Runtime/GLTF/Standard.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 54043e349b047bf4b8f127cd919a757d -timeCreated: 1533542890 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/ShaderProperty/Runtime/GLTF/UniGLTF_UniUnlit.cs b/ShaderProperty/Runtime/GLTF/UniGLTF_UniUnlit.cs deleted file mode 100644 index ce4503a..0000000 --- a/ShaderProperty/Runtime/GLTF/UniGLTF_UniUnlit.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.Collections.Generic; - - -namespace UniGLTF.ShaderPropExporter -{ - public static partial class PreShaderPropExporter - { - [PreExportShader] - static KeyValuePair UniGLTF_UniUnlit - { - get - { - return new KeyValuePair( - "UniGLTF/UniUnlit", - new ShaderProps - { - Properties = new ShaderProperty[]{ -new ShaderProperty("_MainTex", ShaderPropertyType.TexEnv) -,new ShaderProperty("_Color", ShaderPropertyType.Color) -,new ShaderProperty("_Cutoff", ShaderPropertyType.Range) -,new ShaderProperty("_BlendMode", ShaderPropertyType.Float) -,new ShaderProperty("_CullMode", ShaderPropertyType.Float) -,new ShaderProperty("_VColBlendMode", ShaderPropertyType.Float) -,new ShaderProperty("_SrcBlend", ShaderPropertyType.Float) -,new ShaderProperty("_DstBlend", ShaderPropertyType.Float) -,new ShaderProperty("_ZWrite", ShaderPropertyType.Float) - - } - } - ); - } - } - } -} diff --git a/ShaderProperty/Runtime/GLTF/UniGLTF_UniUnlit.cs.meta b/ShaderProperty/Runtime/GLTF/UniGLTF_UniUnlit.cs.meta deleted file mode 100644 index c1315f4..0000000 --- a/ShaderProperty/Runtime/GLTF/UniGLTF_UniUnlit.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: ad4b6b115b83ecd48a513f697afc95f0 -timeCreated: 1537860074 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/ShaderProperty/Runtime/GLTF/Unlit_Color.cs b/ShaderProperty/Runtime/GLTF/Unlit_Color.cs deleted file mode 100644 index 1ef6c3a..0000000 --- a/ShaderProperty/Runtime/GLTF/Unlit_Color.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.Collections.Generic; - - -namespace UniGLTF.ShaderPropExporter -{ - public static partial class PreShaderPropExporter - { - [PreExportShader] - static KeyValuePair Unlit_Color - { - get - { - return new KeyValuePair( - "Unlit/Color", - new ShaderProps - { - Properties = new ShaderProperty[]{ -new ShaderProperty("_Color", ShaderPropertyType.Color) - - } - } - ); - } - } - } -} diff --git a/ShaderProperty/Runtime/GLTF/Unlit_Color.cs.meta b/ShaderProperty/Runtime/GLTF/Unlit_Color.cs.meta deleted file mode 100644 index 4f97a3c..0000000 --- a/ShaderProperty/Runtime/GLTF/Unlit_Color.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 4f91421c5846d5d48933d2ee4ffeeceb -timeCreated: 1535186213 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/ShaderProperty/Runtime/GLTF/Unlit_Texture.cs b/ShaderProperty/Runtime/GLTF/Unlit_Texture.cs deleted file mode 100644 index ed6f487..0000000 --- a/ShaderProperty/Runtime/GLTF/Unlit_Texture.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.Collections.Generic; - - -namespace UniGLTF.ShaderPropExporter -{ - public static partial class PreShaderPropExporter - { - [PreExportShader] - static KeyValuePair Unlit_Texture - { - get - { - return new KeyValuePair( - "Unlit/Texture", - new ShaderProps - { - Properties = new ShaderProperty[]{ -new ShaderProperty("_MainTex", ShaderPropertyType.TexEnv) - - } - } - ); - } - } - } -} diff --git a/ShaderProperty/Runtime/GLTF/Unlit_Texture.cs.meta b/ShaderProperty/Runtime/GLTF/Unlit_Texture.cs.meta deleted file mode 100644 index 8332068..0000000 --- a/ShaderProperty/Runtime/GLTF/Unlit_Texture.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 8273e1e61ad8e914baae94d06836f2ad -timeCreated: 1535186213 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/ShaderProperty/Runtime/GLTF/Unlit_Transparent.cs b/ShaderProperty/Runtime/GLTF/Unlit_Transparent.cs deleted file mode 100644 index cad3b4b..0000000 --- a/ShaderProperty/Runtime/GLTF/Unlit_Transparent.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.Collections.Generic; - - -namespace UniGLTF.ShaderPropExporter -{ - public static partial class PreShaderPropExporter - { - [PreExportShader] - static KeyValuePair Unlit_Transparent - { - get - { - return new KeyValuePair( - "Unlit/Transparent", - new ShaderProps - { - Properties = new ShaderProperty[]{ -new ShaderProperty("_MainTex", ShaderPropertyType.TexEnv) - - } - } - ); - } - } - } -} diff --git a/ShaderProperty/Runtime/GLTF/Unlit_Transparent.cs.meta b/ShaderProperty/Runtime/GLTF/Unlit_Transparent.cs.meta deleted file mode 100644 index f64c655..0000000 --- a/ShaderProperty/Runtime/GLTF/Unlit_Transparent.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: b98a8ee8ca13abb43809305cc4e5571a -timeCreated: 1535186213 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/ShaderProperty/Runtime/GLTF/Unlit_Transparent_Cutout.cs b/ShaderProperty/Runtime/GLTF/Unlit_Transparent_Cutout.cs deleted file mode 100644 index ebe366b..0000000 --- a/ShaderProperty/Runtime/GLTF/Unlit_Transparent_Cutout.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System.Collections.Generic; - - -namespace UniGLTF.ShaderPropExporter -{ - public static partial class PreShaderPropExporter - { - [PreExportShader] - static KeyValuePair Unlit_Transparent_Cutout - { - get - { - return new KeyValuePair( - "Unlit/Transparent Cutout", - new ShaderProps - { - Properties = new ShaderProperty[]{ -new ShaderProperty("_MainTex", ShaderPropertyType.TexEnv) -,new ShaderProperty("_Cutoff", ShaderPropertyType.Range) - - } - } - ); - } - } - } -} diff --git a/ShaderProperty/Runtime/GLTF/Unlit_Transparent_Cutout.cs.meta b/ShaderProperty/Runtime/GLTF/Unlit_Transparent_Cutout.cs.meta deleted file mode 100644 index 5ffeb3f..0000000 --- a/ShaderProperty/Runtime/GLTF/Unlit_Transparent_Cutout.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 844490f13976543478d82efe28251941 -timeCreated: 1535186301 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/ShaderProperty/Runtime/PreShaderPropExporter.cs b/ShaderProperty/Runtime/PreShaderPropExporter.cs deleted file mode 100644 index bdc6b49..0000000 --- a/ShaderProperty/Runtime/PreShaderPropExporter.cs +++ /dev/null @@ -1,64 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Reflection; -using UnityEngine; -#if UNITY_EDITOR -using UnityEditor; -#endif - - -namespace UniGLTF.ShaderPropExporter -{ - public class PreExportShadersAttribute : Attribute { } - public class PreExportShaderAttribute : Attribute { } - - public struct SupportedShader - { - public string TargetFolder; - public string ShaderName; - - public SupportedShader(string targetFolder, string shaderName) - { - TargetFolder = targetFolder; - ShaderName = shaderName; - } - } - - public static partial class PreShaderPropExporter - { - static Dictionary m_shaderPropMap; - - public static ShaderProps GetPropsForSupportedShader(string shaderName) - { - if (m_shaderPropMap == null) - { - m_shaderPropMap = new Dictionary(); - foreach (var prop in typeof(PreShaderPropExporter).GetProperties(BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)) - { - if (prop.GetCustomAttributes(typeof(PreExportShaderAttribute), true).Any()) - { - var kv = (KeyValuePair)prop.GetValue(null, null); - m_shaderPropMap.Add(kv.Key, kv.Value); - } - } - } - - ShaderProps props; - if (m_shaderPropMap.TryGetValue(shaderName, out props)) - { - return props; - } - -#if UNITY_EDITOR - // fallback - Debug.LogWarningFormat("{0} is not predefined shader. Use ShaderUtil", shaderName); - var shader = Shader.Find(shaderName); - return ShaderProps.FromShader(shader); -#else - return null; -#endif - } - } -} diff --git a/ShaderProperty/Runtime/PreShaderPropExporter.cs.meta b/ShaderProperty/Runtime/PreShaderPropExporter.cs.meta deleted file mode 100644 index 431e9cc..0000000 --- a/ShaderProperty/Runtime/PreShaderPropExporter.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 50935dd2f9f3fa445a687f30d4dd663b -timeCreated: 1533035131 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/ShaderProperty/Runtime/ShaderProperty.Runtime.asmdef b/ShaderProperty/Runtime/ShaderProperty.Runtime.asmdef deleted file mode 100644 index ed0a498..0000000 --- a/ShaderProperty/Runtime/ShaderProperty.Runtime.asmdef +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "ShaderProperty.Runtime", - "references": [], - "optionalUnityReferences": [], - "includePlatforms": [], - "excludePlatforms": [], - "allowUnsafeCode": false -} \ No newline at end of file diff --git a/ShaderProperty/Runtime/ShaderProperty.Runtime.asmdef.meta b/ShaderProperty/Runtime/ShaderProperty.Runtime.asmdef.meta deleted file mode 100644 index ec0da62..0000000 --- a/ShaderProperty/Runtime/ShaderProperty.Runtime.asmdef.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 301b251fd9834274c9228e0532f444f7 -AssemblyDefinitionImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/ShaderProperty/Runtime/ShaderProps.cs b/ShaderProperty/Runtime/ShaderProps.cs deleted file mode 100644 index 36d9a82..0000000 --- a/ShaderProperty/Runtime/ShaderProps.cs +++ /dev/null @@ -1,67 +0,0 @@ -#if UNITY_EDITOR -using System; -using System.Collections.Generic; -using UnityEditor; -using UnityEngine; -#endif - - -namespace UniGLTF.ShaderPropExporter -{ - public enum ShaderPropertyType - { - TexEnv, - Color, - Range, - Float, - Vector, - } - - public struct ShaderProperty - { - public string Key; - public ShaderPropertyType ShaderPropertyType; - - public ShaderProperty(string key, ShaderPropertyType propType) - { - Key = key; - ShaderPropertyType = propType; - } - } - - public class ShaderProps - { - public ShaderProperty[] Properties; - -#if UNITY_EDITOR - static ShaderPropertyType ConvType(ShaderUtil.ShaderPropertyType src) - { - switch (src) - { - case ShaderUtil.ShaderPropertyType.TexEnv: return ShaderPropertyType.TexEnv; - case ShaderUtil.ShaderPropertyType.Color: return ShaderPropertyType.Color; - case ShaderUtil.ShaderPropertyType.Float: return ShaderPropertyType.Float; - case ShaderUtil.ShaderPropertyType.Range: return ShaderPropertyType.Range; - case ShaderUtil.ShaderPropertyType.Vector: return ShaderPropertyType.Vector; - default: throw new NotImplementedException(); - } - } - - public static ShaderProps FromShader(Shader shader) - { - var properties = new List(); - for (int i = 0; i < ShaderUtil.GetPropertyCount(shader); ++i) - { - var name = ShaderUtil.GetPropertyName(shader, i); - var propType = ShaderUtil.GetPropertyType(shader, i); - properties.Add(new ShaderProperty(name, ConvType(propType))); - } - - return new ShaderProps - { - Properties = properties.ToArray(), - }; - } -#endif - } -} diff --git a/ShaderProperty/Runtime/ShaderProps.cs.meta b/ShaderProperty/Runtime/ShaderProps.cs.meta deleted file mode 100644 index b078bfe..0000000 --- a/ShaderProperty/Runtime/ShaderProps.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 279964035c950b24cb745511298855dd -timeCreated: 1533539330 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/ShaderProperty/Runtime/VRM.meta b/ShaderProperty/Runtime/VRM.meta deleted file mode 100644 index ee92a53..0000000 --- a/ShaderProperty/Runtime/VRM.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 739211b3c46c2264991ea499352ea61e -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/ShaderProperty/Runtime/VRM/PreExportShaders_VRM.cs b/ShaderProperty/Runtime/VRM/PreExportShaders_VRM.cs deleted file mode 100644 index f246304..0000000 --- a/ShaderProperty/Runtime/VRM/PreExportShaders_VRM.cs +++ /dev/null @@ -1,16 +0,0 @@ -namespace UniGLTF.ShaderPropExporter -{ - public static partial class PreExportShaders - { - const string VRM_TARGET_FOLDER = "VRM"; - [PreExportShaders] - public static SupportedShader[] VRMSupportedShaders = new SupportedShader[] - { - new SupportedShader(VRM_TARGET_FOLDER, "VRM/MToon"), - new SupportedShader(VRM_TARGET_FOLDER, "VRM/UnlitTexture"), - new SupportedShader(VRM_TARGET_FOLDER, "VRM/UnlitCutout"), - new SupportedShader(VRM_TARGET_FOLDER, "VRM/UnlitTransparent"), - new SupportedShader(VRM_TARGET_FOLDER, "VRM/UnlitTransparentZWrite"), - }; - } -} diff --git a/ShaderProperty/Runtime/VRM/PreExportShaders_VRM.cs.meta b/ShaderProperty/Runtime/VRM/PreExportShaders_VRM.cs.meta deleted file mode 100644 index d0fd45c..0000000 --- a/ShaderProperty/Runtime/VRM/PreExportShaders_VRM.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 625b5ee8b5811dc4a915a2fbb2cb319d -timeCreated: 1533035131 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/ShaderProperty/Runtime/VRM/VRM_MToon.cs b/ShaderProperty/Runtime/VRM/VRM_MToon.cs deleted file mode 100644 index f5fc6f1..0000000 --- a/ShaderProperty/Runtime/VRM/VRM_MToon.cs +++ /dev/null @@ -1,67 +0,0 @@ -using System.Collections.Generic; - - -namespace UniGLTF.ShaderPropExporter -{ - public static partial class PreShaderPropExporter - { - [PreExportShader] - static KeyValuePair VRM_MToon - { - get - { - return new KeyValuePair( - "VRM/MToon", - new ShaderProps - { - Properties = new ShaderProperty[]{ -new ShaderProperty("_Cutoff", ShaderPropertyType.Range) -,new ShaderProperty("_Color", ShaderPropertyType.Color) -,new ShaderProperty("_ShadeColor", ShaderPropertyType.Color) -,new ShaderProperty("_MainTex", ShaderPropertyType.TexEnv) -,new ShaderProperty("_ShadeTexture", ShaderPropertyType.TexEnv) -,new ShaderProperty("_BumpScale", ShaderPropertyType.Float) -,new ShaderProperty("_BumpMap", ShaderPropertyType.TexEnv) -,new ShaderProperty("_ReceiveShadowRate", ShaderPropertyType.Range) -,new ShaderProperty("_ReceiveShadowTexture", ShaderPropertyType.TexEnv) -,new ShaderProperty("_ShadingGradeRate", ShaderPropertyType.Range) -,new ShaderProperty("_ShadingGradeTexture", ShaderPropertyType.TexEnv) -,new ShaderProperty("_ShadeShift", ShaderPropertyType.Range) -,new ShaderProperty("_ShadeToony", ShaderPropertyType.Range) -,new ShaderProperty("_LightColorAttenuation", ShaderPropertyType.Range) -,new ShaderProperty("_IndirectLightIntensity", ShaderPropertyType.Range) -,new ShaderProperty("_RimColor", ShaderPropertyType.Color) -,new ShaderProperty("_RimTexture", ShaderPropertyType.TexEnv) -,new ShaderProperty("_RimLightingMix", ShaderPropertyType.Range) -,new ShaderProperty("_RimFresnelPower", ShaderPropertyType.Range) -,new ShaderProperty("_RimLift", ShaderPropertyType.Range) -,new ShaderProperty("_SphereAdd", ShaderPropertyType.TexEnv) -,new ShaderProperty("_EmissionColor", ShaderPropertyType.Color) -,new ShaderProperty("_EmissionMap", ShaderPropertyType.TexEnv) -,new ShaderProperty("_OutlineWidthTexture", ShaderPropertyType.TexEnv) -,new ShaderProperty("_OutlineWidth", ShaderPropertyType.Range) -,new ShaderProperty("_OutlineScaledMaxDistance", ShaderPropertyType.Range) -,new ShaderProperty("_OutlineColor", ShaderPropertyType.Color) -,new ShaderProperty("_OutlineLightingMix", ShaderPropertyType.Range) -,new ShaderProperty("_UvAnimMaskTexture", ShaderPropertyType.TexEnv) -,new ShaderProperty("_UvAnimScrollX", ShaderPropertyType.Float) -,new ShaderProperty("_UvAnimScrollY", ShaderPropertyType.Float) -,new ShaderProperty("_UvAnimRotation", ShaderPropertyType.Float) -,new ShaderProperty("_MToonVersion", ShaderPropertyType.Float) -,new ShaderProperty("_DebugMode", ShaderPropertyType.Float) -,new ShaderProperty("_BlendMode", ShaderPropertyType.Float) -,new ShaderProperty("_OutlineWidthMode", ShaderPropertyType.Float) -,new ShaderProperty("_OutlineColorMode", ShaderPropertyType.Float) -,new ShaderProperty("_CullMode", ShaderPropertyType.Float) -,new ShaderProperty("_OutlineCullMode", ShaderPropertyType.Float) -,new ShaderProperty("_SrcBlend", ShaderPropertyType.Float) -,new ShaderProperty("_DstBlend", ShaderPropertyType.Float) -,new ShaderProperty("_ZWrite", ShaderPropertyType.Float) - - } - } - ); - } - } - } -} diff --git a/ShaderProperty/Runtime/VRM/VRM_MToon.cs.meta b/ShaderProperty/Runtime/VRM/VRM_MToon.cs.meta deleted file mode 100644 index 26afcbf..0000000 --- a/ShaderProperty/Runtime/VRM/VRM_MToon.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 4629d794c8969c141a4724e182af082e -timeCreated: 1533542890 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/ShaderProperty/Runtime/VRM/VRM_UnlitCutout.cs b/ShaderProperty/Runtime/VRM/VRM_UnlitCutout.cs deleted file mode 100644 index 8695f72..0000000 --- a/ShaderProperty/Runtime/VRM/VRM_UnlitCutout.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System.Collections.Generic; - - -namespace UniGLTF.ShaderPropExporter -{ - public static partial class PreShaderPropExporter - { - [PreExportShader] - static KeyValuePair VRM_UnlitCutout - { - get - { - return new KeyValuePair( - "VRM/UnlitCutout", - new ShaderProps - { - Properties = new ShaderProperty[]{ -new ShaderProperty("_MainTex", ShaderPropertyType.TexEnv) -,new ShaderProperty("_Cutoff", ShaderPropertyType.Range) - - } - } - ); - } - } - } -} diff --git a/ShaderProperty/Runtime/VRM/VRM_UnlitCutout.cs.meta b/ShaderProperty/Runtime/VRM/VRM_UnlitCutout.cs.meta deleted file mode 100644 index 3f6607d..0000000 --- a/ShaderProperty/Runtime/VRM/VRM_UnlitCutout.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 611b546ea471ad34cb7d94740c63b558 -timeCreated: 1533542890 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/ShaderProperty/Runtime/VRM/VRM_UnlitTexture.cs b/ShaderProperty/Runtime/VRM/VRM_UnlitTexture.cs deleted file mode 100644 index 6a0ab5b..0000000 --- a/ShaderProperty/Runtime/VRM/VRM_UnlitTexture.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.Collections.Generic; - - -namespace UniGLTF.ShaderPropExporter -{ - public static partial class PreShaderPropExporter - { - [PreExportShader] - static KeyValuePair VRM_UnlitTexture - { - get - { - return new KeyValuePair( - "VRM/UnlitTexture", - new ShaderProps - { - Properties = new ShaderProperty[]{ -new ShaderProperty("_MainTex", ShaderPropertyType.TexEnv) - - } - } - ); - } - } - } -} diff --git a/ShaderProperty/Runtime/VRM/VRM_UnlitTexture.cs.meta b/ShaderProperty/Runtime/VRM/VRM_UnlitTexture.cs.meta deleted file mode 100644 index 181adad..0000000 --- a/ShaderProperty/Runtime/VRM/VRM_UnlitTexture.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 22a8083880389b3498f421e6a5c340d5 -timeCreated: 1533542890 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/ShaderProperty/Runtime/VRM/VRM_UnlitTransparent.cs b/ShaderProperty/Runtime/VRM/VRM_UnlitTransparent.cs deleted file mode 100644 index 2c75038..0000000 --- a/ShaderProperty/Runtime/VRM/VRM_UnlitTransparent.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.Collections.Generic; - - -namespace UniGLTF.ShaderPropExporter -{ - public static partial class PreShaderPropExporter - { - [PreExportShader] - static KeyValuePair VRM_UnlitTransparent - { - get - { - return new KeyValuePair( - "VRM/UnlitTransparent", - new ShaderProps - { - Properties = new ShaderProperty[]{ -new ShaderProperty("_MainTex", ShaderPropertyType.TexEnv) - - } - } - ); - } - } - } -} diff --git a/ShaderProperty/Runtime/VRM/VRM_UnlitTransparent.cs.meta b/ShaderProperty/Runtime/VRM/VRM_UnlitTransparent.cs.meta deleted file mode 100644 index eeaf3b8..0000000 --- a/ShaderProperty/Runtime/VRM/VRM_UnlitTransparent.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 140d6538826e0eb448929d3e4bb2f1cd -timeCreated: 1533542890 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/ShaderProperty/Runtime/VRM/VRM_UnlitTransparentZWrite.cs b/ShaderProperty/Runtime/VRM/VRM_UnlitTransparentZWrite.cs deleted file mode 100644 index 8d03c4e..0000000 --- a/ShaderProperty/Runtime/VRM/VRM_UnlitTransparentZWrite.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.Collections.Generic; - - -namespace UniGLTF.ShaderPropExporter -{ - public static partial class PreShaderPropExporter - { - [PreExportShader] - static KeyValuePair VRM_UnlitTransparentZWrite - { - get - { - return new KeyValuePair( - "VRM/UnlitTransparentZWrite", - new ShaderProps - { - Properties = new ShaderProperty[]{ -new ShaderProperty("_MainTex", ShaderPropertyType.TexEnv) - - } - } - ); - } - } - } -} diff --git a/ShaderProperty/Runtime/VRM/VRM_UnlitTransparentZWrite.cs.meta b/ShaderProperty/Runtime/VRM/VRM_UnlitTransparentZWrite.cs.meta deleted file mode 100644 index 6efeb43..0000000 --- a/ShaderProperty/Runtime/VRM/VRM_UnlitTransparentZWrite.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 165ec79b7aac1564a850fb3d3d19396e -timeCreated: 1533542890 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/UniUnlit.meta b/UniUnlit.meta deleted file mode 100644 index e6cb092..0000000 --- a/UniUnlit.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 5c080e3c6825a3741a9cbc3e7ec8325a -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/UniUnlit/Editor.meta b/UniUnlit/Editor.meta deleted file mode 100644 index c2a7715..0000000 --- a/UniUnlit/Editor.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 5f2065a60bc4c5b4e815354d52f4e318 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/UniUnlit/Editor/UniUnlit.Editor.asmdef b/UniUnlit/Editor/UniUnlit.Editor.asmdef deleted file mode 100644 index 564a54c..0000000 --- a/UniUnlit/Editor/UniUnlit.Editor.asmdef +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "UniUnlit.Editor", - "references": [ - "UniUnlit" - ], - "optionalUnityReferences": [], - "includePlatforms": [ - "Editor" - ], - "excludePlatforms": [], - "allowUnsafeCode": false -} \ No newline at end of file diff --git a/UniUnlit/Editor/UniUnlit.Editor.asmdef.meta b/UniUnlit/Editor/UniUnlit.Editor.asmdef.meta deleted file mode 100644 index 43cedc3..0000000 --- a/UniUnlit/Editor/UniUnlit.Editor.asmdef.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 529ce3a240c1a7a4bbbb220bbd59686b -AssemblyDefinitionImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/UniUnlit/Editor/UniUnlitEditor.cs b/UniUnlit/Editor/UniUnlitEditor.cs deleted file mode 100644 index 326f129..0000000 --- a/UniUnlit/Editor/UniUnlitEditor.cs +++ /dev/null @@ -1,159 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using UnityEditor; -using UnityEngine; -using UnityEngine.Rendering; - - -namespace UniGLTF.UniUnlit -{ - public class UniUnlitEditor : ShaderGUI - { - private MaterialProperty _mainTex; - private MaterialProperty _color; - private MaterialProperty _cutoff; - private MaterialProperty _blendMode; - private MaterialProperty _cullMode; - private MaterialProperty _vColBlendMode; -// private MaterialProperty _srcBlend; -// private MaterialProperty _dstBlend; -// private MaterialProperty _zWrite; - - public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] properties) - { - _mainTex = FindProperty(Utils.PropNameMainTex, properties); - _color = FindProperty(Utils.PropNameColor, properties); - _cutoff = FindProperty(Utils.PropNameCutoff, properties); - _blendMode = FindProperty(Utils.PropNameBlendMode, properties); - _cullMode = FindProperty(Utils.PropNameCullMode, properties); - _vColBlendMode = FindProperty(Utils.PropNameVColBlendMode, properties); -// _srcBlend = FindProperty(PropNameSrcBlend, properties); -// _dstBlend = FindProperty(PropNameDstBlend, properties); -// _zWrite = FindProperty(PropNameZWrite, properties); - - var materials = materialEditor.targets.Select(x => x as Material).ToArray(); - - EditorGUI.BeginChangeCheck(); - { - DrawRenderingBox(materialEditor, materials); - DrawColorBox(materialEditor, materials); - DrawOptionsBox(materialEditor, materials); - } - EditorGUI.EndChangeCheck(); - } - - public override void AssignNewShaderToMaterial(Material material, Shader oldShader, Shader newShader) - { - var blendMode = UniUnlitRenderMode.Opaque; - if (material.HasProperty(Utils.PropNameStandardShadersRenderMode)) // from Standard shader - { - blendMode = (UniUnlitRenderMode) Math.Min(2f, material.GetFloat(Utils.PropNameStandardShadersRenderMode)); - } - - // assigns UniUnlit's properties... - base.AssignNewShaderToMaterial(material, oldShader, newShader); - - // take over old value - material.SetFloat(Utils.PropNameBlendMode, (float) blendMode); - - Utils.ValidateProperties(material, isRenderModeChangedByUser: true); - } - - private void DrawRenderingBox(MaterialEditor materialEditor, Material[] materials) - { - EditorGUILayout.LabelField("Rendering", EditorStyles.boldLabel); - EditorGUILayout.BeginVertical(GUI.skin.box); - { - if (PopupEnum("Rendering Type", _blendMode, materialEditor)) - { - ModeChanged(materials, isRenderModeChangedByUser: true); - } - if (PopupEnum("Cull Mode", _cullMode, materialEditor)) - { - ModeChanged(materials, isRenderModeChangedByUser: true); - } - EditorGUILayout.Space(); - - switch ((UniUnlitRenderMode) _blendMode.floatValue) - { - case UniUnlitRenderMode.Cutout: - materialEditor.ShaderProperty(_cutoff, "Cutoff"); - break; - case UniUnlitRenderMode.Opaque: - case UniUnlitRenderMode.Transparent: - break; - } - } - EditorGUILayout.EndVertical(); - EditorGUILayout.Space(); - } - - private void DrawColorBox(MaterialEditor materialEditor, Material[] materials) - { - EditorGUILayout.LabelField("Color", EditorStyles.boldLabel); - EditorGUILayout.BeginVertical(GUI.skin.box); - { - materialEditor.TexturePropertySingleLine(new GUIContent("Main Tex", "(RGBA)"), _mainTex, _color); - materialEditor.TextureScaleOffsetProperty(_mainTex); - EditorGUILayout.Space(); - - if (PopupEnum("Vertex Color Blend Mode", _vColBlendMode, materialEditor)) - { - ModeChanged(materials, isRenderModeChangedByUser: true); - } - } - EditorGUILayout.EndVertical(); - EditorGUILayout.Space(); - } - - private void DrawOptionsBox(MaterialEditor materialEditor, Material[] materials) - { - EditorGUILayout.LabelField("Options", EditorStyles.boldLabel); - EditorGUILayout.BeginVertical(GUI.skin.box); - { - #if UNITY_5_6_OR_NEWER -// materialEditor.EnableInstancingField(); - materialEditor.DoubleSidedGIField(); - #endif - materialEditor.RenderQueueField(); - } - EditorGUILayout.EndVertical(); - EditorGUILayout.Space(); - } - - private static bool PopupEnum(string name, MaterialProperty property, MaterialEditor editor) where T : struct - { - if (!typeof(T).IsEnum) return false; - - EditorGUI.showMixedValue = property.hasMixedValue; - EditorGUI.BeginChangeCheck(); - var values = (T[]) Enum.GetValues(typeof(T)); - var names = Enum.GetNames(typeof(T)); - - var currInt = (int) property.floatValue; - var currValue = (T) Enum.ToObject(typeof(T), currInt); - var currIndex = Array.IndexOf(values, currValue); - var nextIndex = EditorGUILayout.Popup(name, currIndex, names); - var changed = EditorGUI.EndChangeCheck(); - if (changed) - { - editor.RegisterPropertyChangeUndo("EnumPopUp"); - var nextValue = values[nextIndex]; - var nextInt = (int) (object) nextValue; - property.floatValue = nextInt; - } - EditorGUI.showMixedValue = false; - return changed; - } - - - private static void ModeChanged(Material[] materials, bool isRenderModeChangedByUser = false) - { - foreach (var material in materials) - { - Utils.ValidateProperties(material, isRenderModeChangedByUser); - } - } - } -} diff --git a/UniUnlit/Editor/UniUnlitEditor.cs.meta b/UniUnlit/Editor/UniUnlitEditor.cs.meta deleted file mode 100644 index 7d35d3e..0000000 --- a/UniUnlit/Editor/UniUnlitEditor.cs.meta +++ /dev/null @@ -1,12 +0,0 @@ -fileFormatVersion: 2 -guid: 4c70714358bb2fb4fa96ef08640763fd -timeCreated: 1514224771 -licenseType: Free -MonoImporter: - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/UniUnlit/LICENSE.md b/UniUnlit/LICENSE.md deleted file mode 100644 index 3f1fd54..0000000 --- a/UniUnlit/LICENSE.md +++ /dev/null @@ -1,23 +0,0 @@ -MIT License - -Copyright (c) 2018 DWANGO Co., Ltd. for UniVRM -Copyright (c) 2018 ousttrue for UniGLTF, UniHumanoid -Copyright (c) 2018 Masataka SUMI for MToon - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/UniUnlit/LICENSE.md.meta b/UniUnlit/LICENSE.md.meta deleted file mode 100644 index 69f26c9..0000000 --- a/UniUnlit/LICENSE.md.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: a03883f24bf59d849b53cdcf51424f1c -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/UniUnlit/Runtime.meta b/UniUnlit/Runtime.meta deleted file mode 100644 index acf4701..0000000 --- a/UniUnlit/Runtime.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 6fd1283bc6ab0fe4495d668a5f70818e -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/UniUnlit/Runtime/Resources.meta b/UniUnlit/Runtime/Resources.meta deleted file mode 100644 index 302947a..0000000 --- a/UniUnlit/Runtime/Resources.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 5540f51c95a48f144ba1bc3983554196 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/UniUnlit/Runtime/Resources/UniUnlit.shader b/UniUnlit/Runtime/Resources/UniUnlit.shader deleted file mode 100644 index 2e2466a..0000000 --- a/UniUnlit/Runtime/Resources/UniUnlit.shader +++ /dev/null @@ -1,101 +0,0 @@ -Shader "UniGLTF/UniUnlit" -{ - Properties - { - _MainTex ("Texture", 2D) = "white" {} - _Color ("Main Color", COLOR) = (1,1,1,1) - _Cutoff ("Alpha Cutoff", Range(0, 1)) = 0.5 - - [HideInInspector] _BlendMode ("_BlendMode", Float) = 0.0 - [HideInInspector] _CullMode ("_CullMode", Float) = 2.0 - [HideInInspector] _VColBlendMode ("_VColBlendMode", Float) = 0.0 - [HideInInspector] _SrcBlend ("_SrcBlend", Float) = 1.0 - [HideInInspector] _DstBlend ("_DstBlend", Float) = 0.0 - [HideInInspector] _ZWrite ("_ZWrite", Float) = 1.0 - - // VertexColor - } - SubShader - { - Tags { "RenderType"="Opaque" } - LOD 100 - - Pass - { - Cull [_CullMode] - Blend [_SrcBlend] [_DstBlend] - ZWrite [_ZWrite] - ZTest LEqual - BlendOp Add, Max - - CGPROGRAM - #pragma vertex vert - #pragma fragment frag - #pragma multi_compile_fog - #pragma multi_compile _ _ALPHATEST_ON _ALPHABLEND_ON - #pragma multi_compile _ _VERTEXCOL_MUL - - #include "UnityCG.cginc" - - struct appdata - { - float4 vertex : POSITION; - float2 uv : TEXCOORD0; - #if defined(_VERTEXCOL_MUL) - fixed4 color : COLOR; - #endif - }; - - struct v2f - { - float4 vertex : SV_POSITION; - float2 uv : TEXCOORD0; - UNITY_FOG_COORDS(1) - #if defined(_VERTEXCOL_MUL) - fixed4 color : COLOR; - #endif - }; - - sampler2D _MainTex; - float4 _MainTex_ST; - half4 _Color; - half _Cutoff; - - v2f vert (appdata v) - { - v2f o; - o.vertex = UnityObjectToClipPos(v.vertex); - o.uv = TRANSFORM_TEX(v.uv, _MainTex); - UNITY_TRANSFER_FOG(o,o.vertex); - - #if defined(_VERTEXCOL_MUL) - o.color = v.color; - #endif - return o; - } - - fixed4 frag (v2f i) : SV_Target - { - fixed4 col = tex2D(_MainTex, i.uv) * _Color; - - #if defined(_VERTEXCOL_MUL) - col *= i.color; - #endif - - #if defined(_ALPHATEST_ON) - clip(col.a - _Cutoff); - #endif - - #if !defined(_ALPHATEST_ON) && !defined(_ALPHABLEND_ON) - col.a = 1.0; - #endif - - UNITY_APPLY_FOG(i.fogCoord, col); - return col; - } - ENDCG - } - } - CustomEditor "UniGLTF.UniUnlit.UniUnlitEditor" - Fallback "Unlit/Texture" -} diff --git a/UniUnlit/Runtime/Resources/UniUnlit.shader.meta b/UniUnlit/Runtime/Resources/UniUnlit.shader.meta deleted file mode 100644 index 750c8ab..0000000 --- a/UniUnlit/Runtime/Resources/UniUnlit.shader.meta +++ /dev/null @@ -1,9 +0,0 @@ -fileFormatVersion: 2 -guid: 8c17b56f4bf084c47872edcb95237e4a -timeCreated: 1535616926 -licenseType: Free -ShaderImporter: - defaultTextures: [] - userData: - assetBundleName: - assetBundleVariant: diff --git a/UniUnlit/Runtime/Scripts.meta b/UniUnlit/Runtime/Scripts.meta deleted file mode 100644 index 862a545..0000000 --- a/UniUnlit/Runtime/Scripts.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: b19f3d26eec098d46a33d8d35ba2eab5 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/UniUnlit/Runtime/Scripts/Utils.cs b/UniUnlit/Runtime/Scripts/Utils.cs deleted file mode 100644 index 0987006..0000000 --- a/UniUnlit/Runtime/Scripts/Utils.cs +++ /dev/null @@ -1,147 +0,0 @@ -using System; -using UnityEngine; -using UnityEngine.Rendering; - -namespace UniGLTF.UniUnlit -{ - public enum UniUnlitRenderMode - { - Opaque = 0, - Cutout = 1, - Transparent = 2, - } - - public enum UniUnlitCullMode - { - Off = 0, -// Front = 1, - Back = 2, - } - - public enum UniUnlitVertexColorBlendOp - { - None = 0, - Multiply = 1, - } - - public static class Utils - { - public const string PropNameMainTex = "_MainTex"; - public const string PropNameColor = "_Color"; - public const string PropNameCutoff = "_Cutoff"; - public const string PropNameBlendMode = "_BlendMode"; - public const string PropNameCullMode = "_CullMode"; - [Obsolete("Use PropNameVColBlendMode")] - public const string PropeNameVColBlendMode = PropNameVColBlendMode; - public const string PropNameVColBlendMode = "_VColBlendMode"; - public const string PropNameSrcBlend = "_SrcBlend"; - public const string PropNameDstBlend = "_DstBlend"; - public const string PropNameZWrite = "_ZWrite"; - - public const string PropNameStandardShadersRenderMode = "_Mode"; - - public const string KeywordAlphaTestOn = "_ALPHATEST_ON"; - public const string KeywordAlphaBlendOn = "_ALPHABLEND_ON"; - public const string KeywordVertexColMul = "_VERTEXCOL_MUL"; - - public const string TagRenderTypeKey = "RenderType"; - public const string TagRenderTypeValueOpaque = "Opaque"; - public const string TagRenderTypeValueTransparentCutout = "TransparentCutout"; - public const string TagRenderTypeValueTransparent = "Transparent"; - - public static void SetRenderMode(Material material, UniUnlitRenderMode mode) - { - material.SetInt(PropNameBlendMode, (int)mode); - } - - public static void SetCullMode(Material material, UniUnlitCullMode mode) - { - material.SetInt(PropNameCullMode, (int) mode); - } - - public static void SetVColBlendMode(Material material, UniUnlitVertexColorBlendOp mode) - { - material.SetInt(PropNameVColBlendMode, (int)mode); - } - - public static UniUnlitRenderMode GetRenderMode(Material material) - { - return (UniUnlitRenderMode)material.GetInt(PropNameBlendMode); - } - - public static UniUnlitCullMode GetCullMode(Material material) - { - return (UniUnlitCullMode)material.GetInt(PropNameCullMode); - } - - /// - /// Validate target material's UniUnlitRenderMode, UniUnlitVertexColorBlendOp. - /// Set appropriate hidden properties & keywords. - /// This will change RenderQueue independent to UniUnlitRenderMode if isRenderModeChangedByUser is true. - /// - /// Target material - /// Is changed by user - public static void ValidateProperties(Material material, bool isRenderModeChangedByUser = false) - { - SetupBlendMode(material, (UniUnlitRenderMode)material.GetFloat(PropNameBlendMode), - isRenderModeChangedByUser); - SetupVertexColorBlendOp(material, (UniUnlitVertexColorBlendOp)material.GetFloat(PropNameVColBlendMode)); - } - - private static void SetupBlendMode(Material material, UniUnlitRenderMode renderMode, - bool isRenderModeChangedByUser = false) - { - switch (renderMode) - { - case UniUnlitRenderMode.Opaque: - material.SetOverrideTag(TagRenderTypeKey, TagRenderTypeValueOpaque); - material.SetInt(PropNameSrcBlend, (int)BlendMode.One); - material.SetInt(PropNameDstBlend, (int)BlendMode.Zero); - material.SetInt(PropNameZWrite, 1); - SetKeyword(material, KeywordAlphaTestOn, false); - SetKeyword(material, KeywordAlphaBlendOn, false); - if (isRenderModeChangedByUser) material.renderQueue = -1; - break; - case UniUnlitRenderMode.Cutout: - material.SetOverrideTag(TagRenderTypeKey, TagRenderTypeValueTransparentCutout); - material.SetInt(PropNameSrcBlend, (int)BlendMode.One); - material.SetInt(PropNameDstBlend, (int)BlendMode.Zero); - material.SetInt(PropNameZWrite, 1); - SetKeyword(material, KeywordAlphaTestOn, true); - SetKeyword(material, KeywordAlphaBlendOn, false); - if (isRenderModeChangedByUser) material.renderQueue = (int)RenderQueue.AlphaTest; - break; - case UniUnlitRenderMode.Transparent: - material.SetOverrideTag(TagRenderTypeKey, TagRenderTypeValueTransparent); - material.SetInt(PropNameSrcBlend, (int)BlendMode.SrcAlpha); - material.SetInt(PropNameDstBlend, (int)BlendMode.OneMinusSrcAlpha); - material.SetInt(PropNameZWrite, 0); - SetKeyword(material, KeywordAlphaTestOn, false); - SetKeyword(material, KeywordAlphaBlendOn, true); - if (isRenderModeChangedByUser) material.renderQueue = (int)RenderQueue.Transparent; - break; - } - } - - private static void SetupVertexColorBlendOp(Material material, UniUnlitVertexColorBlendOp vColBlendOp) - { - switch (vColBlendOp) - { - case UniUnlitVertexColorBlendOp.None: - SetKeyword(material, KeywordVertexColMul, false); - break; - case UniUnlitVertexColorBlendOp.Multiply: - SetKeyword(material, KeywordVertexColMul, true); - break; - } - } - - private static void SetKeyword(Material mat, string keyword, bool required) - { - if (required) - mat.EnableKeyword(keyword); - else - mat.DisableKeyword(keyword); - } - } -} \ No newline at end of file diff --git a/UniUnlit/Runtime/Scripts/Utils.cs.meta b/UniUnlit/Runtime/Scripts/Utils.cs.meta deleted file mode 100644 index 7824f08..0000000 --- a/UniUnlit/Runtime/Scripts/Utils.cs.meta +++ /dev/null @@ -1,3 +0,0 @@ -fileFormatVersion: 2 -guid: e96cbbd810384352a6799dd731533178 -timeCreated: 1537534399 \ No newline at end of file diff --git a/UniUnlit/Runtime/UniUnlit.asmdef b/UniUnlit/Runtime/UniUnlit.asmdef deleted file mode 100644 index e58648d..0000000 --- a/UniUnlit/Runtime/UniUnlit.asmdef +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name": "UniUnlit" -} diff --git a/UniUnlit/Runtime/UniUnlit.asmdef.meta b/UniUnlit/Runtime/UniUnlit.asmdef.meta deleted file mode 100644 index 4d059ab..0000000 --- a/UniUnlit/Runtime/UniUnlit.asmdef.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 60c8346e00a8ddd4cafc5a02eceeec57 -AssemblyDefinitionImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/UniVgo/Runtime/VgoVersion.cs b/UniVgo/Runtime/VgoVersion.cs index a80d019..fd50250 100644 --- a/UniVgo/Runtime/VgoVersion.cs +++ b/UniVgo/Runtime/VgoVersion.cs @@ -16,9 +16,9 @@ public class VgoVersion public const int MINOR = 8; /// Patch - public const int PATCH = 1; + public const int PATCH = 2; /// Version - public const string VERSION = "0.8.1"; + public const string VERSION = "0.8.2"; } } diff --git a/package.json b/package.json index 58de950..cb6ff52 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "izayoi.univgo", "displayName": "UniVGO", "description": "UniVGO is a package that can handle VGO files in Unity.", - "version": "0.8.1-preview", + "version": "0.8.2-preview", "type": "tool", "category": "", "keywords": [ @@ -18,8 +18,8 @@ "mtoon", "vgo" ], - "unity": "2018.3", - "unityRelease": "14f1", + "unity": "2018.4", + "unityRelease": "24f1", "author": { "name" : "Izayoi Jiichan" }, @@ -32,6 +32,7 @@ "url": "git+https://github.com/izayoijiichan/VGO.git" }, "dependencies": { + "com.vrmc.vrmshaders": "0.56.1", "jillejr.newtonsoft.json-for-unity": "12.0.301" } } \ No newline at end of file