diff --git a/Assets/VRMShaders/VRM/MToon b/Assets/VRMShaders/VRM/MToon deleted file mode 160000 index 42b0316345..0000000000 --- a/Assets/VRMShaders/VRM/MToon +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 42b03163459ac8e6b7aee08070d0f4f912035069 diff --git a/Assets/VRMShaders/VRM/MToon/.gitignore b/Assets/VRMShaders/VRM/MToon/.gitignore new file mode 100644 index 0000000000..eb83a8f122 --- /dev/null +++ b/Assets/VRMShaders/VRM/MToon/.gitignore @@ -0,0 +1,34 @@ +/[Ll]ibrary/ +/[Tt]emp/ +/[Oo]bj/ +/[Bb]uild/ +/[Bb]uilds/ +/Assets/AssetStoreTools* + +# Visual Studio 2015 cache directory +/.vs/ + +# Autogenerated VS/MD/Consulo solution and project files +ExportedObj/ +.consulo/ +*.csproj +*.unityproj +*.sln +*.suo +*.tmp +*.user +*.userprefs +*.pidb +*.booproj +*.svd +*.pdb + +# Unity3D generated meta files +*.pidb.meta + +# Unity3D Generated File On Crash Reports +sysinfo.txt + +# Builds +*.apk +*.unitypackage diff --git a/Assets/VRMShaders/VRM/MToon/LICENSE b/Assets/VRMShaders/VRM/MToon/LICENSE new file mode 100644 index 0000000000..2b51a7fbc0 --- /dev/null +++ b/Assets/VRMShaders/VRM/MToon/LICENSE @@ -0,0 +1,21 @@ +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/Assets/VRMShaders/VRM/MToon/LICENSE.meta b/Assets/VRMShaders/VRM/MToon/LICENSE.meta new file mode 100644 index 0000000000..be5656a1d0 --- /dev/null +++ b/Assets/VRMShaders/VRM/MToon/LICENSE.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 2a5e8a5d481e3574b8274fa7ce4bdc2d +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/VRMShaders/VRM/MToon/MToon.meta b/Assets/VRMShaders/VRM/MToon/MToon.meta new file mode 100644 index 0000000000..b5340c31d0 --- /dev/null +++ b/Assets/VRMShaders/VRM/MToon/MToon.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 029f110c597b25547ab35b6ed3fc049d +folderAsset: yes +timeCreated: 1520006778 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/VRMShaders/VRM/MToon/MToon/Editor.meta b/Assets/VRMShaders/VRM/MToon/MToon/Editor.meta new file mode 100644 index 0000000000..59203d1fc2 --- /dev/null +++ b/Assets/VRMShaders/VRM/MToon/MToon/Editor.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 1b669562c8ecaee4c98c808d3971271b +folderAsset: yes +timeCreated: 1514224760 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/VRMShaders/VRM/MToon/MToon/Editor/EditorEnums.cs b/Assets/VRMShaders/VRM/MToon/MToon/Editor/EditorEnums.cs new file mode 100644 index 0000000000..5ad360a476 --- /dev/null +++ b/Assets/VRMShaders/VRM/MToon/MToon/Editor/EditorEnums.cs @@ -0,0 +1,9 @@ +namespace MToon +{ + public enum EditorRotationUnit + { + Rounds = 0, + Degrees = 1, + Radians = 2, + } +} \ No newline at end of file diff --git a/Assets/VRMShaders/VRM/MToon/MToon/Editor/EditorEnums.cs.meta b/Assets/VRMShaders/VRM/MToon/MToon/Editor/EditorEnums.cs.meta new file mode 100644 index 0000000000..e31fd65363 --- /dev/null +++ b/Assets/VRMShaders/VRM/MToon/MToon/Editor/EditorEnums.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 24156f9da0724eb5a159f36c69a7d90a +timeCreated: 1560622066 \ No newline at end of file diff --git a/Assets/VRMShaders/VRM/MToon/MToon/Editor/EditorUtils.cs b/Assets/VRMShaders/VRM/MToon/MToon/Editor/EditorUtils.cs new file mode 100644 index 0000000000..6e20bb166d --- /dev/null +++ b/Assets/VRMShaders/VRM/MToon/MToon/Editor/EditorUtils.cs @@ -0,0 +1,61 @@ +using System.IO; +using System.Text.RegularExpressions; +using UnityEditor; +using UnityEngine; + +namespace MToon +{ + public static 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/Assets/VRMShaders/VRM/MToon/MToon/Editor/EditorUtils.cs.meta b/Assets/VRMShaders/VRM/MToon/MToon/Editor/EditorUtils.cs.meta new file mode 100644 index 0000000000..334cf67a21 --- /dev/null +++ b/Assets/VRMShaders/VRM/MToon/MToon/Editor/EditorUtils.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 531922bb16b74a00b81445116c49b09c +timeCreated: 1559719559 \ No newline at end of file diff --git a/Assets/VRMShaders/VRM/MToon/MToon/Editor/MToon.Editor.asmdef b/Assets/VRMShaders/VRM/MToon/MToon/Editor/MToon.Editor.asmdef new file mode 100644 index 0000000000..0adfbf1e3e --- /dev/null +++ b/Assets/VRMShaders/VRM/MToon/MToon/Editor/MToon.Editor.asmdef @@ -0,0 +1,17 @@ +{ + "name": "MToon.Editor", + "references": [ + "GUID:a9bc101fb0471f94a8f99fd242fdd934" + ], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": false, + "defineConstraints": [], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Assets/VRMShaders/VRM/MToon/MToon/Editor/MToon.Editor.asmdef.meta b/Assets/VRMShaders/VRM/MToon/MToon/Editor/MToon.Editor.asmdef.meta new file mode 100644 index 0000000000..57face7642 --- /dev/null +++ b/Assets/VRMShaders/VRM/MToon/MToon/Editor/MToon.Editor.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: dddf8398e965f254cae2d7519d7f67d2 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/VRMShaders/VRM/MToon/MToon/Editor/MToonInspector.cs b/Assets/VRMShaders/VRM/MToon/MToon/Editor/MToonInspector.cs new file mode 100644 index 0000000000..871cb44aaa --- /dev/null +++ b/Assets/VRMShaders/VRM/MToon/MToon/Editor/MToonInspector.cs @@ -0,0 +1,459 @@ +using System; +using System.Linq; +using UnityEditor; +using UnityEngine; +using UnityEngine.Rendering; + +namespace MToon +{ + public class MToonInspector : ShaderGUI + { + private const float RoundsToDegree = 360f; + private const float RoundsToRadian = (float) Math.PI * 2f; + + private static bool isAdvancedLightingPanelFoldout = false; + private static EditorRotationUnit editorRotationUnit = EditorRotationUnit.Rounds; + + 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)"); + + { + var control = EditorGUILayout.GetControlRect(hasLabel: true); + const int popupMargin = 5; + const int popupWidth = 80; + + var floatControl = new Rect(control); + floatControl.width -= popupMargin + popupWidth; + var popupControl = new Rect(control); + popupControl.x = floatControl.x + floatControl.width + popupMargin; + popupControl.width = popupWidth; + + EditorGUI.BeginChangeCheck(); + var inspectorRotationValue = GetInspectorRotationValue(editorRotationUnit, _uvAnimRotation.floatValue); + inspectorRotationValue = EditorGUI.FloatField(floatControl, "Rotation value (per second)", inspectorRotationValue); + if (EditorGUI.EndChangeCheck()) + { + materialEditor.RegisterPropertyChangeUndo("UvAnimRotationValueChanged"); + _uvAnimRotation.floatValue = GetRawRotationValue(editorRotationUnit, inspectorRotationValue); + } + editorRotationUnit = (EditorRotationUnit) EditorGUI.EnumPopup(popupControl, editorRotationUnit); + } + } + } + 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); + + } + + private static float GetRawRotationValue(EditorRotationUnit unit, float inspectorValue) + { + switch (unit) + { + case EditorRotationUnit.Rounds: + return inspectorValue; + case EditorRotationUnit.Degrees: + return inspectorValue / RoundsToDegree; + case EditorRotationUnit.Radians: + return inspectorValue / RoundsToRadian; + default: + throw new ArgumentOutOfRangeException(); + } + } + + private static float GetInspectorRotationValue(EditorRotationUnit unit, float rawValue) + { + switch (unit) + { + case EditorRotationUnit.Rounds: + return rawValue; + case EditorRotationUnit.Degrees: + return rawValue * RoundsToDegree; + case EditorRotationUnit.Radians: + return rawValue * RoundsToRadian; + default: + throw new ArgumentOutOfRangeException(); + } + } + } +} \ No newline at end of file diff --git a/Assets/VRMShaders/VRM/MToon/MToon/Editor/MToonInspector.cs.meta b/Assets/VRMShaders/VRM/MToon/MToon/Editor/MToonInspector.cs.meta new file mode 100644 index 0000000000..cfe6932185 --- /dev/null +++ b/Assets/VRMShaders/VRM/MToon/MToon/Editor/MToonInspector.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 8b43baa9f62f04748bb167ad186f1b1a +timeCreated: 1514224771 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/VRMShaders/VRM/MToon/MToon/MToon.asmdef b/Assets/VRMShaders/VRM/MToon/MToon/MToon.asmdef new file mode 100644 index 0000000000..647303ff70 --- /dev/null +++ b/Assets/VRMShaders/VRM/MToon/MToon/MToon.asmdef @@ -0,0 +1,12 @@ +{ + "name": "MToon", + "references": [], + "optionalUnityReferences": [], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": false, + "defineConstraints": [] +} \ No newline at end of file diff --git a/Assets/VRMShaders/VRM/MToon/MToon/MToon.asmdef.meta b/Assets/VRMShaders/VRM/MToon/MToon/MToon.asmdef.meta new file mode 100644 index 0000000000..4daa4ce35d --- /dev/null +++ b/Assets/VRMShaders/VRM/MToon/MToon/MToon.asmdef.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: a9bc101fb0471f94a8f99fd242fdd934 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/VRMShaders/VRM/MToon/MToon/Resources.meta b/Assets/VRMShaders/VRM/MToon/MToon/Resources.meta new file mode 100644 index 0000000000..f1a215fddd --- /dev/null +++ b/Assets/VRMShaders/VRM/MToon/MToon/Resources.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9491ac346386a2b4e9f3c801c6786818 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/VRMShaders/VRM/MToon/MToon/Resources/Shaders.meta b/Assets/VRMShaders/VRM/MToon/MToon/Resources/Shaders.meta new file mode 100644 index 0000000000..09aef816d2 --- /dev/null +++ b/Assets/VRMShaders/VRM/MToon/MToon/Resources/Shaders.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 221dcd8025c13ab42a51e886d7a7a92e +folderAsset: yes +timeCreated: 1516295202 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/VRMShaders/VRM/MToon/MToon/Resources/Shaders/MToon.shader b/Assets/VRMShaders/VRM/MToon/MToon/Resources/Shaders/MToon.shader new file mode 100644 index 0000000000..df0f7fe89e --- /dev/null +++ b/Assets/VRMShaders/VRM/MToon/MToon/Resources/Shaders/MToon.shader @@ -0,0 +1,166 @@ +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) = 39 + [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 + [HideInInspector] _AlphaToMask ("_AlphaToMask", Float) = 0.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 + AlphaToMask [_AlphaToMask] + + 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 + AlphaToMask [_AlphaToMask] + + 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 + AlphaToMask [_AlphaToMask] + + 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/Assets/VRMShaders/VRM/MToon/MToon/Resources/Shaders/MToon.shader.meta b/Assets/VRMShaders/VRM/MToon/MToon/Resources/Shaders/MToon.shader.meta new file mode 100644 index 0000000000..dfa84505f7 --- /dev/null +++ b/Assets/VRMShaders/VRM/MToon/MToon/Resources/Shaders/MToon.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 1a97144e4ad27a04aafd70f7b915cedb +timeCreated: 1514111466 +licenseType: Free +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/VRMShaders/VRM/MToon/MToon/Resources/Shaders/MToonCore.cginc b/Assets/VRMShaders/VRM/MToon/MToon/Resources/Shaders/MToonCore.cginc new file mode 100644 index 0000000000..38c5d9c1c4 --- /dev/null +++ b/Assets/VRMShaders/VRM/MToon/MToon/Resources/Shaders/MToonCore.cginc @@ -0,0 +1,283 @@ +#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; +// NOTE: "tex2d() * _Time.y" returns mediump value if sampler is half precision in Android VR platform +sampler2D_float _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) + UNITY_SHADOW_COORDS(8) + //UNITY_VERTEX_INPUT_INSTANCE_ID // necessary only if any instanced properties are going to be accessed in the fragment Shader. + UNITY_VERTEX_OUTPUT_STEREO +}; + +inline v2f InitializeV2F(appdata_full v, float4 projectedVertex, float isOutline) +{ + v2f o; + UNITY_INITIALIZE_OUTPUT(v2f, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + //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; + UNITY_TRANSFER_SHADOW(o, o._ShadowCoord); + 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); + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i); + + // const + const float PI_2 = 6.28318530718; + const float EPS_COL = 0.00001; + + // uv + float2 mainUv = TRANSFORM_TEX(i.uv0, _MainTex); + + // uv anim + float 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; + alpha = (alpha - _Cutoff) / max(fwidth(alpha), EPS_COL) + 0.5; // Alpha to Coverage + clip(alpha - _Cutoff); + alpha = 1.0; // Discarded, otherwise it should be assumed to have full opacity +#endif +#ifdef _ALPHABLEND_ON + alpha = _Color.a * mainTex.a; +#if !_ALPHATEST_ON && SHADER_API_D3D11 // Only enable this on D3D11, where I tested it + clip(alpha - 0.0001); // Slightly improves rendering with layered transparency +#endif +#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), max(_RimFresnelPower, EPS_COL)) * _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/Assets/VRMShaders/VRM/MToon/MToon/Resources/Shaders/MToonCore.cginc.meta b/Assets/VRMShaders/VRM/MToon/MToon/Resources/Shaders/MToonCore.cginc.meta new file mode 100644 index 0000000000..6b68091699 --- /dev/null +++ b/Assets/VRMShaders/VRM/MToon/MToon/Resources/Shaders/MToonCore.cginc.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: ef6682d138947ed4fbc8fbecfe75cd28 +timeCreated: 1514120022 +licenseType: Free +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/VRMShaders/VRM/MToon/MToon/Resources/Shaders/MToonSM3.cginc b/Assets/VRMShaders/VRM/MToon/MToon/Resources/Shaders/MToonSM3.cginc new file mode 100644 index 0000000000..1fa120ab73 --- /dev/null +++ b/Assets/VRMShaders/VRM/MToon/MToon/Resources/Shaders/MToonSM3.cginc @@ -0,0 +1,22 @@ +#include "./MToonCore.cginc" + +v2f vert_forward_base(appdata_full v) +{ + UNITY_SETUP_INSTANCE_ID(v); + v.normal = normalize(v.normal); + return InitializeV2F(v, UnityObjectToClipPos(v.vertex), 0); +} + +v2f vert_forward_base_outline(appdata_full v) +{ + UNITY_SETUP_INSTANCE_ID(v); + v.normal = normalize(v.normal); + return InitializeV2F(v, CalculateOutlineVertexClipPosition(v), 1); +} + +v2f vert_forward_add(appdata_full v) +{ + UNITY_SETUP_INSTANCE_ID(v); + v.normal = normalize(v.normal); + return InitializeV2F(v, UnityObjectToClipPos(v.vertex), 0); +} diff --git a/Assets/VRMShaders/VRM/MToon/MToon/Resources/Shaders/MToonSM3.cginc.meta b/Assets/VRMShaders/VRM/MToon/MToon/Resources/Shaders/MToonSM3.cginc.meta new file mode 100644 index 0000000000..843b34e33f --- /dev/null +++ b/Assets/VRMShaders/VRM/MToon/MToon/Resources/Shaders/MToonSM3.cginc.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 084281ffd8b1b8e4a8605725d3b0760b +timeCreated: 1514120022 +licenseType: Free +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/VRMShaders/VRM/MToon/MToon/Resources/Shaders/MToonSM4.cginc b/Assets/VRMShaders/VRM/MToon/MToon/Resources/Shaders/MToonSM4.cginc new file mode 100644 index 0000000000..1b701ecd8e --- /dev/null +++ b/Assets/VRMShaders/VRM/MToon/MToon/Resources/Shaders/MToonSM4.cginc @@ -0,0 +1,39 @@ +#include "./MToonCore.cginc" + +appdata_full vert_forward_base_with_outline(appdata_full v) +{ + UNITY_SETUP_INSTANCE_ID(v); + v.normal = normalize(v.normal); + return v; +} + +v2f vert_forward_add(appdata_full v) +{ + UNITY_SETUP_INSTANCE_ID(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/Assets/VRMShaders/VRM/MToon/MToon/Resources/Shaders/MToonSM4.cginc.meta b/Assets/VRMShaders/VRM/MToon/MToon/Resources/Shaders/MToonSM4.cginc.meta new file mode 100644 index 0000000000..f6bdf05cb4 --- /dev/null +++ b/Assets/VRMShaders/VRM/MToon/MToon/Resources/Shaders/MToonSM4.cginc.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 17d4e0f990fbc794ab41e4fcc196d559 +timeCreated: 1514120022 +licenseType: Free +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/VRMShaders/VRM/MToon/MToon/Samples.meta b/Assets/VRMShaders/VRM/MToon/MToon/Samples.meta new file mode 100644 index 0000000000..f454277f6f --- /dev/null +++ b/Assets/VRMShaders/VRM/MToon/MToon/Samples.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 9e9b6e0377a19e54d9d9ff78f925aec6 +folderAsset: yes +timeCreated: 1520007011 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/VRMShaders/VRM/MToon/MToon/Samples/Materials.meta b/Assets/VRMShaders/VRM/MToon/MToon/Samples/Materials.meta new file mode 100644 index 0000000000..3aa2897bd1 --- /dev/null +++ b/Assets/VRMShaders/VRM/MToon/MToon/Samples/Materials.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: a028698465d209d4e91f4935e23b138e +folderAsset: yes +timeCreated: 1520007030 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/VRMShaders/VRM/MToon/MToon/Samples/Materials/Ex_OutlineWidth_Screen.mat b/Assets/VRMShaders/VRM/MToon/MToon/Samples/Materials/Ex_OutlineWidth_Screen.mat new file mode 100644 index 0000000000..fb6fbd6adf --- /dev/null +++ b/Assets/VRMShaders/VRM/MToon/MToon/Samples/Materials/Ex_OutlineWidth_Screen.mat @@ -0,0 +1,108 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Ex_OutlineWidth_Screen + m_Shader: {fileID: 4800000, guid: 1a97144e4ad27a04aafd70f7b915cedb, type: 3} + m_ShaderKeywords: MTOON_OUTLINE_COLOR_FIXED MTOON_OUTLINE_WIDTH_SCREEN + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: + RenderType: Opaque + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineWidthTexture: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ReceiveShadowTexture: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadeTexture: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SphereAdd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BlendMode: 0 + - _BumpScale: 1 + - _CullMode: 2 + - _Cutoff: 0.5 + - _DebugMode: 0 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _IsFirstSetup: 0 + - _LightColorAttenuation: 0 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _OutlineColorMode: 0 + - _OutlineLightingMix: 1 + - _OutlineScaledMaxDistance: 10 + - _OutlineWidth: 1 + - _OutlineWidthMode: 2 + - _Parallax: 0.02 + - _ReceiveShadowRate: 1 + - _ShadeShift: 0 + - _ShadeToony: 0.9 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 0, g: 0, b: 0, a: 1} + - _ShadeColor: {r: 0.97, g: 0.81, b: 0.86, a: 1} diff --git a/Assets/VRMShaders/VRM/MToon/MToon/Samples/Materials/Ex_OutlineWidth_Screen.mat.meta b/Assets/VRMShaders/VRM/MToon/MToon/Samples/Materials/Ex_OutlineWidth_Screen.mat.meta new file mode 100644 index 0000000000..a2cb280671 --- /dev/null +++ b/Assets/VRMShaders/VRM/MToon/MToon/Samples/Materials/Ex_OutlineWidth_Screen.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 4f42a26097c877b40a7616aa60580c43 +timeCreated: 1521569501 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/VRMShaders/VRM/MToon/MToon/Samples/Materials/Ex_OutlineWidth_World.mat b/Assets/VRMShaders/VRM/MToon/MToon/Samples/Materials/Ex_OutlineWidth_World.mat new file mode 100644 index 0000000000..7634815e63 --- /dev/null +++ b/Assets/VRMShaders/VRM/MToon/MToon/Samples/Materials/Ex_OutlineWidth_World.mat @@ -0,0 +1,108 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Ex_OutlineWidth_World + m_Shader: {fileID: 4800000, guid: 1a97144e4ad27a04aafd70f7b915cedb, type: 3} + m_ShaderKeywords: MTOON_OUTLINE_COLOR_FIXED MTOON_OUTLINE_WIDTH_WORLD + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: + RenderType: Opaque + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineWidthTexture: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ReceiveShadowTexture: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadeTexture: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SphereAdd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BlendMode: 0 + - _BumpScale: 1 + - _CullMode: 2 + - _Cutoff: 0.5 + - _DebugMode: 0 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _IsFirstSetup: 0 + - _LightColorAttenuation: 0 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _OutlineColorMode: 0 + - _OutlineLightingMix: 1 + - _OutlineScaledMaxDistance: 1 + - _OutlineWidth: 1 + - _OutlineWidthMode: 1 + - _Parallax: 0.02 + - _ReceiveShadowRate: 1 + - _ShadeShift: 0 + - _ShadeToony: 0.9 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _OutlineColor: {r: 0, g: 0, b: 0, a: 1} + - _ShadeColor: {r: 0.97, g: 0.81, b: 0.86, a: 1} diff --git a/Assets/VRMShaders/VRM/MToon/MToon/Samples/Materials/Ex_OutlineWidth_World.mat.meta b/Assets/VRMShaders/VRM/MToon/MToon/Samples/Materials/Ex_OutlineWidth_World.mat.meta new file mode 100644 index 0000000000..9d54c3ed02 --- /dev/null +++ b/Assets/VRMShaders/VRM/MToon/MToon/Samples/Materials/Ex_OutlineWidth_World.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: e40a129e14e378c4db040df3fd4a6077 +timeCreated: 1521569501 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/VRMShaders/VRM/MToon/MToon/Samples/Materials/Ground.mat b/Assets/VRMShaders/VRM/MToon/MToon/Samples/Materials/Ground.mat new file mode 100644 index 0000000000..9256e9a6f8 --- /dev/null +++ b/Assets/VRMShaders/VRM/MToon/MToon/Samples/Materials/Ground.mat @@ -0,0 +1,76 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Ground + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 0.35294116, g: 0.35294116, b: 0.35294116, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/Assets/VRMShaders/VRM/MToon/MToon/Samples/Materials/Ground.mat.meta b/Assets/VRMShaders/VRM/MToon/MToon/Samples/Materials/Ground.mat.meta new file mode 100644 index 0000000000..bc98f0821a --- /dev/null +++ b/Assets/VRMShaders/VRM/MToon/MToon/Samples/Materials/Ground.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 54da18ba3126f1343924588562df72e0 +timeCreated: 1520008460 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/VRMShaders/VRM/MToon/MToon/Samples/Materials/Toon.mat b/Assets/VRMShaders/VRM/MToon/MToon/Samples/Materials/Toon.mat new file mode 100644 index 0000000000..a26f22e597 --- /dev/null +++ b/Assets/VRMShaders/VRM/MToon/MToon/Samples/Materials/Toon.mat @@ -0,0 +1,127 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_Name: Toon + m_Shader: {fileID: 4800000, guid: 1a97144e4ad27a04aafd70f7b915cedb, type: 3} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 1 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: + RenderType: Opaque + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaTexture: + m_Texture: {fileID: 2800000, guid: 92024733fdffba54db25f64b8c81a267, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _LitTexture: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _NormalTexture: + m_Texture: {fileID: 179082629, guid: 114e7de62fa527d458ae3774d145e045, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineWidthTexture: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ReceiveShadowTexture: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadeTexture: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SphereAdd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _Alpha: 1 + - _BlendMode: 0 + - _BumpScale: 1 + - _CullMode: 2 + - _Cutoff: 0.611 + - _DebugMode: 0 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _IsFirstSetup: 0 + - _LightColorAttenuation: 0 + - _Metallic: 0 + - _Mode: 0 + - _NormalCylinderizeRate: 0 + - _NormalFromVColorRate: 0 + - _OcclusionStrength: 1 + - _OutlineColorMode: 0 + - _OutlineLightingMix: 1 + - _OutlineMode: 0 + - _OutlineScaledMaxDistance: 1 + - _OutlineWidth: 1 + - _OutlineWidthMode: 0 + - _Parallax: 0.02 + - _ReceiveShadowRate: 1 + - _ShadeShift: 0.5 + - _ShadeToony: 0.5 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 0.93995947, b: 0.45588237, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _LitColor: {r: 1, g: 1, b: 1, a: 1} + - _NormalCylinderizeAxis: {r: 0, g: 1, b: 0, a: 0} + - _NormalCylinderizePos: {r: 0, g: 0, b: 0, a: 0} + - _OutlineColor: {r: 0, g: 0, b: 0, a: 1} + - _ShadeColor: {r: 1, g: 0.5147059, b: 0.80588233, a: 1} diff --git a/Assets/VRMShaders/VRM/MToon/MToon/Samples/Materials/Toon.mat.meta b/Assets/VRMShaders/VRM/MToon/MToon/Samples/Materials/Toon.mat.meta new file mode 100644 index 0000000000..aeb51f3e6c --- /dev/null +++ b/Assets/VRMShaders/VRM/MToon/MToon/Samples/Materials/Toon.mat.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 9639e17dffc656345a70282f7f216672 +timeCreated: 1520007037 +licenseType: Free +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/VRMShaders/VRM/MToon/MToon/Samples/OutlineWidthModes.unity b/Assets/VRMShaders/VRM/MToon/MToon/Samples/OutlineWidthModes.unity new file mode 100644 index 0000000000..1d452bb527 --- /dev/null +++ b/Assets/VRMShaders/VRM/MToon/MToon/Samples/OutlineWidthModes.unity @@ -0,0 +1,1984 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 8 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1} +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 11 + m_GIWorkflowMode: 0 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_TemporalCoherenceThreshold: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 1 + m_LightmapEditorSettings: + serializedVersion: 9 + m_Resolution: 2 + m_BakeResolution: 40 + m_TextureWidth: 1024 + m_TextureHeight: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 0 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 500 + m_PVRBounces: 2 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVRFilteringMode: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ShowResolutionOverlay: 1 + m_LightingDataAsset: {fileID: 0} + m_UseShadowmask: 1 +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &258232875 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 258232876} + m_Layer: 0 + m_Name: OutlineWidth_World + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &258232876 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 258232875} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -1.24, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 785023941} + - {fileID: 1884108470} + - {fileID: 1151291098} + - {fileID: 1122307219} + - {fileID: 860725899} + - {fileID: 513101434} + - {fileID: 1258929826} + - {fileID: 1515544977} + m_Father: {fileID: 0} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &287894940 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 287894941} + - component: {fileID: 287894943} + - component: {fileID: 287894942} + m_Layer: 0 + m_Name: Sphere (5) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &287894941 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 287894940} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0.5, z: 10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 949706139} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &287894942 +MeshRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 287894940} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 4f42a26097c877b40a7616aa60580c43, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &287894943 +MeshFilter: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 287894940} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &449049889 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 449049892} + - component: {fileID: 449049891} + - component: {fileID: 449049890} + m_Layer: 0 + m_Name: New Text (3) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!102 &449049890 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 449049889} + m_Text: 'Fixed length + + in World coords' + m_OffsetZ: 0 + m_CharacterSize: 1 + m_LineSpacing: 1 + m_Anchor: 0 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 0 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &449049891 +MeshRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 449049889} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!4 &449049892 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 449049889} + m_LocalRotation: {x: 0.0000014603138, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -6.67, y: 0.31272152, z: 7.78} + m_LocalScale: {x: 0.29944235, y: 0.29944223, z: 0.29944223} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 8 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &473362767 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 473362770} + - component: {fileID: 473362769} + - component: {fileID: 473362768} + m_Layer: 0 + m_Name: New Text (4) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!102 &473362768 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 473362767} + m_Text: Outline Width Mode + m_OffsetZ: 0 + m_CharacterSize: 1 + m_LineSpacing: 1 + m_Anchor: 0 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 0 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &473362769 +MeshRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 473362767} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!4 &473362770 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 473362767} + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: -0.819, y: 0.095275, z: -0.299} + m_LocalScale: {x: 0.13751951, y: 0.13751945, z: 0.13751945} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 9 + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!1 &513101433 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 513101434} + - component: {fileID: 513101436} + - component: {fileID: 513101435} + m_Layer: 0 + m_Name: Sphere (5) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &513101434 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 513101433} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0.5, z: 10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 258232876} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &513101435 +MeshRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 513101433} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: e40a129e14e378c4db040df3fd4a6077, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &513101436 +MeshFilter: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 513101433} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &562432354 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 562432355} + - component: {fileID: 562432357} + - component: {fileID: 562432356} + m_Layer: 0 + m_Name: Sphere (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &562432355 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 562432354} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0.5, z: 2} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 949706139} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &562432356 +MeshRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 562432354} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 4f42a26097c877b40a7616aa60580c43, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &562432357 +MeshFilter: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 562432354} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &569565535 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 569565538} + - component: {fileID: 569565537} + - component: {fileID: 569565536} + m_Layer: 0 + m_Name: New Text (2) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!102 &569565536 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 569565535} + m_Text: 'Fixed length + + in Screen coords' + m_OffsetZ: 0 + m_CharacterSize: 1 + m_LineSpacing: 1 + m_Anchor: 0 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 0 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &569565537 +MeshRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 569565535} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!4 &569565538 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 569565535} + m_LocalRotation: {x: 0.0000014603138, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 3.96, y: 0.31272152, z: 7.78} + m_LocalScale: {x: 0.29944235, y: 0.29944223, z: 0.29944223} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 7 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &570198665 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 570198666} + - component: {fileID: 570198668} + - component: {fileID: 570198667} + m_Layer: 0 + m_Name: Sphere (7) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &570198666 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 570198665} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0.5, z: 14} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 949706139} + m_RootOrder: 7 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &570198667 +MeshRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 570198665} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 4f42a26097c877b40a7616aa60580c43, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &570198668 +MeshFilter: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 570198665} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &785023940 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 785023941} + - component: {fileID: 785023943} + - component: {fileID: 785023942} + m_Layer: 0 + m_Name: Sphere + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &785023941 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 785023940} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0.5, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 258232876} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &785023942 +MeshRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 785023940} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: e40a129e14e378c4db040df3fd4a6077, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &785023943 +MeshFilter: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 785023940} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &860725898 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 860725899} + - component: {fileID: 860725901} + - component: {fileID: 860725900} + m_Layer: 0 + m_Name: Sphere (4) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &860725899 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 860725898} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0.5, z: 8} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 258232876} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &860725900 +MeshRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 860725898} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: e40a129e14e378c4db040df3fd4a6077, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &860725901 +MeshFilter: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 860725898} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &911241602 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 911241603} + - component: {fileID: 911241605} + - component: {fileID: 911241604} + m_Layer: 0 + m_Name: Sphere (3) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &911241603 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 911241602} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0.5, z: 6} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 949706139} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &911241604 +MeshRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 911241602} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 4f42a26097c877b40a7616aa60580c43, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &911241605 +MeshFilter: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 911241602} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &949706138 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 949706139} + m_Layer: 0 + m_Name: OutlineWidth_Screen + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &949706139 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 949706138} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 1.24, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 982378650} + - {fileID: 562432355} + - {fileID: 2006212098} + - {fileID: 911241603} + - {fileID: 1933383087} + - {fileID: 287894941} + - {fileID: 1361188086} + - {fileID: 570198666} + m_Father: {fileID: 0} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &982378649 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 982378650} + - component: {fileID: 982378652} + - component: {fileID: 982378651} + m_Layer: 0 + m_Name: Sphere + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &982378650 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 982378649} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0.5, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 949706139} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &982378651 +MeshRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 982378649} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 4f42a26097c877b40a7616aa60580c43, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &982378652 +MeshFilter: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 982378649} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1122307218 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1122307219} + - component: {fileID: 1122307221} + - component: {fileID: 1122307220} + m_Layer: 0 + m_Name: Sphere (3) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1122307219 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1122307218} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0.5, z: 6} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 258232876} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &1122307220 +MeshRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1122307218} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: e40a129e14e378c4db040df3fd4a6077, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &1122307221 +MeshFilter: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1122307218} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1143053075 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1143053079} + - component: {fileID: 1143053078} + - component: {fileID: 1143053077} + - component: {fileID: 1143053076} + m_Layer: 0 + m_Name: Plane + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!23 &1143053076 +MeshRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1143053075} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 54da18ba3126f1343924588562df72e0, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!64 &1143053077 +MeshCollider: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1143053075} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 3 + m_Convex: 0 + m_CookingOptions: 14 + m_SkinWidth: 0.01 + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!33 &1143053078 +MeshFilter: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1143053075} + m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1143053079 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1143053075} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 10, y: 10, z: 10} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1151291097 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1151291098} + - component: {fileID: 1151291100} + - component: {fileID: 1151291099} + m_Layer: 0 + m_Name: Sphere (2) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1151291098 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1151291097} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0.5, z: 4} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 258232876} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &1151291099 +MeshRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1151291097} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: e40a129e14e378c4db040df3fd4a6077, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &1151291100 +MeshFilter: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1151291097} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1258929825 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1258929826} + - component: {fileID: 1258929828} + - component: {fileID: 1258929827} + m_Layer: 0 + m_Name: Sphere (6) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1258929826 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1258929825} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0.5, z: 12} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 258232876} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &1258929827 +MeshRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1258929825} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: e40a129e14e378c4db040df3fd4a6077, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &1258929828 +MeshFilter: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1258929825} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1344602170 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1344602173} + - component: {fileID: 1344602172} + - component: {fileID: 1344602171} + m_Layer: 0 + m_Name: New Text (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!102 &1344602171 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1344602170} + m_Text: Screen + m_OffsetZ: 0 + m_CharacterSize: 1 + m_LineSpacing: 1 + m_Anchor: 0 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 0 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1344602172 +MeshRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1344602170} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!4 &1344602173 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1344602170} + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: 0.85066, y: 0.095275, z: -0.43498} + m_LocalScale: {x: 0.1727766, y: 0.17277655, z: 0.17277655} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!1 &1361188085 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1361188086} + - component: {fileID: 1361188088} + - component: {fileID: 1361188087} + m_Layer: 0 + m_Name: Sphere (6) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1361188086 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1361188085} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0.5, z: 12} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 949706139} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &1361188087 +MeshRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1361188085} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 4f42a26097c877b40a7616aa60580c43, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &1361188088 +MeshFilter: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1361188085} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1515544976 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1515544977} + - component: {fileID: 1515544979} + - component: {fileID: 1515544978} + m_Layer: 0 + m_Name: Sphere (7) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1515544977 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1515544976} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0.5, z: 14} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 258232876} + m_RootOrder: 7 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &1515544978 +MeshRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1515544976} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: e40a129e14e378c4db040df3fd4a6077, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &1515544979 +MeshFilter: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1515544976} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1670878653 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1670878657} + - component: {fileID: 1670878656} + - component: {fileID: 1670878655} + - component: {fileID: 1670878654} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &1670878654 +AudioListener: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1670878653} + m_Enabled: 1 +--- !u!124 &1670878655 +Behaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1670878653} + m_Enabled: 1 +--- !u!20 &1670878656 +Camera: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1670878653} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 45 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &1670878657 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1670878653} + m_LocalRotation: {x: 0.21979502, y: -0, z: -0, w: 0.97554606} + m_LocalPosition: {x: 0, y: 2.09, z: -2.67} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 25.394001, y: 0, z: 0} +--- !u!1 &1884108469 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1884108470} + - component: {fileID: 1884108472} + - component: {fileID: 1884108471} + m_Layer: 0 + m_Name: Sphere (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1884108470 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1884108469} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0.5, z: 2} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 258232876} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &1884108471 +MeshRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1884108469} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: e40a129e14e378c4db040df3fd4a6077, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &1884108472 +MeshFilter: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1884108469} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1912481823 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1912481826} + - component: {fileID: 1912481825} + - component: {fileID: 1912481824} + m_Layer: 0 + m_Name: New Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!102 &1912481824 +TextMesh: + serializedVersion: 3 + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1912481823} + m_Text: World + m_OffsetZ: 0 + m_CharacterSize: 1 + m_LineSpacing: 1 + m_Anchor: 0 + m_Alignment: 0 + m_TabSize: 4 + m_FontSize: 0 + m_FontStyle: 0 + m_RichText: 1 + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_Color: + serializedVersion: 2 + rgba: 4294967295 +--- !u!23 &1912481825 +MeshRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1912481823} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!4 &1912481826 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1912481823} + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: -1.5655, y: 0.095275, z: -0.4374} + m_LocalScale: {x: 0.16944185, y: 0.16944179, z: 0.16944179} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!1 &1933383086 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1933383087} + - component: {fileID: 1933383089} + - component: {fileID: 1933383088} + m_Layer: 0 + m_Name: Sphere (4) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1933383087 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1933383086} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0.5, z: 8} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 949706139} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &1933383088 +MeshRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1933383086} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 4f42a26097c877b40a7616aa60580c43, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &1933383089 +MeshFilter: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1933383086} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &2006212097 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 2006212098} + - component: {fileID: 2006212100} + - component: {fileID: 2006212099} + m_Layer: 0 + m_Name: Sphere (2) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2006212098 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2006212097} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0.5, z: 4} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 949706139} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!23 &2006212099 +MeshRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2006212097} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_Materials: + - {fileID: 2100000, guid: 4f42a26097c877b40a7616aa60580c43, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_PreserveUVs: 1 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 0 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 +--- !u!33 &2006212100 +MeshFilter: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2006212097} + m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &2063006920 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 2063006922} + - component: {fileID: 2063006921} + m_Layer: 0 + m_Name: Directional Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!108 &2063006921 +Light: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2063006920} + m_Enabled: 1 + serializedVersion: 8 + m_Type: 1 + m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} + m_Intensity: 1 + m_Range: 10 + m_SpotAngle: 30 + m_CookieSize: 10 + m_Shadows: + m_Type: 2 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_Lightmapping: 4 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!4 &2063006922 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 2063006920} + m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} + m_LocalPosition: {x: 0, y: 3, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} diff --git a/Assets/VRMShaders/VRM/MToon/MToon/Samples/OutlineWidthModes.unity.meta b/Assets/VRMShaders/VRM/MToon/MToon/Samples/OutlineWidthModes.unity.meta new file mode 100644 index 0000000000..99ace3bdff --- /dev/null +++ b/Assets/VRMShaders/VRM/MToon/MToon/Samples/OutlineWidthModes.unity.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 8b731264e8acd0f4b8f56986e5eb2531 +timeCreated: 1521569785 +licenseType: Free +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/VRMShaders/VRM/MToon/MToon/Scripts.meta b/Assets/VRMShaders/VRM/MToon/MToon/Scripts.meta new file mode 100644 index 0000000000..f8e901d72d --- /dev/null +++ b/Assets/VRMShaders/VRM/MToon/MToon/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 88551f898b0043c41b202eeb79752973 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/VRMShaders/VRM/MToon/MToon/Scripts/Enums.cs b/Assets/VRMShaders/VRM/MToon/MToon/Scripts/Enums.cs new file mode 100644 index 0000000000..fde05ed37d --- /dev/null +++ b/Assets/VRMShaders/VRM/MToon/MToon/Scripts/Enums.cs @@ -0,0 +1,44 @@ +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/Assets/VRMShaders/VRM/MToon/MToon/Scripts/Enums.cs.meta b/Assets/VRMShaders/VRM/MToon/MToon/Scripts/Enums.cs.meta new file mode 100644 index 0000000000..5149027fc8 --- /dev/null +++ b/Assets/VRMShaders/VRM/MToon/MToon/Scripts/Enums.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 9a3fb070d7eb4114b5cf387e2cd60391 +timeCreated: 1548858571 \ No newline at end of file diff --git a/Assets/VRMShaders/VRM/MToon/MToon/Scripts/MToonDefinition.cs b/Assets/VRMShaders/VRM/MToon/MToon/Scripts/MToonDefinition.cs new file mode 100644 index 0000000000..7d208c0773 --- /dev/null +++ b/Assets/VRMShaders/VRM/MToon/MToon/Scripts/MToonDefinition.cs @@ -0,0 +1,109 @@ +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/Assets/VRMShaders/VRM/MToon/MToon/Scripts/MToonDefinition.cs.meta b/Assets/VRMShaders/VRM/MToon/MToon/Scripts/MToonDefinition.cs.meta new file mode 100644 index 0000000000..47c4a3396f --- /dev/null +++ b/Assets/VRMShaders/VRM/MToon/MToon/Scripts/MToonDefinition.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 2849b99d94074fcf9e10c5ca3eab15a8 +timeCreated: 1548857282 \ No newline at end of file diff --git a/Assets/VRMShaders/VRM/MToon/MToon/Scripts/Utils.cs b/Assets/VRMShaders/VRM/MToon/MToon/Scripts/Utils.cs new file mode 100644 index 0000000000..672e9e17cf --- /dev/null +++ b/Assets/VRMShaders/VRM/MToon/MToon/Scripts/Utils.cs @@ -0,0 +1,116 @@ +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 PropAlphaToMask = "_AlphaToMask"; + + 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/Assets/VRMShaders/VRM/MToon/MToon/Scripts/Utils.cs.meta b/Assets/VRMShaders/VRM/MToon/MToon/Scripts/Utils.cs.meta new file mode 100644 index 0000000000..bd4175c3fb --- /dev/null +++ b/Assets/VRMShaders/VRM/MToon/MToon/Scripts/Utils.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 9d2012c170a74b3db0002f7ecda53622 +timeCreated: 1537557325 \ No newline at end of file diff --git a/Assets/VRMShaders/VRM/MToon/MToon/Scripts/UtilsGetter.cs b/Assets/VRMShaders/VRM/MToon/MToon/Scripts/UtilsGetter.cs new file mode 100644 index 0000000000..a917955603 --- /dev/null +++ b/Assets/VRMShaders/VRM/MToon/MToon/Scripts/UtilsGetter.cs @@ -0,0 +1,180 @@ +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/Assets/VRMShaders/VRM/MToon/MToon/Scripts/UtilsGetter.cs.meta b/Assets/VRMShaders/VRM/MToon/MToon/Scripts/UtilsGetter.cs.meta new file mode 100644 index 0000000000..db1134ad55 --- /dev/null +++ b/Assets/VRMShaders/VRM/MToon/MToon/Scripts/UtilsGetter.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 6724aa45c8c349fabd5954a531301aa8 +timeCreated: 1557229569 \ No newline at end of file diff --git a/Assets/VRMShaders/VRM/MToon/MToon/Scripts/UtilsSetter.cs b/Assets/VRMShaders/VRM/MToon/MToon/Scripts/UtilsSetter.cs new file mode 100644 index 0000000000..ea5ce5c83d --- /dev/null +++ b/Assets/VRMShaders/VRM/MToon/MToon/Scripts/UtilsSetter.cs @@ -0,0 +1,283 @@ +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; + SetRenderMode(material, rendering.RenderMode, rendering.RenderQueueOffsetNumber, + useDefaultRenderQueue: false); + SetCullMode(material, rendering.CullMode); + } + { + 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; + SetNormalMapping(material, prop.NormalTexture, 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); + SetOutlineMode(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); + } + + ValidateProperties(material, isBlendModeChangedByUser: false); + } + + /// + /// 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) + { + SetRenderMode(material, + (RenderMode) material.GetFloat(PropBlendMode), + material.renderQueue - GetRenderQueueRequirement((RenderMode) material.GetFloat(PropBlendMode)).DefaultValue, + useDefaultRenderQueue: isBlendModeChangedByUser); + SetNormalMapping(material, material.GetTexture(PropBumpMap), material.GetFloat(PropBumpScale)); + SetOutlineMode(material, + (OutlineWidthMode) material.GetFloat(PropOutlineWidthMode), + (OutlineColorMode) material.GetFloat(PropOutlineColorMode)); + SetDebugMode(material, (DebugMode) material.GetFloat(PropDebugMode)); + SetCullMode(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 SetDebugMode(Material material, DebugMode debugMode) + { + SetValue(material, PropDebugMode, (int) 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; + } + } + + private static void SetRenderMode(Material material, RenderMode renderMode, int renderQueueOffset, + bool useDefaultRenderQueue) + { + SetValue(material, PropBlendMode, (int) renderMode); + + 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); + material.SetInt(PropAlphaToMask, DisabledIntValue); + 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); + material.SetInt(PropAlphaToMask, 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); + material.SetInt(PropAlphaToMask, 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); + material.SetInt(PropAlphaToMask, DisabledIntValue); + SetKeyword(material, KeyAlphaTestOn, false); + SetKeyword(material, KeyAlphaBlendOn, true); + SetKeyword(material, KeyAlphaPremultiplyOn, false); + break; + } + + if (useDefaultRenderQueue) + { + var requirement = GetRenderQueueRequirement(renderMode); + material.renderQueue = requirement.DefaultValue; + } + else + { + var requirement = GetRenderQueueRequirement(renderMode); + material.renderQueue = Mathf.Clamp( + requirement.DefaultValue + renderQueueOffset, requirement.MinValue, requirement.MaxValue); + } + } + + private static void SetOutlineMode(Material material, OutlineWidthMode outlineWidthMode, + OutlineColorMode outlineColorMode) + { + SetValue(material, PropOutlineWidthMode, (int) outlineWidthMode); + SetValue(material, PropOutlineColorMode, (int) 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 SetNormalMapping(Material material, Texture bumpMap, float bumpScale) + { + SetTexture(material, PropBumpMap, bumpMap); + SetValue(material, PropBumpScale, bumpScale); + + SetKeyword(material, KeyNormalMap, bumpMap != null); + } + + private static void SetCullMode(Material material, CullMode cullMode) + { + SetValue(material, PropCullMode, (int) 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, Texture 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/Assets/VRMShaders/VRM/MToon/MToon/Scripts/UtilsSetter.cs.meta b/Assets/VRMShaders/VRM/MToon/MToon/Scripts/UtilsSetter.cs.meta new file mode 100644 index 0000000000..d49b0361fa --- /dev/null +++ b/Assets/VRMShaders/VRM/MToon/MToon/Scripts/UtilsSetter.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: b24a672e82874c9fbfef9c2b2dfdab42 +timeCreated: 1557304397 \ No newline at end of file diff --git a/Assets/VRMShaders/VRM/MToon/MToon/Scripts/UtilsVersion.cs b/Assets/VRMShaders/VRM/MToon/MToon/Scripts/UtilsVersion.cs new file mode 100644 index 0000000000..91436bc17d --- /dev/null +++ b/Assets/VRMShaders/VRM/MToon/MToon/Scripts/UtilsVersion.cs @@ -0,0 +1,8 @@ +namespace MToon +{ + public static partial class Utils + { + public const string Implementation = "Santarh/MToon"; + public const int VersionNumber = 39; + } +} diff --git a/Assets/VRMShaders/VRM/MToon/MToon/Scripts/UtilsVersion.cs.meta b/Assets/VRMShaders/VRM/MToon/MToon/Scripts/UtilsVersion.cs.meta new file mode 100644 index 0000000000..b2f3ef440e --- /dev/null +++ b/Assets/VRMShaders/VRM/MToon/MToon/Scripts/UtilsVersion.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 4702d4b2c1414cc08b4382c3762eebab +timeCreated: 1557306172 \ No newline at end of file diff --git a/Assets/VRMShaders/VRM/MToon/README.md b/Assets/VRMShaders/VRM/MToon/README.md new file mode 100644 index 0000000000..222d931192 --- /dev/null +++ b/Assets/VRMShaders/VRM/MToon/README.md @@ -0,0 +1,11 @@ +# MToon +Toon Shader with Unity Global Illumination + +## Tutorial +https://www.slideshare.net/VirtualCast/vrm-mtoon + +## Version +v3.9 + +## Release Note +https://github.com/Santarh/MToon/releases diff --git a/Assets/VRMShaders/VRM/MToon/README.md.meta b/Assets/VRMShaders/VRM/MToon/README.md.meta new file mode 100644 index 0000000000..348927767f --- /dev/null +++ b/Assets/VRMShaders/VRM/MToon/README.md.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 1021e7e6d453b9f4fb2f46a130425deb +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: