From 295e284dd0bde5d06a1b5215ebc860c24873001d Mon Sep 17 00:00:00 2001 From: "NJ\\skrwn" Date: Sat, 20 Jun 2026 16:46:29 +0900 Subject: [PATCH 1/4] =?UTF-8?q?2026-06-20=20=EB=89=B4=ED=8E=98=EC=96=B4?= =?UTF-8?q?=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/04_Models/Characters/Fariy.meta | 8 + .../Characters/Fariy/Animations.meta | 8 + .../Animations/FairyAnimController.controller | 72 + .../FairyAnimController.controller.meta | 8 + .../Animations/FairyFly_Idle_FlapWings.anim | 3 + .../FairyFly_Idle_FlapWings.anim.meta | 8 + Assets/04_Models/Characters/Fariy/FBX.meta | 8 + .../Characters/Fariy/FBX/Alistia.fbx | 3 + .../Characters/Fariy/FBX/Alistia.fbx.meta | 1114 +++++ .../Characters/Fariy/FBX/Alistia_Hair.fbx | 3 + .../Fariy/FBX/Alistia_Hair.fbx.meta | 127 + .../Characters/Fariy/FBX/Fairy_wing.fbx | 3 + .../Characters/Fariy/FBX/Fairy_wing.fbx.meta | 114 + .../04_Models/Characters/Fariy/Fairy.prefab | 3 + .../Characters/Fariy/Fairy.prefab.meta | 7 + .../04_Models/Characters/Fariy/Materials.meta | 8 + .../Characters/Fariy/Materials/Body_Hair.meta | 8 + .../Materials/Body_Hair/Alistia_Body.mat | 998 ++++ .../Materials/Body_Hair/Alistia_Body.mat.meta | 8 + .../Materials/Body_Hair/Alistia_Face.mat | 999 ++++ .../Materials/Body_Hair/Alistia_Face.mat.meta | 8 + .../Body_Hair/Alistia_Face_Alpha.mat | 1030 ++++ .../Body_Hair/Alistia_Face_Alpha.mat.meta | 8 + .../Materials/Body_Hair/Alistia_Hair.mat | 1026 ++++ .../Materials/Body_Hair/Alistia_Hair.mat.meta | 8 + .../Characters/Fariy/Materials/Cloth.meta | 8 + .../Materials/Cloth/Alistia_Cloth_1_Blue.mat | 996 ++++ .../Cloth/Alistia_Cloth_1_Blue.mat.meta | 8 + .../Cloth/Alistia_Cloth_1_Blue_Lace.mat | 1028 ++++ .../Cloth/Alistia_Cloth_1_Blue_Lace.mat.meta | 8 + .../Materials/Cloth/Alistia_Cloth_2_Lace.mat | 1026 ++++ .../Cloth/Alistia_Cloth_2_Lace.mat.meta | 8 + .../Characters/Fariy/Materials/Komono.meta | 8 + .../Fariy/Materials/Komono/Jewel_Blue.mat | 977 ++++ .../Materials/Komono/Jewel_Blue.mat.meta | 8 + .../Fariy/Materials/Komono/Metal_Gold.mat | 996 ++++ .../Materials/Komono/Metal_Gold.mat.meta | 8 + .../Fariy/Materials/wing_effects.mat | 137 + .../Fariy/Materials/wing_effects.mat.meta | 8 + .../Characters/Fariy/Materials/wing_mat.mat | 1027 ++++ .../Fariy/Materials/wing_mat.mat.meta | 8 + .../Characters/Fariy/Materials/wing_trail.mat | 139 + .../Fariy/Materials/wing_trail.mat.meta | 8 + .../04_Models/Characters/Fariy/Textures.meta | 8 + .../Characters/Fariy/Textures/Body_Hair.meta | 8 + .../Fariy/Textures/Body_Hair/Alistia_Body.png | 3 + .../Textures/Body_Hair/Alistia_Body.png.meta | 104 + .../Fariy/Textures/Body_Hair/Alistia_Face.png | 3 + .../Textures/Body_Hair/Alistia_Face.png.meta | 104 + .../Textures/Body_Hair/Alistia_Face_Alpha.png | 3 + .../Body_Hair/Alistia_Face_Alpha.png.meta | 104 + .../Textures/Body_Hair/Alistia_Face_mask.png | 3 + .../Body_Hair/Alistia_Face_mask.png.meta | 104 + .../Fariy/Textures/Body_Hair/Alistia_Hair.png | 3 + .../Textures/Body_Hair/Alistia_Hair.png.meta | 104 + .../Textures/Body_Hair/Alistia_Hair_Mask.png | 3 + .../Body_Hair/Alistia_Hair_Mask.png.meta | 104 + .../Characters/Fariy/Textures/Cloth.meta | 8 + .../Textures/Cloth/Alistia_Cloth_1_blue.png | 3 + .../Cloth/Alistia_Cloth_1_blue.png.meta | 104 + .../Fariy/Textures/Cloth/Alistia_Cloth_2.png | 3 + .../Textures/Cloth/Alistia_Cloth_2.png.meta | 104 + .../Fariy/Textures/wing_effects_tex.png | 3 + .../Fariy/Textures/wing_effects_tex.png.meta | 140 + .../Fariy/Textures/wing_mat_BaseMap.png | 3 + .../Fariy/Textures/wing_mat_BaseMap.png.meta | 140 + .../Characters/Fariy/Textures/wing_matcap.png | 3 + .../Fariy/Textures/wing_matcap.png.meta | 140 + .../Fariy/Textures/wing_trail_tex.png | 3 + .../Fariy/Textures/wing_trail_tex.png.meta | 140 + Assets/MagicaCloth2.meta | 8 + .../Example (Can be deleted).meta | 8 + .../Example (Can be deleted)/Common.meta | 8 + .../Common/Materials.meta | 8 + .../Common/Materials/MC2_Floor.mat | 202 + .../Common/Materials/MC2_Floor.mat.meta | 15 + .../Common/Materials/MC2_Test_Back.mat | 202 + .../Common/Materials/MC2_Test_Back.mat.meta | 15 + .../Common/Materials/MC2_Test_Front.mat | 202 + .../Common/Materials/MC2_Test_Front.mat.meta | 15 + .../Common/Materials/MC2_White.mat | 133 + .../Common/Materials/MC2_White.mat.meta | 15 + .../Common/Model.meta | 8 + .../Common/Model/Materials.meta | 8 + .../Common/Model/Materials/Arrow.mat | 151 + .../Common/Model/Materials/Arrow.mat.meta | 15 + .../Common/Model/arrow_b.fbx | 3 + .../Common/Model/arrow_b.fbx.meta | 132 + .../Common/Prefabs.meta | 8 + .../Common/Prefabs/Cube.prefab | 3 + .../Common/Prefabs/Cube.prefab.meta | 14 + .../Common/Prefabs/CubeRoup.prefab | 3 + .../Common/Prefabs/CubeRoup.prefab.meta | 14 + .../Common/Prefabs/Env.prefab | 3 + .../Common/Prefabs/Env.prefab.meta | 14 + .../Common/Prefabs/Plane.prefab | 3 + .../Common/Prefabs/Plane.prefab.meta | 14 + .../Common/Prefabs/RuntimeBuildDemo.prefab | 3 + .../Prefabs/RuntimeBuildDemo.prefab.meta | 14 + .../Common/Prefabs/RuntimeDressUpDemo.prefab | 3 + .../Prefabs/RuntimeDressUpDemo.prefab.meta | 14 + .../Common/Prefabs/SimpleImputManager.prefab | 3 + .../Prefabs/SimpleImputManager.prefab.meta | 14 + .../Common/Prefabs/Stage.prefab | 3 + .../Common/Prefabs/Stage.prefab.meta | 14 + .../Common/Prefabs/UI_KAGURA.prefab | 3 + .../Common/Prefabs/UI_KAGURA.prefab.meta | 14 + .../Common/Prefabs/UI_RuntimeBuild.prefab | 3 + .../Prefabs/UI_RuntimeBuild.prefab.meta | 14 + .../Common/Prefabs/UI_RuntimeDressUp.prefab | 3 + .../Prefabs/UI_RuntimeDressUp.prefab.meta | 14 + .../Common/Prefabs/UI_Wind.prefab | 3 + .../Common/Prefabs/UI_Wind.prefab.meta | 14 + .../Common/Prefabs/WindDemo.prefab | 3 + .../Common/Prefabs/WindDemo.prefab.meta | 14 + .../Common/Prefabs/WindParticle.prefab | 3 + .../Common/Prefabs/WindParticle.prefab.meta | 14 + .../Common/Resources.meta | 8 + .../Resources/MC2_BoneCloth_Ribbon_Demo.json | 1 + .../MC2_BoneCloth_Ribbon_Demo.json.meta | 14 + .../Common/Scripts.meta | 8 + .../Common/Scripts/AutoRotate.cs | 60 + .../Common/Scripts/AutoRotate.cs.meta | 19 + .../Common/Scripts/CameraOrbit.cs | 249 + .../Common/Scripts/CameraOrbit.cs.meta | 18 + .../Common/Scripts/CreateSingleton.cs | 136 + .../Common/Scripts/CreateSingleton.cs.meta | 18 + .../Common/Scripts/Editor.meta | 8 + .../Common/Scripts/Editor/ShaderGraph.meta | 8 + .../MagicaCloth2UPMImporterShaderGraph.asmdef | 24 + ...caCloth2UPMImporterShaderGraph.asmdef.meta | 14 + .../ShaderGraph/UnityPackageImporter.cs | 30 + .../ShaderGraph/UnityPackageImporter.cs.meta | 18 + .../Common/Scripts/GameObjectContainer.cs | 44 + .../Scripts/GameObjectContainer.cs.meta | 18 + .../Common/Scripts/MagicaCloth2Example.asmdef | 25 + .../Scripts/MagicaCloth2Example.asmdef.meta | 14 + .../Common/Scripts/ModelController.cs | 82 + .../Common/Scripts/ModelController.cs.meta | 18 + .../Common/Scripts/RuntimeBuildDemo.cs | 248 + .../Common/Scripts/RuntimeBuildDemo.cs.meta | 18 + .../Common/Scripts/RuntimeDressUpDemo.cs | 210 + .../Common/Scripts/RuntimeDressUpDemo.cs.meta | 18 + .../Common/Scripts/SimpleInput.cs | 196 + .../Common/Scripts/SimpleInput.cs.meta | 18 + .../Common/Scripts/SimpleInputManager.cs | 602 +++ .../Common/Scripts/SimpleInputManager.cs.meta | 18 + .../Common/Scripts/SliderText.cs | 46 + .../Common/Scripts/SliderText.cs.meta | 18 + .../Common/Scripts/TargetFPS.cs | 19 + .../Common/Scripts/TargetFPS.cs.meta | 18 + .../Common/Scripts/WindDemo.cs | 94 + .../Common/Scripts/WindDemo.cs.meta | 18 + .../Common/Shaders.meta | 8 + .../Shaders/MC2_Common_Lit_Back.shadergraph | 2336 +++++++++ .../MC2_Common_Lit_Back.shadergraph.meta | 17 + .../Shaders/MC2_Common_Lit_Front.shadergraph | 1889 ++++++++ .../MC2_Common_Lit_Front.shadergraph.meta | 17 + .../Common/Textures.meta | 8 + .../Textures/SD_UnityChan_Skirt_PaintMap.png | 3 + .../SD_UnityChan_Skirt_PaintMap.png.meta | 142 + .../Example (Can be deleted)/DemoScenes.meta | 8 + .../DemoScenes/CoreRP.meta | 8 + .../CoreRP/RuntimeBuild_CoreRP.unity | 3 + .../CoreRP/RuntimeBuild_CoreRP.unity.meta | 14 + .../CoreRP/RuntimeDressUp_CoreRP.unity | 3 + .../CoreRP/RuntimeDressUp_CoreRP.unity.meta | 14 + .../CoreRP/UnityChanKAGURA_CoreRP.unity | 3 + .../CoreRP/UnityChanKAGURA_CoreRP.unity.meta | 14 + .../DemoScenes/CoreRP/Wind_CoreRP.unity | 3 + .../DemoScenes/CoreRP/Wind_CoreRP.unity.meta | 14 + .../DemoScenes/HDRP.meta | 8 + .../HDRP/MC2_SkyandFogSettingsProfile.asset | 3 + .../MC2_SkyandFogSettingsProfile.asset.meta | 15 + .../DemoScenes/HDRP/RuntimeBuild_HDRP.unity | 3 + .../HDRP/RuntimeBuild_HDRP.unity.meta | 14 + .../DemoScenes/HDRP/RuntimeDressUp_HDRP.unity | 3 + .../HDRP/RuntimeDressUp_HDRP.unity.meta | 14 + .../HDRP/UnityChanKAGURA_HDRP.unity | 3 + .../HDRP/UnityChanKAGURA_HDRP.unity.meta | 14 + .../DemoScenes/HDRP/Wind_HDRP.unity | 3 + .../DemoScenes/HDRP/Wind_HDRP.unity.meta | 14 + .../DemoScenes/URP.meta | 8 + .../DemoScenes/URP/RuntimeBuild_URP.unity | 3 + .../URP/RuntimeBuild_URP.unity.meta | 14 + .../DemoScenes/URP/RuntimeDressUp_URP.unity | 3 + .../URP/RuntimeDressUp_URP.unity.meta | 14 + .../DemoScenes/URP/UnityChanKAGURA_URP.unity | 3 + .../URP/UnityChanKAGURA_URP.unity.meta | 14 + .../DemoScenes/URP/Wind_URP.unity | 3 + .../DemoScenes/URP/Wind_URP.unity.meta | 14 + .../DemoScenes_Unity_6.1_or_Higher.meta | 8 + .../HighDefinition3D.meta | 8 + .../RuntimeBuild_HighDefinition3D.unity | 3 + .../RuntimeBuild_HighDefinition3D.unity.meta | 14 + .../RuntimeDressUp_HighDefinition3D.unity | 3 + ...RuntimeDressUp_HighDefinition3D.unity.meta | 14 + .../UnityChanKAGURA_HighDefinition3D.unity | 3 + ...nityChanKAGURA_HighDefinition3D.unity.meta | 14 + .../Wind_HighDefinition3D.unity | 3 + .../Wind_HighDefinition3D.unity.meta | 14 + .../Universal3D.meta | 8 + .../RuntimeBuild_Universal3D.unity | 3 + .../RuntimeBuild_Universal3D.unity.meta | 14 + .../RuntimeDressUp_Universal3D.unity | 3 + .../RuntimeDressUp_Universal3D.unity.meta | 14 + .../UnityChanKAGURA_Universal3D.unity | 3 + .../UnityChanKAGURA_Universal3D.unity.meta | 14 + .../Universal3D/Wind_Universal3D.unity | 3 + .../Universal3D/Wind_Universal3D.unity.meta | 14 + .../Example (Can be deleted)/UnityChan.meta | 8 + .../UnityChan/Logo.meta | 8 + .../UnityChan/Logo/Dark_Silhouette.png | 3 + .../UnityChan/Logo/Dark_Silhouette.png.meta | 142 + .../UnityChan/SD_Kohaku_chanz.meta | 8 + .../UnityChan/SD_Kohaku_chanz/Materials.meta | 8 + .../SD_Kohaku_chanz/Materials/SB_def_mat.mat | 133 + .../Materials/SB_def_mat.mat.meta | 15 + .../SD_Kohaku_chanz/Materials/SB_nol_mat.mat | 133 + .../Materials/SB_nol_mat.mat.meta | 15 + .../SD_Kohaku_chanz/Materials/SB_skin_mat.mat | 133 + .../Materials/SB_skin_mat.mat.meta | 15 + .../SD_Kohaku_chanz/Materials/def_mat.mat | 133 + .../Materials/def_mat.mat.meta | 15 + .../SD_Kohaku_chanz/Materials/hair_mat.mat | 133 + .../Materials/hair_mat.mat.meta | 15 + .../SD_Kohaku_chanz/Materials/mouth_mat.mat | 133 + .../Materials/mouth_mat.mat.meta | 15 + .../SD_Kohaku_chanz/Materials/nol_mat.mat | 133 + .../Materials/nol_mat.mat.meta | 15 + .../SD_Kohaku_chanz/Materials/skin_mat.mat | 133 + .../Materials/skin_mat.mat.meta | 15 + .../SD_Kohaku_chanz/SD_UnityChan.controller | 159 + .../SD_UnityChan.controller.meta | 15 + .../UnityChan/SD_Kohaku_chanz/Textures.meta | 8 + .../SD_Kohaku_chanz/Textures/body_sum.png | 3 + .../Textures/body_sum.png.meta | 142 + .../SD_Kohaku_chanz/Textures/body_win.png | 3 + .../Textures/body_win.png.meta | 142 + .../SD_Kohaku_chanz/Textures/misaki_head.png | 3 + .../Textures/misaki_head.png.meta | 142 + .../SD_Kohaku_chanz/Textures/utc_all2.png | 3 + .../Textures/utc_all2.png.meta | 142 + .../SD_Kohaku_chanz/Textures/yuko_head.png | 3 + .../Textures/yuko_head.png.meta | 142 + .../Utc_sum_humanoid (Body).prefab | 3 + .../Utc_sum_humanoid (Body).prefab.meta | 15 + .../Utc_sum_humanoid (Hair).prefab | 3 + .../Utc_sum_humanoid (Hair).prefab.meta | 15 + .../Utc_sum_humanoid (Skeleton).prefab | 3 + .../Utc_sum_humanoid (Skeleton).prefab.meta | 15 + .../Utc_sum_humanoid Variant.prefab | 3 + .../Utc_sum_humanoid Variant.prefab.meta | 15 + .../SD_Kohaku_chanz/Utc_sum_humanoid.fbx | 3 + .../SD_Kohaku_chanz/Utc_sum_humanoid.fbx.meta | 1107 +++++ .../UnityChan/UCL2.0.meta | 8 + .../UnityChan/UCL2.0/English.meta | 8 + ... License Terms and Condition_EN_UCL2.0.pdf | 3 + ...nse Terms and Condition_EN_UCL2.0.pdf.meta | 15 + ... Terms and Condition_Summary_EN_UCL2.0.pdf | 3 + ...s and Condition_Summary_EN_UCL2.0.pdf.meta | 15 + .../03Indication of License_EN_UCL2.0.pdf | 3 + ...03Indication of License_EN_UCL2.0.pdf.meta | 15 + .../UnityChan/UCL2.0/Japanese.meta | 8 + ... License Terms and Condition_JP_UCL2.0.pdf | 3 + ...nse Terms and Condition_JP_UCL2.0.pdf.meta | 15 + ... Terms and Condition_Summary_JP_UCL2.0.pdf | 3 + ...s and Condition_Summary_JP_UCL2.0.pdf.meta | 15 + .../03Indication of License_JP_UCL2.0.pdf | 3 + ...03Indication of License_JP_UCL2.0.pdf.meta | 15 + .../UnityChan/UCL2.0/License Logo.meta | 8 + .../UCL2.0/License Logo/LUUL_LOGO_rules02.ai | 3 + .../License Logo/LUUL_LOGO_rules02.ai.meta | 15 + .../UCL2.0/License Logo/LUUL_LOGO_rules02.psd | 3 + .../License Logo/LUUL_LOGO_rules02.psd.meta | 143 + .../License Logo/LUUL_logo-guideline.pdf | 3 + .../License Logo/LUUL_logo-guideline.pdf.meta | 15 + .../License Logo/LUUL_logo-guideline_en.pdf | 3 + .../LUUL_logo-guideline_en.pdf.meta | 15 + .../UnityChan/UCL2.0/License Logo/Others.meta | 8 + .../UCL2.0/License Logo/Others/jpg.meta | 8 + .../Others/jpg/Dark_Silhouette.jpg | 3 + .../Others/jpg/Dark_Silhouette.jpg.meta | 143 + .../Others/jpg/Light_Silhouette.jpg | 3 + .../Others/jpg/Light_Silhouette.jpg.meta | 143 + .../UCL2.0/License Logo/Others/png.meta | 8 + .../Others/png/Dark_Silhouette.png | 3 + .../Others/png/Dark_Silhouette.png.meta | 143 + .../License Logo/Others/png/Light_Frame.png | 3 + .../Others/png/Light_Frame.png.meta | 143 + .../Others/png/Light_Silhouette.png | 3 + .../Others/png/Light_Silhouette.png.meta | 143 + .../UCL2.0/License Logo/Others/svg.meta | 8 + .../Others/svg/Dark_Silhouette.svg | 163 + .../Others/svg/Dark_Silhouette.svg.meta | 61 + .../License Logo/Others/svg/Light_Frame.svg | 153 + .../Others/svg/Light_Frame.svg.meta | 61 + .../Others/svg/Light_Silhouette.svg | 145 + .../Others/svg/Light_Silhouette.svg.meta | 61 + .../UnityChan/Unity-Chan License.txt | 18 + .../UnityChan/Unity-Chan License.txt.meta | 14 + .../UnityChan/UnityChanKAGURA.meta | 8 + .../UnityChan/UnityChanKAGURA/Animation.meta | 8 + .../UnityChanKAGURA/Animation/RUN00_F.anim | 3 + .../Animation/RUN00_F.anim.meta | 15 + .../Animation/UC01_001_UniteInTheSky -WA-.fbx | 3 + .../UC01_001_UniteInTheSky -WA-.fbx.meta | 1149 +++++ .../UnityChanKAGURA/Animation/WAIT02.anim | 3 + .../Animation/WAIT02.anim.meta | 15 + .../UnityChanKAGURA/Animation/WAIT04.anim | 3 + .../Animation/WAIT04.anim.meta | 15 + .../UnityChanKAGURA/Animation/WALK00_F.anim | 3 + .../Animation/WALK00_F.anim.meta | 15 + .../UnityChanKAGURA/Animation/WIN00.anim | 3 + .../UnityChanKAGURA/Animation/WIN00.anim.meta | 15 + .../UnityChan/UnityChanKAGURA/Materials.meta | 8 + .../UnityChanKAGURA/Materials/Albedo.mat | 83 + .../UnityChanKAGURA/Materials/Albedo.mat.meta | 15 + .../UnityChanKAGURA/Materials/Body Back.mat | 405 ++ .../Materials/Body Back.mat.meta | 16 + .../UnityChanKAGURA/Materials/Body.mat | 405 ++ .../UnityChanKAGURA/Materials/Body.mat.meta | 16 + .../UnityChanKAGURA/Materials/Eyes.mat | 405 ++ .../UnityChanKAGURA/Materials/Eyes.mat.meta | 16 + .../UnityChanKAGURA/Materials/Eyes_HL.mat | 410 ++ .../Materials/Eyes_HL.mat.meta | 15 + .../UnityChanKAGURA/Materials/Face.mat | 405 ++ .../UnityChanKAGURA/Materials/Face.mat.meta | 16 + .../UnityChanKAGURA/Materials/Hair.mat | 405 ++ .../UnityChanKAGURA/Materials/Hair.mat.meta | 16 + .../UnityChanKAGURA/Materials/HairPony.mat | 405 ++ .../Materials/HairPony.mat.meta | 16 + .../UnityChanKAGURA/Materials/Headgear.mat | 405 ++ .../Materials/Headgear.mat.meta | 16 + .../Materials/LongSleeve Back.mat | 405 ++ .../Materials/LongSleeve Back.mat.meta | 16 + .../UnityChanKAGURA/Materials/LongSleeve.mat | 405 ++ .../Materials/LongSleeve.mat.meta | 16 + .../UnityChanKAGURA/Materials/Skin.mat | 405 ++ .../UnityChanKAGURA/Materials/Skin.mat.meta | 16 + .../UnityChanKAGURA/Materials/TEX.meta | 9 + .../UnityChanKAGURA/Materials/TEX/PNG.meta | 8 + .../Materials/TEX/PNG/Body_Base.png | 3 + .../Materials/TEX/PNG/Body_Base.png.meta | 147 + .../Materials/TEX/PNG/Body_Emi.png | 3 + .../Materials/TEX/PNG/Body_Emi.png.meta | 147 + .../Materials/TEX/PNG/Body_SGM.png | 3 + .../Materials/TEX/PNG/Body_SGM.png.meta | 147 + .../Materials/TEX/PNG/Body_Shd1.png | 3 + .../Materials/TEX/PNG/Body_Shd1.png.meta | 147 + .../Materials/TEX/PNG/Body_Shd2.png | 3 + .../Materials/TEX/PNG/Body_Shd2.png.meta | 147 + .../Materials/TEX/PNG/Body_Spc.png | 3 + .../Materials/TEX/PNG/Body_Spc.png.meta | 147 + .../Materials/TEX/PNG/Face_Base.png | 3 + .../Materials/TEX/PNG/Face_Base.png.meta | 147 + .../Materials/TEX/PNG/Face_Emi.png | 3 + .../Materials/TEX/PNG/Face_Emi.png.meta | 147 + .../Materials/TEX/PNG/Face_LSM.png | 3 + .../Materials/TEX/PNG/Face_LSM.png.meta | 147 + .../Materials/TEX/PNG/Face_Rim.png | 3 + .../Materials/TEX/PNG/Face_Rim.png.meta | 147 + .../Materials/TEX/PNG/Face_SGM.png | 3 + .../Materials/TEX/PNG/Face_SGM.png.meta | 147 + .../Materials/TEX/PNG/Face_Shd1.png | 3 + .../Materials/TEX/PNG/Face_Shd1.png.meta | 147 + .../Materials/TEX/PNG/Face_Shd2.png | 3 + .../Materials/TEX/PNG/Face_Shd2.png.meta | 147 + .../Materials/TEX/PNG/Hair_SGM.png | 3 + .../Materials/TEX/PNG/Hair_SGM.png.meta | 147 + .../Materials/TEX/PNG/Headfgear_Base.png | 3 + .../Materials/TEX/PNG/Headfgear_Base.png.meta | 147 + .../Materials/TEX/PNG/Skin_Base.png | 3 + .../Materials/TEX/PNG/Skin_Base.png.meta | 147 + .../Materials/TEX/PNG/Skin_Emi.png | 3 + .../Materials/TEX/PNG/Skin_Emi.png.meta | 147 + .../Materials/TEX/PNG/Skin_Nrm.png | 3 + .../Materials/TEX/PNG/Skin_Nrm.png.meta | 147 + .../Materials/TEX/PNG/Skin_Rim.png | 3 + .../Materials/TEX/PNG/Skin_Rim.png.meta | 147 + .../Materials/TEX/PNG/Skin_SGM.png | 3 + .../Materials/TEX/PNG/Skin_SGM.png.meta | 147 + .../Materials/TEX/PNG/Skin_Spc.png | 3 + .../Materials/TEX/PNG/Skin_Spc.png.meta | 147 + .../Materials/TEX/PNG/Skin_SpcCol.png | 3 + .../Materials/TEX/PNG/Skin_SpcCol.png.meta | 147 + .../UnityChanKAGURA/Materials/face3_main.mat | 201 + .../Materials/face3_main.mat.meta | 15 + .../UnityChanKAGURA/Materials/headExt.mat | 201 + .../Materials/headExt.mat.meta | 15 + .../UnityChanKAGURA/UniteInTheSky.controller | 460 ++ .../UniteInTheSky.controller.meta | 15 + .../UnityChanKAGURA/UnityCHanKAGURA.fbx | 3 + .../UnityChanKAGURA/UnityCHanKAGURA.fbx.meta | 2266 +++++++++ .../UnityCHanKAGURA_MC2.prefab | 3 + .../UnityCHanKAGURA_MC2.prefab.meta | 14 + Assets/MagicaCloth2/MagicaCloth2.asmdef | 37 + Assets/MagicaCloth2/MagicaCloth2.asmdef.meta | 14 + Assets/MagicaCloth2/Readme.txt | 60 + Assets/MagicaCloth2/Readme.txt.meta | 14 + Assets/MagicaCloth2/Readme_jpn.txt | 60 + Assets/MagicaCloth2/Readme_jpn.txt.meta | 14 + Assets/MagicaCloth2/Res.meta | 8 + Assets/MagicaCloth2/Res/Icon.meta | 8 + Assets/MagicaCloth2/Res/Icon/icon-cloth.png | 3 + .../MagicaCloth2/Res/Icon/icon-cloth.png.meta | 131 + .../MagicaCloth2/Res/Icon/icon-collider.png | 3 + .../Res/Icon/icon-collider.png.meta | 143 + .../MagicaCloth2/Res/Icon/icon-settings.png | 3 + .../Res/Icon/icon-settings.png.meta | 142 + Assets/MagicaCloth2/Res/Icon/icon-wind.png | 3 + .../MagicaCloth2/Res/Icon/icon-wind.png.meta | 142 + Assets/MagicaCloth2/Res/Preset.meta | 8 + .../Res/Preset/MC2_Preset_Accessory.json | 1 + .../Res/Preset/MC2_Preset_Accessory.json.meta | 14 + .../Res/Preset/MC2_Preset_Cape.json | 1 + .../Res/Preset/MC2_Preset_Cape.json.meta | 14 + .../Res/Preset/MC2_Preset_FrontHair.json | 1 + .../Res/Preset/MC2_Preset_FrontHair.json.meta | 14 + .../Res/Preset/MC2_Preset_HardSpring.json | 1 + .../Preset/MC2_Preset_HardSpring.json.meta | 14 + .../Res/Preset/MC2_Preset_LongHair.json | 1 + .../Res/Preset/MC2_Preset_LongHair.json.meta | 14 + .../Res/Preset/MC2_Preset_MiddleSpring.json | 1 + .../Preset/MC2_Preset_MiddleSpring.json.meta | 14 + .../Res/Preset/MC2_Preset_ShortHair.json | 1 + .../Res/Preset/MC2_Preset_ShortHair.json.meta | 14 + .../Res/Preset/MC2_Preset_Skirt.json | 1 + .../Res/Preset/MC2_Preset_Skirt.json.meta | 14 + .../Res/Preset/MC2_Preset_SoftSkirt.json | 1 + .../Res/Preset/MC2_Preset_SoftSkirt.json.meta | 14 + .../Res/Preset/MC2_Preset_SoftSpring.json | 1 + .../Preset/MC2_Preset_SoftSpring.json.meta | 14 + .../Res/Preset/MC2_Preset_Tail.json | 1 + .../Res/Preset/MC2_Preset_Tail.json.meta | 14 + Assets/MagicaCloth2/Scripts.meta | 8 + Assets/MagicaCloth2/Scripts/Core.meta | 8 + Assets/MagicaCloth2/Scripts/Core/Cloth.meta | 8 + .../Core/Cloth/CheckSliderSerializeData.cs | 57 + .../Cloth/CheckSliderSerializeData.cs.meta | 18 + .../Scripts/Core/Cloth/ClothBehaviour.cs | 29 + .../Scripts/Core/Cloth/ClothBehaviour.cs.meta | 18 + .../Scripts/Core/Cloth/ClothDisableMode.cs | 22 + .../Core/Cloth/ClothDisableMode.cs.meta | 18 + .../Scripts/Core/Cloth/ClothForceMode.cs | 36 + .../Scripts/Core/Cloth/ClothForceMode.cs.meta | 18 + .../Core/Cloth/ClothInitSerializeData.cs | 211 + .../Core/Cloth/ClothInitSerializeData.cs.meta | 18 + .../Scripts/Core/Cloth/ClothMeshWriteMode.cs | 25 + .../Core/Cloth/ClothMeshWriteMode.cs.meta | 18 + .../Scripts/Core/Cloth/ClothNormalAxis.cs | 27 + .../Core/Cloth/ClothNormalAxis.cs.meta | 18 + .../Scripts/Core/Cloth/ClothParameters.cs | 99 + .../Core/Cloth/ClothParameters.cs.meta | 18 + .../Scripts/Core/Cloth/ClothProcess.cs | 1588 +++++++ .../Scripts/Core/Cloth/ClothProcess.cs.meta | 18 + .../Scripts/Core/Cloth/ClothProcessData.cs | 509 ++ .../Core/Cloth/ClothProcessData.cs.meta | 18 + .../Core/Cloth/ClothProcessGeneration.cs | 120 + .../Core/Cloth/ClothProcessGeneration.cs.meta | 18 + .../Scripts/Core/Cloth/ClothSerializeData.cs | 278 ++ .../Core/Cloth/ClothSerializeData.cs.meta | 18 + .../Scripts/Core/Cloth/ClothSerializeData2.cs | 94 + .../Core/Cloth/ClothSerializeData2.cs.meta | 18 + .../Core/Cloth/ClothSerializeDataFunction.cs | 448 ++ .../Cloth/ClothSerializeDataFunction.cs.meta | 18 + .../Scripts/Core/Cloth/ClothUpdateMode.cs | 36 + .../Core/Cloth/ClothUpdateMode.cs.meta | 18 + .../Scripts/Core/Cloth/Collider.meta | 8 + .../Core/Cloth/Collider/ColliderComponent.cs | 434 ++ .../Cloth/Collider/ColliderComponent.cs.meta | 18 + .../Cloth/Collider/ColliderSymmetryMode.cs | 52 + .../Collider/ColliderSymmetryMode.cs.meta | 18 + .../Cloth/Collider/MagicaCapsuleCollider.cs | 132 + .../Collider/MagicaCapsuleCollider.cs.meta | 18 + .../Cloth/Collider/MagicaPlaneCollider.cs | 28 + .../Collider/MagicaPlaneCollider.cs.meta | 18 + .../Cloth/Collider/MagicaSphereCollider.cs | 34 + .../Collider/MagicaSphereCollider.cs.meta | 18 + .../Scripts/Core/Cloth/Constraints.meta | 8 + .../Core/Cloth/Constraints/AngleConstraint.cs | 594 +++ .../Cloth/Constraints/AngleConstraint.cs.meta | 18 + .../ColliderCollisionConstraint.cs | 1065 +++++ .../ColliderCollisionConstraint.cs.meta | 18 + .../Cloth/Constraints/DistanceConstraint.cs | 536 +++ .../Constraints/DistanceConstraint.cs.meta | 18 + .../Cloth/Constraints/InertiaConstraint.cs | 636 +++ .../Constraints/InertiaConstraint.cs.meta | 18 + .../Cloth/Constraints/MotionConstraint.cs | 292 ++ .../Constraints/MotionConstraint.cs.meta | 18 + .../Constraints/SelfCollisionConstraint.cs | 2320 +++++++++ .../SelfCollisionConstraint.cs.meta | 18 + .../Cloth/Constraints/SpringConstraint.cs | 130 + .../Constraints/SpringConstraint.cs.meta | 18 + .../Cloth/Constraints/TetherConstraint.cs | 203 + .../Constraints/TetherConstraint.cs.meta | 18 + .../Constraints/TriangleBendingConstraint.cs | 738 +++ .../TriangleBendingConstraint.cs.meta | 18 + .../Scripts/Core/Cloth/CullingSettings.cs | 162 + .../Core/Cloth/CullingSettings.cs.meta | 18 + .../Scripts/Core/Cloth/CurveSerializeData.cs | 122 + .../Core/Cloth/CurveSerializeData.cs.meta | 18 + .../Core/Cloth/CustomSkinningSettings.cs | 100 + .../Core/Cloth/CustomSkinningSettings.cs.meta | 18 + .../Scripts/Core/Cloth/GizmoSerializeData.cs | 36 + .../Core/Cloth/GizmoSerializeData.cs.meta | 18 + .../Scripts/Core/Cloth/MagicaCloth.cs | 142 + .../Scripts/Core/Cloth/MagicaCloth.cs.meta | 18 + .../Scripts/Core/Cloth/MagicaClothAPI.cs | 353 ++ .../Scripts/Core/Cloth/MagicaClothAPI.cs.meta | 18 + .../Cloth/MagicaClothAnimationProperty.cs | 130 + .../MagicaClothAnimationProperty.cs.meta | 18 + .../Core/Cloth/NormalAlignmentSettings.cs | 107 + .../Cloth/NormalAlignmentSettings.cs.meta | 18 + .../Scripts/Core/Cloth/SelectionData.cs | 445 ++ .../Scripts/Core/Cloth/SelectionData.cs.meta | 18 + .../MagicaCloth2/Scripts/Core/Cloth/Wind.meta | 8 + .../Scripts/Core/Cloth/Wind/MagicaWindZone.cs | 204 + .../Core/Cloth/Wind/MagicaWindZone.cs.meta | 18 + .../Scripts/Core/Cloth/Wind/WindParams.cs | 36 + .../Core/Cloth/Wind/WindParams.cs.meta | 18 + .../Scripts/Core/Cloth/Wind/WindSettings.cs | 109 + .../Core/Cloth/Wind/WindSettings.cs.meta | 18 + Assets/MagicaCloth2/Scripts/Core/Define.meta | 8 + .../Scripts/Core/Define/ResultDefine.cs | 182 + .../Scripts/Core/Define/ResultDefine.cs.meta | 18 + .../Scripts/Core/Define/SystemDefine.cs | 430 ++ .../Scripts/Core/Define/SystemDefine.cs.meta | 18 + .../MagicaCloth2/Scripts/Core/Interface.meta | 8 + .../Scripts/Core/Interface/ICount.cs | 14 + .../Scripts/Core/Interface/ICount.cs.meta | 18 + .../Scripts/Core/Interface/IDataValidate.cs | 14 + .../Core/Interface/IDataValidate.cs.meta | 18 + .../Scripts/Core/Interface/ITransform.cs | 25 + .../Scripts/Core/Interface/ITransform.cs.meta | 18 + .../Scripts/Core/Interface/IValid.cs | 14 + .../Scripts/Core/Interface/IValid.cs.meta | 18 + Assets/MagicaCloth2/Scripts/Core/Manager.meta | 8 + .../Scripts/Core/Manager/Cloth.meta | 8 + .../Core/Manager/Cloth/ClothManager.cs | 337 ++ .../Core/Manager/Cloth/ClothManager.cs.meta | 18 + .../Core/Manager/Cloth/PreBuildManager.cs | 301 ++ .../Manager/Cloth/PreBuildManager.cs.meta | 18 + .../Scripts/Core/Manager/IManager.cs | 28 + .../Scripts/Core/Manager/IManager.cs.meta | 18 + .../Scripts/Core/Manager/MagicaManager.cs | 484 ++ .../Core/Manager/MagicaManager.cs.meta | 18 + .../Scripts/Core/Manager/MagicaManagerAPI.cs | 224 + .../Core/Manager/MagicaManagerAPI.cs.meta | 18 + .../Scripts/Core/Manager/MagicaSettings.cs | 169 + .../Core/Manager/MagicaSettings.cs.meta | 18 + .../Scripts/Core/Manager/Render.meta | 8 + .../Scripts/Core/Manager/Render/RenderData.cs | 427 ++ .../Core/Manager/Render/RenderData.cs.meta | 18 + .../Core/Manager/Render/RenderManager.cs | 403 ++ .../Core/Manager/Render/RenderManager.cs.meta | 18 + .../Core/Manager/Render/RenderSetupData.cs | 911 ++++ .../Manager/Render/RenderSetupData.cs.meta | 18 + .../Render/RenderSetupDataSerialization.cs | 202 + .../RenderSetupDataSerialization.cs.meta | 18 + .../Render/RenderSetupSerializeData.cs | 355 ++ .../Render/RenderSetupSerializeData.cs.meta | 18 + .../Scripts/Core/Manager/Simulation.meta | 8 + .../Manager/Simulation/ColliderManager.cs | 1317 +++++ .../Simulation/ColliderManager.cs.meta | 18 + .../Manager/Simulation/SimulationManager.cs | 1476 ++++++ .../Simulation/SimulationManager.cs.meta | 18 + .../Simulation/SimulationManagerNormal.cs | 1797 +++++++ .../SimulationManagerNormal.cs.meta | 18 + .../Simulation/SimulationManagerSplit.cs | 2373 ++++++++++ .../Simulation/SimulationManagerSplit.cs.meta | 18 + .../Core/Manager/Simulation/TimeManager.cs | 159 + .../Manager/Simulation/TimeManager.cs.meta | 18 + .../Core/Manager/Simulation/WindManager.cs | 229 + .../Manager/Simulation/WindManager.cs.meta | 18 + .../Scripts/Core/Manager/Team.meta | 8 + .../Scripts/Core/Manager/Team/TeamManager.cs | 2926 ++++++++++++ .../Core/Manager/Team/TeamManager.cs.meta | 18 + .../Scripts/Core/Manager/Team/TeamWindData.cs | 110 + .../Core/Manager/Team/TeamWindData.cs.meta | 18 + .../Core/Manager/TransformManager.meta | 8 + .../Manager/TransformManager/TransformData.cs | 967 ++++ .../TransformManager/TransformData.cs.meta | 18 + .../TransformDataSerialization.cs | 117 + .../TransformDataSerialization.cs.meta | 18 + .../TransformManager/TransformManager.cs | 1105 +++++ .../TransformManager/TransformManager.cs.meta | 18 + .../TransformManager/TransformRecord.cs | 78 + .../TransformManager/TransformRecord.cs.meta | 18 + .../TransformRecordSerializeData.cs | 82 + .../TransformRecordSerializeData.cs.meta | 18 + .../Scripts/Core/Manager/VirtualMesh.meta | 8 + .../Manager/VirtualMesh/VirtualMeshManager.cs | 1719 +++++++ .../VirtualMesh/VirtualMeshManager.cs.meta | 18 + .../MagicaCloth2/Scripts/Core/PreBuild.meta | 8 + .../Core/PreBuild/PreBuildScriptableObject.cs | 64 + .../PreBuild/PreBuildScriptableObject.cs.meta | 18 + .../Core/PreBuild/PreBuildSerializeData.cs | 101 + .../PreBuild/PreBuildSerializeData.cs.meta | 18 + .../Core/PreBuild/SharePreBuildData.cs | 69 + .../Core/PreBuild/SharePreBuildData.cs.meta | 18 + .../Core/PreBuild/UniquePreBuildData.cs | 49 + .../Core/PreBuild/UniquePreBuildData.cs.meta | 18 + .../MagicaCloth2/Scripts/Core/Reduction.meta | 8 + .../Core/Reduction/ReductionSettings.cs | 77 + .../Core/Reduction/ReductionSettings.cs.meta | 18 + .../Core/Reduction/ReductionWorkData.cs | 141 + .../Core/Reduction/ReductionWorkData.cs.meta | 18 + .../Core/Reduction/SameDistanceReduction.cs | 560 +++ .../Reduction/SameDistanceReduction.cs.meta | 18 + .../Core/Reduction/ShapeDistanceReduction.cs | 145 + .../Reduction/ShapeDistanceReduction.cs.meta | 18 + .../Core/Reduction/SimpleDistanceReduction.cs | 182 + .../Reduction/SimpleDistanceReduction.cs.meta | 18 + .../Core/Reduction/StepReductionBase.cs | 773 +++ .../Core/Reduction/StepReductionBase.cs.meta | 18 + .../MagicaCloth2/Scripts/Core/Settings.meta | 8 + .../Core/Settings/ClothDebugSettings.cs | 120 + .../Core/Settings/ClothDebugSettings.cs.meta | 18 + .../Core/Settings/VirtualMeshDebugSettings.cs | 54 + .../Settings/VirtualMeshDebugSettings.cs.meta | 18 + Assets/MagicaCloth2/Scripts/Core/Utility.meta | 8 + .../Scripts/Core/Utility/Data.meta | 8 + .../Scripts/Core/Utility/Data/DataUtility.cs | 528 +++ .../Core/Utility/Data/DataUtility.cs.meta | 18 + .../Core/Utility/Data/MagicaObjectId.cs | 98 + .../Core/Utility/Data/MagicaObjectId.cs.meta | 18 + .../Core/Utility/Data/MultiDataBuilder.cs | 133 + .../Utility/Data/MultiDataBuilder.cs.meta | 18 + .../Scripts/Core/Utility/Grid.meta | 8 + .../Scripts/Core/Utility/Grid/GridMap.cs | 233 + .../Scripts/Core/Utility/Grid/GridMap.cs.meta | 18 + .../Scripts/Core/Utility/Jobs.meta | 8 + .../Core/Utility/Jobs/InterlockUtility.cs | 114 + .../Utility/Jobs/InterlockUtility.cs.meta | 18 + .../Scripts/Core/Utility/Jobs/JobUtility.cs | 717 +++ .../Core/Utility/Jobs/JobUtility.cs.meta | 18 + .../Scripts/Core/Utility/Math.meta | 8 + .../Scripts/Core/Utility/Math/AABB.cs | 238 + .../Scripts/Core/Utility/Math/AABB.cs.meta | 18 + .../Scripts/Core/Utility/Math/IntAABB.cs | 158 + .../Scripts/Core/Utility/Math/IntAABB.cs.meta | 18 + .../Core/Utility/Math/MathExtensions.cs | 61 + .../Core/Utility/Math/MathExtensions.cs.meta | 18 + .../Scripts/Core/Utility/Math/MathUtility.cs | 1814 +++++++ .../Core/Utility/Math/MathUtility.cs.meta | 18 + .../Scripts/Core/Utility/Math/MinimumData.cs | 57 + .../Core/Utility/Math/MinimumData.cs.meta | 18 + .../Scripts/Core/Utility/Mesh.meta | 8 + .../Scripts/Core/Utility/Mesh/MeshUtility.cs | 99 + .../Core/Utility/Mesh/MeshUtility.cs.meta | 18 + .../Scripts/Core/Utility/Misc.meta | 8 + .../Scripts/Core/Utility/Misc/Develop.cs | 53 + .../Scripts/Core/Utility/Misc/Develop.cs.meta | 18 + .../Core/Utility/Misc/StaticStringBuilder.cs | 97 + .../Utility/Misc/StaticStringBuilder.cs.meta | 18 + .../Core/Utility/NativeCollection.meta | 8 + .../Utility/NativeCollection/DataChunk.cs | 55 + .../NativeCollection/DataChunk.cs.meta | 18 + .../Utility/NativeCollection/ExBitFlag16.cs | 51 + .../NativeCollection/ExBitFlag16.cs.meta | 18 + .../Utility/NativeCollection/ExBitFlag8.cs | 52 + .../NativeCollection/ExBitFlag8.cs.meta | 18 + .../NativeCollection/ExCostSortedList1.cs | 73 + .../ExCostSortedList1.cs.meta | 18 + .../NativeCollection/ExCostSortedList4.cs | 186 + .../ExCostSortedList4.cs.meta | 18 + .../Utility/NativeCollection/ExNativeArray.cs | 709 +++ .../NativeCollection/ExNativeArray.cs.meta | 18 + .../NativeCollection/ExProcessingList.cs | 80 + .../NativeCollection/ExProcessingList.cs.meta | 18 + .../NativeCollection/ExSimpleNativeArray.cs | 603 +++ .../ExSimpleNativeArray.cs.meta | 18 + .../ExTransformAccessArray.cs | 210 + .../ExTransformAccessArray.cs.meta | 18 + .../FixedList128BytesExtensions.cs | 117 + .../FixedList128BytesExtensions.cs.meta | 18 + .../FixedList32BytesExtensions.cs | 117 + .../FixedList32BytesExtensions.cs.meta | 18 + .../FixedList4096BytesExtensions.cs | 117 + .../FixedList4096BytesExtensions.cs.meta | 18 + .../FixedList512BytesExtensions.cs | 117 + .../FixedList512BytesExtensions.cs.meta | 18 + .../FixedList64BytesExtensions.cs | 117 + .../FixedList64BytesExtensions.cs.meta | 18 + .../NativeCollection/NativeArrayExtensions.cs | 85 + .../NativeArrayExtensions.cs.meta | 18 + .../NativeMultiHashMapExtensions.cs | 227 + .../NativeMultiHashMapExtensions.cs.meta | 18 + .../NativeParallelHashMapExtensions.cs | 30 + .../NativeParallelHashMapExtensions.cs.meta | 18 + .../NativeReferenceExtensions.cs | 28 + .../NativeReferenceExtensions.cs.meta | 18 + .../Scripts/Core/Utility/ResultCode.meta | 8 + .../Core/Utility/ResultCode/Exception.cs | 31 + .../Core/Utility/ResultCode/Exception.cs.meta | 18 + .../Core/Utility/ResultCode/ResultCode.cs | 165 + .../Utility/ResultCode/ResultCode.cs.meta | 18 + .../Scripts/Core/Utility/Time.meta | 8 + .../Scripts/Core/Utility/Time/TimeSpan.cs | 71 + .../Core/Utility/Time/TimeSpan.cs.meta | 18 + .../Core/Utility/Time/UnityTimeSpan.cs | 56 + .../Core/Utility/Time/UnityTimeSpan.cs.meta | 18 + .../Scripts/Core/VirtualMesh.meta | 8 + .../Scripts/Core/VirtualMesh/Function.meta | 8 + .../Function/VirtualMeshInputOutput.cs | 1910 ++++++++ .../Function/VirtualMeshInputOutput.cs.meta | 18 + .../Function/VirtualMeshMapping.cs | 710 +++ .../Function/VirtualMeshMapping.cs.meta | 18 + .../Function/VirtualMeshOptimization.cs | 237 + .../Function/VirtualMeshOptimization.cs.meta | 18 + .../VirtualMesh/Function/VirtualMeshProxy.cs | 2426 ++++++++++ .../Function/VirtualMeshProxy.cs.meta | 18 + .../Function/VirtualMeshReduction.cs | 892 ++++ .../Function/VirtualMeshReduction.cs.meta | 18 + .../Function/VirtualMeshSerialization.cs | 291 ++ .../Function/VirtualMeshSerialization.cs.meta | 18 + .../VirtualMesh/Function/VirtualMeshWork.cs | 465 ++ .../Function/VirtualMeshWork.cs.meta | 18 + .../Core/VirtualMesh/VertexAttribute.cs | 167 + .../Core/VirtualMesh/VertexAttribute.cs.meta | 18 + .../Scripts/Core/VirtualMesh/VirtualMesh.cs | 534 +++ .../Core/VirtualMesh/VirtualMesh.cs.meta | 18 + .../Core/VirtualMesh/VirtualMeshBoneWeight.cs | 142 + .../VirtualMesh/VirtualMeshBoneWeight.cs.meta | 18 + .../Core/VirtualMesh/VirtualMeshContainer.cs | 60 + .../VirtualMesh/VirtualMeshContainer.cs.meta | 18 + .../Core/VirtualMesh/VirtualMeshPrimitive.cs | 14 + .../VirtualMesh/VirtualMeshPrimitive.cs.meta | 18 + .../Core/VirtualMesh/VirtualMeshRaycastHit.cs | 35 + .../VirtualMesh/VirtualMeshRaycastHit.cs.meta | 18 + .../Core/VirtualMesh/VirtualMeshTransform.cs | 168 + .../VirtualMesh/VirtualMeshTransform.cs.meta | 18 + Assets/MagicaCloth2/Scripts/Editor.meta | 8 + Assets/MagicaCloth2/Scripts/Editor/Cloth.meta | 8 + .../Editor/Cloth/ClothAssetPostprocessor.cs | 41 + .../Cloth/ClothAssetPostprocessor.cs.meta | 18 + .../Editor/Cloth/ClothEditorManager.cs | 1110 +++++ .../Editor/Cloth/ClothEditorManager.cs.meta | 18 + .../Editor/Cloth/ClothEditorUtility.cs | 1161 +++++ .../Editor/Cloth/ClothEditorUtility.cs.meta | 18 + .../Editor/Cloth/ClothInspectorUtility.cs | 76 + .../Cloth/ClothInspectorUtility.cs.meta | 18 + .../Scripts/Editor/Cloth/ClothPainter.cs | 949 ++++ .../Scripts/Editor/Cloth/ClothPainter.cs.meta | 18 + .../Editor/Cloth/ClothPresetUtility.cs | 232 + .../Editor/Cloth/ClothPresetUtility.cs.meta | 18 + .../Cloth/MagicaCapsuleColliderEditor.cs | 118 + .../Cloth/MagicaCapsuleColliderEditor.cs.meta | 18 + .../Scripts/Editor/Cloth/MagicaClothEditor.cs | 951 ++++ .../Editor/Cloth/MagicaClothEditor.cs.meta | 18 + .../Scripts/Editor/Cloth/MagicaEditorBase.cs | 40 + .../Editor/Cloth/MagicaEditorBase.cs.meta | 18 + .../Editor/Cloth/MagicaPlaneColliderEditor.cs | 35 + .../Cloth/MagicaPlaneColliderEditor.cs.meta | 18 + .../Editor/Cloth/MagicaSettingsEditor.cs | 37 + .../Editor/Cloth/MagicaSettingsEditor.cs.meta | 18 + .../Cloth/MagicaSphereColliderEditor.cs | 50 + .../Cloth/MagicaSphereColliderEditor.cs.meta | 18 + .../Editor/Cloth/MagicaWindZoneEditor.cs | 77 + .../Editor/Cloth/MagicaWindZoneEditor.cs.meta | 18 + .../Editor/Cloth/VirtualMeshEditorUtility.cs | 538 +++ .../Cloth/VirtualMeshEditorUtility.cs.meta | 18 + .../Scripts/Editor/EditorExtension.meta | 8 + .../Editor/EditorExtension/AboutMenu.cs | 96 + .../Editor/EditorExtension/AboutMenu.cs.meta | 20 + .../CheckSliderSerializeDataDrawer.cs | 60 + .../CheckSliderSerializeDataDrawer.cs.meta | 18 + .../CurveSerializeDataDrawer.cs | 80 + .../CurveSerializeDataDrawer.cs.meta | 18 + .../EditorExtension/DrawIconInHierarchy.cs | 75 + .../DrawIconInHierarchy.cs.meta | 18 + .../Editor/EditorExtension/MenuItemScript.cs | 222 + .../EditorExtension/MenuItemScript.cs.meta | 18 + .../SharePreBuildDataDrawer.cs | 76 + .../SharePreBuildDataDrawer.cs.meta | 18 + .../MagicaCloth2/Scripts/Editor/Gizmos.meta | 8 + .../Scripts/Editor/Gizmos/GizmoUtility.cs | 693 +++ .../Editor/Gizmos/GizmoUtility.cs.meta | 18 + .../MagicaCapsuleColliderGizmoDrawer.cs | 19 + .../MagicaCapsuleColliderGizmoDrawer.cs.meta | 18 + .../Editor/Gizmos/MagicaClothGizmoDrawer.cs | 19 + .../Gizmos/MagicaClothGizmoDrawer.cs.meta | 18 + .../Gizmos/MagicaPlaneColliderGizmoDrawer.cs | 19 + .../MagicaPlaneColliderGizmoDrawer.cs.meta | 18 + .../Gizmos/MagicaSphereColliderGizmoDrawer.cs | 19 + .../MagicaSphereColliderGizmoDrawer.cs.meta | 18 + .../Gizmos/MagicaWindZoneGizmoDrawer.cs | 16 + .../Gizmos/MagicaWindZoneGizmoDrawer.cs.meta | 18 + .../Scripts/Editor/MagicaCloth2.Editor.asmdef | 35 + .../Editor/MagicaCloth2.Editor.asmdef.meta | 14 + .../MagicaCloth2/Scripts/Editor/PreBuild.meta | 8 + .../Editor/PreBuild/PreBuildDataCreation.cs | 514 ++ .../PreBuild/PreBuildDataCreation.cs.meta | 18 + .../Scripts/Editor/UnityPackageImporter.meta | 8 + .../Editor/UnityPackageImporter/Burst.meta | 8 + .../Burst/MagicaCloth2UPMImporterBurst.asmdef | 24 + .../MagicaCloth2UPMImporterBurst.asmdef.meta | 14 + .../Burst/UnityPackageImporter.cs | 33 + .../Burst/UnityPackageImporter.cs.meta | 18 + .../UnityPackageImporter/Collections.meta | 8 + .../MagicaCloth2UPMImporterCollections.asmdef | 24 + ...caCloth2UPMImporterCollections.asmdef.meta | 14 + .../Collections/UnityPackageImporter.cs | 33 + .../Collections/UnityPackageImporter.cs.meta | 18 + Assets/RealToon.meta | 8 + Assets/RealToon/Editor.meta | 8 + Assets/RealToon/Editor/RT_Welcome.cs | 584 +++ Assets/RealToon/Editor/RT_Welcome.cs.meta | 18 + Assets/RealToon/Editor/RealToonShaderCache.cs | 129 + .../Editor/RealToonShaderCache.cs.meta | 9 + .../Editor/RealToonShaderGUI_URP_SRP.cs | 4216 +++++++++++++++++ .../Editor/RealToonShaderGUI_URP_SRP.cs.meta | 11 + .../Editor/RealToon_Settings_Options.cs | 37 + .../Editor/RealToon_Settings_Options.cs.meta | 2 + .../RealToon/Editor/SwapShaderToRealToon.cs | 1848 ++++++++ .../Editor/SwapShaderToRealToon.cs.meta | 18 + Assets/RealToon/RealToon Shaders.meta | 8 + .../RealToon Shaders/RealToon Core.meta | 8 + .../RealToon Shaders/RealToon Core/URP.meta | 8 + .../RealToon Core/URP/Pass.meta | 8 + .../URP/Pass/RT_URP_MoVecPas.hlsl | 148 + .../URP/Pass/RT_URP_MoVecPas.hlsl.meta | 7 + .../RealToon Core/URP/RT_URP_Core.hlsl | 1560 ++++++ .../RealToon Core/URP/RT_URP_Core.hlsl.meta | 7 + .../RealToon Core/URP/RT_URP_PROP.hlsl | 1085 +++++ .../RealToon Core/URP/RT_URP_PROP.hlsl.meta | 7 + .../RealToon/RealToon Shaders/Version 5.meta | 8 + .../RealToon Shaders/Version 5/URP.meta | 8 + .../Version 5/URP/Default.meta | 8 + .../URP/Default/D_Default_URP.shader | 4184 ++++++++++++++++ .../URP/Default/D_Default_URP.shader.meta | 9 + Assets/RealToon/RealToon Tools.meta | 8 + .../RealToon Tools/CustomShadowResolution.cs | 57 + .../CustomShadowResolution.cs.meta | 19 + .../RealToon Tools/FrameByFrameRendering.meta | 8 + .../FrameByFrameRendering_Default.cs | 236 + .../FrameByFrameRendering_Default.cs.meta | 20 + .../FrameByFrameRendering_Manual.cs | 177 + .../FrameByFrameRendering_Manual.cs.meta | 19 + .../PerspectiveAdjustmentController.cs | 407 ++ .../PerspectiveAdjustmentController.cs.meta | 9 + .../RealToon Tools/ShadowTSDFModeHelper.cs | 192 + .../ShadowTSDFModeHelper.cs.meta | 9 + .../RealToon Tools/SmearEffectHelper.cs | 314 ++ .../RealToon Tools/SmearEffectHelper.cs.meta | 9 + .../SmoothObjectNormalHelper.cs | 128 + .../SmoothObjectNormalHelper.cs.meta | 18 + ProjectSettings/ProjectSettings.asset | 4 +- 849 files changed, 116860 insertions(+), 2 deletions(-) create mode 100644 Assets/04_Models/Characters/Fariy.meta create mode 100644 Assets/04_Models/Characters/Fariy/Animations.meta create mode 100644 Assets/04_Models/Characters/Fariy/Animations/FairyAnimController.controller create mode 100644 Assets/04_Models/Characters/Fariy/Animations/FairyAnimController.controller.meta create mode 100644 Assets/04_Models/Characters/Fariy/Animations/FairyFly_Idle_FlapWings.anim create mode 100644 Assets/04_Models/Characters/Fariy/Animations/FairyFly_Idle_FlapWings.anim.meta create mode 100644 Assets/04_Models/Characters/Fariy/FBX.meta create mode 100644 Assets/04_Models/Characters/Fariy/FBX/Alistia.fbx create mode 100644 Assets/04_Models/Characters/Fariy/FBX/Alistia.fbx.meta create mode 100644 Assets/04_Models/Characters/Fariy/FBX/Alistia_Hair.fbx create mode 100644 Assets/04_Models/Characters/Fariy/FBX/Alistia_Hair.fbx.meta create mode 100644 Assets/04_Models/Characters/Fariy/FBX/Fairy_wing.fbx create mode 100644 Assets/04_Models/Characters/Fariy/FBX/Fairy_wing.fbx.meta create mode 100644 Assets/04_Models/Characters/Fariy/Fairy.prefab create mode 100644 Assets/04_Models/Characters/Fariy/Fairy.prefab.meta create mode 100644 Assets/04_Models/Characters/Fariy/Materials.meta create mode 100644 Assets/04_Models/Characters/Fariy/Materials/Body_Hair.meta create mode 100644 Assets/04_Models/Characters/Fariy/Materials/Body_Hair/Alistia_Body.mat create mode 100644 Assets/04_Models/Characters/Fariy/Materials/Body_Hair/Alistia_Body.mat.meta create mode 100644 Assets/04_Models/Characters/Fariy/Materials/Body_Hair/Alistia_Face.mat create mode 100644 Assets/04_Models/Characters/Fariy/Materials/Body_Hair/Alistia_Face.mat.meta create mode 100644 Assets/04_Models/Characters/Fariy/Materials/Body_Hair/Alistia_Face_Alpha.mat create mode 100644 Assets/04_Models/Characters/Fariy/Materials/Body_Hair/Alistia_Face_Alpha.mat.meta create mode 100644 Assets/04_Models/Characters/Fariy/Materials/Body_Hair/Alistia_Hair.mat create mode 100644 Assets/04_Models/Characters/Fariy/Materials/Body_Hair/Alistia_Hair.mat.meta create mode 100644 Assets/04_Models/Characters/Fariy/Materials/Cloth.meta create mode 100644 Assets/04_Models/Characters/Fariy/Materials/Cloth/Alistia_Cloth_1_Blue.mat create mode 100644 Assets/04_Models/Characters/Fariy/Materials/Cloth/Alistia_Cloth_1_Blue.mat.meta create mode 100644 Assets/04_Models/Characters/Fariy/Materials/Cloth/Alistia_Cloth_1_Blue_Lace.mat create mode 100644 Assets/04_Models/Characters/Fariy/Materials/Cloth/Alistia_Cloth_1_Blue_Lace.mat.meta create mode 100644 Assets/04_Models/Characters/Fariy/Materials/Cloth/Alistia_Cloth_2_Lace.mat create mode 100644 Assets/04_Models/Characters/Fariy/Materials/Cloth/Alistia_Cloth_2_Lace.mat.meta create mode 100644 Assets/04_Models/Characters/Fariy/Materials/Komono.meta create mode 100644 Assets/04_Models/Characters/Fariy/Materials/Komono/Jewel_Blue.mat create mode 100644 Assets/04_Models/Characters/Fariy/Materials/Komono/Jewel_Blue.mat.meta create mode 100644 Assets/04_Models/Characters/Fariy/Materials/Komono/Metal_Gold.mat create mode 100644 Assets/04_Models/Characters/Fariy/Materials/Komono/Metal_Gold.mat.meta create mode 100644 Assets/04_Models/Characters/Fariy/Materials/wing_effects.mat create mode 100644 Assets/04_Models/Characters/Fariy/Materials/wing_effects.mat.meta create mode 100644 Assets/04_Models/Characters/Fariy/Materials/wing_mat.mat create mode 100644 Assets/04_Models/Characters/Fariy/Materials/wing_mat.mat.meta create mode 100644 Assets/04_Models/Characters/Fariy/Materials/wing_trail.mat create mode 100644 Assets/04_Models/Characters/Fariy/Materials/wing_trail.mat.meta create mode 100644 Assets/04_Models/Characters/Fariy/Textures.meta create mode 100644 Assets/04_Models/Characters/Fariy/Textures/Body_Hair.meta create mode 100644 Assets/04_Models/Characters/Fariy/Textures/Body_Hair/Alistia_Body.png create mode 100644 Assets/04_Models/Characters/Fariy/Textures/Body_Hair/Alistia_Body.png.meta create mode 100644 Assets/04_Models/Characters/Fariy/Textures/Body_Hair/Alistia_Face.png create mode 100644 Assets/04_Models/Characters/Fariy/Textures/Body_Hair/Alistia_Face.png.meta create mode 100644 Assets/04_Models/Characters/Fariy/Textures/Body_Hair/Alistia_Face_Alpha.png create mode 100644 Assets/04_Models/Characters/Fariy/Textures/Body_Hair/Alistia_Face_Alpha.png.meta create mode 100644 Assets/04_Models/Characters/Fariy/Textures/Body_Hair/Alistia_Face_mask.png create mode 100644 Assets/04_Models/Characters/Fariy/Textures/Body_Hair/Alistia_Face_mask.png.meta create mode 100644 Assets/04_Models/Characters/Fariy/Textures/Body_Hair/Alistia_Hair.png create mode 100644 Assets/04_Models/Characters/Fariy/Textures/Body_Hair/Alistia_Hair.png.meta create mode 100644 Assets/04_Models/Characters/Fariy/Textures/Body_Hair/Alistia_Hair_Mask.png create mode 100644 Assets/04_Models/Characters/Fariy/Textures/Body_Hair/Alistia_Hair_Mask.png.meta create mode 100644 Assets/04_Models/Characters/Fariy/Textures/Cloth.meta create mode 100644 Assets/04_Models/Characters/Fariy/Textures/Cloth/Alistia_Cloth_1_blue.png create mode 100644 Assets/04_Models/Characters/Fariy/Textures/Cloth/Alistia_Cloth_1_blue.png.meta create mode 100644 Assets/04_Models/Characters/Fariy/Textures/Cloth/Alistia_Cloth_2.png create mode 100644 Assets/04_Models/Characters/Fariy/Textures/Cloth/Alistia_Cloth_2.png.meta create mode 100644 Assets/04_Models/Characters/Fariy/Textures/wing_effects_tex.png create mode 100644 Assets/04_Models/Characters/Fariy/Textures/wing_effects_tex.png.meta create mode 100644 Assets/04_Models/Characters/Fariy/Textures/wing_mat_BaseMap.png create mode 100644 Assets/04_Models/Characters/Fariy/Textures/wing_mat_BaseMap.png.meta create mode 100644 Assets/04_Models/Characters/Fariy/Textures/wing_matcap.png create mode 100644 Assets/04_Models/Characters/Fariy/Textures/wing_matcap.png.meta create mode 100644 Assets/04_Models/Characters/Fariy/Textures/wing_trail_tex.png create mode 100644 Assets/04_Models/Characters/Fariy/Textures/wing_trail_tex.png.meta create mode 100644 Assets/MagicaCloth2.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted).meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Materials.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Materials/MC2_Floor.mat create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Materials/MC2_Floor.mat.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Materials/MC2_Test_Back.mat create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Materials/MC2_Test_Back.mat.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Materials/MC2_Test_Front.mat create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Materials/MC2_Test_Front.mat.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Materials/MC2_White.mat create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Materials/MC2_White.mat.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Model.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Model/Materials.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Model/Materials/Arrow.mat create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Model/Materials/Arrow.mat.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Model/arrow_b.fbx create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Model/arrow_b.fbx.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/Cube.prefab create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/Cube.prefab.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/CubeRoup.prefab create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/CubeRoup.prefab.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/Env.prefab create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/Env.prefab.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/Plane.prefab create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/Plane.prefab.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/RuntimeBuildDemo.prefab create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/RuntimeBuildDemo.prefab.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/RuntimeDressUpDemo.prefab create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/RuntimeDressUpDemo.prefab.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/SimpleImputManager.prefab create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/SimpleImputManager.prefab.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/Stage.prefab create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/Stage.prefab.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/UI_KAGURA.prefab create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/UI_KAGURA.prefab.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/UI_RuntimeBuild.prefab create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/UI_RuntimeBuild.prefab.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/UI_RuntimeDressUp.prefab create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/UI_RuntimeDressUp.prefab.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/UI_Wind.prefab create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/UI_Wind.prefab.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/WindDemo.prefab create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/WindDemo.prefab.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/WindParticle.prefab create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/WindParticle.prefab.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Resources.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Resources/MC2_BoneCloth_Ribbon_Demo.json create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Resources/MC2_BoneCloth_Ribbon_Demo.json.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/AutoRotate.cs create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/AutoRotate.cs.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/CameraOrbit.cs create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/CameraOrbit.cs.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/CreateSingleton.cs create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/CreateSingleton.cs.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/Editor.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/Editor/ShaderGraph.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/Editor/ShaderGraph/MagicaCloth2UPMImporterShaderGraph.asmdef create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/Editor/ShaderGraph/MagicaCloth2UPMImporterShaderGraph.asmdef.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/Editor/ShaderGraph/UnityPackageImporter.cs create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/Editor/ShaderGraph/UnityPackageImporter.cs.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/GameObjectContainer.cs create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/GameObjectContainer.cs.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/MagicaCloth2Example.asmdef create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/MagicaCloth2Example.asmdef.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/ModelController.cs create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/ModelController.cs.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/RuntimeBuildDemo.cs create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/RuntimeBuildDemo.cs.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/RuntimeDressUpDemo.cs create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/RuntimeDressUpDemo.cs.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/SimpleInput.cs create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/SimpleInput.cs.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/SimpleInputManager.cs create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/SimpleInputManager.cs.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/SliderText.cs create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/SliderText.cs.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/TargetFPS.cs create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/TargetFPS.cs.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/WindDemo.cs create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/WindDemo.cs.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Shaders.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Shaders/MC2_Common_Lit_Back.shadergraph create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Shaders/MC2_Common_Lit_Back.shadergraph.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Shaders/MC2_Common_Lit_Front.shadergraph create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Shaders/MC2_Common_Lit_Front.shadergraph.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Textures.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Textures/SD_UnityChan_Skirt_PaintMap.png create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/Common/Textures/SD_UnityChan_Skirt_PaintMap.png.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/CoreRP.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/CoreRP/RuntimeBuild_CoreRP.unity create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/CoreRP/RuntimeBuild_CoreRP.unity.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/CoreRP/RuntimeDressUp_CoreRP.unity create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/CoreRP/RuntimeDressUp_CoreRP.unity.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/CoreRP/UnityChanKAGURA_CoreRP.unity create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/CoreRP/UnityChanKAGURA_CoreRP.unity.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/CoreRP/Wind_CoreRP.unity create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/CoreRP/Wind_CoreRP.unity.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/HDRP.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/HDRP/MC2_SkyandFogSettingsProfile.asset create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/HDRP/MC2_SkyandFogSettingsProfile.asset.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/HDRP/RuntimeBuild_HDRP.unity create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/HDRP/RuntimeBuild_HDRP.unity.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/HDRP/RuntimeDressUp_HDRP.unity create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/HDRP/RuntimeDressUp_HDRP.unity.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/HDRP/UnityChanKAGURA_HDRP.unity create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/HDRP/UnityChanKAGURA_HDRP.unity.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/HDRP/Wind_HDRP.unity create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/HDRP/Wind_HDRP.unity.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/URP.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/URP/RuntimeBuild_URP.unity create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/URP/RuntimeBuild_URP.unity.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/URP/RuntimeDressUp_URP.unity create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/URP/RuntimeDressUp_URP.unity.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/URP/UnityChanKAGURA_URP.unity create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/URP/UnityChanKAGURA_URP.unity.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/URP/Wind_URP.unity create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/URP/Wind_URP.unity.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/HighDefinition3D.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/HighDefinition3D/RuntimeBuild_HighDefinition3D.unity create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/HighDefinition3D/RuntimeBuild_HighDefinition3D.unity.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/HighDefinition3D/RuntimeDressUp_HighDefinition3D.unity create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/HighDefinition3D/RuntimeDressUp_HighDefinition3D.unity.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/HighDefinition3D/UnityChanKAGURA_HighDefinition3D.unity create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/HighDefinition3D/UnityChanKAGURA_HighDefinition3D.unity.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/HighDefinition3D/Wind_HighDefinition3D.unity create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/HighDefinition3D/Wind_HighDefinition3D.unity.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/Universal3D.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/Universal3D/RuntimeBuild_Universal3D.unity create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/Universal3D/RuntimeBuild_Universal3D.unity.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/Universal3D/RuntimeDressUp_Universal3D.unity create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/Universal3D/RuntimeDressUp_Universal3D.unity.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/Universal3D/UnityChanKAGURA_Universal3D.unity create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/Universal3D/UnityChanKAGURA_Universal3D.unity.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/Universal3D/Wind_Universal3D.unity create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/Universal3D/Wind_Universal3D.unity.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/Logo.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/Logo/Dark_Silhouette.png create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/Logo/Dark_Silhouette.png.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/SB_def_mat.mat create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/SB_def_mat.mat.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/SB_nol_mat.mat create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/SB_nol_mat.mat.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/SB_skin_mat.mat create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/SB_skin_mat.mat.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/def_mat.mat create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/def_mat.mat.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/hair_mat.mat create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/hair_mat.mat.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/mouth_mat.mat create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/mouth_mat.mat.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/nol_mat.mat create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/nol_mat.mat.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/skin_mat.mat create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/skin_mat.mat.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/SD_UnityChan.controller create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/SD_UnityChan.controller.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Textures.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Textures/body_sum.png create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Textures/body_sum.png.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Textures/body_win.png create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Textures/body_win.png.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Textures/misaki_head.png create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Textures/misaki_head.png.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Textures/utc_all2.png create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Textures/utc_all2.png.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Textures/yuko_head.png create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Textures/yuko_head.png.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Utc_sum_humanoid (Body).prefab create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Utc_sum_humanoid (Body).prefab.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Utc_sum_humanoid (Hair).prefab create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Utc_sum_humanoid (Hair).prefab.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Utc_sum_humanoid (Skeleton).prefab create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Utc_sum_humanoid (Skeleton).prefab.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Utc_sum_humanoid Variant.prefab create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Utc_sum_humanoid Variant.prefab.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Utc_sum_humanoid.fbx create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Utc_sum_humanoid.fbx.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/English.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/English/01Unity-Chan License Terms and Condition_EN_UCL2.0.pdf create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/English/01Unity-Chan License Terms and Condition_EN_UCL2.0.pdf.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/English/02Unity-Chan License Terms and Condition_Summary_EN_UCL2.0.pdf create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/English/02Unity-Chan License Terms and Condition_Summary_EN_UCL2.0.pdf.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/English/03Indication of License_EN_UCL2.0.pdf create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/English/03Indication of License_EN_UCL2.0.pdf.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/Japanese.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/Japanese/01Unity-Chan License Terms and Condition_JP_UCL2.0.pdf create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/Japanese/01Unity-Chan License Terms and Condition_JP_UCL2.0.pdf.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/Japanese/02Unity-Chan License Terms and Condition_Summary_JP_UCL2.0.pdf create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/Japanese/02Unity-Chan License Terms and Condition_Summary_JP_UCL2.0.pdf.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/Japanese/03Indication of License_JP_UCL2.0.pdf create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/Japanese/03Indication of License_JP_UCL2.0.pdf.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/LUUL_LOGO_rules02.ai create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/LUUL_LOGO_rules02.ai.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/LUUL_LOGO_rules02.psd create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/LUUL_LOGO_rules02.psd.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/LUUL_logo-guideline.pdf create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/LUUL_logo-guideline.pdf.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/LUUL_logo-guideline_en.pdf create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/LUUL_logo-guideline_en.pdf.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/jpg.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/jpg/Dark_Silhouette.jpg create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/jpg/Dark_Silhouette.jpg.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/jpg/Light_Silhouette.jpg create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/jpg/Light_Silhouette.jpg.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/png.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/png/Dark_Silhouette.png create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/png/Dark_Silhouette.png.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/png/Light_Frame.png create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/png/Light_Frame.png.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/png/Light_Silhouette.png create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/png/Light_Silhouette.png.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/svg.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/svg/Dark_Silhouette.svg create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/svg/Dark_Silhouette.svg.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/svg/Light_Frame.svg create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/svg/Light_Frame.svg.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/svg/Light_Silhouette.svg create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/svg/Light_Silhouette.svg.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/Unity-Chan License.txt create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/Unity-Chan License.txt.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation/RUN00_F.anim create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation/RUN00_F.anim.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation/UC01_001_UniteInTheSky -WA-.fbx create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation/UC01_001_UniteInTheSky -WA-.fbx.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation/WAIT02.anim create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation/WAIT02.anim.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation/WAIT04.anim create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation/WAIT04.anim.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation/WALK00_F.anim create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation/WALK00_F.anim.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation/WIN00.anim create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation/WIN00.anim.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Albedo.mat create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Albedo.mat.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Body Back.mat create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Body Back.mat.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Body.mat create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Body.mat.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Eyes.mat create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Eyes.mat.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Eyes_HL.mat create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Eyes_HL.mat.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Face.mat create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Face.mat.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Hair.mat create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Hair.mat.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/HairPony.mat create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/HairPony.mat.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Headgear.mat create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Headgear.mat.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/LongSleeve Back.mat create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/LongSleeve Back.mat.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/LongSleeve.mat create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/LongSleeve.mat.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Skin.mat create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Skin.mat.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Body_Base.png create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Body_Base.png.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Body_Emi.png create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Body_Emi.png.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Body_SGM.png create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Body_SGM.png.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Body_Shd1.png create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Body_Shd1.png.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Body_Shd2.png create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Body_Shd2.png.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Body_Spc.png create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Body_Spc.png.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_Base.png create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_Base.png.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_Emi.png create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_Emi.png.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_LSM.png create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_LSM.png.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_Rim.png create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_Rim.png.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_SGM.png create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_SGM.png.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_Shd1.png create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_Shd1.png.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_Shd2.png create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_Shd2.png.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Hair_SGM.png create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Hair_SGM.png.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Headfgear_Base.png create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Headfgear_Base.png.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_Base.png create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_Base.png.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_Emi.png create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_Emi.png.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_Nrm.png create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_Nrm.png.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_Rim.png create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_Rim.png.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_SGM.png create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_SGM.png.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_Spc.png create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_Spc.png.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_SpcCol.png create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_SpcCol.png.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/face3_main.mat create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/face3_main.mat.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/headExt.mat create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/headExt.mat.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/UniteInTheSky.controller create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/UniteInTheSky.controller.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/UnityCHanKAGURA.fbx create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/UnityCHanKAGURA.fbx.meta create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/UnityCHanKAGURA_MC2.prefab create mode 100644 Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/UnityCHanKAGURA_MC2.prefab.meta create mode 100644 Assets/MagicaCloth2/MagicaCloth2.asmdef create mode 100644 Assets/MagicaCloth2/MagicaCloth2.asmdef.meta create mode 100644 Assets/MagicaCloth2/Readme.txt create mode 100644 Assets/MagicaCloth2/Readme.txt.meta create mode 100644 Assets/MagicaCloth2/Readme_jpn.txt create mode 100644 Assets/MagicaCloth2/Readme_jpn.txt.meta create mode 100644 Assets/MagicaCloth2/Res.meta create mode 100644 Assets/MagicaCloth2/Res/Icon.meta create mode 100644 Assets/MagicaCloth2/Res/Icon/icon-cloth.png create mode 100644 Assets/MagicaCloth2/Res/Icon/icon-cloth.png.meta create mode 100644 Assets/MagicaCloth2/Res/Icon/icon-collider.png create mode 100644 Assets/MagicaCloth2/Res/Icon/icon-collider.png.meta create mode 100644 Assets/MagicaCloth2/Res/Icon/icon-settings.png create mode 100644 Assets/MagicaCloth2/Res/Icon/icon-settings.png.meta create mode 100644 Assets/MagicaCloth2/Res/Icon/icon-wind.png create mode 100644 Assets/MagicaCloth2/Res/Icon/icon-wind.png.meta create mode 100644 Assets/MagicaCloth2/Res/Preset.meta create mode 100644 Assets/MagicaCloth2/Res/Preset/MC2_Preset_Accessory.json create mode 100644 Assets/MagicaCloth2/Res/Preset/MC2_Preset_Accessory.json.meta create mode 100644 Assets/MagicaCloth2/Res/Preset/MC2_Preset_Cape.json create mode 100644 Assets/MagicaCloth2/Res/Preset/MC2_Preset_Cape.json.meta create mode 100644 Assets/MagicaCloth2/Res/Preset/MC2_Preset_FrontHair.json create mode 100644 Assets/MagicaCloth2/Res/Preset/MC2_Preset_FrontHair.json.meta create mode 100644 Assets/MagicaCloth2/Res/Preset/MC2_Preset_HardSpring.json create mode 100644 Assets/MagicaCloth2/Res/Preset/MC2_Preset_HardSpring.json.meta create mode 100644 Assets/MagicaCloth2/Res/Preset/MC2_Preset_LongHair.json create mode 100644 Assets/MagicaCloth2/Res/Preset/MC2_Preset_LongHair.json.meta create mode 100644 Assets/MagicaCloth2/Res/Preset/MC2_Preset_MiddleSpring.json create mode 100644 Assets/MagicaCloth2/Res/Preset/MC2_Preset_MiddleSpring.json.meta create mode 100644 Assets/MagicaCloth2/Res/Preset/MC2_Preset_ShortHair.json create mode 100644 Assets/MagicaCloth2/Res/Preset/MC2_Preset_ShortHair.json.meta create mode 100644 Assets/MagicaCloth2/Res/Preset/MC2_Preset_Skirt.json create mode 100644 Assets/MagicaCloth2/Res/Preset/MC2_Preset_Skirt.json.meta create mode 100644 Assets/MagicaCloth2/Res/Preset/MC2_Preset_SoftSkirt.json create mode 100644 Assets/MagicaCloth2/Res/Preset/MC2_Preset_SoftSkirt.json.meta create mode 100644 Assets/MagicaCloth2/Res/Preset/MC2_Preset_SoftSpring.json create mode 100644 Assets/MagicaCloth2/Res/Preset/MC2_Preset_SoftSpring.json.meta create mode 100644 Assets/MagicaCloth2/Res/Preset/MC2_Preset_Tail.json create mode 100644 Assets/MagicaCloth2/Res/Preset/MC2_Preset_Tail.json.meta create mode 100644 Assets/MagicaCloth2/Scripts.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/CheckSliderSerializeData.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/CheckSliderSerializeData.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/ClothBehaviour.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/ClothBehaviour.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/ClothDisableMode.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/ClothDisableMode.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/ClothForceMode.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/ClothForceMode.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/ClothInitSerializeData.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/ClothInitSerializeData.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/ClothMeshWriteMode.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/ClothMeshWriteMode.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/ClothNormalAxis.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/ClothNormalAxis.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/ClothParameters.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/ClothParameters.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/ClothProcess.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/ClothProcess.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/ClothProcessData.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/ClothProcessData.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/ClothProcessGeneration.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/ClothProcessGeneration.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/ClothSerializeData.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/ClothSerializeData.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/ClothSerializeData2.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/ClothSerializeData2.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/ClothSerializeDataFunction.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/ClothSerializeDataFunction.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/ClothUpdateMode.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/ClothUpdateMode.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/Collider.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/Collider/ColliderComponent.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/Collider/ColliderComponent.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/Collider/ColliderSymmetryMode.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/Collider/ColliderSymmetryMode.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/Collider/MagicaCapsuleCollider.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/Collider/MagicaCapsuleCollider.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/Collider/MagicaPlaneCollider.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/Collider/MagicaPlaneCollider.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/Collider/MagicaSphereCollider.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/Collider/MagicaSphereCollider.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/AngleConstraint.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/AngleConstraint.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/ColliderCollisionConstraint.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/ColliderCollisionConstraint.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/DistanceConstraint.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/DistanceConstraint.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/InertiaConstraint.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/InertiaConstraint.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/MotionConstraint.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/MotionConstraint.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/SelfCollisionConstraint.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/SelfCollisionConstraint.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/SpringConstraint.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/SpringConstraint.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/TetherConstraint.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/TetherConstraint.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/TriangleBendingConstraint.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/TriangleBendingConstraint.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/CullingSettings.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/CullingSettings.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/CurveSerializeData.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/CurveSerializeData.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/CustomSkinningSettings.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/CustomSkinningSettings.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/GizmoSerializeData.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/GizmoSerializeData.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/MagicaCloth.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/MagicaCloth.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/MagicaClothAPI.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/MagicaClothAPI.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/MagicaClothAnimationProperty.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/MagicaClothAnimationProperty.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/NormalAlignmentSettings.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/NormalAlignmentSettings.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/SelectionData.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/SelectionData.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/Wind.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/Wind/MagicaWindZone.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/Wind/MagicaWindZone.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/Wind/WindParams.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/Wind/WindParams.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/Wind/WindSettings.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Cloth/Wind/WindSettings.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Define.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Define/ResultDefine.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Define/ResultDefine.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Define/SystemDefine.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Define/SystemDefine.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Interface.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Interface/ICount.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Interface/ICount.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Interface/IDataValidate.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Interface/IDataValidate.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Interface/ITransform.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Interface/ITransform.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Interface/IValid.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Interface/IValid.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/Cloth.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/Cloth/ClothManager.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/Cloth/ClothManager.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/Cloth/PreBuildManager.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/Cloth/PreBuildManager.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/IManager.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/IManager.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/MagicaManager.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/MagicaManager.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/MagicaManagerAPI.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/MagicaManagerAPI.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/MagicaSettings.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/MagicaSettings.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/Render.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/Render/RenderData.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/Render/RenderData.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/Render/RenderManager.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/Render/RenderManager.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/Render/RenderSetupData.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/Render/RenderSetupData.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/Render/RenderSetupDataSerialization.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/Render/RenderSetupDataSerialization.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/Render/RenderSetupSerializeData.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/Render/RenderSetupSerializeData.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/Simulation.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/Simulation/ColliderManager.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/Simulation/ColliderManager.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/Simulation/SimulationManager.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/Simulation/SimulationManager.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/Simulation/SimulationManagerNormal.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/Simulation/SimulationManagerNormal.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/Simulation/SimulationManagerSplit.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/Simulation/SimulationManagerSplit.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/Simulation/TimeManager.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/Simulation/TimeManager.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/Simulation/WindManager.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/Simulation/WindManager.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/Team.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/Team/TeamManager.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/Team/TeamManager.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/Team/TeamWindData.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/Team/TeamWindData.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/TransformManager.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/TransformManager/TransformData.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/TransformManager/TransformData.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/TransformManager/TransformDataSerialization.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/TransformManager/TransformDataSerialization.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/TransformManager/TransformManager.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/TransformManager/TransformManager.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/TransformManager/TransformRecord.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/TransformManager/TransformRecord.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/TransformManager/TransformRecordSerializeData.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/TransformManager/TransformRecordSerializeData.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/VirtualMesh.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/VirtualMesh/VirtualMeshManager.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Manager/VirtualMesh/VirtualMeshManager.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/PreBuild.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/PreBuild/PreBuildScriptableObject.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/PreBuild/PreBuildScriptableObject.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/PreBuild/PreBuildSerializeData.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/PreBuild/PreBuildSerializeData.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/PreBuild/SharePreBuildData.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/PreBuild/SharePreBuildData.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/PreBuild/UniquePreBuildData.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/PreBuild/UniquePreBuildData.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Reduction.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Reduction/ReductionSettings.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Reduction/ReductionSettings.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Reduction/ReductionWorkData.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Reduction/ReductionWorkData.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Reduction/SameDistanceReduction.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Reduction/SameDistanceReduction.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Reduction/ShapeDistanceReduction.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Reduction/ShapeDistanceReduction.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Reduction/SimpleDistanceReduction.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Reduction/SimpleDistanceReduction.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Reduction/StepReductionBase.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Reduction/StepReductionBase.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Settings.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Settings/ClothDebugSettings.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Settings/ClothDebugSettings.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Settings/VirtualMeshDebugSettings.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Settings/VirtualMeshDebugSettings.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/Data.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/Data/DataUtility.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/Data/DataUtility.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/Data/MagicaObjectId.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/Data/MagicaObjectId.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/Data/MultiDataBuilder.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/Data/MultiDataBuilder.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/Grid.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/Grid/GridMap.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/Grid/GridMap.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/Jobs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/Jobs/InterlockUtility.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/Jobs/InterlockUtility.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/Jobs/JobUtility.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/Jobs/JobUtility.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/Math.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/Math/AABB.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/Math/AABB.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/Math/IntAABB.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/Math/IntAABB.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/Math/MathExtensions.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/Math/MathExtensions.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/Math/MathUtility.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/Math/MathUtility.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/Math/MinimumData.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/Math/MinimumData.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/Mesh.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/Mesh/MeshUtility.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/Mesh/MeshUtility.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/Misc.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/Misc/Develop.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/Misc/Develop.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/Misc/StaticStringBuilder.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/Misc/StaticStringBuilder.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/DataChunk.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/DataChunk.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExBitFlag16.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExBitFlag16.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExBitFlag8.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExBitFlag8.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExCostSortedList1.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExCostSortedList1.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExCostSortedList4.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExCostSortedList4.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExNativeArray.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExNativeArray.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExProcessingList.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExProcessingList.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExSimpleNativeArray.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExSimpleNativeArray.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExTransformAccessArray.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExTransformAccessArray.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/FixedList128BytesExtensions.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/FixedList128BytesExtensions.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/FixedList32BytesExtensions.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/FixedList32BytesExtensions.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/FixedList4096BytesExtensions.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/FixedList4096BytesExtensions.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/FixedList512BytesExtensions.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/FixedList512BytesExtensions.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/FixedList64BytesExtensions.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/FixedList64BytesExtensions.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/NativeArrayExtensions.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/NativeArrayExtensions.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/NativeMultiHashMapExtensions.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/NativeMultiHashMapExtensions.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/NativeParallelHashMapExtensions.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/NativeParallelHashMapExtensions.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/NativeReferenceExtensions.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/NativeReferenceExtensions.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/ResultCode.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/ResultCode/Exception.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/ResultCode/Exception.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/ResultCode/ResultCode.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/ResultCode/ResultCode.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/Time.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/Time/TimeSpan.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/Time/TimeSpan.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/Time/UnityTimeSpan.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/Utility/Time/UnityTimeSpan.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/VirtualMesh.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshInputOutput.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshInputOutput.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshMapping.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshMapping.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshOptimization.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshOptimization.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshProxy.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshProxy.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshReduction.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshReduction.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshSerialization.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshSerialization.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshWork.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshWork.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VertexAttribute.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VertexAttribute.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VirtualMesh.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VirtualMesh.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VirtualMeshBoneWeight.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VirtualMeshBoneWeight.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VirtualMeshContainer.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VirtualMeshContainer.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VirtualMeshPrimitive.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VirtualMeshPrimitive.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VirtualMeshRaycastHit.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VirtualMeshRaycastHit.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VirtualMeshTransform.cs create mode 100644 Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VirtualMeshTransform.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Editor.meta create mode 100644 Assets/MagicaCloth2/Scripts/Editor/Cloth.meta create mode 100644 Assets/MagicaCloth2/Scripts/Editor/Cloth/ClothAssetPostprocessor.cs create mode 100644 Assets/MagicaCloth2/Scripts/Editor/Cloth/ClothAssetPostprocessor.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Editor/Cloth/ClothEditorManager.cs create mode 100644 Assets/MagicaCloth2/Scripts/Editor/Cloth/ClothEditorManager.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Editor/Cloth/ClothEditorUtility.cs create mode 100644 Assets/MagicaCloth2/Scripts/Editor/Cloth/ClothEditorUtility.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Editor/Cloth/ClothInspectorUtility.cs create mode 100644 Assets/MagicaCloth2/Scripts/Editor/Cloth/ClothInspectorUtility.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Editor/Cloth/ClothPainter.cs create mode 100644 Assets/MagicaCloth2/Scripts/Editor/Cloth/ClothPainter.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Editor/Cloth/ClothPresetUtility.cs create mode 100644 Assets/MagicaCloth2/Scripts/Editor/Cloth/ClothPresetUtility.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaCapsuleColliderEditor.cs create mode 100644 Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaCapsuleColliderEditor.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaClothEditor.cs create mode 100644 Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaClothEditor.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaEditorBase.cs create mode 100644 Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaEditorBase.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaPlaneColliderEditor.cs create mode 100644 Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaPlaneColliderEditor.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaSettingsEditor.cs create mode 100644 Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaSettingsEditor.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaSphereColliderEditor.cs create mode 100644 Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaSphereColliderEditor.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaWindZoneEditor.cs create mode 100644 Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaWindZoneEditor.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Editor/Cloth/VirtualMeshEditorUtility.cs create mode 100644 Assets/MagicaCloth2/Scripts/Editor/Cloth/VirtualMeshEditorUtility.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Editor/EditorExtension.meta create mode 100644 Assets/MagicaCloth2/Scripts/Editor/EditorExtension/AboutMenu.cs create mode 100644 Assets/MagicaCloth2/Scripts/Editor/EditorExtension/AboutMenu.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Editor/EditorExtension/CheckSliderSerializeDataDrawer.cs create mode 100644 Assets/MagicaCloth2/Scripts/Editor/EditorExtension/CheckSliderSerializeDataDrawer.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Editor/EditorExtension/CurveSerializeDataDrawer.cs create mode 100644 Assets/MagicaCloth2/Scripts/Editor/EditorExtension/CurveSerializeDataDrawer.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Editor/EditorExtension/DrawIconInHierarchy.cs create mode 100644 Assets/MagicaCloth2/Scripts/Editor/EditorExtension/DrawIconInHierarchy.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Editor/EditorExtension/MenuItemScript.cs create mode 100644 Assets/MagicaCloth2/Scripts/Editor/EditorExtension/MenuItemScript.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Editor/EditorExtension/SharePreBuildDataDrawer.cs create mode 100644 Assets/MagicaCloth2/Scripts/Editor/EditorExtension/SharePreBuildDataDrawer.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Editor/Gizmos.meta create mode 100644 Assets/MagicaCloth2/Scripts/Editor/Gizmos/GizmoUtility.cs create mode 100644 Assets/MagicaCloth2/Scripts/Editor/Gizmos/GizmoUtility.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Editor/Gizmos/MagicaCapsuleColliderGizmoDrawer.cs create mode 100644 Assets/MagicaCloth2/Scripts/Editor/Gizmos/MagicaCapsuleColliderGizmoDrawer.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Editor/Gizmos/MagicaClothGizmoDrawer.cs create mode 100644 Assets/MagicaCloth2/Scripts/Editor/Gizmos/MagicaClothGizmoDrawer.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Editor/Gizmos/MagicaPlaneColliderGizmoDrawer.cs create mode 100644 Assets/MagicaCloth2/Scripts/Editor/Gizmos/MagicaPlaneColliderGizmoDrawer.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Editor/Gizmos/MagicaSphereColliderGizmoDrawer.cs create mode 100644 Assets/MagicaCloth2/Scripts/Editor/Gizmos/MagicaSphereColliderGizmoDrawer.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Editor/Gizmos/MagicaWindZoneGizmoDrawer.cs create mode 100644 Assets/MagicaCloth2/Scripts/Editor/Gizmos/MagicaWindZoneGizmoDrawer.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Editor/MagicaCloth2.Editor.asmdef create mode 100644 Assets/MagicaCloth2/Scripts/Editor/MagicaCloth2.Editor.asmdef.meta create mode 100644 Assets/MagicaCloth2/Scripts/Editor/PreBuild.meta create mode 100644 Assets/MagicaCloth2/Scripts/Editor/PreBuild/PreBuildDataCreation.cs create mode 100644 Assets/MagicaCloth2/Scripts/Editor/PreBuild/PreBuildDataCreation.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Editor/UnityPackageImporter.meta create mode 100644 Assets/MagicaCloth2/Scripts/Editor/UnityPackageImporter/Burst.meta create mode 100644 Assets/MagicaCloth2/Scripts/Editor/UnityPackageImporter/Burst/MagicaCloth2UPMImporterBurst.asmdef create mode 100644 Assets/MagicaCloth2/Scripts/Editor/UnityPackageImporter/Burst/MagicaCloth2UPMImporterBurst.asmdef.meta create mode 100644 Assets/MagicaCloth2/Scripts/Editor/UnityPackageImporter/Burst/UnityPackageImporter.cs create mode 100644 Assets/MagicaCloth2/Scripts/Editor/UnityPackageImporter/Burst/UnityPackageImporter.cs.meta create mode 100644 Assets/MagicaCloth2/Scripts/Editor/UnityPackageImporter/Collections.meta create mode 100644 Assets/MagicaCloth2/Scripts/Editor/UnityPackageImporter/Collections/MagicaCloth2UPMImporterCollections.asmdef create mode 100644 Assets/MagicaCloth2/Scripts/Editor/UnityPackageImporter/Collections/MagicaCloth2UPMImporterCollections.asmdef.meta create mode 100644 Assets/MagicaCloth2/Scripts/Editor/UnityPackageImporter/Collections/UnityPackageImporter.cs create mode 100644 Assets/MagicaCloth2/Scripts/Editor/UnityPackageImporter/Collections/UnityPackageImporter.cs.meta create mode 100644 Assets/RealToon.meta create mode 100644 Assets/RealToon/Editor.meta create mode 100644 Assets/RealToon/Editor/RT_Welcome.cs create mode 100644 Assets/RealToon/Editor/RT_Welcome.cs.meta create mode 100644 Assets/RealToon/Editor/RealToonShaderCache.cs create mode 100644 Assets/RealToon/Editor/RealToonShaderCache.cs.meta create mode 100644 Assets/RealToon/Editor/RealToonShaderGUI_URP_SRP.cs create mode 100644 Assets/RealToon/Editor/RealToonShaderGUI_URP_SRP.cs.meta create mode 100644 Assets/RealToon/Editor/RealToon_Settings_Options.cs create mode 100644 Assets/RealToon/Editor/RealToon_Settings_Options.cs.meta create mode 100644 Assets/RealToon/Editor/SwapShaderToRealToon.cs create mode 100644 Assets/RealToon/Editor/SwapShaderToRealToon.cs.meta create mode 100644 Assets/RealToon/RealToon Shaders.meta create mode 100644 Assets/RealToon/RealToon Shaders/RealToon Core.meta create mode 100644 Assets/RealToon/RealToon Shaders/RealToon Core/URP.meta create mode 100644 Assets/RealToon/RealToon Shaders/RealToon Core/URP/Pass.meta create mode 100644 Assets/RealToon/RealToon Shaders/RealToon Core/URP/Pass/RT_URP_MoVecPas.hlsl create mode 100644 Assets/RealToon/RealToon Shaders/RealToon Core/URP/Pass/RT_URP_MoVecPas.hlsl.meta create mode 100644 Assets/RealToon/RealToon Shaders/RealToon Core/URP/RT_URP_Core.hlsl create mode 100644 Assets/RealToon/RealToon Shaders/RealToon Core/URP/RT_URP_Core.hlsl.meta create mode 100644 Assets/RealToon/RealToon Shaders/RealToon Core/URP/RT_URP_PROP.hlsl create mode 100644 Assets/RealToon/RealToon Shaders/RealToon Core/URP/RT_URP_PROP.hlsl.meta create mode 100644 Assets/RealToon/RealToon Shaders/Version 5.meta create mode 100644 Assets/RealToon/RealToon Shaders/Version 5/URP.meta create mode 100644 Assets/RealToon/RealToon Shaders/Version 5/URP/Default.meta create mode 100644 Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader create mode 100644 Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader.meta create mode 100644 Assets/RealToon/RealToon Tools.meta create mode 100644 Assets/RealToon/RealToon Tools/CustomShadowResolution.cs create mode 100644 Assets/RealToon/RealToon Tools/CustomShadowResolution.cs.meta create mode 100644 Assets/RealToon/RealToon Tools/FrameByFrameRendering.meta create mode 100644 Assets/RealToon/RealToon Tools/FrameByFrameRendering/FrameByFrameRendering_Default.cs create mode 100644 Assets/RealToon/RealToon Tools/FrameByFrameRendering/FrameByFrameRendering_Default.cs.meta create mode 100644 Assets/RealToon/RealToon Tools/FrameByFrameRendering/FrameByFrameRendering_Manual.cs create mode 100644 Assets/RealToon/RealToon Tools/FrameByFrameRendering/FrameByFrameRendering_Manual.cs.meta create mode 100644 Assets/RealToon/RealToon Tools/PerspectiveAdjustmentController.cs create mode 100644 Assets/RealToon/RealToon Tools/PerspectiveAdjustmentController.cs.meta create mode 100644 Assets/RealToon/RealToon Tools/ShadowTSDFModeHelper.cs create mode 100644 Assets/RealToon/RealToon Tools/ShadowTSDFModeHelper.cs.meta create mode 100644 Assets/RealToon/RealToon Tools/SmearEffectHelper.cs create mode 100644 Assets/RealToon/RealToon Tools/SmearEffectHelper.cs.meta create mode 100644 Assets/RealToon/RealToon Tools/SmoothObjectNormalHelper.cs create mode 100644 Assets/RealToon/RealToon Tools/SmoothObjectNormalHelper.cs.meta diff --git a/Assets/04_Models/Characters/Fariy.meta b/Assets/04_Models/Characters/Fariy.meta new file mode 100644 index 00000000..6bb3398b --- /dev/null +++ b/Assets/04_Models/Characters/Fariy.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: af51857a4ff2fc543966503a726fdeff +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/04_Models/Characters/Fariy/Animations.meta b/Assets/04_Models/Characters/Fariy/Animations.meta new file mode 100644 index 00000000..6401dde9 --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Animations.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: da57b9fe4d668324d9b14528ebb2becd +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/04_Models/Characters/Fariy/Animations/FairyAnimController.controller b/Assets/04_Models/Characters/Fariy/Animations/FairyAnimController.controller new file mode 100644 index 00000000..42a6203e --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Animations/FairyAnimController.controller @@ -0,0 +1,72 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1107 &-3534055997575833487 +AnimatorStateMachine: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Base Layer + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: 521846643228410262} + m_Position: {x: 410, y: 70, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 770, y: 110, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: 521846643228410262} +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: FairyAnimController + serializedVersion: 5 + m_AnimatorParameters: [] + m_AnimatorLayers: + - serializedVersion: 5 + m_Name: Base Layer + m_StateMachine: {fileID: -3534055997575833487} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 0 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} +--- !u!1102 &521846643228410262 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Idle + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: [] + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: a6f209f95d90e4e43be4124b55773e8c, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: diff --git a/Assets/04_Models/Characters/Fariy/Animations/FairyAnimController.controller.meta b/Assets/04_Models/Characters/Fariy/Animations/FairyAnimController.controller.meta new file mode 100644 index 00000000..1cb01876 --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Animations/FairyAnimController.controller.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5236f50e9ec746e4b945415ddcf99c20 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 9100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/04_Models/Characters/Fariy/Animations/FairyFly_Idle_FlapWings.anim b/Assets/04_Models/Characters/Fariy/Animations/FairyFly_Idle_FlapWings.anim new file mode 100644 index 00000000..f90b093a --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Animations/FairyFly_Idle_FlapWings.anim @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cfbf961c3a1911f4bc52ac60076f1c0d528506653f33bd86f2b1ac245a3865de +size 8568115 diff --git a/Assets/04_Models/Characters/Fariy/Animations/FairyFly_Idle_FlapWings.anim.meta b/Assets/04_Models/Characters/Fariy/Animations/FairyFly_Idle_FlapWings.anim.meta new file mode 100644 index 00000000..9e31afe6 --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Animations/FairyFly_Idle_FlapWings.anim.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a6f209f95d90e4e43be4124b55773e8c +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/04_Models/Characters/Fariy/FBX.meta b/Assets/04_Models/Characters/Fariy/FBX.meta new file mode 100644 index 00000000..b91a9101 --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/FBX.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3a264d424820bc24792b5f3c4c5c0d6c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/04_Models/Characters/Fariy/FBX/Alistia.fbx b/Assets/04_Models/Characters/Fariy/FBX/Alistia.fbx new file mode 100644 index 00000000..ed4b8174 --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/FBX/Alistia.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f1a3be64bb9fd8bd4a50535155dbd8efe7f02f8484923fcdcf14242fbc198a36 +size 4448668 diff --git a/Assets/04_Models/Characters/Fariy/FBX/Alistia.fbx.meta b/Assets/04_Models/Characters/Fariy/FBX/Alistia.fbx.meta new file mode 100644 index 00000000..1eeda6e6 --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/FBX/Alistia.fbx.meta @@ -0,0 +1,1114 @@ +fileFormatVersion: 2 +guid: c13b330bbe536e24082294714017c4c4 +ModelImporter: + serializedVersion: 19301 + internalIDToNameTable: [] + externalObjects: + - first: + type: UnityEngine:Material + assembly: UnityEngine.CoreModule + name: Alistia_Body + second: {fileID: 2100000, guid: c8b11ad3fb679554b8fe6a090fb2df31, type: 2} + - first: + type: UnityEngine:Material + assembly: UnityEngine.CoreModule + name: Alistia_Cloth + second: {fileID: 2100000, guid: bcbfd5c6863e38343b245e267d25bc9a, type: 2} + - first: + type: UnityEngine:Material + assembly: UnityEngine.CoreModule + name: Alistia_Cloth_2 + second: {fileID: 2100000, guid: e53efbb67fe6728448f434995daddef8, type: 2} + - first: + type: UnityEngine:Material + assembly: UnityEngine.CoreModule + name: Alistia_Cloth_Komono + second: {fileID: 2100000, guid: 3de8853db9fb48f479399f3e4c29bd4f, type: 2} + - first: + type: UnityEngine:Material + assembly: UnityEngine.CoreModule + name: Alistia_Cloth_Komono_Lace + second: {fileID: 2100000, guid: 0103269314fd354438519459bcba1200, type: 2} + - first: + type: UnityEngine:Material + assembly: UnityEngine.CoreModule + name: Alistia_Cloth_Lace + second: {fileID: 2100000, guid: ec6935d242801ba45a50c57594f80846, type: 2} + - first: + type: UnityEngine:Material + assembly: UnityEngine.CoreModule + name: Alistia_Hair + second: {fileID: 2100000, guid: c605ffdaefec0d3429b476e3f534840c, type: 2} + - first: + type: UnityEngine:Material + assembly: UnityEngine.CoreModule + name: Face + second: {fileID: 2100000, guid: 5964f5c0619d80048afe0d1a2fd68036, type: 2} + - first: + type: UnityEngine:Material + assembly: UnityEngine.CoreModule + name: Face_Alpha + second: {fileID: 2100000, guid: 5434df79a062a264fa80847913923f64, type: 2} + - first: + type: UnityEngine:Material + assembly: UnityEngine.CoreModule + name: Hair + second: {fileID: 2100000, guid: 603c28e1d1dba2c41a6cb2eeba1df007, type: 2} + - first: + type: UnityEngine:Material + assembly: UnityEngine.CoreModule + name: Jewel + second: {fileID: 2100000, guid: 54d340b7837b65346af0333fa5c8f9a8, type: 2} + - first: + type: UnityEngine:Material + assembly: UnityEngine.CoreModule + name: Kohane_Body + second: {fileID: 2100000, guid: c8b11ad3fb679554b8fe6a090fb2df31, type: 2} + - first: + type: UnityEngine:Material + assembly: UnityEngine.CoreModule + name: Maid_Cloth_Komono + second: {fileID: 2100000, guid: 3de8853db9fb48f479399f3e4c29bd4f, type: 2} + - first: + type: UnityEngine:Material + assembly: UnityEngine.CoreModule + name: Maid_Cloth_Race + second: {fileID: 2100000, guid: 0103269314fd354438519459bcba1200, type: 2} + - first: + type: UnityEngine:Material + assembly: UnityEngine.CoreModule + name: Metal + second: {fileID: 2100000, guid: d65d67af019c21e4090c03f494b1958c, type: 2} + - first: + type: UnityEngine:Material + assembly: UnityEngine.CoreModule + name: Rapis_Cloth_Skirt + second: {fileID: 2100000, guid: e84afd90834c51543b69db9871a01f2d, type: 2} + - first: + type: UnityEngine:Material + assembly: UnityEngine.CoreModule + name: Stoking + second: {fileID: 2100000, guid: 1d28e362395e8f141bb82817fa4e8fe3, type: 2} + materials: + materialImportMode: 1 + materialName: 0 + materialSearch: 1 + materialLocation: 1 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + resampleCurves: 1 + optimizeGameObjects: 0 + motionNodeName: + rigImportErrors: + rigImportWarnings: + animationImportErrors: + animationImportWarnings: + animationRetargetingWarnings: + animationDoRetargetingWarnings: 0 + importAnimatedCustomProperties: 0 + importConstraints: 0 + animationCompression: 3 + animationRotationError: 0.5 + animationPositionError: 0.5 + animationScaleError: 0.5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + extraUserProperties: [] + clipAnimations: [] + isReadable: 1 + meshes: + lODScreenPercentages: [] + globalScale: 1 + meshCompression: 0 + addColliders: 0 + useSRGBMaterialColor: 1 + sortHierarchyByName: 1 + importVisibility: 1 + importBlendShapes: 1 + importCameras: 1 + importLights: 1 + fileIdsGeneration: 2 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + keepQuads: 0 + weldVertices: 1 + preserveHierarchy: 0 + skinWeightsMode: 0 + maxBonesPerVertex: 4 + minBoneWeight: 0.001 + meshOptimizationFlags: -1 + indexFormat: 0 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVPackMargin: 4 + useFileScale: 1 + tangentSpace: + normalSmoothAngle: 60 + normalImportMode: 0 + tangentImportMode: 3 + normalCalculationMode: 4 + legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 1 + blendShapeNormalImportMode: 1 + normalSmoothingSource: 0 + referencedClips: [] + importAnimation: 1 + humanDescription: + serializedVersion: 3 + human: + - boneName: Hips + humanName: Hips + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: UpperLeg.L + humanName: LeftUpperLeg + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: UpperLeg.R + humanName: RightUpperLeg + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: LowerLeg.L + humanName: LeftLowerLeg + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: LowerLeg.R + humanName: RightLowerLeg + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Foot.L + humanName: LeftFoot + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Foot.R + humanName: RightFoot + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Spine + humanName: Spine + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Chest + humanName: Chest + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Neck + humanName: Neck + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Head + humanName: Head + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Shoulder.L + humanName: LeftShoulder + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Shoulder.R + humanName: RightShoulder + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: UpperArm.L + humanName: LeftUpperArm + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: UpperArm.R + humanName: RightUpperArm + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: LowerArm.L + humanName: LeftLowerArm + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: LowerArm.R + humanName: RightLowerArm + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Hand.L + humanName: LeftHand + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Hand.R + humanName: RightHand + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Toe.L + humanName: LeftToes + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Toe.R + humanName: RightToes + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: LeftEye + humanName: LeftEye + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: RightEye + humanName: RightEye + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Thumb1.L + humanName: Left Thumb Proximal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Thumb2.L + humanName: Left Thumb Intermediate + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Thumb3.L + humanName: Left Thumb Distal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Index1.L + humanName: Left Index Proximal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Index2.L + humanName: Left Index Intermediate + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Index3.L + humanName: Left Index Distal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Middle1.L + humanName: Left Middle Proximal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Middle2.L + humanName: Left Middle Intermediate + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Middle3.L + humanName: Left Middle Distal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Ring1.L + humanName: Left Ring Proximal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Ring2.L + humanName: Left Ring Intermediate + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Ring3.L + humanName: Left Ring Distal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Little1.L + humanName: Left Little Proximal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Little2.L + humanName: Left Little Intermediate + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Little3.L + humanName: Left Little Distal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Thumb1.R + humanName: Right Thumb Proximal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Thumb2.R + humanName: Right Thumb Intermediate + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Thumb3.R + humanName: Right Thumb Distal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Index1.R + humanName: Right Index Proximal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Index2.R + humanName: Right Index Intermediate + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Index3.R + humanName: Right Index Distal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Middle1.R + humanName: Right Middle Proximal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Middle2.R + humanName: Right Middle Intermediate + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Middle3.R + humanName: Right Middle Distal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Ring1.R + humanName: Right Ring Proximal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Ring2.R + humanName: Right Ring Intermediate + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Ring3.R + humanName: Right Ring Distal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Little1.R + humanName: Right Little Proximal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Little2.R + humanName: Right Little Intermediate + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Little3.R + humanName: Right Little Distal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + skeleton: + - name: Alistia(Clone) + parentName: + position: {x: 0, y: 0, z: 0} + rotation: {x: 0, y: 0, z: 0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: Hair_Base + parentName: Alistia(Clone) + position: {x: -0, y: -0.00492125, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: Body + parentName: Alistia(Clone) + position: {x: -0, y: -0.00492125, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: Armature + parentName: Alistia(Clone) + position: {x: -0, y: 0, z: 0} + rotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071067} + scale: {x: 1, y: 1, z: 1} + - name: Hips + parentName: Armature + position: {x: -6.1696267e-18, y: -0.012475, z: 0.753024} + rotation: {x: 0.7071068, y: 3.3087225e-24, z: -6.170892e-17, w: 0.7071067} + scale: {x: 1, y: 1, z: 1} + - name: Spine + parentName: Hips + position: {x: 3.0245975e-18, y: 0.036037683, z: -0.0000004293397} + rotation: {x: -0, y: 4.3634793e-17, z: 4.3634793e-17, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: Chest + parentName: Spine + position: {x: -0, y: 0.0681147, z: 0} + rotation: {x: -0.13042058, y: 0.0000029922032, z: 0.0000029922046, w: 0.9914588} + scale: {x: 1, y: 0.9999996, z: 0.9999996} + - name: Bust1.L + parentName: Chest + position: {x: -0.036373794, y: 0.052300382, z: 0.043459147} + rotation: {x: 0.105609804, y: 0.5449849, z: 0.77077436, w: 0.31264198} + scale: {x: 1.0000036, y: 1.0000033, z: 1.0000024} + - name: Bust2.L + parentName: Bust1.L + position: {x: -0.000000020489097, y: 0.037450638, z: 0.000000038184226} + rotation: {x: 0.0037107654, y: -0.00004570186, z: -0.006652124, w: 0.99997103} + scale: {x: 1.0000026, y: 0.99999994, z: 1.0000001} + - name: Bust1.R + parentName: Chest + position: {x: 0.036374047, y: 0.05229984, z: 0.043459497} + rotation: {x: -0.105610535, y: 0.54498696, z: 0.770776, w: -0.31263408} + scale: {x: 0.9999986, y: 0.9999991, z: 1.0000001} + - name: Bust2.R + parentName: Bust1.R + position: {x: 0.000000040978193, y: 0.03745065, z: -0.000000031664968} + rotation: {x: 0.0037109037, y: 0.00004512072, z: 0.0066522853, w: 0.99997103} + scale: {x: 1.0000046, y: 1.0000024, z: 1.0000007} + - name: Neck + parentName: Chest + position: {x: 0.00000017770147, y: 0.14812247, z: 0.00617598} + rotation: {x: 0.13042058, y: -0.0000029861471, z: -0.0000029843127, w: 0.9914588} + scale: {x: 1, y: 1.0000002, z: 1.0000002} + - name: Head + parentName: Neck + position: {x: 3.1086245e-14, y: 0.05062616, z: 7.8205137e-10} + rotation: {x: -0.00024789572, y: 0.0000000662767, z: 0.00000006627272, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: LeftEye + parentName: Head + position: {x: -0.03256895, y: 0.045570184, z: 0.031821743} + rotation: {x: 0.00024789572, y: -0.00000006363798, z: -0.00000008297502, w: 1} + scale: {x: 1, y: 0.99999994, z: 1} + - name: RightEye + parentName: Head + position: {x: 0.032570522, y: 0.045570176, z: 0.031821754} + rotation: {x: 0.00024789572, y: -0.00000006363798, z: -0.00000008297502, w: 1} + scale: {x: 1, y: 0.99999994, z: 1} + - name: Shoulder.L + parentName: Chest + position: {x: -0.044254683, y: 0.13164537, z: 0.0018712665} + rotation: {x: 0.469565, y: -0.46929485, z: -0.52889204, w: -0.5287195} + scale: {x: 1.0000012, y: 1.0000018, z: 1.0000026} + - name: UpperArm.L + parentName: Shoulder.L + position: {x: -0.0000000058653313, y: 0.03066374, z: -0.000000012219971} + rotation: {x: -0.00022864343, y: 0.07132179, z: -0.000016376378, w: -0.99745333} + scale: {x: 1.0000024, y: 1.0000027, z: 1.000001} + - name: LowerArm.L + parentName: UpperArm.L + position: {x: -0.0000000023840077, y: 0.17359607, z: -5.9620864e-10} + rotation: {x: 0.000009654234, y: -0.0000054165716, z: 0.00088465307, w: 0.9999996} + scale: {x: 1.0000001, y: 0.99999946, z: 1.0000008} + - name: Hand.L + parentName: LowerArm.L + position: {x: -0.0000000018299033, y: 0.15869713, z: 0.000000052892275} + rotation: {x: 0.019572105, y: -0.037160914, z: -0.006793405, w: 0.99909455} + scale: {x: 1.0000012, y: 1.000002, z: 1.0000024} + - name: Index1.L + parentName: Hand.L + position: {x: -0.014522348, y: 0.047296092, z: 0.0045981416} + rotation: {x: -0.019978369, y: 0.036954556, z: -0.0038930534, w: 0.99910975} + scale: {x: 1.0000025, y: 1.000001, z: 1.0000018} + - name: Index2.L + parentName: Index1.L + position: {x: -1.8769697e-10, y: 0.024015969, z: -0.0000000026099771} + rotation: {x: 0.014445683, y: -0.014164986, z: 0.009858514, w: -0.99974674} + scale: {x: 1.0000014, y: 1.0000026, z: 1.000003} + - name: Index3.L + parentName: Index2.L + position: {x: 0.0000000018626451, y: 0.014786593, z: 0.000000021027518} + rotation: {x: -0.000000012107191, y: -0.000000012107191, z: -0.00000019467548, + w: 1} + scale: {x: 1.0000013, y: 1.0000019, z: 1.0000017} + - name: Little1.L + parentName: Hand.L + position: {x: 0.021028362, y: 0.04450399, z: 0.0020691496} + rotation: {x: -0.02193701, y: 0.03713258, z: 0.005996953, w: 0.9990515} + scale: {x: 1.000001, y: 0.99999946, z: 0.99999946} + - name: Little2.L + parentName: Little1.L + position: {x: 0.000000004107335, y: 0.021644933, z: -0.000000016318651} + rotation: {x: 0.0023245423, y: 0.0000025592747, z: -0.00000082282355, w: 0.9999973} + scale: {x: 0.99999875, y: 0.99999946, z: 0.9999992} + - name: Little3.L + parentName: Little2.L + position: {x: 0.0000000048106865, y: 0.012178692, z: -0.00000001093121} + rotation: {x: -2.3283064e-10, y: -0, z: -2.3092639e-14, w: 1} + scale: {x: 0.99999875, y: 0.99999946, z: 1.0000007} + - name: Middle1.L + parentName: Hand.L + position: {x: -0.0017258427, y: 0.048072364, z: 0.0036171} + rotation: {x: -0.019614687, y: 0.037148982, z: 0.0059097754, w: 0.9990998} + scale: {x: 1.0000014, y: 1.0000001, z: 1.0000002} + - name: Middle2.L + parentName: Middle1.L + position: {x: 0.0000000013537331, y: 0.026750837, z: -0.000000002144489} + rotation: {x: 0.000000029802319, y: -0.00000002235174, z: -0.000000032363456, + w: 1} + scale: {x: 0.99999994, y: 1.0000005, z: 1.0000011} + - name: Middle3.L + parentName: Middle2.L + position: {x: -2.6077274e-10, y: 0.01650331, z: -0.0000000033507597} + rotation: {x: -0, y: -0, z: 6.6613366e-16, w: 1} + scale: {x: 0.99999887, y: 1.0000001, z: 0.9999998} + - name: Ring1.L + parentName: Hand.L + position: {x: 0.009650505, y: 0.047645066, z: 0.0027892725} + rotation: {x: -0.019614726, y: 0.037149027, z: 0.0059097037, w: 0.9990998} + scale: {x: 1.0000007, y: 0.99999994, z: 0.99999994} + - name: Ring2.L + parentName: Ring1.L + position: {x: 9.057999e-11, y: 0.024814803, z: -0.000000006199496} + rotation: {x: -0, y: -0, z: -1.7462297e-10, w: 1} + scale: {x: 1.0000014, y: 1.0000017, z: 1.0000018} + - name: Ring3.L + parentName: Ring2.L + position: {x: 0.000000002025672, y: 0.014320652, z: -0.0000000060218603} + rotation: {x: -0, y: -0, z: -0, w: 1} + scale: {x: 1.0000015, y: 1.0000013, z: 1.0000014} + - name: Thumb1.L + parentName: Hand.L + position: {x: -0.017468017, y: 0.015065361, z: -0.0066261836} + rotation: {x: -0.039141063, y: 0.08133935, z: 0.34762844, w: 0.9332772} + scale: {x: 1.0000014, y: 1.0000005, z: 1.0000005} + - name: Thumb2.L + parentName: Thumb1.L + position: {x: 0.000000007450581, y: 0.021335164, z: -7.566996e-10} + rotation: {x: 0.007667834, y: -0.010849059, z: -0.036383722, w: 0.99924964} + scale: {x: 1.0000035, y: 1.0000007, z: 1.0000017} + - name: Thumb3.L + parentName: Thumb2.L + position: {x: 0.000000007450581, y: 0.018980972, z: -0.00000001268927} + rotation: {x: -0.004107844, y: -0.00076166354, z: 0.0055113547, w: 0.99997616} + scale: {x: 1.0000035, y: 1.0000026, z: 1.0000029} + - name: Shoulder.R + parentName: Chest + position: {x: 0.04425644, y: 0.13164477, z: 0.0018717226} + rotation: {x: 0.46956572, y: 0.46929416, z: 0.5288982, w: -0.5287134} + scale: {x: 1.0000001, y: 1, z: 1.0000001} + - name: UpperArm.R + parentName: Shoulder.R + position: {x: 0.000000006031769, y: 0.030663732, z: -0.000000013584213} + rotation: {x: -0.00022903082, y: -0.07132173, z: 0.000016376374, w: -0.99745333} + scale: {x: 1, y: 1.0000013, z: 1.0000015} + - name: LowerArm.R + parentName: UpperArm.R + position: {x: 7.476624e-10, y: 0.17359607, z: 0.000000058706714} + rotation: {x: -0.000009797542, y: -0.000005535781, z: 0.000884568, w: -0.9999996} + scale: {x: 1.0000019, y: 1.0000014, z: 1.0000018} + - name: Hand.R + parentName: LowerArm.R + position: {x: -4.3655746e-11, y: 0.15869711, z: 0.00000011249634} + rotation: {x: -0.019572623, y: -0.037161004, z: -0.0067932573, w: -0.9990945} + scale: {x: 0.9999997, y: 1.0000001, z: 0.9999998} + - name: Index1.R + parentName: Hand.R + position: {x: 0.014522422, y: 0.0472945, z: 0.004598211} + rotation: {x: -0.019979157, y: -0.036954816, z: 0.0038928925, w: 0.9991096} + scale: {x: 1.0000015, y: 1.0000017, z: 1.0000008} + - name: Index2.R + parentName: Index1.R + position: {x: 4.1104897e-10, y: 0.02401601, z: 0.00000005662945} + rotation: {x: 0.014446163, y: 0.014165023, z: -0.009858646, w: -0.99974674} + scale: {x: 1.000001, y: 1, z: 1.000001} + - name: Index3.R + parentName: Index2.R + position: {x: -0.0000000055879354, y: 0.014786594, z: -0.00000002561137} + rotation: {x: 0.000000025145706, y: 0.00000006798654, z: 0.000000103405895, + w: 1} + scale: {x: 1.0000012, y: 1.0000025, z: 1.0000006} + - name: Little1.R + parentName: Hand.R + position: {x: -0.021028282, y: 0.044502433, z: 0.0020692172} + rotation: {x: -0.014526544, y: -0.03717604, z: -0.0057192114, w: 0.9991868} + scale: {x: 1.0000002, y: 1.0000015, z: 0.9999997} + - name: Little2.R + parentName: Little1.R + position: {x: -6.608616e-10, y: 0.021646503, z: -0.000000006893572} + rotation: {x: -0.0050930735, y: -0.0000026598573, z: -0.0000012849341, w: 0.99998707} + scale: {x: 1.0000019, y: 1.0000002, z: 1} + - name: Little3.R + parentName: Little2.R + position: {x: -0.0000000047143334, y: 0.012178687, z: -0.0000000104769} + rotation: {x: -0, y: -0, z: -3.819167e-14, w: 1} + scale: {x: 1.0000017, y: 1.0000012, z: 1.0000024} + - name: Middle1.R + parentName: Hand.R + position: {x: 0.001725913, y: 0.048070777, z: 0.003617167} + rotation: {x: -0.019615255, y: -0.0371491, z: -0.0059097228, w: 0.99909973} + scale: {x: 1.0000002, y: 1, z: 0.9999992} + - name: Middle2.R + parentName: Middle1.R + position: {x: -0.0000000014237784, y: 0.026750863, z: -0.0000000060028147} + rotation: {x: -0, y: -0, z: -0, w: 1} + scale: {x: 1.0000006, y: 0.9999997, z: 1.0000002} + - name: Middle3.R + parentName: Middle2.R + position: {x: -5.5291594e-10, y: 0.016503299, z: -0.0000000033507639} + rotation: {x: -0, y: -0, z: -0, w: 1} + scale: {x: 1.0000007, y: 0.9999996, z: 1.0000002} + - name: Ring1.R + parentName: Hand.R + position: {x: -0.00965043, y: 0.047643475, z: 0.0027893397} + rotation: {x: -0.019615255, y: -0.0371491, z: -0.0059097228, w: 0.99909973} + scale: {x: 1.0000002, y: 1.0000001, z: 0.9999992} + - name: Ring2.R + parentName: Ring1.R + position: {x: -0.0000000025396218, y: 0.02481485, z: -0.000000006856413} + rotation: {x: -0, y: -0, z: -0, w: 1} + scale: {x: 1.0000005, y: 0.99999994, z: 1} + - name: Ring3.R + parentName: Ring2.R + position: {x: -0.0000000029314577, y: 0.014320662, z: -0.0000000054744365} + rotation: {x: -0, y: -0, z: -0, w: 1} + scale: {x: 1.0000005, y: 0.99999946, z: 0.99999994} + - name: Thumb1.R + parentName: Hand.R + position: {x: 0.017468033, y: 0.015065379, z: -0.0066261836} + rotation: {x: 0.039138585, y: 0.081340834, z: 0.34763065, w: -0.93327636} + scale: {x: 1.0000015, y: 1.0000005, z: 0.9999998} + - name: Thumb2.R + parentName: Thumb1.R + position: {x: -0.000000013038516, y: 0.021335162, z: -0.000000043946784} + rotation: {x: 0.0076674893, y: 0.010848768, z: 0.036383204, w: 0.99924964} + scale: {x: 1.0000014, y: 0.99999887, z: 0.99999803} + - name: Thumb3.R + parentName: Thumb2.R + position: {x: -0.000000016763806, y: 0.018980978, z: -0.000000021071173} + rotation: {x: -0.0041078813, y: 0.00076163746, z: -0.005511368, w: 0.9999761} + scale: {x: 1.0000019, y: 1.0000011, z: 1.0000006} + - name: UpperLeg.L + parentName: Hips + position: {x: -0.05510006, y: -0.08030146, z: -0.011969948} + rotation: {x: 0.99994344, y: 0.000000014035436, z: 0.000000014035655, w: -0.010635735} + scale: {x: 1, y: 0.99999994, z: 1.0000001} + - name: LowerLeg.L + parentName: UpperLeg.L + position: {x: -0.000000003655421, y: 0.26264185, z: 7.981139e-10} + rotation: {x: 0.01915314, y: -0.000000013611388, z: 0.000000014447262, w: 0.99981654} + scale: {x: 1, y: 0.9999979, z: 0.9999975} + - name: Foot.L + parentName: LowerLeg.L + position: {x: 1.3537782e-14, y: 0.30144525, z: -9.313206e-10} + rotation: {x: -0.4684318, y: 0.00000024730994, z: -0.000000088532694, w: 0.8834997} + scale: {x: 1, y: 0.99999917, z: 0.99999905} + - name: Toe.L + parentName: Foot.L + position: {x: -0.0000000021820092, y: 0.0990005, z: 0.0000000011536248} + rotation: {x: -0.32203057, y: 0.00000005524476, z: -0.00000016759871, w: 0.9467293} + scale: {x: 1, y: 1.0000013, z: 1.0000006} + - name: UpperLeg.R + parentName: Hips + position: {x: 0.05510006, y: -0.08030146, z: -0.011969948} + rotation: {x: 0.99994344, y: -0.000000014035436, z: -0.000000014035655, w: -0.010635735} + scale: {x: 1, y: 0.99999994, z: 1.0000001} + - name: LowerLeg.R + parentName: UpperLeg.R + position: {x: 0.000000003655421, y: 0.26264185, z: 7.981139e-10} + rotation: {x: 0.01915314, y: 0.000000013611388, z: -0.000000014447262, w: 0.99981654} + scale: {x: 1, y: 0.9999979, z: 0.9999975} + - name: Foot.R + parentName: LowerLeg.R + position: {x: -1.3537782e-14, y: 0.30144525, z: -9.313206e-10} + rotation: {x: -0.4684318, y: -0.00000024730994, z: 0.000000088532694, w: 0.8834997} + scale: {x: 1, y: 0.99999917, z: 0.99999905} + - name: Toe.R + parentName: Foot.R + position: {x: 0.0000000021820092, y: 0.0990005, z: 0.0000000011536248} + rotation: {x: -0.32203057, y: -0.00000005524476, z: 0.00000016759871, w: 0.9467293} + scale: {x: 1, y: 1.0000013, z: 1.0000006} + - name: Butt_L + parentName: Hips + position: {x: -0.049432106, y: -0.05621457, z: -0.03961581} + rotation: {x: -0.08417424, y: -0.54739594, z: 0.8217151, w: 0.13437526} + scale: {x: 1.0000019, y: 1.0000018, z: 1.0000007} + - name: Butt_L_end + parentName: Butt_L + position: {x: 0.000000009487849, y: 0.032692622, z: -0.000000027939677} + rotation: {x: 0.82941407, y: -0.05051005, z: 0.5164937, w: -0.20677382} + scale: {x: 1.0000019, y: 1.0000004, z: 1.0000017} + - name: Butt_R + parentName: Hips + position: {x: 0.049432106, y: -0.05621457, z: -0.03961581} + rotation: {x: 0.08417424, y: -0.54739594, z: 0.8217151, w: -0.13437526} + scale: {x: 1.0000019, y: 1.0000018, z: 1.0000007} + - name: Butt_R_end + parentName: Butt_R + position: {x: -0.000000009487849, y: 0.032692622, z: -0.000000027939677} + rotation: {x: 0.82941407, y: 0.05051005, z: -0.5164937, w: -0.20677382} + scale: {x: 1.0000019, y: 1.0000004, z: 1.0000017} + - name: Skirt_Root + parentName: Hips + position: {x: 3.0847643e-19, y: 0, z: 0.003534737} + rotation: {x: -0, y: -7.4497085e-18, z: -7.449713e-18, w: 1} + scale: {x: 1, y: 0.99999994, z: 1} + - name: Skirt_Front.1 + parentName: Skirt_Root + position: {x: 0.000090820686, y: 0.043659806, z: 0.05385978} + rotation: {x: -0.0022729947, y: 0.25096434, z: 0.967991, w: -0.0022730457} + scale: {x: 1.0000007, y: 1.0000014, z: 1.0000007} + - name: Skirt_Front.2 + parentName: Skirt_Front.1 + position: {x: -6.1118044e-10, y: 0.11242955, z: -0.000000008366214} + rotation: {x: 0.008286804, y: 0.0057808724, z: 0.0034313942, w: 0.9999431} + scale: {x: 1.0000024, y: 1.0000026, z: 0.9999996} + - name: Skirt_Front.3 + parentName: Skirt_Front.2 + position: {x: -1.1641532e-10, y: 0.069933556, z: 0.000000065039785} + rotation: {x: -0.0025075343, y: -0.000021738466, z: -0.0000413167, w: 0.9999969} + scale: {x: 1.0000057, y: 1.0000054, z: 1.000001} + - name: Skirt_SideF.R.1 + parentName: Skirt_Root + position: {x: 0.06909272, y: 0.04469335, z: 0.01596947} + rotation: {x: 0.4931639, y: 0.27615485, z: 0.80647975, w: -0.17354628} + scale: {x: 1.0000007, y: 1.0000013, z: 1} + - name: Skirt_SideF.R.2 + parentName: Skirt_SideF.R.1 + position: {x: -0.0000000060535967, y: 0.1107295, z: -0.00000005401671} + rotation: {x: -0.0045289397, y: -0.0052891374, z: 0.0005489439, w: 0.9999756} + scale: {x: 1.0000012, y: 1.0000013, z: 1} + - name: Skirt_SideF.R.3 + parentName: Skirt_SideF.R.2 + position: {x: 0.0000000040745363, y: 0.07303925, z: 0.000000033527613} + rotation: {x: -0.015564112, y: -0.019994458, z: -0.0018620439, w: 0.9996772} + scale: {x: 1.0000023, y: 1.0000033, z: 1} + - name: Skirt_SideF.L.1 + parentName: Skirt_Root + position: {x: -0.06909272, y: 0.04469335, z: 0.01596947} + rotation: {x: -0.4931639, y: 0.27615485, z: 0.80647975, w: 0.17354628} + scale: {x: 1.0000007, y: 1.0000013, z: 1} + - name: Skirt_SideF.L.2 + parentName: Skirt_SideF.L.1 + position: {x: 0.0000000060535967, y: 0.1107295, z: -0.00000005401671} + rotation: {x: -0.0045289397, y: 0.0052891374, z: -0.0005489439, w: 0.9999756} + scale: {x: 1.0000012, y: 1.0000013, z: 1} + - name: Skirt_SideF.L.3 + parentName: Skirt_SideF.L.2 + position: {x: -0.0000000040745363, y: 0.07303925, z: 0.000000033527613} + rotation: {x: -0.015564112, y: 0.019994458, z: 0.0018620439, w: 0.9996772} + scale: {x: 1.0000023, y: 1.0000033, z: 1} + - name: Skirt_SideB.R.1 + parentName: Skirt_Root + position: {x: 0.06992278, y: 0.04766363, z: -0.03609936} + rotation: {x: 0.79942715, y: 0.21083584, z: 0.4823379, w: -0.2895076} + scale: {x: 1.0000005, y: 1, z: 1.0000001} + - name: Skirt_SideB.R.2 + parentName: Skirt_SideB.R.1 + position: {x: -0.000000007450581, y: 0.1065388, z: 0.00000008940697} + rotation: {x: 0.0071548377, y: 0.0048371074, z: 0.0008139909, w: 0.9999624} + scale: {x: 1, y: 1.0000017, z: 1.0000023} + - name: Skirt_SideB.R.3 + parentName: Skirt_SideB.R.2 + position: {x: 0.000000026077032, y: 0.064784944, z: -0.000000022351742} + rotation: {x: 0.003669546, y: 0.003379154, z: -0.0027890278, w: 0.99998367} + scale: {x: 1.0000008, y: 1.0000032, z: 1.0000008} + - name: Skirt_SideB.L.1 + parentName: Skirt_Root + position: {x: -0.06992278, y: 0.04766363, z: -0.03609936} + rotation: {x: 0.79942715, y: -0.21083584, z: -0.4823379, w: -0.2895076} + scale: {x: 1.0000005, y: 1, z: 1.0000001} + - name: Skirt_SideB.L.2 + parentName: Skirt_SideB.L.1 + position: {x: 0.000000007450581, y: 0.1065388, z: 0.00000008940697} + rotation: {x: 0.0071548377, y: -0.0048371074, z: -0.0008139909, w: 0.9999624} + scale: {x: 1, y: 1.0000017, z: 1.0000023} + - name: Skirt_SideB.L.3 + parentName: Skirt_SideB.L.2 + position: {x: -0.000000026077032, y: 0.064784944, z: -0.000000022351742} + rotation: {x: 0.003669546, y: -0.003379154, z: 0.0027890278, w: 0.99998367} + scale: {x: 1.0000008, y: 1.0000032, z: 1.0000008} + - name: Skirt_Back.L.1 + parentName: Skirt_Root + position: {x: -0.04380273, y: 0.048995197, z: -0.05938794} + rotation: {x: 0.89772934, y: -0.12274001, z: -0.25275782, w: -0.33930883} + scale: {x: 1, y: 1.0000015, z: 1.000002} + - name: Skirt_Back.L.2 + parentName: Skirt_Back.L.1 + position: {x: 0.0000000037252903, y: 0.09740044, z: 0.000000009313226} + rotation: {x: 0.012178749, y: -0.0054054265, z: 0.0028376952, w: 0.99990726} + scale: {x: 1, y: 1.0000017, z: 1.0000014} + - name: Skirt_Back.L.3 + parentName: Skirt_Back.L.2 + position: {x: -0.000000014901161, y: 0.062575325, z: -0.000000011175871} + rotation: {x: 0.0030677347, y: -0.00019095556, z: -0.0022174448, w: 0.9999928} + scale: {x: 1.0000008, y: 1.0000023, z: 1.0000027} + - name: Skirt_Back.R.1 + parentName: Skirt_Root + position: {x: 0.04380273, y: 0.048995197, z: -0.05938794} + rotation: {x: 0.89772934, y: 0.12274001, z: 0.25275782, w: -0.33930883} + scale: {x: 1, y: 1.0000015, z: 1.000002} + - name: Skirt_Back.R.2 + parentName: Skirt_Back.R.1 + position: {x: -0.0000000037252903, y: 0.09740044, z: 0.000000009313226} + rotation: {x: 0.012178749, y: 0.0054054265, z: -0.0028376952, w: 0.99990726} + scale: {x: 1, y: 1.0000017, z: 1.0000014} + - name: Skirt_Back.R.3 + parentName: Skirt_Back.R.2 + position: {x: 0.000000014901161, y: 0.062575325, z: -0.000000011175871} + rotation: {x: 0.0030677347, y: 0.00019095556, z: 0.0022174448, w: 0.9999928} + scale: {x: 1.0000008, y: 1.0000023, z: 1.0000027} + - name: Skirt_Back.1 + parentName: Skirt_Root + position: {x: 0.000003445553, y: 0.0477556, z: -0.066995524} + rotation: {x: 0.9465774, y: -0.000025761121, z: -0.000025761103, w: -0.3224767} + scale: {x: 1, y: 1, z: 1.0000006} + - name: Skirt_Back.2 + parentName: Skirt_Back.1 + position: {x: -0, y: 0.06473696, z: 2.5313751e-11} + rotation: {x: 0.009685993, y: -0.0001802143, z: 0.00036565022, w: 0.99995303} + scale: {x: 0.99999994, y: 1.0000044, z: 1.0000038} + - name: Skirt_Back.3 + parentName: Skirt_Back.2 + position: {x: -2.1827873e-11, y: 0.05930858, z: 0.00000010795618} + rotation: {x: -0.0023036834, y: 0.0000951104, z: -0.00019585915, w: 0.9999973} + scale: {x: 0.9999996, y: 1.0000035, z: 1.000003} + - name: Skirt_Front.L.1 + parentName: Skirt_Root + position: {x: -0.041149877, y: 0.043450058, z: 0.042650267} + rotation: {x: -0.25715423, y: 0.2572139, z: 0.923851, w: 0.11921423} + scale: {x: 1.0000015, y: 1.0000007, z: 0.9999995} + - name: Skirt_Front.L.2 + parentName: Skirt_Front.L.1 + position: {x: -0.000000011175871, y: 0.10722355, z: 0.000000022351742} + rotation: {x: 0.0033605844, y: -0.00621943, z: -0.0032254755, w: 0.99996984} + scale: {x: 1.0000035, y: 1.000003, z: 1.0000014} + - name: Skirt_Front.L.3 + parentName: Skirt_Front.L.2 + position: {x: -0.000000022351742, y: 0.072623, z: -0.000000011175871} + rotation: {x: -0.010979156, y: 0.024391025, z: 0.011415142, w: 0.99957705} + scale: {x: 1.0000046, y: 1.000004, z: 1.0000008} + - name: Skirt_Front.R.1 + parentName: Skirt_Root + position: {x: 0.041149877, y: 0.043450058, z: 0.042650267} + rotation: {x: 0.25715423, y: 0.2572139, z: 0.923851, w: -0.11921423} + scale: {x: 1.0000015, y: 1.0000007, z: 0.9999995} + - name: Skirt_Front.R.2 + parentName: Skirt_Front.R.1 + position: {x: 0.000000011175871, y: 0.10722355, z: 0.000000022351742} + rotation: {x: 0.0033605844, y: 0.00621943, z: 0.0032254755, w: 0.99996984} + scale: {x: 1.0000035, y: 1.000003, z: 1.0000014} + - name: Skirt_Front.R.3 + parentName: Skirt_Front.R.2 + position: {x: 0.000000022351742, y: 0.072623, z: -0.000000011175871} + rotation: {x: -0.010979156, y: -0.024391025, z: -0.011415142, w: 0.99957705} + scale: {x: 1.0000046, y: 1.000004, z: 1.0000008} + - name: Body_Base + parentName: Alistia(Clone) + position: {x: -0, y: 0, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: Underwear + parentName: Alistia(Clone) + position: {x: -0, y: 0, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: Stocking + parentName: Alistia(Clone) + position: {x: -0, y: 0, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: Bura + parentName: Alistia(Clone) + position: {x: -0, y: 0, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: Shoes + parentName: Alistia(Clone) + position: {x: -0, y: 0, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + armTwist: 0.5 + foreArmTwist: 0.5 + upperLegTwist: 0.5 + legTwist: 0.5 + armStretch: 0.05 + legStretch: 0.05 + feetSpacing: 0 + globalScale: 1 + rootMotionBoneName: + hasTranslationDoF: 0 + hasExtraRoot: 1 + skeletonHasParents: 1 + lastHumanDescriptionAvatarSource: {instanceID: 0} + autoGenerateAvatarMappingIfUnspecified: 1 + animationType: 3 + humanoidOversampling: 1 + avatarSetup: 1 + additionalBone: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/04_Models/Characters/Fariy/FBX/Alistia_Hair.fbx b/Assets/04_Models/Characters/Fariy/FBX/Alistia_Hair.fbx new file mode 100644 index 00000000..7f314d39 --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/FBX/Alistia_Hair.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:37a5bcc3532b3ae7e48d7b2ac45e82ddc7566071e9d2f93ccd7e48f41a2cc40a +size 1149532 diff --git a/Assets/04_Models/Characters/Fariy/FBX/Alistia_Hair.fbx.meta b/Assets/04_Models/Characters/Fariy/FBX/Alistia_Hair.fbx.meta new file mode 100644 index 00000000..d9b1e52b --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/FBX/Alistia_Hair.fbx.meta @@ -0,0 +1,127 @@ +fileFormatVersion: 2 +guid: a6dfbc6390c7c32439b5535d97ba9adf +ModelImporter: + serializedVersion: 19301 + internalIDToNameTable: [] + externalObjects: + - first: + type: UnityEngine:Material + assembly: UnityEngine.CoreModule + name: Alistia_Cloth + second: {fileID: 2100000, guid: bcbfd5c6863e38343b245e267d25bc9a, type: 2} + - first: + type: UnityEngine:Material + assembly: UnityEngine.CoreModule + name: Alistia_Cloth_2 + second: {fileID: 2100000, guid: ec6935d242801ba45a50c57594f80846, type: 2} + - first: + type: UnityEngine:Material + assembly: UnityEngine.CoreModule + name: Alistia_Cloth_Komono + second: {fileID: 2100000, guid: 1d28e362395e8f141bb82817fa4e8fe3, type: 2} + - first: + type: UnityEngine:Material + assembly: UnityEngine.CoreModule + name: Alistia_Hair + second: {fileID: 2100000, guid: c605ffdaefec0d3429b476e3f534840c, type: 2} + - first: + type: UnityEngine:Material + assembly: UnityEngine.CoreModule + name: Maid_Cloth_Komono + second: {fileID: 2100000, guid: 3de8853db9fb48f479399f3e4c29bd4f, type: 2} + - first: + type: UnityEngine:Material + assembly: UnityEngine.CoreModule + name: Rapis_Hair + second: {fileID: 2100000, guid: 9f0241da9e2ba3d43b0fcf5d77fdd7f2, type: 2} + materials: + materialImportMode: 1 + materialName: 0 + materialSearch: 1 + materialLocation: 1 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + resampleCurves: 1 + optimizeGameObjects: 0 + motionNodeName: + rigImportErrors: + rigImportWarnings: + animationImportErrors: + animationImportWarnings: + animationRetargetingWarnings: + animationDoRetargetingWarnings: 0 + importAnimatedCustomProperties: 0 + importConstraints: 0 + animationCompression: 1 + animationRotationError: 0.5 + animationPositionError: 0.5 + animationScaleError: 0.5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + extraUserProperties: [] + clipAnimations: [] + isReadable: 1 + meshes: + lODScreenPercentages: [] + globalScale: 1 + meshCompression: 0 + addColliders: 0 + useSRGBMaterialColor: 1 + sortHierarchyByName: 1 + importVisibility: 1 + importBlendShapes: 1 + importCameras: 1 + importLights: 1 + fileIdsGeneration: 2 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + keepQuads: 0 + weldVertices: 1 + preserveHierarchy: 0 + skinWeightsMode: 0 + maxBonesPerVertex: 4 + minBoneWeight: 0.001 + meshOptimizationFlags: -1 + indexFormat: 0 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVPackMargin: 4 + useFileScale: 1 + tangentSpace: + normalSmoothAngle: 60 + normalImportMode: 0 + tangentImportMode: 3 + normalCalculationMode: 4 + legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 1 + blendShapeNormalImportMode: 1 + normalSmoothingSource: 0 + referencedClips: [] + importAnimation: 1 + humanDescription: + serializedVersion: 3 + human: [] + skeleton: [] + armTwist: 0.5 + foreArmTwist: 0.5 + upperLegTwist: 0.5 + legTwist: 0.5 + armStretch: 0.05 + legStretch: 0.05 + feetSpacing: 0 + globalScale: 1 + rootMotionBoneName: + hasTranslationDoF: 0 + hasExtraRoot: 0 + skeletonHasParents: 1 + lastHumanDescriptionAvatarSource: {instanceID: 0} + autoGenerateAvatarMappingIfUnspecified: 1 + animationType: 2 + humanoidOversampling: 1 + avatarSetup: 0 + additionalBone: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/04_Models/Characters/Fariy/FBX/Fairy_wing.fbx b/Assets/04_Models/Characters/Fariy/FBX/Fairy_wing.fbx new file mode 100644 index 00000000..70af8712 --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/FBX/Fairy_wing.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:43612c9379f8231c067100a039b19ae6dc06ba854ff96a8a16007ce3f6ba3814 +size 1218464 diff --git a/Assets/04_Models/Characters/Fariy/FBX/Fairy_wing.fbx.meta b/Assets/04_Models/Characters/Fariy/FBX/Fairy_wing.fbx.meta new file mode 100644 index 00000000..3021c57c --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/FBX/Fairy_wing.fbx.meta @@ -0,0 +1,114 @@ +fileFormatVersion: 2 +guid: 99566d3cd39f8fb49acda32c3f66513d +ModelImporter: + serializedVersion: 22200 + internalIDToNameTable: [] + externalObjects: + - first: + type: UnityEngine:Material + assembly: UnityEngine.CoreModule + name: wing_mat + second: {fileID: 2100000, guid: 6705337112664b647b77d78bb08704fb, type: 2} + materials: + materialImportMode: 2 + materialName: 0 + materialSearch: 1 + materialLocation: 0 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + resampleCurves: 1 + optimizeGameObjects: 0 + removeConstantScaleCurves: 0 + motionNodeName: + rigImportErrors: + rigImportWarnings: + animationImportErrors: + animationImportWarnings: + animationRetargetingWarnings: + animationDoRetargetingWarnings: 0 + importAnimatedCustomProperties: 0 + importConstraints: 0 + animationCompression: 1 + animationRotationError: 0.5 + animationPositionError: 0.5 + animationScaleError: 0.5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + extraUserProperties: [] + clipAnimations: [] + isReadable: 0 + meshes: + lODScreenPercentages: [] + globalScale: 1 + meshCompression: 0 + addColliders: 0 + useSRGBMaterialColor: 1 + sortHierarchyByName: 1 + importPhysicalCameras: 1 + importVisibility: 1 + importBlendShapes: 1 + importCameras: 1 + importLights: 1 + nodeNameCollisionStrategy: 1 + fileIdsGeneration: 2 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + keepQuads: 0 + weldVertices: 1 + bakeAxisConversion: 0 + preserveHierarchy: 0 + skinWeightsMode: 0 + maxBonesPerVertex: 4 + minBoneWeight: 0.001 + optimizeBones: 1 + meshOptimizationFlags: -1 + indexFormat: 0 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVMarginMethod: 1 + secondaryUVMinLightmapResolution: 40 + secondaryUVMinObjectScale: 1 + secondaryUVPackMargin: 4 + useFileScale: 1 + strictVertexDataChecks: 0 + tangentSpace: + normalSmoothAngle: 60 + normalImportMode: 0 + tangentImportMode: 3 + normalCalculationMode: 4 + legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0 + blendShapeNormalImportMode: 1 + normalSmoothingSource: 0 + referencedClips: [] + importAnimation: 1 + humanDescription: + serializedVersion: 3 + human: [] + skeleton: [] + armTwist: 0.5 + foreArmTwist: 0.5 + upperLegTwist: 0.5 + legTwist: 0.5 + armStretch: 0.05 + legStretch: 0.05 + feetSpacing: 0 + globalScale: 1 + rootMotionBoneName: + hasTranslationDoF: 0 + hasExtraRoot: 0 + skeletonHasParents: 1 + lastHumanDescriptionAvatarSource: {instanceID: 0} + autoGenerateAvatarMappingIfUnspecified: 1 + animationType: 2 + humanoidOversampling: 1 + avatarSetup: 0 + addHumanoidExtraRootOnlyWhenUsingAvatar: 1 + importBlendShapeDeformPercent: 1 + remapMaterialsIfMaterialImportModeIsNone: 0 + additionalBone: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/04_Models/Characters/Fariy/Fairy.prefab b/Assets/04_Models/Characters/Fariy/Fairy.prefab new file mode 100644 index 00000000..e005bc94 --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Fairy.prefab @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d007c21785389ce941f7be6c6deec99248b6e61a2125f113eeaead0ee33bec4c +size 472037 diff --git a/Assets/04_Models/Characters/Fariy/Fairy.prefab.meta b/Assets/04_Models/Characters/Fariy/Fairy.prefab.meta new file mode 100644 index 00000000..1aa3f9aa --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Fairy.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 327739e1c886bed48af9bcb80c8a617c +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/04_Models/Characters/Fariy/Materials.meta b/Assets/04_Models/Characters/Fariy/Materials.meta new file mode 100644 index 00000000..59da9320 --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Materials.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4067b7e3770e11342bd1f9a6a629f337 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/04_Models/Characters/Fariy/Materials/Body_Hair.meta b/Assets/04_Models/Characters/Fariy/Materials/Body_Hair.meta new file mode 100644 index 00000000..21e288e1 --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Materials/Body_Hair.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 719e101d11ee0274487bef5d8c811ffb +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/04_Models/Characters/Fariy/Materials/Body_Hair/Alistia_Body.mat b/Assets/04_Models/Characters/Fariy/Materials/Body_Hair/Alistia_Body.mat new file mode 100644 index 00000000..1ba2268e --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Materials/Body_Hair/Alistia_Body.mat @@ -0,0 +1,998 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Alistia_Body + m_Shader: {fileID: 4800000, guid: 6459b2db96a08ca41b0f9b39dc7ad59e, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: + - N_F_DDMD_ON + - N_F_EAL_ON + - N_F_LLI_ON + - N_F_O_ON + - N_F_RDC_ON + - N_F_RELGI_ON + - N_F_SS_ON + - N_F_TRANSAFFSHA_ON + - _UVSET_UV0 + m_InvalidKeywords: [] + m_LightmapFlags: 0 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: + VRCFallback: Unlit + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AnisotropyScaleMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AnisotropyShiftNoiseMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AnisotropyTangentMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AudioLinkLocalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AudioLinkMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BacklightColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BaseColorMap: + m_Texture: {fileID: 2800000, guid: 38eb494fcb7511e49a5a0dafcb8aec73, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BaseMap: + m_Texture: {fileID: 2800000, guid: 38eb494fcb7511e49a5a0dafcb8aec73, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Bump2ndMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Bump2ndScaleMask: + m_Texture: {fileID: 0} + 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} + - _DissolveMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DissolveNoiseMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DitherTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Emission2ndBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Emission2ndGradTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Emission2ndMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionGradTex: + 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} + - _FReflection: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlitterColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlitterShapeTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlossTexture: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MCap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MCapMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main2ndBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main2ndDissolveMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main2ndDissolveNoiseMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main2ndTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main3rdBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main3rdDissolveMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main3rdDissolveNoiseMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main3rdTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainColorAdjustMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainGradationTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 38eb494fcb7511e49a5a0dafcb8aec73, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MaskGloss: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MaskReflection: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MaskSelfLit: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MaskTransparency: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCap2ndBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCap2ndBumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCap2ndTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCapBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCapBumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCapTex: + 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} + - _NormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineVectorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineWidthControl: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineWidthMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _PTexture: + 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} + - _ReflectionColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ReflectionCubeTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _RimColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _RimShadeMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SecondaryCutout: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Shadow2ndColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Shadow3rdColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowBlurMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowBorderMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowColorTexture: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowStrengthMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowT: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SmoothnessTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _AAS: 0.0001 + - _AAStrength: 1 + - _AlpToCov: 0 + - _AlphaBaseCutout: 1 + - _AlphaBoostFA: 10 + - _AlphaMaskMode: 0 + - _AlphaMaskScale: 1 + - _AlphaMaskValue: 0 + - _AlphaToMask: 0 + - _Anisotropy2MatCap: 0 + - _Anisotropy2MatCap2nd: 0 + - _Anisotropy2Reflection: 0 + - _Anisotropy2ndBitangentWidth: 1 + - _Anisotropy2ndShift: 0 + - _Anisotropy2ndShiftNoiseScale: 0 + - _Anisotropy2ndSpecularStrength: 0 + - _Anisotropy2ndTangentWidth: 1 + - _AnisotropyBitangentWidth: 1 + - _AnisotropyScale: 1 + - _AnisotropyShift: 0 + - _AnisotropyShiftNoiseScale: 0 + - _AnisotropySpecularStrength: 1 + - _AnisotropyTangentWidth: 1 + - _ApplyReflection: 0 + - _ApplySpecular: 1 + - _ApplySpecularFA: 1 + - _AsOverlay: 0 + - _AsUnlit: 0 + - _AudioLink2Emission: 0 + - _AudioLink2Emission2nd: 0 + - _AudioLink2Emission2ndGrad: 0 + - _AudioLink2EmissionGrad: 0 + - _AudioLink2Main2nd: 0 + - _AudioLink2Main3rd: 0 + - _AudioLink2Vertex: 0 + - _AudioLinkAsLocal: 0 + - _AudioLinkMask_UVMode: 0 + - _AudioLinkUVMode: 1 + - _AudioLinkVertexUVMode: 1 + - _BackfaceForceShadow: 0 + - _BacklightBackfaceMask: 1 + - _BacklightBlur: 0.05 + - _BacklightBorder: 0.35 + - _BacklightDirectivity: 5 + - _BacklightMainStrength: 0 + - _BacklightNormalStrength: 1 + - _BacklightReceiveShadow: 1 + - _BacklightViewStrength: 1 + - _BeforeExposureLimit: 10000 + - _BitKey0: 0 + - _BitKey1: 0 + - _BitKey10: 0 + - _BitKey11: 0 + - _BitKey12: 0 + - _BitKey13: 0 + - _BitKey14: 0 + - _BitKey15: 0 + - _BitKey16: 0 + - _BitKey17: 0 + - _BitKey18: 0 + - _BitKey19: 0 + - _BitKey2: 0 + - _BitKey20: 0 + - _BitKey21: 0 + - _BitKey22: 0 + - _BitKey23: 0 + - _BitKey24: 0 + - _BitKey25: 0 + - _BitKey26: 0 + - _BitKey27: 0 + - _BitKey28: 0 + - _BitKey29: 0 + - _BitKey3: 0 + - _BitKey30: 0 + - _BitKey31: 0 + - _BitKey4: 0 + - _BitKey5: 0 + - _BitKey6: 0 + - _BitKey7: 0 + - _BitKey8: 0 + - _BitKey9: 0 + - _BleModDest: 0 + - _BleModSour: 1 + - _BlendOp: 0 + - _BlendOpAlpha: 0 + - _BlendOpAlphaFA: 4 + - _BlendOpFA: 4 + - _Bump2ndMap_UVMode: 0 + - _Bump2ndScale: 1 + - _BumpScale: 1 + - _ClipAdju: 0 + - _ColorMask: 15 + - _Compa: 4 + - _ComputeMeshIndex: 0 + - _Cull: 2 + - _Culling: 2 + - _CustomLightDirectionFollowObjectRotation: 0 + - _CustomLightDirectionIntensity: 0 + - _Cutoff: 0.5 + - _Cutout: 0.5 + - _DepthThreshold: 900 + - _DirectionalLightIntensity: 1 + - _DissolveNoiseStrength: 0.1 + - _DistanceFadeMode: 0 + - _DistanceFadeRimFresnelPower: 5 + - _DitherMaxValue: 255 + - _DoubleSidedOutline: 1 + - _DstBlend: 0 + - _DstBlendAlpha: 10 + - _DstBlendAlphaFA: 1 + - _DstBlendFA: 1 + - _DummyProperty: 0 + - _DynamicNoisyOutline: 0 + - _Emission2ndBlend: 1 + - _Emission2ndBlendMode: 1 + - _Emission2ndFluorescence: 0 + - _Emission2ndGradSpeed: 1 + - _Emission2ndMainStrength: 0 + - _Emission2ndMap_UVMode: 0 + - _Emission2ndParallaxDepth: 0 + - _Emission2ndUseGrad: 0 + - _EmissionBlend: 1 + - _EmissionBlendMode: 1 + - _EmissionFluorescence: 1 + - _EmissionGradSpeed: 1 + - _EmissionMainStrength: 0 + - _EmissionMap_UVMode: 0 + - _EmissionParallaxDepth: 0 + - _EmissionUseGrad: 0 + - _EnvironmentalLightingIntensity: 1 + - _FarDistanceMaxWidth: 10 + - _FlipNormal: 0 + - _GIFlatShade: 0 + - _GIShadeThreshold: 0 + - _GSAAStrength: 0 + - _GlitterAngleRandomize: 0 + - _GlitterApplyShape: 0 + - _GlitterApplyTransparency: 1 + - _GlitterBackfaceMask: 0 + - _GlitterColorTex_UVMode: 0 + - _GlitterEnableLighting: 1 + - _GlitterMainStrength: 0 + - _GlitterNormalStrength: 1 + - _GlitterPostContrast: 1 + - _GlitterScaleRandomize: 0 + - _GlitterSensitivity: 0.25 + - _GlitterShadowMask: 0 + - _GlitterUVMode: 0 + - _GlitterVRParallaxStrength: 1 + - _GlossColorPower: 10 + - _GlossIntensity: 1 + - _GlossSoftness: 0 + - _GlossTextureFollowLight: 0 + - _GlossTextureFollowObjectRotation: 0 + - _GlossTextureRotate: 0 + - _GlossTextureSoftness: 0 + - _Glossiness: 0.6 + - _Glow_Edge_Width: 1 + - _HighlightColorPower: 1 + - _IDMask1: 0 + - _IDMask2: 0 + - _IDMask3: 0 + - _IDMask4: 0 + - _IDMask5: 0 + - _IDMask6: 0 + - _IDMask7: 0 + - _IDMask8: 0 + - _IDMaskCompile: 0 + - _IDMaskControlsDissolve: 0 + - _IDMaskFrom: 8 + - _IDMaskIndex1: 0 + - _IDMaskIndex2: 0 + - _IDMaskIndex3: 0 + - _IDMaskIndex4: 0 + - _IDMaskIndex5: 0 + - _IDMaskIndex6: 0 + - _IDMaskIndex7: 0 + - _IDMaskIndex8: 0 + - _IDMaskIsBitmap: 0 + - _IDMaskPrior1: 0 + - _IDMaskPrior2: 0 + - _IDMaskPrior3: 0 + - _IDMaskPrior4: 0 + - _IDMaskPrior5: 0 + - _IDMaskPrior6: 0 + - _IDMaskPrior7: 0 + - _IDMaskPrior8: 0 + - _IgnoreEncryption: 0 + - _Invisible: 0 + - _LLI_Max: 2 + - _LLI_Min: 1 + - _LigIgnoYNorDir: 0 + - _LightAffectOutlineColor: 0 + - _LightAffectRimLightColor: 0 + - _LightAffectShadow: 0 + - _LightFalloffAffectShadowT: 0 + - _LightFalloffSoftness: 1 + - _LightIntensity: 1 + - _LightMaxLimit: 1 + - _LightMinLimit: 0.05 + - _MCIALO: 0 + - _MCapIntensity: 1 + - _MVCOL: 0 + - _MaiColPo: 0.8 + - _Main2ndDissolveNoiseStrength: 0.1 + - _Main2ndEnableLighting: 1 + - _Main2ndTexAlphaMode: 0 + - _Main2ndTexAngle: 0 + - _Main2ndTexBlendMode: 1 + - _Main2ndTexIsDecal: 0 + - _Main2ndTexIsLeftOnly: 0 + - _Main2ndTexIsMSDF: 0 + - _Main2ndTexIsRightOnly: 0 + - _Main2ndTexShouldCopy: 0 + - _Main2ndTexShouldFlipCopy: 0 + - _Main2ndTexShouldFlipMirror: 0 + - _Main2ndTex_Cull: 0 + - _Main2ndTex_UVMode: 0 + - _Main3rdDissolveNoiseStrength: 0.1 + - _Main3rdEnableLighting: 1 + - _Main3rdTexAlphaMode: 0 + - _Main3rdTexAngle: 0 + - _Main3rdTexBlendMode: 0 + - _Main3rdTexIsDecal: 0 + - _Main3rdTexIsLeftOnly: 0 + - _Main3rdTexIsMSDF: 0 + - _Main3rdTexIsRightOnly: 0 + - _Main3rdTexShouldCopy: 0 + - _Main3rdTexShouldFlipCopy: 0 + - _Main3rdTexShouldFlipMirror: 0 + - _Main3rdTex_Cull: 0 + - _Main3rdTex_UVMode: 0 + - _MainGradationStrength: 0 + - _MatCap2ndApplyTransparency: 1 + - _MatCap2ndBackfaceMask: 0 + - _MatCap2ndBlend: 1 + - _MatCap2ndBlendMode: 1 + - _MatCap2ndBumpScale: 1 + - _MatCap2ndCustomNormal: 0 + - _MatCap2ndEnableLighting: 1 + - _MatCap2ndLod: 0 + - _MatCap2ndMainStrength: 0 + - _MatCap2ndNormalStrength: 1 + - _MatCap2ndPerspective: 1 + - _MatCap2ndShadowMask: 0 + - _MatCap2ndVRParallaxStrength: 1 + - _MatCap2ndZRotCancel: 1 + - _MatCapApplyTransparency: 1 + - _MatCapBackfaceMask: 0 + - _MatCapBlend: 1 + - _MatCapBlendMode: 1 + - _MatCapBumpScale: 1 + - _MatCapCustomNormal: 0 + - _MatCapEnableLighting: 1 + - _MatCapLod: 0 + - _MatCapMainStrength: 0 + - _MatCapNormalStrength: 1 + - _MatCapPerspective: 1 + - _MatCapShadowMask: 0 + - _MatCapVRParallaxStrength: 1 + - _MatCapZRotCancel: 1 + - _MaxFadDistance: 2 + - _Metallic: 0 + - _MinFadDistance: 0 + - _MixMainTexToOutline: 0 + - _MonochromeLighting: 0 + - _N_F_ANIS: 0 + - _N_F_CA: 0 + - _N_F_CLD: 0 + - _N_F_CO: 0 + - _N_F_COEDGL: 0 + - _N_F_DCS: 0 + - _N_F_DDMD: 1 + - _N_F_EAL: 1 + - _N_F_ESSAO: 0 + - _N_F_FR: 0 + - _N_F_GLO: 0 + - _N_F_GLOT: 0 + - _N_F_HDLS: 0 + - _N_F_HPSS: 0 + - _N_F_LLI: 1 + - _N_F_MC: 0 + - _N_F_MSSOLTFO: 0 + - _N_F_NFD: 0 + - _N_F_NLASOBF: 0 + - _N_F_NM: 0 + - _N_F_O: 1 + - _N_F_OFLMB: 0 + - _N_F_PA: 0 + - _N_F_PT: 0 + - _N_F_R: 0 + - _N_F_RDC: 1 + - _N_F_RL: 0 + - _N_F_RLIS: 0 + - _N_F_SCO: 0 + - _N_F_SCT: 0 + - _N_F_SE: 0 + - _N_F_SL: 0 + - _N_F_SLMM: 0 + - _N_F_SON: 0 + - _N_F_SS: 1 + - _N_F_ST: 0 + - _N_F_STIAL: 0 + - _N_F_STIS: 0 + - _N_F_STSDFM: 0 + - _N_F_TP: 0 + - _NoiTexAffStraWidt: 0 + - _NoisTexInten: 1 + - _NoiseSize: 100 + - _NoisyOutlineIntensity: 0 + - _NorMapAsDis: 0 + - _NormalMapIntensity: 1 + - _ObjePosiZCS: 0 + - _OffsetFactor: 0 + - _OffsetUnits: 0 + - _Opacity: 1 + - _Oper: 0 + - _OutStenPass: 0 + - _OutZTest: 4 + - _OutZWrite: 1 + - _OutlineAlphaToMask: 0 + - _OutlineBlendOp: 0 + - _OutlineBlendOpAlpha: 0 + - _OutlineBlendOpAlphaFA: 4 + - _OutlineBlendOpFA: 4 + - _OutlineColorMask: 15 + - _OutlineCull: 1 + - _OutlineDeleteMesh: 0 + - _OutlineDisableInVR: 0 + - _OutlineDstBlend: 0 + - _OutlineDstBlendAlpha: 10 + - _OutlineDstBlendAlphaFA: 1 + - _OutlineDstBlendFA: 1 + - _OutlineEnableLighting: 1 + - _OutlineExtrudeMethod: 0 + - _OutlineFixWidth: 0 + - _OutlineLitApplyTex: 0 + - _OutlineLitOffset: -8 + - _OutlineLitScale: 10 + - _OutlineLitShadowReceive: 0 + - _OutlineOffsetFactor: 0 + - _OutlineOffsetUnits: 0 + - _OutlineSrcBlend: 1 + - _OutlineSrcBlendAlpha: 1 + - _OutlineSrcBlendAlphaFA: 0 + - _OutlineSrcBlendFA: 1 + - _OutlineStencilComp: 8 + - _OutlineStencilFail: 0 + - _OutlineStencilPass: 0 + - _OutlineStencilReadMask: 255 + - _OutlineStencilRef: 0 + - _OutlineStencilWriteMask: 255 + - _OutlineStencilZFail: 0 + - _OutlineVectorScale: 1 + - _OutlineVectorUVMode: 0 + - _OutlineVertexR2Width: 0 + - _OutlineWidth: 0.03 + - _OutlineWidthAffectedByViewDistance: 0 + - _OutlineZBias: 0 + - _OutlineZClip: 1 + - _OutlineZPostionInCamera: 0 + - _OutlineZTest: 2 + - _OutlineZWrite: 1 + - _OverallShadowColorPower: 1 + - _PADist: 0 + - _PASize: 0.5 + - _PASmooTrans: 1 + - _PSGLOTEX: 0 + - _PTexturePower: 1 + - _Parallax: 0.02 + - _ParallaxOffset: 0.5 + - _PointSpotlightIntensity: 1 + - _PresAdju: 1 + - _RELG: 1 + - _RQSO: 0 + - _ReduSha: 0.5 + - _RefMetallic: 0 + - _RefVal: 0 + - _Reflectance: 0.04 + - _ReflectionApplyTransparency: 1 + - _ReflectionBlendMode: 1 + - _ReflectionCubeEnableLighting: 1 + - _ReflectionCubeOverride: 0 + - _ReflectionIntensity: 0 + - _ReflectionNormalStrength: 1 + - _RimApplyTransparency: 1 + - _RimBackfaceMask: 0 + - _RimBlendMode: 1 + - _RimBlur: 0.1 + - _RimBorder: 0.5 + - _RimDirRange: 0 + - _RimDirStrength: 0 + - _RimEnableLighting: 1 + - _RimFresnelPower: 3 + - _RimIndirBlur: 0.1 + - _RimIndirBorder: 0.5 + - _RimIndirRange: 0 + - _RimLigInt: 1 + - _RimLightColorPower: 10 + - _RimLightInLight: 1 + - _RimLightSoftness: 1 + - _RimLightUnfill: 1.5 + - _RimMainStrength: 0 + - _RimNormalStrength: 1 + - _RimShadeBlur: 1 + - _RimShadeBorder: 0.5 + - _RimShadeFresnelPower: 1 + - _RimShadeNormalStrength: 1 + - _RimShadowMask: 0 + - _RimVRParallaxStrength: 1 + - _SPECIN: 1 + - _SPECMODE: 0 + - _STIL: 0 + - _Saturation: 1 + - _SelfLitHighContrast: 1 + - _SelfLitIntensity: 0 + - _SelfLitPower: 2 + - _SelfShadowAffectedByLightShadowStrength: 0 + - _SelfShadowHardness: 1 + - _SelfShadowRealTimeShadowColorPower: 1 + - _SelfShadowRealtimeShadowIntensity: 0 + - _SelfShadowShadowTAtViewDirection: 0 + - _SelfShadowThreshold: 0.93 + - _Shadow2ndBlur: 0.08 + - _Shadow2ndBorder: 0.2 + - _Shadow2ndNormalStrength: 1 + - _Shadow2ndReceive: 0 + - _Shadow3rdBlur: 0.1 + - _Shadow3rdBorder: 0.25 + - _Shadow3rdNormalStrength: 1 + - _Shadow3rdReceive: 0 + - _ShadowBlur: 0.17 + - _ShadowBlurMaskLOD: 0 + - _ShadowBorder: 0.1 + - _ShadowBorderMaskLOD: 0 + - _ShadowBorderRange: 0 + - _ShadowColorTexturePower: 0 + - _ShadowColorType: 0 + - _ShadowEnvStrength: 0 + - _ShadowFlatBlur: 1 + - _ShadowFlatBorder: 1 + - _ShadowHardness: 0 + - _ShadowMainStrength: 0 + - _ShadowMaskType: 0 + - _ShadowNormalStrength: 1 + - _ShadowPostAO: 0 + - _ShadowReceive: 1 + - _ShadowStrength: 0.6 + - _ShadowStrengthMaskLOD: 0 + - _ShadowTColorPower: 1 + - _ShadowTHardness: 1 + - _ShadowTIntensity: 1 + - _ShadowTLightThreshold: 50 + - _ShadowTShadowThreshold: 0 + - _ShifAnis: 0 + - _ShiftBackfaceUV: 0 + - _ShowInAmbientLightShadowIntensity: 1 + - _ShowInAmbientLightShadowThreshold: 0.4 + - _ShowNormal: 0 + - _SimTrans: 0 + - _SkinMatrixIndex: 0 + - _SmoothObjectNormal: 0 + - _Smoothness: 1 + - _SpecularBlur: 0 + - _SpecularBorder: 0.5 + - _SpecularNormalStrength: 1 + - _SpecularToon: 1 + - _SrcBlend: 1 + - _SrcBlendAlpha: 1 + - _SrcBlendAlphaFA: 0 + - _SrcBlendFA: 1 + - _StencilComp: 8 + - _StencilFail: 0 + - _StencilPass: 0 + - _StencilReadMask: 255 + - _StencilRef: 0 + - _StencilWriteMask: 255 + - _StencilZFail: 0 + - _StraWidt: 10 + - _SubpassCutoff: 0.5 + - _TEXMCOLINT: 1 + - _TRANSMODE: 0 + - _TessEdge: 10 + - _TessFactorMax: 3 + - _TessShrink: 0 + - _TessStrength: 0.5 + - _TessellationFar: 1 + - _TessellationNear: 1 + - _TessellationSmoothness: 0.5 + - _TessellationTransition: 0.8 + - _TexturePatternStyle: 0 + - _TrailSize: 1.5 + - _TransAffSha: 1 + - _TransparentMode: 0 + - _TransparentThreshold: 0 + - _TriPlaBlend: 4 + - _TriPlaTile: 1 + - _UDIMDiscardCompile: 0 + - _UDIMDiscardMode: 0 + - _UDIMDiscardRow0_0: 0 + - _UDIMDiscardRow0_1: 0 + - _UDIMDiscardRow0_2: 0 + - _UDIMDiscardRow0_3: 0 + - _UDIMDiscardRow1_0: 0 + - _UDIMDiscardRow1_1: 0 + - _UDIMDiscardRow1_2: 0 + - _UDIMDiscardRow1_3: 0 + - _UDIMDiscardRow2_0: 0 + - _UDIMDiscardRow2_1: 0 + - _UDIMDiscardRow2_2: 0 + - _UDIMDiscardRow2_3: 0 + - _UDIMDiscardRow3_0: 0 + - _UDIMDiscardRow3_1: 0 + - _UDIMDiscardRow3_2: 0 + - _UDIMDiscardRow3_3: 0 + - _UDIMDiscardUV: 0 + - _UVSet: 0 + - _UseAnisotropy: 0 + - _UseAudioLink: 0 + - _UseBacklight: 0 + - _UseBump2ndMap: 0 + - _UseBumpMap: 0 + - _UseClippingCanceller: 0 + - _UseDither: 0 + - _UseEmission: 0 + - _UseEmission2nd: 0 + - _UseGlitter: 0 + - _UseMain2ndTex: 0 + - _UseMain3rdTex: 0 + - _UseMatCap: 0 + - _UseMatCap2nd: 0 + - _UseOutline: 0 + - _UsePOM: 0 + - _UseParallax: 0 + - _UseReflection: 0 + - _UseRim: 0 + - _UseRimShade: 0 + - _UseSecondaryCutout: 0 + - _UseShadow: 1 + - _UseTLB: 0 + - _VertexColorBlueAffectOutlineWitdh: 0 + - _VertexColorGreenControlSelfShadowThreshold: 0 + - _VertexColorRedControlSmoothObjectNormal: 0 + - _VertexLightStrength: 1 + - _ZClip: 1 + - _ZTest: 4 + - _ZWrite: 1 + - _e2gai: 2 + - _e2gci: 2 + - _egai: 2 + - _egci: 2 + - _lilDirectionalLightStrength: 1 + - _lilShadowCasterBias: 0 + - _lilToonVersion: 42 + m_Colors: + - _AudioLinkDefaultValue: {r: 0, g: 0, b: 2, a: 0.75} + - _AudioLinkLocalMapParams: {r: 120, g: 1, b: 0, a: 0} + - _AudioLinkMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _AudioLinkStart: {r: 0, g: 0, b: 0, a: 0} + - _AudioLinkUVParams: {r: 0.25, g: 0, b: 0, a: 0.125} + - _AudioLinkVertexStart: {r: 0, g: 0, b: 0, a: 0} + - _AudioLinkVertexStrength: {r: 0, g: 0, b: 0, a: 1} + - _AudioLinkVertexUVParams: {r: 0.25, g: 0, b: 0, a: 0.125} + - _BackfaceColor: {r: 0, g: 0, b: 0, a: 0} + - _BacklightColor: {r: 0.85, g: 0.8, b: 0.7, a: 1} + - _BaseColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Color2nd: {r: 1, g: 1, b: 1, a: 1} + - _Color3rd: {r: 1, g: 1, b: 1, a: 1} + - _CustomLightDirection: {r: 0, g: 0, b: 10, a: 0} + - _DissolveColor: {r: 1, g: 1, b: 1, a: 1} + - _DissolveNoiseMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _DissolveParams: {r: 0, g: 0, b: 0.5, a: 0.1} + - _DissolvePos: {r: 0, g: 0, b: 0, a: 0} + - _DistanceFade: {r: 0.1, g: 0.01, b: 0, a: 0} + - _DistanceFadeColor: {r: 0, g: 0, b: 0, a: 1} + - _DistanceFadeRimColor: {r: 0, g: 0, b: 0, a: 0} + - _Emission2ndBlendMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _Emission2ndBlink: {r: 0, g: 0, b: 3.141593, a: 0} + - _Emission2ndColor: {r: 1, g: 1, b: 1, a: 1} + - _Emission2ndMap_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _EmissionBlendMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _EmissionBlink: {r: 0, g: 0, b: 3.1415932, a: 0} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _EmissionMap_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _GlitterAtras: {r: 1, g: 1, b: 0, a: 0} + - _GlitterColor: {r: 1, g: 1, b: 1, a: 1} + - _GlitterParams1: {r: 256, g: 256, b: 0.16, a: 50} + - _GlitterParams2: {r: 0.25, g: 0, b: 0, a: 0} + - _GlossColor: {r: 1, g: 1, b: 1, a: 1} + - _Glow_Color: {r: 1, g: 1, b: 1, a: 1} + - _HighlightColor: {r: 0.7311321, g: 0.7490734, b: 1, a: 1} + - _Keys: {r: 0, g: 0, b: 0, a: 0} + - _LightDirectionOverride: {r: 0, g: 0.001, b: 0, a: 0} + - _Main2ndDissolveColor: {r: 1, g: 1, b: 1, a: 1} + - _Main2ndDissolveNoiseMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _Main2ndDissolveParams: {r: 0, g: 0, b: 0.5, a: 0.1} + - _Main2ndDissolvePos: {r: 0, g: 0, b: 0, a: 0} + - _Main2ndDistanceFade: {r: 0.1, g: 0.01, b: 0, a: 0} + - _Main2ndTexDecalAnimation: {r: 1, g: 1, b: 1, a: 30} + - _Main2ndTexDecalSubParam: {r: 1, g: 1, b: 0, a: 1} + - _Main2ndTex_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _Main3rdDissolveColor: {r: 1, g: 1, b: 1, a: 1} + - _Main3rdDissolveNoiseMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _Main3rdDissolveParams: {r: 0, g: 0, b: 0.5, a: 0.1} + - _Main3rdDissolvePos: {r: 0, g: 0, b: 0, a: 0} + - _Main3rdDistanceFade: {r: 0.1, g: 0.01, b: 0, a: 0} + - _Main3rdTexDecalAnimation: {r: 1, g: 1, b: 1, a: 30} + - _Main3rdTexDecalSubParam: {r: 1, g: 1, b: 0, a: 1} + - _Main3rdTex_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _MainColor: {r: 1, g: 1, b: 1, a: 1} + - _MainTexHSVG: {r: 0, g: 1, b: 1, a: 1} + - _MainTex_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _MatCap2ndBlendUV1: {r: 0, g: 0, b: 0, a: 0} + - _MatCap2ndColor: {r: 1, g: 1, b: 1, a: 1} + - _MatCapBlendUV1: {r: 0, g: 0, b: 0, a: 0} + - _MatCapColor: {r: 1, g: 1, b: 1, a: 1} + - _ObjPosi: {r: 0, g: 0, b: 0, a: 0} + - _ObjectForward: {r: 0, g: 0, b: 0, a: 0} + - _ObjectRight: {r: 0, g: 0, b: 0, a: 0} + - _OutResi: {r: 1, g: 1, b: 1, a: 1} + - _OutlineColor: {r: 0.8392157, g: 0.5647059, b: 0.63529414, a: 1} + - _OutlineLitColor: {r: 1, g: 0.19999996, b: 0, a: 0} + - _OutlineOffset: {r: 0, g: 0, b: 0, a: 1} + - _OutlineTexHSVG: {r: 0, g: 1, b: 1, a: 1} + - _OutlineTex_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _OverallShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _PTCol: {r: 0, g: 0, b: 0, a: 1} + - _PrevPosition: {r: 0, g: 0, b: 0, a: 0} + - _ReflectionColor: {r: 1, g: 1, b: 1, a: 1} + - _ReflectionCubeColor: {r: 0, g: 0, b: 0, a: 1} + - _RimColor: {r: 1, g: 1, b: 1, a: 1} + - _RimIndirColor: {r: 1, g: 1, b: 1, a: 1} + - _RimLigPosi: {r: 1, g: 1, b: 1, a: 1} + - _RimLightColor: {r: 1, g: 1, b: 1, a: 1} + - _RimShadeColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + - _SSAOColor: {r: 0, g: 0, b: 0, a: 0} + - _SelfLitColor: {r: 1, g: 1, b: 1, a: 1} + - _SelfShadowRealTimeShadowColor: {r: 1, g: 1, b: 1, a: 1} + - _Shadow2ndColor: {r: 1, g: 0.9156185, b: 0.8915094, a: 1} + - _Shadow3rdColor: {r: 0, g: 0, b: 0, a: 0} + - _ShadowAOShift: {r: 1, g: 0, b: 1, a: 0} + - _ShadowAOShift2: {r: 1, g: 0, b: 1, a: 0} + - _ShadowBorderColor: {r: 0, g: 0, b: 0, a: 1} + - _ShadowColor: {r: 1, g: 0.92156863, b: 0.8901961, a: 1} + - _ShadowTColor: {r: 1, g: 1, b: 1, a: 1} + - _XYZPosition: {r: 0, g: 0, b: 0, a: 0} + - _e2ga0: {r: 1, g: 0, b: 0, a: 0} + - _e2ga1: {r: 1, g: 0, b: 0, a: 1} + - _e2ga2: {r: 1, g: 0, b: 0, a: 0} + - _e2ga3: {r: 1, g: 0, b: 0, a: 0} + - _e2ga4: {r: 1, g: 0, b: 0, a: 0} + - _e2ga5: {r: 1, g: 0, b: 0, a: 0} + - _e2ga6: {r: 1, g: 0, b: 0, a: 0} + - _e2ga7: {r: 1, g: 0, b: 0, a: 0} + - _e2gc0: {r: 1, g: 1, b: 1, a: 0} + - _e2gc1: {r: 1, g: 1, b: 1, a: 1} + - _e2gc2: {r: 1, g: 1, b: 1, a: 0} + - _e2gc3: {r: 1, g: 1, b: 1, a: 0} + - _e2gc4: {r: 1, g: 1, b: 1, a: 0} + - _e2gc5: {r: 1, g: 1, b: 1, a: 0} + - _e2gc6: {r: 1, g: 1, b: 1, a: 0} + - _e2gc7: {r: 1, g: 1, b: 1, a: 0} + - _ega0: {r: 1, g: 0, b: 0, a: 0} + - _ega1: {r: 1, g: 0, b: 0, a: 1} + - _ega2: {r: 1, g: 0, b: 0, a: 0} + - _ega3: {r: 1, g: 0, b: 0, a: 0} + - _ega4: {r: 1, g: 0, b: 0, a: 0} + - _ega5: {r: 1, g: 0, b: 0, a: 0} + - _ega6: {r: 1, g: 0, b: 0, a: 0} + - _ega7: {r: 1, g: 0, b: 0, a: 0} + - _egc0: {r: 1, g: 1, b: 1, a: 0} + - _egc1: {r: 1, g: 1, b: 1, a: 1} + - _egc2: {r: 1, g: 1, b: 1, a: 0} + - _egc3: {r: 1, g: 1, b: 1, a: 0} + - _egc4: {r: 1, g: 1, b: 1, a: 0} + - _egc5: {r: 1, g: 1, b: 1, a: 0} + - _egc6: {r: 1, g: 1, b: 1, a: 0} + - _egc7: {r: 1, g: 1, b: 1, a: 0} + m_BuildTextureStacks: [] + m_AllowLocking: 1 diff --git a/Assets/04_Models/Characters/Fariy/Materials/Body_Hair/Alistia_Body.mat.meta b/Assets/04_Models/Characters/Fariy/Materials/Body_Hair/Alistia_Body.mat.meta new file mode 100644 index 00000000..434e8b91 --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Materials/Body_Hair/Alistia_Body.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c8b11ad3fb679554b8fe6a090fb2df31 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/04_Models/Characters/Fariy/Materials/Body_Hair/Alistia_Face.mat b/Assets/04_Models/Characters/Fariy/Materials/Body_Hair/Alistia_Face.mat new file mode 100644 index 00000000..44ff3be8 --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Materials/Body_Hair/Alistia_Face.mat @@ -0,0 +1,999 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Alistia_Face + m_Shader: {fileID: 4800000, guid: 6459b2db96a08ca41b0f9b39dc7ad59e, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: + - N_F_DDMD_ON + - N_F_EAL_ON + - N_F_O_ON + - N_F_RDC_ON + - N_F_RELGI_ON + - N_F_SS_ON + - N_F_TRANSAFFSHA_ON + - N_F_TRANS_ON + - _UVSET_UV0 + m_InvalidKeywords: [] + m_LightmapFlags: 0 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 3000 + stringTagMap: + RenderType: Transparent + VRCFallback: Unlit + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AnisotropyScaleMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AnisotropyShiftNoiseMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AnisotropyTangentMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AudioLinkLocalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AudioLinkMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BacklightColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BaseColorMap: + m_Texture: {fileID: 2800000, guid: 59cc88e58da82534b9ef6df2b16d0789, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BaseMap: + m_Texture: {fileID: 2800000, guid: 59cc88e58da82534b9ef6df2b16d0789, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Bump2ndMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Bump2ndScaleMask: + m_Texture: {fileID: 0} + 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} + - _DissolveMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DissolveNoiseMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DitherTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Emission2ndBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Emission2ndGradTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Emission2ndMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionGradTex: + 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} + - _FReflection: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlitterColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlitterShapeTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlossTexture: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MCap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MCapMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main2ndBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main2ndDissolveMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main2ndDissolveNoiseMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main2ndTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main3rdBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main3rdDissolveMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main3rdDissolveNoiseMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main3rdTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainColorAdjustMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainGradationTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 59cc88e58da82534b9ef6df2b16d0789, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MaskGloss: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MaskReflection: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MaskSelfLit: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MaskTransparency: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCap2ndBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCap2ndBumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCap2ndTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCapBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCapBumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCapTex: + 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} + - _NormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineVectorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineWidthControl: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineWidthMask: + m_Texture: {fileID: 2800000, guid: 513f256d33e4b294cb9a238d2ae516c4, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _PTexture: + 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} + - _ReflectionColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ReflectionCubeTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _RimColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _RimShadeMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SecondaryCutout: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Shadow2ndColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Shadow3rdColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowBlurMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowBorderMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowColorTexture: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowStrengthMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowT: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SmoothnessTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _AAS: 0.0001 + - _AAStrength: 1 + - _AlpToCov: 0 + - _AlphaBaseCutout: 1 + - _AlphaBoostFA: 10 + - _AlphaMaskMode: 0 + - _AlphaMaskScale: 1 + - _AlphaMaskValue: 0 + - _AlphaToMask: 0 + - _Anisotropy2MatCap: 0 + - _Anisotropy2MatCap2nd: 0 + - _Anisotropy2Reflection: 0 + - _Anisotropy2ndBitangentWidth: 1 + - _Anisotropy2ndShift: 0 + - _Anisotropy2ndShiftNoiseScale: 0 + - _Anisotropy2ndSpecularStrength: 0 + - _Anisotropy2ndTangentWidth: 1 + - _AnisotropyBitangentWidth: 1 + - _AnisotropyScale: 1 + - _AnisotropyShift: 0 + - _AnisotropyShiftNoiseScale: 0 + - _AnisotropySpecularStrength: 1 + - _AnisotropyTangentWidth: 1 + - _ApplyReflection: 0 + - _ApplySpecular: 1 + - _ApplySpecularFA: 1 + - _AsOverlay: 0 + - _AsUnlit: 0 + - _AudioLink2Emission: 0 + - _AudioLink2Emission2nd: 0 + - _AudioLink2Emission2ndGrad: 0 + - _AudioLink2EmissionGrad: 0 + - _AudioLink2Main2nd: 0 + - _AudioLink2Main3rd: 0 + - _AudioLink2Vertex: 0 + - _AudioLinkAsLocal: 0 + - _AudioLinkMask_UVMode: 0 + - _AudioLinkUVMode: 1 + - _AudioLinkVertexUVMode: 1 + - _BackfaceForceShadow: 0 + - _BacklightBackfaceMask: 1 + - _BacklightBlur: 0.05 + - _BacklightBorder: 0.35 + - _BacklightDirectivity: 5 + - _BacklightMainStrength: 0 + - _BacklightNormalStrength: 1 + - _BacklightReceiveShadow: 1 + - _BacklightViewStrength: 1 + - _BeforeExposureLimit: 10000 + - _BitKey0: 0 + - _BitKey1: 0 + - _BitKey10: 0 + - _BitKey11: 0 + - _BitKey12: 0 + - _BitKey13: 0 + - _BitKey14: 0 + - _BitKey15: 0 + - _BitKey16: 0 + - _BitKey17: 0 + - _BitKey18: 0 + - _BitKey19: 0 + - _BitKey2: 0 + - _BitKey20: 0 + - _BitKey21: 0 + - _BitKey22: 0 + - _BitKey23: 0 + - _BitKey24: 0 + - _BitKey25: 0 + - _BitKey26: 0 + - _BitKey27: 0 + - _BitKey28: 0 + - _BitKey29: 0 + - _BitKey3: 0 + - _BitKey30: 0 + - _BitKey31: 0 + - _BitKey4: 0 + - _BitKey5: 0 + - _BitKey6: 0 + - _BitKey7: 0 + - _BitKey8: 0 + - _BitKey9: 0 + - _BleModDest: 10 + - _BleModSour: 5 + - _BlendOp: 0 + - _BlendOpAlpha: 0 + - _BlendOpAlphaFA: 4 + - _BlendOpFA: 4 + - _Bump2ndMap_UVMode: 0 + - _Bump2ndScale: 1 + - _BumpScale: 1 + - _ClipAdju: 0 + - _ColorMask: 15 + - _Compa: 4 + - _ComputeMeshIndex: 0 + - _Cull: 2 + - _Culling: 2 + - _CustomLightDirectionFollowObjectRotation: 0 + - _CustomLightDirectionIntensity: 0 + - _Cutoff: 0.5 + - _Cutout: 0.5 + - _DepthThreshold: 900 + - _DirectionalLightIntensity: 0.5 + - _DissolveNoiseStrength: 0.1 + - _DistanceFadeMode: 0 + - _DistanceFadeRimFresnelPower: 5 + - _DitherMaxValue: 255 + - _DoubleSidedOutline: 1 + - _DstBlend: 0 + - _DstBlendAlpha: 10 + - _DstBlendAlphaFA: 1 + - _DstBlendFA: 1 + - _DummyProperty: 0 + - _DynamicNoisyOutline: 0 + - _Emission2ndBlend: 1 + - _Emission2ndBlendMode: 1 + - _Emission2ndFluorescence: 0 + - _Emission2ndGradSpeed: 1 + - _Emission2ndMainStrength: 0 + - _Emission2ndMap_UVMode: 0 + - _Emission2ndParallaxDepth: 0 + - _Emission2ndUseGrad: 0 + - _EmissionBlend: 1 + - _EmissionBlendMode: 1 + - _EmissionFluorescence: 1 + - _EmissionGradSpeed: 1 + - _EmissionMainStrength: 0 + - _EmissionMap_UVMode: 0 + - _EmissionParallaxDepth: 0 + - _EmissionUseGrad: 0 + - _EnvironmentalLightingIntensity: 1 + - _FarDistanceMaxWidth: 10 + - _FlipNormal: 0 + - _GIFlatShade: 0 + - _GIShadeThreshold: 0 + - _GSAAStrength: 0 + - _GlitterAngleRandomize: 0 + - _GlitterApplyShape: 0 + - _GlitterApplyTransparency: 1 + - _GlitterBackfaceMask: 0 + - _GlitterColorTex_UVMode: 0 + - _GlitterEnableLighting: 1 + - _GlitterMainStrength: 0 + - _GlitterNormalStrength: 1 + - _GlitterPostContrast: 1 + - _GlitterScaleRandomize: 0 + - _GlitterSensitivity: 0.25 + - _GlitterShadowMask: 0 + - _GlitterUVMode: 0 + - _GlitterVRParallaxStrength: 1 + - _GlossColorPower: 10 + - _GlossIntensity: 1 + - _GlossSoftness: 0 + - _GlossTextureFollowLight: 0 + - _GlossTextureFollowObjectRotation: 0 + - _GlossTextureRotate: 0 + - _GlossTextureSoftness: 0 + - _Glossiness: 0.6 + - _Glow_Edge_Width: 1 + - _HighlightColorPower: 1 + - _IDMask1: 0 + - _IDMask2: 0 + - _IDMask3: 0 + - _IDMask4: 0 + - _IDMask5: 0 + - _IDMask6: 0 + - _IDMask7: 0 + - _IDMask8: 0 + - _IDMaskCompile: 0 + - _IDMaskControlsDissolve: 0 + - _IDMaskFrom: 8 + - _IDMaskIndex1: 0 + - _IDMaskIndex2: 0 + - _IDMaskIndex3: 0 + - _IDMaskIndex4: 0 + - _IDMaskIndex5: 0 + - _IDMaskIndex6: 0 + - _IDMaskIndex7: 0 + - _IDMaskIndex8: 0 + - _IDMaskIsBitmap: 0 + - _IDMaskPrior1: 0 + - _IDMaskPrior2: 0 + - _IDMaskPrior3: 0 + - _IDMaskPrior4: 0 + - _IDMaskPrior5: 0 + - _IDMaskPrior6: 0 + - _IDMaskPrior7: 0 + - _IDMaskPrior8: 0 + - _IgnoreEncryption: 0 + - _Invisible: 0 + - _LLI_Max: 1 + - _LLI_Min: 0 + - _LigIgnoYNorDir: 0 + - _LightAffectOutlineColor: 0 + - _LightAffectRimLightColor: 0 + - _LightAffectShadow: 0 + - _LightFalloffAffectShadowT: 0 + - _LightFalloffSoftness: 1 + - _LightIntensity: 1 + - _LightMaxLimit: 1 + - _LightMinLimit: 0.05 + - _MCIALO: 0 + - _MCapIntensity: 1 + - _MVCOL: 0 + - _MaiColPo: 0.8 + - _Main2ndDissolveNoiseStrength: 0.1 + - _Main2ndEnableLighting: 1 + - _Main2ndTexAlphaMode: 0 + - _Main2ndTexAngle: 0 + - _Main2ndTexBlendMode: 1 + - _Main2ndTexIsDecal: 0 + - _Main2ndTexIsLeftOnly: 0 + - _Main2ndTexIsMSDF: 0 + - _Main2ndTexIsRightOnly: 0 + - _Main2ndTexShouldCopy: 0 + - _Main2ndTexShouldFlipCopy: 0 + - _Main2ndTexShouldFlipMirror: 0 + - _Main2ndTex_Cull: 0 + - _Main2ndTex_UVMode: 0 + - _Main3rdDissolveNoiseStrength: 0.1 + - _Main3rdEnableLighting: 1 + - _Main3rdTexAlphaMode: 0 + - _Main3rdTexAngle: 0 + - _Main3rdTexBlendMode: 0 + - _Main3rdTexIsDecal: 0 + - _Main3rdTexIsLeftOnly: 0 + - _Main3rdTexIsMSDF: 0 + - _Main3rdTexIsRightOnly: 0 + - _Main3rdTexShouldCopy: 0 + - _Main3rdTexShouldFlipCopy: 0 + - _Main3rdTexShouldFlipMirror: 0 + - _Main3rdTex_Cull: 0 + - _Main3rdTex_UVMode: 0 + - _MainGradationStrength: 0 + - _MatCap2ndApplyTransparency: 1 + - _MatCap2ndBackfaceMask: 0 + - _MatCap2ndBlend: 1 + - _MatCap2ndBlendMode: 1 + - _MatCap2ndBumpScale: 1 + - _MatCap2ndCustomNormal: 0 + - _MatCap2ndEnableLighting: 1 + - _MatCap2ndLod: 0 + - _MatCap2ndMainStrength: 0 + - _MatCap2ndNormalStrength: 1 + - _MatCap2ndPerspective: 1 + - _MatCap2ndShadowMask: 0 + - _MatCap2ndVRParallaxStrength: 1 + - _MatCap2ndZRotCancel: 1 + - _MatCapApplyTransparency: 1 + - _MatCapBackfaceMask: 0 + - _MatCapBlend: 1 + - _MatCapBlendMode: 1 + - _MatCapBumpScale: 1 + - _MatCapCustomNormal: 0 + - _MatCapEnableLighting: 1 + - _MatCapLod: 0 + - _MatCapMainStrength: 0 + - _MatCapNormalStrength: 1 + - _MatCapPerspective: 1 + - _MatCapShadowMask: 0 + - _MatCapVRParallaxStrength: 1 + - _MatCapZRotCancel: 1 + - _MaxFadDistance: 2 + - _Metallic: 0 + - _MinFadDistance: 0 + - _MixMainTexToOutline: 0 + - _MonochromeLighting: 0 + - _N_F_ANIS: 0 + - _N_F_CA: 0 + - _N_F_CLD: 0 + - _N_F_CO: 0 + - _N_F_COEDGL: 0 + - _N_F_DCS: 0 + - _N_F_DDMD: 1 + - _N_F_EAL: 1 + - _N_F_ESSAO: 0 + - _N_F_FR: 0 + - _N_F_GLO: 0 + - _N_F_GLOT: 0 + - _N_F_HDLS: 0 + - _N_F_HPSS: 0 + - _N_F_LLI: 0 + - _N_F_MC: 0 + - _N_F_MSSOLTFO: 0 + - _N_F_NFD: 0 + - _N_F_NLASOBF: 0 + - _N_F_NM: 0 + - _N_F_O: 1 + - _N_F_OFLMB: 0 + - _N_F_PA: 0 + - _N_F_PT: 0 + - _N_F_R: 0 + - _N_F_RDC: 1 + - _N_F_RL: 0 + - _N_F_RLIS: 0 + - _N_F_SCO: 0 + - _N_F_SCT: 0 + - _N_F_SE: 0 + - _N_F_SL: 0 + - _N_F_SLMM: 0 + - _N_F_SON: 0 + - _N_F_SS: 1 + - _N_F_ST: 0 + - _N_F_STIAL: 0 + - _N_F_STIS: 0 + - _N_F_STSDFM: 0 + - _N_F_TP: 0 + - _NoiTexAffStraWidt: 0 + - _NoisTexInten: 1 + - _NoiseSize: 100 + - _NoisyOutlineIntensity: 0 + - _NorMapAsDis: 0 + - _NormalMapIntensity: 1 + - _ObjePosiZCS: 0 + - _OffsetFactor: 0 + - _OffsetUnits: 0 + - _Opacity: 1 + - _Oper: 0 + - _OutStenPass: 0 + - _OutZTest: 4 + - _OutZWrite: 1 + - _OutlineAlphaToMask: 0 + - _OutlineBlendOp: 0 + - _OutlineBlendOpAlpha: 0 + - _OutlineBlendOpAlphaFA: 4 + - _OutlineBlendOpFA: 4 + - _OutlineColorMask: 15 + - _OutlineCull: 1 + - _OutlineDeleteMesh: 0 + - _OutlineDisableInVR: 0 + - _OutlineDstBlend: 0 + - _OutlineDstBlendAlpha: 10 + - _OutlineDstBlendAlphaFA: 1 + - _OutlineDstBlendFA: 1 + - _OutlineEnableLighting: 1 + - _OutlineExtrudeMethod: 0 + - _OutlineFixWidth: 0 + - _OutlineLitApplyTex: 0 + - _OutlineLitOffset: -8 + - _OutlineLitScale: 10 + - _OutlineLitShadowReceive: 0 + - _OutlineOffsetFactor: 0 + - _OutlineOffsetUnits: 0 + - _OutlineSrcBlend: 1 + - _OutlineSrcBlendAlpha: 1 + - _OutlineSrcBlendAlphaFA: 0 + - _OutlineSrcBlendFA: 1 + - _OutlineStencilComp: 8 + - _OutlineStencilFail: 0 + - _OutlineStencilPass: 0 + - _OutlineStencilReadMask: 255 + - _OutlineStencilRef: 0 + - _OutlineStencilWriteMask: 255 + - _OutlineStencilZFail: 0 + - _OutlineVectorScale: 1 + - _OutlineVectorUVMode: 0 + - _OutlineVertexR2Width: 0 + - _OutlineWidth: 0.035 + - _OutlineWidthAffectedByViewDistance: 0 + - _OutlineZBias: 0 + - _OutlineZClip: 1 + - _OutlineZPostionInCamera: 0 + - _OutlineZTest: 2 + - _OutlineZWrite: 1 + - _OverallShadowColorPower: 1 + - _PADist: 0 + - _PASize: 0.5 + - _PASmooTrans: 1 + - _PSGLOTEX: 0 + - _PTexturePower: 1 + - _Parallax: 0.02 + - _ParallaxOffset: 0.5 + - _PointSpotlightIntensity: 1 + - _PresAdju: 1 + - _RELG: 1 + - _RQSO: 0 + - _ReduSha: 0.5 + - _RefMetallic: 0 + - _RefVal: 0 + - _Reflectance: 0.04 + - _ReflectionApplyTransparency: 1 + - _ReflectionBlendMode: 1 + - _ReflectionCubeEnableLighting: 1 + - _ReflectionCubeOverride: 0 + - _ReflectionIntensity: 0 + - _ReflectionNormalStrength: 1 + - _RimApplyTransparency: 1 + - _RimBackfaceMask: 0 + - _RimBlendMode: 1 + - _RimBlur: 0.1 + - _RimBorder: 0.5 + - _RimDirRange: 0 + - _RimDirStrength: 0 + - _RimEnableLighting: 1 + - _RimFresnelPower: 3 + - _RimIndirBlur: 0.1 + - _RimIndirBorder: 0.5 + - _RimIndirRange: 0 + - _RimLigInt: 1 + - _RimLightColorPower: 10 + - _RimLightInLight: 1 + - _RimLightSoftness: 1 + - _RimLightUnfill: 1.5 + - _RimMainStrength: 0 + - _RimNormalStrength: 1 + - _RimShadeBlur: 1 + - _RimShadeBorder: 0.5 + - _RimShadeFresnelPower: 1 + - _RimShadeNormalStrength: 1 + - _RimShadowMask: 0 + - _RimVRParallaxStrength: 1 + - _SPECIN: 1 + - _SPECMODE: 0 + - _STIL: 0 + - _Saturation: 1 + - _SelfLitHighContrast: 1 + - _SelfLitIntensity: 0 + - _SelfLitPower: 2 + - _SelfShadowAffectedByLightShadowStrength: 0 + - _SelfShadowHardness: 1 + - _SelfShadowRealTimeShadowColorPower: 1 + - _SelfShadowRealtimeShadowIntensity: 0 + - _SelfShadowShadowTAtViewDirection: 0 + - _SelfShadowThreshold: 0.93 + - _Shadow2ndBlur: 0.08 + - _Shadow2ndBorder: 0.2 + - _Shadow2ndNormalStrength: 1 + - _Shadow2ndReceive: 0 + - _Shadow3rdBlur: 0.1 + - _Shadow3rdBorder: 0.25 + - _Shadow3rdNormalStrength: 1 + - _Shadow3rdReceive: 0 + - _ShadowBlur: 0.17 + - _ShadowBlurMaskLOD: 0 + - _ShadowBorder: 0.1 + - _ShadowBorderMaskLOD: 0 + - _ShadowBorderRange: 0 + - _ShadowColorTexturePower: 0 + - _ShadowColorType: 0 + - _ShadowEnvStrength: 0 + - _ShadowFlatBlur: 1 + - _ShadowFlatBorder: 1 + - _ShadowHardness: 0 + - _ShadowMainStrength: 0 + - _ShadowMaskType: 0 + - _ShadowNormalStrength: 1 + - _ShadowPostAO: 0 + - _ShadowReceive: 1 + - _ShadowStrength: 0.6 + - _ShadowStrengthMaskLOD: 0 + - _ShadowTColorPower: 1 + - _ShadowTHardness: 1 + - _ShadowTIntensity: 1 + - _ShadowTLightThreshold: 50 + - _ShadowTShadowThreshold: 0 + - _ShifAnis: 0 + - _ShiftBackfaceUV: 0 + - _ShowInAmbientLightShadowIntensity: 1 + - _ShowInAmbientLightShadowThreshold: 0.4 + - _ShowNormal: 0 + - _SimTrans: 0 + - _SkinMatrixIndex: 0 + - _SmoothObjectNormal: 0 + - _Smoothness: 1 + - _SpecularBlur: 0 + - _SpecularBorder: 0.5 + - _SpecularNormalStrength: 1 + - _SpecularToon: 1 + - _SrcBlend: 1 + - _SrcBlendAlpha: 1 + - _SrcBlendAlphaFA: 0 + - _SrcBlendFA: 1 + - _StencilComp: 8 + - _StencilFail: 0 + - _StencilPass: 2 + - _StencilReadMask: 255 + - _StencilRef: 51 + - _StencilWriteMask: 255 + - _StencilZFail: 0 + - _StraWidt: 10 + - _SubpassCutoff: 0.5 + - _TEXMCOLINT: 1 + - _TRANSMODE: 1 + - _TessEdge: 10 + - _TessFactorMax: 3 + - _TessShrink: 0 + - _TessStrength: 0.5 + - _TessellationFar: 1 + - _TessellationNear: 1 + - _TessellationSmoothness: 0.5 + - _TessellationTransition: 0.8 + - _TexturePatternStyle: 0 + - _TrailSize: 1.5 + - _TransAffSha: 1 + - _TransparentMode: 0 + - _TransparentThreshold: 0 + - _TriPlaBlend: 4 + - _TriPlaTile: 1 + - _UDIMDiscardCompile: 0 + - _UDIMDiscardMode: 0 + - _UDIMDiscardRow0_0: 0 + - _UDIMDiscardRow0_1: 0 + - _UDIMDiscardRow0_2: 0 + - _UDIMDiscardRow0_3: 0 + - _UDIMDiscardRow1_0: 0 + - _UDIMDiscardRow1_1: 0 + - _UDIMDiscardRow1_2: 0 + - _UDIMDiscardRow1_3: 0 + - _UDIMDiscardRow2_0: 0 + - _UDIMDiscardRow2_1: 0 + - _UDIMDiscardRow2_2: 0 + - _UDIMDiscardRow2_3: 0 + - _UDIMDiscardRow3_0: 0 + - _UDIMDiscardRow3_1: 0 + - _UDIMDiscardRow3_2: 0 + - _UDIMDiscardRow3_3: 0 + - _UDIMDiscardUV: 0 + - _UVSet: 0 + - _UseAnisotropy: 0 + - _UseAudioLink: 0 + - _UseBacklight: 0 + - _UseBump2ndMap: 0 + - _UseBumpMap: 0 + - _UseClippingCanceller: 0 + - _UseDither: 0 + - _UseEmission: 0 + - _UseEmission2nd: 0 + - _UseGlitter: 0 + - _UseMain2ndTex: 0 + - _UseMain3rdTex: 0 + - _UseMatCap: 0 + - _UseMatCap2nd: 0 + - _UseOutline: 0 + - _UsePOM: 0 + - _UseParallax: 0 + - _UseReflection: 0 + - _UseRim: 0 + - _UseRimShade: 0 + - _UseSecondaryCutout: 0 + - _UseShadow: 1 + - _UseTLB: 0 + - _VertexColorBlueAffectOutlineWitdh: 0 + - _VertexColorGreenControlSelfShadowThreshold: 0 + - _VertexColorRedControlSmoothObjectNormal: 0 + - _VertexLightStrength: 1 + - _ZClip: 1 + - _ZTest: 4 + - _ZWrite: 1 + - _e2gai: 2 + - _e2gci: 2 + - _egai: 2 + - _egci: 2 + - _lilDirectionalLightStrength: 1 + - _lilShadowCasterBias: 0 + - _lilToonVersion: 42 + m_Colors: + - _AudioLinkDefaultValue: {r: 0, g: 0, b: 2, a: 0.75} + - _AudioLinkLocalMapParams: {r: 120, g: 1, b: 0, a: 0} + - _AudioLinkMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _AudioLinkStart: {r: 0, g: 0, b: 0, a: 0} + - _AudioLinkUVParams: {r: 0.25, g: 0, b: 0, a: 0.125} + - _AudioLinkVertexStart: {r: 0, g: 0, b: 0, a: 0} + - _AudioLinkVertexStrength: {r: 0, g: 0, b: 0, a: 1} + - _AudioLinkVertexUVParams: {r: 0.25, g: 0, b: 0, a: 0.125} + - _BackfaceColor: {r: 0, g: 0, b: 0, a: 0} + - _BacklightColor: {r: 0.85, g: 0.8, b: 0.7, a: 1} + - _BaseColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Color2nd: {r: 1, g: 1, b: 1, a: 1} + - _Color3rd: {r: 1, g: 1, b: 1, a: 1} + - _CustomLightDirection: {r: 0, g: 0, b: 10, a: 0} + - _DissolveColor: {r: 1, g: 1, b: 1, a: 1} + - _DissolveNoiseMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _DissolveParams: {r: 0, g: 0, b: 0.5, a: 0.1} + - _DissolvePos: {r: 0, g: 0, b: 0, a: 0} + - _DistanceFade: {r: 0.1, g: 0.01, b: 0, a: 0} + - _DistanceFadeColor: {r: 0, g: 0, b: 0, a: 1} + - _DistanceFadeRimColor: {r: 0, g: 0, b: 0, a: 0} + - _Emission2ndBlendMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _Emission2ndBlink: {r: 0, g: 0, b: 3.141593, a: 0} + - _Emission2ndColor: {r: 1, g: 1, b: 1, a: 1} + - _Emission2ndMap_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _EmissionBlendMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _EmissionBlink: {r: 0, g: 0, b: 3.1415932, a: 0} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _EmissionMap_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _GlitterAtras: {r: 1, g: 1, b: 0, a: 0} + - _GlitterColor: {r: 1, g: 1, b: 1, a: 1} + - _GlitterParams1: {r: 256, g: 256, b: 0.16, a: 50} + - _GlitterParams2: {r: 0.25, g: 0, b: 0, a: 0} + - _GlossColor: {r: 1, g: 1, b: 1, a: 1} + - _Glow_Color: {r: 1, g: 1, b: 1, a: 1} + - _HighlightColor: {r: 0.75, g: 0.7710225, b: 1, a: 1} + - _Keys: {r: 0, g: 0, b: 0, a: 0} + - _LightDirectionOverride: {r: 0, g: 0.001, b: 0, a: 0} + - _Main2ndDissolveColor: {r: 1, g: 1, b: 1, a: 1} + - _Main2ndDissolveNoiseMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _Main2ndDissolveParams: {r: 0, g: 0, b: 0.5, a: 0.1} + - _Main2ndDissolvePos: {r: 0, g: 0, b: 0, a: 0} + - _Main2ndDistanceFade: {r: 0.1, g: 0.01, b: 0, a: 0} + - _Main2ndTexDecalAnimation: {r: 1, g: 1, b: 1, a: 30} + - _Main2ndTexDecalSubParam: {r: 1, g: 1, b: 0, a: 1} + - _Main2ndTex_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _Main3rdDissolveColor: {r: 1, g: 1, b: 1, a: 1} + - _Main3rdDissolveNoiseMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _Main3rdDissolveParams: {r: 0, g: 0, b: 0.5, a: 0.1} + - _Main3rdDissolvePos: {r: 0, g: 0, b: 0, a: 0} + - _Main3rdDistanceFade: {r: 0.1, g: 0.01, b: 0, a: 0} + - _Main3rdTexDecalAnimation: {r: 1, g: 1, b: 1, a: 30} + - _Main3rdTexDecalSubParam: {r: 1, g: 1, b: 0, a: 1} + - _Main3rdTex_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _MainColor: {r: 1, g: 1, b: 1, a: 1} + - _MainTexHSVG: {r: 0, g: 1, b: 1, a: 1} + - _MainTex_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _MatCap2ndBlendUV1: {r: 0, g: 0, b: 0, a: 0} + - _MatCap2ndColor: {r: 1, g: 1, b: 1, a: 1} + - _MatCapBlendUV1: {r: 0, g: 0, b: 0, a: 0} + - _MatCapColor: {r: 1, g: 1, b: 1, a: 1} + - _ObjPosi: {r: 0, g: 0, b: 0, a: 0} + - _ObjectForward: {r: 0, g: 0, b: 0, a: 0} + - _ObjectRight: {r: 0, g: 0, b: 0, a: 0} + - _OutResi: {r: 1, g: 1, b: 1, a: 1} + - _OutlineColor: {r: 0.8396226, g: 0.5505073, b: 0.6236169, a: 1} + - _OutlineLitColor: {r: 1, g: 0.19999996, b: 0, a: 0} + - _OutlineOffset: {r: 0, g: 0, b: 0, a: 1} + - _OutlineTexHSVG: {r: 0, g: 1, b: 1, a: 1} + - _OutlineTex_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _OverallShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _PTCol: {r: 0, g: 0, b: 0, a: 1} + - _PrevPosition: {r: 0, g: 0, b: 0, a: 0} + - _ReflectionColor: {r: 1, g: 1, b: 1, a: 1} + - _ReflectionCubeColor: {r: 0, g: 0, b: 0, a: 1} + - _RimColor: {r: 1, g: 1, b: 1, a: 1} + - _RimIndirColor: {r: 1, g: 1, b: 1, a: 1} + - _RimLigPosi: {r: 1, g: 1, b: 1, a: 1} + - _RimLightColor: {r: 1, g: 1, b: 1, a: 1} + - _RimShadeColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + - _SSAOColor: {r: 0, g: 0, b: 0, a: 0} + - _SelfLitColor: {r: 1, g: 1, b: 1, a: 1} + - _SelfShadowRealTimeShadowColor: {r: 1, g: 1, b: 1, a: 1} + - _Shadow2ndColor: {r: 1, g: 0.91764706, b: 0.89411765, a: 1} + - _Shadow3rdColor: {r: 0, g: 0, b: 0, a: 0} + - _ShadowAOShift: {r: 1, g: 0, b: 1, a: 0} + - _ShadowAOShift2: {r: 1, g: 0, b: 1, a: 0} + - _ShadowBorderColor: {r: 0, g: 0, b: 0, a: 1} + - _ShadowColor: {r: 1, g: 0.92250675, b: 0.8915094, a: 1} + - _ShadowTColor: {r: 1, g: 1, b: 1, a: 1} + - _XYZPosition: {r: 0, g: 0, b: 0, a: 0} + - _e2ga0: {r: 1, g: 0, b: 0, a: 0} + - _e2ga1: {r: 1, g: 0, b: 0, a: 1} + - _e2ga2: {r: 1, g: 0, b: 0, a: 0} + - _e2ga3: {r: 1, g: 0, b: 0, a: 0} + - _e2ga4: {r: 1, g: 0, b: 0, a: 0} + - _e2ga5: {r: 1, g: 0, b: 0, a: 0} + - _e2ga6: {r: 1, g: 0, b: 0, a: 0} + - _e2ga7: {r: 1, g: 0, b: 0, a: 0} + - _e2gc0: {r: 1, g: 1, b: 1, a: 0} + - _e2gc1: {r: 1, g: 1, b: 1, a: 1} + - _e2gc2: {r: 1, g: 1, b: 1, a: 0} + - _e2gc3: {r: 1, g: 1, b: 1, a: 0} + - _e2gc4: {r: 1, g: 1, b: 1, a: 0} + - _e2gc5: {r: 1, g: 1, b: 1, a: 0} + - _e2gc6: {r: 1, g: 1, b: 1, a: 0} + - _e2gc7: {r: 1, g: 1, b: 1, a: 0} + - _ega0: {r: 1, g: 0, b: 0, a: 0} + - _ega1: {r: 1, g: 0, b: 0, a: 1} + - _ega2: {r: 1, g: 0, b: 0, a: 0} + - _ega3: {r: 1, g: 0, b: 0, a: 0} + - _ega4: {r: 1, g: 0, b: 0, a: 0} + - _ega5: {r: 1, g: 0, b: 0, a: 0} + - _ega6: {r: 1, g: 0, b: 0, a: 0} + - _ega7: {r: 1, g: 0, b: 0, a: 0} + - _egc0: {r: 1, g: 1, b: 1, a: 0} + - _egc1: {r: 1, g: 1, b: 1, a: 1} + - _egc2: {r: 1, g: 1, b: 1, a: 0} + - _egc3: {r: 1, g: 1, b: 1, a: 0} + - _egc4: {r: 1, g: 1, b: 1, a: 0} + - _egc5: {r: 1, g: 1, b: 1, a: 0} + - _egc6: {r: 1, g: 1, b: 1, a: 0} + - _egc7: {r: 1, g: 1, b: 1, a: 0} + m_BuildTextureStacks: [] + m_AllowLocking: 1 diff --git a/Assets/04_Models/Characters/Fariy/Materials/Body_Hair/Alistia_Face.mat.meta b/Assets/04_Models/Characters/Fariy/Materials/Body_Hair/Alistia_Face.mat.meta new file mode 100644 index 00000000..58af4b99 --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Materials/Body_Hair/Alistia_Face.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5964f5c0619d80048afe0d1a2fd68036 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/04_Models/Characters/Fariy/Materials/Body_Hair/Alistia_Face_Alpha.mat b/Assets/04_Models/Characters/Fariy/Materials/Body_Hair/Alistia_Face_Alpha.mat new file mode 100644 index 00000000..0ae415fb --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Materials/Body_Hair/Alistia_Face_Alpha.mat @@ -0,0 +1,1030 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Alistia_Face_Alpha + m_Shader: {fileID: 4800000, guid: 6459b2db96a08ca41b0f9b39dc7ad59e, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: + - N_F_DDMD_ON + - N_F_EAL_ON + - N_F_O_ON + - N_F_RDC_ON + - N_F_RELGI_ON + - N_F_SIMTRANS_ON + - N_F_SS_ON + - N_F_TRANSAFFSHA_ON + - N_F_TRANS_ON + - _UVSET_UV0 + m_InvalidKeywords: [] + m_LightmapFlags: 0 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 3000 + stringTagMap: + RenderType: Transparent + VRCFallback: Unlit + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AnisotropyScaleMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AnisotropyShiftNoiseMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AnisotropyTangentMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AudioLinkLocalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AudioLinkMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BacklightColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BaseColorMap: + m_Texture: {fileID: 2800000, guid: e9127ca5d92e63940bdc0358062db97b, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BaseMap: + m_Texture: {fileID: 2800000, guid: e9127ca5d92e63940bdc0358062db97b, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Bump2ndMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Bump2ndScaleMask: + m_Texture: {fileID: 0} + 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} + - _DissolveMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DissolveNoiseMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DitherTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Emission2ndBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Emission2ndGradTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Emission2ndMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionGradTex: + 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} + - _FReflection: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlitterColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlitterShapeTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlossTexture: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MCap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MCapMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main2ndBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main2ndDissolveMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main2ndDissolveNoiseMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main2ndTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main3rdBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main3rdDissolveMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main3rdDissolveNoiseMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main3rdTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainColorAdjustMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainGradationTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: e9127ca5d92e63940bdc0358062db97b, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MaskGloss: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MaskReflection: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MaskSelfLit: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MaskTransparency: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCap2ndBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCap2ndBumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCap2ndTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCapBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCapBumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCapTex: + 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} + - _NormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineVectorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineWidthControl: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineWidthMask: + m_Texture: {fileID: 2800000, guid: 513f256d33e4b294cb9a238d2ae516c4, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _PTexture: + 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} + - _ReflectionColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ReflectionCubeTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _RimColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _RimShadeMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SecondaryCutout: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Shadow2ndColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Shadow3rdColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowBlurMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowBorderMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowColorTexture: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowStrengthMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowT: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SmoothnessTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _AAS: 0.0001 + - _AAStrength: 1 + - _AlpToCov: 0 + - _AlphaBaseCutout: 1 + - _AlphaBoostFA: 10 + - _AlphaMaskMode: 0 + - _AlphaMaskScale: 1 + - _AlphaMaskValue: 0 + - _AlphaToMask: 0 + - _Anisotropy2MatCap: 0 + - _Anisotropy2MatCap2nd: 0 + - _Anisotropy2Reflection: 0 + - _Anisotropy2ndBitangentWidth: 1 + - _Anisotropy2ndShift: 0 + - _Anisotropy2ndShiftNoiseScale: 0 + - _Anisotropy2ndSpecularStrength: 0 + - _Anisotropy2ndTangentWidth: 1 + - _AnisotropyBitangentWidth: 1 + - _AnisotropyScale: 1 + - _AnisotropyShift: 0 + - _AnisotropyShiftNoiseScale: 0 + - _AnisotropySpecularStrength: 1 + - _AnisotropyTangentWidth: 1 + - _ApplyReflection: 0 + - _ApplySpecular: 1 + - _ApplySpecularFA: 1 + - _AsOverlay: 0 + - _AsUnlit: 0 + - _AudioLink2Emission: 0 + - _AudioLink2Emission2nd: 0 + - _AudioLink2Emission2ndGrad: 0 + - _AudioLink2EmissionGrad: 0 + - _AudioLink2Main2nd: 0 + - _AudioLink2Main3rd: 0 + - _AudioLink2Vertex: 0 + - _AudioLinkAsLocal: 0 + - _AudioLinkMask_UVMode: 0 + - _AudioLinkUVMode: 1 + - _AudioLinkVertexUVMode: 1 + - _BackfaceForceShadow: 0 + - _BacklightBackfaceMask: 1 + - _BacklightBlur: 0.05 + - _BacklightBorder: 0.35 + - _BacklightDirectivity: 5 + - _BacklightMainStrength: 0 + - _BacklightNormalStrength: 1 + - _BacklightReceiveShadow: 1 + - _BacklightViewStrength: 1 + - _BeforeExposureLimit: 10000 + - _BitKey0: 0 + - _BitKey1: 0 + - _BitKey10: 0 + - _BitKey11: 0 + - _BitKey12: 0 + - _BitKey13: 0 + - _BitKey14: 0 + - _BitKey15: 0 + - _BitKey16: 0 + - _BitKey17: 0 + - _BitKey18: 0 + - _BitKey19: 0 + - _BitKey2: 0 + - _BitKey20: 0 + - _BitKey21: 0 + - _BitKey22: 0 + - _BitKey23: 0 + - _BitKey24: 0 + - _BitKey25: 0 + - _BitKey26: 0 + - _BitKey27: 0 + - _BitKey28: 0 + - _BitKey29: 0 + - _BitKey3: 0 + - _BitKey30: 0 + - _BitKey31: 0 + - _BitKey4: 0 + - _BitKey5: 0 + - _BitKey6: 0 + - _BitKey7: 0 + - _BitKey8: 0 + - _BitKey9: 0 + - _BleModDest: 10 + - _BleModSour: 5 + - _BlendOp: 0 + - _BlendOpAlpha: 0 + - _BlendOpAlphaFA: 4 + - _BlendOpFA: 4 + - _Bump2ndMap_UVMode: 0 + - _Bump2ndScale: 1 + - _BumpScale: 1 + - _ClipAdju: 0 + - _ColorMask: 15 + - _Compa: 4 + - _ComputeMeshIndex: 0 + - _Cull: 2 + - _Culling: 2 + - _CustomLightDirectionFollowObjectRotation: 0 + - _CustomLightDirectionIntensity: 0 + - _Cutoff: 0.001 + - _Cutout: 0.5 + - _DepthThreshold: 900 + - _DirectionalLightIntensity: 1 + - _DissolveNoiseStrength: 0.1 + - _DistanceFadeMode: 0 + - _DistanceFadeRimFresnelPower: 5 + - _DitherMaxValue: 255 + - _DoubleSidedOutline: 1 + - _DstBlend: 10 + - _DstBlendAlpha: 10 + - _DstBlendAlphaFA: 1 + - _DstBlendFA: 1 + - _DummyProperty: 0 + - _DynamicNoisyOutline: 0 + - _Emission2ndBlend: 1 + - _Emission2ndBlendMode: 1 + - _Emission2ndFluorescence: 0 + - _Emission2ndGradSpeed: 1 + - _Emission2ndMainStrength: 0 + - _Emission2ndMap_UVMode: 0 + - _Emission2ndParallaxDepth: 0 + - _Emission2ndUseGrad: 0 + - _EmissionBlend: 1 + - _EmissionBlendMode: 1 + - _EmissionFluorescence: 1 + - _EmissionGradSpeed: 1 + - _EmissionMainStrength: 0 + - _EmissionMap_UVMode: 0 + - _EmissionParallaxDepth: 0 + - _EmissionUseGrad: 0 + - _EnvironmentalLightingIntensity: 1 + - _FarDistanceMaxWidth: 10 + - _FlipNormal: 0 + - _GIFlatShade: 0 + - _GIShadeThreshold: 0 + - _GSAAStrength: 0 + - _GlitterAngleRandomize: 0 + - _GlitterApplyShape: 0 + - _GlitterApplyTransparency: 1 + - _GlitterBackfaceMask: 0 + - _GlitterColorTex_UVMode: 0 + - _GlitterEnableLighting: 1 + - _GlitterMainStrength: 0 + - _GlitterNormalStrength: 1 + - _GlitterPostContrast: 1 + - _GlitterScaleRandomize: 0 + - _GlitterSensitivity: 0.25 + - _GlitterShadowMask: 0 + - _GlitterUVMode: 0 + - _GlitterVRParallaxStrength: 1 + - _GlossColorPower: 10 + - _GlossIntensity: 1 + - _GlossSoftness: 0 + - _GlossTextureFollowLight: 0 + - _GlossTextureFollowObjectRotation: 0 + - _GlossTextureRotate: 0 + - _GlossTextureSoftness: 0 + - _Glossiness: 0.6 + - _Glow_Edge_Width: 1 + - _HighlightColorPower: 5 + - _IDMask1: 0 + - _IDMask2: 0 + - _IDMask3: 0 + - _IDMask4: 0 + - _IDMask5: 0 + - _IDMask6: 0 + - _IDMask7: 0 + - _IDMask8: 0 + - _IDMaskCompile: 0 + - _IDMaskControlsDissolve: 0 + - _IDMaskFrom: 8 + - _IDMaskIndex1: 0 + - _IDMaskIndex2: 0 + - _IDMaskIndex3: 0 + - _IDMaskIndex4: 0 + - _IDMaskIndex5: 0 + - _IDMaskIndex6: 0 + - _IDMaskIndex7: 0 + - _IDMaskIndex8: 0 + - _IDMaskIsBitmap: 0 + - _IDMaskPrior1: 0 + - _IDMaskPrior2: 0 + - _IDMaskPrior3: 0 + - _IDMaskPrior4: 0 + - _IDMaskPrior5: 0 + - _IDMaskPrior6: 0 + - _IDMaskPrior7: 0 + - _IDMaskPrior8: 0 + - _IgnoreEncryption: 0 + - _Invisible: 0 + - _LLI_Max: 1 + - _LLI_Min: 0 + - _LigIgnoYNorDir: 0 + - _LightAffectOutlineColor: 0 + - _LightAffectRimLightColor: 0 + - _LightAffectShadow: 0 + - _LightFalloffAffectShadowT: 0 + - _LightFalloffSoftness: 1 + - _LightIntensity: 1 + - _LightMaxLimit: 1 + - _LightMinLimit: 0.05 + - _MCIALO: 0 + - _MCapIntensity: 1 + - _MVCOL: 0 + - _MaiColPo: 0.8 + - _Main2ndDissolveNoiseStrength: 0.1 + - _Main2ndEnableLighting: 1 + - _Main2ndTexAlphaMode: 0 + - _Main2ndTexAngle: 0 + - _Main2ndTexBlendMode: 1 + - _Main2ndTexIsDecal: 0 + - _Main2ndTexIsLeftOnly: 0 + - _Main2ndTexIsMSDF: 0 + - _Main2ndTexIsRightOnly: 0 + - _Main2ndTexShouldCopy: 0 + - _Main2ndTexShouldFlipCopy: 0 + - _Main2ndTexShouldFlipMirror: 0 + - _Main2ndTex_Cull: 0 + - _Main2ndTex_UVMode: 0 + - _Main3rdDissolveNoiseStrength: 0.1 + - _Main3rdEnableLighting: 1 + - _Main3rdTexAlphaMode: 0 + - _Main3rdTexAngle: 0 + - _Main3rdTexBlendMode: 0 + - _Main3rdTexIsDecal: 0 + - _Main3rdTexIsLeftOnly: 0 + - _Main3rdTexIsMSDF: 0 + - _Main3rdTexIsRightOnly: 0 + - _Main3rdTexShouldCopy: 0 + - _Main3rdTexShouldFlipCopy: 0 + - _Main3rdTexShouldFlipMirror: 0 + - _Main3rdTex_Cull: 0 + - _Main3rdTex_UVMode: 0 + - _MainGradationStrength: 0 + - _MatCap2ndApplyTransparency: 1 + - _MatCap2ndBackfaceMask: 0 + - _MatCap2ndBlend: 1 + - _MatCap2ndBlendMode: 1 + - _MatCap2ndBumpScale: 1 + - _MatCap2ndCustomNormal: 0 + - _MatCap2ndEnableLighting: 1 + - _MatCap2ndLod: 0 + - _MatCap2ndMainStrength: 0 + - _MatCap2ndNormalStrength: 1 + - _MatCap2ndPerspective: 1 + - _MatCap2ndShadowMask: 0 + - _MatCap2ndVRParallaxStrength: 1 + - _MatCap2ndZRotCancel: 1 + - _MatCapApplyTransparency: 1 + - _MatCapBackfaceMask: 0 + - _MatCapBlend: 1 + - _MatCapBlendMode: 1 + - _MatCapBumpScale: 1 + - _MatCapCustomNormal: 0 + - _MatCapEnableLighting: 1 + - _MatCapLod: 0 + - _MatCapMainStrength: 0 + - _MatCapNormalStrength: 1 + - _MatCapPerspective: 1 + - _MatCapShadowMask: 0 + - _MatCapVRParallaxStrength: 1 + - _MatCapZRotCancel: 1 + - _MaxFadDistance: 2 + - _Metallic: 0 + - _MinFadDistance: 0 + - _MixMainTexToOutline: 0 + - _MonochromeLighting: 0 + - _N_F_ANIS: 0 + - _N_F_CA: 0 + - _N_F_CLD: 0 + - _N_F_CO: 0 + - _N_F_COEDGL: 0 + - _N_F_DCS: 0 + - _N_F_DDMD: 1 + - _N_F_EAL: 1 + - _N_F_ESSAO: 0 + - _N_F_FR: 0 + - _N_F_GLO: 0 + - _N_F_GLOT: 0 + - _N_F_HDLS: 0 + - _N_F_HPSS: 0 + - _N_F_LLI: 0 + - _N_F_MC: 0 + - _N_F_MSSOLTFO: 0 + - _N_F_NFD: 0 + - _N_F_NLASOBF: 0 + - _N_F_NM: 0 + - _N_F_O: 1 + - _N_F_OFLMB: 0 + - _N_F_PA: 0 + - _N_F_PT: 0 + - _N_F_R: 0 + - _N_F_RDC: 1 + - _N_F_RL: 0 + - _N_F_RLIS: 0 + - _N_F_SCO: 0 + - _N_F_SCT: 0 + - _N_F_SE: 0 + - _N_F_SL: 0 + - _N_F_SLMM: 0 + - _N_F_SON: 0 + - _N_F_SS: 1 + - _N_F_ST: 0 + - _N_F_STIAL: 0 + - _N_F_STIS: 0 + - _N_F_STSDFM: 0 + - _N_F_TP: 0 + - _NoiTexAffStraWidt: 0 + - _NoisTexInten: 1 + - _NoiseSize: 100 + - _NoisyOutlineIntensity: 0 + - _NorMapAsDis: 0 + - _NormalMapIntensity: 1 + - _ObjePosiZCS: 0 + - _OffsetFactor: 0 + - _OffsetUnits: 0 + - _Opacity: 1 + - _Oper: 0 + - _OutStenPass: 0 + - _OutZTest: 4 + - _OutZWrite: 1 + - _OutlineAlphaToMask: 0 + - _OutlineBlendOp: 0 + - _OutlineBlendOpAlpha: 0 + - _OutlineBlendOpAlphaFA: 4 + - _OutlineBlendOpFA: 4 + - _OutlineColorMask: 15 + - _OutlineCull: 1 + - _OutlineDeleteMesh: 0 + - _OutlineDisableInVR: 0 + - _OutlineDstBlend: 10 + - _OutlineDstBlendAlpha: 10 + - _OutlineDstBlendAlphaFA: 1 + - _OutlineDstBlendFA: 1 + - _OutlineEnableLighting: 1 + - _OutlineExtrudeMethod: 0 + - _OutlineFixWidth: 0 + - _OutlineLitApplyTex: 0 + - _OutlineLitOffset: -8 + - _OutlineLitScale: 10 + - _OutlineLitShadowReceive: 0 + - _OutlineOffsetFactor: 0 + - _OutlineOffsetUnits: 0 + - _OutlineSrcBlend: 5 + - _OutlineSrcBlendAlpha: 1 + - _OutlineSrcBlendAlphaFA: 0 + - _OutlineSrcBlendFA: 1 + - _OutlineStencilComp: 8 + - _OutlineStencilFail: 0 + - _OutlineStencilPass: 0 + - _OutlineStencilReadMask: 255 + - _OutlineStencilRef: 0 + - _OutlineStencilWriteMask: 255 + - _OutlineStencilZFail: 0 + - _OutlineVectorScale: 1 + - _OutlineVectorUVMode: 0 + - _OutlineVertexR2Width: 0 + - _OutlineWidth: 0.03 + - _OutlineWidthAffectedByViewDistance: 0 + - _OutlineZBias: 0 + - _OutlineZClip: 1 + - _OutlineZPostionInCamera: 0 + - _OutlineZTest: 2 + - _OutlineZWrite: 1 + - _OverallShadowColorPower: 1 + - _PADist: 0 + - _PASize: 0.5 + - _PASmooTrans: 1 + - _PSGLOTEX: 0 + - _PTexturePower: 1 + - _Parallax: 0.02 + - _ParallaxOffset: 0.5 + - _PointSpotlightIntensity: 1 + - _PreAlphaToMask: 0 + - _PreBlendOp: 0 + - _PreBlendOpAlpha: 0 + - _PreBlendOpAlphaFA: 4 + - _PreBlendOpFA: 4 + - _PreColorMask: 15 + - _PreCull: 2 + - _PreCutoff: 0.5 + - _PreDstBlend: 10 + - _PreDstBlendAlpha: 10 + - _PreDstBlendAlphaFA: 1 + - _PreDstBlendFA: 1 + - _PreOffsetFactor: 0 + - _PreOffsetUnits: 0 + - _PreOutType: 0 + - _PreSrcBlend: 1 + - _PreSrcBlendAlpha: 1 + - _PreSrcBlendAlphaFA: 0 + - _PreSrcBlendFA: 1 + - _PreStencilComp: 8 + - _PreStencilFail: 0 + - _PreStencilPass: 0 + - _PreStencilReadMask: 255 + - _PreStencilRef: 0 + - _PreStencilWriteMask: 255 + - _PreStencilZFail: 0 + - _PreZClip: 1 + - _PreZTest: 4 + - _PreZWrite: 1 + - _PresAdju: 1 + - _RELG: 1 + - _RQSO: 0 + - _ReduSha: 0.5 + - _RefMetallic: 0 + - _RefVal: 0 + - _Reflectance: 0.04 + - _ReflectionApplyTransparency: 1 + - _ReflectionBlendMode: 1 + - _ReflectionCubeEnableLighting: 1 + - _ReflectionCubeOverride: 0 + - _ReflectionIntensity: 0 + - _ReflectionNormalStrength: 1 + - _RimApplyTransparency: 1 + - _RimBackfaceMask: 0 + - _RimBlendMode: 1 + - _RimBlur: 0.1 + - _RimBorder: 0.5 + - _RimDirRange: 0 + - _RimDirStrength: 0 + - _RimEnableLighting: 1 + - _RimFresnelPower: 3 + - _RimIndirBlur: 0.1 + - _RimIndirBorder: 0.5 + - _RimIndirRange: 0 + - _RimLigInt: 1 + - _RimLightColorPower: 10 + - _RimLightInLight: 1 + - _RimLightSoftness: 1 + - _RimLightUnfill: 1.5 + - _RimMainStrength: 0 + - _RimNormalStrength: 1 + - _RimShadeBlur: 1 + - _RimShadeBorder: 0.5 + - _RimShadeFresnelPower: 1 + - _RimShadeNormalStrength: 1 + - _RimShadowMask: 0 + - _RimVRParallaxStrength: 1 + - _SPECIN: 1 + - _SPECMODE: 0 + - _STIL: 0 + - _Saturation: 1 + - _SelfLitHighContrast: 1 + - _SelfLitIntensity: 0 + - _SelfLitPower: 2 + - _SelfShadowAffectedByLightShadowStrength: 0 + - _SelfShadowHardness: 1 + - _SelfShadowRealTimeShadowColorPower: 1 + - _SelfShadowRealtimeShadowIntensity: 0 + - _SelfShadowShadowTAtViewDirection: 0 + - _SelfShadowThreshold: 0.93 + - _Shadow2ndBlur: 0.3 + - _Shadow2ndBorder: 0.5 + - _Shadow2ndNormalStrength: 1 + - _Shadow2ndReceive: 0 + - _Shadow3rdBlur: 0.1 + - _Shadow3rdBorder: 0.25 + - _Shadow3rdNormalStrength: 1 + - _Shadow3rdReceive: 0 + - _ShadowBlur: 0.1 + - _ShadowBlurMaskLOD: 0 + - _ShadowBorder: 0.5 + - _ShadowBorderMaskLOD: 0 + - _ShadowBorderRange: 0 + - _ShadowColorTexturePower: 0 + - _ShadowColorType: 0 + - _ShadowEnvStrength: 0 + - _ShadowFlatBlur: 1 + - _ShadowFlatBorder: 1 + - _ShadowHardness: 0 + - _ShadowMainStrength: 1 + - _ShadowMaskType: 0 + - _ShadowNormalStrength: 1 + - _ShadowPostAO: 0 + - _ShadowReceive: 0 + - _ShadowStrength: 1 + - _ShadowStrengthMaskLOD: 0 + - _ShadowTColorPower: 1 + - _ShadowTHardness: 1 + - _ShadowTIntensity: 1 + - _ShadowTLightThreshold: 50 + - _ShadowTShadowThreshold: 0 + - _ShifAnis: 0 + - _ShiftBackfaceUV: 0 + - _ShowInAmbientLightShadowIntensity: 1 + - _ShowInAmbientLightShadowThreshold: 0.4 + - _ShowNormal: 0 + - _SimTrans: 1 + - _SkinMatrixIndex: 0 + - _SmoothObjectNormal: 0 + - _Smoothness: 1 + - _SpecularBlur: 0 + - _SpecularBorder: 0.5 + - _SpecularNormalStrength: 1 + - _SpecularToon: 1 + - _SrcBlend: 1 + - _SrcBlendAlpha: 1 + - _SrcBlendAlphaFA: 0 + - _SrcBlendFA: 1 + - _StencilComp: 8 + - _StencilFail: 0 + - _StencilPass: 0 + - _StencilReadMask: 255 + - _StencilRef: 0 + - _StencilWriteMask: 255 + - _StencilZFail: 0 + - _StraWidt: 10 + - _SubpassCutoff: 0.5 + - _TEXMCOLINT: 1 + - _TRANSMODE: 1 + - _TessEdge: 10 + - _TessFactorMax: 3 + - _TessShrink: 0 + - _TessStrength: 0.5 + - _TessellationFar: 1 + - _TessellationNear: 1 + - _TessellationSmoothness: 0.5 + - _TessellationTransition: 0.8 + - _TexturePatternStyle: 0 + - _TrailSize: 1.5 + - _TransAffSha: 1 + - _TransparentMode: 0 + - _TransparentThreshold: 0 + - _TriPlaBlend: 4 + - _TriPlaTile: 1 + - _UDIMDiscardCompile: 0 + - _UDIMDiscardMode: 0 + - _UDIMDiscardRow0_0: 0 + - _UDIMDiscardRow0_1: 0 + - _UDIMDiscardRow0_2: 0 + - _UDIMDiscardRow0_3: 0 + - _UDIMDiscardRow1_0: 0 + - _UDIMDiscardRow1_1: 0 + - _UDIMDiscardRow1_2: 0 + - _UDIMDiscardRow1_3: 0 + - _UDIMDiscardRow2_0: 0 + - _UDIMDiscardRow2_1: 0 + - _UDIMDiscardRow2_2: 0 + - _UDIMDiscardRow2_3: 0 + - _UDIMDiscardRow3_0: 0 + - _UDIMDiscardRow3_1: 0 + - _UDIMDiscardRow3_2: 0 + - _UDIMDiscardRow3_3: 0 + - _UDIMDiscardUV: 0 + - _UVSet: 0 + - _UseAnisotropy: 0 + - _UseAudioLink: 0 + - _UseBacklight: 0 + - _UseBump2ndMap: 0 + - _UseBumpMap: 0 + - _UseClippingCanceller: 0 + - _UseDither: 0 + - _UseEmission: 0 + - _UseEmission2nd: 0 + - _UseGlitter: 0 + - _UseMain2ndTex: 0 + - _UseMain3rdTex: 0 + - _UseMatCap: 0 + - _UseMatCap2nd: 0 + - _UseOutline: 0 + - _UsePOM: 0 + - _UseParallax: 0 + - _UseReflection: 0 + - _UseRim: 0 + - _UseRimShade: 0 + - _UseSecondaryCutout: 0 + - _UseShadow: 0 + - _UseTLB: 0 + - _VertexColorBlueAffectOutlineWitdh: 0 + - _VertexColorGreenControlSelfShadowThreshold: 0 + - _VertexColorRedControlSmoothObjectNormal: 0 + - _VertexLightStrength: 1 + - _ZClip: 1 + - _ZTest: 4 + - _ZWrite: 1 + - _e2gai: 2 + - _e2gci: 2 + - _egai: 2 + - _egci: 2 + - _lilDirectionalLightStrength: 1 + - _lilShadowCasterBias: 0 + - _lilToonVersion: 42 + m_Colors: + - _AudioLinkDefaultValue: {r: 0, g: 0, b: 2, a: 0.75} + - _AudioLinkLocalMapParams: {r: 120, g: 1, b: 0, a: 0} + - _AudioLinkMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _AudioLinkStart: {r: 0, g: 0, b: 0, a: 0} + - _AudioLinkUVParams: {r: 0.25, g: 0, b: 0, a: 0.125} + - _AudioLinkVertexStart: {r: 0, g: 0, b: 0, a: 0} + - _AudioLinkVertexStrength: {r: 0, g: 0, b: 0, a: 1} + - _AudioLinkVertexUVParams: {r: 0.25, g: 0, b: 0, a: 0.125} + - _BackfaceColor: {r: 0, g: 0, b: 0, a: 0} + - _BacklightColor: {r: 0.85, g: 0.8, b: 0.7, a: 1} + - _BaseColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Color2nd: {r: 1, g: 1, b: 1, a: 1} + - _Color3rd: {r: 1, g: 1, b: 1, a: 1} + - _CustomLightDirection: {r: 0, g: 0, b: 10, a: 0} + - _DissolveColor: {r: 1, g: 1, b: 1, a: 1} + - _DissolveNoiseMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _DissolveParams: {r: 0, g: 0, b: 0.5, a: 0.1} + - _DissolvePos: {r: 0, g: 0, b: 0, a: 0} + - _DistanceFade: {r: 0.1, g: 0.01, b: 0, a: 0} + - _DistanceFadeColor: {r: 0, g: 0, b: 0, a: 1} + - _DistanceFadeRimColor: {r: 0, g: 0, b: 0, a: 0} + - _Emission2ndBlendMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _Emission2ndBlink: {r: 0, g: 0, b: 3.141593, a: 0} + - _Emission2ndColor: {r: 1, g: 1, b: 1, a: 1} + - _Emission2ndMap_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _EmissionBlendMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _EmissionBlink: {r: 0, g: 0, b: 3.1415932, a: 0} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _EmissionMap_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _GlitterAtras: {r: 1, g: 1, b: 0, a: 0} + - _GlitterColor: {r: 1, g: 1, b: 1, a: 1} + - _GlitterParams1: {r: 256, g: 256, b: 0.16, a: 50} + - _GlitterParams2: {r: 0.25, g: 0, b: 0, a: 0} + - _GlossColor: {r: 1, g: 1, b: 1, a: 1} + - _Glow_Color: {r: 1, g: 1, b: 1, a: 1} + - _HighlightColor: {r: 0, g: 0.013357639, b: 1, a: 1} + - _Keys: {r: 0, g: 0, b: 0, a: 0} + - _LightDirectionOverride: {r: 0, g: 0.001, b: 0, a: 0} + - _Main2ndDissolveColor: {r: 1, g: 1, b: 1, a: 1} + - _Main2ndDissolveNoiseMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _Main2ndDissolveParams: {r: 0, g: 0, b: 0.5, a: 0.1} + - _Main2ndDissolvePos: {r: 0, g: 0, b: 0, a: 0} + - _Main2ndDistanceFade: {r: 0.1, g: 0.01, b: 0, a: 0} + - _Main2ndTexDecalAnimation: {r: 1, g: 1, b: 1, a: 30} + - _Main2ndTexDecalSubParam: {r: 1, g: 1, b: 0, a: 1} + - _Main2ndTex_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _Main3rdDissolveColor: {r: 1, g: 1, b: 1, a: 1} + - _Main3rdDissolveNoiseMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _Main3rdDissolveParams: {r: 0, g: 0, b: 0.5, a: 0.1} + - _Main3rdDissolvePos: {r: 0, g: 0, b: 0, a: 0} + - _Main3rdDistanceFade: {r: 0.1, g: 0.01, b: 0, a: 0} + - _Main3rdTexDecalAnimation: {r: 1, g: 1, b: 1, a: 30} + - _Main3rdTexDecalSubParam: {r: 1, g: 1, b: 0, a: 1} + - _Main3rdTex_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _MainColor: {r: 1, g: 1, b: 1, a: 1} + - _MainTexHSVG: {r: 0, g: 1, b: 1, a: 1} + - _MainTex_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _MatCap2ndBlendUV1: {r: 0, g: 0, b: 0, a: 0} + - _MatCap2ndColor: {r: 1, g: 1, b: 1, a: 1} + - _MatCapBlendUV1: {r: 0, g: 0, b: 0, a: 0} + - _MatCapColor: {r: 1, g: 1, b: 1, a: 1} + - _ObjPosi: {r: 0, g: 0, b: 0, a: 0} + - _ObjectForward: {r: 0, g: 0, b: 0, a: 0} + - _ObjectRight: {r: 0, g: 0, b: 0, a: 0} + - _OutResi: {r: 1, g: 1, b: 1, a: 1} + - _OutlineColor: {r: 0.76052475, g: 0.48514998, b: 0.5583405, a: 1} + - _OutlineLitColor: {r: 1, g: 0.19999996, b: 0, a: 0} + - _OutlineOffset: {r: 0, g: 0, b: 0, a: 1} + - _OutlineTexHSVG: {r: 0, g: 1, b: 1, a: 1} + - _OutlineTex_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _OverallShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _PTCol: {r: 0, g: 0, b: 0, a: 1} + - _PreColor: {r: 1, g: 1, b: 1, a: 1} + - _PrevPosition: {r: 0, g: 0, b: 0, a: 0} + - _ReflectionColor: {r: 1, g: 1, b: 1, a: 1} + - _ReflectionCubeColor: {r: 0, g: 0, b: 0, a: 1} + - _RimColor: {r: 1, g: 1, b: 1, a: 1} + - _RimIndirColor: {r: 1, g: 1, b: 1, a: 1} + - _RimLigPosi: {r: 1, g: 1, b: 1, a: 1} + - _RimLightColor: {r: 1, g: 1, b: 1, a: 1} + - _RimShadeColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + - _SSAOColor: {r: 0, g: 0, b: 0, a: 0} + - _SelfLitColor: {r: 1, g: 1, b: 1, a: 1} + - _SelfShadowRealTimeShadowColor: {r: 1, g: 1, b: 1, a: 1} + - _Shadow2ndColor: {r: 0, g: 0, b: 0, a: 0} + - _Shadow3rdColor: {r: 0, g: 0, b: 0, a: 0} + - _ShadowAOShift: {r: 1, g: 0, b: 1, a: 0} + - _ShadowAOShift2: {r: 1, g: 0, b: 1, a: 0} + - _ShadowBorderColor: {r: 1, g: 0, b: 0, a: 1} + - _ShadowColor: {r: 0.7, g: 0.75, b: 0.85, a: 1} + - _ShadowTColor: {r: 1, g: 1, b: 1, a: 1} + - _XYZPosition: {r: 0, g: 0, b: 0, a: 0} + - _e2ga0: {r: 1, g: 0, b: 0, a: 0} + - _e2ga1: {r: 1, g: 0, b: 0, a: 1} + - _e2ga2: {r: 1, g: 0, b: 0, a: 0} + - _e2ga3: {r: 1, g: 0, b: 0, a: 0} + - _e2ga4: {r: 1, g: 0, b: 0, a: 0} + - _e2ga5: {r: 1, g: 0, b: 0, a: 0} + - _e2ga6: {r: 1, g: 0, b: 0, a: 0} + - _e2ga7: {r: 1, g: 0, b: 0, a: 0} + - _e2gc0: {r: 1, g: 1, b: 1, a: 0} + - _e2gc1: {r: 1, g: 1, b: 1, a: 1} + - _e2gc2: {r: 1, g: 1, b: 1, a: 0} + - _e2gc3: {r: 1, g: 1, b: 1, a: 0} + - _e2gc4: {r: 1, g: 1, b: 1, a: 0} + - _e2gc5: {r: 1, g: 1, b: 1, a: 0} + - _e2gc6: {r: 1, g: 1, b: 1, a: 0} + - _e2gc7: {r: 1, g: 1, b: 1, a: 0} + - _ega0: {r: 1, g: 0, b: 0, a: 0} + - _ega1: {r: 1, g: 0, b: 0, a: 1} + - _ega2: {r: 1, g: 0, b: 0, a: 0} + - _ega3: {r: 1, g: 0, b: 0, a: 0} + - _ega4: {r: 1, g: 0, b: 0, a: 0} + - _ega5: {r: 1, g: 0, b: 0, a: 0} + - _ega6: {r: 1, g: 0, b: 0, a: 0} + - _ega7: {r: 1, g: 0, b: 0, a: 0} + - _egc0: {r: 1, g: 1, b: 1, a: 0} + - _egc1: {r: 1, g: 1, b: 1, a: 1} + - _egc2: {r: 1, g: 1, b: 1, a: 0} + - _egc3: {r: 1, g: 1, b: 1, a: 0} + - _egc4: {r: 1, g: 1, b: 1, a: 0} + - _egc5: {r: 1, g: 1, b: 1, a: 0} + - _egc6: {r: 1, g: 1, b: 1, a: 0} + - _egc7: {r: 1, g: 1, b: 1, a: 0} + m_BuildTextureStacks: [] + m_AllowLocking: 1 diff --git a/Assets/04_Models/Characters/Fariy/Materials/Body_Hair/Alistia_Face_Alpha.mat.meta b/Assets/04_Models/Characters/Fariy/Materials/Body_Hair/Alistia_Face_Alpha.mat.meta new file mode 100644 index 00000000..30a25bd7 --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Materials/Body_Hair/Alistia_Face_Alpha.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5434df79a062a264fa80847913923f64 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/04_Models/Characters/Fariy/Materials/Body_Hair/Alistia_Hair.mat b/Assets/04_Models/Characters/Fariy/Materials/Body_Hair/Alistia_Hair.mat new file mode 100644 index 00000000..4ce2de3e --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Materials/Body_Hair/Alistia_Hair.mat @@ -0,0 +1,1026 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Alistia_Hair + m_Shader: {fileID: 4800000, guid: 6459b2db96a08ca41b0f9b39dc7ad59e, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: + - N_F_DDMD_ON + - N_F_EAL_ON + - N_F_O_ON + - N_F_RDC_ON + - N_F_RELGI_ON + - N_F_SS_ON + - N_F_TRANSAFFSHA_ON + - _UVSET_UV0 + m_InvalidKeywords: [] + m_LightmapFlags: 0 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaMask: + m_Texture: {fileID: 2800000, guid: 782a9af2fc072c2419c418886e440f9d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AnisotropyScaleMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AnisotropyShiftNoiseMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AnisotropyTangentMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AudioLinkLocalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AudioLinkMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BacklightColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BaseColorMap: + m_Texture: {fileID: 2800000, guid: d048c66387fa0bc4f9913dd2d7d7fa87, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BaseMap: + m_Texture: {fileID: 2800000, guid: d048c66387fa0bc4f9913dd2d7d7fa87, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Bump2ndMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Bump2ndScaleMask: + m_Texture: {fileID: 0} + 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} + - _DissolveMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DissolveNoiseMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DitherTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Emission2ndBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Emission2ndGradTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Emission2ndMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionGradTex: + 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} + - _FReflection: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlitterColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlitterShapeTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlossTexture: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MCap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MCapMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main2ndBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main2ndDissolveMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main2ndDissolveNoiseMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main2ndTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main3rdBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main3rdDissolveMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main3rdDissolveNoiseMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main3rdTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainColorAdjustMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainGradationTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: d048c66387fa0bc4f9913dd2d7d7fa87, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MaskGloss: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MaskReflection: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MaskSelfLit: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MaskTransparency: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCap2ndBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCap2ndBumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCap2ndTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCapBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCapBumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCapTex: + 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} + - _NormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: d048c66387fa0bc4f9913dd2d7d7fa87, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineVectorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineWidthControl: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineWidthMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _PTexture: + 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} + - _ReflectionColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ReflectionCubeTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _RimColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _RimShadeMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SecondaryCutout: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Shadow2ndColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Shadow3rdColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowBlurMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowBorderMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowColorTexture: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowStrengthMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowT: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SmoothnessTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _AAS: 0.0001 + - _AAStrength: 1 + - _AlpToCov: 0 + - _AlphaBaseCutout: 1 + - _AlphaBoostFA: 10 + - _AlphaMaskMode: 1 + - _AlphaMaskScale: 1 + - _AlphaMaskValue: 0.35 + - _AlphaToMask: 0 + - _Anisotropy2MatCap: 0 + - _Anisotropy2MatCap2nd: 0 + - _Anisotropy2Reflection: 0 + - _Anisotropy2ndBitangentWidth: 1 + - _Anisotropy2ndShift: 0 + - _Anisotropy2ndShiftNoiseScale: 0 + - _Anisotropy2ndSpecularStrength: 0 + - _Anisotropy2ndTangentWidth: 1 + - _AnisotropyBitangentWidth: 1 + - _AnisotropyScale: 1 + - _AnisotropyShift: 0 + - _AnisotropyShiftNoiseScale: 0 + - _AnisotropySpecularStrength: 1 + - _AnisotropyTangentWidth: 1 + - _ApplyReflection: 0 + - _ApplySpecular: 1 + - _ApplySpecularFA: 1 + - _AsOverlay: 0 + - _AsUnlit: 0 + - _AudioLink2Emission: 0 + - _AudioLink2Emission2nd: 0 + - _AudioLink2Emission2ndGrad: 0 + - _AudioLink2EmissionGrad: 0 + - _AudioLink2Main2nd: 0 + - _AudioLink2Main3rd: 0 + - _AudioLink2Vertex: 0 + - _AudioLinkAsLocal: 0 + - _AudioLinkMask_UVMode: 0 + - _AudioLinkUVMode: 1 + - _AudioLinkVertexUVMode: 1 + - _BackfaceForceShadow: 0 + - _BacklightBackfaceMask: 1 + - _BacklightBlur: 0.05 + - _BacklightBorder: 0.35 + - _BacklightDirectivity: 5 + - _BacklightMainStrength: 0 + - _BacklightNormalStrength: 1 + - _BacklightReceiveShadow: 1 + - _BacklightViewStrength: 1 + - _BeforeExposureLimit: 10000 + - _BitKey0: 0 + - _BitKey1: 0 + - _BitKey10: 0 + - _BitKey11: 0 + - _BitKey12: 0 + - _BitKey13: 0 + - _BitKey14: 0 + - _BitKey15: 0 + - _BitKey16: 0 + - _BitKey17: 0 + - _BitKey18: 0 + - _BitKey19: 0 + - _BitKey2: 0 + - _BitKey20: 0 + - _BitKey21: 0 + - _BitKey22: 0 + - _BitKey23: 0 + - _BitKey24: 0 + - _BitKey25: 0 + - _BitKey26: 0 + - _BitKey27: 0 + - _BitKey28: 0 + - _BitKey29: 0 + - _BitKey3: 0 + - _BitKey30: 0 + - _BitKey31: 0 + - _BitKey4: 0 + - _BitKey5: 0 + - _BitKey6: 0 + - _BitKey7: 0 + - _BitKey8: 0 + - _BitKey9: 0 + - _BleModDest: 0 + - _BleModSour: 1 + - _BlendOp: 0 + - _BlendOpAlpha: 0 + - _BlendOpAlphaFA: 4 + - _BlendOpFA: 4 + - _Bump2ndMap_UVMode: 0 + - _Bump2ndScale: 1 + - _BumpScale: 1 + - _ClipAdju: 0 + - _ColorMask: 15 + - _Compa: 4 + - _ComputeMeshIndex: 0 + - _Cull: 0 + - _Culling: 2 + - _CustomLightDirectionFollowObjectRotation: 0 + - _CustomLightDirectionIntensity: 0 + - _Cutoff: 0.001 + - _Cutout: 0.5 + - _DepthThreshold: 900 + - _DirectionalLightIntensity: 1 + - _DissolveNoiseStrength: 0.1 + - _DistanceFadeMode: 0 + - _DistanceFadeRimFresnelPower: 5 + - _DitherMaxValue: 255 + - _DoubleSidedOutline: 1 + - _DstBlend: 10 + - _DstBlendAlpha: 10 + - _DstBlendAlphaFA: 1 + - _DstBlendFA: 1 + - _DummyProperty: 0 + - _DynamicNoisyOutline: 0 + - _Emission2ndBlend: 1 + - _Emission2ndBlendMode: 1 + - _Emission2ndFluorescence: 0 + - _Emission2ndGradSpeed: 1 + - _Emission2ndMainStrength: 0 + - _Emission2ndMap_UVMode: 0 + - _Emission2ndParallaxDepth: 0 + - _Emission2ndUseGrad: 0 + - _EmissionBlend: 1 + - _EmissionBlendMode: 1 + - _EmissionFluorescence: 0 + - _EmissionGradSpeed: 1 + - _EmissionMainStrength: 0 + - _EmissionMap_UVMode: 0 + - _EmissionParallaxDepth: 0 + - _EmissionUseGrad: 0 + - _EnvironmentalLightingIntensity: 1 + - _FarDistanceMaxWidth: 10 + - _FlipNormal: 0 + - _GIFlatShade: 0 + - _GIShadeThreshold: 0 + - _GSAAStrength: 0 + - _GlitterAngleRandomize: 0 + - _GlitterApplyShape: 0 + - _GlitterApplyTransparency: 1 + - _GlitterBackfaceMask: 0 + - _GlitterColorTex_UVMode: 0 + - _GlitterEnableLighting: 1 + - _GlitterMainStrength: 0 + - _GlitterNormalStrength: 1 + - _GlitterPostContrast: 1 + - _GlitterScaleRandomize: 0 + - _GlitterSensitivity: 0.25 + - _GlitterShadowMask: 0 + - _GlitterUVMode: 0 + - _GlitterVRParallaxStrength: 0 + - _GlossColorPower: 10 + - _GlossIntensity: 1 + - _GlossSoftness: 0 + - _GlossTextureFollowLight: 0 + - _GlossTextureFollowObjectRotation: 0 + - _GlossTextureRotate: 0 + - _GlossTextureSoftness: 0 + - _Glossiness: 0.6 + - _Glow_Edge_Width: 1 + - _HighlightColorPower: 1 + - _IDMask1: 0 + - _IDMask2: 0 + - _IDMask3: 0 + - _IDMask4: 0 + - _IDMask5: 0 + - _IDMask6: 0 + - _IDMask7: 0 + - _IDMask8: 0 + - _IDMaskCompile: 0 + - _IDMaskControlsDissolve: 0 + - _IDMaskFrom: 8 + - _IDMaskIndex1: 0 + - _IDMaskIndex2: 0 + - _IDMaskIndex3: 0 + - _IDMaskIndex4: 0 + - _IDMaskIndex5: 0 + - _IDMaskIndex6: 0 + - _IDMaskIndex7: 0 + - _IDMaskIndex8: 0 + - _IDMaskIsBitmap: 0 + - _IDMaskPrior1: 0 + - _IDMaskPrior2: 0 + - _IDMaskPrior3: 0 + - _IDMaskPrior4: 0 + - _IDMaskPrior5: 0 + - _IDMaskPrior6: 0 + - _IDMaskPrior7: 0 + - _IDMaskPrior8: 0 + - _IgnoreEncryption: 0 + - _Invisible: 0 + - _LLI_Max: 1 + - _LLI_Min: 0 + - _LigIgnoYNorDir: 0 + - _LightAffectOutlineColor: 0 + - _LightAffectRimLightColor: 0 + - _LightAffectShadow: 0 + - _LightFalloffAffectShadowT: 0 + - _LightFalloffSoftness: 1 + - _LightIntensity: 1 + - _LightMaxLimit: 1 + - _LightMinLimit: 0.05 + - _MCIALO: 0 + - _MCapIntensity: 1 + - _MVCOL: 0 + - _MaiColPo: 0.8 + - _Main2ndDissolveNoiseStrength: 0.1 + - _Main2ndEnableLighting: 1 + - _Main2ndTexAlphaMode: 0 + - _Main2ndTexAngle: 0 + - _Main2ndTexBlendMode: 0 + - _Main2ndTexIsDecal: 0 + - _Main2ndTexIsLeftOnly: 0 + - _Main2ndTexIsMSDF: 0 + - _Main2ndTexIsRightOnly: 0 + - _Main2ndTexShouldCopy: 0 + - _Main2ndTexShouldFlipCopy: 0 + - _Main2ndTexShouldFlipMirror: 0 + - _Main2ndTex_Cull: 0 + - _Main2ndTex_UVMode: 0 + - _Main3rdDissolveNoiseStrength: 0.1 + - _Main3rdEnableLighting: 1 + - _Main3rdTexAlphaMode: 0 + - _Main3rdTexAngle: 0 + - _Main3rdTexBlendMode: 0 + - _Main3rdTexIsDecal: 0 + - _Main3rdTexIsLeftOnly: 0 + - _Main3rdTexIsMSDF: 0 + - _Main3rdTexIsRightOnly: 0 + - _Main3rdTexShouldCopy: 0 + - _Main3rdTexShouldFlipCopy: 0 + - _Main3rdTexShouldFlipMirror: 0 + - _Main3rdTex_Cull: 0 + - _Main3rdTex_UVMode: 0 + - _MainGradationStrength: 0 + - _MatCap2ndApplyTransparency: 1 + - _MatCap2ndBackfaceMask: 0 + - _MatCap2ndBlend: 1 + - _MatCap2ndBlendMode: 1 + - _MatCap2ndBumpScale: 1 + - _MatCap2ndCustomNormal: 0 + - _MatCap2ndEnableLighting: 1 + - _MatCap2ndLod: 0 + - _MatCap2ndMainStrength: 0 + - _MatCap2ndNormalStrength: 1 + - _MatCap2ndPerspective: 1 + - _MatCap2ndShadowMask: 0 + - _MatCap2ndVRParallaxStrength: 1 + - _MatCap2ndZRotCancel: 1 + - _MatCapApplyTransparency: 1 + - _MatCapBackfaceMask: 0 + - _MatCapBlend: 0.6 + - _MatCapBlendMode: 1 + - _MatCapBumpScale: 1 + - _MatCapCustomNormal: 0 + - _MatCapEnableLighting: 1 + - _MatCapLod: 0 + - _MatCapMainStrength: 0 + - _MatCapNormalStrength: 1 + - _MatCapPerspective: 1 + - _MatCapShadowMask: 0.75 + - _MatCapVRParallaxStrength: 1 + - _MatCapZRotCancel: 1 + - _MaxFadDistance: 2 + - _Metallic: 0 + - _MinFadDistance: 0 + - _MixMainTexToOutline: 0 + - _MonochromeLighting: 0 + - _N_F_ANIS: 0 + - _N_F_CA: 0 + - _N_F_CLD: 0 + - _N_F_CO: 0 + - _N_F_COEDGL: 0 + - _N_F_DCS: 0 + - _N_F_DDMD: 1 + - _N_F_EAL: 1 + - _N_F_ESSAO: 0 + - _N_F_FR: 0 + - _N_F_GLO: 0 + - _N_F_GLOT: 0 + - _N_F_HDLS: 0 + - _N_F_HPSS: 0 + - _N_F_LLI: 0 + - _N_F_MC: 0 + - _N_F_MSSOLTFO: 0 + - _N_F_NFD: 0 + - _N_F_NLASOBF: 0 + - _N_F_NM: 0 + - _N_F_O: 1 + - _N_F_OFLMB: 0 + - _N_F_PA: 0 + - _N_F_PT: 0 + - _N_F_R: 0 + - _N_F_RDC: 1 + - _N_F_RL: 0 + - _N_F_RLIS: 0 + - _N_F_SCO: 0 + - _N_F_SCT: 0 + - _N_F_SE: 0 + - _N_F_SL: 0 + - _N_F_SLMM: 0 + - _N_F_SON: 0 + - _N_F_SS: 1 + - _N_F_ST: 0 + - _N_F_STIAL: 0 + - _N_F_STIS: 0 + - _N_F_STSDFM: 0 + - _N_F_TP: 0 + - _NoiTexAffStraWidt: 0 + - _NoisTexInten: 1 + - _NoiseSize: 100 + - _NoisyOutlineIntensity: 0 + - _NorMapAsDis: 0 + - _NormalMapIntensity: 1 + - _ObjePosiZCS: 0 + - _OffsetFactor: 0 + - _OffsetUnits: 0 + - _Opacity: 1 + - _Oper: 0 + - _OutStenPass: 0 + - _OutZTest: 4 + - _OutZWrite: 1 + - _OutlineAlphaToMask: 0 + - _OutlineBlendOp: 0 + - _OutlineBlendOpAlpha: 0 + - _OutlineBlendOpAlphaFA: 4 + - _OutlineBlendOpFA: 4 + - _OutlineColorMask: 15 + - _OutlineCull: 1 + - _OutlineDeleteMesh: 0 + - _OutlineDisableInVR: 0 + - _OutlineDstBlend: 10 + - _OutlineDstBlendAlpha: 10 + - _OutlineDstBlendAlphaFA: 1 + - _OutlineDstBlendFA: 1 + - _OutlineEnableLighting: 1 + - _OutlineExtrudeMethod: 0 + - _OutlineFixWidth: 0 + - _OutlineLitApplyTex: 0 + - _OutlineLitOffset: -8 + - _OutlineLitScale: 10 + - _OutlineLitShadowReceive: 0 + - _OutlineOffsetFactor: 0 + - _OutlineOffsetUnits: 0 + - _OutlineSrcBlend: 5 + - _OutlineSrcBlendAlpha: 1 + - _OutlineSrcBlendAlphaFA: 0 + - _OutlineSrcBlendFA: 1 + - _OutlineStencilComp: 8 + - _OutlineStencilFail: 0 + - _OutlineStencilPass: 0 + - _OutlineStencilReadMask: 255 + - _OutlineStencilRef: 0 + - _OutlineStencilWriteMask: 255 + - _OutlineStencilZFail: 0 + - _OutlineVectorScale: 1 + - _OutlineVectorUVMode: 0 + - _OutlineVertexR2Width: 0 + - _OutlineWidth: 0.03 + - _OutlineWidthAffectedByViewDistance: 0 + - _OutlineZBias: 0 + - _OutlineZClip: 1 + - _OutlineZPostionInCamera: 0 + - _OutlineZTest: 2 + - _OutlineZWrite: 1 + - _OverallShadowColorPower: 1 + - _PADist: 0 + - _PASize: 0.5 + - _PASmooTrans: 1 + - _PSGLOTEX: 0 + - _PTexturePower: 1 + - _Parallax: 0.02 + - _ParallaxOffset: 0.5 + - _PointSpotlightIntensity: 1 + - _PreAlphaToMask: 0 + - _PreBlendOp: 0 + - _PreBlendOpAlpha: 0 + - _PreBlendOpAlphaFA: 4 + - _PreBlendOpFA: 4 + - _PreColorMask: 15 + - _PreCull: 2 + - _PreCutoff: 0.5 + - _PreDstBlend: 10 + - _PreDstBlendAlpha: 10 + - _PreDstBlendAlphaFA: 1 + - _PreDstBlendFA: 1 + - _PreOffsetFactor: 0 + - _PreOffsetUnits: 0 + - _PreOutType: 0 + - _PreSrcBlend: 1 + - _PreSrcBlendAlpha: 1 + - _PreSrcBlendAlphaFA: 0 + - _PreSrcBlendFA: 1 + - _PreStencilComp: 8 + - _PreStencilFail: 0 + - _PreStencilPass: 0 + - _PreStencilReadMask: 255 + - _PreStencilRef: 0 + - _PreStencilWriteMask: 255 + - _PreStencilZFail: 0 + - _PreZClip: 1 + - _PreZTest: 4 + - _PreZWrite: 1 + - _PresAdju: 1 + - _RELG: 1 + - _RQSO: 0 + - _ReduSha: 0.5 + - _RefMetallic: 0 + - _RefVal: 0 + - _Reflectance: 0.04 + - _ReflectionApplyTransparency: 1 + - _ReflectionBlendMode: 1 + - _ReflectionCubeEnableLighting: 1 + - _ReflectionCubeOverride: 0 + - _ReflectionIntensity: 0 + - _ReflectionNormalStrength: 1 + - _RimApplyTransparency: 1 + - _RimBackfaceMask: 0 + - _RimBlendMode: 1 + - _RimBlur: 0.1 + - _RimBorder: 0.873 + - _RimDirRange: 0 + - _RimDirStrength: 0 + - _RimEnableLighting: 1 + - _RimFresnelPower: 1 + - _RimIndirBlur: 0.1 + - _RimIndirBorder: 0.5 + - _RimIndirRange: 0 + - _RimLigInt: 1 + - _RimLightColorPower: 10 + - _RimLightInLight: 1 + - _RimLightSoftness: 1 + - _RimLightUnfill: 1.5 + - _RimMainStrength: 0 + - _RimNormalStrength: 1 + - _RimShadeBlur: 1 + - _RimShadeBorder: 0.5 + - _RimShadeFresnelPower: 1 + - _RimShadeNormalStrength: 1 + - _RimShadowMask: 1 + - _RimVRParallaxStrength: 1 + - _SPECIN: 1 + - _SPECMODE: 0 + - _STIL: 0 + - _Saturation: 1 + - _SelfLitHighContrast: 1 + - _SelfLitIntensity: 0 + - _SelfLitPower: 2 + - _SelfShadowAffectedByLightShadowStrength: 0 + - _SelfShadowHardness: 1 + - _SelfShadowRealTimeShadowColorPower: 1 + - _SelfShadowRealtimeShadowIntensity: 0 + - _SelfShadowShadowTAtViewDirection: 0 + - _SelfShadowThreshold: 0.93 + - _Shadow2ndBlur: 0.14 + - _Shadow2ndBorder: 0.3 + - _Shadow2ndNormalStrength: 1 + - _Shadow2ndReceive: 0 + - _Shadow3rdBlur: 0.1 + - _Shadow3rdBorder: 0.25 + - _Shadow3rdNormalStrength: 1 + - _Shadow3rdReceive: 0 + - _ShadowBlur: 0.1 + - _ShadowBlurMaskLOD: 0 + - _ShadowBorder: 0.35 + - _ShadowBorderMaskLOD: 0 + - _ShadowBorderRange: 0 + - _ShadowColorTexturePower: 0 + - _ShadowColorType: 0 + - _ShadowEnvStrength: 0 + - _ShadowFlatBlur: 1 + - _ShadowFlatBorder: 1 + - _ShadowHardness: 0 + - _ShadowMainStrength: 0 + - _ShadowMaskType: 0 + - _ShadowNormalStrength: 1 + - _ShadowPostAO: 0 + - _ShadowReceive: 1 + - _ShadowStrength: 1 + - _ShadowStrengthMaskLOD: 0 + - _ShadowTColorPower: 1 + - _ShadowTHardness: 1 + - _ShadowTIntensity: 1 + - _ShadowTLightThreshold: 50 + - _ShadowTShadowThreshold: 0 + - _ShifAnis: 0 + - _ShiftBackfaceUV: 0 + - _ShowInAmbientLightShadowIntensity: 1 + - _ShowInAmbientLightShadowThreshold: 0.4 + - _ShowNormal: 0 + - _SimTrans: 0 + - _SkinMatrixIndex: 0 + - _SmoothObjectNormal: 0 + - _Smoothness: 1 + - _SpecularBlur: 0 + - _SpecularBorder: 0.5 + - _SpecularNormalStrength: 1 + - _SpecularToon: 1 + - _SrcBlend: 1 + - _SrcBlendAlpha: 1 + - _SrcBlendAlphaFA: 0 + - _SrcBlendFA: 1 + - _StencilComp: 8 + - _StencilFail: 0 + - _StencilPass: 2 + - _StencilReadMask: 255 + - _StencilRef: 0 + - _StencilWriteMask: 255 + - _StencilZFail: 0 + - _StraWidt: 10 + - _SubpassCutoff: 0.5 + - _TEXMCOLINT: 1 + - _TRANSMODE: 0 + - _TessEdge: 10 + - _TessFactorMax: 3 + - _TessShrink: 0 + - _TessStrength: 0.5 + - _TessellationFar: 1 + - _TessellationNear: 1 + - _TessellationSmoothness: 0.5 + - _TessellationTransition: 0.8 + - _TexturePatternStyle: 0 + - _TrailSize: 1.5 + - _TransAffSha: 1 + - _TransparentMode: 0 + - _TransparentThreshold: 0 + - _TriPlaBlend: 4 + - _TriPlaTile: 1 + - _UDIMDiscardCompile: 0 + - _UDIMDiscardMode: 0 + - _UDIMDiscardRow0_0: 0 + - _UDIMDiscardRow0_1: 0 + - _UDIMDiscardRow0_2: 0 + - _UDIMDiscardRow0_3: 0 + - _UDIMDiscardRow1_0: 0 + - _UDIMDiscardRow1_1: 0 + - _UDIMDiscardRow1_2: 0 + - _UDIMDiscardRow1_3: 0 + - _UDIMDiscardRow2_0: 0 + - _UDIMDiscardRow2_1: 0 + - _UDIMDiscardRow2_2: 0 + - _UDIMDiscardRow2_3: 0 + - _UDIMDiscardRow3_0: 0 + - _UDIMDiscardRow3_1: 0 + - _UDIMDiscardRow3_2: 0 + - _UDIMDiscardRow3_3: 0 + - _UDIMDiscardUV: 0 + - _UVSet: 0 + - _UseAnisotropy: 0 + - _UseAudioLink: 0 + - _UseBacklight: 0 + - _UseBump2ndMap: 0 + - _UseBumpMap: 0 + - _UseClippingCanceller: 0 + - _UseDither: 0 + - _UseEmission: 0 + - _UseEmission2nd: 0 + - _UseGlitter: 0 + - _UseMain2ndTex: 0 + - _UseMain3rdTex: 0 + - _UseMatCap: 0 + - _UseMatCap2nd: 0 + - _UseOutline: 0 + - _UsePOM: 0 + - _UseParallax: 0 + - _UseReflection: 0 + - _UseRim: 0 + - _UseRimShade: 0 + - _UseSecondaryCutout: 0 + - _UseShadow: 1 + - _UseTLB: 0 + - _VertexColorBlueAffectOutlineWitdh: 0 + - _VertexColorGreenControlSelfShadowThreshold: 0 + - _VertexColorRedControlSmoothObjectNormal: 0 + - _VertexLightStrength: 0 + - _ZClip: 1 + - _ZTest: 4 + - _ZWrite: 1 + - _e2gai: 2 + - _e2gci: 2 + - _egai: 2 + - _egci: 2 + - _lilDirectionalLightStrength: 1 + - _lilShadowCasterBias: 0 + - _lilToonVersion: 42 + m_Colors: + - _AudioLinkDefaultValue: {r: 0, g: 0, b: 2, a: 0.75} + - _AudioLinkLocalMapParams: {r: 120, g: 1, b: 0, a: 0} + - _AudioLinkMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _AudioLinkStart: {r: 0, g: 0, b: 0, a: 0} + - _AudioLinkUVParams: {r: 0.25, g: 0, b: 0, a: 0.125} + - _AudioLinkVertexStart: {r: 0, g: 0, b: 0, a: 0} + - _AudioLinkVertexStrength: {r: 0, g: 0, b: 0, a: 1} + - _AudioLinkVertexUVParams: {r: 0.25, g: 0, b: 0, a: 0.125} + - _BackfaceColor: {r: 0, g: 0, b: 0, a: 0} + - _BacklightColor: {r: 0.85, g: 0.8, b: 0.7, a: 1} + - _BaseColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Color2nd: {r: 1, g: 1, b: 1, a: 1} + - _Color3rd: {r: 1, g: 1, b: 1, a: 1} + - _CustomLightDirection: {r: 0, g: 0, b: 10, a: 0} + - _DissolveColor: {r: 1, g: 1, b: 1, a: 1} + - _DissolveNoiseMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _DissolveParams: {r: 0, g: 0, b: 0.5, a: 0.1} + - _DissolvePos: {r: 0, g: 0, b: 0, a: 0} + - _DistanceFade: {r: 0.1, g: 0.01, b: 0, a: 0} + - _DistanceFadeColor: {r: 0, g: 0, b: 0, a: 1} + - _DistanceFadeRimColor: {r: 0, g: 0, b: 0, a: 0} + - _Emission2ndBlendMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _Emission2ndBlink: {r: 0, g: 0, b: 3.141593, a: 0} + - _Emission2ndColor: {r: 1, g: 1, b: 1, a: 1} + - _Emission2ndMap_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _EmissionBlendMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _EmissionBlink: {r: 0, g: 0, b: 3.141593, a: 0} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _EmissionMap_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _GlitterAtras: {r: 1, g: 1, b: 0, a: 0} + - _GlitterColor: {r: 1, g: 1, b: 1, a: 1} + - _GlitterParams1: {r: 256, g: 256, b: 0.16, a: 50} + - _GlitterParams2: {r: 0.25, g: 0, b: 0, a: 0} + - _GlossColor: {r: 1, g: 1, b: 1, a: 1} + - _Glow_Color: {r: 1, g: 1, b: 1, a: 1} + - _HighlightColor: {r: 0, g: 0.056895256, b: 1, a: 1} + - _Keys: {r: 0, g: 0, b: 0, a: 0} + - _LightDirectionOverride: {r: 0.001, g: 0.002, b: 0.001, a: 0} + - _Main2ndDissolveColor: {r: 1, g: 1, b: 1, a: 1} + - _Main2ndDissolveNoiseMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _Main2ndDissolveParams: {r: 0, g: 0, b: 0.5, a: 0.1} + - _Main2ndDissolvePos: {r: 0, g: 0, b: 0, a: 0} + - _Main2ndDistanceFade: {r: 0.1, g: 0.01, b: 0, a: 0} + - _Main2ndTexDecalAnimation: {r: 1, g: 1, b: 1, a: 30} + - _Main2ndTexDecalSubParam: {r: 1, g: 1, b: 0, a: 1} + - _Main2ndTex_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _Main3rdDissolveColor: {r: 1, g: 1, b: 1, a: 1} + - _Main3rdDissolveNoiseMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _Main3rdDissolveParams: {r: 0, g: 0, b: 0.5, a: 0.1} + - _Main3rdDissolvePos: {r: 0, g: 0, b: 0, a: 0} + - _Main3rdDistanceFade: {r: 0.1, g: 0.01, b: 0, a: 0} + - _Main3rdTexDecalAnimation: {r: 1, g: 1, b: 1, a: 30} + - _Main3rdTexDecalSubParam: {r: 1, g: 1, b: 0, a: 1} + - _Main3rdTex_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _MainColor: {r: 1, g: 1, b: 1, a: 1} + - _MainTexHSVG: {r: 0, g: 1, b: 1, a: 1} + - _MainTex_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _MatCap2ndBlendUV1: {r: 0, g: 0, b: 0, a: 0} + - _MatCap2ndColor: {r: 1, g: 1, b: 1, a: 1} + - _MatCapBlendUV1: {r: 0, g: 0, b: 0, a: 0} + - _MatCapColor: {r: 1, g: 1, b: 1, a: 0.7} + - _ObjPosi: {r: 0, g: 0, b: 0, a: 0} + - _ObjectForward: {r: 0, g: 0, b: 0, a: 0} + - _ObjectRight: {r: 0, g: 0, b: 0, a: 0} + - _OutResi: {r: 1, g: 1, b: 1, a: 1} + - _OutlineColor: {r: 0.43298328, g: 0.4456163, b: 0.6603774, a: 1} + - _OutlineLitColor: {r: 1, g: 0.19999996, b: 0, a: 0} + - _OutlineOffset: {r: 0, g: 0, b: 0, a: 1} + - _OutlineTexHSVG: {r: 0, g: 1, b: 1, a: 1} + - _OutlineTex_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _OverallShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _PTCol: {r: 0, g: 0, b: 0, a: 1} + - _PreColor: {r: 1, g: 1, b: 1, a: 1} + - _PrevPosition: {r: 0, g: 0, b: 0, a: 0} + - _ReflectionColor: {r: 1, g: 1, b: 1, a: 1} + - _ReflectionCubeColor: {r: 0, g: 0, b: 0, a: 1} + - _RimColor: {r: 0.5, g: 0.46249998, b: 0.42499956, a: 0.262} + - _RimIndirColor: {r: 1, g: 1, b: 1, a: 1} + - _RimLigPosi: {r: 1, g: 1, b: 1, a: 1} + - _RimLightColor: {r: 1, g: 1, b: 1, a: 1} + - _RimShadeColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + - _SSAOColor: {r: 0, g: 0, b: 0, a: 0} + - _SelfLitColor: {r: 1, g: 1, b: 1, a: 1} + - _SelfShadowRealTimeShadowColor: {r: 1, g: 1, b: 1, a: 1} + - _Shadow2ndColor: {r: 0.85898006, g: 0.88302904, b: 0.9150943, a: 1} + - _Shadow3rdColor: {r: 0, g: 0, b: 0, a: 0} + - _ShadowAOShift: {r: 1, g: 0, b: 1, a: 0} + - _ShadowAOShift2: {r: 1, g: 0, b: 1, a: 0} + - _ShadowBorderColor: {r: 0.8666667, g: 0.8901961, b: 0.9137255, a: 1} + - _ShadowColor: {r: 0.9123354, g: 0.9326618, b: 0.9622642, a: 1} + - _ShadowTColor: {r: 1, g: 1, b: 1, a: 1} + - _XYZPosition: {r: 0, g: 0, b: 0, a: 0} + - _e2ga0: {r: 1, g: 0, b: 0, a: 0} + - _e2ga1: {r: 1, g: 0, b: 0, a: 1} + - _e2ga2: {r: 1, g: 0, b: 0, a: 0} + - _e2ga3: {r: 1, g: 0, b: 0, a: 0} + - _e2ga4: {r: 1, g: 0, b: 0, a: 0} + - _e2ga5: {r: 1, g: 0, b: 0, a: 0} + - _e2ga6: {r: 1, g: 0, b: 0, a: 0} + - _e2ga7: {r: 1, g: 0, b: 0, a: 0} + - _e2gc0: {r: 1, g: 1, b: 1, a: 0} + - _e2gc1: {r: 1, g: 1, b: 1, a: 1} + - _e2gc2: {r: 1, g: 1, b: 1, a: 0} + - _e2gc3: {r: 1, g: 1, b: 1, a: 0} + - _e2gc4: {r: 1, g: 1, b: 1, a: 0} + - _e2gc5: {r: 1, g: 1, b: 1, a: 0} + - _e2gc6: {r: 1, g: 1, b: 1, a: 0} + - _e2gc7: {r: 1, g: 1, b: 1, a: 0} + - _ega0: {r: 1, g: 0, b: 0, a: 0} + - _ega1: {r: 1, g: 0, b: 0, a: 1} + - _ega2: {r: 1, g: 0, b: 0, a: 0} + - _ega3: {r: 1, g: 0, b: 0, a: 0} + - _ega4: {r: 1, g: 0, b: 0, a: 0} + - _ega5: {r: 1, g: 0, b: 0, a: 0} + - _ega6: {r: 1, g: 0, b: 0, a: 0} + - _ega7: {r: 1, g: 0, b: 0, a: 0} + - _egc0: {r: 1, g: 1, b: 1, a: 0} + - _egc1: {r: 1, g: 1, b: 1, a: 1} + - _egc2: {r: 1, g: 1, b: 1, a: 0} + - _egc3: {r: 1, g: 1, b: 1, a: 0} + - _egc4: {r: 1, g: 1, b: 1, a: 0} + - _egc5: {r: 1, g: 1, b: 1, a: 0} + - _egc6: {r: 1, g: 1, b: 1, a: 0} + - _egc7: {r: 1, g: 1, b: 1, a: 0} + m_BuildTextureStacks: [] + m_AllowLocking: 1 diff --git a/Assets/04_Models/Characters/Fariy/Materials/Body_Hair/Alistia_Hair.mat.meta b/Assets/04_Models/Characters/Fariy/Materials/Body_Hair/Alistia_Hair.mat.meta new file mode 100644 index 00000000..12477884 --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Materials/Body_Hair/Alistia_Hair.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c605ffdaefec0d3429b476e3f534840c +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/04_Models/Characters/Fariy/Materials/Cloth.meta b/Assets/04_Models/Characters/Fariy/Materials/Cloth.meta new file mode 100644 index 00000000..1abd81f6 --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Materials/Cloth.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ee4551c5eae27eb4bb89edfacd9aa4b7 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/04_Models/Characters/Fariy/Materials/Cloth/Alistia_Cloth_1_Blue.mat b/Assets/04_Models/Characters/Fariy/Materials/Cloth/Alistia_Cloth_1_Blue.mat new file mode 100644 index 00000000..d66be4b9 --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Materials/Cloth/Alistia_Cloth_1_Blue.mat @@ -0,0 +1,996 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Alistia_Cloth_1_Blue + m_Shader: {fileID: 4800000, guid: 6459b2db96a08ca41b0f9b39dc7ad59e, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: + - N_F_DDMD_ON + - N_F_EAL_ON + - N_F_O_ON + - N_F_RDC_ON + - N_F_RELGI_ON + - N_F_SS_ON + - N_F_TRANSAFFSHA_ON + - _UVSET_UV0 + m_InvalidKeywords: [] + m_LightmapFlags: 0 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_LockedProperties: _ShadowHardness + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AnisotropyScaleMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AnisotropyShiftNoiseMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AnisotropyTangentMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AudioLinkLocalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AudioLinkMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BacklightColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BaseColorMap: + m_Texture: {fileID: 2800000, guid: 083e7f8c110fa364c817bb3c34f9fdeb, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BaseMap: + m_Texture: {fileID: 2800000, guid: 083e7f8c110fa364c817bb3c34f9fdeb, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Bump2ndMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Bump2ndScaleMask: + m_Texture: {fileID: 0} + 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} + - _DissolveMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DissolveNoiseMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DitherTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Emission2ndBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Emission2ndGradTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Emission2ndMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionGradTex: + 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} + - _FReflection: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlitterColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlitterShapeTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlossTexture: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MCap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MCapMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main2ndBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main2ndDissolveMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main2ndDissolveNoiseMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main2ndTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main3rdBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main3rdDissolveMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main3rdDissolveNoiseMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main3rdTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainColorAdjustMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainGradationTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 083e7f8c110fa364c817bb3c34f9fdeb, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MaskGloss: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MaskReflection: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MaskSelfLit: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MaskTransparency: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCap2ndBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCap2ndBumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCap2ndTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCapBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCapBumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCapTex: + 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} + - _NormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 083e7f8c110fa364c817bb3c34f9fdeb, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineVectorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineWidthControl: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineWidthMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _PTexture: + 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} + - _ReflectionColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ReflectionCubeTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _RimColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _RimShadeMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SecondaryCutout: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Shadow2ndColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Shadow3rdColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowBlurMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowBorderMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowColorTexture: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowStrengthMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowT: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SmoothnessTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _AAS: 0.0001 + - _AAStrength: 1 + - _AlpToCov: 0 + - _AlphaBaseCutout: 1 + - _AlphaBoostFA: 10 + - _AlphaMaskMode: 0 + - _AlphaMaskScale: 1 + - _AlphaMaskValue: 0 + - _AlphaToMask: 0 + - _Anisotropy2MatCap: 0 + - _Anisotropy2MatCap2nd: 0 + - _Anisotropy2Reflection: 0 + - _Anisotropy2ndBitangentWidth: 1 + - _Anisotropy2ndShift: 0 + - _Anisotropy2ndShiftNoiseScale: 0 + - _Anisotropy2ndSpecularStrength: 0 + - _Anisotropy2ndTangentWidth: 1 + - _AnisotropyBitangentWidth: 1 + - _AnisotropyScale: 1 + - _AnisotropyShift: 0 + - _AnisotropyShiftNoiseScale: 0 + - _AnisotropySpecularStrength: 1 + - _AnisotropyTangentWidth: 1 + - _ApplyReflection: 0 + - _ApplySpecular: 1 + - _ApplySpecularFA: 1 + - _AsOverlay: 0 + - _AsUnlit: 0 + - _AudioLink2Emission: 0 + - _AudioLink2Emission2nd: 0 + - _AudioLink2Emission2ndGrad: 0 + - _AudioLink2EmissionGrad: 0 + - _AudioLink2Main2nd: 0 + - _AudioLink2Main3rd: 0 + - _AudioLink2Vertex: 0 + - _AudioLinkAsLocal: 0 + - _AudioLinkMask_UVMode: 0 + - _AudioLinkUVMode: 1 + - _AudioLinkVertexUVMode: 1 + - _BackfaceForceShadow: 0 + - _BacklightBackfaceMask: 1 + - _BacklightBlur: 0.2 + - _BacklightBorder: 0.45 + - _BacklightDirectivity: 5 + - _BacklightMainStrength: 0 + - _BacklightNormalStrength: 1 + - _BacklightReceiveShadow: 1 + - _BacklightViewStrength: 1 + - _BeforeExposureLimit: 10000 + - _BitKey0: 0 + - _BitKey1: 0 + - _BitKey10: 0 + - _BitKey11: 0 + - _BitKey12: 0 + - _BitKey13: 0 + - _BitKey14: 0 + - _BitKey15: 0 + - _BitKey16: 0 + - _BitKey17: 0 + - _BitKey18: 0 + - _BitKey19: 0 + - _BitKey2: 0 + - _BitKey20: 0 + - _BitKey21: 0 + - _BitKey22: 0 + - _BitKey23: 0 + - _BitKey24: 0 + - _BitKey25: 0 + - _BitKey26: 0 + - _BitKey27: 0 + - _BitKey28: 0 + - _BitKey29: 0 + - _BitKey3: 0 + - _BitKey30: 0 + - _BitKey31: 0 + - _BitKey4: 0 + - _BitKey5: 0 + - _BitKey6: 0 + - _BitKey7: 0 + - _BitKey8: 0 + - _BitKey9: 0 + - _BleModDest: 0 + - _BleModSour: 1 + - _BlendOp: 0 + - _BlendOpAlpha: 0 + - _BlendOpAlphaFA: 4 + - _BlendOpFA: 4 + - _Bump2ndMap_UVMode: 0 + - _Bump2ndScale: 1 + - _BumpScale: 1 + - _ClipAdju: 0 + - _ColorMask: 15 + - _Compa: 4 + - _ComputeMeshIndex: 0 + - _Cull: 0 + - _Culling: 2 + - _CustomLightDirectionFollowObjectRotation: 0 + - _CustomLightDirectionIntensity: 0 + - _Cutoff: 0.5 + - _Cutout: 0.5 + - _DepthThreshold: 900 + - _DirectionalLightIntensity: 1 + - _DissolveNoiseStrength: 0.1 + - _DistanceFadeMode: 0 + - _DistanceFadeRimFresnelPower: 5 + - _DitherMaxValue: 255 + - _DoubleSidedOutline: 1 + - _DstBlend: 0 + - _DstBlendAlpha: 10 + - _DstBlendAlphaFA: 1 + - _DstBlendFA: 1 + - _DummyProperty: 0 + - _DynamicNoisyOutline: 0 + - _Emission2ndBlend: 1 + - _Emission2ndBlendMode: 1 + - _Emission2ndFluorescence: 0 + - _Emission2ndGradSpeed: 1 + - _Emission2ndMainStrength: 0 + - _Emission2ndMap_UVMode: 0 + - _Emission2ndParallaxDepth: 0 + - _Emission2ndUseGrad: 0 + - _EmissionBlend: 1 + - _EmissionBlendMode: 1 + - _EmissionFluorescence: 0 + - _EmissionGradSpeed: 1 + - _EmissionMainStrength: 0 + - _EmissionMap_UVMode: 0 + - _EmissionParallaxDepth: 0 + - _EmissionUseGrad: 0 + - _EnvironmentalLightingIntensity: 1 + - _FarDistanceMaxWidth: 10 + - _FlipNormal: 0 + - _GIFlatShade: 0 + - _GIShadeThreshold: 0 + - _GSAAStrength: 0 + - _GlitterAngleRandomize: 0 + - _GlitterApplyShape: 0 + - _GlitterApplyTransparency: 1 + - _GlitterBackfaceMask: 0 + - _GlitterColorTex_UVMode: 0 + - _GlitterEnableLighting: 1 + - _GlitterMainStrength: 0 + - _GlitterNormalStrength: 1 + - _GlitterPostContrast: 1 + - _GlitterScaleRandomize: 0 + - _GlitterSensitivity: 0.25 + - _GlitterShadowMask: 0 + - _GlitterUVMode: 0 + - _GlitterVRParallaxStrength: 0 + - _GlossColorPower: 10 + - _GlossIntensity: 1 + - _GlossSoftness: 0 + - _GlossTextureFollowLight: 0 + - _GlossTextureFollowObjectRotation: 0 + - _GlossTextureRotate: 0 + - _GlossTextureSoftness: 0 + - _Glossiness: 0.6 + - _Glow_Edge_Width: 1 + - _HighlightColorPower: 5 + - _IDMask1: 0 + - _IDMask2: 0 + - _IDMask3: 0 + - _IDMask4: 0 + - _IDMask5: 0 + - _IDMask6: 0 + - _IDMask7: 0 + - _IDMask8: 0 + - _IDMaskCompile: 0 + - _IDMaskControlsDissolve: 0 + - _IDMaskFrom: 8 + - _IDMaskIndex1: 0 + - _IDMaskIndex2: 0 + - _IDMaskIndex3: 0 + - _IDMaskIndex4: 0 + - _IDMaskIndex5: 0 + - _IDMaskIndex6: 0 + - _IDMaskIndex7: 0 + - _IDMaskIndex8: 0 + - _IDMaskIsBitmap: 0 + - _IDMaskPrior1: 0 + - _IDMaskPrior2: 0 + - _IDMaskPrior3: 0 + - _IDMaskPrior4: 0 + - _IDMaskPrior5: 0 + - _IDMaskPrior6: 0 + - _IDMaskPrior7: 0 + - _IDMaskPrior8: 0 + - _IgnoreEncryption: 0 + - _Invisible: 0 + - _LLI_Max: 1 + - _LLI_Min: 0 + - _LigIgnoYNorDir: 0 + - _LightAffectOutlineColor: 0 + - _LightAffectRimLightColor: 0 + - _LightAffectShadow: 0 + - _LightFalloffAffectShadowT: 0 + - _LightFalloffSoftness: 1 + - _LightIntensity: 1 + - _LightMaxLimit: 1 + - _LightMinLimit: 0.05 + - _MCIALO: 0 + - _MCapIntensity: 1 + - _MVCOL: 0 + - _MaiColPo: 0.8 + - _Main2ndDissolveNoiseStrength: 0.1 + - _Main2ndEnableLighting: 1 + - _Main2ndTexAlphaMode: 0 + - _Main2ndTexAngle: 0 + - _Main2ndTexBlendMode: 0 + - _Main2ndTexIsDecal: 0 + - _Main2ndTexIsLeftOnly: 0 + - _Main2ndTexIsMSDF: 0 + - _Main2ndTexIsRightOnly: 0 + - _Main2ndTexShouldCopy: 0 + - _Main2ndTexShouldFlipCopy: 0 + - _Main2ndTexShouldFlipMirror: 0 + - _Main2ndTex_Cull: 0 + - _Main2ndTex_UVMode: 0 + - _Main3rdDissolveNoiseStrength: 0.1 + - _Main3rdEnableLighting: 1 + - _Main3rdTexAlphaMode: 0 + - _Main3rdTexAngle: 0 + - _Main3rdTexBlendMode: 0 + - _Main3rdTexIsDecal: 0 + - _Main3rdTexIsLeftOnly: 0 + - _Main3rdTexIsMSDF: 0 + - _Main3rdTexIsRightOnly: 0 + - _Main3rdTexShouldCopy: 0 + - _Main3rdTexShouldFlipCopy: 0 + - _Main3rdTexShouldFlipMirror: 0 + - _Main3rdTex_Cull: 0 + - _Main3rdTex_UVMode: 0 + - _MainGradationStrength: 0 + - _MatCap2ndApplyTransparency: 1 + - _MatCap2ndBackfaceMask: 0 + - _MatCap2ndBlend: 1 + - _MatCap2ndBlendMode: 1 + - _MatCap2ndBumpScale: 1 + - _MatCap2ndCustomNormal: 0 + - _MatCap2ndEnableLighting: 1 + - _MatCap2ndLod: 0 + - _MatCap2ndMainStrength: 0 + - _MatCap2ndNormalStrength: 1 + - _MatCap2ndPerspective: 1 + - _MatCap2ndShadowMask: 0 + - _MatCap2ndVRParallaxStrength: 1 + - _MatCap2ndZRotCancel: 1 + - _MatCapApplyTransparency: 1 + - _MatCapBackfaceMask: 0 + - _MatCapBlend: 1 + - _MatCapBlendMode: 1 + - _MatCapBumpScale: 1 + - _MatCapCustomNormal: 0 + - _MatCapEnableLighting: 1 + - _MatCapLod: 0 + - _MatCapMainStrength: 0 + - _MatCapNormalStrength: 1 + - _MatCapPerspective: 1 + - _MatCapShadowMask: 0 + - _MatCapVRParallaxStrength: 1 + - _MatCapZRotCancel: 1 + - _MaxFadDistance: 2 + - _Metallic: 0 + - _MinFadDistance: 0 + - _MixMainTexToOutline: 0 + - _MonochromeLighting: 0 + - _N_F_ANIS: 0 + - _N_F_CA: 0 + - _N_F_CLD: 0 + - _N_F_CO: 0 + - _N_F_COEDGL: 0 + - _N_F_DCS: 0 + - _N_F_DDMD: 1 + - _N_F_EAL: 1 + - _N_F_ESSAO: 0 + - _N_F_FR: 0 + - _N_F_GLO: 0 + - _N_F_GLOT: 0 + - _N_F_HDLS: 0 + - _N_F_HPSS: 0 + - _N_F_LLI: 0 + - _N_F_MC: 0 + - _N_F_MSSOLTFO: 0 + - _N_F_NFD: 0 + - _N_F_NLASOBF: 0 + - _N_F_NM: 0 + - _N_F_O: 1 + - _N_F_OFLMB: 0 + - _N_F_PA: 0 + - _N_F_PT: 0 + - _N_F_R: 0 + - _N_F_RDC: 1 + - _N_F_RL: 0 + - _N_F_RLIS: 0 + - _N_F_SCO: 0 + - _N_F_SCT: 0 + - _N_F_SE: 0 + - _N_F_SL: 0 + - _N_F_SLMM: 0 + - _N_F_SON: 0 + - _N_F_SS: 1 + - _N_F_ST: 0 + - _N_F_STIAL: 0 + - _N_F_STIS: 0 + - _N_F_STSDFM: 0 + - _N_F_TP: 0 + - _NoiTexAffStraWidt: 0 + - _NoisTexInten: 1 + - _NoiseSize: 100 + - _NoisyOutlineIntensity: 0 + - _NorMapAsDis: 0 + - _NormalMapIntensity: 1 + - _ObjePosiZCS: 0 + - _OffsetFactor: 0 + - _OffsetUnits: 0 + - _Opacity: 1 + - _Oper: 0 + - _OutStenPass: 0 + - _OutZTest: 4 + - _OutZWrite: 1 + - _OutlineAlphaToMask: 0 + - _OutlineBlendOp: 0 + - _OutlineBlendOpAlpha: 0 + - _OutlineBlendOpAlphaFA: 4 + - _OutlineBlendOpFA: 4 + - _OutlineColorMask: 15 + - _OutlineCull: 1 + - _OutlineDeleteMesh: 0 + - _OutlineDisableInVR: 0 + - _OutlineDstBlend: 0 + - _OutlineDstBlendAlpha: 10 + - _OutlineDstBlendAlphaFA: 1 + - _OutlineDstBlendFA: 1 + - _OutlineEnableLighting: 1 + - _OutlineExtrudeMethod: 0 + - _OutlineFixWidth: 1 + - _OutlineLitApplyTex: 0 + - _OutlineLitOffset: -8 + - _OutlineLitScale: 10 + - _OutlineLitShadowReceive: 0 + - _OutlineOffsetFactor: 0 + - _OutlineOffsetUnits: 0 + - _OutlineSrcBlend: 1 + - _OutlineSrcBlendAlpha: 1 + - _OutlineSrcBlendAlphaFA: 0 + - _OutlineSrcBlendFA: 1 + - _OutlineStencilComp: 8 + - _OutlineStencilFail: 0 + - _OutlineStencilPass: 0 + - _OutlineStencilReadMask: 255 + - _OutlineStencilRef: 0 + - _OutlineStencilWriteMask: 255 + - _OutlineStencilZFail: 0 + - _OutlineVectorScale: 1 + - _OutlineVectorUVMode: 0 + - _OutlineVertexR2Width: 0 + - _OutlineWidth: 0.07 + - _OutlineWidthAffectedByViewDistance: 0 + - _OutlineZBias: 0 + - _OutlineZClip: 1 + - _OutlineZPostionInCamera: 0 + - _OutlineZTest: 2 + - _OutlineZWrite: 1 + - _OverallShadowColorPower: 1 + - _PADist: 0 + - _PASize: 0.5 + - _PASmooTrans: 1 + - _PSGLOTEX: 0 + - _PTexturePower: 1 + - _Parallax: 0.02 + - _ParallaxOffset: 0.5 + - _PointSpotlightIntensity: 1 + - _PresAdju: 1 + - _RELG: 1 + - _RQSO: 0 + - _ReduSha: 0.5 + - _RefMetallic: 0 + - _RefVal: 0 + - _Reflectance: 0.04 + - _ReflectionApplyTransparency: 1 + - _ReflectionBlendMode: 1 + - _ReflectionCubeEnableLighting: 1 + - _ReflectionCubeOverride: 0 + - _ReflectionIntensity: 0 + - _ReflectionNormalStrength: 1 + - _RimApplyTransparency: 1 + - _RimBackfaceMask: 1 + - _RimBlendMode: 1 + - _RimBlur: 0.6 + - _RimBorder: 0.5 + - _RimDirRange: 0 + - _RimDirStrength: 0 + - _RimEnableLighting: 1 + - _RimFresnelPower: 4 + - _RimIndirBlur: 0.029999971 + - _RimIndirBorder: 0.985 + - _RimIndirRange: 0 + - _RimLigInt: 1 + - _RimLightColorPower: 10 + - _RimLightInLight: 1 + - _RimLightSoftness: 1 + - _RimLightUnfill: 1.5 + - _RimMainStrength: 0 + - _RimNormalStrength: 1 + - _RimShadeBlur: 1 + - _RimShadeBorder: 0.5 + - _RimShadeFresnelPower: 1 + - _RimShadeNormalStrength: 1 + - _RimShadowMask: 0 + - _RimVRParallaxStrength: 0 + - _SPECIN: 1 + - _SPECMODE: 0 + - _STIL: 0 + - _Saturation: 1 + - _SelfLitHighContrast: 1 + - _SelfLitIntensity: 0 + - _SelfLitPower: 2 + - _SelfShadowAffectedByLightShadowStrength: 0 + - _SelfShadowHardness: 1 + - _SelfShadowRealTimeShadowColorPower: 1 + - _SelfShadowRealtimeShadowIntensity: 0 + - _SelfShadowShadowTAtViewDirection: 0 + - _SelfShadowThreshold: 0.93 + - _Shadow2ndBlur: 0.146 + - _Shadow2ndBorder: 0.212 + - _Shadow2ndNormalStrength: 1 + - _Shadow2ndReceive: 0 + - _Shadow3rdBlur: 0.1 + - _Shadow3rdBorder: 0.25 + - _Shadow3rdNormalStrength: 1 + - _Shadow3rdReceive: 0 + - _ShadowBlur: 0.1 + - _ShadowBlurMaskLOD: 0 + - _ShadowBorder: 0.249 + - _ShadowBorderMaskLOD: 0 + - _ShadowBorderRange: 0.01 + - _ShadowColorTexturePower: 0 + - _ShadowColorType: 0 + - _ShadowEnvStrength: 0 + - _ShadowFlatBlur: 1 + - _ShadowFlatBorder: 1 + - _ShadowHardness: 0 + - _ShadowMainStrength: 1 + - _ShadowMaskType: 0 + - _ShadowNormalStrength: 1 + - _ShadowPostAO: 0 + - _ShadowReceive: 0 + - _ShadowStrength: 0.2 + - _ShadowStrengthMaskLOD: 0 + - _ShadowTColorPower: 1 + - _ShadowTHardness: 1 + - _ShadowTIntensity: 1 + - _ShadowTLightThreshold: 50 + - _ShadowTShadowThreshold: 0 + - _ShifAnis: 0 + - _ShiftBackfaceUV: 0 + - _ShowInAmbientLightShadowIntensity: 1 + - _ShowInAmbientLightShadowThreshold: 0.4 + - _ShowNormal: 0 + - _SimTrans: 0 + - _SkinMatrixIndex: 0 + - _SmoothObjectNormal: 0 + - _Smoothness: 1 + - _SpecularBlur: 0 + - _SpecularBorder: 0.5 + - _SpecularNormalStrength: 1 + - _SpecularToon: 1 + - _SrcBlend: 1 + - _SrcBlendAlpha: 1 + - _SrcBlendAlphaFA: 0 + - _SrcBlendFA: 1 + - _StencilComp: 8 + - _StencilFail: 0 + - _StencilPass: 0 + - _StencilReadMask: 255 + - _StencilRef: 0 + - _StencilWriteMask: 255 + - _StencilZFail: 0 + - _StraWidt: 10 + - _SubpassCutoff: 0.5 + - _TEXMCOLINT: 1 + - _TRANSMODE: 0 + - _TessEdge: 10 + - _TessFactorMax: 3 + - _TessShrink: 0 + - _TessStrength: 0.5 + - _TessellationFar: 1 + - _TessellationNear: 1 + - _TessellationSmoothness: 0.5 + - _TessellationTransition: 0.8 + - _TexturePatternStyle: 0 + - _TrailSize: 1.5 + - _TransAffSha: 1 + - _TransparentMode: 0 + - _TransparentThreshold: 0 + - _TriPlaBlend: 4 + - _TriPlaTile: 1 + - _UDIMDiscardCompile: 0 + - _UDIMDiscardMode: 0 + - _UDIMDiscardRow0_0: 0 + - _UDIMDiscardRow0_1: 0 + - _UDIMDiscardRow0_2: 0 + - _UDIMDiscardRow0_3: 0 + - _UDIMDiscardRow1_0: 0 + - _UDIMDiscardRow1_1: 0 + - _UDIMDiscardRow1_2: 0 + - _UDIMDiscardRow1_3: 0 + - _UDIMDiscardRow2_0: 0 + - _UDIMDiscardRow2_1: 0 + - _UDIMDiscardRow2_2: 0 + - _UDIMDiscardRow2_3: 0 + - _UDIMDiscardRow3_0: 0 + - _UDIMDiscardRow3_1: 0 + - _UDIMDiscardRow3_2: 0 + - _UDIMDiscardRow3_3: 0 + - _UDIMDiscardUV: 0 + - _UVSet: 0 + - _UseAnisotropy: 0 + - _UseAudioLink: 0 + - _UseBacklight: 1 + - _UseBump2ndMap: 0 + - _UseBumpMap: 0 + - _UseClippingCanceller: 0 + - _UseDither: 0 + - _UseEmission: 0 + - _UseEmission2nd: 0 + - _UseGlitter: 0 + - _UseMain2ndTex: 0 + - _UseMain3rdTex: 0 + - _UseMatCap: 0 + - _UseMatCap2nd: 0 + - _UseOutline: 0 + - _UsePOM: 0 + - _UseParallax: 0 + - _UseReflection: 0 + - _UseRim: 1 + - _UseRimShade: 0 + - _UseSecondaryCutout: 0 + - _UseShadow: 1 + - _UseTLB: 0 + - _VertexColorBlueAffectOutlineWitdh: 0 + - _VertexColorGreenControlSelfShadowThreshold: 0 + - _VertexColorRedControlSmoothObjectNormal: 0 + - _VertexLightStrength: 0 + - _ZClip: 1 + - _ZTest: 4 + - _ZWrite: 1 + - _e2gai: 2 + - _e2gci: 2 + - _egai: 2 + - _egci: 2 + - _lilDirectionalLightStrength: 1 + - _lilShadowCasterBias: 0 + - _lilToonVersion: 42 + m_Colors: + - _AudioLinkDefaultValue: {r: 0, g: 0, b: 2, a: 0.75} + - _AudioLinkLocalMapParams: {r: 120, g: 1, b: 0, a: 0} + - _AudioLinkMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _AudioLinkStart: {r: 0, g: 0, b: 0, a: 0} + - _AudioLinkUVParams: {r: 0.25, g: 0, b: 0, a: 0.125} + - _AudioLinkVertexStart: {r: 0, g: 0, b: 0, a: 0} + - _AudioLinkVertexStrength: {r: 0, g: 0, b: 0, a: 1} + - _AudioLinkVertexUVParams: {r: 0.25, g: 0, b: 0, a: 0.125} + - _BackfaceColor: {r: 0, g: 0, b: 0, a: 0} + - _BacklightColor: {r: 0.85, g: 0.8, b: 0.7, a: 1} + - _BaseColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Color2nd: {r: 1, g: 1, b: 1, a: 1} + - _Color3rd: {r: 1, g: 1, b: 1, a: 1} + - _CustomLightDirection: {r: 0, g: 0, b: 10, a: 0} + - _DissolveColor: {r: 1, g: 1, b: 1, a: 1} + - _DissolveNoiseMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _DissolveParams: {r: 0, g: 0, b: 0.5, a: 0.1} + - _DissolvePos: {r: 0, g: 0, b: 0, a: 0} + - _DistanceFade: {r: 0.1, g: 0.01, b: 0, a: 0} + - _DistanceFadeColor: {r: 0, g: 0, b: 0, a: 1} + - _DistanceFadeRimColor: {r: 0, g: 0, b: 0, a: 0} + - _Emission2ndBlendMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _Emission2ndBlink: {r: 0, g: 0, b: 3.141593, a: 0} + - _Emission2ndColor: {r: 1, g: 1, b: 1, a: 1} + - _Emission2ndMap_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _EmissionBlendMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _EmissionBlink: {r: 0, g: 0, b: 3.141593, a: 0} + - _EmissionColor: {r: 1, g: 1, b: 1, a: 1} + - _EmissionMap_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _GlitterAtras: {r: 1, g: 1, b: 0, a: 0} + - _GlitterColor: {r: 1, g: 1, b: 1, a: 1} + - _GlitterParams1: {r: 256, g: 256, b: 0.16, a: 50} + - _GlitterParams2: {r: 0.25, g: 0, b: 0, a: 0} + - _GlossColor: {r: 1, g: 1, b: 1, a: 1} + - _Glow_Color: {r: 1, g: 1, b: 1, a: 1} + - _HighlightColor: {r: 0, g: 0.02643156, b: 1, a: 1} + - _Keys: {r: 0, g: 0, b: 0, a: 0} + - _LightDirectionOverride: {r: 0.001, g: 0.002, b: 0.001, a: 0} + - _Main2ndDissolveColor: {r: 1, g: 1, b: 1, a: 1} + - _Main2ndDissolveNoiseMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _Main2ndDissolveParams: {r: 0, g: 0, b: 0.5, a: 0.1} + - _Main2ndDissolvePos: {r: 0, g: 0, b: 0, a: 0} + - _Main2ndDistanceFade: {r: 0.1, g: 0.01, b: 0, a: 0} + - _Main2ndTexDecalAnimation: {r: 1, g: 1, b: 1, a: 30} + - _Main2ndTexDecalSubParam: {r: 1, g: 1, b: 0, a: 1} + - _Main2ndTex_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _Main3rdDissolveColor: {r: 1, g: 1, b: 1, a: 1} + - _Main3rdDissolveNoiseMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _Main3rdDissolveParams: {r: 0, g: 0, b: 0.5, a: 0.1} + - _Main3rdDissolvePos: {r: 0, g: 0, b: 0, a: 0} + - _Main3rdDistanceFade: {r: 0.1, g: 0.01, b: 0, a: 0} + - _Main3rdTexDecalAnimation: {r: 1, g: 1, b: 1, a: 30} + - _Main3rdTexDecalSubParam: {r: 1, g: 1, b: 0, a: 1} + - _Main3rdTex_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _MainColor: {r: 1, g: 1, b: 1, a: 1} + - _MainTexHSVG: {r: 0, g: 1, b: 1, a: 1} + - _MainTex_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _MatCap2ndBlendUV1: {r: 0, g: 0, b: 0, a: 0} + - _MatCap2ndColor: {r: 1, g: 1, b: 1, a: 1} + - _MatCapBlendUV1: {r: 0, g: 0, b: 0, a: 0} + - _MatCapColor: {r: 1, g: 1, b: 1, a: 1} + - _ObjPosi: {r: 0, g: 0, b: 0, a: 0} + - _ObjectForward: {r: 0, g: 0, b: 0, a: 0} + - _ObjectRight: {r: 0, g: 0, b: 0, a: 0} + - _OutResi: {r: 1, g: 1, b: 1, a: 1} + - _OutlineColor: {r: 0.5568628, g: 0.48235294, b: 0.5137255, a: 1} + - _OutlineLitColor: {r: 1, g: 0.28235295, b: 0, a: 0} + - _OutlineOffset: {r: 0, g: 0, b: 0, a: 1} + - _OutlineTexHSVG: {r: 0, g: 1, b: 1, a: 2} + - _OutlineTex_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _OverallShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _PTCol: {r: 0, g: 0, b: 0, a: 1} + - _PrevPosition: {r: 0, g: 0, b: 0, a: 0} + - _ReflectionColor: {r: 1, g: 1, b: 1, a: 1} + - _ReflectionCubeColor: {r: 0, g: 0, b: 0, a: 1} + - _RimColor: {r: 0.34509623, g: 0.32548836, b: 0.39607662, a: 0.2} + - _RimIndirColor: {r: 0, g: 0, b: 0, a: 1} + - _RimLigPosi: {r: 1, g: 1, b: 1, a: 1} + - _RimLightColor: {r: 1, g: 1, b: 1, a: 1} + - _RimShadeColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + - _SSAOColor: {r: 0, g: 0, b: 0, a: 0} + - _SelfLitColor: {r: 1, g: 1, b: 1, a: 1} + - _SelfShadowRealTimeShadowColor: {r: 1, g: 1, b: 1, a: 1} + - _Shadow2ndColor: {r: 0.4509804, g: 0.528278, b: 0.6509804, a: 1} + - _Shadow3rdColor: {r: 0, g: 0, b: 0, a: 0} + - _ShadowAOShift: {r: 1, g: 0, b: 1, a: 0} + - _ShadowAOShift2: {r: 1, g: 0, b: 1, a: 0} + - _ShadowBorderColor: {r: 0.18039216, g: 0.15294118, b: 0.15294118, a: 1} + - _ShadowColor: {r: 0.58708614, g: 0.6017861, b: 0.745283, a: 1} + - _ShadowTColor: {r: 1, g: 1, b: 1, a: 1} + - _XYZPosition: {r: 0, g: 0, b: 0, a: 0} + - _e2ga0: {r: 1, g: 0, b: 0, a: 0} + - _e2ga1: {r: 1, g: 0, b: 0, a: 1} + - _e2ga2: {r: 1, g: 0, b: 0, a: 0} + - _e2ga3: {r: 1, g: 0, b: 0, a: 0} + - _e2ga4: {r: 1, g: 0, b: 0, a: 0} + - _e2ga5: {r: 1, g: 0, b: 0, a: 0} + - _e2ga6: {r: 1, g: 0, b: 0, a: 0} + - _e2ga7: {r: 1, g: 0, b: 0, a: 0} + - _e2gc0: {r: 1, g: 1, b: 1, a: 0} + - _e2gc1: {r: 1, g: 1, b: 1, a: 1} + - _e2gc2: {r: 1, g: 1, b: 1, a: 0} + - _e2gc3: {r: 1, g: 1, b: 1, a: 0} + - _e2gc4: {r: 1, g: 1, b: 1, a: 0} + - _e2gc5: {r: 1, g: 1, b: 1, a: 0} + - _e2gc6: {r: 1, g: 1, b: 1, a: 0} + - _e2gc7: {r: 1, g: 1, b: 1, a: 0} + - _ega0: {r: 1, g: 0, b: 0, a: 0} + - _ega1: {r: 1, g: 0, b: 0, a: 1} + - _ega2: {r: 1, g: 0, b: 0, a: 0} + - _ega3: {r: 1, g: 0, b: 0, a: 0} + - _ega4: {r: 1, g: 0, b: 0, a: 0} + - _ega5: {r: 1, g: 0, b: 0, a: 0} + - _ega6: {r: 1, g: 0, b: 0, a: 0} + - _ega7: {r: 1, g: 0, b: 0, a: 0} + - _egc0: {r: 1, g: 1, b: 1, a: 0} + - _egc1: {r: 1, g: 1, b: 1, a: 1} + - _egc2: {r: 1, g: 1, b: 1, a: 0} + - _egc3: {r: 1, g: 1, b: 1, a: 0} + - _egc4: {r: 1, g: 1, b: 1, a: 0} + - _egc5: {r: 1, g: 1, b: 1, a: 0} + - _egc6: {r: 1, g: 1, b: 1, a: 0} + - _egc7: {r: 1, g: 1, b: 1, a: 0} + m_BuildTextureStacks: [] + m_AllowLocking: 1 diff --git a/Assets/04_Models/Characters/Fariy/Materials/Cloth/Alistia_Cloth_1_Blue.mat.meta b/Assets/04_Models/Characters/Fariy/Materials/Cloth/Alistia_Cloth_1_Blue.mat.meta new file mode 100644 index 00000000..25cef9ea --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Materials/Cloth/Alistia_Cloth_1_Blue.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bcbfd5c6863e38343b245e267d25bc9a +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/04_Models/Characters/Fariy/Materials/Cloth/Alistia_Cloth_1_Blue_Lace.mat b/Assets/04_Models/Characters/Fariy/Materials/Cloth/Alistia_Cloth_1_Blue_Lace.mat new file mode 100644 index 00000000..37411fbf --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Materials/Cloth/Alistia_Cloth_1_Blue_Lace.mat @@ -0,0 +1,1028 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Alistia_Cloth_1_Blue_Lace + m_Shader: {fileID: 4800000, guid: 6459b2db96a08ca41b0f9b39dc7ad59e, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: + - N_F_DDMD_ON + - N_F_EAL_ON + - N_F_O_ON + - N_F_RDC_ON + - N_F_RELGI_ON + - N_F_SS_ON + - N_F_TRANSAFFSHA_ON + - N_F_TRANS_ON + - _UVSET_UV0 + m_InvalidKeywords: [] + m_LightmapFlags: 0 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 3000 + stringTagMap: + RenderType: Transparent + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AnisotropyScaleMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AnisotropyShiftNoiseMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AnisotropyTangentMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AudioLinkLocalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AudioLinkMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BacklightColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BaseColorMap: + m_Texture: {fileID: 2800000, guid: 083e7f8c110fa364c817bb3c34f9fdeb, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BaseMap: + m_Texture: {fileID: 2800000, guid: 083e7f8c110fa364c817bb3c34f9fdeb, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Bump2ndMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Bump2ndScaleMask: + m_Texture: {fileID: 0} + 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} + - _DissolveMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DissolveNoiseMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DitherTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Emission2ndBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Emission2ndGradTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Emission2ndMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionGradTex: + 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} + - _FReflection: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlitterColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlitterShapeTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlossTexture: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MCap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MCapMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main2ndBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main2ndDissolveMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main2ndDissolveNoiseMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main2ndTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main3rdBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main3rdDissolveMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main3rdDissolveNoiseMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main3rdTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainColorAdjustMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainGradationTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 083e7f8c110fa364c817bb3c34f9fdeb, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MaskGloss: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MaskReflection: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MaskSelfLit: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MaskTransparency: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCap2ndBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCap2ndBumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCap2ndTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCapBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCapBumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCapTex: + 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} + - _NormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 083e7f8c110fa364c817bb3c34f9fdeb, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineVectorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineWidthControl: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineWidthMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _PTexture: + 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} + - _ReflectionColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ReflectionCubeTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _RimColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _RimShadeMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SecondaryCutout: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Shadow2ndColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Shadow3rdColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowBlurMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowBorderMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowColorTexture: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowStrengthMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowT: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SmoothnessTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _AAS: 0.0001 + - _AAStrength: 1 + - _AlpToCov: 0 + - _AlphaBaseCutout: 1 + - _AlphaBoostFA: 10 + - _AlphaMaskMode: 0 + - _AlphaMaskScale: 1 + - _AlphaMaskValue: 0.03 + - _AlphaToMask: 0 + - _Anisotropy2MatCap: 0 + - _Anisotropy2MatCap2nd: 0 + - _Anisotropy2Reflection: 0 + - _Anisotropy2ndBitangentWidth: 1 + - _Anisotropy2ndShift: 0 + - _Anisotropy2ndShiftNoiseScale: 0 + - _Anisotropy2ndSpecularStrength: 0 + - _Anisotropy2ndTangentWidth: 1 + - _AnisotropyBitangentWidth: 1 + - _AnisotropyScale: 1 + - _AnisotropyShift: 0 + - _AnisotropyShiftNoiseScale: 0 + - _AnisotropySpecularStrength: 1 + - _AnisotropyTangentWidth: 1 + - _ApplyReflection: 0 + - _ApplySpecular: 1 + - _ApplySpecularFA: 1 + - _AsOverlay: 0 + - _AsUnlit: 0 + - _AudioLink2Emission: 0 + - _AudioLink2Emission2nd: 0 + - _AudioLink2Emission2ndGrad: 0 + - _AudioLink2EmissionGrad: 0 + - _AudioLink2Main2nd: 0 + - _AudioLink2Main3rd: 0 + - _AudioLink2Vertex: 0 + - _AudioLinkAsLocal: 0 + - _AudioLinkMask_UVMode: 0 + - _AudioLinkUVMode: 1 + - _AudioLinkVertexUVMode: 1 + - _BackfaceForceShadow: 0 + - _BacklightBackfaceMask: 1 + - _BacklightBlur: 0.05 + - _BacklightBorder: 0.35 + - _BacklightDirectivity: 5 + - _BacklightMainStrength: 0 + - _BacklightNormalStrength: 1 + - _BacklightReceiveShadow: 1 + - _BacklightViewStrength: 1 + - _BeforeExposureLimit: 10000 + - _BitKey0: 0 + - _BitKey1: 0 + - _BitKey10: 0 + - _BitKey11: 0 + - _BitKey12: 0 + - _BitKey13: 0 + - _BitKey14: 0 + - _BitKey15: 0 + - _BitKey16: 0 + - _BitKey17: 0 + - _BitKey18: 0 + - _BitKey19: 0 + - _BitKey2: 0 + - _BitKey20: 0 + - _BitKey21: 0 + - _BitKey22: 0 + - _BitKey23: 0 + - _BitKey24: 0 + - _BitKey25: 0 + - _BitKey26: 0 + - _BitKey27: 0 + - _BitKey28: 0 + - _BitKey29: 0 + - _BitKey3: 0 + - _BitKey30: 0 + - _BitKey31: 0 + - _BitKey4: 0 + - _BitKey5: 0 + - _BitKey6: 0 + - _BitKey7: 0 + - _BitKey8: 0 + - _BitKey9: 0 + - _BleModDest: 10 + - _BleModSour: 5 + - _BlendOp: 0 + - _BlendOpAlpha: 0 + - _BlendOpAlphaFA: 4 + - _BlendOpFA: 4 + - _Bump2ndMap_UVMode: 0 + - _Bump2ndScale: 1 + - _BumpScale: 1 + - _ClipAdju: 0 + - _ColorMask: 15 + - _Compa: 4 + - _ComputeMeshIndex: 0 + - _Cull: 0 + - _Culling: 2 + - _CustomLightDirectionFollowObjectRotation: 0 + - _CustomLightDirectionIntensity: 0 + - _Cutoff: 0 + - _Cutout: 0.5 + - _DepthThreshold: 900 + - _DirectionalLightIntensity: 1 + - _DissolveNoiseStrength: 0.1 + - _DistanceFadeMode: 0 + - _DistanceFadeRimFresnelPower: 5 + - _DitherMaxValue: 255 + - _DoubleSidedOutline: 1 + - _DstBlend: 10 + - _DstBlendAlpha: 10 + - _DstBlendAlphaFA: 1 + - _DstBlendFA: 1 + - _DummyProperty: 0 + - _DynamicNoisyOutline: 0 + - _Emission2ndBlend: 1 + - _Emission2ndBlendMode: 1 + - _Emission2ndFluorescence: 0 + - _Emission2ndGradSpeed: 1 + - _Emission2ndMainStrength: 0 + - _Emission2ndMap_UVMode: 0 + - _Emission2ndParallaxDepth: 0 + - _Emission2ndUseGrad: 0 + - _EmissionBlend: 1 + - _EmissionBlendMode: 1 + - _EmissionFluorescence: 0 + - _EmissionGradSpeed: 1 + - _EmissionMainStrength: 0 + - _EmissionMap_UVMode: 0 + - _EmissionParallaxDepth: 0 + - _EmissionUseGrad: 0 + - _EnvironmentalLightingIntensity: 1 + - _FarDistanceMaxWidth: 10 + - _FlipNormal: 0 + - _GIFlatShade: 0 + - _GIShadeThreshold: 0 + - _GSAAStrength: 0 + - _GlitterAngleRandomize: 0 + - _GlitterApplyShape: 0 + - _GlitterApplyTransparency: 1 + - _GlitterBackfaceMask: 0 + - _GlitterColorTex_UVMode: 0 + - _GlitterEnableLighting: 1 + - _GlitterMainStrength: 0 + - _GlitterNormalStrength: 1 + - _GlitterPostContrast: 1 + - _GlitterScaleRandomize: 0 + - _GlitterSensitivity: 0.25 + - _GlitterShadowMask: 0 + - _GlitterUVMode: 0 + - _GlitterVRParallaxStrength: 0 + - _GlossColorPower: 10 + - _GlossIntensity: 1 + - _GlossSoftness: 0 + - _GlossTextureFollowLight: 0 + - _GlossTextureFollowObjectRotation: 0 + - _GlossTextureRotate: 0 + - _GlossTextureSoftness: 0 + - _Glossiness: 0.6 + - _Glow_Edge_Width: 1 + - _HighlightColorPower: 5 + - _IDMask1: 0 + - _IDMask2: 0 + - _IDMask3: 0 + - _IDMask4: 0 + - _IDMask5: 0 + - _IDMask6: 0 + - _IDMask7: 0 + - _IDMask8: 0 + - _IDMaskCompile: 0 + - _IDMaskControlsDissolve: 0 + - _IDMaskFrom: 8 + - _IDMaskIndex1: 0 + - _IDMaskIndex2: 0 + - _IDMaskIndex3: 0 + - _IDMaskIndex4: 0 + - _IDMaskIndex5: 0 + - _IDMaskIndex6: 0 + - _IDMaskIndex7: 0 + - _IDMaskIndex8: 0 + - _IDMaskIsBitmap: 0 + - _IDMaskPrior1: 0 + - _IDMaskPrior2: 0 + - _IDMaskPrior3: 0 + - _IDMaskPrior4: 0 + - _IDMaskPrior5: 0 + - _IDMaskPrior6: 0 + - _IDMaskPrior7: 0 + - _IDMaskPrior8: 0 + - _IgnoreEncryption: 0 + - _Invisible: 0 + - _LLI_Max: 1 + - _LLI_Min: 0 + - _LigIgnoYNorDir: 0 + - _LightAffectOutlineColor: 0 + - _LightAffectRimLightColor: 0 + - _LightAffectShadow: 0 + - _LightFalloffAffectShadowT: 0 + - _LightFalloffSoftness: 1 + - _LightIntensity: 1 + - _LightMaxLimit: 1 + - _LightMinLimit: 0.05 + - _MCIALO: 0 + - _MCapIntensity: 1 + - _MVCOL: 0 + - _MaiColPo: 0.8 + - _Main2ndDissolveNoiseStrength: 0.1 + - _Main2ndEnableLighting: 1 + - _Main2ndTexAlphaMode: 0 + - _Main2ndTexAngle: 0 + - _Main2ndTexBlendMode: 0 + - _Main2ndTexIsDecal: 0 + - _Main2ndTexIsLeftOnly: 0 + - _Main2ndTexIsMSDF: 0 + - _Main2ndTexIsRightOnly: 0 + - _Main2ndTexShouldCopy: 0 + - _Main2ndTexShouldFlipCopy: 0 + - _Main2ndTexShouldFlipMirror: 0 + - _Main2ndTex_Cull: 0 + - _Main2ndTex_UVMode: 0 + - _Main3rdDissolveNoiseStrength: 0.1 + - _Main3rdEnableLighting: 1 + - _Main3rdTexAlphaMode: 0 + - _Main3rdTexAngle: 0 + - _Main3rdTexBlendMode: 0 + - _Main3rdTexIsDecal: 0 + - _Main3rdTexIsLeftOnly: 0 + - _Main3rdTexIsMSDF: 0 + - _Main3rdTexIsRightOnly: 0 + - _Main3rdTexShouldCopy: 0 + - _Main3rdTexShouldFlipCopy: 0 + - _Main3rdTexShouldFlipMirror: 0 + - _Main3rdTex_Cull: 0 + - _Main3rdTex_UVMode: 0 + - _MainGradationStrength: 0 + - _MatCap2ndApplyTransparency: 1 + - _MatCap2ndBackfaceMask: 0 + - _MatCap2ndBlend: 1 + - _MatCap2ndBlendMode: 1 + - _MatCap2ndBumpScale: 1 + - _MatCap2ndCustomNormal: 0 + - _MatCap2ndEnableLighting: 1 + - _MatCap2ndLod: 0 + - _MatCap2ndMainStrength: 0 + - _MatCap2ndNormalStrength: 1 + - _MatCap2ndPerspective: 1 + - _MatCap2ndShadowMask: 0 + - _MatCap2ndVRParallaxStrength: 1 + - _MatCap2ndZRotCancel: 1 + - _MatCapApplyTransparency: 1 + - _MatCapBackfaceMask: 0 + - _MatCapBlend: 0 + - _MatCapBlendMode: 1 + - _MatCapBumpScale: 1 + - _MatCapCustomNormal: 0 + - _MatCapEnableLighting: 1 + - _MatCapLod: 0 + - _MatCapMainStrength: 0 + - _MatCapNormalStrength: 1 + - _MatCapPerspective: 1 + - _MatCapShadowMask: 0.75 + - _MatCapVRParallaxStrength: 1 + - _MatCapZRotCancel: 1 + - _MaxFadDistance: 2 + - _Metallic: 0 + - _MinFadDistance: 0 + - _MixMainTexToOutline: 0 + - _MonochromeLighting: 0 + - _N_F_ANIS: 0 + - _N_F_CA: 0 + - _N_F_CLD: 0 + - _N_F_CO: 0 + - _N_F_COEDGL: 0 + - _N_F_DCS: 0 + - _N_F_DDMD: 1 + - _N_F_EAL: 1 + - _N_F_ESSAO: 0 + - _N_F_FR: 0 + - _N_F_GLO: 0 + - _N_F_GLOT: 0 + - _N_F_HDLS: 0 + - _N_F_HPSS: 0 + - _N_F_LLI: 0 + - _N_F_MC: 0 + - _N_F_MSSOLTFO: 0 + - _N_F_NFD: 0 + - _N_F_NLASOBF: 0 + - _N_F_NM: 0 + - _N_F_O: 1 + - _N_F_OFLMB: 0 + - _N_F_PA: 0 + - _N_F_PT: 0 + - _N_F_R: 0 + - _N_F_RDC: 1 + - _N_F_RL: 0 + - _N_F_RLIS: 0 + - _N_F_SCO: 0 + - _N_F_SCT: 0 + - _N_F_SE: 0 + - _N_F_SL: 0 + - _N_F_SLMM: 0 + - _N_F_SON: 0 + - _N_F_SS: 1 + - _N_F_ST: 0 + - _N_F_STIAL: 0 + - _N_F_STIS: 0 + - _N_F_STSDFM: 0 + - _N_F_TP: 0 + - _NoiTexAffStraWidt: 0 + - _NoisTexInten: 1 + - _NoiseSize: 100 + - _NoisyOutlineIntensity: 0 + - _NorMapAsDis: 0 + - _NormalMapIntensity: 1 + - _ObjePosiZCS: 0 + - _OffsetFactor: 0 + - _OffsetUnits: 0 + - _Opacity: 1 + - _Oper: 0 + - _OutStenPass: 0 + - _OutZTest: 4 + - _OutZWrite: 1 + - _OutlineAlphaToMask: 0 + - _OutlineBlendOp: 0 + - _OutlineBlendOpAlpha: 0 + - _OutlineBlendOpAlphaFA: 4 + - _OutlineBlendOpFA: 4 + - _OutlineColorMask: 15 + - _OutlineCull: 1 + - _OutlineDeleteMesh: 0 + - _OutlineDisableInVR: 0 + - _OutlineDstBlend: 10 + - _OutlineDstBlendAlpha: 10 + - _OutlineDstBlendAlphaFA: 1 + - _OutlineDstBlendFA: 1 + - _OutlineEnableLighting: 1 + - _OutlineExtrudeMethod: 0 + - _OutlineFixWidth: 0 + - _OutlineLitApplyTex: 0 + - _OutlineLitOffset: -8 + - _OutlineLitScale: 10 + - _OutlineLitShadowReceive: 0 + - _OutlineOffsetFactor: 0 + - _OutlineOffsetUnits: 0 + - _OutlineSrcBlend: 5 + - _OutlineSrcBlendAlpha: 1 + - _OutlineSrcBlendAlphaFA: 0 + - _OutlineSrcBlendFA: 1 + - _OutlineStencilComp: 8 + - _OutlineStencilFail: 0 + - _OutlineStencilPass: 0 + - _OutlineStencilReadMask: 255 + - _OutlineStencilRef: 0 + - _OutlineStencilWriteMask: 255 + - _OutlineStencilZFail: 0 + - _OutlineVectorScale: 1 + - _OutlineVectorUVMode: 0 + - _OutlineVertexR2Width: 0 + - _OutlineWidth: 0.02 + - _OutlineWidthAffectedByViewDistance: 0 + - _OutlineZBias: 0 + - _OutlineZClip: 1 + - _OutlineZPostionInCamera: 0 + - _OutlineZTest: 2 + - _OutlineZWrite: 1 + - _OverallShadowColorPower: 1 + - _PADist: 0 + - _PASize: 0.5 + - _PASmooTrans: 1 + - _PSGLOTEX: 0 + - _PTexturePower: 1 + - _Parallax: 0.02 + - _ParallaxOffset: 0.5 + - _PointSpotlightIntensity: 1 + - _PreAlphaToMask: 0 + - _PreBlendOp: 0 + - _PreBlendOpAlpha: 0 + - _PreBlendOpAlphaFA: 4 + - _PreBlendOpFA: 4 + - _PreColorMask: 15 + - _PreCull: 2 + - _PreCutoff: 0.5 + - _PreDstBlend: 10 + - _PreDstBlendAlpha: 10 + - _PreDstBlendAlphaFA: 1 + - _PreDstBlendFA: 1 + - _PreOffsetFactor: 0 + - _PreOffsetUnits: 0 + - _PreOutType: 0 + - _PreSrcBlend: 1 + - _PreSrcBlendAlpha: 1 + - _PreSrcBlendAlphaFA: 0 + - _PreSrcBlendFA: 1 + - _PreStencilComp: 8 + - _PreStencilFail: 0 + - _PreStencilPass: 0 + - _PreStencilReadMask: 255 + - _PreStencilRef: 0 + - _PreStencilWriteMask: 255 + - _PreStencilZFail: 0 + - _PreZClip: 1 + - _PreZTest: 4 + - _PreZWrite: 1 + - _PresAdju: 1 + - _RELG: 1 + - _RQSO: 0 + - _ReduSha: 0.5 + - _RefMetallic: 0 + - _RefVal: 0 + - _Reflectance: 0.04 + - _ReflectionApplyTransparency: 1 + - _ReflectionBlendMode: 1 + - _ReflectionCubeEnableLighting: 1 + - _ReflectionCubeOverride: 0 + - _ReflectionIntensity: 0 + - _ReflectionNormalStrength: 1 + - _RimApplyTransparency: 1 + - _RimBackfaceMask: 0 + - _RimBlendMode: 1 + - _RimBlur: 0.1 + - _RimBorder: 0.873 + - _RimDirRange: 0 + - _RimDirStrength: 0 + - _RimEnableLighting: 1 + - _RimFresnelPower: 1 + - _RimIndirBlur: 0.1 + - _RimIndirBorder: 0.5 + - _RimIndirRange: 0 + - _RimLigInt: 1 + - _RimLightColorPower: 10 + - _RimLightInLight: 1 + - _RimLightSoftness: 1 + - _RimLightUnfill: 1.5 + - _RimMainStrength: 0 + - _RimNormalStrength: 1 + - _RimShadeBlur: 1 + - _RimShadeBorder: 0.5 + - _RimShadeFresnelPower: 1 + - _RimShadeNormalStrength: 1 + - _RimShadowMask: 1 + - _RimVRParallaxStrength: 1 + - _SPECIN: 1 + - _SPECMODE: 0 + - _STIL: 0 + - _Saturation: 1 + - _SelfLitHighContrast: 1 + - _SelfLitIntensity: 0 + - _SelfLitPower: 2 + - _SelfShadowAffectedByLightShadowStrength: 0 + - _SelfShadowHardness: 1 + - _SelfShadowRealTimeShadowColorPower: 1 + - _SelfShadowRealtimeShadowIntensity: 0 + - _SelfShadowShadowTAtViewDirection: 0 + - _SelfShadowThreshold: 0.93 + - _Shadow2ndBlur: 0.175 + - _Shadow2ndBorder: 0.132 + - _Shadow2ndNormalStrength: 1 + - _Shadow2ndReceive: 0 + - _Shadow3rdBlur: 0.1 + - _Shadow3rdBorder: 0.25 + - _Shadow3rdNormalStrength: 1 + - _Shadow3rdReceive: 0 + - _ShadowBlur: 0.17 + - _ShadowBlurMaskLOD: 0 + - _ShadowBorder: 0.272 + - _ShadowBorderMaskLOD: 0 + - _ShadowBorderRange: 0.015 + - _ShadowColorTexturePower: 0 + - _ShadowColorType: 0 + - _ShadowEnvStrength: 0 + - _ShadowFlatBlur: 1 + - _ShadowFlatBorder: 1 + - _ShadowHardness: 0 + - _ShadowMainStrength: 0 + - _ShadowMaskType: 0 + - _ShadowNormalStrength: 1 + - _ShadowPostAO: 0 + - _ShadowReceive: 1 + - _ShadowStrength: 1 + - _ShadowStrengthMaskLOD: 0 + - _ShadowTColorPower: 1 + - _ShadowTHardness: 1 + - _ShadowTIntensity: 1 + - _ShadowTLightThreshold: 50 + - _ShadowTShadowThreshold: 0 + - _ShifAnis: 0 + - _ShiftBackfaceUV: 0 + - _ShowInAmbientLightShadowIntensity: 1 + - _ShowInAmbientLightShadowThreshold: 0.4 + - _ShowNormal: 0 + - _SimTrans: 0 + - _SkinMatrixIndex: 0 + - _SmoothObjectNormal: 0 + - _Smoothness: 1 + - _SpecularBlur: 0 + - _SpecularBorder: 0.5 + - _SpecularNormalStrength: 1 + - _SpecularToon: 1 + - _SrcBlend: 1 + - _SrcBlendAlpha: 1 + - _SrcBlendAlphaFA: 0 + - _SrcBlendFA: 1 + - _StencilComp: 8 + - _StencilFail: 0 + - _StencilPass: 0 + - _StencilReadMask: 255 + - _StencilRef: 0 + - _StencilWriteMask: 255 + - _StencilZFail: 0 + - _StraWidt: 10 + - _SubpassCutoff: 0.5 + - _TEXMCOLINT: 1 + - _TRANSMODE: 1 + - _TessEdge: 10 + - _TessFactorMax: 3 + - _TessShrink: 0 + - _TessStrength: 0.5 + - _TessellationFar: 1 + - _TessellationNear: 1 + - _TessellationSmoothness: 0.5 + - _TessellationTransition: 0.8 + - _TexturePatternStyle: 0 + - _TrailSize: 1.5 + - _TransAffSha: 1 + - _TransparentMode: 0 + - _TransparentThreshold: 0 + - _TriPlaBlend: 4 + - _TriPlaTile: 1 + - _UDIMDiscardCompile: 0 + - _UDIMDiscardMode: 0 + - _UDIMDiscardRow0_0: 0 + - _UDIMDiscardRow0_1: 0 + - _UDIMDiscardRow0_2: 0 + - _UDIMDiscardRow0_3: 0 + - _UDIMDiscardRow1_0: 0 + - _UDIMDiscardRow1_1: 0 + - _UDIMDiscardRow1_2: 0 + - _UDIMDiscardRow1_3: 0 + - _UDIMDiscardRow2_0: 0 + - _UDIMDiscardRow2_1: 0 + - _UDIMDiscardRow2_2: 0 + - _UDIMDiscardRow2_3: 0 + - _UDIMDiscardRow3_0: 0 + - _UDIMDiscardRow3_1: 0 + - _UDIMDiscardRow3_2: 0 + - _UDIMDiscardRow3_3: 0 + - _UDIMDiscardUV: 0 + - _UVSet: 0 + - _UseAnisotropy: 0 + - _UseAudioLink: 0 + - _UseBacklight: 0 + - _UseBump2ndMap: 0 + - _UseBumpMap: 0 + - _UseClippingCanceller: 0 + - _UseDither: 0 + - _UseEmission: 0 + - _UseEmission2nd: 0 + - _UseGlitter: 0 + - _UseMain2ndTex: 0 + - _UseMain3rdTex: 0 + - _UseMatCap: 0 + - _UseMatCap2nd: 0 + - _UseOutline: 0 + - _UsePOM: 0 + - _UseParallax: 0 + - _UseReflection: 0 + - _UseRim: 0 + - _UseRimShade: 0 + - _UseSecondaryCutout: 0 + - _UseShadow: 1 + - _UseTLB: 0 + - _VertexColorBlueAffectOutlineWitdh: 0 + - _VertexColorGreenControlSelfShadowThreshold: 0 + - _VertexColorRedControlSmoothObjectNormal: 0 + - _VertexLightStrength: 0 + - _ZClip: 1 + - _ZTest: 4 + - _ZWrite: 1 + - _e2gai: 2 + - _e2gci: 2 + - _egai: 2 + - _egci: 2 + - _lilDirectionalLightStrength: 1 + - _lilShadowCasterBias: 0 + - _lilToonVersion: 42 + m_Colors: + - _AudioLinkDefaultValue: {r: 0, g: 0, b: 2, a: 0.75} + - _AudioLinkLocalMapParams: {r: 120, g: 1, b: 0, a: 0} + - _AudioLinkMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _AudioLinkStart: {r: 0, g: 0, b: 0, a: 0} + - _AudioLinkUVParams: {r: 0.25, g: 0, b: 0, a: 0.125} + - _AudioLinkVertexStart: {r: 0, g: 0, b: 0, a: 0} + - _AudioLinkVertexStrength: {r: 0, g: 0, b: 0, a: 1} + - _AudioLinkVertexUVParams: {r: 0.25, g: 0, b: 0, a: 0.125} + - _BackfaceColor: {r: 0, g: 0, b: 0, a: 0} + - _BacklightColor: {r: 0.85, g: 0.8, b: 0.7, a: 1} + - _BaseColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Color2nd: {r: 1, g: 1, b: 1, a: 1} + - _Color3rd: {r: 1, g: 1, b: 1, a: 1} + - _CustomLightDirection: {r: 0, g: 0, b: 10, a: 0} + - _DissolveColor: {r: 1, g: 1, b: 1, a: 1} + - _DissolveNoiseMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _DissolveParams: {r: 0, g: 0, b: 0.5, a: 0.1} + - _DissolvePos: {r: 0, g: 0, b: 0, a: 0} + - _DistanceFade: {r: 0.1, g: 0.01, b: 0, a: 0} + - _DistanceFadeColor: {r: 0, g: 0, b: 0, a: 1} + - _DistanceFadeRimColor: {r: 0, g: 0, b: 0, a: 0} + - _Emission2ndBlendMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _Emission2ndBlink: {r: 0, g: 0, b: 3.141593, a: 0} + - _Emission2ndColor: {r: 1, g: 1, b: 1, a: 1} + - _Emission2ndMap_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _EmissionBlendMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _EmissionBlink: {r: 0, g: 0, b: 3.141593, a: 0} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _EmissionMap_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _GlitterAtras: {r: 1, g: 1, b: 0, a: 0} + - _GlitterColor: {r: 1, g: 1, b: 1, a: 1} + - _GlitterParams1: {r: 256, g: 256, b: 0.16, a: 50} + - _GlitterParams2: {r: 0.25, g: 0, b: 0, a: 0} + - _GlossColor: {r: 1, g: 1, b: 1, a: 1} + - _Glow_Color: {r: 1, g: 1, b: 1, a: 1} + - _HighlightColor: {r: 0, g: 0.022338867, b: 1, a: 1} + - _Keys: {r: 0, g: 0, b: 0, a: 0} + - _LightDirectionOverride: {r: 0.001, g: 0.002, b: 0.001, a: 0} + - _Main2ndDissolveColor: {r: 1, g: 1, b: 1, a: 1} + - _Main2ndDissolveNoiseMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _Main2ndDissolveParams: {r: 0, g: 0, b: 0.5, a: 0.1} + - _Main2ndDissolvePos: {r: 0, g: 0, b: 0, a: 0} + - _Main2ndDistanceFade: {r: 0.1, g: 0.01, b: 0, a: 0} + - _Main2ndTexDecalAnimation: {r: 1, g: 1, b: 1, a: 30} + - _Main2ndTexDecalSubParam: {r: 1, g: 1, b: 0, a: 1} + - _Main2ndTex_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _Main3rdDissolveColor: {r: 1, g: 1, b: 1, a: 1} + - _Main3rdDissolveNoiseMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _Main3rdDissolveParams: {r: 0, g: 0, b: 0.5, a: 0.1} + - _Main3rdDissolvePos: {r: 0, g: 0, b: 0, a: 0} + - _Main3rdDistanceFade: {r: 0.1, g: 0.01, b: 0, a: 0} + - _Main3rdTexDecalAnimation: {r: 1, g: 1, b: 1, a: 30} + - _Main3rdTexDecalSubParam: {r: 1, g: 1, b: 0, a: 1} + - _Main3rdTex_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _MainColor: {r: 1, g: 1, b: 1, a: 1} + - _MainTexHSVG: {r: 0, g: 1, b: 1, a: 1} + - _MainTex_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _MatCap2ndBlendUV1: {r: 0, g: 0, b: 0, a: 0} + - _MatCap2ndColor: {r: 1, g: 1, b: 1, a: 1} + - _MatCapBlendUV1: {r: 0, g: 0, b: 0, a: 0} + - _MatCapColor: {r: 1, g: 1, b: 1, a: 0.7} + - _ObjPosi: {r: 0, g: 0, b: 0, a: 0} + - _ObjectForward: {r: 0, g: 0, b: 0, a: 0} + - _ObjectRight: {r: 0, g: 0, b: 0, a: 0} + - _OutResi: {r: 1, g: 1, b: 1, a: 1} + - _OutlineColor: {r: 0.7276166, g: 0.73921245, b: 0.7830189, a: 1} + - _OutlineLitColor: {r: 1, g: 0.19999996, b: 0, a: 0} + - _OutlineOffset: {r: 0, g: 0, b: 0, a: 1} + - _OutlineTexHSVG: {r: 0, g: 1, b: 1, a: 1} + - _OutlineTex_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _OverallShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _PTCol: {r: 0, g: 0, b: 0, a: 1} + - _PreColor: {r: 1, g: 1, b: 1, a: 1} + - _PrevPosition: {r: 0, g: 0, b: 0, a: 0} + - _ReflectionColor: {r: 1, g: 1, b: 1, a: 1} + - _ReflectionCubeColor: {r: 0, g: 0, b: 0, a: 1} + - _RimColor: {r: 0.5, g: 0.46249998, b: 0.42499956, a: 0.262} + - _RimIndirColor: {r: 1, g: 1, b: 1, a: 1} + - _RimLigPosi: {r: 1, g: 1, b: 1, a: 1} + - _RimLightColor: {r: 1, g: 1, b: 1, a: 1} + - _RimShadeColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + - _SSAOColor: {r: 0, g: 0, b: 0, a: 0} + - _SelfLitColor: {r: 1, g: 1, b: 1, a: 1} + - _SelfShadowRealTimeShadowColor: {r: 1, g: 1, b: 1, a: 1} + - _Shadow2ndColor: {r: 0.85882354, g: 0.87771285, b: 0.9137255, a: 1} + - _Shadow3rdColor: {r: 0, g: 0, b: 0, a: 0} + - _ShadowAOShift: {r: 1, g: 0, b: 1, a: 0} + - _ShadowAOShift2: {r: 1, g: 0, b: 1, a: 0} + - _ShadowBorderColor: {r: 0.8666667, g: 0.8901961, b: 0.9137255, a: 1} + - _ShadowColor: {r: 0.8666667, g: 0.888508, b: 0.9137255, a: 1} + - _ShadowTColor: {r: 1, g: 1, b: 1, a: 1} + - _XYZPosition: {r: 0, g: 0, b: 0, a: 0} + - _e2ga0: {r: 1, g: 0, b: 0, a: 0} + - _e2ga1: {r: 1, g: 0, b: 0, a: 1} + - _e2ga2: {r: 1, g: 0, b: 0, a: 0} + - _e2ga3: {r: 1, g: 0, b: 0, a: 0} + - _e2ga4: {r: 1, g: 0, b: 0, a: 0} + - _e2ga5: {r: 1, g: 0, b: 0, a: 0} + - _e2ga6: {r: 1, g: 0, b: 0, a: 0} + - _e2ga7: {r: 1, g: 0, b: 0, a: 0} + - _e2gc0: {r: 1, g: 1, b: 1, a: 0} + - _e2gc1: {r: 1, g: 1, b: 1, a: 1} + - _e2gc2: {r: 1, g: 1, b: 1, a: 0} + - _e2gc3: {r: 1, g: 1, b: 1, a: 0} + - _e2gc4: {r: 1, g: 1, b: 1, a: 0} + - _e2gc5: {r: 1, g: 1, b: 1, a: 0} + - _e2gc6: {r: 1, g: 1, b: 1, a: 0} + - _e2gc7: {r: 1, g: 1, b: 1, a: 0} + - _ega0: {r: 1, g: 0, b: 0, a: 0} + - _ega1: {r: 1, g: 0, b: 0, a: 1} + - _ega2: {r: 1, g: 0, b: 0, a: 0} + - _ega3: {r: 1, g: 0, b: 0, a: 0} + - _ega4: {r: 1, g: 0, b: 0, a: 0} + - _ega5: {r: 1, g: 0, b: 0, a: 0} + - _ega6: {r: 1, g: 0, b: 0, a: 0} + - _ega7: {r: 1, g: 0, b: 0, a: 0} + - _egc0: {r: 1, g: 1, b: 1, a: 0} + - _egc1: {r: 1, g: 1, b: 1, a: 1} + - _egc2: {r: 1, g: 1, b: 1, a: 0} + - _egc3: {r: 1, g: 1, b: 1, a: 0} + - _egc4: {r: 1, g: 1, b: 1, a: 0} + - _egc5: {r: 1, g: 1, b: 1, a: 0} + - _egc6: {r: 1, g: 1, b: 1, a: 0} + - _egc7: {r: 1, g: 1, b: 1, a: 0} + m_BuildTextureStacks: [] + m_AllowLocking: 1 diff --git a/Assets/04_Models/Characters/Fariy/Materials/Cloth/Alistia_Cloth_1_Blue_Lace.mat.meta b/Assets/04_Models/Characters/Fariy/Materials/Cloth/Alistia_Cloth_1_Blue_Lace.mat.meta new file mode 100644 index 00000000..b9772bf5 --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Materials/Cloth/Alistia_Cloth_1_Blue_Lace.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ec6935d242801ba45a50c57594f80846 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/04_Models/Characters/Fariy/Materials/Cloth/Alistia_Cloth_2_Lace.mat b/Assets/04_Models/Characters/Fariy/Materials/Cloth/Alistia_Cloth_2_Lace.mat new file mode 100644 index 00000000..fb37c1bd --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Materials/Cloth/Alistia_Cloth_2_Lace.mat @@ -0,0 +1,1026 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Alistia_Cloth_2_Lace + m_Shader: {fileID: 4800000, guid: 6459b2db96a08ca41b0f9b39dc7ad59e, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: + - N_F_DDMD_ON + - N_F_EAL_ON + - N_F_O_ON + - N_F_RDC_ON + - N_F_RELGI_ON + - N_F_SS_ON + - N_F_TRANSAFFSHA_ON + - _UVSET_UV0 + m_InvalidKeywords: [] + m_LightmapFlags: 0 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AnisotropyScaleMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AnisotropyShiftNoiseMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AnisotropyTangentMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AudioLinkLocalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AudioLinkMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BacklightColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BaseColorMap: + m_Texture: {fileID: 2800000, guid: 093a9db6b1fee594380cc05560ae5e8a, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BaseMap: + m_Texture: {fileID: 2800000, guid: 093a9db6b1fee594380cc05560ae5e8a, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Bump2ndMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Bump2ndScaleMask: + m_Texture: {fileID: 0} + 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} + - _DissolveMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DissolveNoiseMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DitherTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Emission2ndBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Emission2ndGradTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Emission2ndMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionGradTex: + 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} + - _FReflection: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlitterColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlitterShapeTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlossTexture: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MCap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MCapMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main2ndBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main2ndDissolveMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main2ndDissolveNoiseMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main2ndTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main3rdBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main3rdDissolveMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main3rdDissolveNoiseMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main3rdTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainColorAdjustMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainGradationTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 093a9db6b1fee594380cc05560ae5e8a, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MaskGloss: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MaskReflection: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MaskSelfLit: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MaskTransparency: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCap2ndBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCap2ndBumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCap2ndTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCapBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCapBumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCapTex: + 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} + - _NormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 2800000, guid: 093a9db6b1fee594380cc05560ae5e8a, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineVectorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineWidthControl: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineWidthMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _PTexture: + 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} + - _ReflectionColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ReflectionCubeTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _RimColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _RimShadeMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SecondaryCutout: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Shadow2ndColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Shadow3rdColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowBlurMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowBorderMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowColorTexture: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowStrengthMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowT: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SmoothnessTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _AAS: 0.0001 + - _AAStrength: 1 + - _AlpToCov: 0 + - _AlphaBaseCutout: 1 + - _AlphaBoostFA: 10 + - _AlphaMaskMode: 0 + - _AlphaMaskScale: 1 + - _AlphaMaskValue: 0 + - _AlphaToMask: 0 + - _Anisotropy2MatCap: 0 + - _Anisotropy2MatCap2nd: 0 + - _Anisotropy2Reflection: 0 + - _Anisotropy2ndBitangentWidth: 1 + - _Anisotropy2ndShift: 0 + - _Anisotropy2ndShiftNoiseScale: 0 + - _Anisotropy2ndSpecularStrength: 0 + - _Anisotropy2ndTangentWidth: 1 + - _AnisotropyBitangentWidth: 1 + - _AnisotropyScale: 1 + - _AnisotropyShift: 0 + - _AnisotropyShiftNoiseScale: 0 + - _AnisotropySpecularStrength: 1 + - _AnisotropyTangentWidth: 1 + - _ApplyReflection: 0 + - _ApplySpecular: 1 + - _ApplySpecularFA: 1 + - _AsOverlay: 0 + - _AsUnlit: 0 + - _AudioLink2Emission: 0 + - _AudioLink2Emission2nd: 0 + - _AudioLink2Emission2ndGrad: 0 + - _AudioLink2EmissionGrad: 0 + - _AudioLink2Main2nd: 0 + - _AudioLink2Main3rd: 0 + - _AudioLink2Vertex: 0 + - _AudioLinkAsLocal: 0 + - _AudioLinkMask_UVMode: 0 + - _AudioLinkUVMode: 1 + - _AudioLinkVertexUVMode: 1 + - _BackfaceForceShadow: 0 + - _BacklightBackfaceMask: 1 + - _BacklightBlur: 0.05 + - _BacklightBorder: 0.35 + - _BacklightDirectivity: 5 + - _BacklightMainStrength: 0 + - _BacklightNormalStrength: 1 + - _BacklightReceiveShadow: 1 + - _BacklightViewStrength: 1 + - _BeforeExposureLimit: 10000 + - _BitKey0: 0 + - _BitKey1: 0 + - _BitKey10: 0 + - _BitKey11: 0 + - _BitKey12: 0 + - _BitKey13: 0 + - _BitKey14: 0 + - _BitKey15: 0 + - _BitKey16: 0 + - _BitKey17: 0 + - _BitKey18: 0 + - _BitKey19: 0 + - _BitKey2: 0 + - _BitKey20: 0 + - _BitKey21: 0 + - _BitKey22: 0 + - _BitKey23: 0 + - _BitKey24: 0 + - _BitKey25: 0 + - _BitKey26: 0 + - _BitKey27: 0 + - _BitKey28: 0 + - _BitKey29: 0 + - _BitKey3: 0 + - _BitKey30: 0 + - _BitKey31: 0 + - _BitKey4: 0 + - _BitKey5: 0 + - _BitKey6: 0 + - _BitKey7: 0 + - _BitKey8: 0 + - _BitKey9: 0 + - _BleModDest: 0 + - _BleModSour: 1 + - _BlendOp: 0 + - _BlendOpAlpha: 0 + - _BlendOpAlphaFA: 4 + - _BlendOpFA: 4 + - _Bump2ndMap_UVMode: 0 + - _Bump2ndScale: 1 + - _BumpScale: 1 + - _ClipAdju: 0 + - _ColorMask: 15 + - _Compa: 4 + - _ComputeMeshIndex: 0 + - _Cull: 0 + - _Culling: 2 + - _CustomLightDirectionFollowObjectRotation: 0 + - _CustomLightDirectionIntensity: 0 + - _Cutoff: 0.001 + - _Cutout: 0.5 + - _DepthThreshold: 900 + - _DirectionalLightIntensity: 1 + - _DissolveNoiseStrength: 0.1 + - _DistanceFadeMode: 0 + - _DistanceFadeRimFresnelPower: 5 + - _DitherMaxValue: 255 + - _DoubleSidedOutline: 1 + - _DstBlend: 10 + - _DstBlendAlpha: 10 + - _DstBlendAlphaFA: 1 + - _DstBlendFA: 1 + - _DummyProperty: 0 + - _DynamicNoisyOutline: 0 + - _Emission2ndBlend: 1 + - _Emission2ndBlendMode: 1 + - _Emission2ndFluorescence: 0 + - _Emission2ndGradSpeed: 1 + - _Emission2ndMainStrength: 0 + - _Emission2ndMap_UVMode: 0 + - _Emission2ndParallaxDepth: 0 + - _Emission2ndUseGrad: 0 + - _EmissionBlend: 1 + - _EmissionBlendMode: 1 + - _EmissionFluorescence: 0 + - _EmissionGradSpeed: 1 + - _EmissionMainStrength: 0 + - _EmissionMap_UVMode: 0 + - _EmissionParallaxDepth: 0 + - _EmissionUseGrad: 0 + - _EnvironmentalLightingIntensity: 1 + - _FarDistanceMaxWidth: 10 + - _FlipNormal: 0 + - _GIFlatShade: 0 + - _GIShadeThreshold: 0 + - _GSAAStrength: 0 + - _GlitterAngleRandomize: 0 + - _GlitterApplyShape: 0 + - _GlitterApplyTransparency: 1 + - _GlitterBackfaceMask: 0 + - _GlitterColorTex_UVMode: 0 + - _GlitterEnableLighting: 1 + - _GlitterMainStrength: 0 + - _GlitterNormalStrength: 1 + - _GlitterPostContrast: 1 + - _GlitterScaleRandomize: 0 + - _GlitterSensitivity: 0.25 + - _GlitterShadowMask: 0 + - _GlitterUVMode: 0 + - _GlitterVRParallaxStrength: 0 + - _GlossColorPower: 10 + - _GlossIntensity: 1 + - _GlossSoftness: 0 + - _GlossTextureFollowLight: 0 + - _GlossTextureFollowObjectRotation: 0 + - _GlossTextureRotate: 0 + - _GlossTextureSoftness: 0 + - _Glossiness: 0.6 + - _Glow_Edge_Width: 1 + - _HighlightColorPower: 5 + - _IDMask1: 0 + - _IDMask2: 0 + - _IDMask3: 0 + - _IDMask4: 0 + - _IDMask5: 0 + - _IDMask6: 0 + - _IDMask7: 0 + - _IDMask8: 0 + - _IDMaskCompile: 0 + - _IDMaskControlsDissolve: 0 + - _IDMaskFrom: 8 + - _IDMaskIndex1: 0 + - _IDMaskIndex2: 0 + - _IDMaskIndex3: 0 + - _IDMaskIndex4: 0 + - _IDMaskIndex5: 0 + - _IDMaskIndex6: 0 + - _IDMaskIndex7: 0 + - _IDMaskIndex8: 0 + - _IDMaskIsBitmap: 0 + - _IDMaskPrior1: 0 + - _IDMaskPrior2: 0 + - _IDMaskPrior3: 0 + - _IDMaskPrior4: 0 + - _IDMaskPrior5: 0 + - _IDMaskPrior6: 0 + - _IDMaskPrior7: 0 + - _IDMaskPrior8: 0 + - _IgnoreEncryption: 0 + - _Invisible: 0 + - _LLI_Max: 1 + - _LLI_Min: 0 + - _LigIgnoYNorDir: 0 + - _LightAffectOutlineColor: 0 + - _LightAffectRimLightColor: 0 + - _LightAffectShadow: 0 + - _LightFalloffAffectShadowT: 0 + - _LightFalloffSoftness: 1 + - _LightIntensity: 1 + - _LightMaxLimit: 1 + - _LightMinLimit: 0.05 + - _MCIALO: 0 + - _MCapIntensity: 1 + - _MVCOL: 0 + - _MaiColPo: 0.8 + - _Main2ndDissolveNoiseStrength: 0.1 + - _Main2ndEnableLighting: 1 + - _Main2ndTexAlphaMode: 0 + - _Main2ndTexAngle: 0 + - _Main2ndTexBlendMode: 0 + - _Main2ndTexIsDecal: 0 + - _Main2ndTexIsLeftOnly: 0 + - _Main2ndTexIsMSDF: 0 + - _Main2ndTexIsRightOnly: 0 + - _Main2ndTexShouldCopy: 0 + - _Main2ndTexShouldFlipCopy: 0 + - _Main2ndTexShouldFlipMirror: 0 + - _Main2ndTex_Cull: 0 + - _Main2ndTex_UVMode: 0 + - _Main3rdDissolveNoiseStrength: 0.1 + - _Main3rdEnableLighting: 1 + - _Main3rdTexAlphaMode: 0 + - _Main3rdTexAngle: 0 + - _Main3rdTexBlendMode: 0 + - _Main3rdTexIsDecal: 0 + - _Main3rdTexIsLeftOnly: 0 + - _Main3rdTexIsMSDF: 0 + - _Main3rdTexIsRightOnly: 0 + - _Main3rdTexShouldCopy: 0 + - _Main3rdTexShouldFlipCopy: 0 + - _Main3rdTexShouldFlipMirror: 0 + - _Main3rdTex_Cull: 0 + - _Main3rdTex_UVMode: 0 + - _MainGradationStrength: 0 + - _MatCap2ndApplyTransparency: 1 + - _MatCap2ndBackfaceMask: 0 + - _MatCap2ndBlend: 1 + - _MatCap2ndBlendMode: 1 + - _MatCap2ndBumpScale: 1 + - _MatCap2ndCustomNormal: 0 + - _MatCap2ndEnableLighting: 1 + - _MatCap2ndLod: 0 + - _MatCap2ndMainStrength: 0 + - _MatCap2ndNormalStrength: 1 + - _MatCap2ndPerspective: 1 + - _MatCap2ndShadowMask: 0 + - _MatCap2ndVRParallaxStrength: 1 + - _MatCap2ndZRotCancel: 1 + - _MatCapApplyTransparency: 1 + - _MatCapBackfaceMask: 0 + - _MatCapBlend: 1 + - _MatCapBlendMode: 1 + - _MatCapBumpScale: 1 + - _MatCapCustomNormal: 0 + - _MatCapEnableLighting: 1 + - _MatCapLod: 0 + - _MatCapMainStrength: 0 + - _MatCapNormalStrength: 1 + - _MatCapPerspective: 1 + - _MatCapShadowMask: 0 + - _MatCapVRParallaxStrength: 1 + - _MatCapZRotCancel: 1 + - _MaxFadDistance: 2 + - _Metallic: 0 + - _MinFadDistance: 0 + - _MixMainTexToOutline: 0 + - _MonochromeLighting: 0 + - _N_F_ANIS: 0 + - _N_F_CA: 0 + - _N_F_CLD: 0 + - _N_F_CO: 0 + - _N_F_COEDGL: 0 + - _N_F_DCS: 0 + - _N_F_DDMD: 1 + - _N_F_EAL: 1 + - _N_F_ESSAO: 0 + - _N_F_FR: 0 + - _N_F_GLO: 0 + - _N_F_GLOT: 0 + - _N_F_HDLS: 0 + - _N_F_HPSS: 0 + - _N_F_LLI: 0 + - _N_F_MC: 0 + - _N_F_MSSOLTFO: 0 + - _N_F_NFD: 0 + - _N_F_NLASOBF: 0 + - _N_F_NM: 0 + - _N_F_O: 1 + - _N_F_OFLMB: 0 + - _N_F_PA: 0 + - _N_F_PT: 0 + - _N_F_R: 0 + - _N_F_RDC: 1 + - _N_F_RL: 0 + - _N_F_RLIS: 0 + - _N_F_SCO: 0 + - _N_F_SCT: 0 + - _N_F_SE: 0 + - _N_F_SL: 0 + - _N_F_SLMM: 0 + - _N_F_SON: 0 + - _N_F_SS: 1 + - _N_F_ST: 0 + - _N_F_STIAL: 0 + - _N_F_STIS: 0 + - _N_F_STSDFM: 0 + - _N_F_TP: 0 + - _NoiTexAffStraWidt: 0 + - _NoisTexInten: 1 + - _NoiseSize: 100 + - _NoisyOutlineIntensity: 0 + - _NorMapAsDis: 0 + - _NormalMapIntensity: 1 + - _ObjePosiZCS: 0 + - _OffsetFactor: 0 + - _OffsetUnits: 0 + - _Opacity: 1 + - _Oper: 0 + - _OutStenPass: 0 + - _OutZTest: 4 + - _OutZWrite: 1 + - _OutlineAlphaToMask: 0 + - _OutlineBlendOp: 0 + - _OutlineBlendOpAlpha: 0 + - _OutlineBlendOpAlphaFA: 4 + - _OutlineBlendOpFA: 4 + - _OutlineColorMask: 15 + - _OutlineCull: 1 + - _OutlineDeleteMesh: 0 + - _OutlineDisableInVR: 0 + - _OutlineDstBlend: 10 + - _OutlineDstBlendAlpha: 10 + - _OutlineDstBlendAlphaFA: 1 + - _OutlineDstBlendFA: 1 + - _OutlineEnableLighting: 1 + - _OutlineExtrudeMethod: 0 + - _OutlineFixWidth: 0.5 + - _OutlineLitApplyTex: 0 + - _OutlineLitOffset: -8 + - _OutlineLitScale: 10 + - _OutlineLitShadowReceive: 0 + - _OutlineOffsetFactor: 0 + - _OutlineOffsetUnits: 0 + - _OutlineSrcBlend: 5 + - _OutlineSrcBlendAlpha: 1 + - _OutlineSrcBlendAlphaFA: 0 + - _OutlineSrcBlendFA: 1 + - _OutlineStencilComp: 8 + - _OutlineStencilFail: 0 + - _OutlineStencilPass: 0 + - _OutlineStencilReadMask: 255 + - _OutlineStencilRef: 0 + - _OutlineStencilWriteMask: 255 + - _OutlineStencilZFail: 0 + - _OutlineVectorScale: 1 + - _OutlineVectorUVMode: 0 + - _OutlineVertexR2Width: 0 + - _OutlineWidth: 0.02 + - _OutlineWidthAffectedByViewDistance: 0 + - _OutlineZBias: 0 + - _OutlineZClip: 1 + - _OutlineZPostionInCamera: 0 + - _OutlineZTest: 2 + - _OutlineZWrite: 1 + - _OverallShadowColorPower: 1 + - _PADist: 0 + - _PASize: 0.5 + - _PASmooTrans: 1 + - _PSGLOTEX: 0 + - _PTexturePower: 1 + - _Parallax: 0.02 + - _ParallaxOffset: 0.5 + - _PointSpotlightIntensity: 1 + - _PreAlphaToMask: 0 + - _PreBlendOp: 0 + - _PreBlendOpAlpha: 0 + - _PreBlendOpAlphaFA: 4 + - _PreBlendOpFA: 4 + - _PreColorMask: 15 + - _PreCull: 2 + - _PreCutoff: 0.5 + - _PreDstBlend: 10 + - _PreDstBlendAlpha: 10 + - _PreDstBlendAlphaFA: 1 + - _PreDstBlendFA: 1 + - _PreOffsetFactor: 0 + - _PreOffsetUnits: 0 + - _PreOutType: 0 + - _PreSrcBlend: 1 + - _PreSrcBlendAlpha: 1 + - _PreSrcBlendAlphaFA: 0 + - _PreSrcBlendFA: 1 + - _PreStencilComp: 8 + - _PreStencilFail: 0 + - _PreStencilPass: 0 + - _PreStencilReadMask: 255 + - _PreStencilRef: 0 + - _PreStencilWriteMask: 255 + - _PreStencilZFail: 0 + - _PreZClip: 1 + - _PreZTest: 4 + - _PreZWrite: 1 + - _PresAdju: 1 + - _RELG: 1 + - _RQSO: 0 + - _ReduSha: 0.5 + - _RefMetallic: 0 + - _RefVal: 0 + - _Reflectance: 0.04 + - _ReflectionApplyTransparency: 1 + - _ReflectionBlendMode: 1 + - _ReflectionCubeEnableLighting: 1 + - _ReflectionCubeOverride: 0 + - _ReflectionIntensity: 0 + - _ReflectionNormalStrength: 1 + - _RimApplyTransparency: 1 + - _RimBackfaceMask: 1 + - _RimBlendMode: 1 + - _RimBlur: 0.15 + - _RimBorder: 0.9 + - _RimDirRange: 0 + - _RimDirStrength: 0 + - _RimEnableLighting: 1 + - _RimFresnelPower: 3.5 + - _RimIndirBlur: 0.1 + - _RimIndirBorder: 0.5 + - _RimIndirRange: 0 + - _RimLigInt: 1 + - _RimLightColorPower: 10 + - _RimLightInLight: 1 + - _RimLightSoftness: 1 + - _RimLightUnfill: 1.5 + - _RimMainStrength: 0 + - _RimNormalStrength: 1 + - _RimShadeBlur: 1 + - _RimShadeBorder: 0.5 + - _RimShadeFresnelPower: 1 + - _RimShadeNormalStrength: 1 + - _RimShadowMask: 0.5 + - _RimVRParallaxStrength: 1 + - _SPECIN: 1 + - _SPECMODE: 0 + - _STIL: 0 + - _Saturation: 1 + - _SelfLitHighContrast: 1 + - _SelfLitIntensity: 0 + - _SelfLitPower: 2 + - _SelfShadowAffectedByLightShadowStrength: 0 + - _SelfShadowHardness: 1 + - _SelfShadowRealTimeShadowColorPower: 1 + - _SelfShadowRealtimeShadowIntensity: 0 + - _SelfShadowShadowTAtViewDirection: 0 + - _SelfShadowThreshold: 0.93 + - _Shadow2ndBlur: 0.1 + - _Shadow2ndBorder: 0.15 + - _Shadow2ndNormalStrength: 1 + - _Shadow2ndReceive: 0 + - _Shadow3rdBlur: 0.1 + - _Shadow3rdBorder: 0.25 + - _Shadow3rdNormalStrength: 1 + - _Shadow3rdReceive: 0 + - _ShadowBlur: 0.1 + - _ShadowBlurMaskLOD: 0 + - _ShadowBorder: 0.2 + - _ShadowBorderMaskLOD: 0 + - _ShadowBorderRange: 0.08 + - _ShadowColorTexturePower: 0 + - _ShadowColorType: 0 + - _ShadowEnvStrength: 0 + - _ShadowFlatBlur: 1 + - _ShadowFlatBorder: 1 + - _ShadowHardness: 0 + - _ShadowMainStrength: 0 + - _ShadowMaskType: 0 + - _ShadowNormalStrength: 1 + - _ShadowPostAO: 0 + - _ShadowReceive: 1 + - _ShadowStrength: 0.7 + - _ShadowStrengthMaskLOD: 0 + - _ShadowTColorPower: 1 + - _ShadowTHardness: 1 + - _ShadowTIntensity: 1 + - _ShadowTLightThreshold: 50 + - _ShadowTShadowThreshold: 0 + - _ShifAnis: 0 + - _ShiftBackfaceUV: 0 + - _ShowInAmbientLightShadowIntensity: 1 + - _ShowInAmbientLightShadowThreshold: 0.4 + - _ShowNormal: 0 + - _SimTrans: 0 + - _SkinMatrixIndex: 0 + - _SmoothObjectNormal: 0 + - _Smoothness: 1 + - _SpecularBlur: 0 + - _SpecularBorder: 0.5 + - _SpecularNormalStrength: 1 + - _SpecularToon: 1 + - _SrcBlend: 1 + - _SrcBlendAlpha: 1 + - _SrcBlendAlphaFA: 0 + - _SrcBlendFA: 1 + - _StencilComp: 8 + - _StencilFail: 0 + - _StencilPass: 0 + - _StencilReadMask: 255 + - _StencilRef: 0 + - _StencilWriteMask: 255 + - _StencilZFail: 0 + - _StraWidt: 10 + - _SubpassCutoff: 0.5 + - _TEXMCOLINT: 1 + - _TRANSMODE: 0 + - _TessEdge: 10 + - _TessFactorMax: 3 + - _TessShrink: 0 + - _TessStrength: 0.5 + - _TessellationFar: 1 + - _TessellationNear: 1 + - _TessellationSmoothness: 0.5 + - _TessellationTransition: 0.8 + - _TexturePatternStyle: 0 + - _TrailSize: 1.5 + - _TransAffSha: 1 + - _TransparentMode: 0 + - _TransparentThreshold: 0 + - _TriPlaBlend: 4 + - _TriPlaTile: 1 + - _UDIMDiscardCompile: 0 + - _UDIMDiscardMode: 0 + - _UDIMDiscardRow0_0: 0 + - _UDIMDiscardRow0_1: 0 + - _UDIMDiscardRow0_2: 0 + - _UDIMDiscardRow0_3: 0 + - _UDIMDiscardRow1_0: 0 + - _UDIMDiscardRow1_1: 0 + - _UDIMDiscardRow1_2: 0 + - _UDIMDiscardRow1_3: 0 + - _UDIMDiscardRow2_0: 0 + - _UDIMDiscardRow2_1: 0 + - _UDIMDiscardRow2_2: 0 + - _UDIMDiscardRow2_3: 0 + - _UDIMDiscardRow3_0: 0 + - _UDIMDiscardRow3_1: 0 + - _UDIMDiscardRow3_2: 0 + - _UDIMDiscardRow3_3: 0 + - _UDIMDiscardUV: 0 + - _UVSet: 0 + - _UseAnisotropy: 0 + - _UseAudioLink: 0 + - _UseBacklight: 0 + - _UseBump2ndMap: 0 + - _UseBumpMap: 0 + - _UseClippingCanceller: 0 + - _UseDither: 0 + - _UseEmission: 0 + - _UseEmission2nd: 0 + - _UseGlitter: 0 + - _UseMain2ndTex: 0 + - _UseMain3rdTex: 0 + - _UseMatCap: 0 + - _UseMatCap2nd: 0 + - _UseOutline: 0 + - _UsePOM: 0 + - _UseParallax: 0 + - _UseReflection: 0 + - _UseRim: 0 + - _UseRimShade: 0 + - _UseSecondaryCutout: 0 + - _UseShadow: 1 + - _UseTLB: 0 + - _VertexColorBlueAffectOutlineWitdh: 0 + - _VertexColorGreenControlSelfShadowThreshold: 0 + - _VertexColorRedControlSmoothObjectNormal: 0 + - _VertexLightStrength: 0 + - _ZClip: 1 + - _ZTest: 4 + - _ZWrite: 1 + - _e2gai: 2 + - _e2gci: 2 + - _egai: 2 + - _egci: 2 + - _lilDirectionalLightStrength: 1 + - _lilShadowCasterBias: 0 + - _lilToonVersion: 42 + m_Colors: + - _AudioLinkDefaultValue: {r: 0, g: 0, b: 2, a: 0.75} + - _AudioLinkLocalMapParams: {r: 120, g: 1, b: 0, a: 0} + - _AudioLinkMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _AudioLinkStart: {r: 0, g: 0, b: 0, a: 0} + - _AudioLinkUVParams: {r: 0.25, g: 0, b: 0, a: 0.125} + - _AudioLinkVertexStart: {r: 0, g: 0, b: 0, a: 0} + - _AudioLinkVertexStrength: {r: 0, g: 0, b: 0, a: 1} + - _AudioLinkVertexUVParams: {r: 0.25, g: 0, b: 0, a: 0.125} + - _BackfaceColor: {r: 0, g: 0, b: 0, a: 0} + - _BacklightColor: {r: 0.85, g: 0.8, b: 0.7, a: 1} + - _BaseColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Color2nd: {r: 1, g: 1, b: 1, a: 1} + - _Color3rd: {r: 1, g: 1, b: 1, a: 1} + - _CustomLightDirection: {r: 0, g: 0, b: 10, a: 0} + - _DissolveColor: {r: 1, g: 1, b: 1, a: 1} + - _DissolveNoiseMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _DissolveParams: {r: 0, g: 0, b: 0.5, a: 0.1} + - _DissolvePos: {r: 0, g: 0, b: 0, a: 0} + - _DistanceFade: {r: 0.1, g: 0.01, b: 0, a: 0} + - _DistanceFadeColor: {r: 0, g: 0, b: 0, a: 1} + - _DistanceFadeRimColor: {r: 0, g: 0, b: 0, a: 0} + - _Emission2ndBlendMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _Emission2ndBlink: {r: 0, g: 0, b: 3.141593, a: 0} + - _Emission2ndColor: {r: 1, g: 1, b: 1, a: 1} + - _Emission2ndMap_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _EmissionBlendMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _EmissionBlink: {r: 0, g: 0, b: 3.141593, a: 0} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _EmissionMap_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _GlitterAtras: {r: 1, g: 1, b: 0, a: 0} + - _GlitterColor: {r: 1, g: 1, b: 1, a: 1} + - _GlitterParams1: {r: 256, g: 256, b: 0.16, a: 50} + - _GlitterParams2: {r: 0.25, g: 0, b: 0, a: 0} + - _GlossColor: {r: 1, g: 1, b: 1, a: 1} + - _Glow_Color: {r: 1, g: 1, b: 1, a: 1} + - _HighlightColor: {r: 0, g: 0.022767067, b: 1, a: 1} + - _Keys: {r: 0, g: 0, b: 0, a: 0} + - _LightDirectionOverride: {r: 0.001, g: 0.002, b: 0.001, a: 0} + - _Main2ndDissolveColor: {r: 1, g: 1, b: 1, a: 1} + - _Main2ndDissolveNoiseMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _Main2ndDissolveParams: {r: 0, g: 0, b: 0.5, a: 0.1} + - _Main2ndDissolvePos: {r: 0, g: 0, b: 0, a: 0} + - _Main2ndDistanceFade: {r: 0.1, g: 0.01, b: 0, a: 0} + - _Main2ndTexDecalAnimation: {r: 1, g: 1, b: 1, a: 30} + - _Main2ndTexDecalSubParam: {r: 1, g: 1, b: 0, a: 1} + - _Main2ndTex_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _Main3rdDissolveColor: {r: 1, g: 1, b: 1, a: 1} + - _Main3rdDissolveNoiseMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _Main3rdDissolveParams: {r: 0, g: 0, b: 0.5, a: 0.1} + - _Main3rdDissolvePos: {r: 0, g: 0, b: 0, a: 0} + - _Main3rdDistanceFade: {r: 0.1, g: 0.01, b: 0, a: 0} + - _Main3rdTexDecalAnimation: {r: 1, g: 1, b: 1, a: 30} + - _Main3rdTexDecalSubParam: {r: 1, g: 1, b: 0, a: 1} + - _Main3rdTex_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _MainColor: {r: 1, g: 1, b: 1, a: 1} + - _MainTexHSVG: {r: 0, g: 1, b: 1, a: 1} + - _MainTex_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _MatCap2ndBlendUV1: {r: 0, g: 0, b: 0, a: 0} + - _MatCap2ndColor: {r: 1, g: 1, b: 1, a: 1} + - _MatCapBlendUV1: {r: 0, g: 0, b: 0, a: 0} + - _MatCapColor: {r: 1, g: 1, b: 1, a: 1} + - _ObjPosi: {r: 0, g: 0, b: 0, a: 0} + - _ObjectForward: {r: 0, g: 0, b: 0, a: 0} + - _ObjectRight: {r: 0, g: 0, b: 0, a: 0} + - _OutResi: {r: 1, g: 1, b: 1, a: 1} + - _OutlineColor: {r: 0.65837497, g: 0.5028866, b: 0.47932023, a: 1} + - _OutlineLitColor: {r: 1, g: 0.19999996, b: 0, a: 0} + - _OutlineOffset: {r: 0, g: 0, b: 0, a: 1} + - _OutlineTexHSVG: {r: 0, g: 1, b: 1, a: 1} + - _OutlineTex_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _OverallShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _PTCol: {r: 0, g: 0, b: 0, a: 1} + - _PreColor: {r: 1, g: 1, b: 1, a: 1} + - _PrevPosition: {r: 0, g: 0, b: 0, a: 0} + - _ReflectionColor: {r: 1, g: 1, b: 1, a: 1} + - _ReflectionCubeColor: {r: 0, g: 0, b: 0, a: 1} + - _RimColor: {r: 0.8396226, g: 0.75352514, b: 0.74061054, a: 1} + - _RimIndirColor: {r: 1, g: 1, b: 1, a: 1} + - _RimLigPosi: {r: 1, g: 1, b: 1, a: 1} + - _RimLightColor: {r: 1, g: 1, b: 1, a: 1} + - _RimShadeColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + - _SSAOColor: {r: 0, g: 0, b: 0, a: 0} + - _SelfLitColor: {r: 1, g: 1, b: 1, a: 1} + - _SelfShadowRealTimeShadowColor: {r: 1, g: 1, b: 1, a: 1} + - _Shadow2ndColor: {r: 0.8683324, g: 0.85898006, b: 0.9150943, a: 1} + - _Shadow3rdColor: {r: 0, g: 0, b: 0, a: 0} + - _ShadowAOShift: {r: 1, g: 0, b: 1, a: 0} + - _ShadowAOShift2: {r: 1, g: 0, b: 1, a: 0} + - _ShadowBorderColor: {r: 0.16981131, g: 0.16981131, b: 0.16981131, a: 1} + - _ShadowColor: {r: 0.94978195, g: 0.9123354, b: 0.9622642, a: 1} + - _ShadowTColor: {r: 1, g: 1, b: 1, a: 1} + - _XYZPosition: {r: 0, g: 0, b: 0, a: 0} + - _e2ga0: {r: 1, g: 0, b: 0, a: 0} + - _e2ga1: {r: 1, g: 0, b: 0, a: 1} + - _e2ga2: {r: 1, g: 0, b: 0, a: 0} + - _e2ga3: {r: 1, g: 0, b: 0, a: 0} + - _e2ga4: {r: 1, g: 0, b: 0, a: 0} + - _e2ga5: {r: 1, g: 0, b: 0, a: 0} + - _e2ga6: {r: 1, g: 0, b: 0, a: 0} + - _e2ga7: {r: 1, g: 0, b: 0, a: 0} + - _e2gc0: {r: 1, g: 1, b: 1, a: 0} + - _e2gc1: {r: 1, g: 1, b: 1, a: 1} + - _e2gc2: {r: 1, g: 1, b: 1, a: 0} + - _e2gc3: {r: 1, g: 1, b: 1, a: 0} + - _e2gc4: {r: 1, g: 1, b: 1, a: 0} + - _e2gc5: {r: 1, g: 1, b: 1, a: 0} + - _e2gc6: {r: 1, g: 1, b: 1, a: 0} + - _e2gc7: {r: 1, g: 1, b: 1, a: 0} + - _ega0: {r: 1, g: 0, b: 0, a: 0} + - _ega1: {r: 1, g: 0, b: 0, a: 1} + - _ega2: {r: 1, g: 0, b: 0, a: 0} + - _ega3: {r: 1, g: 0, b: 0, a: 0} + - _ega4: {r: 1, g: 0, b: 0, a: 0} + - _ega5: {r: 1, g: 0, b: 0, a: 0} + - _ega6: {r: 1, g: 0, b: 0, a: 0} + - _ega7: {r: 1, g: 0, b: 0, a: 0} + - _egc0: {r: 1, g: 1, b: 1, a: 0} + - _egc1: {r: 1, g: 1, b: 1, a: 1} + - _egc2: {r: 1, g: 1, b: 1, a: 0} + - _egc3: {r: 1, g: 1, b: 1, a: 0} + - _egc4: {r: 1, g: 1, b: 1, a: 0} + - _egc5: {r: 1, g: 1, b: 1, a: 0} + - _egc6: {r: 1, g: 1, b: 1, a: 0} + - _egc7: {r: 1, g: 1, b: 1, a: 0} + m_BuildTextureStacks: [] + m_AllowLocking: 1 diff --git a/Assets/04_Models/Characters/Fariy/Materials/Cloth/Alistia_Cloth_2_Lace.mat.meta b/Assets/04_Models/Characters/Fariy/Materials/Cloth/Alistia_Cloth_2_Lace.mat.meta new file mode 100644 index 00000000..bdd4036b --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Materials/Cloth/Alistia_Cloth_2_Lace.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e53efbb67fe6728448f434995daddef8 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/04_Models/Characters/Fariy/Materials/Komono.meta b/Assets/04_Models/Characters/Fariy/Materials/Komono.meta new file mode 100644 index 00000000..3638fdae --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Materials/Komono.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c59e650fcc5259249a93565130ccd21f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/04_Models/Characters/Fariy/Materials/Komono/Jewel_Blue.mat b/Assets/04_Models/Characters/Fariy/Materials/Komono/Jewel_Blue.mat new file mode 100644 index 00000000..741d6eb7 --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Materials/Komono/Jewel_Blue.mat @@ -0,0 +1,977 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Jewel_Blue + m_Shader: {fileID: 4800000, guid: 6459b2db96a08ca41b0f9b39dc7ad59e, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: + - N_F_DDMD_ON + - N_F_EAL_ON + - N_F_O_ON + - N_F_RDC_ON + - N_F_RELGI_ON + - N_F_SS_ON + - N_F_TRANSAFFSHA_ON + - _UVSET_UV0 + m_InvalidKeywords: [] + m_LightmapFlags: 0 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AnisotropyScaleMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AnisotropyShiftNoiseMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AnisotropyTangentMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AudioLinkLocalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AudioLinkMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BacklightColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BaseColorMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BaseMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Bump2ndMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Bump2ndScaleMask: + m_Texture: {fileID: 0} + 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} + - _DissolveMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DissolveNoiseMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DitherTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Emission2ndBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Emission2ndGradTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Emission2ndMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionGradTex: + 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} + - _FReflection: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlitterColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlitterShapeTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlossTexture: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MCap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MCapMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main2ndBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main2ndDissolveMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main2ndDissolveNoiseMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main2ndTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main3rdBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main3rdDissolveMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main3rdDissolveNoiseMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main3rdTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainColorAdjustMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainGradationTex: + 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} + - _MaskGloss: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MaskReflection: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MaskSelfLit: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MaskTransparency: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCap2ndBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCap2ndBumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCap2ndTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCapBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCapBumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCapTex: + 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} + - _NormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineVectorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineWidthControl: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineWidthMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _PTexture: + 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} + - _ReflectionColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ReflectionCubeTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _RimColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _RimShadeMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SecondaryCutout: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Shadow2ndColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Shadow3rdColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowBlurMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowBorderMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowColorTexture: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowStrengthMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowT: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SmoothnessTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _AAS: 0.0001 + - _AAStrength: 1 + - _AlpToCov: 0 + - _AlphaBaseCutout: 1 + - _AlphaBoostFA: 10 + - _AlphaMaskMode: 0 + - _AlphaMaskScale: 1 + - _AlphaMaskValue: 0 + - _AlphaToMask: 0 + - _Anisotropy2MatCap: 0 + - _Anisotropy2MatCap2nd: 0 + - _Anisotropy2Reflection: 0 + - _Anisotropy2ndBitangentWidth: 1 + - _Anisotropy2ndShift: 0 + - _Anisotropy2ndShiftNoiseScale: 0 + - _Anisotropy2ndSpecularStrength: 0 + - _Anisotropy2ndTangentWidth: 1 + - _AnisotropyBitangentWidth: 1 + - _AnisotropyScale: 1 + - _AnisotropyShift: 0 + - _AnisotropyShiftNoiseScale: 0 + - _AnisotropySpecularStrength: 1 + - _AnisotropyTangentWidth: 1 + - _ApplyReflection: 0 + - _ApplySpecular: 1 + - _ApplySpecularFA: 1 + - _AsOverlay: 0 + - _AsUnlit: 0 + - _AudioLink2Emission: 0 + - _AudioLink2Emission2nd: 0 + - _AudioLink2Emission2ndGrad: 0 + - _AudioLink2EmissionGrad: 0 + - _AudioLink2Main2nd: 0 + - _AudioLink2Main3rd: 0 + - _AudioLink2Vertex: 0 + - _AudioLinkAsLocal: 0 + - _AudioLinkMask_UVMode: 0 + - _AudioLinkUVMode: 1 + - _AudioLinkVertexUVMode: 1 + - _BackfaceForceShadow: 0 + - _BacklightBackfaceMask: 1 + - _BacklightBlur: 0.05 + - _BacklightBorder: 0.35 + - _BacklightDirectivity: 5 + - _BacklightMainStrength: 0 + - _BacklightNormalStrength: 1 + - _BacklightReceiveShadow: 1 + - _BacklightViewStrength: 1 + - _BeforeExposureLimit: 10000 + - _BitKey0: 0 + - _BitKey1: 0 + - _BitKey10: 0 + - _BitKey11: 0 + - _BitKey12: 0 + - _BitKey13: 0 + - _BitKey14: 0 + - _BitKey15: 0 + - _BitKey16: 0 + - _BitKey17: 0 + - _BitKey18: 0 + - _BitKey19: 0 + - _BitKey2: 0 + - _BitKey20: 0 + - _BitKey21: 0 + - _BitKey22: 0 + - _BitKey23: 0 + - _BitKey24: 0 + - _BitKey25: 0 + - _BitKey26: 0 + - _BitKey27: 0 + - _BitKey28: 0 + - _BitKey29: 0 + - _BitKey3: 0 + - _BitKey30: 0 + - _BitKey31: 0 + - _BitKey4: 0 + - _BitKey5: 0 + - _BitKey6: 0 + - _BitKey7: 0 + - _BitKey8: 0 + - _BitKey9: 0 + - _BleModDest: 0 + - _BleModSour: 1 + - _BlendOp: 0 + - _BlendOpAlpha: 0 + - _BlendOpAlphaFA: 4 + - _BlendOpFA: 4 + - _Bump2ndMap_UVMode: 0 + - _Bump2ndScale: 1 + - _BumpScale: 1 + - _ClipAdju: 0 + - _ColorMask: 15 + - _Compa: 4 + - _ComputeMeshIndex: 0 + - _Cull: 0 + - _Culling: 2 + - _CustomLightDirectionFollowObjectRotation: 0 + - _CustomLightDirectionIntensity: 0 + - _Cutoff: 0.5 + - _Cutout: 0.5 + - _DepthThreshold: 900 + - _DirectionalLightIntensity: 1 + - _DissolveNoiseStrength: 0.1 + - _DistanceFadeMode: 0 + - _DistanceFadeRimFresnelPower: 5 + - _DitherMaxValue: 255 + - _DoubleSidedOutline: 1 + - _DstBlend: 1 + - _DstBlendAlpha: 10 + - _DstBlendAlphaFA: 1 + - _DstBlendFA: 1 + - _DummyProperty: 0 + - _DynamicNoisyOutline: 0 + - _Emission2ndBlend: 1 + - _Emission2ndBlendMode: 1 + - _Emission2ndFluorescence: 0 + - _Emission2ndGradSpeed: 1 + - _Emission2ndMainStrength: 0 + - _Emission2ndMap_UVMode: 0 + - _Emission2ndParallaxDepth: 0 + - _Emission2ndUseGrad: 0 + - _EmissionBlend: 1 + - _EmissionBlendMode: 1 + - _EmissionFluorescence: 0 + - _EmissionGradSpeed: 1 + - _EmissionMainStrength: 0 + - _EmissionMap_UVMode: 0 + - _EmissionParallaxDepth: 0 + - _EmissionUseGrad: 0 + - _EnvironmentalLightingIntensity: 1 + - _FarDistanceMaxWidth: 10 + - _FlipNormal: 0 + - _GIFlatShade: 0 + - _GIShadeThreshold: 0 + - _GSAAStrength: 0 + - _GemChromaticAberration: 0.02 + - _GemEnvContrast: 2 + - _GemParticleLoop: 8 + - _GemVRParallaxStrength: 1 + - _GlitterAngleRandomize: 0 + - _GlitterApplyShape: 0 + - _GlitterApplyTransparency: 1 + - _GlitterBackfaceMask: 0 + - _GlitterColorTex_UVMode: 0 + - _GlitterEnableLighting: 1 + - _GlitterMainStrength: 0 + - _GlitterNormalStrength: 1 + - _GlitterPostContrast: 1 + - _GlitterScaleRandomize: 0 + - _GlitterSensitivity: 0.25 + - _GlitterShadowMask: 0 + - _GlitterUVMode: 0 + - _GlitterVRParallaxStrength: 1 + - _GlossColorPower: 10 + - _GlossIntensity: 1 + - _GlossSoftness: 0 + - _GlossTextureFollowLight: 0 + - _GlossTextureFollowObjectRotation: 0 + - _GlossTextureRotate: 0 + - _GlossTextureSoftness: 0 + - _Glossiness: 0.6 + - _Glow_Edge_Width: 1 + - _HighlightColorPower: 5 + - _IDMask1: 0 + - _IDMask2: 0 + - _IDMask3: 0 + - _IDMask4: 0 + - _IDMask5: 0 + - _IDMask6: 0 + - _IDMask7: 0 + - _IDMask8: 0 + - _IDMaskCompile: 0 + - _IDMaskControlsDissolve: 0 + - _IDMaskFrom: 8 + - _IDMaskIndex1: 0 + - _IDMaskIndex2: 0 + - _IDMaskIndex3: 0 + - _IDMaskIndex4: 0 + - _IDMaskIndex5: 0 + - _IDMaskIndex6: 0 + - _IDMaskIndex7: 0 + - _IDMaskIndex8: 0 + - _IDMaskIsBitmap: 0 + - _IDMaskPrior1: 0 + - _IDMaskPrior2: 0 + - _IDMaskPrior3: 0 + - _IDMaskPrior4: 0 + - _IDMaskPrior5: 0 + - _IDMaskPrior6: 0 + - _IDMaskPrior7: 0 + - _IDMaskPrior8: 0 + - _IgnoreEncryption: 0 + - _Invisible: 0 + - _LLI_Max: 1 + - _LLI_Min: 0 + - _LigIgnoYNorDir: 0 + - _LightAffectOutlineColor: 0 + - _LightAffectRimLightColor: 0 + - _LightAffectShadow: 0 + - _LightFalloffAffectShadowT: 0 + - _LightFalloffSoftness: 1 + - _LightIntensity: 1 + - _LightMaxLimit: 1 + - _LightMinLimit: 0.05 + - _MCIALO: 0 + - _MCapIntensity: 1 + - _MVCOL: 0 + - _MaiColPo: 0.8 + - _Main2ndDissolveNoiseStrength: 0.1 + - _Main2ndEnableLighting: 1 + - _Main2ndTexAlphaMode: 0 + - _Main2ndTexAngle: 0 + - _Main2ndTexBlendMode: 0 + - _Main2ndTexIsDecal: 0 + - _Main2ndTexIsLeftOnly: 0 + - _Main2ndTexIsMSDF: 0 + - _Main2ndTexIsRightOnly: 0 + - _Main2ndTexShouldCopy: 0 + - _Main2ndTexShouldFlipCopy: 0 + - _Main2ndTexShouldFlipMirror: 0 + - _Main2ndTex_Cull: 0 + - _Main2ndTex_UVMode: 0 + - _Main3rdDissolveNoiseStrength: 0.1 + - _Main3rdEnableLighting: 1 + - _Main3rdTexAlphaMode: 0 + - _Main3rdTexAngle: 0 + - _Main3rdTexBlendMode: 0 + - _Main3rdTexIsDecal: 0 + - _Main3rdTexIsLeftOnly: 0 + - _Main3rdTexIsMSDF: 0 + - _Main3rdTexIsRightOnly: 0 + - _Main3rdTexShouldCopy: 0 + - _Main3rdTexShouldFlipCopy: 0 + - _Main3rdTexShouldFlipMirror: 0 + - _Main3rdTex_Cull: 0 + - _Main3rdTex_UVMode: 0 + - _MainGradationStrength: 0 + - _MatCap2ndApplyTransparency: 1 + - _MatCap2ndBackfaceMask: 0 + - _MatCap2ndBlend: 1 + - _MatCap2ndBlendMode: 1 + - _MatCap2ndBumpScale: 1 + - _MatCap2ndCustomNormal: 0 + - _MatCap2ndEnableLighting: 1 + - _MatCap2ndLod: 0 + - _MatCap2ndMainStrength: 0 + - _MatCap2ndNormalStrength: 1 + - _MatCap2ndPerspective: 1 + - _MatCap2ndShadowMask: 0 + - _MatCap2ndVRParallaxStrength: 1 + - _MatCap2ndZRotCancel: 1 + - _MatCapApplyTransparency: 1 + - _MatCapBackfaceMask: 0 + - _MatCapBlend: 1 + - _MatCapBlendMode: 1 + - _MatCapBumpScale: 1 + - _MatCapCustomNormal: 0 + - _MatCapEnableLighting: 1 + - _MatCapLod: 0 + - _MatCapMainStrength: 0 + - _MatCapNormalStrength: 1 + - _MatCapPerspective: 1 + - _MatCapShadowMask: 0 + - _MatCapVRParallaxStrength: 1 + - _MatCapZRotCancel: 1 + - _MaxFadDistance: 2 + - _Metallic: 0 + - _MinFadDistance: 0 + - _MixMainTexToOutline: 0 + - _MonochromeLighting: 0 + - _N_F_ANIS: 0 + - _N_F_CA: 0 + - _N_F_CLD: 0 + - _N_F_CO: 0 + - _N_F_COEDGL: 0 + - _N_F_DCS: 0 + - _N_F_DDMD: 1 + - _N_F_EAL: 1 + - _N_F_ESSAO: 0 + - _N_F_FR: 0 + - _N_F_GLO: 0 + - _N_F_GLOT: 0 + - _N_F_HDLS: 0 + - _N_F_HPSS: 0 + - _N_F_LLI: 0 + - _N_F_MC: 0 + - _N_F_MSSOLTFO: 0 + - _N_F_NFD: 0 + - _N_F_NLASOBF: 0 + - _N_F_NM: 0 + - _N_F_O: 1 + - _N_F_OFLMB: 0 + - _N_F_PA: 0 + - _N_F_PT: 0 + - _N_F_R: 0 + - _N_F_RDC: 1 + - _N_F_RL: 0 + - _N_F_RLIS: 0 + - _N_F_SCO: 0 + - _N_F_SCT: 0 + - _N_F_SE: 0 + - _N_F_SL: 0 + - _N_F_SLMM: 0 + - _N_F_SON: 0 + - _N_F_SS: 1 + - _N_F_ST: 0 + - _N_F_STIAL: 0 + - _N_F_STIS: 0 + - _N_F_STSDFM: 0 + - _N_F_TP: 0 + - _NoiTexAffStraWidt: 0 + - _NoisTexInten: 1 + - _NoiseSize: 100 + - _NoisyOutlineIntensity: 0 + - _NorMapAsDis: 0 + - _NormalMapIntensity: 1 + - _ObjePosiZCS: 0 + - _OffsetFactor: 0 + - _OffsetUnits: 0 + - _Opacity: 1 + - _Oper: 0 + - _OutStenPass: 0 + - _OutZTest: 4 + - _OutZWrite: 1 + - _OutlineDeleteMesh: 0 + - _OutlineDisableInVR: 0 + - _OutlineEnableLighting: 1 + - _OutlineExtrudeMethod: 0 + - _OutlineFixWidth: 0.5 + - _OutlineLitApplyTex: 0 + - _OutlineLitOffset: -8 + - _OutlineLitScale: 10 + - _OutlineLitShadowReceive: 0 + - _OutlineVectorScale: 1 + - _OutlineVectorUVMode: 0 + - _OutlineVertexR2Width: 0 + - _OutlineWidth: 0.08 + - _OutlineWidthAffectedByViewDistance: 0 + - _OutlineZBias: 0 + - _OutlineZPostionInCamera: 0 + - _OverallShadowColorPower: 1 + - _PADist: 0 + - _PASize: 0.5 + - _PASmooTrans: 1 + - _PSGLOTEX: 0 + - _PTexturePower: 1 + - _Parallax: 0.02 + - _ParallaxOffset: 0.5 + - _PointSpotlightIntensity: 1 + - _PresAdju: 1 + - _RELG: 1 + - _RQSO: 0 + - _ReduSha: 0.5 + - _RefMetallic: 0 + - _RefVal: 0 + - _Reflectance: 0.04 + - _ReflectionApplyTransparency: 1 + - _ReflectionBlendMode: 1 + - _ReflectionCubeEnableLighting: 1 + - _ReflectionCubeOverride: 0 + - _ReflectionIntensity: 0 + - _ReflectionNormalStrength: 1 + - _RefractionFresnelPower: 1 + - _RefractionStrength: 0.5 + - _RimApplyTransparency: 1 + - _RimBackfaceMask: 0 + - _RimBlendMode: 1 + - _RimBlur: 0.1 + - _RimBorder: 0.5 + - _RimDirRange: 0 + - _RimDirStrength: 0 + - _RimEnableLighting: 1 + - _RimFresnelPower: 3 + - _RimIndirBlur: 0.1 + - _RimIndirBorder: 0.5 + - _RimIndirRange: 0 + - _RimLigInt: 1 + - _RimLightColorPower: 10 + - _RimLightInLight: 1 + - _RimLightSoftness: 1 + - _RimLightUnfill: 1.5 + - _RimMainStrength: 0 + - _RimNormalStrength: 1 + - _RimShadeBlur: 1 + - _RimShadeBorder: 0.5 + - _RimShadeFresnelPower: 1 + - _RimShadeNormalStrength: 1 + - _RimShadowMask: 0 + - _RimVRParallaxStrength: 1 + - _SPECIN: 1 + - _SPECMODE: 0 + - _STIL: 0 + - _Saturation: 1 + - _SelfLitHighContrast: 1 + - _SelfLitIntensity: 0 + - _SelfLitPower: 2 + - _SelfShadowAffectedByLightShadowStrength: 0 + - _SelfShadowHardness: 1 + - _SelfShadowRealTimeShadowColorPower: 1 + - _SelfShadowRealtimeShadowIntensity: 0 + - _SelfShadowShadowTAtViewDirection: 0 + - _SelfShadowThreshold: 0.93 + - _Shadow2ndBlur: 0.3 + - _Shadow2ndBorder: 0.5 + - _Shadow2ndNormalStrength: 1 + - _Shadow2ndReceive: 0 + - _Shadow3rdBlur: 0.1 + - _Shadow3rdBorder: 0.25 + - _Shadow3rdNormalStrength: 1 + - _Shadow3rdReceive: 0 + - _ShadowBlur: 0.1 + - _ShadowBlurMaskLOD: 0 + - _ShadowBorder: 0.5 + - _ShadowBorderMaskLOD: 0 + - _ShadowBorderRange: 0 + - _ShadowColorTexturePower: 0 + - _ShadowColorType: 0 + - _ShadowEnvStrength: 0 + - _ShadowFlatBlur: 1 + - _ShadowFlatBorder: 1 + - _ShadowHardness: 0 + - _ShadowMainStrength: 1 + - _ShadowMaskType: 0 + - _ShadowNormalStrength: 1 + - _ShadowPostAO: 0 + - _ShadowReceive: 0 + - _ShadowStrength: 1 + - _ShadowStrengthMaskLOD: 0 + - _ShadowTColorPower: 1 + - _ShadowTHardness: 1 + - _ShadowTIntensity: 1 + - _ShadowTLightThreshold: 50 + - _ShadowTShadowThreshold: 0 + - _ShifAnis: 0 + - _ShiftBackfaceUV: 0 + - _ShowInAmbientLightShadowIntensity: 1 + - _ShowInAmbientLightShadowThreshold: 0.4 + - _ShowNormal: 0 + - _SimTrans: 0 + - _SkinMatrixIndex: 0 + - _SmoothObjectNormal: 0 + - _Smoothness: 1 + - _SpecularBlur: 0 + - _SpecularBorder: 0.5 + - _SpecularNormalStrength: 1 + - _SpecularToon: 1 + - _SrcBlend: 1 + - _SrcBlendAlpha: 1 + - _SrcBlendAlphaFA: 0 + - _SrcBlendFA: 1 + - _StencilComp: 8 + - _StencilFail: 0 + - _StencilPass: 0 + - _StencilReadMask: 255 + - _StencilRef: 0 + - _StencilWriteMask: 255 + - _StencilZFail: 0 + - _StraWidt: 10 + - _SubpassCutoff: 0.5 + - _TEXMCOLINT: 1 + - _TRANSMODE: 0 + - _TessEdge: 10 + - _TessFactorMax: 3 + - _TessShrink: 0 + - _TessStrength: 0.5 + - _TessellationFar: 1 + - _TessellationNear: 1 + - _TessellationSmoothness: 0.5 + - _TessellationTransition: 0.8 + - _TexturePatternStyle: 0 + - _TrailSize: 1.5 + - _TransAffSha: 1 + - _TransparentMode: 0 + - _TransparentThreshold: 0 + - _TriPlaBlend: 4 + - _TriPlaTile: 1 + - _UDIMDiscardCompile: 0 + - _UDIMDiscardMode: 0 + - _UDIMDiscardRow0_0: 0 + - _UDIMDiscardRow0_1: 0 + - _UDIMDiscardRow0_2: 0 + - _UDIMDiscardRow0_3: 0 + - _UDIMDiscardRow1_0: 0 + - _UDIMDiscardRow1_1: 0 + - _UDIMDiscardRow1_2: 0 + - _UDIMDiscardRow1_3: 0 + - _UDIMDiscardRow2_0: 0 + - _UDIMDiscardRow2_1: 0 + - _UDIMDiscardRow2_2: 0 + - _UDIMDiscardRow2_3: 0 + - _UDIMDiscardRow3_0: 0 + - _UDIMDiscardRow3_1: 0 + - _UDIMDiscardRow3_2: 0 + - _UDIMDiscardRow3_3: 0 + - _UDIMDiscardUV: 0 + - _UVSet: 0 + - _UseAnisotropy: 0 + - _UseAudioLink: 0 + - _UseBacklight: 0 + - _UseBump2ndMap: 0 + - _UseBumpMap: 0 + - _UseClippingCanceller: 0 + - _UseDither: 0 + - _UseEmission: 0 + - _UseEmission2nd: 0 + - _UseGlitter: 0 + - _UseMain2ndTex: 0 + - _UseMain3rdTex: 0 + - _UseMatCap: 0 + - _UseMatCap2nd: 0 + - _UseOutline: 0 + - _UsePOM: 0 + - _UseParallax: 0 + - _UseReflection: 0 + - _UseRim: 0 + - _UseRimShade: 0 + - _UseSecondaryCutout: 0 + - _UseShadow: 0 + - _UseTLB: 0 + - _VertexColorBlueAffectOutlineWitdh: 0 + - _VertexColorGreenControlSelfShadowThreshold: 0 + - _VertexColorRedControlSmoothObjectNormal: 0 + - _VertexLightStrength: 0 + - _ZClip: 1 + - _ZTest: 4 + - _ZWrite: 0 + - _e2gai: 2 + - _e2gci: 2 + - _egai: 2 + - _egci: 2 + - _lilDirectionalLightStrength: 1 + - _lilShadowCasterBias: 0 + - _lilToonVersion: 42 + m_Colors: + - _AudioLinkDefaultValue: {r: 0, g: 0, b: 2, a: 0.75} + - _AudioLinkLocalMapParams: {r: 120, g: 1, b: 0, a: 0} + - _AudioLinkMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _AudioLinkStart: {r: 0, g: 0, b: 0, a: 0} + - _AudioLinkUVParams: {r: 0.25, g: 0, b: 0, a: 0.125} + - _AudioLinkVertexStart: {r: 0, g: 0, b: 0, a: 0} + - _AudioLinkVertexStrength: {r: 0, g: 0, b: 0, a: 1} + - _AudioLinkVertexUVParams: {r: 0.25, g: 0, b: 0, a: 0.125} + - _BackfaceColor: {r: 0, g: 0, b: 0, a: 0} + - _BacklightColor: {r: 0.85, g: 0.8, b: 0.7, a: 1} + - _BaseColor: {r: 0, g: 0.68, b: 2.9960785, a: 1} + - _Color: {r: 0, g: 0.68, b: 2.9960785, a: 1} + - _Color2nd: {r: 1, g: 1, b: 1, a: 1} + - _Color3rd: {r: 1, g: 1, b: 1, a: 1} + - _CustomLightDirection: {r: 0, g: 0, b: 10, a: 0} + - _DissolveColor: {r: 1, g: 1, b: 1, a: 1} + - _DissolveNoiseMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _DissolveParams: {r: 0, g: 0, b: 0.5, a: 0.1} + - _DissolvePos: {r: 0, g: 0, b: 0, a: 0} + - _DistanceFade: {r: 0.1, g: 0.01, b: 0, a: 0} + - _DistanceFadeColor: {r: 0, g: 0, b: 0, a: 1} + - _DistanceFadeRimColor: {r: 0, g: 0, b: 0, a: 0} + - _Emission2ndBlendMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _Emission2ndBlink: {r: 0, g: 0, b: 3.141593, a: 0} + - _Emission2ndColor: {r: 1, g: 1, b: 1, a: 1} + - _Emission2ndMap_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _EmissionBlendMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _EmissionBlink: {r: 0, g: 0, b: 3.141593, a: 0} + - _EmissionColor: {r: 1, g: 1, b: 1, a: 1} + - _EmissionMap_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _GemEnvColor: {r: 1, g: 1, b: 1, a: 1} + - _GemParticleColor: {r: 4, g: 4, b: 4, a: 1} + - _GlitterAtras: {r: 1, g: 1, b: 0, a: 0} + - _GlitterColor: {r: 1, g: 1, b: 1, a: 1} + - _GlitterParams1: {r: 256, g: 256, b: 0.16, a: 50} + - _GlitterParams2: {r: 0.25, g: 0, b: 0, a: 0} + - _GlossColor: {r: 1, g: 1, b: 1, a: 1} + - _Glow_Color: {r: 1, g: 1, b: 1, a: 1} + - _HighlightColor: {r: 0, g: 0.020439148, b: 1, a: 1} + - _Keys: {r: 0, g: 0, b: 0, a: 0} + - _LightDirectionOverride: {r: 0, g: 0.001, b: 0, a: 0} + - _Main2ndDissolveColor: {r: 1, g: 1, b: 1, a: 1} + - _Main2ndDissolveNoiseMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _Main2ndDissolveParams: {r: 0, g: 0, b: 0.5, a: 0.1} + - _Main2ndDissolvePos: {r: 0, g: 0, b: 0, a: 0} + - _Main2ndDistanceFade: {r: 0.1, g: 0.01, b: 0, a: 0} + - _Main2ndTexDecalAnimation: {r: 1, g: 1, b: 1, a: 30} + - _Main2ndTexDecalSubParam: {r: 1, g: 1, b: 0, a: 1} + - _Main2ndTex_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _Main3rdDissolveColor: {r: 1, g: 1, b: 1, a: 1} + - _Main3rdDissolveNoiseMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _Main3rdDissolveParams: {r: 0, g: 0, b: 0.5, a: 0.1} + - _Main3rdDissolvePos: {r: 0, g: 0, b: 0, a: 0} + - _Main3rdDistanceFade: {r: 0.1, g: 0.01, b: 0, a: 0} + - _Main3rdTexDecalAnimation: {r: 1, g: 1, b: 1, a: 30} + - _Main3rdTexDecalSubParam: {r: 1, g: 1, b: 0, a: 1} + - _Main3rdTex_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _MainColor: {r: 1, g: 1, b: 1, a: 1} + - _MainTexHSVG: {r: 0, g: 1, b: 1, a: 1} + - _MainTex_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _MatCap2ndBlendUV1: {r: 0, g: 0, b: 0, a: 0} + - _MatCap2ndColor: {r: 1, g: 1, b: 1, a: 1} + - _MatCapBlendUV1: {r: 0, g: 0, b: 0, a: 0} + - _MatCapColor: {r: 1, g: 1, b: 1, a: 1} + - _ObjPosi: {r: 0, g: 0, b: 0, a: 0} + - _ObjectForward: {r: 0, g: 0, b: 0, a: 0} + - _ObjectRight: {r: 0, g: 0, b: 0, a: 0} + - _OutResi: {r: 1, g: 1, b: 1, a: 1} + - _OutlineColor: {r: 0.6, g: 0.56, b: 0.73, a: 1} + - _OutlineLitColor: {r: 1, g: 0.19999996, b: 0, a: 0} + - _OutlineOffset: {r: 0, g: 0, b: 0, a: 1} + - _OutlineTexHSVG: {r: 0, g: 1, b: 1, a: 1} + - _OutlineTex_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _OverallShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _PTCol: {r: 0, g: 0, b: 0, a: 1} + - _PrevPosition: {r: 0, g: 0, b: 0, a: 0} + - _ReflectionColor: {r: 1, g: 1, b: 1, a: 1} + - _ReflectionCubeColor: {r: 0, g: 0, b: 0, a: 1} + - _RimColor: {r: 1, g: 1, b: 1, a: 1} + - _RimIndirColor: {r: 1, g: 1, b: 1, a: 1} + - _RimLigPosi: {r: 1, g: 1, b: 1, a: 1} + - _RimLightColor: {r: 1, g: 1, b: 1, a: 1} + - _RimShadeColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + - _SSAOColor: {r: 0, g: 0, b: 0, a: 0} + - _SelfLitColor: {r: 1, g: 1, b: 1, a: 1} + - _SelfShadowRealTimeShadowColor: {r: 1, g: 1, b: 1, a: 1} + - _Shadow2ndColor: {r: 0, g: 0, b: 0, a: 0} + - _Shadow3rdColor: {r: 0, g: 0, b: 0, a: 0} + - _ShadowAOShift: {r: 1, g: 0, b: 1, a: 0} + - _ShadowAOShift2: {r: 1, g: 0, b: 1, a: 0} + - _ShadowBorderColor: {r: 1, g: 0, b: 0, a: 1} + - _ShadowColor: {r: 0.7, g: 0.75, b: 0.85, a: 1} + - _ShadowTColor: {r: 1, g: 1, b: 1, a: 1} + - _XYZPosition: {r: 0, g: 0, b: 0, a: 0} + - _e2ga0: {r: 1, g: 0, b: 0, a: 0} + - _e2ga1: {r: 1, g: 0, b: 0, a: 1} + - _e2ga2: {r: 1, g: 0, b: 0, a: 0} + - _e2ga3: {r: 1, g: 0, b: 0, a: 0} + - _e2ga4: {r: 1, g: 0, b: 0, a: 0} + - _e2ga5: {r: 1, g: 0, b: 0, a: 0} + - _e2ga6: {r: 1, g: 0, b: 0, a: 0} + - _e2ga7: {r: 1, g: 0, b: 0, a: 0} + - _e2gc0: {r: 1, g: 1, b: 1, a: 0} + - _e2gc1: {r: 1, g: 1, b: 1, a: 1} + - _e2gc2: {r: 1, g: 1, b: 1, a: 0} + - _e2gc3: {r: 1, g: 1, b: 1, a: 0} + - _e2gc4: {r: 1, g: 1, b: 1, a: 0} + - _e2gc5: {r: 1, g: 1, b: 1, a: 0} + - _e2gc6: {r: 1, g: 1, b: 1, a: 0} + - _e2gc7: {r: 1, g: 1, b: 1, a: 0} + - _ega0: {r: 1, g: 0, b: 0, a: 0} + - _ega1: {r: 1, g: 0, b: 0, a: 1} + - _ega2: {r: 1, g: 0, b: 0, a: 0} + - _ega3: {r: 1, g: 0, b: 0, a: 0} + - _ega4: {r: 1, g: 0, b: 0, a: 0} + - _ega5: {r: 1, g: 0, b: 0, a: 0} + - _ega6: {r: 1, g: 0, b: 0, a: 0} + - _ega7: {r: 1, g: 0, b: 0, a: 0} + - _egc0: {r: 1, g: 1, b: 1, a: 0} + - _egc1: {r: 1, g: 1, b: 1, a: 1} + - _egc2: {r: 1, g: 1, b: 1, a: 0} + - _egc3: {r: 1, g: 1, b: 1, a: 0} + - _egc4: {r: 1, g: 1, b: 1, a: 0} + - _egc5: {r: 1, g: 1, b: 1, a: 0} + - _egc6: {r: 1, g: 1, b: 1, a: 0} + - _egc7: {r: 1, g: 1, b: 1, a: 0} + m_BuildTextureStacks: [] + m_AllowLocking: 1 diff --git a/Assets/04_Models/Characters/Fariy/Materials/Komono/Jewel_Blue.mat.meta b/Assets/04_Models/Characters/Fariy/Materials/Komono/Jewel_Blue.mat.meta new file mode 100644 index 00000000..285ec83e --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Materials/Komono/Jewel_Blue.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 54d340b7837b65346af0333fa5c8f9a8 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/04_Models/Characters/Fariy/Materials/Komono/Metal_Gold.mat b/Assets/04_Models/Characters/Fariy/Materials/Komono/Metal_Gold.mat new file mode 100644 index 00000000..81fc02a7 --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Materials/Komono/Metal_Gold.mat @@ -0,0 +1,996 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Metal_Gold + m_Shader: {fileID: 4800000, guid: 6459b2db96a08ca41b0f9b39dc7ad59e, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: + - N_F_DDMD_ON + - N_F_EAL_ON + - N_F_O_ON + - N_F_RDC_ON + - N_F_RELGI_ON + - N_F_SS_ON + - N_F_TRANSAFFSHA_ON + - _UVSET_UV0 + m_InvalidKeywords: [] + m_LightmapFlags: 0 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AnisotropyScaleMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AnisotropyShiftNoiseMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AnisotropyTangentMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AudioLinkLocalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AudioLinkMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BacklightColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BaseColorMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BaseMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Bump2ndMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Bump2ndScaleMask: + m_Texture: {fileID: 0} + 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} + - _DissolveMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DissolveNoiseMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DitherTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Emission2ndBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Emission2ndGradTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Emission2ndMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionGradTex: + 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} + - _FReflection: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlitterColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlitterShapeTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlossTexture: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MCap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MCapMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main2ndBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main2ndDissolveMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main2ndDissolveNoiseMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main2ndTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main3rdBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main3rdDissolveMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main3rdDissolveNoiseMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main3rdTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainColorAdjustMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainGradationTex: + 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} + - _MaskGloss: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MaskReflection: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MaskSelfLit: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MaskTransparency: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCap2ndBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCap2ndBumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCap2ndTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCapBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCapBumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCapTex: + m_Texture: {fileID: 2800000, guid: a06ed8ab718f1884fa52fe010de1c3c7, type: 3} + 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} + - _NormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineVectorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineWidthControl: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineWidthMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _PTexture: + 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} + - _ReflectionColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ReflectionCubeTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _RimColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _RimShadeMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SecondaryCutout: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Shadow2ndColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Shadow3rdColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowBlurMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowBorderMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowColorTexture: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowStrengthMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowT: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SmoothnessTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _AAS: 0.0001 + - _AAStrength: 1 + - _AlpToCov: 0 + - _AlphaBaseCutout: 1 + - _AlphaBoostFA: 10 + - _AlphaMaskMode: 0 + - _AlphaMaskScale: 1 + - _AlphaMaskValue: 0 + - _AlphaToMask: 0 + - _Anisotropy2MatCap: 0 + - _Anisotropy2MatCap2nd: 0 + - _Anisotropy2Reflection: 0 + - _Anisotropy2ndBitangentWidth: 1 + - _Anisotropy2ndShift: 0 + - _Anisotropy2ndShiftNoiseScale: 0 + - _Anisotropy2ndSpecularStrength: 0 + - _Anisotropy2ndTangentWidth: 1 + - _AnisotropyBitangentWidth: 1 + - _AnisotropyScale: 1 + - _AnisotropyShift: 0 + - _AnisotropyShiftNoiseScale: 0 + - _AnisotropySpecularStrength: 1 + - _AnisotropyTangentWidth: 1 + - _ApplyReflection: 0 + - _ApplySpecular: 1 + - _ApplySpecularFA: 1 + - _AsOverlay: 0 + - _AsUnlit: 0 + - _AudioLink2Emission: 0 + - _AudioLink2Emission2nd: 0 + - _AudioLink2Emission2ndGrad: 0 + - _AudioLink2EmissionGrad: 0 + - _AudioLink2Main2nd: 0 + - _AudioLink2Main3rd: 0 + - _AudioLink2Vertex: 0 + - _AudioLinkAsLocal: 0 + - _AudioLinkMask_UVMode: 0 + - _AudioLinkUVMode: 1 + - _AudioLinkVertexUVMode: 1 + - _BackfaceForceShadow: 0 + - _BacklightBackfaceMask: 1 + - _BacklightBlur: 0.05 + - _BacklightBorder: 0.35 + - _BacklightDirectivity: 5 + - _BacklightMainStrength: 0 + - _BacklightNormalStrength: 1 + - _BacklightReceiveShadow: 1 + - _BacklightViewStrength: 1 + - _BeforeExposureLimit: 10000 + - _BitKey0: 0 + - _BitKey1: 0 + - _BitKey10: 0 + - _BitKey11: 0 + - _BitKey12: 0 + - _BitKey13: 0 + - _BitKey14: 0 + - _BitKey15: 0 + - _BitKey16: 0 + - _BitKey17: 0 + - _BitKey18: 0 + - _BitKey19: 0 + - _BitKey2: 0 + - _BitKey20: 0 + - _BitKey21: 0 + - _BitKey22: 0 + - _BitKey23: 0 + - _BitKey24: 0 + - _BitKey25: 0 + - _BitKey26: 0 + - _BitKey27: 0 + - _BitKey28: 0 + - _BitKey29: 0 + - _BitKey3: 0 + - _BitKey30: 0 + - _BitKey31: 0 + - _BitKey4: 0 + - _BitKey5: 0 + - _BitKey6: 0 + - _BitKey7: 0 + - _BitKey8: 0 + - _BitKey9: 0 + - _BleModDest: 0 + - _BleModSour: 1 + - _BlendOp: 0 + - _BlendOpAlpha: 0 + - _BlendOpAlphaFA: 4 + - _BlendOpFA: 4 + - _Bump2ndMap_UVMode: 0 + - _Bump2ndScale: 1 + - _BumpScale: 1 + - _ClipAdju: 0 + - _ColorMask: 15 + - _Compa: 4 + - _ComputeMeshIndex: 0 + - _Cull: 0 + - _Culling: 2 + - _CustomLightDirectionFollowObjectRotation: 0 + - _CustomLightDirectionIntensity: 0 + - _Cutoff: 0.5 + - _Cutout: 0.5 + - _DepthThreshold: 900 + - _DirectionalLightIntensity: 1 + - _DissolveNoiseStrength: 0.1 + - _DistanceFadeMode: 0 + - _DistanceFadeRimFresnelPower: 5 + - _DitherMaxValue: 255 + - _DoubleSidedOutline: 1 + - _DstBlend: 0 + - _DstBlendAlpha: 10 + - _DstBlendAlphaFA: 1 + - _DstBlendFA: 1 + - _DummyProperty: 0 + - _DynamicNoisyOutline: 0 + - _Emission2ndBlend: 1 + - _Emission2ndBlendMode: 1 + - _Emission2ndFluorescence: 0 + - _Emission2ndGradSpeed: 1 + - _Emission2ndMainStrength: 0 + - _Emission2ndMap_UVMode: 0 + - _Emission2ndParallaxDepth: 0 + - _Emission2ndUseGrad: 0 + - _EmissionBlend: 1 + - _EmissionBlendMode: 1 + - _EmissionFluorescence: 0 + - _EmissionGradSpeed: 1 + - _EmissionMainStrength: 0 + - _EmissionMap_UVMode: 0 + - _EmissionParallaxDepth: 0 + - _EmissionUseGrad: 0 + - _EnvironmentalLightingIntensity: 1 + - _FarDistanceMaxWidth: 10 + - _FlipNormal: 0 + - _GIFlatShade: 0 + - _GIShadeThreshold: 0 + - _GSAAStrength: 0 + - _GlitterAngleRandomize: 0 + - _GlitterApplyShape: 0 + - _GlitterApplyTransparency: 1 + - _GlitterBackfaceMask: 0 + - _GlitterColorTex_UVMode: 0 + - _GlitterEnableLighting: 1 + - _GlitterMainStrength: 0 + - _GlitterNormalStrength: 1 + - _GlitterPostContrast: 1 + - _GlitterScaleRandomize: 0 + - _GlitterSensitivity: 0.25 + - _GlitterShadowMask: 0 + - _GlitterUVMode: 0 + - _GlitterVRParallaxStrength: 1 + - _GlossColorPower: 10 + - _GlossIntensity: 1 + - _GlossSoftness: 0 + - _GlossTextureFollowLight: 0 + - _GlossTextureFollowObjectRotation: 0 + - _GlossTextureRotate: 0 + - _GlossTextureSoftness: 0 + - _Glossiness: 0.6 + - _Glow_Edge_Width: 1 + - _HighlightColorPower: 5 + - _IDMask1: 0 + - _IDMask2: 0 + - _IDMask3: 0 + - _IDMask4: 0 + - _IDMask5: 0 + - _IDMask6: 0 + - _IDMask7: 0 + - _IDMask8: 0 + - _IDMaskCompile: 0 + - _IDMaskControlsDissolve: 0 + - _IDMaskFrom: 8 + - _IDMaskIndex1: 0 + - _IDMaskIndex2: 0 + - _IDMaskIndex3: 0 + - _IDMaskIndex4: 0 + - _IDMaskIndex5: 0 + - _IDMaskIndex6: 0 + - _IDMaskIndex7: 0 + - _IDMaskIndex8: 0 + - _IDMaskIsBitmap: 0 + - _IDMaskPrior1: 0 + - _IDMaskPrior2: 0 + - _IDMaskPrior3: 0 + - _IDMaskPrior4: 0 + - _IDMaskPrior5: 0 + - _IDMaskPrior6: 0 + - _IDMaskPrior7: 0 + - _IDMaskPrior8: 0 + - _IgnoreEncryption: 0 + - _Invisible: 0 + - _LLI_Max: 1 + - _LLI_Min: 0 + - _LigIgnoYNorDir: 0 + - _LightAffectOutlineColor: 0 + - _LightAffectRimLightColor: 0 + - _LightAffectShadow: 0 + - _LightFalloffAffectShadowT: 0 + - _LightFalloffSoftness: 1 + - _LightIntensity: 1 + - _LightMaxLimit: 1 + - _LightMinLimit: 0.05 + - _MCIALO: 0 + - _MCapIntensity: 1 + - _MVCOL: 0 + - _MaiColPo: 0.8 + - _Main2ndDissolveNoiseStrength: 0.1 + - _Main2ndEnableLighting: 1 + - _Main2ndTexAlphaMode: 0 + - _Main2ndTexAngle: 0 + - _Main2ndTexBlendMode: 0 + - _Main2ndTexIsDecal: 0 + - _Main2ndTexIsLeftOnly: 0 + - _Main2ndTexIsMSDF: 0 + - _Main2ndTexIsRightOnly: 0 + - _Main2ndTexShouldCopy: 0 + - _Main2ndTexShouldFlipCopy: 0 + - _Main2ndTexShouldFlipMirror: 0 + - _Main2ndTex_Cull: 0 + - _Main2ndTex_UVMode: 0 + - _Main3rdDissolveNoiseStrength: 0.1 + - _Main3rdEnableLighting: 1 + - _Main3rdTexAlphaMode: 0 + - _Main3rdTexAngle: 0 + - _Main3rdTexBlendMode: 0 + - _Main3rdTexIsDecal: 0 + - _Main3rdTexIsLeftOnly: 0 + - _Main3rdTexIsMSDF: 0 + - _Main3rdTexIsRightOnly: 0 + - _Main3rdTexShouldCopy: 0 + - _Main3rdTexShouldFlipCopy: 0 + - _Main3rdTexShouldFlipMirror: 0 + - _Main3rdTex_Cull: 0 + - _Main3rdTex_UVMode: 0 + - _MainGradationStrength: 0 + - _MatCap2ndApplyTransparency: 1 + - _MatCap2ndBackfaceMask: 0 + - _MatCap2ndBlend: 1 + - _MatCap2ndBlendMode: 1 + - _MatCap2ndBumpScale: 1 + - _MatCap2ndCustomNormal: 0 + - _MatCap2ndEnableLighting: 1 + - _MatCap2ndLod: 0 + - _MatCap2ndMainStrength: 0 + - _MatCap2ndNormalStrength: 1 + - _MatCap2ndPerspective: 1 + - _MatCap2ndShadowMask: 0 + - _MatCap2ndVRParallaxStrength: 1 + - _MatCap2ndZRotCancel: 1 + - _MatCapApplyTransparency: 1 + - _MatCapBackfaceMask: 0 + - _MatCapBlend: 1 + - _MatCapBlendMode: 3 + - _MatCapBumpScale: 1 + - _MatCapCustomNormal: 0 + - _MatCapEnableLighting: 0 + - _MatCapLod: 0 + - _MatCapMainStrength: 0 + - _MatCapNormalStrength: 1 + - _MatCapPerspective: 1 + - _MatCapShadowMask: 0 + - _MatCapVRParallaxStrength: 1 + - _MatCapZRotCancel: 1 + - _MaxFadDistance: 2 + - _Metallic: 0 + - _MinFadDistance: 0 + - _MixMainTexToOutline: 0 + - _MonochromeLighting: 0 + - _N_F_ANIS: 0 + - _N_F_CA: 0 + - _N_F_CLD: 0 + - _N_F_CO: 0 + - _N_F_COEDGL: 0 + - _N_F_DCS: 0 + - _N_F_DDMD: 1 + - _N_F_EAL: 1 + - _N_F_ESSAO: 0 + - _N_F_FR: 0 + - _N_F_GLO: 0 + - _N_F_GLOT: 0 + - _N_F_HDLS: 0 + - _N_F_HPSS: 0 + - _N_F_LLI: 0 + - _N_F_MC: 0 + - _N_F_MSSOLTFO: 0 + - _N_F_NFD: 0 + - _N_F_NLASOBF: 0 + - _N_F_NM: 0 + - _N_F_O: 1 + - _N_F_OFLMB: 0 + - _N_F_PA: 0 + - _N_F_PT: 0 + - _N_F_R: 0 + - _N_F_RDC: 1 + - _N_F_RL: 0 + - _N_F_RLIS: 0 + - _N_F_SCO: 0 + - _N_F_SCT: 0 + - _N_F_SE: 0 + - _N_F_SL: 0 + - _N_F_SLMM: 0 + - _N_F_SON: 0 + - _N_F_SS: 1 + - _N_F_ST: 0 + - _N_F_STIAL: 0 + - _N_F_STIS: 0 + - _N_F_STSDFM: 0 + - _N_F_TP: 0 + - _NoiTexAffStraWidt: 0 + - _NoisTexInten: 1 + - _NoiseSize: 100 + - _NoisyOutlineIntensity: 0 + - _NorMapAsDis: 0 + - _NormalMapIntensity: 1 + - _ObjePosiZCS: 0 + - _OffsetFactor: 0 + - _OffsetUnits: 0 + - _Opacity: 1 + - _Oper: 0 + - _OutStenPass: 0 + - _OutZTest: 4 + - _OutZWrite: 1 + - _OutlineAlphaToMask: 0 + - _OutlineBlendOp: 0 + - _OutlineBlendOpAlpha: 0 + - _OutlineBlendOpAlphaFA: 4 + - _OutlineBlendOpFA: 4 + - _OutlineColorMask: 15 + - _OutlineCull: 1 + - _OutlineDeleteMesh: 0 + - _OutlineDisableInVR: 0 + - _OutlineDstBlend: 0 + - _OutlineDstBlendAlpha: 10 + - _OutlineDstBlendAlphaFA: 1 + - _OutlineDstBlendFA: 1 + - _OutlineEnableLighting: 1 + - _OutlineExtrudeMethod: 0 + - _OutlineFixWidth: 0.5 + - _OutlineLitApplyTex: 0 + - _OutlineLitOffset: -8 + - _OutlineLitScale: 10 + - _OutlineLitShadowReceive: 0 + - _OutlineOffsetFactor: 0 + - _OutlineOffsetUnits: 0 + - _OutlineSrcBlend: 1 + - _OutlineSrcBlendAlpha: 1 + - _OutlineSrcBlendAlphaFA: 0 + - _OutlineSrcBlendFA: 1 + - _OutlineStencilComp: 8 + - _OutlineStencilFail: 0 + - _OutlineStencilPass: 0 + - _OutlineStencilReadMask: 255 + - _OutlineStencilRef: 0 + - _OutlineStencilWriteMask: 255 + - _OutlineStencilZFail: 0 + - _OutlineVectorScale: 1 + - _OutlineVectorUVMode: 0 + - _OutlineVertexR2Width: 0 + - _OutlineWidth: 0.08 + - _OutlineWidthAffectedByViewDistance: 0 + - _OutlineZBias: 0 + - _OutlineZClip: 1 + - _OutlineZPostionInCamera: 0 + - _OutlineZTest: 2 + - _OutlineZWrite: 1 + - _OverallShadowColorPower: 1 + - _PADist: 0 + - _PASize: 0.5 + - _PASmooTrans: 1 + - _PSGLOTEX: 0 + - _PTexturePower: 1 + - _Parallax: 0.02 + - _ParallaxOffset: 0.5 + - _PointSpotlightIntensity: 1 + - _PresAdju: 1 + - _RELG: 1 + - _RQSO: 0 + - _ReduSha: 0.5 + - _RefMetallic: 0 + - _RefVal: 0 + - _Reflectance: 0.04 + - _ReflectionApplyTransparency: 1 + - _ReflectionBlendMode: 1 + - _ReflectionCubeEnableLighting: 1 + - _ReflectionCubeOverride: 0 + - _ReflectionIntensity: 0 + - _ReflectionNormalStrength: 1 + - _RimApplyTransparency: 1 + - _RimBackfaceMask: 0 + - _RimBlendMode: 1 + - _RimBlur: 0.1 + - _RimBorder: 0.5 + - _RimDirRange: 0 + - _RimDirStrength: 0 + - _RimEnableLighting: 1 + - _RimFresnelPower: 3 + - _RimIndirBlur: 0.1 + - _RimIndirBorder: 0.5 + - _RimIndirRange: 0 + - _RimLigInt: 1 + - _RimLightColorPower: 10 + - _RimLightInLight: 1 + - _RimLightSoftness: 1 + - _RimLightUnfill: 1.5 + - _RimMainStrength: 0 + - _RimNormalStrength: 1 + - _RimShadeBlur: 1 + - _RimShadeBorder: 0.5 + - _RimShadeFresnelPower: 1 + - _RimShadeNormalStrength: 1 + - _RimShadowMask: 0 + - _RimVRParallaxStrength: 1 + - _SPECIN: 1 + - _SPECMODE: 0 + - _STIL: 0 + - _Saturation: 1 + - _SelfLitHighContrast: 1 + - _SelfLitIntensity: 0 + - _SelfLitPower: 2 + - _SelfShadowAffectedByLightShadowStrength: 0 + - _SelfShadowHardness: 1 + - _SelfShadowRealTimeShadowColorPower: 1 + - _SelfShadowRealtimeShadowIntensity: 0 + - _SelfShadowShadowTAtViewDirection: 0 + - _SelfShadowThreshold: 0.93 + - _Shadow2ndBlur: 0.3 + - _Shadow2ndBorder: 0.5 + - _Shadow2ndNormalStrength: 1 + - _Shadow2ndReceive: 0 + - _Shadow3rdBlur: 0.1 + - _Shadow3rdBorder: 0.25 + - _Shadow3rdNormalStrength: 1 + - _Shadow3rdReceive: 0 + - _ShadowBlur: 0.1 + - _ShadowBlurMaskLOD: 0 + - _ShadowBorder: 0.1 + - _ShadowBorderMaskLOD: 0 + - _ShadowBorderRange: 0 + - _ShadowColorTexturePower: 0 + - _ShadowColorType: 0 + - _ShadowEnvStrength: 0 + - _ShadowFlatBlur: 1 + - _ShadowFlatBorder: 1 + - _ShadowHardness: 0 + - _ShadowMainStrength: 1 + - _ShadowMaskType: 0 + - _ShadowNormalStrength: 1 + - _ShadowPostAO: 0 + - _ShadowReceive: 0 + - _ShadowStrength: 1 + - _ShadowStrengthMaskLOD: 0 + - _ShadowTColorPower: 1 + - _ShadowTHardness: 1 + - _ShadowTIntensity: 1 + - _ShadowTLightThreshold: 50 + - _ShadowTShadowThreshold: 0 + - _ShifAnis: 0 + - _ShiftBackfaceUV: 0 + - _ShowInAmbientLightShadowIntensity: 1 + - _ShowInAmbientLightShadowThreshold: 0.4 + - _ShowNormal: 0 + - _SimTrans: 0 + - _SkinMatrixIndex: 0 + - _SmoothObjectNormal: 0 + - _Smoothness: 1 + - _SpecularBlur: 0 + - _SpecularBorder: 0.5 + - _SpecularNormalStrength: 1 + - _SpecularToon: 1 + - _SrcBlend: 1 + - _SrcBlendAlpha: 1 + - _SrcBlendAlphaFA: 0 + - _SrcBlendFA: 1 + - _StencilComp: 8 + - _StencilFail: 0 + - _StencilPass: 0 + - _StencilReadMask: 255 + - _StencilRef: 0 + - _StencilWriteMask: 255 + - _StencilZFail: 0 + - _StraWidt: 10 + - _SubpassCutoff: 0.5 + - _TEXMCOLINT: 1 + - _TRANSMODE: 0 + - _TessEdge: 10 + - _TessFactorMax: 3 + - _TessShrink: 0 + - _TessStrength: 0.5 + - _TessellationFar: 1 + - _TessellationNear: 1 + - _TessellationSmoothness: 0.5 + - _TessellationTransition: 0.8 + - _TexturePatternStyle: 0 + - _TrailSize: 1.5 + - _TransAffSha: 1 + - _TransparentMode: 0 + - _TransparentThreshold: 0 + - _TriPlaBlend: 4 + - _TriPlaTile: 1 + - _UDIMDiscardCompile: 0 + - _UDIMDiscardMode: 0 + - _UDIMDiscardRow0_0: 0 + - _UDIMDiscardRow0_1: 0 + - _UDIMDiscardRow0_2: 0 + - _UDIMDiscardRow0_3: 0 + - _UDIMDiscardRow1_0: 0 + - _UDIMDiscardRow1_1: 0 + - _UDIMDiscardRow1_2: 0 + - _UDIMDiscardRow1_3: 0 + - _UDIMDiscardRow2_0: 0 + - _UDIMDiscardRow2_1: 0 + - _UDIMDiscardRow2_2: 0 + - _UDIMDiscardRow2_3: 0 + - _UDIMDiscardRow3_0: 0 + - _UDIMDiscardRow3_1: 0 + - _UDIMDiscardRow3_2: 0 + - _UDIMDiscardRow3_3: 0 + - _UDIMDiscardUV: 0 + - _UVSet: 0 + - _UseAnisotropy: 0 + - _UseAudioLink: 0 + - _UseBacklight: 0 + - _UseBump2ndMap: 0 + - _UseBumpMap: 0 + - _UseClippingCanceller: 0 + - _UseDither: 0 + - _UseEmission: 0 + - _UseEmission2nd: 0 + - _UseGlitter: 0 + - _UseMain2ndTex: 0 + - _UseMain3rdTex: 0 + - _UseMatCap: 1 + - _UseMatCap2nd: 0 + - _UseOutline: 0 + - _UsePOM: 0 + - _UseParallax: 0 + - _UseReflection: 0 + - _UseRim: 0 + - _UseRimShade: 0 + - _UseSecondaryCutout: 0 + - _UseShadow: 0 + - _UseTLB: 0 + - _VertexColorBlueAffectOutlineWitdh: 0 + - _VertexColorGreenControlSelfShadowThreshold: 0 + - _VertexColorRedControlSmoothObjectNormal: 0 + - _VertexLightStrength: 0 + - _ZClip: 1 + - _ZTest: 4 + - _ZWrite: 1 + - _e2gai: 2 + - _e2gci: 2 + - _egai: 2 + - _egci: 2 + - _lilDirectionalLightStrength: 1 + - _lilShadowCasterBias: 0 + - _lilToonVersion: 42 + m_Colors: + - _AudioLinkDefaultValue: {r: 0, g: 0, b: 2, a: 0.75} + - _AudioLinkLocalMapParams: {r: 120, g: 1, b: 0, a: 0} + - _AudioLinkMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _AudioLinkStart: {r: 0, g: 0, b: 0, a: 0} + - _AudioLinkUVParams: {r: 0.25, g: 0, b: 0, a: 0.125} + - _AudioLinkVertexStart: {r: 0, g: 0, b: 0, a: 0} + - _AudioLinkVertexStrength: {r: 0, g: 0, b: 0, a: 1} + - _AudioLinkVertexUVParams: {r: 0.25, g: 0, b: 0, a: 0.125} + - _BackfaceColor: {r: 0, g: 0, b: 0, a: 0} + - _BacklightColor: {r: 0.85, g: 0.8, b: 0.7, a: 1} + - _BaseColor: {r: 1, g: 0.7405456, b: 0, a: 1} + - _Color: {r: 1, g: 0.7405456, b: 0, a: 1} + - _Color2nd: {r: 1, g: 1, b: 1, a: 1} + - _Color3rd: {r: 1, g: 1, b: 1, a: 1} + - _CustomLightDirection: {r: 0, g: 0, b: 10, a: 0} + - _DissolveColor: {r: 1, g: 1, b: 1, a: 1} + - _DissolveNoiseMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _DissolveParams: {r: 0, g: 0, b: 0.5, a: 0.1} + - _DissolvePos: {r: 0, g: 0, b: 0, a: 0} + - _DistanceFade: {r: 0.1, g: 0.01, b: 0, a: 0} + - _DistanceFadeColor: {r: 0, g: 0, b: 0, a: 1} + - _DistanceFadeRimColor: {r: 0, g: 0, b: 0, a: 0} + - _Emission2ndBlendMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _Emission2ndBlink: {r: 0, g: 0, b: 3.141593, a: 0} + - _Emission2ndColor: {r: 1, g: 1, b: 1, a: 1} + - _Emission2ndMap_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _EmissionBlendMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _EmissionBlink: {r: 0, g: 0, b: 3.141593, a: 0} + - _EmissionColor: {r: 1, g: 1, b: 1, a: 1} + - _EmissionMap_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _GlitterAtras: {r: 1, g: 1, b: 0, a: 0} + - _GlitterColor: {r: 1, g: 1, b: 1, a: 1} + - _GlitterParams1: {r: 256, g: 256, b: 0.16, a: 50} + - _GlitterParams2: {r: 0.25, g: 0, b: 0, a: 0} + - _GlossColor: {r: 1, g: 1, b: 1, a: 1} + - _Glow_Color: {r: 1, g: 1, b: 1, a: 1} + - _HighlightColor: {r: 0, g: 0.045587063, b: 1, a: 1} + - _Keys: {r: 0, g: 0, b: 0, a: 0} + - _LightDirectionOverride: {r: 0, g: 0.001, b: 0, a: 0} + - _Main2ndDissolveColor: {r: 1, g: 1, b: 1, a: 1} + - _Main2ndDissolveNoiseMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _Main2ndDissolveParams: {r: 0, g: 0, b: 0.5, a: 0.1} + - _Main2ndDissolvePos: {r: 0, g: 0, b: 0, a: 0} + - _Main2ndDistanceFade: {r: 0.1, g: 0.01, b: 0, a: 0} + - _Main2ndTexDecalAnimation: {r: 1, g: 1, b: 1, a: 30} + - _Main2ndTexDecalSubParam: {r: 1, g: 1, b: 0, a: 1} + - _Main2ndTex_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _Main3rdDissolveColor: {r: 1, g: 1, b: 1, a: 1} + - _Main3rdDissolveNoiseMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _Main3rdDissolveParams: {r: 0, g: 0, b: 0.5, a: 0.1} + - _Main3rdDissolvePos: {r: 0, g: 0, b: 0, a: 0} + - _Main3rdDistanceFade: {r: 0.1, g: 0.01, b: 0, a: 0} + - _Main3rdTexDecalAnimation: {r: 1, g: 1, b: 1, a: 30} + - _Main3rdTexDecalSubParam: {r: 1, g: 1, b: 0, a: 1} + - _Main3rdTex_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _MainColor: {r: 1, g: 1, b: 1, a: 1} + - _MainTexHSVG: {r: 0, g: 1, b: 1, a: 1} + - _MainTex_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _MatCap2ndBlendUV1: {r: 0, g: 0, b: 0, a: 0} + - _MatCap2ndColor: {r: 1, g: 1, b: 1, a: 1} + - _MatCapBlendUV1: {r: 0, g: 0, b: 0, a: 0} + - _MatCapColor: {r: 2.9960785, g: 2.9960785, b: 2.9960785, a: 1} + - _ObjPosi: {r: 0, g: 0, b: 0, a: 0} + - _ObjectForward: {r: 0, g: 0, b: 0, a: 0} + - _ObjectRight: {r: 0, g: 0, b: 0, a: 0} + - _OutResi: {r: 1, g: 1, b: 1, a: 1} + - _OutlineColor: {r: 0.6, g: 0.56, b: 0.73, a: 1} + - _OutlineLitColor: {r: 1, g: 0.19999996, b: 0, a: 0} + - _OutlineOffset: {r: 0, g: 0, b: 0, a: 1} + - _OutlineTexHSVG: {r: 0, g: 1, b: 1, a: 1} + - _OutlineTex_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _OverallShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _PTCol: {r: 0, g: 0, b: 0, a: 1} + - _PrevPosition: {r: 0, g: 0, b: 0, a: 0} + - _ReflectionColor: {r: 1, g: 1, b: 1, a: 1} + - _ReflectionCubeColor: {r: 0, g: 0, b: 0, a: 1} + - _RimColor: {r: 1, g: 1, b: 1, a: 1} + - _RimIndirColor: {r: 1, g: 1, b: 1, a: 1} + - _RimLigPosi: {r: 1, g: 1, b: 1, a: 1} + - _RimLightColor: {r: 1, g: 1, b: 1, a: 1} + - _RimShadeColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + - _SSAOColor: {r: 0, g: 0, b: 0, a: 0} + - _SelfLitColor: {r: 1, g: 1, b: 1, a: 1} + - _SelfShadowRealTimeShadowColor: {r: 1, g: 1, b: 1, a: 1} + - _Shadow2ndColor: {r: 0, g: 0, b: 0, a: 0} + - _Shadow3rdColor: {r: 0, g: 0, b: 0, a: 0} + - _ShadowAOShift: {r: 1, g: 0, b: 1, a: 0} + - _ShadowAOShift2: {r: 1, g: 0, b: 1, a: 0} + - _ShadowBorderColor: {r: 1, g: 0, b: 0, a: 1} + - _ShadowColor: {r: 0.7, g: 0.75, b: 0.85, a: 1} + - _ShadowTColor: {r: 1, g: 1, b: 1, a: 1} + - _XYZPosition: {r: 0, g: 0, b: 0, a: 0} + - _e2ga0: {r: 1, g: 0, b: 0, a: 0} + - _e2ga1: {r: 1, g: 0, b: 0, a: 1} + - _e2ga2: {r: 1, g: 0, b: 0, a: 0} + - _e2ga3: {r: 1, g: 0, b: 0, a: 0} + - _e2ga4: {r: 1, g: 0, b: 0, a: 0} + - _e2ga5: {r: 1, g: 0, b: 0, a: 0} + - _e2ga6: {r: 1, g: 0, b: 0, a: 0} + - _e2ga7: {r: 1, g: 0, b: 0, a: 0} + - _e2gc0: {r: 1, g: 1, b: 1, a: 0} + - _e2gc1: {r: 1, g: 1, b: 1, a: 1} + - _e2gc2: {r: 1, g: 1, b: 1, a: 0} + - _e2gc3: {r: 1, g: 1, b: 1, a: 0} + - _e2gc4: {r: 1, g: 1, b: 1, a: 0} + - _e2gc5: {r: 1, g: 1, b: 1, a: 0} + - _e2gc6: {r: 1, g: 1, b: 1, a: 0} + - _e2gc7: {r: 1, g: 1, b: 1, a: 0} + - _ega0: {r: 1, g: 0, b: 0, a: 0} + - _ega1: {r: 1, g: 0, b: 0, a: 1} + - _ega2: {r: 1, g: 0, b: 0, a: 0} + - _ega3: {r: 1, g: 0, b: 0, a: 0} + - _ega4: {r: 1, g: 0, b: 0, a: 0} + - _ega5: {r: 1, g: 0, b: 0, a: 0} + - _ega6: {r: 1, g: 0, b: 0, a: 0} + - _ega7: {r: 1, g: 0, b: 0, a: 0} + - _egc0: {r: 1, g: 1, b: 1, a: 0} + - _egc1: {r: 1, g: 1, b: 1, a: 1} + - _egc2: {r: 1, g: 1, b: 1, a: 0} + - _egc3: {r: 1, g: 1, b: 1, a: 0} + - _egc4: {r: 1, g: 1, b: 1, a: 0} + - _egc5: {r: 1, g: 1, b: 1, a: 0} + - _egc6: {r: 1, g: 1, b: 1, a: 0} + - _egc7: {r: 1, g: 1, b: 1, a: 0} + m_BuildTextureStacks: [] + m_AllowLocking: 1 diff --git a/Assets/04_Models/Characters/Fariy/Materials/Komono/Metal_Gold.mat.meta b/Assets/04_Models/Characters/Fariy/Materials/Komono/Metal_Gold.mat.meta new file mode 100644 index 00000000..288b9d33 --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Materials/Komono/Metal_Gold.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d65d67af019c21e4090c03f494b1958c +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/04_Models/Characters/Fariy/Materials/wing_effects.mat b/Assets/04_Models/Characters/Fariy/Materials/wing_effects.mat new file mode 100644 index 00000000..947fd2ef --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Materials/wing_effects.mat @@ -0,0 +1,137 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: wing_effects + m_Shader: {fileID: 4800000, guid: 0406db5a14f94604a8c57ccfbc9f3b46, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: + - _SURFACE_TYPE_TRANSPARENT + m_InvalidKeywords: + - _ALPHABLEND_ON + - _FLIPBOOKBLENDING_OFF + m_LightmapFlags: 0 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 3000 + stringTagMap: + RenderType: Transparent + disabledShaderPasses: + - GRABPASS + - DepthOnly + - SHADOWCASTER + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BaseMap: + m_Texture: {fileID: 2800000, guid: df447867c7b49b44eafa9aa27d119770, 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} + - _MainTex: + m_Texture: {fileID: 2800000, guid: df447867c7b49b44eafa9aa27d119770, type: 3} + 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_Ints: [] + m_Floats: + - _AlphaClip: 0 + - _AlphaToMask: 0 + - _Blend: 0 + - _BlendOp: 0 + - _BumpScale: 1 + - _CameraFadingEnabled: 0 + - _CameraFarFadeDistance: 2 + - _CameraNearFadeDistance: 1 + - _ColorMode: 0 + - _Cull: 2 + - _Cutoff: 0.759 + - _DetailNormalMapScale: 1 + - _DistortionBlend: 0.5 + - _DistortionEnabled: 0 + - _DistortionStrength: 1 + - _DistortionStrengthScaled: 0 + - _DstBlend: 10 + - _DstBlendAlpha: 10 + - _EmissionEnabled: 0 + - _FlipbookBlending: 0 + - _FlipbookMode: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _LightingEnabled: 0 + - _Metallic: 0 + - _Mode: 2 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _QueueOffset: 0 + - _SmoothnessTextureChannel: 0 + - _SoftParticlesEnabled: 0 + - _SoftParticlesFarFadeDistance: 1 + - _SoftParticlesNearFadeDistance: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 5 + - _SrcBlendAlpha: 1 + - _Surface: 1 + - _UVSec: 0 + - _ZWrite: 0 + m_Colors: + - _BaseColor: {r: 1.3041189, g: 1.3041189, b: 1.3041189, a: 1} + - _BaseColorAddSubDiff: {r: 0, g: 0, b: 0, a: 0} + - _CameraFadeParams: {r: 0, g: Infinity, b: 0, a: 0} + - _Color: {r: 1.3041189, g: 1.3041189, b: 1.3041189, a: 1} + - _ColorAddSubDiff: {r: 0, g: 0, b: 0, a: 0} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _SoftParticleFadeParams: {r: 0, g: 0, b: 0, a: 0} + m_BuildTextureStacks: [] + m_AllowLocking: 1 +--- !u!114 &7416825320795440829 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Editor::UnityEditor.Rendering.Universal.AssetVersion + version: 10 diff --git a/Assets/04_Models/Characters/Fariy/Materials/wing_effects.mat.meta b/Assets/04_Models/Characters/Fariy/Materials/wing_effects.mat.meta new file mode 100644 index 00000000..9919ad27 --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Materials/wing_effects.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 03eb55f12985e7a489f93579fdf8ce07 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/04_Models/Characters/Fariy/Materials/wing_mat.mat b/Assets/04_Models/Characters/Fariy/Materials/wing_mat.mat new file mode 100644 index 00000000..042f18cc --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Materials/wing_mat.mat @@ -0,0 +1,1027 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: wing_mat + m_Shader: {fileID: 4800000, guid: 6459b2db96a08ca41b0f9b39dc7ad59e, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: + - N_F_DDMD_ON + - N_F_EAL_ON + - N_F_LLI_ON + - N_F_O_ON + - N_F_RDC_ON + - N_F_RELGI_ON + - N_F_SS_ON + - N_F_TRANSAFFSHA_ON + - _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A + - _UVSET_UV0 + m_InvalidKeywords: + - UNITY_UI_CLIP_RECT + - _EMISSION + - _METALLICGLOSSMAP + - _REQUIRE_UV2 + - _SPECGLOSSMAP + m_LightmapFlags: 0 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _AlphaMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AnisotropyScaleMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AnisotropyShiftNoiseMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AnisotropyTangentMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AudioLinkLocalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AudioLinkMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BacklightColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BaseColorMap: + m_Texture: {fileID: 2800000, guid: cc50bff8e08ffa649877aa0890e95edf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BaseMap: + m_Texture: {fileID: 2800000, guid: cc50bff8e08ffa649877aa0890e95edf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Bump2ndMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Bump2ndScaleMask: + m_Texture: {fileID: 0} + 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} + - _DissolveMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DissolveNoiseMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DitherTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Emission2ndBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Emission2ndGradTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Emission2ndMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionGradTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 2800000, guid: cc50bff8e08ffa649877aa0890e95edf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _FReflection: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlitterColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlitterShapeTex: + m_Texture: {fileID: 2800000, guid: 6432d6f480a91aa4aa2ae56c90a08961, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _GlossTexture: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MCap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MCapMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main2ndBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main2ndDissolveMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main2ndDissolveNoiseMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main2ndTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main3rdBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main3rdDissolveMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main3rdDissolveNoiseMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main3rdTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainColorAdjustMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainGradationTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: cc50bff8e08ffa649877aa0890e95edf, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MaskGloss: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MaskReflection: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MaskSelfLit: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MaskTransparency: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCap2ndBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCap2ndBumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCap2ndTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCapBlendMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCapBumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCapTex: + m_Texture: {fileID: 2800000, guid: 7d34b02ec05d5a44c8a3e592ea8a3c3e, type: 3} + 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} + - _NormalMap: + 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} + - _OutlineTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineVectorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineWidthControl: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OutlineWidthMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _PTexture: + 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} + - _ReflectionColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ReflectionCubeTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _RimColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _RimShadeMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SecondaryCutout: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Shadow2ndColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Shadow3rdColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowBlurMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowBorderMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowColorTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowColorTexture: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowStrengthMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadowT: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SmoothnessTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _AAS: 0.0001 + - _AAStrength: 1 + - _AlpToCov: 0 + - _AlphaBaseCutout: 1 + - _AlphaBoostFA: 10 + - _AlphaMaskMode: 0 + - _AlphaMaskScale: 1 + - _AlphaMaskValue: 0 + - _AlphaToMask: 0 + - _Anisotropy2MatCap: 0 + - _Anisotropy2MatCap2nd: 0 + - _Anisotropy2Reflection: 0 + - _Anisotropy2ndBitangentWidth: 1 + - _Anisotropy2ndShift: 0 + - _Anisotropy2ndShiftNoiseScale: 0 + - _Anisotropy2ndSpecularStrength: 0 + - _Anisotropy2ndTangentWidth: 1 + - _AnisotropyBitangentWidth: 1 + - _AnisotropyScale: 1 + - _AnisotropyShift: 0 + - _AnisotropyShiftNoiseScale: 0 + - _AnisotropySpecularStrength: 1 + - _AnisotropyTangentWidth: 1 + - _ApplyReflection: 0 + - _ApplySpecular: 1 + - _ApplySpecularFA: 1 + - _AsOverlay: 0 + - _AsUnlit: 0 + - _AudioLink2Emission: 0 + - _AudioLink2Emission2nd: 0 + - _AudioLink2Emission2ndGrad: 0 + - _AudioLink2EmissionGrad: 0 + - _AudioLink2Main2nd: 0 + - _AudioLink2Main3rd: 0 + - _AudioLink2Vertex: 0 + - _AudioLinkAsLocal: 0 + - _AudioLinkMask_UVMode: 0 + - _AudioLinkUVMode: 1 + - _AudioLinkVertexUVMode: 1 + - _BackfaceForceShadow: 1 + - _BacklightBackfaceMask: 1 + - _BacklightBlur: 0.05 + - _BacklightBorder: 0.35 + - _BacklightDirectivity: 5 + - _BacklightMainStrength: 0 + - _BacklightNormalStrength: 1 + - _BacklightReceiveShadow: 1 + - _BacklightViewStrength: 1 + - _BeforeExposureLimit: 10000 + - _BitKey0: 0 + - _BitKey1: 0 + - _BitKey10: 0 + - _BitKey11: 0 + - _BitKey12: 0 + - _BitKey13: 0 + - _BitKey14: 0 + - _BitKey15: 0 + - _BitKey16: 0 + - _BitKey17: 0 + - _BitKey18: 0 + - _BitKey19: 0 + - _BitKey2: 0 + - _BitKey20: 0 + - _BitKey21: 0 + - _BitKey22: 0 + - _BitKey23: 0 + - _BitKey24: 0 + - _BitKey25: 0 + - _BitKey26: 0 + - _BitKey27: 0 + - _BitKey28: 0 + - _BitKey29: 0 + - _BitKey3: 0 + - _BitKey30: 0 + - _BitKey31: 0 + - _BitKey4: 0 + - _BitKey5: 0 + - _BitKey6: 0 + - _BitKey7: 0 + - _BitKey8: 0 + - _BitKey9: 0 + - _BleModDest: 0 + - _BleModSour: 1 + - _BlendOp: 0 + - _BlendOpAlpha: 0 + - _BlendOpAlphaFA: 4 + - _BlendOpFA: 4 + - _Bump2ndMap_UVMode: 0 + - _Bump2ndScale: 1 + - _BumpScale: 1 + - _ClipAdju: 0 + - _ColorMask: 15 + - _Compa: 4 + - _ComputeMeshIndex: 0 + - _Cull: 0 + - _Culling: 2 + - _CustomLightDirectionFollowObjectRotation: 0 + - _CustomLightDirectionIntensity: 0 + - _Cutoff: -0.001 + - _Cutout: 0.5 + - _DepthThreshold: 900 + - _DetailNormalMapScale: 1 + - _DirectionalLightIntensity: 2 + - _DissolveNoiseStrength: 0.1 + - _DistanceFadeMode: 0 + - _DistanceFadeRimFresnelPower: 5 + - _DitherMaxValue: 255 + - _DoubleSidedOutline: 1 + - _DstBlend: 10 + - _DstBlendAlpha: 10 + - _DstBlendAlphaFA: 1 + - _DstBlendFA: 1 + - _DummyProperty: 0 + - _DynamicNoisyOutline: 0 + - _Emission2ndBlend: 1 + - _Emission2ndBlendMode: 1 + - _Emission2ndFluorescence: 0 + - _Emission2ndGradSpeed: 1 + - _Emission2ndMainStrength: 0 + - _Emission2ndMap_UVMode: 0 + - _Emission2ndParallaxDepth: 0 + - _Emission2ndUseGrad: 0 + - _EmissionBlend: 1 + - _EmissionBlendMode: 1 + - _EmissionFluorescence: 0 + - _EmissionGradSpeed: 1 + - _EmissionMainStrength: 1 + - _EmissionMap_UVMode: 0 + - _EmissionParallaxDepth: 0 + - _EmissionUseGrad: 0 + - _EnvironmentalLightingIntensity: 2 + - _FarDistanceMaxWidth: 10 + - _FlipNormal: 0 + - _GIFlatShade: 0 + - _GIShadeThreshold: 0 + - _GSAAStrength: 0 + - _GlitterAngleRandomize: 0 + - _GlitterApplyShape: 1 + - _GlitterApplyTransparency: 1 + - _GlitterBackfaceMask: 0 + - _GlitterColorTex_UVMode: 0 + - _GlitterEnableLighting: 1 + - _GlitterMainStrength: 1 + - _GlitterNormalStrength: 1 + - _GlitterPostContrast: 1 + - _GlitterScaleRandomize: 1 + - _GlitterSensitivity: 0.9545943 + - _GlitterShadowMask: 0 + - _GlitterUVMode: 0 + - _GlitterVRParallaxStrength: 0 + - _GlossColorPower: 10 + - _GlossIntensity: 1 + - _GlossMapScale: 1 + - _GlossSoftness: 0 + - _GlossTextureFollowLight: 0 + - _GlossTextureFollowObjectRotation: 0 + - _GlossTextureRotate: 0 + - _GlossTextureSoftness: 0 + - _Glossiness: 0.25123277 + - _GlossyReflections: 1 + - _Glow_Edge_Width: 1 + - _HighlightColorPower: 10 + - _IDMask1: 0 + - _IDMask2: 0 + - _IDMask3: 0 + - _IDMask4: 0 + - _IDMask5: 0 + - _IDMask6: 0 + - _IDMask7: 0 + - _IDMask8: 0 + - _IDMaskCompile: 0 + - _IDMaskControlsDissolve: 0 + - _IDMaskFrom: 8 + - _IDMaskIndex1: 0 + - _IDMaskIndex2: 0 + - _IDMaskIndex3: 0 + - _IDMaskIndex4: 0 + - _IDMaskIndex5: 0 + - _IDMaskIndex6: 0 + - _IDMaskIndex7: 0 + - _IDMaskIndex8: 0 + - _IDMaskIsBitmap: 0 + - _IDMaskPrior1: 0 + - _IDMaskPrior2: 0 + - _IDMaskPrior3: 0 + - _IDMaskPrior4: 0 + - _IDMaskPrior5: 0 + - _IDMaskPrior6: 0 + - _IDMaskPrior7: 0 + - _IDMaskPrior8: 0 + - _IgnoreEncryption: 0 + - _Invisible: 0 + - _LLI_Max: 3 + - _LLI_Min: 1 + - _LigIgnoYNorDir: 0 + - _LightAffectOutlineColor: 0 + - _LightAffectRimLightColor: 0 + - _LightAffectShadow: 0 + - _LightFalloffAffectShadowT: 0 + - _LightFalloffSoftness: 1 + - _LightIntensity: 1 + - _LightMaxLimit: 1 + - _LightMinLimit: 0.05 + - _MCIALO: 0 + - _MCapIntensity: 1 + - _MVCOL: 0 + - _MaiColPo: 0.8 + - _Main2ndDissolveNoiseStrength: 0.1 + - _Main2ndEnableLighting: 1 + - _Main2ndTexAlphaMode: 0 + - _Main2ndTexAngle: 0 + - _Main2ndTexBlendMode: 0 + - _Main2ndTexIsDecal: 0 + - _Main2ndTexIsLeftOnly: 0 + - _Main2ndTexIsMSDF: 0 + - _Main2ndTexIsRightOnly: 0 + - _Main2ndTexShouldCopy: 0 + - _Main2ndTexShouldFlipCopy: 0 + - _Main2ndTexShouldFlipMirror: 0 + - _Main2ndTex_Cull: 0 + - _Main2ndTex_UVMode: 0 + - _Main3rdDissolveNoiseStrength: 0.1 + - _Main3rdEnableLighting: 1 + - _Main3rdTexAlphaMode: 0 + - _Main3rdTexAngle: 0 + - _Main3rdTexBlendMode: 0 + - _Main3rdTexIsDecal: 0 + - _Main3rdTexIsLeftOnly: 0 + - _Main3rdTexIsMSDF: 0 + - _Main3rdTexIsRightOnly: 0 + - _Main3rdTexShouldCopy: 0 + - _Main3rdTexShouldFlipCopy: 0 + - _Main3rdTexShouldFlipMirror: 0 + - _Main3rdTex_Cull: 0 + - _Main3rdTex_UVMode: 0 + - _MainGradationStrength: 0 + - _MatCap2ndApplyTransparency: 1 + - _MatCap2ndBackfaceMask: 0 + - _MatCap2ndBlend: 1 + - _MatCap2ndBlendMode: 1 + - _MatCap2ndBumpScale: 1 + - _MatCap2ndCustomNormal: 0 + - _MatCap2ndEnableLighting: 1 + - _MatCap2ndLod: 0 + - _MatCap2ndMainStrength: 0 + - _MatCap2ndNormalStrength: 1 + - _MatCap2ndPerspective: 1 + - _MatCap2ndShadowMask: 0 + - _MatCap2ndVRParallaxStrength: 1 + - _MatCap2ndZRotCancel: 1 + - _MatCapApplyTransparency: 1 + - _MatCapBackfaceMask: 0 + - _MatCapBlend: 1 + - _MatCapBlendMode: 2 + - _MatCapBumpScale: 1 + - _MatCapCustomNormal: 0 + - _MatCapEnableLighting: 1 + - _MatCapLod: 0 + - _MatCapMainStrength: 0 + - _MatCapNormalStrength: 1 + - _MatCapPerspective: 1 + - _MatCapShadowMask: 0 + - _MatCapVRParallaxStrength: 1 + - _MatCapZRotCancel: 1 + - _MaxFadDistance: 2 + - _Metallic: 0 + - _MinFadDistance: 0 + - _MixMainTexToOutline: 0 + - _Mode: 0 + - _MonochromeLighting: 0 + - _N_F_ANIS: 0 + - _N_F_CA: 0 + - _N_F_CLD: 0 + - _N_F_CO: 0 + - _N_F_COEDGL: 0 + - _N_F_DCS: 0 + - _N_F_DDMD: 1 + - _N_F_EAL: 1 + - _N_F_ESSAO: 0 + - _N_F_FR: 0 + - _N_F_GLO: 0 + - _N_F_GLOT: 0 + - _N_F_HDLS: 0 + - _N_F_HPSS: 0 + - _N_F_LLI: 1 + - _N_F_MC: 0 + - _N_F_MSSOLTFO: 0 + - _N_F_NFD: 0 + - _N_F_NLASOBF: 0 + - _N_F_NM: 0 + - _N_F_O: 1 + - _N_F_OFLMB: 0 + - _N_F_PA: 0 + - _N_F_PT: 0 + - _N_F_R: 0 + - _N_F_RDC: 1 + - _N_F_RL: 0 + - _N_F_RLIS: 0 + - _N_F_SCO: 0 + - _N_F_SCT: 0 + - _N_F_SE: 0 + - _N_F_SL: 0 + - _N_F_SLMM: 0 + - _N_F_SON: 0 + - _N_F_SS: 1 + - _N_F_ST: 0 + - _N_F_STIAL: 0 + - _N_F_STIS: 0 + - _N_F_STSDFM: 0 + - _N_F_TP: 0 + - _NoiTexAffStraWidt: 0 + - _NoisTexInten: 1 + - _NoiseSize: 100 + - _NoisyOutlineIntensity: 0 + - _NorMapAsDis: 0 + - _NormalMapIntensity: 1 + - _ObjePosiZCS: 0 + - _OcclusionStrength: 1 + - _OffsetFactor: 0 + - _OffsetUnits: 0 + - _Opacity: 1 + - _Oper: 0 + - _OutStenPass: 0 + - _OutZTest: 4 + - _OutZWrite: 1 + - _OutlineAlphaToMask: 0 + - _OutlineBlendOp: 0 + - _OutlineBlendOpAlpha: 0 + - _OutlineBlendOpAlphaFA: 4 + - _OutlineBlendOpFA: 4 + - _OutlineColorMask: 15 + - _OutlineCull: 1 + - _OutlineDeleteMesh: 0 + - _OutlineDisableInVR: 0 + - _OutlineDstBlend: 10 + - _OutlineDstBlendAlpha: 10 + - _OutlineDstBlendAlphaFA: 1 + - _OutlineDstBlendFA: 1 + - _OutlineEnableLighting: 1 + - _OutlineExtrudeMethod: 0 + - _OutlineFixWidth: 0.5 + - _OutlineLitApplyTex: 0 + - _OutlineLitOffset: -8 + - _OutlineLitScale: 10 + - _OutlineLitShadowReceive: 0 + - _OutlineOffsetFactor: 0 + - _OutlineOffsetUnits: 0 + - _OutlineSrcBlend: 5 + - _OutlineSrcBlendAlpha: 1 + - _OutlineSrcBlendAlphaFA: 0 + - _OutlineSrcBlendFA: 1 + - _OutlineStencilComp: 6 + - _OutlineStencilFail: 0 + - _OutlineStencilPass: 0 + - _OutlineStencilReadMask: 255 + - _OutlineStencilRef: 1 + - _OutlineStencilWriteMask: 255 + - _OutlineStencilZFail: 0 + - _OutlineVectorScale: 1 + - _OutlineVectorUVMode: 0 + - _OutlineVertexR2Width: 0 + - _OutlineWidth: 0.22 + - _OutlineWidthAffectedByViewDistance: 0 + - _OutlineZBias: 0 + - _OutlineZClip: 1 + - _OutlineZPostionInCamera: 0 + - _OutlineZTest: 2 + - _OutlineZWrite: 1 + - _OverallShadowColorPower: 1 + - _PADist: 0 + - _PASize: 0.5 + - _PASmooTrans: 1 + - _PSGLOTEX: 0 + - _PTexturePower: 1 + - _Parallax: 0.02 + - _ParallaxOffset: 0.5 + - _PointSpotlightIntensity: 1 + - _PresAdju: 1 + - _RELG: 1 + - _RQSO: 0 + - _ReduSha: 0.5 + - _RefMetallic: 0 + - _RefVal: 0 + - _Reflectance: 0.04 + - _ReflectionApplyTransparency: 1 + - _ReflectionBlendMode: 1 + - _ReflectionCubeEnableLighting: 1 + - _ReflectionCubeOverride: 0 + - _ReflectionIntensity: 0 + - _ReflectionNormalStrength: 1 + - _RimApplyTransparency: 1 + - _RimBackfaceMask: 1 + - _RimBlendMode: 1 + - _RimBlur: 0.65 + - _RimBorder: 0.33999997 + - _RimDirRange: 0 + - _RimDirStrength: 0 + - _RimEnableLighting: 1 + - _RimFresnelPower: 3.5 + - _RimIndirBlur: 0.1 + - _RimIndirBorder: 0.5 + - _RimIndirRange: 0 + - _RimLigInt: 1 + - _RimLightColorPower: 10 + - _RimLightInLight: 1 + - _RimLightSoftness: 1 + - _RimLightUnfill: 1.5 + - _RimMainStrength: 0 + - _RimNormalStrength: 1 + - _RimShadeBlur: 1 + - _RimShadeBorder: 0.5 + - _RimShadeFresnelPower: 1 + - _RimShadeNormalStrength: 1 + - _RimShadowMask: 0.5 + - _RimVRParallaxStrength: 1 + - _SPECIN: 1 + - _SPECMODE: 0 + - _STIL: 0 + - _Saturation: 1 + - _SelfLitHighContrast: 1 + - _SelfLitIntensity: 0 + - _SelfLitPower: 2 + - _SelfShadowAffectedByLightShadowStrength: 0 + - _SelfShadowHardness: 1 + - _SelfShadowRealTimeShadowColorPower: 1 + - _SelfShadowRealtimeShadowIntensity: 0 + - _SelfShadowShadowTAtViewDirection: 0 + - _SelfShadowThreshold: 1 + - _Shadow2ndBlur: 0.1 + - _Shadow2ndBorder: 0.15 + - _Shadow2ndNormalStrength: 1 + - _Shadow2ndReceive: 0 + - _Shadow3rdBlur: 0.1 + - _Shadow3rdBorder: 0.25 + - _Shadow3rdNormalStrength: 1 + - _Shadow3rdReceive: 0 + - _ShadowBlur: 0 + - _ShadowBlurMaskLOD: 0 + - _ShadowBorder: 0.78 + - _ShadowBorderMaskLOD: 0 + - _ShadowBorderRange: 0.08 + - _ShadowColorTexturePower: 0 + - _ShadowColorType: 0 + - _ShadowEnvStrength: 0 + - _ShadowFlatBlur: 1 + - _ShadowFlatBorder: 1 + - _ShadowHardness: 0 + - _ShadowMainStrength: 0 + - _ShadowMaskType: 0 + - _ShadowNormalStrength: 1 + - _ShadowPostAO: 0 + - _ShadowReceive: 0 + - _ShadowStrength: 1 + - _ShadowStrengthMaskLOD: 0 + - _ShadowTColorPower: 1 + - _ShadowTHardness: 1 + - _ShadowTIntensity: 1 + - _ShadowTLightThreshold: 50 + - _ShadowTShadowThreshold: 0 + - _ShifAnis: 0 + - _ShiftBackfaceUV: 0 + - _ShowInAmbientLightShadowIntensity: 1 + - _ShowInAmbientLightShadowThreshold: 0.4 + - _ShowNormal: 0 + - _SimTrans: 0 + - _SkinMatrixIndex: 0 + - _SmoothObjectNormal: 0 + - _Smoothness: 1 + - _SmoothnessTextureChannel: 0 + - _SpecularBlur: 0 + - _SpecularBorder: 0.5 + - _SpecularHighlights: 1 + - _SpecularNormalStrength: 1 + - _SpecularToon: 1 + - _SrcBlend: 1 + - _SrcBlendAlpha: 1 + - _SrcBlendAlphaFA: 0 + - _SrcBlendFA: 1 + - _StencilComp: 6 + - _StencilFail: 0 + - _StencilPass: 0 + - _StencilReadMask: 255 + - _StencilRef: 1 + - _StencilWriteMask: 255 + - _StencilZFail: 0 + - _StraWidt: 10 + - _SubpassCutoff: 0.5 + - _TEXMCOLINT: 1 + - _TRANSMODE: 0 + - _TessEdge: 10 + - _TessFactorMax: 3 + - _TessShrink: 0 + - _TessStrength: 0.5 + - _TessellationFar: 1 + - _TessellationNear: 1 + - _TessellationSmoothness: 0.5 + - _TessellationTransition: 0.8 + - _TexturePatternStyle: 0 + - _TrailSize: 1.5 + - _TransAffSha: 1 + - _TransparentMode: 2 + - _TransparentThreshold: 0 + - _TriPlaBlend: 4 + - _TriPlaTile: 1 + - _UDIMDiscardCompile: 0 + - _UDIMDiscardMode: 0 + - _UDIMDiscardRow0_0: 0 + - _UDIMDiscardRow0_1: 0 + - _UDIMDiscardRow0_2: 0 + - _UDIMDiscardRow0_3: 0 + - _UDIMDiscardRow1_0: 0 + - _UDIMDiscardRow1_1: 0 + - _UDIMDiscardRow1_2: 0 + - _UDIMDiscardRow1_3: 0 + - _UDIMDiscardRow2_0: 0 + - _UDIMDiscardRow2_1: 0 + - _UDIMDiscardRow2_2: 0 + - _UDIMDiscardRow2_3: 0 + - _UDIMDiscardRow3_0: 0 + - _UDIMDiscardRow3_1: 0 + - _UDIMDiscardRow3_2: 0 + - _UDIMDiscardRow3_3: 0 + - _UDIMDiscardUV: 0 + - _UVSec: 0 + - _UVSet: 0 + - _UseAnisotropy: 0 + - _UseAudioLink: 0 + - _UseBacklight: 0 + - _UseBump2ndMap: 0 + - _UseBumpMap: 0 + - _UseClippingCanceller: 0 + - _UseDither: 0 + - _UseEmission: 1 + - _UseEmission2nd: 0 + - _UseGlitter: 1 + - _UseMain2ndTex: 0 + - _UseMain3rdTex: 0 + - _UseMatCap: 1 + - _UseMatCap2nd: 0 + - _UseOutline: 0 + - _UsePOM: 0 + - _UseParallax: 0 + - _UseReflection: 0 + - _UseRim: 1 + - _UseRimShade: 0 + - _UseSecondaryCutout: 0 + - _UseShadow: 1 + - _UseTLB: 0 + - _VertexColorBlueAffectOutlineWitdh: 0 + - _VertexColorGreenControlSelfShadowThreshold: 0 + - _VertexColorRedControlSmoothObjectNormal: 0 + - _VertexLightStrength: 0 + - _ZClip: 1 + - _ZTest: 4 + - _ZWrite: 1 + - _e2gai: 2 + - _e2gci: 2 + - _egai: 2 + - _egci: 2 + - _lilDirectionalLightStrength: 1 + - _lilShadowCasterBias: 0 + - _lilToonVersion: 44 + m_Colors: + - _AudioLinkDefaultValue: {r: 0, g: 0, b: 2, a: 0.75} + - _AudioLinkLocalMapParams: {r: 120, g: 1, b: 0, a: 0} + - _AudioLinkMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _AudioLinkStart: {r: 0, g: 0, b: 0, a: 0} + - _AudioLinkUVParams: {r: 0.25, g: 0, b: 0, a: 0.125} + - _AudioLinkVertexStart: {r: 0, g: 0, b: 0, a: 0} + - _AudioLinkVertexStrength: {r: 0, g: 0, b: 0, a: 1} + - _AudioLinkVertexUVParams: {r: 0.25, g: 0, b: 0, a: 0.125} + - _BackfaceColor: {r: 0, g: 0, b: 0, a: 0} + - _BacklightColor: {r: 0.85, g: 0.8, b: 0.7, a: 1} + - _BaseColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _Color2nd: {r: 1, g: 1, b: 1, a: 1} + - _Color3rd: {r: 1, g: 1, b: 1, a: 1} + - _CustomLightDirection: {r: 0, g: 0, b: 10, a: 0} + - _DissolveColor: {r: 1, g: 1, b: 1, a: 1} + - _DissolveNoiseMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _DissolveParams: {r: 0, g: 0, b: 0.5, a: 0.1} + - _DissolvePos: {r: 0, g: 0, b: 0, a: 0} + - _DistanceFade: {r: 0.1, g: 0.01, b: 0, a: 0} + - _DistanceFadeColor: {r: 0, g: 0, b: 0, a: 1} + - _DistanceFadeRimColor: {r: 0, g: 0, b: 0, a: 0} + - _Emission2ndBlendMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _Emission2ndBlink: {r: 0, g: 0, b: 3.141593, a: 0} + - _Emission2ndColor: {r: 1, g: 1, b: 1, a: 1} + - _Emission2ndMap_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _EmissionBlendMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _EmissionBlink: {r: 0, g: 0, b: 3.141593, a: 0} + - _EmissionColor: {r: 1, g: 1, b: 1, a: 0.47} + - _EmissionMap_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _GlitterAtras: {r: 1, g: 1, b: 0, a: 0} + - _GlitterColor: {r: 1, g: 1, b: 1, a: 1} + - _GlitterParams1: {r: 256, g: 256, b: 1.4641001, a: 3.4293556} + - _GlitterParams2: {r: 0.25, g: 1.48, b: 0, a: 1} + - _GlossColor: {r: 1, g: 1, b: 1, a: 1} + - _Glow_Color: {r: 1, g: 1, b: 1, a: 1} + - _HighlightColor: {r: 0, g: 0.11449838, b: 1, a: 1} + - _Keys: {r: 0, g: 0, b: 0, a: 0} + - _LightDirectionOverride: {r: 0.001, g: 0.002, b: 0.001, a: 0} + - _Main2ndDissolveColor: {r: 1, g: 1, b: 1, a: 1} + - _Main2ndDissolveNoiseMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _Main2ndDissolveParams: {r: 0, g: 0, b: 0.5, a: 0.1} + - _Main2ndDissolvePos: {r: 0, g: 0, b: 0, a: 0} + - _Main2ndDistanceFade: {r: 0.1, g: 0.01, b: 0, a: 0} + - _Main2ndTexDecalAnimation: {r: 1, g: 1, b: 1, a: 30} + - _Main2ndTexDecalSubParam: {r: 1, g: 1, b: 0, a: 1} + - _Main2ndTex_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _Main3rdDissolveColor: {r: 1, g: 1, b: 1, a: 1} + - _Main3rdDissolveNoiseMask_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _Main3rdDissolveParams: {r: 0, g: 0, b: 0.5, a: 0.1} + - _Main3rdDissolvePos: {r: 0, g: 0, b: 0, a: 0} + - _Main3rdDistanceFade: {r: 0.1, g: 0.01, b: 0, a: 0} + - _Main3rdTexDecalAnimation: {r: 1, g: 1, b: 1, a: 30} + - _Main3rdTexDecalSubParam: {r: 1, g: 1, b: 0, a: 1} + - _Main3rdTex_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _MainColor: {r: 1, g: 1, b: 1, a: 1} + - _MainTexHSVG: {r: 0, g: 1, b: 1, a: 1} + - _MainTex_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _MatCap2ndBlendUV1: {r: 0, g: 0, b: 0, a: 0} + - _MatCap2ndColor: {r: 1, g: 1, b: 1, a: 1} + - _MatCapBlendUV1: {r: 0, g: 0, b: 0, a: 0} + - _MatCapColor: {r: 1, g: 1, b: 1, a: 0.19} + - _ObjPosi: {r: 0, g: 0, b: 0, a: 0} + - _ObjectForward: {r: 0, g: 0, b: 0, a: 0} + - _ObjectRight: {r: 0, g: 0, b: 0, a: 0} + - _OutResi: {r: 1, g: 1, b: 1, a: 1} + - _OutlineColor: {r: 0.16037738, g: 0.16037738, b: 0.16037738, a: 1} + - _OutlineLitColor: {r: 1, g: 0.19999996, b: 0, a: 0} + - _OutlineOffset: {r: 0, g: 0, b: 0, a: 1} + - _OutlineTexHSVG: {r: 0, g: 1, b: 1, a: 1} + - _OutlineTex_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} + - _OverallShadowColor: {r: 0, g: 0, b: 0, a: 1} + - _PTCol: {r: 0, g: 0, b: 0, a: 1} + - _PrevPosition: {r: 0, g: 0, b: 0, a: 0} + - _ReflectionColor: {r: 1, g: 1, b: 1, a: 1} + - _ReflectionCubeColor: {r: 0, g: 0, b: 0, a: 1} + - _RimColor: {r: 0.9811321, g: 0.72659314, b: 0.884591, a: 1} + - _RimIndirColor: {r: 1, g: 1, b: 1, a: 1} + - _RimLigPosi: {r: 1, g: 1, b: 1, a: 1} + - _RimLightColor: {r: 1, g: 1, b: 1, a: 1} + - _RimShadeColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + - _SSAOColor: {r: 0, g: 0, b: 0, a: 0} + - _SelfLitColor: {r: 1, g: 1, b: 1, a: 1} + - _SelfShadowRealTimeShadowColor: {r: 1, g: 1, b: 1, a: 1} + - _Shadow2ndColor: {r: 0.68, g: 0.65999997, b: 0.78999996, a: 1} + - _Shadow3rdColor: {r: 0, g: 0, b: 0, a: 0} + - _ShadowAOShift: {r: 1, g: 0, b: 1, a: 0} + - _ShadowAOShift2: {r: 1, g: 0, b: 1, a: 0} + - _ShadowBorderColor: {r: 1, g: 0.09999997, b: 0, a: 1} + - _ShadowColor: {r: 0.97538966, g: 0.9292453, b: 1, a: 1} + - _ShadowTColor: {r: 1, g: 1, b: 1, a: 1} + - _XYZPosition: {r: 0, g: 0, b: 0, a: 0} + - _e2ga0: {r: 1, g: 0, b: 0, a: 0} + - _e2ga1: {r: 1, g: 0, b: 0, a: 1} + - _e2ga2: {r: 1, g: 0, b: 0, a: 0} + - _e2ga3: {r: 1, g: 0, b: 0, a: 0} + - _e2ga4: {r: 1, g: 0, b: 0, a: 0} + - _e2ga5: {r: 1, g: 0, b: 0, a: 0} + - _e2ga6: {r: 1, g: 0, b: 0, a: 0} + - _e2ga7: {r: 1, g: 0, b: 0, a: 0} + - _e2gc0: {r: 1, g: 1, b: 1, a: 0} + - _e2gc1: {r: 1, g: 1, b: 1, a: 1} + - _e2gc2: {r: 1, g: 1, b: 1, a: 0} + - _e2gc3: {r: 1, g: 1, b: 1, a: 0} + - _e2gc4: {r: 1, g: 1, b: 1, a: 0} + - _e2gc5: {r: 1, g: 1, b: 1, a: 0} + - _e2gc6: {r: 1, g: 1, b: 1, a: 0} + - _e2gc7: {r: 1, g: 1, b: 1, a: 0} + - _ega0: {r: 1, g: 0, b: 0, a: 0} + - _ega1: {r: 1, g: 0, b: 0, a: 1} + - _ega2: {r: 1, g: 0, b: 0, a: 0} + - _ega3: {r: 1, g: 0, b: 0, a: 0} + - _ega4: {r: 1, g: 0, b: 0, a: 0} + - _ega5: {r: 1, g: 0, b: 0, a: 0} + - _ega6: {r: 1, g: 0, b: 0, a: 0} + - _ega7: {r: 1, g: 0, b: 0, a: 0} + - _egc0: {r: 1, g: 1, b: 1, a: 0} + - _egc1: {r: 1, g: 1, b: 1, a: 1} + - _egc2: {r: 1, g: 1, b: 1, a: 0} + - _egc3: {r: 1, g: 1, b: 1, a: 0} + - _egc4: {r: 1, g: 1, b: 1, a: 0} + - _egc5: {r: 1, g: 1, b: 1, a: 0} + - _egc6: {r: 1, g: 1, b: 1, a: 0} + - _egc7: {r: 1, g: 1, b: 1, a: 0} + m_BuildTextureStacks: [] + m_AllowLocking: 1 diff --git a/Assets/04_Models/Characters/Fariy/Materials/wing_mat.mat.meta b/Assets/04_Models/Characters/Fariy/Materials/wing_mat.mat.meta new file mode 100644 index 00000000..afd53122 --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Materials/wing_mat.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6705337112664b647b77d78bb08704fb +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/04_Models/Characters/Fariy/Materials/wing_trail.mat b/Assets/04_Models/Characters/Fariy/Materials/wing_trail.mat new file mode 100644 index 00000000..b93931c5 --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Materials/wing_trail.mat @@ -0,0 +1,139 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-6421258964859668105 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Editor::UnityEditor.Rendering.Universal.AssetVersion + version: 10 +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: wing_trail + m_Shader: {fileID: 4800000, guid: 0406db5a14f94604a8c57ccfbc9f3b46, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: + - _FADING_ON + - _SOFTPARTICLES_ON + - _SURFACE_TYPE_TRANSPARENT + m_InvalidKeywords: + - _ALPHABLEND_ON + - _FLIPBOOKBLENDING_OFF + m_LightmapFlags: 0 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 1 + m_CustomRenderQueue: 3000 + stringTagMap: + RenderType: Transparent + disabledShaderPasses: + - GRABPASS + - DepthOnly + - SHADOWCASTER + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BaseMap: + m_Texture: {fileID: 2800000, guid: a0025c0eef7b3f540b9f5e85a42dc557, 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} + - _MainTex: + m_Texture: {fileID: 2800000, guid: a0025c0eef7b3f540b9f5e85a42dc557, type: 3} + 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_Ints: [] + m_Floats: + - _AlphaClip: 0 + - _AlphaToMask: 0 + - _Blend: 0 + - _BlendOp: 0 + - _BumpScale: 1 + - _CameraFadingEnabled: 1 + - _CameraFarFadeDistance: 2 + - _CameraNearFadeDistance: 1 + - _ColorMode: 0 + - _Cull: 0 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DistortionBlend: 0.5 + - _DistortionEnabled: 0 + - _DistortionStrength: 1 + - _DistortionStrengthScaled: 0 + - _DstBlend: 10 + - _DstBlendAlpha: 10 + - _EmissionEnabled: 0 + - _FlipbookBlending: 0 + - _FlipbookMode: 0 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _LightingEnabled: 0 + - _Metallic: 0 + - _Mode: 2 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _QueueOffset: 0 + - _SmoothnessTextureChannel: 0 + - _SoftParticlesEnabled: 1 + - _SoftParticlesFarFadeDistance: 1 + - _SoftParticlesNearFadeDistance: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 5 + - _SrcBlendAlpha: 1 + - _Surface: 1 + - _UVSec: 0 + - _ZWrite: 0 + m_Colors: + - _BaseColor: {r: 0.9883372, g: 0.9883372, b: 0.9883372, a: 1} + - _BaseColorAddSubDiff: {r: 0, g: 0, b: 0, a: 0} + - _CameraFadeParams: {r: 1, g: 1, b: 0, a: 0} + - _Color: {r: 0.9883372, g: 0.9883372, b: 0.9883372, a: 1} + - _ColorAddSubDiff: {r: 0, g: 0, b: 0, a: 0} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _SoftParticleFadeParams: {r: 0, g: 1, b: 0, a: 0} + m_BuildTextureStacks: [] + m_AllowLocking: 1 diff --git a/Assets/04_Models/Characters/Fariy/Materials/wing_trail.mat.meta b/Assets/04_Models/Characters/Fariy/Materials/wing_trail.mat.meta new file mode 100644 index 00000000..bab53ee1 --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Materials/wing_trail.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8bfa74ea827894c4fb41b47df4ea083f +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/04_Models/Characters/Fariy/Textures.meta b/Assets/04_Models/Characters/Fariy/Textures.meta new file mode 100644 index 00000000..e2146cc5 --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Textures.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: fb2157b26ebfc2549b8862cdabc04f1c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/04_Models/Characters/Fariy/Textures/Body_Hair.meta b/Assets/04_Models/Characters/Fariy/Textures/Body_Hair.meta new file mode 100644 index 00000000..64724786 --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Textures/Body_Hair.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 66642a4a0eddd064e834f9a45173bbb0 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/04_Models/Characters/Fariy/Textures/Body_Hair/Alistia_Body.png b/Assets/04_Models/Characters/Fariy/Textures/Body_Hair/Alistia_Body.png new file mode 100644 index 00000000..9032405d --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Textures/Body_Hair/Alistia_Body.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7041182aeb607bb48452f04ea52ea8ad78dbc932b153580407f4efcac8959151 +size 3557678 diff --git a/Assets/04_Models/Characters/Fariy/Textures/Body_Hair/Alistia_Body.png.meta b/Assets/04_Models/Characters/Fariy/Textures/Body_Hair/Alistia_Body.png.meta new file mode 100644 index 00000000..f1826f0f --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Textures/Body_Hair/Alistia_Body.png.meta @@ -0,0 +1,104 @@ +fileFormatVersion: 2 +guid: 38eb494fcb7511e49a5a0dafcb8aec73 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 1 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/04_Models/Characters/Fariy/Textures/Body_Hair/Alistia_Face.png b/Assets/04_Models/Characters/Fariy/Textures/Body_Hair/Alistia_Face.png new file mode 100644 index 00000000..27290621 --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Textures/Body_Hair/Alistia_Face.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6cd515b725dff72fcaa5eb7b54c4c7cfb68778d4b0b582163d2727e8fa11386f +size 2790895 diff --git a/Assets/04_Models/Characters/Fariy/Textures/Body_Hair/Alistia_Face.png.meta b/Assets/04_Models/Characters/Fariy/Textures/Body_Hair/Alistia_Face.png.meta new file mode 100644 index 00000000..6b65ae8f --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Textures/Body_Hair/Alistia_Face.png.meta @@ -0,0 +1,104 @@ +fileFormatVersion: 2 +guid: 59cc88e58da82534b9ef6df2b16d0789 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 1 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/04_Models/Characters/Fariy/Textures/Body_Hair/Alistia_Face_Alpha.png b/Assets/04_Models/Characters/Fariy/Textures/Body_Hair/Alistia_Face_Alpha.png new file mode 100644 index 00000000..722aed64 --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Textures/Body_Hair/Alistia_Face_Alpha.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3352d6899c049d8a5a66741d75015949aa91a661a1f430acb6638417b09dd7a1 +size 89734 diff --git a/Assets/04_Models/Characters/Fariy/Textures/Body_Hair/Alistia_Face_Alpha.png.meta b/Assets/04_Models/Characters/Fariy/Textures/Body_Hair/Alistia_Face_Alpha.png.meta new file mode 100644 index 00000000..9734bdba --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Textures/Body_Hair/Alistia_Face_Alpha.png.meta @@ -0,0 +1,104 @@ +fileFormatVersion: 2 +guid: e9127ca5d92e63940bdc0358062db97b +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 1 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/04_Models/Characters/Fariy/Textures/Body_Hair/Alistia_Face_mask.png b/Assets/04_Models/Characters/Fariy/Textures/Body_Hair/Alistia_Face_mask.png new file mode 100644 index 00000000..105e821d --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Textures/Body_Hair/Alistia_Face_mask.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6fd35c21129b82dcfa53e48e293344899c93d136464d0a9a903e95484141f207 +size 367919 diff --git a/Assets/04_Models/Characters/Fariy/Textures/Body_Hair/Alistia_Face_mask.png.meta b/Assets/04_Models/Characters/Fariy/Textures/Body_Hair/Alistia_Face_mask.png.meta new file mode 100644 index 00000000..d25a5284 --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Textures/Body_Hair/Alistia_Face_mask.png.meta @@ -0,0 +1,104 @@ +fileFormatVersion: 2 +guid: 513f256d33e4b294cb9a238d2ae516c4 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 1 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/04_Models/Characters/Fariy/Textures/Body_Hair/Alistia_Hair.png b/Assets/04_Models/Characters/Fariy/Textures/Body_Hair/Alistia_Hair.png new file mode 100644 index 00000000..727c4cae --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Textures/Body_Hair/Alistia_Hair.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6978b32a1f785dd2600303ea973c0b39e3d87c1627b8650447788a8fc8bf9a38 +size 4933039 diff --git a/Assets/04_Models/Characters/Fariy/Textures/Body_Hair/Alistia_Hair.png.meta b/Assets/04_Models/Characters/Fariy/Textures/Body_Hair/Alistia_Hair.png.meta new file mode 100644 index 00000000..068dc0a7 --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Textures/Body_Hair/Alistia_Hair.png.meta @@ -0,0 +1,104 @@ +fileFormatVersion: 2 +guid: d048c66387fa0bc4f9913dd2d7d7fa87 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 1 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/04_Models/Characters/Fariy/Textures/Body_Hair/Alistia_Hair_Mask.png b/Assets/04_Models/Characters/Fariy/Textures/Body_Hair/Alistia_Hair_Mask.png new file mode 100644 index 00000000..7a442e17 --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Textures/Body_Hair/Alistia_Hair_Mask.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ab0acd7324d89f54bf54b8f57df783c150c7d65694c93ae947ec304b9c9f2b38 +size 111582 diff --git a/Assets/04_Models/Characters/Fariy/Textures/Body_Hair/Alistia_Hair_Mask.png.meta b/Assets/04_Models/Characters/Fariy/Textures/Body_Hair/Alistia_Hair_Mask.png.meta new file mode 100644 index 00000000..1bee0ca0 --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Textures/Body_Hair/Alistia_Hair_Mask.png.meta @@ -0,0 +1,104 @@ +fileFormatVersion: 2 +guid: 782a9af2fc072c2419c418886e440f9d +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 1 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/04_Models/Characters/Fariy/Textures/Cloth.meta b/Assets/04_Models/Characters/Fariy/Textures/Cloth.meta new file mode 100644 index 00000000..11ed707c --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Textures/Cloth.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: dd660d0cb0cc18a40b108f321b2ddc32 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/04_Models/Characters/Fariy/Textures/Cloth/Alistia_Cloth_1_blue.png b/Assets/04_Models/Characters/Fariy/Textures/Cloth/Alistia_Cloth_1_blue.png new file mode 100644 index 00000000..0387a698 --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Textures/Cloth/Alistia_Cloth_1_blue.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:16757907c116513464c62a9f0fb8707c94eb74fede58b498ed2f8e44a90ffba3 +size 3965312 diff --git a/Assets/04_Models/Characters/Fariy/Textures/Cloth/Alistia_Cloth_1_blue.png.meta b/Assets/04_Models/Characters/Fariy/Textures/Cloth/Alistia_Cloth_1_blue.png.meta new file mode 100644 index 00000000..74374947 --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Textures/Cloth/Alistia_Cloth_1_blue.png.meta @@ -0,0 +1,104 @@ +fileFormatVersion: 2 +guid: 083e7f8c110fa364c817bb3c34f9fdeb +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 1 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/04_Models/Characters/Fariy/Textures/Cloth/Alistia_Cloth_2.png b/Assets/04_Models/Characters/Fariy/Textures/Cloth/Alistia_Cloth_2.png new file mode 100644 index 00000000..d612e01e --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Textures/Cloth/Alistia_Cloth_2.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a43a46fb311ef47ecac95fdb447e6ce1f4834c7aab3f133994589ec4046955df +size 5211285 diff --git a/Assets/04_Models/Characters/Fariy/Textures/Cloth/Alistia_Cloth_2.png.meta b/Assets/04_Models/Characters/Fariy/Textures/Cloth/Alistia_Cloth_2.png.meta new file mode 100644 index 00000000..ec2e7d97 --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Textures/Cloth/Alistia_Cloth_2.png.meta @@ -0,0 +1,104 @@ +fileFormatVersion: 2 +guid: 093a9db6b1fee594380cc05560ae5e8a +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 1 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/04_Models/Characters/Fariy/Textures/wing_effects_tex.png b/Assets/04_Models/Characters/Fariy/Textures/wing_effects_tex.png new file mode 100644 index 00000000..6d613d11 --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Textures/wing_effects_tex.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d6727dbfa2337db97c349c585fc8ac890394327bf640222eb1c9eece60aa4c50 +size 192023 diff --git a/Assets/04_Models/Characters/Fariy/Textures/wing_effects_tex.png.meta b/Assets/04_Models/Characters/Fariy/Textures/wing_effects_tex.png.meta new file mode 100644 index 00000000..bff26192 --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Textures/wing_effects_tex.png.meta @@ -0,0 +1,140 @@ +fileFormatVersion: 2 +guid: df447867c7b49b44eafa9aa27d119770 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/04_Models/Characters/Fariy/Textures/wing_mat_BaseMap.png b/Assets/04_Models/Characters/Fariy/Textures/wing_mat_BaseMap.png new file mode 100644 index 00000000..172a6630 --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Textures/wing_mat_BaseMap.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1373b7ff273cb2af36041f60e864786f5e31184781432ca68a98f98abd1f1111 +size 6062156 diff --git a/Assets/04_Models/Characters/Fariy/Textures/wing_mat_BaseMap.png.meta b/Assets/04_Models/Characters/Fariy/Textures/wing_mat_BaseMap.png.meta new file mode 100644 index 00000000..3bb8c96a --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Textures/wing_mat_BaseMap.png.meta @@ -0,0 +1,140 @@ +fileFormatVersion: 2 +guid: cc50bff8e08ffa649877aa0890e95edf +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/04_Models/Characters/Fariy/Textures/wing_matcap.png b/Assets/04_Models/Characters/Fariy/Textures/wing_matcap.png new file mode 100644 index 00000000..fb66a254 --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Textures/wing_matcap.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0bd82587588611b818d811b5d8c11057e4cb5d4774c0f2a19a56247deaab50e5 +size 2870852 diff --git a/Assets/04_Models/Characters/Fariy/Textures/wing_matcap.png.meta b/Assets/04_Models/Characters/Fariy/Textures/wing_matcap.png.meta new file mode 100644 index 00000000..69a69283 --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Textures/wing_matcap.png.meta @@ -0,0 +1,140 @@ +fileFormatVersion: 2 +guid: 7d34b02ec05d5a44c8a3e592ea8a3c3e +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/04_Models/Characters/Fariy/Textures/wing_trail_tex.png b/Assets/04_Models/Characters/Fariy/Textures/wing_trail_tex.png new file mode 100644 index 00000000..89860967 --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Textures/wing_trail_tex.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5a18bd6e03eba9cab09b12de07964e67d28d6068f82650bdc8c95895e9cb3642 +size 96215 diff --git a/Assets/04_Models/Characters/Fariy/Textures/wing_trail_tex.png.meta b/Assets/04_Models/Characters/Fariy/Textures/wing_trail_tex.png.meta new file mode 100644 index 00000000..9c49cf1b --- /dev/null +++ b/Assets/04_Models/Characters/Fariy/Textures/wing_trail_tex.png.meta @@ -0,0 +1,140 @@ +fileFormatVersion: 2 +guid: a0025c0eef7b3f540b9f5e85a42dc557 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2.meta b/Assets/MagicaCloth2.meta new file mode 100644 index 00000000..899bd46d --- /dev/null +++ b/Assets/MagicaCloth2.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f31820b1e966ca049a982e2a30795d24 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Example (Can be deleted).meta b/Assets/MagicaCloth2/Example (Can be deleted).meta new file mode 100644 index 00000000..ea812ecc --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted).meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b13ad20384f6dd8459a0ee155e8181f1 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common.meta b/Assets/MagicaCloth2/Example (Can be deleted)/Common.meta new file mode 100644 index 00000000..fcc83fdf --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 791ca5043c61c164093a43f6e1134756 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Materials.meta b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Materials.meta new file mode 100644 index 00000000..d56df5f5 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Materials.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 319509eb5d501a04f8a0d2e3a8f5b0a0 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Materials/MC2_Floor.mat b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Materials/MC2_Floor.mat new file mode 100644 index 00000000..e75b1e12 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Materials/MC2_Floor.mat @@ -0,0 +1,202 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-5413520746483021427 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: da692e001514ec24dbc4cca1949ff7e8, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 12 + hdPluginSubTargetMaterialVersions: + m_Keys: [] + m_Values: +--- !u!114 &-3015027763282864326 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 10 +--- !u!114 &-2537191031519904044 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 639247ca83abc874e893eb93af2b5e44, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 0 +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: MC2_Floor + m_Shader: {fileID: -6465566751694194690, guid: e0b73429f84a56840ba17b216237f806, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: + - _DISABLE_SSR_TRANSPARENT + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 2000 + stringTagMap: + MotionVector: User + disabledShaderPasses: + - TransparentDepthPrepass + - TransparentDepthPostpass + - TransparentBackface + - RayTracingPrepass + - MOTIONVECTORS + m_LockedProperties: + 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} + - _Main: + m_Texture: {fileID: 10309, guid: 0000000000000000f000000000000000, type: 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} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _AddPrecomputedVelocity: 0 + - _AlphaCutoffEnable: 0 + - _AlphaDstBlend: 0 + - _AlphaSrcBlend: 1 + - _AlphaToMask: 0 + - _AlphaToMaskInspectorValue: 0 + - _BUILTIN_QueueControl: 0 + - _BUILTIN_QueueOffset: 0 + - _BlendMode: 0 + - _BumpScale: 1 + - _ConservativeDepthOffsetEnable: 0 + - _CullMode: 2 + - _CullModeForward: 2 + - _Cutoff: 0.5 + - _DepthOffsetEnable: 0 + - _DetailNormalMapScale: 1 + - _DoubleSidedEnable: 0 + - _DoubleSidedGIMode: 0 + - _DoubleSidedNormalMode: 2 + - _DstBlend: 0 + - _EnableBlendModePreserveSpecularLighting: 1 + - _EnableFogOnTransparent: 1 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _OpaqueCullMode: 2 + - _Parallax: 0.02 + - _QueueControl: 1 + - _QueueOffset: 0 + - _RayTracing: 0 + - _ReceivesSSR: 1 + - _ReceivesSSRTransparent: 0 + - _RefractionModel: 0 + - _RenderQueueType: 1 + - _RequireSplitLighting: 0 + - _Smoothness: 0 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _StencilRef: 0 + - _StencilRefDepth: 8 + - _StencilRefDistortionVec: 4 + - _StencilRefGBuffer: 10 + - _StencilRefMV: 40 + - _StencilWriteMask: 6 + - _StencilWriteMaskDepth: 8 + - _StencilWriteMaskDistortionVec: 4 + - _StencilWriteMaskGBuffer: 14 + - _StencilWriteMaskMV: 40 + - _SupportDecals: 1 + - _SurfaceType: 0 + - _TransparentBackfaceEnable: 0 + - _TransparentCullMode: 2 + - _TransparentDepthPostpassEnable: 0 + - _TransparentDepthPrepassEnable: 0 + - _TransparentSortPriority: 0 + - _TransparentWritingMotionVec: 0 + - _TransparentZWrite: 0 + - _UVSec: 0 + - _UseShadowThreshold: 0 + - _ZTestDepthEqualForOpaque: 3 + - _ZTestGBuffer: 4 + - _ZTestTransparent: 4 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 0.14150941, g: 0.14150941, b: 0.14150941, a: 1} + - _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0} + - _EmissionColor: {r: 1, g: 1, b: 1, a: 1} + - _Tiling: {r: 100, g: 100, b: 0, a: 0} + m_BuildTextureStacks: [] + m_AllowLocking: 1 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Materials/MC2_Floor.mat.meta b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Materials/MC2_Floor.mat.meta new file mode 100644 index 00000000..10dc968c --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Materials/MC2_Floor.mat.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 1a8d0a0ce31bbbd49ad39beb17ee9326 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/Common/Materials/MC2_Floor.mat + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Materials/MC2_Test_Back.mat b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Materials/MC2_Test_Back.mat new file mode 100644 index 00000000..ae68f77d --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Materials/MC2_Test_Back.mat @@ -0,0 +1,202 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: MC2_Test_Back + m_Shader: {fileID: -6465566751694194690, guid: b969454d26657854a8fe82c813fb0876, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: + - _DISABLE_SSR_TRANSPARENT + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 2450 + stringTagMap: + MotionVector: User + disabledShaderPasses: + - TransparentDepthPrepass + - TransparentDepthPostpass + - TransparentBackface + - RayTracingPrepass + - MOTIONVECTORS + m_LockedProperties: + 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} + - _Main: + m_Texture: {fileID: 10309, guid: 0000000000000000f000000000000000, type: 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} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _AddPrecomputedVelocity: 0 + - _AlphaCutoffEnable: 0 + - _AlphaDstBlend: 0 + - _AlphaSrcBlend: 1 + - _AlphaToMask: 0 + - _AlphaToMaskInspectorValue: 0 + - _BUILTIN_QueueControl: 0 + - _BUILTIN_QueueOffset: 0 + - _BlendMode: 0 + - _BumpScale: 1 + - _ConservativeDepthOffsetEnable: 0 + - _CullMode: 1 + - _CullModeForward: 1 + - _Cutoff: 0.5 + - _DepthOffsetEnable: 0 + - _DetailNormalMapScale: 1 + - _DoubleSidedEnable: 0 + - _DoubleSidedGIMode: 0 + - _DoubleSidedNormalMode: 2 + - _DstBlend: 0 + - _EnableBlendModePreserveSpecularLighting: 1 + - _EnableFogOnTransparent: 1 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _OpaqueCullMode: 1 + - _Parallax: 0.02 + - _QueueControl: 1 + - _QueueOffset: 0 + - _RayTracing: 0 + - _ReceivesSSR: 1 + - _ReceivesSSRTransparent: 0 + - _RefractionModel: 0 + - _RenderQueueType: 1 + - _RequireSplitLighting: 0 + - _Smoothness: 0 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _StencilRef: 0 + - _StencilRefDepth: 8 + - _StencilRefDistortionVec: 4 + - _StencilRefGBuffer: 10 + - _StencilRefMV: 40 + - _StencilWriteMask: 6 + - _StencilWriteMaskDepth: 8 + - _StencilWriteMaskDistortionVec: 4 + - _StencilWriteMaskGBuffer: 14 + - _StencilWriteMaskMV: 40 + - _SupportDecals: 1 + - _SurfaceType: 0 + - _TransparentBackfaceEnable: 0 + - _TransparentCullMode: 2 + - _TransparentDepthPostpassEnable: 0 + - _TransparentDepthPrepassEnable: 0 + - _TransparentSortPriority: 0 + - _TransparentWritingMotionVec: 0 + - _TransparentZWrite: 0 + - _UVSec: 0 + - _UseShadowThreshold: 0 + - _ZTestDepthEqualForOpaque: 3 + - _ZTestGBuffer: 4 + - _ZTestTransparent: 4 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0} + - _EmissionColor: {r: 1, g: 1, b: 1, a: 1} + - _Tiling: {r: 1, g: 1, b: 0, a: 0} + m_BuildTextureStacks: [] + m_AllowLocking: 1 +--- !u!114 &542807876330787821 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: da692e001514ec24dbc4cca1949ff7e8, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 12 + hdPluginSubTargetMaterialVersions: + m_Keys: [] + m_Values: +--- !u!114 &5888084634695096061 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 639247ca83abc874e893eb93af2b5e44, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 0 +--- !u!114 &7297074712781543736 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 10 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Materials/MC2_Test_Back.mat.meta b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Materials/MC2_Test_Back.mat.meta new file mode 100644 index 00000000..17334c4a --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Materials/MC2_Test_Back.mat.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 586d53852ab2fac4cba5cac70300497d +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/Common/Materials/MC2_Test_Back.mat + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Materials/MC2_Test_Front.mat b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Materials/MC2_Test_Front.mat new file mode 100644 index 00000000..d606521c --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Materials/MC2_Test_Front.mat @@ -0,0 +1,202 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-2678523629483602278 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 10 +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: MC2_Test_Front + m_Shader: {fileID: -6465566751694194690, guid: e0b73429f84a56840ba17b216237f806, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: + - _DISABLE_SSR_TRANSPARENT + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 2000 + stringTagMap: + MotionVector: User + disabledShaderPasses: + - TransparentDepthPrepass + - TransparentDepthPostpass + - TransparentBackface + - RayTracingPrepass + - MOTIONVECTORS + m_LockedProperties: + 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} + - _Main: + m_Texture: {fileID: 10309, guid: 0000000000000000f000000000000000, type: 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} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _AddPrecomputedVelocity: 0 + - _AlphaCutoffEnable: 0 + - _AlphaDstBlend: 0 + - _AlphaSrcBlend: 1 + - _AlphaToMask: 0 + - _AlphaToMaskInspectorValue: 0 + - _BUILTIN_QueueControl: 0 + - _BUILTIN_QueueOffset: 0 + - _BlendMode: 0 + - _BumpScale: 1 + - _ConservativeDepthOffsetEnable: 0 + - _CullMode: 2 + - _CullModeForward: 2 + - _Cutoff: 0.5 + - _DepthOffsetEnable: 0 + - _DetailNormalMapScale: 1 + - _DoubleSidedEnable: 0 + - _DoubleSidedGIMode: 0 + - _DoubleSidedNormalMode: 2 + - _DstBlend: 0 + - _EnableBlendModePreserveSpecularLighting: 1 + - _EnableFogOnTransparent: 1 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _OpaqueCullMode: 2 + - _Parallax: 0.02 + - _QueueControl: 1 + - _QueueOffset: 0 + - _RayTracing: 0 + - _ReceivesSSR: 1 + - _ReceivesSSRTransparent: 0 + - _RefractionModel: 0 + - _RenderQueueType: 1 + - _RequireSplitLighting: 0 + - _Smoothness: 0 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _StencilRef: 0 + - _StencilRefDepth: 8 + - _StencilRefDistortionVec: 4 + - _StencilRefGBuffer: 10 + - _StencilRefMV: 40 + - _StencilWriteMask: 6 + - _StencilWriteMaskDepth: 8 + - _StencilWriteMaskDistortionVec: 4 + - _StencilWriteMaskGBuffer: 14 + - _StencilWriteMaskMV: 40 + - _SupportDecals: 1 + - _SurfaceType: 0 + - _TransparentBackfaceEnable: 0 + - _TransparentCullMode: 2 + - _TransparentDepthPostpassEnable: 0 + - _TransparentDepthPrepassEnable: 0 + - _TransparentSortPriority: 0 + - _TransparentWritingMotionVec: 0 + - _TransparentZWrite: 0 + - _UVSec: 0 + - _UseShadowThreshold: 0 + - _ZTestDepthEqualForOpaque: 3 + - _ZTestGBuffer: 4 + - _ZTestTransparent: 4 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0} + - _EmissionColor: {r: 1, g: 1, b: 1, a: 1} + - _Tiling: {r: 1, g: 1, b: 0, a: 0} + m_BuildTextureStacks: [] + m_AllowLocking: 1 +--- !u!114 &3436996967411815949 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: da692e001514ec24dbc4cca1949ff7e8, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 12 + hdPluginSubTargetMaterialVersions: + m_Keys: [] + m_Values: +--- !u!114 &5888084634695096061 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 639247ca83abc874e893eb93af2b5e44, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 0 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Materials/MC2_Test_Front.mat.meta b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Materials/MC2_Test_Front.mat.meta new file mode 100644 index 00000000..aac2baec --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Materials/MC2_Test_Front.mat.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: e668c51d0e0125e4dbae8a37cb0d45e4 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/Common/Materials/MC2_Test_Front.mat + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Materials/MC2_White.mat b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Materials/MC2_White.mat new file mode 100644 index 00000000..6b876a94 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Materials/MC2_White.mat @@ -0,0 +1,133 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-3650841247374319034 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Editor::UnityEditor.Rendering.Universal.AssetVersion + version: 10 +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: MC2_White + m_Shader: {fileID: -6465566751694194690, guid: e0b73429f84a56840ba17b216237f806, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: + - MOTIONVECTORS + m_LockedProperties: + 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} + - _Main: + 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} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _BUILTIN_QueueControl: 0 + - _BUILTIN_QueueOffset: 0 + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _QueueControl: 0 + - _QueueOffset: 0 + - _Smoothness: 0 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 0.6886792, g: 0.6886792, b: 0.6886792, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _Tiling: {r: 1, g: 1, b: 0, a: 0} + m_BuildTextureStacks: [] + m_AllowLocking: 1 +--- !u!114 &5537520944958903688 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 639247ca83abc874e893eb93af2b5e44, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 0 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Materials/MC2_White.mat.meta b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Materials/MC2_White.mat.meta new file mode 100644 index 00000000..33f321c1 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Materials/MC2_White.mat.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 9dc80f717b8cf0f44a1328de60c05a87 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/Common/Materials/MC2_White.mat + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Model.meta b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Model.meta new file mode 100644 index 00000000..add85f94 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Model.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 174ae74532988144eaa22b5d3ce3b54b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Model/Materials.meta b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Model/Materials.meta new file mode 100644 index 00000000..edecb123 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Model/Materials.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e22374f5956c7fe49ba058092885078b +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Model/Materials/Arrow.mat b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Model/Materials/Arrow.mat new file mode 100644 index 00000000..b1e3909b --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Model/Materials/Arrow.mat @@ -0,0 +1,151 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Arrow + m_Shader: {fileID: -6465566751694194690, guid: e0b73429f84a56840ba17b216237f806, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: + - MOTIONVECTORS + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BaseMap: + m_Texture: {fileID: 0} + 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} + - _Main: + 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} + - _SpecGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _AlphaClip: 0 + - _BUILTIN_QueueControl: 0 + - _BUILTIN_QueueOffset: 0 + - _Blend: 0 + - _BumpScale: 1 + - _ClearCoatMask: 0 + - _ClearCoatSmoothness: 0 + - _Cull: 2 + - _Cutoff: 0.5 + - _DetailAlbedoMapScale: 1 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _EnvironmentReflections: 1 + - _GlossMapScale: 0 + - _Glossiness: 0 + - _GlossyReflections: 0 + - _Metallic: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.005 + - _QueueControl: 0 + - _QueueOffset: 0 + - _ReceiveShadows: 1 + - _Smoothness: 0.5 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _Surface: 0 + - _WorkflowMode: 1 + - _ZWrite: 1 + m_Colors: + - _BaseColor: {r: 0.8, g: 0.8, b: 0.8, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} + - _Tiling: {r: 1, g: 1, b: 0, a: 0} + m_BuildTextureStacks: [] + m_AllowLocking: 1 +--- !u!114 &7761228438660005603 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 10 +--- !u!114 &8771852287512767389 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 639247ca83abc874e893eb93af2b5e44, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 0 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Model/Materials/Arrow.mat.meta b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Model/Materials/Arrow.mat.meta new file mode 100644 index 00000000..2518afd3 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Model/Materials/Arrow.mat.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 9d8e9d2536fe10f448a1440c26ec0bc3 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/Common/Model/Materials/Arrow.mat + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Model/arrow_b.fbx b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Model/arrow_b.fbx new file mode 100644 index 00000000..2ef7a2d2 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Model/arrow_b.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0160532033ab082715b7fe34c4ba00fb5ecd59ba77dc1e5b3c308cd31c440f29 +size 15660 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Model/arrow_b.fbx.meta b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Model/arrow_b.fbx.meta new file mode 100644 index 00000000..e69d9b51 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Model/arrow_b.fbx.meta @@ -0,0 +1,132 @@ +fileFormatVersion: 2 +guid: 40f00d3ed65180f4ab14accca4d78735 +ModelImporter: + serializedVersion: 21300 + internalIDToNameTable: + - first: + 1: 100000 + second: //RootNode + - first: + 4: 400000 + second: //RootNode + - first: + 21: 2100000 + second: Arrow + - first: + 23: 2300000 + second: //RootNode + - first: + 33: 3300000 + second: //RootNode + - first: + 43: 4300000 + second: Arrow + externalObjects: {} + materials: + materialImportMode: 1 + materialName: 0 + materialSearch: 1 + materialLocation: 1 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + resampleCurves: 1 + optimizeGameObjects: 0 + removeConstantScaleCurves: 0 + motionNodeName: + rigImportErrors: + rigImportWarnings: + animationImportErrors: + animationImportWarnings: + animationRetargetingWarnings: + animationDoRetargetingWarnings: 0 + importAnimatedCustomProperties: 0 + importConstraints: 0 + animationCompression: 1 + animationRotationError: 0.5 + animationPositionError: 0.5 + animationScaleError: 0.5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + extraUserProperties: [] + clipAnimations: [] + isReadable: 1 + meshes: + lODScreenPercentages: [] + globalScale: 1 + meshCompression: 0 + addColliders: 0 + useSRGBMaterialColor: 1 + sortHierarchyByName: 1 + importVisibility: 1 + importBlendShapes: 1 + importCameras: 1 + importLights: 1 + nodeNameCollisionStrategy: 0 + fileIdsGeneration: 1 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + keepQuads: 0 + weldVertices: 1 + bakeAxisConversion: 0 + preserveHierarchy: 0 + skinWeightsMode: 0 + maxBonesPerVertex: 4 + minBoneWeight: 0.001 + optimizeBones: 1 + meshOptimizationFlags: -1 + indexFormat: 0 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVMarginMethod: 0 + secondaryUVMinLightmapResolution: 40 + secondaryUVMinObjectScale: 1 + secondaryUVPackMargin: 4 + useFileScale: 1 + strictVertexDataChecks: 0 + tangentSpace: + normalSmoothAngle: 60 + normalImportMode: 0 + tangentImportMode: 3 + normalCalculationMode: 4 + legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0 + blendShapeNormalImportMode: 1 + normalSmoothingSource: 0 + referencedClips: [] + importAnimation: 1 + humanDescription: + serializedVersion: 3 + human: [] + skeleton: [] + armTwist: 0.5 + foreArmTwist: 0.5 + upperLegTwist: 0.5 + legTwist: 0.5 + armStretch: 0.05 + legStretch: 0.05 + feetSpacing: 0 + globalScale: 1 + rootMotionBoneName: + hasTranslationDoF: 0 + hasExtraRoot: 0 + skeletonHasParents: 1 + lastHumanDescriptionAvatarSource: {instanceID: 0} + autoGenerateAvatarMappingIfUnspecified: 1 + animationType: 0 + humanoidOversampling: 1 + avatarSetup: 0 + addHumanoidExtraRootOnlyWhenUsingAvatar: 0 + remapMaterialsIfMaterialImportModeIsNone: 1 + additionalBone: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/Common/Model/arrow_b.fbx + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs.meta b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs.meta new file mode 100644 index 00000000..eb6b6326 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f43ab23790f02b24aa62d451e140d7ce +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/Cube.prefab b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/Cube.prefab new file mode 100644 index 00000000..ab6df2cf --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/Cube.prefab @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f169efee1513b12061019e163775bfa5128f163f53cffdbc2ad4317d77cd323a +size 2413 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/Cube.prefab.meta b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/Cube.prefab.meta new file mode 100644 index 00000000..bfadfa3a --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/Cube.prefab.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: baaebd372fee4154e9b08570bc3a230e +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/Cube.prefab + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/CubeRoup.prefab b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/CubeRoup.prefab new file mode 100644 index 00000000..72f6eb21 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/CubeRoup.prefab @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:48f133160179ee92b5499d778694740cee7a65369989f324edfa48ceabeaef38 +size 6748 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/CubeRoup.prefab.meta b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/CubeRoup.prefab.meta new file mode 100644 index 00000000..bb0e25f0 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/CubeRoup.prefab.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 1950e99f479bef04581d5185a7cf27b3 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/CubeRoup.prefab + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/Env.prefab b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/Env.prefab new file mode 100644 index 00000000..598223f9 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/Env.prefab @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0bebc9776e0c8f10f095ccb8df1145d85a5414ddb60092d02ed3d359aa5a7696 +size 10022 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/Env.prefab.meta b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/Env.prefab.meta new file mode 100644 index 00000000..9a868bb5 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/Env.prefab.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: b5bac44e9cdf69541b2d1de75e68a9ba +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/Env.prefab + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/Plane.prefab b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/Plane.prefab new file mode 100644 index 00000000..b65951ee --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/Plane.prefab @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9a52573145ff1845f29be4d642fc0d6a85c56b125d12fa5e14305fec633c2837 +size 2971 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/Plane.prefab.meta b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/Plane.prefab.meta new file mode 100644 index 00000000..9a570b0a --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/Plane.prefab.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: f6e49ec628143df48a1d0a213fc770af +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/Plane.prefab + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/RuntimeBuildDemo.prefab b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/RuntimeBuildDemo.prefab new file mode 100644 index 00000000..ed4fe3b2 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/RuntimeBuildDemo.prefab @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1e5c3bbfbf58e8a2cf2384c8a9ff89dc3377eb13c2289fc5408d7ca569bc5efc +size 10344 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/RuntimeBuildDemo.prefab.meta b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/RuntimeBuildDemo.prefab.meta new file mode 100644 index 00000000..ab36424d --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/RuntimeBuildDemo.prefab.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 57eb8094dff10c34f8fae441c280e0f8 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/RuntimeBuildDemo.prefab + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/RuntimeDressUpDemo.prefab b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/RuntimeDressUpDemo.prefab new file mode 100644 index 00000000..dbfa96e4 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/RuntimeDressUpDemo.prefab @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:94aef92a3877c5d4a8e01acdd68e46d24d1551f56d5eed3cc97e413d6501e235 +size 1562 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/RuntimeDressUpDemo.prefab.meta b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/RuntimeDressUpDemo.prefab.meta new file mode 100644 index 00000000..6179dfe0 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/RuntimeDressUpDemo.prefab.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: bca76fc2423c0a14db7d44f7745ab286 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/RuntimeDressUpDemo.prefab + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/SimpleImputManager.prefab b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/SimpleImputManager.prefab new file mode 100644 index 00000000..0eca7f7d --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/SimpleImputManager.prefab @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7d6989df41742a524342d6919406b12184f9d7a275bc7ed6ddb17aef647ba949 +size 1413 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/SimpleImputManager.prefab.meta b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/SimpleImputManager.prefab.meta new file mode 100644 index 00000000..0a612af5 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/SimpleImputManager.prefab.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: e35153ae4a19fa24289b796a4290d4db +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/SimpleImputManager.prefab + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/Stage.prefab b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/Stage.prefab new file mode 100644 index 00000000..636ffec7 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/Stage.prefab @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0feb9a444464642b7c2a97b665826895f45a8445ab81c50f9ab4cf7a60e61c40 +size 3315 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/Stage.prefab.meta b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/Stage.prefab.meta new file mode 100644 index 00000000..314f542f --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/Stage.prefab.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 23be23f56fcb4ac48ac4de26c111e332 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/Stage.prefab + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/UI_KAGURA.prefab b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/UI_KAGURA.prefab new file mode 100644 index 00000000..3644f716 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/UI_KAGURA.prefab @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d406b0102a79ef332a057c5373ccb315b28a62ec079ab27d6b10abae72abf574 +size 27331 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/UI_KAGURA.prefab.meta b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/UI_KAGURA.prefab.meta new file mode 100644 index 00000000..f66e640d --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/UI_KAGURA.prefab.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 94ed6a8f5c3a2ba4d8c93972af7467f0 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/UI_KAGURA.prefab + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/UI_RuntimeBuild.prefab b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/UI_RuntimeBuild.prefab new file mode 100644 index 00000000..d6589817 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/UI_RuntimeBuild.prefab @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e510f1ce5738c1442c35dadec46ad2ee5fdee57038071fc3cbbee7ee631c1f34 +size 20859 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/UI_RuntimeBuild.prefab.meta b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/UI_RuntimeBuild.prefab.meta new file mode 100644 index 00000000..b71e800e --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/UI_RuntimeBuild.prefab.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 0b388bd66f5736b4891ceafcaee539a4 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/UI_RuntimeBuild.prefab + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/UI_RuntimeDressUp.prefab b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/UI_RuntimeDressUp.prefab new file mode 100644 index 00000000..ec16fe6d --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/UI_RuntimeDressUp.prefab @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f8d9e6093648d2e3e36cca00d6fe8133bbc784153337b6949dd2c0fddeab86f0 +size 20875 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/UI_RuntimeDressUp.prefab.meta b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/UI_RuntimeDressUp.prefab.meta new file mode 100644 index 00000000..cb117480 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/UI_RuntimeDressUp.prefab.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 228b0487b4c6f43448267a8277251bc6 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/UI_RuntimeDressUp.prefab + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/UI_Wind.prefab b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/UI_Wind.prefab new file mode 100644 index 00000000..b6e8314a --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/UI_Wind.prefab @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ee28a2d280ad07702182810894d644650133f08a698f7029956bd426e036e2ce +size 67305 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/UI_Wind.prefab.meta b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/UI_Wind.prefab.meta new file mode 100644 index 00000000..a2fb0e06 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/UI_Wind.prefab.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: b10f69e1744a07942843e8c00f85501e +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/UI_Wind.prefab + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/WindDemo.prefab b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/WindDemo.prefab new file mode 100644 index 00000000..b5d8f8e3 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/WindDemo.prefab @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5e4b4d9c97ef008f5dc573b06f70fcc7c47ffd660604490e3f9f6a19f7d10877 +size 12894 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/WindDemo.prefab.meta b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/WindDemo.prefab.meta new file mode 100644 index 00000000..04b2fb11 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/WindDemo.prefab.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: c421f5fd48afe284da1a2c74a043723b +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/WindDemo.prefab + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/WindParticle.prefab b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/WindParticle.prefab new file mode 100644 index 00000000..ef929d11 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/WindParticle.prefab @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9c31a916d60d0e0e6a7d520e4272f764f7236b029afd83aad90a7869335e9fd7 +size 116665 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/WindParticle.prefab.meta b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/WindParticle.prefab.meta new file mode 100644 index 00000000..753a4a44 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/WindParticle.prefab.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 9f50911cfd816e840860425faa5cec57 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/Common/Prefabs/WindParticle.prefab + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Resources.meta b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Resources.meta new file mode 100644 index 00000000..1b086c74 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Resources.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 983f0ab2563c0d34eb966719207674dc +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Resources/MC2_BoneCloth_Ribbon_Demo.json b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Resources/MC2_BoneCloth_Ribbon_Demo.json new file mode 100644 index 00000000..760d000e --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Resources/MC2_BoneCloth_Ribbon_Demo.json @@ -0,0 +1 @@ +{"clothType":1,"sourceRenderers":[],"paintMode":0,"paintMaps":[],"rootBones":[{"instanceID":-1922},{"instanceID":-1974}],"connectionMode":0,"rotationalInterpolation":0.5,"rootRotation":0.5,"animationBlendRatio":0.0,"reductionSetting":{"simpleDistance":0.0,"shapeDistance":0.0},"customSkinningSetting":{"enable":false,"skinningBones":[]},"normalAlignmentSetting":{"alignmentMode":0,"adjustmentTransform":{"instanceID":0}},"normalAxis":1,"gravity":2.0,"gravityDirection":{"x":0.0,"y":-1.0,"z":0.0},"gravityFalloff":0.0,"damping":{"value":0.019999999552965165,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"radius":{"value":0.019999999552965165,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"inertiaConstraint":{"movementInertia":1.0,"rotationInertia":1.0,"depthInertia":0.0,"centrifualAcceleration":0.0,"movementSpeedLimit":{"value":5.0,"use":true},"rotationSpeedLimit":{"value":720.0,"use":true},"particleSpeedLimit":{"value":3.0,"use":true}},"tetherConstraint":{"distanceCompression":0.5},"distanceConstraint":{"stiffness":{"value":1.0,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":-0.5,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":0.5,"inSlope":-0.5,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}}},"triangleBendingConstraint":{"stiffness":0.5},"angleRestorationConstraint":{"useAngleRestoration":true,"stiffness":{"value":0.05400000140070915,"useCurve":true,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":-0.5040969848632813,"outSlope":-0.5040969848632813,"tangentMode":34,"weightedMode":0,"inWeight":0.0,"outWeight":0.3333333432674408},{"serializedVersion":"3","time":1.0,"value":0.49590301513671877,"inSlope":-0.5040969848632813,"outSlope":-0.5040969848632813,"tangentMode":34,"weightedMode":0,"inWeight":0.3333333432674408,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"velocityAttenuation":0.5,"gravityFalloff":0.0},"angleLimitConstraint":{"useAngleLimit":true,"limitAngle":{"value":45.0,"useCurve":true,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":0.0,"inSlope":0.0,"outSlope":1.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":1.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"stiffness":0.30000001192092898},"motionConstraint":{"useMaxDistance":false,"maxDistance":{"value":0.30000001192092898,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"useBackstop":false,"backstopRadius":10.0,"backstopDistance":{"value":0.0,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"stiffness":1.0},"colliderCollisionConstraint":{"mode":1,"friction":0.05000000074505806,"colliderList":[]},"selfCollisionConstraint":{"selfMode":0,"surfaceThickness":{"value":0.004999999888241291,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":0.5,"inSlope":0.0,"outSlope":0.5,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.5,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"syncMode":0,"syncPartner":{"instanceID":0}}} \ No newline at end of file diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Resources/MC2_BoneCloth_Ribbon_Demo.json.meta b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Resources/MC2_BoneCloth_Ribbon_Demo.json.meta new file mode 100644 index 00000000..8c3fafb8 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Resources/MC2_BoneCloth_Ribbon_Demo.json.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 9cb18a57f012d144480f025bca639032 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/Common/Resources/MC2_BoneCloth_Ribbon_Demo.json + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts.meta b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts.meta new file mode 100644 index 00000000..9a8e79f8 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2ccf7a2872d9e554ea3511882b07a3e7 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/AutoRotate.cs b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/AutoRotate.cs new file mode 100644 index 00000000..17daf4f8 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/AutoRotate.cs @@ -0,0 +1,60 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using UnityEngine; + +namespace MagicaCloth2 +{ + public class AutoRotate : MonoBehaviour + { + public Vector3 eulers = new Vector3(0, 90, 0); + public Space space = Space.World; + public enum UpdateMode + { + Update, + FixedUpdate, + } + [SerializeField] + private UpdateMode updateMode = UpdateMode.Update; + + [SerializeField] + [Range(0.1f, 5.0f)] + private float interval = 2.0f; + + public bool useSin = true; + + + private float time = 0; + + protected void FixedUpdate() + { + if (updateMode == UpdateMode.FixedUpdate) + UpdatePosition(Time.fixedDeltaTime); + } + + protected void Update() + { + if (updateMode == UpdateMode.Update) + UpdatePosition(Time.deltaTime); + } + + void UpdatePosition(float dtime) + { + if (useSin) + { + time += dtime; + float ang = (time % interval) / interval * Mathf.PI * 2.0f; + var t = Mathf.Sin(ang); + if (space == Space.World) + transform.eulerAngles = eulers * t; + else + transform.localEulerAngles = eulers * t; + } + else + { + transform.Rotate(eulers * dtime, space); + } + } + } + +} diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/AutoRotate.cs.meta b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/AutoRotate.cs.meta new file mode 100644 index 00000000..39735d8b --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/AutoRotate.cs.meta @@ -0,0 +1,19 @@ +fileFormatVersion: 2 +guid: 4124c59241137374c9cae45d25683042 +timeCreated: 1510336570 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/AutoRotate.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/CameraOrbit.cs b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/CameraOrbit.cs new file mode 100644 index 00000000..8db35753 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/CameraOrbit.cs @@ -0,0 +1,249 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// ‚ЃĦƒİċ›žèğ˘ + /// + public class CameraOrbit : MonoBehaviour + { + [SerializeField] + private Transform cameraTransform; + + [Header("Camera Target")] + public Transform cameraTarget; + public Vector3 cameraTargetPos; + public Vector3 cameraTargetOffset; + + [Header("Now Position")] + [SerializeField] + private float cameraDist = 1.5f; + [SerializeField] + private float cameraPitch = 21.0f; + [SerializeField] + private float cameraYaw = 180.0f; + + [Header("Parameter")] + [SerializeField] + private float cameraDistHokanTime = 0.1f; + [SerializeField] + private float cameraAngleHokanTime = 0.1f; + + [SerializeField] + private float cameraDistSpeed = 0.02f; + [SerializeField] + private float cameraDistMax = 8.0f; + [SerializeField] + private float cameraDistMin = 0.1f; + + [SerializeField] + private float cameraYawSpeed = 0.3f; + [SerializeField] + private float cameraPitchSpeed = 0.3f; + [SerializeField] + private float cameraMaxAngleSpeed = 100.0f; + [SerializeField] + private float cameraPitchMax = 89.0f; + [SerializeField] + private float cameraPitchMin = -89.0f; + + // 中ƒœ‚żƒ³ƒ‰ƒİƒƒ‚°Ğ‚ˆ‚‹ç§ğċ‹• + public enum MoveMode + { + None, + UpDown, + Free, + } + [SerializeField] + private MoveMode moveMode = MoveMode.Free; + [SerializeField] + private float moveSpeed = 0.002f; + + // è‡Şċ‹•ċ›žèğ˘ + [Header("Auto Rotation")] + [SerializeField] + private bool useAutoRotation = false; + [SerializeField] + private float autoRotationSpeed = 90.0f; + + + // ç§ğċ‹•作ĉ­ç”¨ + private float setCameraDist; + private float setCameraPitch; + private float setCameraYaw; + private float cameraDistVelocity; + private float cameraPitchVelocity; + private float cameraYawVelocity; + private float offsetYaw; + + protected void Start() + { + if (cameraTransform == null) + { + var cam = GetComponent(); + if (cam) + cameraTransform = cam.transform; + } + if (cameraTransform == null) + enabled = false; + + setCameraDist = cameraDist; + setCameraPitch = cameraPitch; + setCameraYaw = cameraYaw; + } + + protected void OnEnable() + { + // ċ…ċŠ›‚¤ƒ™ƒ³ƒˆç™ğ録 + SimpleInputManager.OnTouchMove += OnTouchMove; + SimpleInputManager.OnDoubleTouchMove += OnDoubleTouchMove; + SimpleInputManager.OnTouchPinch += OnTouchPinch; + } + + protected void OnDisable() + { + // ċ…ċŠ›‚¤ƒ™ƒ³ƒˆè§£é™¤ + SimpleInputManager.OnTouchMove -= OnTouchMove; + SimpleInputManager.OnDoubleTouchMove -= OnDoubleTouchMove; + SimpleInputManager.OnTouchPinch -= OnTouchPinch; + } + + protected void LateUpdate() + { + // ‚ЃĦƒİĉ›´ĉ–° + updateCamera(); + } + + // ‚ЃĦƒİĉ›´ĉ–° + private void updateCamera() + { + if (cameraTransform == null) + return; + + // ‚ЃĦƒİ‚żƒĵ‚²ƒƒƒˆƒ‚¸‚·ƒ§ƒ³ + cameraTargetPos = cameraTarget ? cameraTarget.position : transform.position; + + // 補間 + cameraDist = Mathf.SmoothDamp(cameraDist, setCameraDist, ref cameraDistVelocity, cameraDistHokanTime); + cameraPitch = Mathf.SmoothDampAngle(cameraPitch, setCameraPitch, ref cameraPitchVelocity, cameraAngleHokanTime); + cameraYaw = Mathf.SmoothDampAngle(cameraYaw, setCameraYaw, ref cameraYawVelocity, cameraAngleHokanTime); + + // è‡Şċ‹•ċ›žèğ˘ + if (useAutoRotation) + { + offsetYaw += autoRotationSpeed * Time.deltaTime; + } + + // ċş§ĉ¨™ç˘şċš + Quaternion q = Quaternion.Euler(cameraPitch, cameraYaw + offsetYaw, 0); + q = transform.rotation * q; // ‚³ƒ³ƒƒĵƒƒ³ƒˆċ›žèğ˘ + Vector3 v = new Vector3(0, 0, -cameraDist); + Vector3 pos = q * v; + + // ‚żƒĵ‚²ƒƒƒˆƒ‚¸‚·ƒ§ƒ³ + Vector3 tarpos = cameraTargetPos + transform.TransformVector(cameraTargetOffset); + Vector3 fixpos = tarpos + pos; + cameraTransform.position = fixpos; + + // ċ›žèğ˘ç˘şċš + Vector3 relativePos = tarpos - cameraTransform.position; + Quaternion rot = Quaternion.LookRotation(relativePos, transform.up); + cameraTransform.rotation = rot; + } + + // ċ›žèğ˘ĉ“ä½œ + private void updatePitchYaw(Vector2 speed) + { + // Yaw + setCameraYaw += speed.x * cameraYawSpeed; + + // Pitch + setCameraPitch += -speed.y * cameraPitchSpeed; + setCameraPitch = Mathf.Clamp(setCameraPitch, cameraPitchMin, cameraPitchMax); + } + + // ç§ğċ‹•ĉ“ä½œ + private void updateOffset(Vector2 speed) + { + if (cameraTransform == null) + { + return; + } + + if (moveMode == MoveMode.UpDown) + { + cameraTargetOffset.y -= speed.y * moveSpeed; + } + else if (moveMode == MoveMode.Free) + { + Vector3 offset = moveSpeed * -speed.y * transform.InverseTransformDirection(cameraTransform.up); + offset += moveSpeed * -speed.x * transform.InverseTransformDirection(cameraTransform.right); + + cameraTargetOffset += offset; + } + } + + // ‚şƒĵƒ ĉ“ä½œ + private void updateZoom(float speed) + { + float value = speed * cameraDistSpeed; + float scl = Mathf.InverseLerp(cameraDistMin, cameraDistMax, setCameraDist); + scl = Mathf.Clamp(scl, 0.1f, 1.0f); + setCameraDist -= value * scl; + setCameraDist = Mathf.Clamp(setCameraDist, cameraDistMin, cameraDistMax); + } + + //============================================================================================= + /// + /// ċ…ċŠ›é€šçŸïĵšç§ğċ‹• + /// + /// + /// + private void OnTouchMove(int fid, Vector2 screenPos, Vector2 screenVelocity, Vector2 cmVelocity) + { + screenVelocity *= SpeedAdjustment(); + + if (fid == 2) + { + // 中ƒ‰ƒİƒƒ‚° + updateOffset(screenVelocity); + } + else if (fid == 0) + { + // ċ·Ĥƒ‰ƒİƒƒ‚° + // ĉœ€ċ¤§é€ŸċşĤ + screenVelocity = Vector2.ClampMagnitude(screenVelocity, cameraMaxAngleSpeed); + updatePitchYaw(screenVelocity); + } + } + + private void OnDoubleTouchMove(int fid, Vector2 screenPos, Vector2 screenVelocity, Vector2 cmVelocity) + { + screenVelocity *= SpeedAdjustment(); + + if (SimpleInputManager.Instance.GetTouchCount() >= 3) + updateOffset(screenVelocity); + } + + /// + /// ċ…ċŠ›é€šçŸïĵšƒ”ƒ³ƒ‚¤ƒ³ïĵ‚˘‚Ĥƒˆ + /// + /// + /// + private void OnTouchPinch(float speedscr, float speedcm) + { + speedcm *= SpeedAdjustment(); + + if (SimpleInputManager.Instance.GetTouchCount() < 3) + updateZoom(speedcm); + } + + private float SpeedAdjustment() + { + return Time.deltaTime * 60.0f; + } + } +} diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/CameraOrbit.cs.meta b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/CameraOrbit.cs.meta new file mode 100644 index 00000000..9b3bf462 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/CameraOrbit.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 1fd18111ed866534a92d0a2a59d1608d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/CameraOrbit.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/CreateSingleton.cs b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/CreateSingleton.cs new file mode 100644 index 00000000..68984fa3 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/CreateSingleton.cs @@ -0,0 +1,136 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// ċŸşĉœĴ的Ş‚·ƒ³‚°ƒĞƒˆƒ³ƒ†ƒ³ƒ—ƒĴƒĵƒˆ + /// ƒğ‚·ƒĵƒ³Ğç„Ħ„ċ ´ċˆŻä½œĉˆ™‚‹ + /// ƒğè‡Şċ‹•ċˆĉœŸċŒ–ċ‘ĵ³ċ‡ş—ĉݟ能 + /// ƒğDontDestroyOnLoad設ċš + /// ƒğċŸèĦŒċ‰§‚‚Instance‚˘‚Ż‚ğ‚ıċŻèƒ½ + /// + /// + public abstract class CreateSingleton : MonoBehaviour where T : MonoBehaviour + { + private static T instance; + + /// + /// ċˆĉœŸċŒ–ƒ•ƒİ‚° + /// + private static T initInstance; + + private static bool isDestroy; + + + /// + /// Reload Domain ċŻċżœ + /// â€ğĉ‹ċżµŞŒ‚‰‚¸‚§ƒƒŞƒƒ‚Ż‚Żƒİ‚ı§Ż[RuntimeInitializeOnLoadMethod]Œċˆİ用§Ş„Ÿ‚€ + /// “ċˆĉœŸċŒ–é–˘ĉ•°‚’ĉ´ç”Ÿċ…ƒ§[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] + /// ‚’ä½żç”¨—Ĥċ‘ĵ³ċ‡ş•Ş‘‚Œ°Ş‚‰Ş„ + /// + protected static void InitMember() + { + instance = null; + initInstance = null; + isDestroy = false; + } + + public static T Instance + { + get + { + if (instance == null) + { + // FindObjectOfTypeŻ‚ŒŞ‚ЁĞ負荷Œ‹‹‚‹§ĉ³¨ĉ„ïĵ + // 非‚˘‚Żƒ†‚£ƒ–‚ރ–‚¸‚§‚ŻƒˆŻç™şèĤ‹§Ş„§ĉ³¨ĉ„ïĵ +#if UNITY_6000_4_OR_NEWER + instance = FindAnyObjectByType(); +#elif UNITY_2023_1_OR_NEWER + instance = FindFirstObjectByType(); +#else + instance = FindObjectOfType(); +#endif + + if (instance == null && Application.isPlaying) + { + var obj = new GameObject(typeof(T).Name); + instance = obj.AddComponent(); + } + } + + // ċˆĉœŸċŒ– + InitInstance(); + + return instance; + } + } + + private static void InitInstance() + { + if (initInstance == null && instance != null && Application.isPlaying) + { + // ‚·ƒĵƒ³ċˆ‡‚Šĉ›żˆ§‚‚‚ރ–‚¸‚§‚ŻƒˆŒĉĥˆˆŞ„‚ˆ†Ğ設ċš + //DontDestroyOnLoad(instance.gameObject); + + // ċˆĉœŸċŒ–ċ‘ĵ³ċ‡ş— + var s = instance as CreateSingleton; + s.InitSingleton(); + + initInstance = instance; + } + } + + /// + /// ‚¤ƒ³‚ı‚żƒ³‚ıŒċ­˜ċœ¨™‚‹ċ ´ċˆĞTrue‚’èż”—™ + /// + /// + public static bool IsInstance() + { + return instance != null && isDestroy == false; + } + + /// + /// Awake()§‚¤ƒ³‚ı‚żƒ³‚ı設ċš + /// + protected virtual void Awake() + { + if (instance == null) + { + instance = this as T; + InitInstance(); + } + else if (instance != this) + { + // ïĵ’¤ç›‚³ƒ³ƒƒĵƒƒ³ƒˆ‚’発èĤ‹ + var s = instance as CreateSingleton; + s.DuplicateDetection(this as T); + + // ïĵ’¤ç›‚³ƒ³ƒƒĵƒƒ³ƒˆŻç ´ĉ£„™‚‹ + Destroy(this.gameObject); + } + } + + protected virtual void OnDestroy() + { + // ‚¤ƒ³‚ı‚żƒ³‚ı‚Żƒİ‚ıŞ‚‰°ç„ĦċŠıċŒ–ƒ•ƒİ‚°‚’çĞ‹Ĥ‚‹ + if (instance == this) + { + isDestroy = true; + } + } + + /// + /// ïĵ’¤ç›ç ´ĉ£„•‚Œ‚‹‚³ƒ³ƒƒĵƒƒ³ƒˆ‚’é€šçŸ + /// + /// + protected virtual void DuplicateDetection(T duplicate) { } + + /// + /// ċ†…部ċˆĉœŸċŒ– + /// + protected abstract void InitSingleton(); + } +} diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/CreateSingleton.cs.meta b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/CreateSingleton.cs.meta new file mode 100644 index 00000000..d395d9a3 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/CreateSingleton.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 0d1b801c369005647ae0e5a315e0bdaf +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/CreateSingleton.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/Editor.meta b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/Editor.meta new file mode 100644 index 00000000..52f4e504 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 776d5a1b173ef154c9bef26d30c53fcc +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/Editor/ShaderGraph.meta b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/Editor/ShaderGraph.meta new file mode 100644 index 00000000..35c53220 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/Editor/ShaderGraph.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 347fb6ccc378d9442a92b5316d0ff7c9 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/Editor/ShaderGraph/MagicaCloth2UPMImporterShaderGraph.asmdef b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/Editor/ShaderGraph/MagicaCloth2UPMImporterShaderGraph.asmdef new file mode 100644 index 00000000..0f3f8bea --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/Editor/ShaderGraph/MagicaCloth2UPMImporterShaderGraph.asmdef @@ -0,0 +1,24 @@ +{ + "name": "MagicaCloth2UPMImporterShaderGraph", + "rootNamespace": "", + "references": [], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [ + "!MC2_SHADERGRAPH" + ], + "versionDefines": [ + { + "name": "com.unity.shadergraph", + "expression": "12.0.0", + "define": "MC2_SHADERGRAPH" + } + ], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/Editor/ShaderGraph/MagicaCloth2UPMImporterShaderGraph.asmdef.meta b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/Editor/ShaderGraph/MagicaCloth2UPMImporterShaderGraph.asmdef.meta new file mode 100644 index 00000000..05762707 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/Editor/ShaderGraph/MagicaCloth2UPMImporterShaderGraph.asmdef.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 34d2974f64e7a9f49a48b400abf046ff +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/Editor/ShaderGraph/MagicaCloth2UPMImporterShaderGraph.asmdef + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/Editor/ShaderGraph/UnityPackageImporter.cs b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/Editor/ShaderGraph/UnityPackageImporter.cs new file mode 100644 index 00000000..a879de28 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/Editor/ShaderGraph/UnityPackageImporter.cs @@ -0,0 +1,30 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using UnityEditor; +using UnityEditor.PackageManager; +using UnityEngine; + +namespace MagicaCloth2UPMImporterCollections +{ + /// + /// ċż…èĤŞUnityPackageè‡Şċ‹•‚¤ƒ³‚ıƒˆƒĵƒĞ + /// + [InitializeOnLoad] + public static class UnityPackageImporter + { + static UnityPackageImporter() + { + Install("com.unity.shadergraph"); + } + + public static bool Install(string id) + { + Debug.Log($"Install...{id}"); + var request = Client.Add(id); + while (!request.IsCompleted) { }; + if (request.Error != null) Debug.LogError(request.Error.message); + return request.Error == null; + } + } +} diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/Editor/ShaderGraph/UnityPackageImporter.cs.meta b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/Editor/ShaderGraph/UnityPackageImporter.cs.meta new file mode 100644 index 00000000..45d878d3 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/Editor/ShaderGraph/UnityPackageImporter.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: dd5d6386919360640adca6564193a8f5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/Editor/ShaderGraph/UnityPackageImporter.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/GameObjectContainer.cs b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/GameObjectContainer.cs new file mode 100644 index 00000000..08e0c962 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/GameObjectContainer.cs @@ -0,0 +1,44 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System.Collections.Generic; +using UnityEngine; + +namespace MagicaCloth2 +{ + public class GameObjectContainer : MonoBehaviour + { + [SerializeField] + private List gameObjectList = new List(); + + + private Dictionary gameObjectDict = new Dictionary(); + + protected void Awake() + { + // create dictionary. + foreach (var obj in gameObjectList) + { + if (obj) + { + gameObjectDict.Add(obj.name, obj); + } + } + } + + public bool Contains(string objName) + { + return gameObjectDict.ContainsKey(objName); + } + + public GameObject GetGameObject(string objName) + { + if (gameObjectDict.ContainsKey(objName)) + { + return gameObjectDict[objName]; + } + else + return null; + } + } +} diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/GameObjectContainer.cs.meta b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/GameObjectContainer.cs.meta new file mode 100644 index 00000000..2bc7af87 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/GameObjectContainer.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 4357444b3effcf149a7c0557d3c4ddc5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/GameObjectContainer.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/MagicaCloth2Example.asmdef b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/MagicaCloth2Example.asmdef new file mode 100644 index 00000000..f0713e7a --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/MagicaCloth2Example.asmdef @@ -0,0 +1,25 @@ +{ + "name": "MagicaCloth2Example", + "rootNamespace": "", + "references": [ + "MagicaClothV2", + "Unity.InputSystem" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": true, + "precompiledReferences": [], + "autoReferenced": false, + "defineConstraints": [ + "MAGICACLOTH2" + ], + "versionDefines": [ + { + "name": "com.unity.inputsystem", + "expression": "1.0.0", + "define": "MC2_INPUTSYSTEM" + } + ], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/MagicaCloth2Example.asmdef.meta b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/MagicaCloth2Example.asmdef.meta new file mode 100644 index 00000000..8fb4a072 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/MagicaCloth2Example.asmdef.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 5bc0ea054e216f5498d1a84885db7ab1 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/MagicaCloth2Example.asmdef + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/ModelController.cs b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/ModelController.cs new file mode 100644 index 00000000..3889240c --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/ModelController.cs @@ -0,0 +1,82 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System.Collections.Generic; +using UnityEngine; + +namespace MagicaCloth2 +{ + public class ModelController : MonoBehaviour + { + [SerializeField] + private List characterList = new List(); + + [SerializeField] + private float slowTime = 0.1f; + + private bool slow; + + protected void Start() + { + slow = false; + } + + private void AnimatorAction(System.Action act) + { + foreach (var chara in characterList) + { + if (chara && chara.activeInHierarchy) + { + var animator = chara.GetComponent(); + if (animator) + { + act(animator); + } + } + } + } + + private void ClothAction(System.Action act) + { + foreach (var chara in characterList) + { + if (chara && chara.activeInHierarchy) + { + var clothList = chara.GetComponentsInChildren(true); + if (clothList != null) + { + foreach (var cloth in clothList) + { + act(cloth); + } + } + } + } + } + + public void OnNextButton() + { + AnimatorAction((ani) => ani.SetTrigger("Next")); + } + + public void OnBackButton() + { + AnimatorAction((ani) => ani.SetTrigger("Back")); + } + + public void OnSlowButton() + { + slow = !slow; + + float timeScale = slow ? slowTime : 1.0f; + + AnimatorAction((ani) => ani.speed = timeScale); + ClothAction((cloth) => cloth.SetTimeScale(timeScale)); + } + + public void OnActiveButton() + { + ClothAction((cloth) => cloth.gameObject.SetActive(!cloth.gameObject.activeSelf)); + } + } +} diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/ModelController.cs.meta b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/ModelController.cs.meta new file mode 100644 index 00000000..89432ecb --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/ModelController.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 49572a6b5327127438636ad59bdb9226 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/ModelController.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/RuntimeBuildDemo.cs b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/RuntimeBuildDemo.cs new file mode 100644 index 00000000..5837b149 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/RuntimeBuildDemo.cs @@ -0,0 +1,248 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// A sample that builds MagicaCloth at runtime. + /// + public class RuntimeBuildDemo : MonoBehaviour + { + [SerializeField] + private GameObject characterPrefab; + [SerializeField] + private MagicaCloth frontHairSource; + [SerializeField] + private string ribbonPresetName; + [SerializeField] + private string skirtName; + [SerializeField] + private Texture2D skirtPaintMap; + + GameObject character; + GameObjectContainer gameObjectContainer; + + protected void Start() + { + character = null; + gameObjectContainer = null; + } + + public void OnCreateButton() + { + if (character) + return; + + // Generate a character from a prefab. + GenerateCharacter(); + + // BoneCloth construction example (1). + SetupHairTail_BoneCloth(); + + // BoneCloth construction example (2). + SetupFrontHair_BoneCloth(); + + // BoneCloth construction example (3). + SetupRibbon_BoneCloth(); + + // MeshCloth construction example (1). + SetupSkirt_MeshCloth(); + } + + public void OnRemoveButton() + { + if (character) + { + Destroy(character); + character = null; + gameObjectContainer = null; + } + } + + /// + /// Generate a character from a prefab. + /// A character already contains a to reference a GameObject. + /// This component is optional. + /// It's just there to help with data construction. + /// + void GenerateCharacter() + { + if (characterPrefab) + { + character = Instantiate(characterPrefab, transform); + gameObjectContainer = character.GetComponent(); + } + } + + /// + /// BoneCloth construction example (1). + /// Set all parameters from a script. + /// + void SetupHairTail_BoneCloth() + { + if (character == null) + return; + + var obj = new GameObject("HairTail_BoneCloth"); + obj.transform.SetParent(character.transform, false); + + // add Magica Cloth + var cloth = obj.AddComponent(); + var sdata = cloth.SerializeData; + + // bone cloth + sdata.clothType = ClothProcess.ClothType.BoneCloth; + sdata.rootBones.Add(gameObjectContainer.GetGameObject("J_L_HairTail_00_B").transform); + sdata.rootBones.Add(gameObjectContainer.GetGameObject("J_R_HairTail_00_B").transform); + + // setup parameters + sdata.gravity = 3.0f; + sdata.damping.SetValue(0.05f); + sdata.angleRestorationConstraint.stiffness.SetValue(0.15f, 1.0f, 0.15f, true); + sdata.angleRestorationConstraint.velocityAttenuation = 0.6f; + sdata.tetherConstraint.distanceCompression = 0.5f; + sdata.inertiaConstraint.particleSpeedLimit.SetValue(true, 3.0f); + sdata.colliderCollisionConstraint.mode = ColliderCollisionConstraint.Mode.None; + + // start build + cloth.BuildAndRun(); + } + + /// + /// BoneCloth construction example (2). + /// Copy parameters from an existing component. + /// + void SetupFrontHair_BoneCloth() + { + if (character == null || frontHairSource == null) + return; + + var obj = new GameObject("HairFront_BoneCloth"); + obj.transform.SetParent(character.transform, false); + + // add Magica Cloth + var cloth = obj.AddComponent(); + var sdata = cloth.SerializeData; + + // bone cloth + sdata.clothType = ClothProcess.ClothType.BoneCloth; + sdata.rootBones.Add(gameObjectContainer.GetGameObject("J_L_HairFront_00_B").transform); + sdata.rootBones.Add(gameObjectContainer.GetGameObject("J_L_HairSide2_00_B").transform); + sdata.rootBones.Add(gameObjectContainer.GetGameObject("J_L_HairSide_00_B").transform); + sdata.rootBones.Add(gameObjectContainer.GetGameObject("J_R_HairFront_00_B").transform); + sdata.rootBones.Add(gameObjectContainer.GetGameObject("J_R_HairSide2_00_B").transform); + sdata.rootBones.Add(gameObjectContainer.GetGameObject("J_R_HairSide_00_B").transform); + + // Normal direction setting for backstop + sdata.normalAlignmentSetting.alignmentMode = NormalAlignmentSettings.AlignmentMode.Transform; + sdata.normalAlignmentSetting.adjustmentTransform = gameObjectContainer.GetGameObject("HeadCenter").transform; + + // setup parameters + // Copy from source settings + sdata.Import(frontHairSource, false); + + // start build + cloth.BuildAndRun(); + } + + /// + /// BoneCloth construction example (3). + /// Load parameters from saved presets. + /// + void SetupRibbon_BoneCloth() + { + if (character == null || string.IsNullOrEmpty(ribbonPresetName)) + return; + + var obj = new GameObject("Ribbon_BoneCloth"); + obj.transform.SetParent(character.transform, false); + + // add Magica Cloth + var cloth = obj.AddComponent(); + var sdata = cloth.SerializeData; + + // bone cloth + sdata.clothType = ClothProcess.ClothType.BoneCloth; + sdata.rootBones.Add(gameObjectContainer.GetGameObject("J_L_HeadRibbon_00_B").transform); + sdata.rootBones.Add(gameObjectContainer.GetGameObject("J_R_HeadRibbon_00_B").transform); + + // setup parameters + // Load presets from the Resource folder. + // Since presets are in TextAssets format, they can also be used as asset bundles. + var presetText = Resources.Load(ribbonPresetName); + sdata.ImportJson(presetText.text); + + // start build + cloth.BuildAndRun(); + } + + /// + /// MeshCloth construction example (1). + /// Reads vertex attributes from a paintmap. + /// + void SetupSkirt_MeshCloth() + { + if (character == null || skirtPaintMap == null) + return; + + // skirt renderer + var sobj = gameObjectContainer.GetGameObject(skirtName); + if (sobj == null) + return; + if (!sobj.TryGetComponent(out var skirtRenderer)) + return; + + // add Magica Cloth + var obj = new GameObject("Skirt_MeshCloth"); + obj.transform.SetParent(character.transform, false); + var cloth = obj.AddComponent(); + var sdata = cloth.SerializeData; + + // mesh cloth + sdata.clothType = ClothProcess.ClothType.MeshCloth; + sdata.sourceRenderers.Add(skirtRenderer); + + // reduction settings + sdata.reductionSetting.simpleDistance = 0.0212f; + sdata.reductionSetting.shapeDistance = 0.0244f; + + // paint map settings + // *** Paintmaps must have Read/Write attributes enabled! *** + sdata.paintMode = ClothSerializeData.PaintMode.Texture_Fixed_Move; + sdata.paintMaps.Add(skirtPaintMap); + + // setup parameters + sdata.gravity = 1.0f; + sdata.damping.SetValue(0.03f); + sdata.angleRestorationConstraint.stiffness.SetValue(0.05f, 1.0f, 0.5f, true); + sdata.angleRestorationConstraint.velocityAttenuation = 0.5f; + sdata.angleLimitConstraint.useAngleLimit = true; + sdata.angleLimitConstraint.limitAngle.SetValue(45.0f, 0.0f, 1.0f, true); + sdata.distanceConstraint.stiffness.SetValue(0.5f, 1.0f, 0.5f, true); + sdata.tetherConstraint.distanceCompression = 0.9f; + sdata.inertiaConstraint.depthInertia = 0.7f; + sdata.inertiaConstraint.movementSpeedLimit.SetValue(true, 3.0f); + sdata.inertiaConstraint.particleSpeedLimit.SetValue(true, 3.0f); + sdata.colliderCollisionConstraint.mode = ColliderCollisionConstraint.Mode.Point; + + // setup collider + // UpperLeg L + var lobj = new GameObject("CapsuleCollider_L"); + lobj.transform.SetParent(gameObjectContainer.GetGameObject("Character1_LeftUpLeg").transform); + lobj.transform.localPosition = new Vector3(0.0049f, 0.0f, -0.0832f); + lobj.transform.localEulerAngles = new Vector3(0.23f, 16.376f, -0.028f); + var colliderL = lobj.AddComponent(); + colliderL.direction = MagicaCapsuleCollider.Direction.Z; + colliderL.SetSize(0.082f, 0.094f, 0.3f); + // UpperLeg R (Symmetry) + colliderL.symmetryMode = ColliderSymmetryMode.AutomaticHumanBody; + colliderL.UpdateParameters(); // Required when changing parameters. + sdata.colliderCollisionConstraint.colliderList.Add(colliderL); + + // start build + cloth.BuildAndRun(); + } + } +} diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/RuntimeBuildDemo.cs.meta b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/RuntimeBuildDemo.cs.meta new file mode 100644 index 00000000..09427b80 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/RuntimeBuildDemo.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: d0126e2925cecdf4a933c28a27f415ac +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/RuntimeBuildDemo.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/RuntimeDressUpDemo.cs b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/RuntimeDressUpDemo.cs new file mode 100644 index 00000000..d11978ff --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/RuntimeDressUpDemo.cs @@ -0,0 +1,210 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System.Collections.Generic; +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// Dress-up sample. + /// + public class RuntimeDressUpDemo : MonoBehaviour + { + /// + /// Avatar to change clothes. + /// + public GameObject targetAvatar; + + /// + /// Hair prefab with MagicaCloth set in advance. + /// + public GameObject hariEqupPrefab; + + /// + /// Clothes prefab with MagicaCloth set in advance. + /// + public GameObject bodyEquipPrefab; + + //========================================================================================= + /// + /// Bones dictionary of avatars to dress up. + /// + Dictionary targetAvatarBoneMap = new Dictionary(); + + /// + /// Information class for canceling dress-up. + /// + class EquipInfo + { + public GameObject equipObject; + public List colliderList; + + public bool IsValid() => equipObject != null; + } + EquipInfo hairEquipInfo = new EquipInfo(); + EquipInfo bodyEquipInfo = new EquipInfo(); + + //========================================================================================= + protected void Start() + { + Init(); + } + + //========================================================================================= + public void OnHairEquipButton() + { + if (hairEquipInfo.IsValid()) + Remove(hairEquipInfo); + else + Equip(hariEqupPrefab, hairEquipInfo); + } + + public void OnBodyEquipButton() + { + if (bodyEquipInfo.IsValid()) + Remove(bodyEquipInfo); + else + Equip(bodyEquipPrefab, bodyEquipInfo); + } + + //========================================================================================= + /// + /// Create an avatar bone dictionary in advance. + /// + void Init() + { + Debug.Assert(targetAvatar); + + // Create all bone maps for the target avatar + foreach (Transform bone in targetAvatar.GetComponentsInChildren()) + { + if (targetAvatarBoneMap.ContainsKey(bone.name) == false) + { + targetAvatarBoneMap.Add(bone.name, bone); + } + else + { + Debug.Log($"Duplicate bone name :{bone.name}"); + } + } + } + + /// + /// Equip clothes. + /// + /// + /// + void Equip(GameObject equipPrefab, EquipInfo einfo) + { + Debug.Assert(equipPrefab); + + // Generate a prefab with cloth set up. + var gobj = Instantiate(equipPrefab, targetAvatar.transform); + + // All cloth components included in the prefab. + var clothList = new List(gobj.GetComponentsInChildren()); + + // All collider components included in the prefab. + var colliderList = new List(gobj.GetComponentsInChildren()); + + //€€All renderers included in the prefab. + var skinList = new List(gobj.GetComponentsInChildren()); + + // First stop the automatic build that is executed with Start(). + // And just in case, it does some initialization called Awake(). + foreach (var cloth in clothList) + { + // Normally it is called with Awake(), but if the component is disabled, it will not be executed, so call it manually. + // Ignored if already run with Awake(). + cloth.Initialize(); + + // Turn off auto-build on Start(). + cloth.DisableAutoBuild(); + } + + // Swap the bones of the SkinnedMeshRenderer. + // This process is a general dress-up process for SkinnedMeshRenderer. + // Comment out this series of processes when performing this process with functions such as other assets. + foreach (var sren in skinList) + { + var bones = sren.bones; + Transform[] newBones = new Transform[bones.Length]; + + for (int i = 0; i < bones.Length; ++i) + { + Transform bone = bones[i]; + if (!targetAvatarBoneMap.TryGetValue(bone.name, out newBones[i])) + { + // Is the bone the renderer itself? + if (bone.name == sren.name) + { + newBones[i] = sren.transform; + } + else + { + // bone not found + Debug.Log($"[SkinnedMeshRenderer({sren.name})] Unable to map bone [{bone.name}] to target skeleton."); + } + } + } + sren.bones = newBones; + + // root bone + if (targetAvatarBoneMap.ContainsKey(sren.rootBone != null ? sren.rootBone.name : null)) + { + sren.rootBone = targetAvatarBoneMap[sren.rootBone.name]; + } + } + + // Here, replace the bones used by the MagicaCloth component. + foreach (var cloth in clothList) + { + // Replaces a component's transform. + cloth.ReplaceTransform(targetAvatarBoneMap); + } + + // Move all colliders to the new avatar. + foreach (var collider in colliderList) + { + Transform parent = collider.transform.parent; + if (parent && targetAvatarBoneMap.ContainsKey(parent.name)) + { + Transform newParent = targetAvatarBoneMap[parent.name]; + + // After changing the parent, you need to write back the local posture and align it. + collider.transform.GetLocalPositionAndRotation(out var localPosition, out var localRotation); + collider.transform.SetParent(newParent); + collider.transform.SetLocalPositionAndRotation(localPosition, localRotation); + } + } + + // Finally let's start building the cloth component. + foreach (var cloth in clothList) + { + // I disabled the automatic build, so I build it manually. + cloth.BuildAndRun(); + } + + // Record information for release. + einfo.equipObject = gobj; + einfo.colliderList = colliderList; + } + + /// + /// Removes equipped clothing. + /// + /// + void Remove(EquipInfo einfo) + { + Destroy(einfo.equipObject); + foreach (var c in einfo.colliderList) + { + Destroy(c.gameObject); + } + + einfo.equipObject = null; + einfo.colliderList.Clear(); + } + } +} diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/RuntimeDressUpDemo.cs.meta b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/RuntimeDressUpDemo.cs.meta new file mode 100644 index 00000000..9a678e18 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/RuntimeDressUpDemo.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: e72f8cfc2a22d184e86b4e1905cdf3ec +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/RuntimeDressUpDemo.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/SimpleInput.cs b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/SimpleInput.cs new file mode 100644 index 00000000..ab3496ce --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/SimpleInput.cs @@ -0,0 +1,196 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2025 MagicaSoft. +// https://magicasoft.jp +using UnityEngine; +#if MC2_INPUTSYSTEM +using UnityEngine.InputSystem; +using UnityEngine.InputSystem.EnhancedTouch; +#endif + +namespace MagicaCloth2 +{ + /// + /// InputManager/InputSystemċ…ċŠ›ċˆ‡‚Šĉ›żˆƒİƒƒƒ‘ƒĵ + /// + public class SimpleInput + { +#if MC2_INPUTSYSTEM + // (New) Imput System + public static void Init() + { + EnhancedTouchSupport.Enable(); + } + + public static int touchCount + { + get + { + return UnityEngine.InputSystem.EnhancedTouch.Touch.activeTouches.Count; + } + } + + public static UnityEngine.Touch GetTouch(int index) + { + var touchData = new UnityEngine.Touch(); + + int count = UnityEngine.InputSystem.EnhancedTouch.Touch.activeTouches.Count; + if (index < count) + { + var touch = UnityEngine.InputSystem.EnhancedTouch.Touch.activeTouches[index]; + + // convert + touchData.fingerId = touch.finger.index; + touchData.position = touch.screenPosition; + touchData.deltaPosition = touch.delta; + switch (touch.phase) + { + case UnityEngine.InputSystem.TouchPhase.Canceled: + touchData.phase = UnityEngine.TouchPhase.Canceled; + break; + case UnityEngine.InputSystem.TouchPhase.Ended: + touchData.phase = UnityEngine.TouchPhase.Ended; + break; + case UnityEngine.InputSystem.TouchPhase.Moved: + touchData.phase = UnityEngine.TouchPhase.Moved; + break; + case UnityEngine.InputSystem.TouchPhase.Began: + touchData.phase = UnityEngine.TouchPhase.Began; + break; + } + } + + return touchData; + } + + public static bool GetKey(KeyCode key) + { + switch (key) + { + case KeyCode.Escape: + return Keyboard.current.escapeKey.isPressed; + default: + return false; + } + } + + public static bool GetKeyDown(KeyCode key) + { + switch (key) + { + case KeyCode.Backspace: + return Keyboard.current.backspaceKey.wasPressedThisFrame; + default: + return false; + } + } + + public static bool GetMouseButtonDown(int button) + { + switch (button) + { + case 0: + return Mouse.current.leftButton.wasPressedThisFrame; + case 1: + return Mouse.current.rightButton.wasPressedThisFrame; + case 2: + return Mouse.current.middleButton.wasPressedThisFrame; + default: + return false; + } + } + + public static bool GetMouseButtonUp(int button) + { + switch (button) + { + case 0: + return Mouse.current.leftButton.wasReleasedThisFrame; + case 1: + return Mouse.current.rightButton.wasReleasedThisFrame; + case 2: + return Mouse.current.middleButton.wasReleasedThisFrame; + default: + return false; + } + } + + public static Vector3 mousePosition + { + get + { + return Mouse.current.position.ReadValue(); + } + } + + public static float GetMouseScrollWheel() + { + // ċ¤„InputSystemĞ不ċ…·ċˆ‚‚Š + // ƒ›‚¤ƒĵƒĞƒ‡ƒĞ‚żŒƒ‡ƒ•‚݃Ѓˆ§x120•‚ŒĤèż”£Ĥ‚‹ + // “‚ŒŻWindowsżĉŒ™ċ‹•§Mac/Linux§Żç™şç”Ÿ—Ş„ + // —ĤUnity 2023.2äğ降Żäżĉ­£•‚ŒŸ + + float value = Mouse.current.scroll.ReadValue().y * 0.12f; // base +#if UNITY_2023_2_OR_NEWER + return value; +#else +#if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN + return value / 120.0f; // ƒ›‚¤ƒĵƒĞƒ‡ƒĞ‚żä¸ċ…·ċˆ‚’ċ¸ċŽ +#else + return value; +#endif +#endif + } +#else + // (Old) Imput Manager + public static void Init() + { + } + + public static int touchCount + { + get + { + return Input.touchCount; + } + } + + public static Touch GetTouch(int index) + { + return Input.GetTouch(index); + } + + public static bool GetKey(KeyCode key) + { + return Input.GetKey(key); + } + + public static bool GetKeyDown(KeyCode key) + { + return Input.GetKeyDown(key); + } + + public static bool GetMouseButtonDown(int button) + { + return Input.GetMouseButtonDown(button); + } + + public static bool GetMouseButtonUp(int button) + { + return Input.GetMouseButtonUp(button); + } + + public static Vector3 mousePosition + { + get + { + return Input.mousePosition; + } + } + + public static float GetMouseScrollWheel() + { + return Input.GetAxis("Mouse ScrollWheel"); + } +#endif + } +} diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/SimpleInput.cs.meta b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/SimpleInput.cs.meta new file mode 100644 index 00000000..bed46530 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/SimpleInput.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: ab72fcfec8965ae4181307a06400b57b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/SimpleInput.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/SimpleInputManager.cs b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/SimpleInputManager.cs new file mode 100644 index 00000000..80aff6c0 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/SimpleInputManager.cs @@ -0,0 +1,602 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using UnityEngine; +using UnityEngine.Events; +using UnityEngine.EventSystems; + +namespace MagicaCloth2 +{ + /// + /// ċ…ċŠ›ƒžƒƒĵ‚¸ƒ£ + /// ƒğç°Ħċ˜Ş‚żƒƒƒ—‚„ƒ•ƒŞƒƒ‚Żċˆ¤ċš + /// ƒğPCċ ´ċˆŻƒž‚Ĥ‚ıĞ‚ˆ‚‹è‡Şċ‹•‚¨ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ + /// + public class SimpleInputManager : CreateSingleton + { + // ĉœ€ċ¤§‚żƒƒƒĉ•° + private const int MaxFinger = 3; + + /// + /// ‚żƒƒƒ—ĉœ‰ċŠıċŠċ„(cm) + /// + public float tapRadiusCm = 0.5f; + + /// + /// ƒ•ƒŞƒƒ‚Żċˆ¤ċšè·é›˘(cm) + /// + public float flickRangeCm = 0.01f; + + /// + /// ƒ•ƒŞƒƒ‚Żċˆ¤ċšé€ŸċşĤ(cm/s) + /// + public float flickCheckSpeed = 1.0f; + + /// + /// ƒž‚Ĥ‚ıƒ›‚¤ƒĵƒĞƒ”ƒ³ƒ‚¤ƒ³ƒğƒ”ƒ³ƒ‚˘‚Ĥƒˆé€ŸċşĤ係ĉ•° + /// + public float mouseWheelSpeed = 5.0f; + + // ċ…ċŠ›ĉƒ…ċ ħçĦ理 + private int mainFingerId = -1; + private int subFingerId = -1; + private Vector2[] downPos; // ċ…ċЛ開ċ§‹ċş§ĉ¨™ïĵˆ‚ı‚ŻƒŞƒĵƒ³ïĵ‰ + private Vector2[] lastPos; + private Vector2[] flickDownPos; // ċ…ċЛ開ċ§‹ċş§ĉ¨™ïĵˆ‚ı‚ŻƒŞƒĵƒ³ïĵ‰ + private float[] flickDownTime; + private float lastTime = 0; // ƒƒƒ‚Żƒœ‚żƒ³é€£çĥšċ…ċŠ›é˜²ĉ­˘ç”¨ + + // ƒ˘ƒ‚¤ƒĞĉƒ…ċ ħçĦ理 + private bool mobilePlatform = false; + + // ƒž‚Ĥ‚ı‚¨ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ĉƒ…ċ ħçĦ理 + private bool[] mouseDown; + private Vector2[] mouseOldMovePos; + + // ƒ˘ƒ‹‚żĉƒ…ċ ħ + private float screenDpi; // ‚ı‚ŻƒŞƒĵƒ³DPIċ€¤ + private float screenDpc; // ‚ı‚ŻƒŞƒĵƒ³Dots per cmċ€¤ïĵˆïĵ‘cmċ½“Ÿ‚Ёƒ”‚Ż‚ğƒĞĉ•°ïĵ‰ + + //------------------------------ ƒ˘ƒ‚¤ƒĞ‚żƒƒƒƒ‘ƒƒĞïĵƒž‚Ĥ‚ı‚¨ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ ------------------ + // ‚żƒƒƒé–‹ċ§‹é€šçŸ + // ‚żƒƒƒ•‚ŒŸĉ™‚Ğ€ƒ•‚£ƒ³‚ĴƒĵID€ä½ç½ïĵˆ‚ı‚ŻƒŞƒĵƒ³ïĵ‰‚’通矁—™€‚ + public static UnityAction OnTouchDown; + + // ç§ğċ‹•é€šçŸ + // ‚żƒƒƒ•‚ŒŸç§ğċ‹••‚ŒŸċ ´ċˆĞ€ƒ•‚£ƒ³‚ĴƒĵID€ä½ç½ïĵˆ‚ı‚ŻƒŞƒĵƒ³ïĵ‰€é€ŸċşĤ(‚ı‚ŻƒŞƒĵƒ³ĉŻ”çŽ‡/s)€é€ŸċşĤ(cm/s)‚’通矁—™€‚ + public static UnityAction OnTouchMove; + + // ƒ€ƒ–ƒĞ‚żƒƒƒ•‚ŒŸç§ğċ‹••‚ŒŸċ ´ċˆĞ€ƒ•‚£ƒ³‚ĴƒĵID€ä½ç½ïĵˆ‚ı‚ŻƒŞƒĵƒ³ïĵ‰€é€ŸċşĤ(‚ı‚ŻƒŞƒĵƒ³ĉŻ”çŽ‡/s)€é€ŸċşĤ(cm/s)‚’通矁—™€‚ + public static UnityAction OnDoubleTouchMove; + + // ‚żƒƒƒçµ‚äş†é€šçŸ + // ‚żƒƒƒŒé›˘•‚ŒŸƒ•‚£ƒ³‚ĴƒĵID€ä½ç½ïĵˆ‚ı‚ŻƒŞƒĵƒ³ïĵ‰‚’通矁—™€‚ + public static UnityAction OnTouchUp; + + // ‚żƒƒƒ‚­ƒ£ƒ³‚ğƒĞé€šçŸ + // ‚żƒƒƒç§ğċ‹•Œ‚­ƒ£ƒ³‚ğƒĞïĵˆä¸ğĞç”ğ面ċ¤–Ğç§ğċ‹•ïĵ‰•‚ŒŸċ ´ċˆĞ€ƒ•‚£ƒ³‚ĴƒĵID€ĉœ€çµ‚位ç½ïĵˆ‚ı‚ŻƒŞƒĵƒ³ïĵ‰‚’通矁—™€‚ + public static UnityAction OnTouchMoveCancel; + + // ‚żƒƒƒ—é€šçŸ + // ‚żƒƒƒ—•‚ŒŸĉ™‚Ğ€ƒ•‚£ƒ³‚ĴƒĵID€ä½ç½ïĵˆ‚ı‚ŻƒŞƒĵƒ³ïĵ‰‚’通矁—™€‚ + public static UnityAction OnTouchTap; + + // ƒ•ƒŞƒƒ‚Żé€šçŸ + // ƒ•ƒŞƒƒ‚Żċˆ¤ċš•‚ŒŸċ ´ċˆĞ€ƒ•‚£ƒ³‚ĴƒĵID€ä½ç½ïĵˆ‚ı‚ŻƒŞƒĵƒ³ïĵ‰€ƒ•ƒŞƒƒ‚Żé€ŸċşĤ(‚ı‚ŻƒŞƒĵƒ³ĉŻ”çŽ‡/s)€é€ŸċşĤ(cm/s)‚’通矁—™€‚ + public static UnityAction OnTouchFlick; + + // ƒ”ƒ³ƒ‚¤ƒ³ïĵ‚˘‚Ĥƒˆé€šçŸ + // ƒ”ƒ³ƒ‚¤ƒ³ïĵ‚˘‚Ĥƒˆé€ŸċşĤïĵˆ‚ı‚ŻƒŞƒĵƒ³ĉŻ”çŽ‡/sïĵ‰€é€ŸċşĤ(cm/s)‚’通矁—™€‚ + public static UnityAction OnTouchPinch; + + // ƒƒƒ‚Żƒœ‚żƒ³é€šçŸïĵˆAndroidde§Żĉˆğ‚‹ƒœ‚żƒ³€PC§Ż BackSpace ƒœ‚żƒ³ïĵ‰ + public static UnityAction OnBackButton; + + //========================================================================================= + /// + /// Reload Domain ċŻç­– + /// + [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] + private static void Init() + { + InitMember(); + } + + //========================================================================================= + protected override void InitSingleton() + { + SimpleInput.Init(); + + // ‚ı‚ŻƒŞƒĵƒ³ĉƒ…ċ ħ + CalcScreenDpi(); + + // ĉƒ…ċ ħċˆĉœŸċŒ– + downPos = new Vector2[MaxFinger]; + lastPos = new Vector2[MaxFinger]; + flickDownPos = new Vector2[MaxFinger]; + flickDownTime = new float[MaxFinger]; + + // ƒž‚Ĥ‚ı用 + mouseDown = new bool[3]; + mouseOldMovePos = new Vector2[3]; + + AllResetTouchInfo(); + + // ƒ˘ƒ‚¤ƒĞƒ—ƒİƒƒƒˆƒ•‚݃ĵƒ ċˆ¤ċš + mobilePlatform = Application.isMobilePlatform; + } + + protected void Update() + { + // ċ…ċŠ›‚ż‚¤ƒ—ċˆĉ›´ĉ–°ċ‡Ĥ理 + if (mobilePlatform) + { + // ƒ˘ƒ‚¤ƒĞ用‚żƒƒƒċ…ċŠ› + UpdateMobile(); + } + else + { + // ƒž‚Ĥ‚ı‚¨ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ + UpdateMouse(); + } + } + + //========================================================================================= + /// + /// ‚ı‚ŻƒŞƒĵƒ³DPIċ€¤(Dots per inchi)ïĵ‘‚¤ƒ³ƒċ½“Ÿ‚Ёƒ”‚Ż‚ğƒĞĉ•°‚’ċ–ċ—™‚‹ + /// + public static float ScreenDpi + { + get + { + return Instance.screenDpi; + } + } + + /// + /// ‚ı‚ŻƒŞƒĵƒ³DPCċ€¤(Dots per cm)ïĵ‘cmċ½“Ÿ‚Ёƒ”‚Ż‚ğƒĞĉ•°‚’ċ–ċ—™‚‹ + /// + public static float ScreenDpc + { + get + { + return Instance.screenDpc; + } + } + + /// + /// ‚ı‚ŻƒŞƒĵƒ³Dpi/Dpcċ†è¨ˆç— + /// + private void CalcScreenDpi() + { + screenDpi = Screen.dpi; + if (screenDpi == 0.0f) + { + screenDpi = 96; // ƒ€ƒŸƒĵ + } + screenDpc = screenDpi / 2.54f; // ‚¤ƒ³ƒ‚’cmĞċ¤‰ĉ› + } + + // ‚żƒƒƒċ…ċŠ›ĉƒ…ċ ħƒŞ‚ğƒƒƒˆ + private void AllResetTouchInfo() + { + mainFingerId = -1; + subFingerId = -1; + for (int i = 0; i < 3; i++) + { + mouseDown[i] = false; + } + } + + public int GetTouchCount() + { + return SimpleInput.touchCount; + } + + public bool IsUI() + { + if (EventSystem.current == null) + return false; + + if (mobilePlatform) + { + // ƒ˘ƒ‚¤ƒĞ用‚żƒƒƒċ…ċŠ› + return EventSystem.current.IsPointerOverGameObject(SimpleInput.GetTouch(0).fingerId); + } + else + { + // ƒž‚Ĥ‚ı‚¨ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ + return EventSystem.current.IsPointerOverGameObject(); + } + } + + //========================================================================================= + /// + /// ƒ˘ƒ‚¤ƒĞ用ċ…ċŠ›ĉ›´ĉ–° + /// + private void UpdateMobile() + { + int count = SimpleInput.touchCount; + + if (count == 0) + { + AllResetTouchInfo(); + + // ƒƒƒ‚Żƒœ‚żƒ³ + if (Application.platform == RuntimePlatform.Android) + { + if (SimpleInput.GetKey(KeyCode.Escape) && lastTime + 0.2f < Time.time) + { + lastTime = Time.time; + if (OnBackButton != null) + { + OnBackButton(); + } + return; + } + } + } + else + { + // ƒĦ‚¤ƒ³ + for (int i = 0; i < count; i++) + { + Touch touch = SimpleInput.GetTouch(i); + int fid = touch.fingerId; + + // ƒ•‚£ƒ³‚ĴƒĵIDŒïĵ¨ïĵ‘äğċ¤–Żç„ĦèĤ–™‚‹ + if (fid >= 2) + { + continue; + } + + if (touch.phase == TouchPhase.Began) + { + if (IsUI()) + continue; + // down pos + downPos[fid] = touch.position; + lastPos[fid] = touch.position; + flickDownPos[fid] = touch.position; + + if (fid == 0) + { + mainFingerId = fid; + } + else + { + subFingerId = fid; + } + + // DownŻƒĦ‚¤ƒ³ƒ•‚£ƒ³‚Ĵƒĵż + if (fid == 0) + { + flickDownTime[fid] = Time.time; + if (OnTouchDown != null) + { + OnTouchDown(fid, touch.position); + } + } + } + else if (touch.phase == TouchPhase.Moved) + { + // ƒ”ƒ³ƒ‚¤ƒ³ïĵ‚˘‚Ĥƒˆċˆ¤ċš + if (mainFingerId >= 0 && subFingerId >= 0) + { + Vector2 t1pos = Vector2.zero; + Vector2 t2pos = Vector2.zero; + Vector2 t1delta = Vector2.zero; + Vector2 t2delta = Vector2.zero; + + int setcnt = 0; + for (int j = 0; j < count; j++) + { + Touch t = SimpleInput.GetTouch(j); + if (mainFingerId == t.fingerId) + { + t1pos = t.position; + t1delta = t.deltaPosition; + setcnt++; + } + else if (subFingerId == t.fingerId) + { + t2pos = t.position; + t2delta = t.deltaPosition; + setcnt++; + } + } + + if (setcnt == 2) + { + float nowdist = Vector2.Distance(t1pos, t2pos); + float olddist = Vector2.Distance(t1pos - t1delta, t2pos - t2delta); + float dist = nowdist - olddist; + + // cm/sĞċ¤‰ĉ› + float distcm = dist / screenDpc; // ç§ğċ‹•量(cm) + float speedcm = distcm / Time.deltaTime; // 速ċşĤ(cm/s) + + // ‚ı‚ŻƒŞƒĵƒ³ĉŻ”çŽ‡é€ŸċşĤ + float speedscr = (dist / (Screen.width + Screen.height) * 0.5f) / Time.deltaTime; + + // ƒ”ƒ³ƒé€šçŸ(ç§ğċ‹•量(cm), 速ċşĤ(cm/s)) + if (OnTouchPinch != null) + { + OnTouchPinch(speedscr, speedcm); + } + } + + if (fid == 0) + { + Vector2 distVec2 = touch.position - lastPos[fid]; + Vector2 distcm = distVec2 / screenDpc; // ç§ğċ‹•量(cm) + Vector2 speedcm = distcm / Time.deltaTime; // 速ċşĤ(cm/s) + + // 速ċşĤ(‚ı‚ŻƒŞƒĵƒ³ĉŻ”çŽ‡) + Vector2 speedscr = CalcScreenRatioVector(distVec2) / Time.deltaTime; + + // ç§ğċ‹•通çŸ(çċœ¨‚ı‚ŻƒŞƒĵƒ³ċş§ĉ¨™€é€ŸċşĤ(‚ı‚ŻƒŞƒĵƒ³ĉŻ”çŽ‡), 速ċşĤ(cm/s)) + if (OnDoubleTouchMove != null) + { + OnDoubleTouchMove(fid, touch.position, speedscr, speedcm); + } + + lastPos[fid] = touch.position; + } + } + else + { + // MoveŻƒĦ‚¤ƒ³ƒ•‚£ƒ³‚Ĵƒĵż + if (fid == 0 && mainFingerId >= 0) + { + Vector2 distVec2 = touch.position - lastPos[fid]; + Vector2 distcm = distVec2 / screenDpc; // ç§ğċ‹•量(cm) + Vector2 speedcm = distcm / Time.deltaTime; // 速ċşĤ(cm/s) + + // 速ċşĤ(‚ı‚ŻƒŞƒĵƒ³ĉŻ”çŽ‡) + Vector2 speedscr = CalcScreenRatioVector(distVec2) / Time.deltaTime; + + // ç§ğċ‹•通çŸ(çċœ¨‚ı‚ŻƒŞƒĵƒ³ċş§ĉ¨™€é€ŸċşĤ(‚ı‚ŻƒŞƒĵƒ³ĉŻ”çŽ‡), 速ċşĤ(cm/s)) + if (OnTouchMove != null) + { + OnTouchMove(fid, touch.position, speedscr, speedcm); + } + + // ƒ•ƒŞƒƒ‚Żƒ€‚Ĥƒ³ä½ç½ĉ›´ĉ–° + flickDownPos[fid] = (flickDownPos[fid] + touch.position) * 0.5f; + flickDownTime[fid] = Time.time; + } + + lastPos[fid] = touch.position; + } + } + else if (touch.phase == TouchPhase.Ended) + { + // ƒ•‚£ƒ³‚ĴƒĵIDƒŞƒŞƒĵ‚ı + if (fid == 0) + { + mainFingerId = -1; + subFingerId = -1; + } + else + { + subFingerId = -1; + } + + // End, Tap ŻƒĦ‚¤ƒ³ƒ•‚£ƒ³‚Ĵƒĵż + if (fid == 0) + { + // ‚żƒƒƒ—ċˆ¤ċš + float dist = Vector2.Distance(downPos[fid], touch.position); + float distcm = dist / screenDpc; + + if (distcm <= tapRadiusCm) + { + // ‚żƒƒƒ—é€šçŸ + if (OnTouchTap != null) + { + OnTouchTap(fid, touch.position); + } + } + // ƒ•ƒŞƒƒ‚Żċˆ¤ċš + else + { + CheckFlic(fid, downPos[fid], touch.position, flickDownPos[fid], flickDownTime[fid]); + } + + // ‚żƒƒƒ—‚˘ƒƒƒ—é€šçŸ + if (OnTouchUp != null) + { + OnTouchUp(fid, touch.position); + } + } + } + else if (touch.phase == TouchPhase.Canceled) + { + // ƒ•‚£ƒ³‚ĴƒĵIDƒŞƒŞƒĵ‚ı + if (fid == 0) + { + mainFingerId = -1; + subFingerId = -1; + } + else + { + subFingerId = -1; + } + + // CancelŻƒĦ‚¤ƒ³ƒ•‚£ƒ³‚Ĵƒĵż + if (fid == 0) + { + if (OnTouchMoveCancel != null) + { + OnTouchMoveCancel(fid, touch.position); + } + } + } + } + } + } + + /// + /// ‚ı‚ŻƒŞƒĵƒ³ĉŻ”çŽ‡Ğċ¤‰ĉ›—Ÿƒ™‚ŻƒˆƒĞ‚’ĉħ‚‚‚‹ + /// + /// + /// + private Vector2 CalcScreenRatioVector(Vector2 vec) + { + return new Vector2(vec.x / Screen.width, vec.y / Screen.height); + } + + /// + /// ƒ•ƒŞƒƒ‚Żċˆ¤ċš + /// + /// + /// + /// + /// + /// + private bool CheckFlic(int fid, Vector2 oldpos, Vector2 nowpos, Vector2 downpos, float flicktime) + { + // ƒ•ƒŞƒƒ‚Żċˆ¤ċš + float dist = Vector2.Distance(nowpos, downpos); + float distcm = dist / screenDpc; + if (distcm > flickRangeCm) + { + { + // ç§ğċ‹•ƒ”‚Ż‚ğƒĞ‚’cmċ¤‰ĉ›—€é€ŸċşĤcm/s‚’ċ‰²‚Šċ‡ş™ + Vector2 distVec = (nowpos - downpos); + Vector2 distVec2 = distVec / screenDpc; // cm¸ċ¤‰ĉ›(ç§ğċ‹•量(cm)) + float timeInterval = Time.time - flicktime; + float speedX = distVec2.x / timeInterval; // 速ċşĤ(cm/s) + float speedY = distVec2.y / timeInterval; // 速ċşĤ(cm/s) + + //Develop.Log("distVec", distVec * 100); + //Develop.Log("sppedX:", speedX, " speedY:", speedY); + + if (Mathf.Abs(speedX) >= flickCheckSpeed || Mathf.Abs(speedY) >= flickCheckSpeed) + { + // ƒ•ƒŞƒƒ‚Żé€šçŸ(‚ı‚ŻƒŞƒĵƒ³ä½ç½,速ċşĤïĵˆ‚ı‚ŻƒŞƒĵƒ³ĉŻ”çŽ‡/sïĵ‰,速ċşĤ(cm/s)) + if (OnTouchFlick != null) + { + OnTouchFlick(fid, nowpos, CalcScreenRatioVector(distVec) / timeInterval, new Vector2(speedX, speedY)); + } + + return true; + } + } + } + + return false; + } + + //========================================================================================= + /// + /// ċ…ċŠ›ĉƒ…ċ ħĉ›´ĉ–°ïĵˆPC用ïĵ‰ + /// ƒž‚Ĥ‚ı‚¨ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ + /// ƒğċ³‚ŻƒŞƒƒ‚݁Żä½ż‚Ş„€‚ + /// ƒğƒ”ƒ³ƒ‚¤ƒ³ïĵ‚˘‚ĤƒˆŻƒž‚Ĥ‚ıƒ›‚¤ƒĵƒĞ€‚ + /// + private void UpdateMouse() + { + // BackSpace ‚’ Android çĞŻĉœĞƒƒƒ‚Żƒœ‚żƒ³Ğċ‰²‚Šċ½“Ĥ‚‹ + if (SimpleInput.GetKeyDown(KeyCode.Backspace)) + { + if (OnBackButton != null) + OnBackButton(); + return; + } + + for (int i = 0; i < 3; i++) + { + // ƒž‚Ĥ‚ıƒœ‚żƒ³ƒ€‚Ĥƒ³ + if (SimpleInput.GetMouseButtonDown(i)) + { + if (IsUI()) + continue; + + if (mouseDown[i] == false && i == 0) + { + flickDownTime[i] = Time.time; + } + mouseDown[i] = true; + + // ċ…ċŠ›ä½ç½‚’記録 + downPos[i] = SimpleInput.mousePosition; + mouseOldMovePos[i] = SimpleInput.mousePosition; + if (i == 0) + flickDownPos[i] = SimpleInput.mousePosition; + + // ‚żƒƒƒƒ€‚Ĥƒ³‚¤ƒ™ƒ³ƒˆç™şèĦŒ + if (OnTouchDown != null) + OnTouchDown(i, SimpleInput.mousePosition); + } + + // ƒž‚Ĥ‚ıƒœ‚żƒ³‚˘ƒƒƒ— + if (SimpleInput.GetMouseButtonUp(i) && mouseDown[i]) + { + mouseDown[i] = false; + + // ƒ•ƒŞƒƒ‚Żċˆ¤ċš + if (i == 0) + { + CheckFlic(i, mouseOldMovePos[i], SimpleInput.mousePosition, flickDownPos[i], flickDownTime[i]); + } + + mouseOldMovePos[i] = Vector2.zero; + + // ‚żƒƒƒ‚˘ƒƒƒ—‚¤ƒ™ƒ³ƒˆ + if (OnTouchUp != null) + OnTouchUp(i, SimpleInput.mousePosition); + + // ‚żƒƒƒ—ċˆ¤ċš + float distcm = Vector2.Distance(downPos[0], SimpleInput.mousePosition) / screenDpc; + if (distcm <= tapRadiusCm) + { + if (OnTouchTap != null) + OnTouchTap(i, SimpleInput.mousePosition); + } + } + + // ç§ğċ‹• + if (mouseDown[i]) + { + Vector2 spos = new Vector2(SimpleInput.mousePosition.x, SimpleInput.mousePosition.y); + Vector2 delta = spos - mouseOldMovePos[i]; + + if (spos != mouseOldMovePos[i]) + { + // 速ċşĤ + Vector3 deltacm = delta / screenDpc; // ç§ğċ‹•量(cm) + Vector2 speedcm = deltacm / Time.deltaTime; // 速ċşĤ(cm/s) + + // ç§ğċ‹•通çŸ(çċœ¨‚ı‚ŻƒŞƒĵƒ³ċş§ĉ¨™€é€ŸċşĤ(‚ı‚ŻƒŞƒĵƒ³ĉŻ”çŽ‡/s)€é€ŸċşĤ(cm/s)) + if (OnTouchMove != null) + OnTouchMove(i, SimpleInput.mousePosition, CalcScreenRatioVector(delta) / Time.deltaTime, speedcm); + } + + mouseOldMovePos[i] = SimpleInput.mousePosition; + + // ƒ•ƒŞƒƒ‚Żƒ€‚Ĥƒ³ä½ç½ĉ›´ĉ–° + flickDownPos[i] = (flickDownPos[i] + spos) * 0.5f; + flickDownTime[i] = Time.time; + } + + } + + // ƒ”ƒ³ƒ‚¤ƒ³ïĵ‚˘‚Ĥƒˆ + float w = SimpleInput.GetMouseScrollWheel(); + if (Mathf.Abs(w) > 0.01f) + { + // ƒ˘ƒ‚¤ƒĞċ…ċŠ›¨‚ı‚ħƒĵƒĞĉ„Ÿ‚’ċˆ‚›‚‹Ÿ‚Ğ係ĉ•°‚’ĉŽ›‘‚‹ + w *= mouseWheelSpeed; + + float speedcm = w / Time.deltaTime; + float speedscr = (w / (Screen.width + Screen.height) * 0.5f) / Time.deltaTime; + + // 通çŸïĵˆé€ŸċşĤ(‚ı‚ŻƒŞƒĵƒ³ĉŻ”çŽ‡/s)€é€ŸċşĤ(cm/s) + if (OnTouchPinch != null) + OnTouchPinch(speedscr, speedcm); + } + } + } +} diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/SimpleInputManager.cs.meta b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/SimpleInputManager.cs.meta new file mode 100644 index 00000000..1384c74f --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/SimpleInputManager.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 08208c43232950a4f8b6eae1f7919c13 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/SimpleInputManager.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/SliderText.cs b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/SliderText.cs new file mode 100644 index 00000000..a1d9026c --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/SliderText.cs @@ -0,0 +1,46 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using UnityEngine; +using UnityEngine.UI; + +namespace MagicaCloth2 +{ + public class SliderText : MonoBehaviour + { + [SerializeField] + private Text text = null; + + [SerializeField] + private string lable = ""; + + [SerializeField] + private string format = "0.00"; + + private string formatString; + + protected void Start() + { + formatString = "{0} ({1:" + format + "})"; + + var slider = GetComponent(); + if (slider) + { + slider.onValueChanged.AddListener(OnChangeValue); + + var val = slider.value; + slider.value = 0.001f; + slider.value = val; + } + + } + + private void OnChangeValue(float value) + { + if (text) + { + text.text = string.Format(formatString, lable, value); + } + } + } +} diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/SliderText.cs.meta b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/SliderText.cs.meta new file mode 100644 index 00000000..f42f1549 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/SliderText.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 37e7fecf2cf6fff42800da6e57c20d5d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/SliderText.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/TargetFPS.cs b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/TargetFPS.cs new file mode 100644 index 00000000..adac9cf1 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/TargetFPS.cs @@ -0,0 +1,19 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using UnityEngine; + +namespace MagicaCloth2 +{ + public class TargetFPS : MonoBehaviour + { + public int frameRate = 60; + +#if !UNITY_EDITOR + protected void Start() + { + Application.targetFrameRate = frameRate; + } +#endif + } +} diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/TargetFPS.cs.meta b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/TargetFPS.cs.meta new file mode 100644 index 00000000..abc92766 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/TargetFPS.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 70abefeafa131dd428880b40bd4c183c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/TargetFPS.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/WindDemo.cs b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/WindDemo.cs new file mode 100644 index 00000000..f422c383 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/WindDemo.cs @@ -0,0 +1,94 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System.Collections.Generic; +using UnityEngine; + +namespace MagicaCloth2 +{ + public class WindDemo : MonoBehaviour + { + [SerializeField] + private MagicaWindZone magicaWindZone; + [SerializeField] + private WindZone unityWindZone; + [SerializeField] + private Renderer arrowRenderer = null; + [SerializeField] + private Gradient arrowGradient = new Gradient(); + [SerializeField] + private List rotationTransforms = new List(); + + private float angleY = 0.0f; + private float angleX = 0.0f; + private float main = 0.0f; + private float turbulence = 0.0f; + + public void OnDirectionY(float value) + { + angleY = value; + UpdateDirection(); + } + + public void OnDirectionX(float value) + { + angleX = value; + UpdateDirection(); + } + + public void OnMain(float value) + { + main = value; + UpdateMagicaWindZone(); + UpdateUnityWindZone(); + UpdateArrowColor(); + } + + public void OnTurbulence(float value) + { + turbulence = value; + UpdateMagicaWindZone(); + } + + //========================================================================================= + void UpdateArrowColor() + { + if (arrowRenderer) + { + // color + var t = Mathf.Clamp01(Mathf.InverseLerp(0.0f, 20.0f, main)); + var col = arrowGradient.Evaluate(t); + arrowRenderer.material.color = col * 0.7f; + } + } + + void UpdateDirection() + { + var lrot = Quaternion.Euler(angleX, angleY, 0.0f); + foreach (var t in rotationTransforms) + if (t) + t.localRotation = lrot; + + UpdateMagicaWindZone(); + } + + void UpdateMagicaWindZone() + { + if (magicaWindZone) + { + magicaWindZone.main = main; + magicaWindZone.turbulence = turbulence; + magicaWindZone.directionAngleX = angleX; + magicaWindZone.directionAngleY = angleY; + } + } + + void UpdateUnityWindZone() + { + if (unityWindZone) + { + unityWindZone.windMain = main; + } + } + } +} diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/WindDemo.cs.meta b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/WindDemo.cs.meta new file mode 100644 index 00000000..7492ff5f --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/WindDemo.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 13f11cb1bd01c684b9a48fd075e6a541 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/Common/Scripts/WindDemo.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Shaders.meta b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Shaders.meta new file mode 100644 index 00000000..e5eda76c --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Shaders.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 399b9b712612aee4895e5d0c4dd98d3d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Shaders/MC2_Common_Lit_Back.shadergraph b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Shaders/MC2_Common_Lit_Back.shadergraph new file mode 100644 index 00000000..ca01279f --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Shaders/MC2_Common_Lit_Back.shadergraph @@ -0,0 +1,2336 @@ +{ + "m_SGVersion": 3, + "m_Type": "UnityEditor.ShaderGraph.GraphData", + "m_ObjectId": "f41d4d9b57ae4b59b26678b1f6073750", + "m_Properties": [ + { + "m_Id": "4ff00e04725b4223818808fa53a54254" + }, + { + "m_Id": "ddfd2e0ff3934cee81c59223a6aff2c9" + }, + { + "m_Id": "4e56b0554c1541eebaad6914417685a2" + }, + { + "m_Id": "f82b9f46e40e431fae1d5ec7c3707e42" + } + ], + "m_Keywords": [], + "m_Dropdowns": [], + "m_CategoryData": [ + { + "m_Id": "4b4d7767a3c04b13992378fe6f0758c1" + } + ], + "m_Nodes": [ + { + "m_Id": "10be29e472174f9bac547bf66ae09a6e" + }, + { + "m_Id": "d8cd689a35ac40ccb7fc9fa38bfedb1b" + }, + { + "m_Id": "a3f302f80ed844ffbf44b99dd893415e" + }, + { + "m_Id": "dcc961838b80405199d4e7d4c1f4fd7d" + }, + { + "m_Id": "547c3a6093244b539b47f013a879b43a" + }, + { + "m_Id": "7d896f4d35f540dfb9dacc35ddec6afa" + }, + { + "m_Id": "b3a7b8c6105d4a9d99f2c0e475229395" + }, + { + "m_Id": "7f1e5a6638cc46108a2ef6f3335f7db6" + }, + { + "m_Id": "3e52a198523e4e8089a6a40a3969a3b7" + }, + { + "m_Id": "85cc4ac9d59d4ff9a65f96c816207a3f" + }, + { + "m_Id": "f538dbc91a2f4d8d8f4b21556d67960b" + }, + { + "m_Id": "f8ebcdc66077436288a397d204bbd8cd" + }, + { + "m_Id": "f5609f11baf94d889ab3f8bf42aa2131" + }, + { + "m_Id": "85fc068f71f9403e9b327a6076c0726d" + }, + { + "m_Id": "b75bfd40495a47c687573a825b006ec3" + }, + { + "m_Id": "baceccda18a146aabc489ed8fe66e00e" + }, + { + "m_Id": "dad6f28cdb54429b9ec2c4474304b92c" + }, + { + "m_Id": "c3fae475af5f494782e2283aab0b42e4" + }, + { + "m_Id": "36e45cd12e3a4bb39df36dfdba2d165f" + }, + { + "m_Id": "b91e9b998964417096174d43beedd509" + }, + { + "m_Id": "85e4660eb18e4763bd4a2c7fca16df72" + }, + { + "m_Id": "1b135e3a26af4cffae7fb6fc68befcfc" + }, + { + "m_Id": "ad74695cfc12453188fbb4d17b6c96c2" + } + ], + "m_GroupDatas": [], + "m_StickyNoteDatas": [], + "m_Edges": [ + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "36e45cd12e3a4bb39df36dfdba2d165f" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "ad74695cfc12453188fbb4d17b6c96c2" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "85cc4ac9d59d4ff9a65f96c816207a3f" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "f5609f11baf94d889ab3f8bf42aa2131" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "85e4660eb18e4763bd4a2c7fca16df72" + }, + "m_SlotId": 3 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "dad6f28cdb54429b9ec2c4474304b92c" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "85fc068f71f9403e9b327a6076c0726d" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "b3a7b8c6105d4a9d99f2c0e475229395" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "ad74695cfc12453188fbb4d17b6c96c2" + }, + "m_SlotId": 1 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "d8cd689a35ac40ccb7fc9fa38bfedb1b" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "b75bfd40495a47c687573a825b006ec3" + }, + "m_SlotId": 3 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "f8ebcdc66077436288a397d204bbd8cd" + }, + "m_SlotId": 2 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "b91e9b998964417096174d43beedd509" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "85e4660eb18e4763bd4a2c7fca16df72" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "baceccda18a146aabc489ed8fe66e00e" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "b75bfd40495a47c687573a825b006ec3" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "f538dbc91a2f4d8d8f4b21556d67960b" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "f8ebcdc66077436288a397d204bbd8cd" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "f5609f11baf94d889ab3f8bf42aa2131" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "dcc961838b80405199d4e7d4c1f4fd7d" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "f8ebcdc66077436288a397d204bbd8cd" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "f5609f11baf94d889ab3f8bf42aa2131" + }, + "m_SlotId": 1 + } + } + ], + "m_VertexContext": { + "m_Position": { + "x": 0.0, + "y": 0.0 + }, + "m_Blocks": [ + { + "m_Id": "10be29e472174f9bac547bf66ae09a6e" + }, + { + "m_Id": "d8cd689a35ac40ccb7fc9fa38bfedb1b" + }, + { + "m_Id": "a3f302f80ed844ffbf44b99dd893415e" + } + ] + }, + "m_FragmentContext": { + "m_Position": { + "x": 0.0, + "y": 200.0 + }, + "m_Blocks": [ + { + "m_Id": "dcc961838b80405199d4e7d4c1f4fd7d" + }, + { + "m_Id": "547c3a6093244b539b47f013a879b43a" + }, + { + "m_Id": "7d896f4d35f540dfb9dacc35ddec6afa" + }, + { + "m_Id": "b3a7b8c6105d4a9d99f2c0e475229395" + }, + { + "m_Id": "7f1e5a6638cc46108a2ef6f3335f7db6" + }, + { + "m_Id": "3e52a198523e4e8089a6a40a3969a3b7" + }, + { + "m_Id": "dad6f28cdb54429b9ec2c4474304b92c" + }, + { + "m_Id": "c3fae475af5f494782e2283aab0b42e4" + }, + { + "m_Id": "1b135e3a26af4cffae7fb6fc68befcfc" + } + ] + }, + "m_PreviewData": { + "serializedMesh": { + "m_SerializedMesh": "{\"mesh\":{\"instanceID\":0}}", + "m_Guid": "" + }, + "preventRotation": false + }, + "m_Path": "Shader Graphs", + "m_GraphPrecision": 1, + "m_PreviewMode": 2, + "m_OutputNode": { + "m_Id": "" + }, + "m_ActiveTargets": [ + { + "m_Id": "1cefe9920a694056a32d6044c91eb117" + }, + { + "m_Id": "889230749e8b4e5b8ff8388a75e3e6f4" + }, + { + "m_Id": "70351697015745fca15077ddec8afc89" + } + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BooleanMaterialSlot", + "m_ObjectId": "0067ec270e2b4a6c8186ff77a4d24e90", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 2, + "m_Value": true, + "m_DefaultValue": true +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.BuiltinData", + "m_ObjectId": "036dd76274464631a7d3a06d6e8483e7", + "m_Distortion": false, + "m_DistortionMode": 0, + "m_DistortionDepthTest": true, + "m_AddPrecomputedVelocity": false, + "m_TransparentWritesMotionVec": false, + "m_AlphaToMask": false, + "m_DepthOffset": false, + "m_ConservativeDepthOffset": false, + "m_TransparencyFog": true, + "m_AlphaTestShadow": false, + "m_BackThenFrontRendering": false, + "m_TransparentDepthPrepass": false, + "m_TransparentDepthPostpass": false, + "m_SupportLodCrossFade": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "0a2d6e54a269462995058e94217b6f82", + "m_Id": 0, + "m_DisplayName": "In", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "In", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "0b1293431328425da5ca8c5b3b333166", + "m_Id": 3, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Texture2DMaterialSlot", + "m_ObjectId": "0e30156cfe4e4283a0dde082768d533e", + "m_Id": 0, + "m_DisplayName": "Main", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_BareResource": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "10be29e472174f9bac547bf66ae09a6e", + "m_Group": { + "m_Id": "" + }, + "m_Name": "VertexDescription.Position", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "79a8c2197a1843f58e31684f0ac49dcb" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Position" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "1b135e3a26af4cffae7fb6fc68befcfc", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.AlphaClipThreshold", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "ab9406cddef148cba7c487de1453ce4d" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.AlphaClipThreshold" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "1c6b14984c74490d9e22845b989d3c38", + "m_Id": 7, + "m_DisplayName": "A", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "1cb440ca7c114bc7bbf5c85750d2a3b1", + "m_Id": 2, + "m_DisplayName": "Offset", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Offset", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 2, + "m_Type": "UnityEditor.Rendering.BuiltIn.ShaderGraph.BuiltInTarget", + "m_ObjectId": "1cefe9920a694056a32d6044c91eb117", + "m_ActiveSubTarget": { + "m_Id": "be4795b19cdd4426bcdabf79f1c24b0a" + }, + "m_AllowMaterialOverride": false, + "m_SurfaceType": 0, + "m_ZWriteControl": 0, + "m_ZTestMode": 4, + "m_AlphaMode": 0, + "m_RenderFace": 0, + "m_AlphaClip": true, + "m_CustomEditorGUI": "" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector3MaterialSlot", + "m_ObjectId": "26c1f3e8ea1d4795b62c3dfe9fd0f48d", + "m_Id": 0, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 1.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "27a353a5cc96432fa692fdda747d8c67", + "m_Id": 5, + "m_DisplayName": "G", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "G", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot", + "m_ObjectId": "30615abfe8e94f039230bb345e2dc291", + "m_Id": 0, + "m_DisplayName": "Emission", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Emission", + "m_StageCapability": 2, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [], + "m_ColorMode": 1, + "m_DefaultColor": { + "r": 0.0, + "g": 0.0, + "b": 0.0, + "a": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.NormalVectorNode", + "m_ObjectId": "36e45cd12e3a4bb39df36dfdba2d165f", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Normal Vector", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -930.3999633789063, + "y": -163.20001220703126, + "width": 206.4000244140625, + "height": 128.80001831054688 + } + }, + "m_Slots": [ + { + "m_Id": "26c1f3e8ea1d4795b62c3dfe9fd0f48d" + } + ], + "synonyms": [ + "surface direction" + ], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_PreviewMode": 2, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Space": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.SystemData", + "m_ObjectId": "37519b892be8480ab341c1c4f7f12ff1", + "m_MaterialNeedsUpdateHash": 529, + "m_SurfaceType": 0, + "m_RenderingPass": 1, + "m_BlendMode": 0, + "m_ZTest": 4, + "m_ZWrite": false, + "m_TransparentCullMode": 2, + "m_OpaqueCullMode": 2, + "m_SortPriority": 0, + "m_AlphaTest": false, + "m_TransparentDepthPrepass": false, + "m_TransparentDepthPostpass": false, + "m_SupportLodCrossFade": false, + "m_DoubleSidedMode": 0, + "m_DOTSInstancing": false, + "m_CustomVelocity": false, + "m_Tessellation": false, + "m_TessellationMode": 0, + "m_TessellationFactorMinDistance": 20.0, + "m_TessellationFactorMaxDistance": 50.0, + "m_TessellationFactorTriangleSize": 100.0, + "m_TessellationShapeFactor": 0.75, + "m_TessellationBackFaceCullEpsilon": -0.25, + "m_TessellationMaxDisplacement": 0.009999999776482582, + "m_Version": 1, + "inspectorFoldoutMask": 1 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "3e52a198523e4e8089a6a40a3969a3b7", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.Occlusion", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "d62d1c4bb772482a93392ab836e9a3d9" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.Occlusion" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.TangentMaterialSlot", + "m_ObjectId": "3f29e230e3d24419aee114c671d1e1a2", + "m_Id": 0, + "m_DisplayName": "Tangent", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Tangent", + "m_StageCapability": 1, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [], + "m_Space": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.CategoryData", + "m_ObjectId": "4b4d7767a3c04b13992378fe6f0758c1", + "m_Name": "", + "m_ChildObjectList": [ + { + "m_Id": "4ff00e04725b4223818808fa53a54254" + }, + { + "m_Id": "ddfd2e0ff3934cee81c59223a6aff2c9" + }, + { + "m_Id": "4e56b0554c1541eebaad6914417685a2" + }, + { + "m_Id": "f82b9f46e40e431fae1d5ec7c3707e42" + } + ] +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "4e56b0554c1541eebaad6914417685a2", + "m_Guid": { + "m_GuidSerialized": "291c9d7d-b925-4410-9719-cbd950781678" + }, + "m_Name": "Smoothness", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "Smoothness", + "m_DefaultReferenceName": "_Smoothness", + "m_OverrideReferenceName": "", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": 0.0, + "m_FloatType": 1, + "m_RangeValues": { + "x": 0.0, + "y": 1.0 + } +} + +{ + "m_SGVersion": 3, + "m_Type": "UnityEditor.ShaderGraph.Internal.ColorShaderProperty", + "m_ObjectId": "4ff00e04725b4223818808fa53a54254", + "m_Guid": { + "m_GuidSerialized": "2b85b46b-4c2e-4207-b64c-9ea0d9e7fe37" + }, + "m_Name": "Color", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "Color", + "m_DefaultReferenceName": "_Color", + "m_OverrideReferenceName": "", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": { + "r": 1.0, + "g": 1.0, + "b": 1.0, + "a": 1.0 + }, + "isMainColor": false, + "m_ColorMode": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.UVMaterialSlot", + "m_ObjectId": "502dd87805614bd6bb2cd5674cb78d13", + "m_Id": 0, + "m_DisplayName": "UV", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "UV", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [], + "m_Channel": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "537ac3a52c2746868e48f15018591a5c", + "m_Id": 0, + "m_DisplayName": "A", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 3, + "m_Value": { + "e00": 0.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 0.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 0.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 0.0 + }, + "m_DefaultValue": { + "e00": 1.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 1.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 1.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "5431740a337c4f00863d1124e4bcd0be", + "m_Id": 0, + "m_DisplayName": "Smoothness", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "547c3a6093244b539b47f013a879b43a", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.NormalTS", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "89193339fb5f4aa8ae1e5d4a9385e8ac" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.NormalTS" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot", + "m_ObjectId": "58f71dd6e7b94c619ccf281e00723d3d", + "m_Id": 0, + "m_DisplayName": "Normal", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Normal", + "m_StageCapability": 1, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [], + "m_Space": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "59f499593ce549cdbfb6c359ff36b6cc", + "m_Id": 0, + "m_DisplayName": "Smoothness", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Smoothness", + "m_StageCapability": 2, + "m_Value": 0.5, + "m_DefaultValue": 0.5, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot", + "m_ObjectId": "5e169845faf04ef1a19dade797cadeed", + "m_Id": 0, + "m_DisplayName": "Base Color", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "BaseColor", + "m_StageCapability": 2, + "m_Value": { + "x": 0.5, + "y": 0.5, + "z": 0.5 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [], + "m_ColorMode": 0, + "m_DefaultColor": { + "r": 0.5, + "g": 0.5, + "b": 0.5, + "a": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "649101757f0d46e8b214f02fa64ad916", + "m_Id": 0, + "m_DisplayName": "Tiling", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "6d50080048054afba4d078d72081b0a2", + "m_Id": 3, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "6ea111b9abf147c6a3795f2eae8d8496", + "m_Id": 1, + "m_DisplayName": "True", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "True", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 1.0, + "z": 1.0, + "w": 1.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalTarget", + "m_ObjectId": "70351697015745fca15077ddec8afc89", + "m_ActiveSubTarget": { + "m_Id": "f89b1f7ace834b6ab17c8f38c907dca5" + }, + "m_AllowMaterialOverride": false, + "m_SurfaceType": 0, + "m_ZTestMode": 4, + "m_ZWriteControl": 0, + "m_AlphaMode": 0, + "m_RenderFace": 0, + "m_AlphaClip": true, + "m_CastShadows": true, + "m_ReceiveShadows": true, + "m_CustomEditorGUI": "", + "m_SupportVFX": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PositionMaterialSlot", + "m_ObjectId": "79a8c2197a1843f58e31684f0ac49dcb", + "m_Id": 0, + "m_DisplayName": "Position", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Position", + "m_StageCapability": 1, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [], + "m_Space": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "7d896f4d35f540dfb9dacc35ddec6afa", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.Metallic", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "e34c98ea8e534dd09964fc90ab08bd91" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.Metallic" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "7f1e5a6638cc46108a2ef6f3335f7db6", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.Emission", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "30615abfe8e94f039230bb345e2dc291" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.Emission" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "83b8eb9a889d43a684ef184301fd6e9e", + "m_Id": 4, + "m_DisplayName": "R", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "R", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "85cc4ac9d59d4ff9a65f96c816207a3f", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Property", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -956.7999877929688, + "y": 140.80003356933595, + "width": 105.5999755859375, + "height": 33.59999084472656 + } + }, + "m_Slots": [ + { + "m_Id": "99e14767e4d44dbbb5e5e436f5b1e92f" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "4ff00e04725b4223818808fa53a54254" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BranchNode", + "m_ObjectId": "85e4660eb18e4763bd4a2c7fca16df72", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Branch", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -543.2000732421875, + "y": 572.800048828125, + "width": 169.60000610351563, + "height": 141.60003662109376 + } + }, + "m_Slots": [ + { + "m_Id": "c7e2c7aeb45840969d6d7a1b48f1079c" + }, + { + "m_Id": "6ea111b9abf147c6a3795f2eae8d8496" + }, + { + "m_Id": "e23d1fcbba0748deae4abff33d8460b2" + }, + { + "m_Id": "0b1293431328425da5ca8c5b3b333166" + } + ], + "synonyms": [ + "switch", + "if", + "else" + ], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "85fc068f71f9403e9b327a6076c0726d", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Property", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -391.20001220703127, + "y": 360.8000183105469, + "width": 139.99996948242188, + "height": 33.5999755859375 + } + }, + "m_Slots": [ + { + "m_Id": "5431740a337c4f00863d1124e4bcd0be" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "4e56b0554c1541eebaad6914417685a2" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.HDLitData", + "m_ObjectId": "87b9ee4fa41847a0864cbf738d5e88a4", + "m_RayTracing": false, + "m_MaterialType": 0, + "m_RefractionModel": 0, + "m_SSSTransmission": true, + "m_EnergyConservingSpecular": true, + "m_ClearCoat": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.HDTarget", + "m_ObjectId": "889230749e8b4e5b8ff8388a75e3e6f4", + "m_ActiveSubTarget": { + "m_Id": "adea60d545ad41fbb866b87a2d93d5b6" + }, + "m_Datas": [ + { + "m_Id": "87b9ee4fa41847a0864cbf738d5e88a4" + }, + { + "m_Id": "036dd76274464631a7d3a06d6e8483e7" + }, + { + "m_Id": "9c745f132bd54832a7b95cb8dbe12071" + }, + { + "m_Id": "37519b892be8480ab341c1c4f7f12ff1" + } + ], + "m_CustomEditorGUI": "", + "m_SupportVFX": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.SamplerStateMaterialSlot", + "m_ObjectId": "88b967de53c84f6499f2cca8003c4851", + "m_Id": 3, + "m_DisplayName": "Sampler", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Sampler", + "m_StageCapability": 3, + "m_BareResource": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot", + "m_ObjectId": "89193339fb5f4aa8ae1e5d4a9385e8ac", + "m_Id": 0, + "m_DisplayName": "Normal (Tangent Space)", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "NormalTS", + "m_StageCapability": 2, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [], + "m_Space": 3 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "8f07f80a79804412a5c2bb689ad58241", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": { + "e00": 2.0, + "e01": 2.0, + "e02": 2.0, + "e03": 2.0, + "e10": 2.0, + "e11": 2.0, + "e12": 2.0, + "e13": 2.0, + "e20": 2.0, + "e21": 2.0, + "e22": 2.0, + "e23": 2.0, + "e30": 2.0, + "e31": 2.0, + "e32": 2.0, + "e33": 2.0 + }, + "m_DefaultValue": { + "e00": 1.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 1.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 1.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "91a7d6a49b9e4cc4bd27f91c53781422", + "m_Id": 0, + "m_DisplayName": "Alpha", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Alpha", + "m_StageCapability": 2, + "m_Value": 1.0, + "m_DefaultValue": 1.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "99e14767e4d44dbbb5e5e436f5b1e92f", + "m_Id": 0, + "m_DisplayName": "Color", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.LightingData", + "m_ObjectId": "9c745f132bd54832a7b95cb8dbe12071", + "m_NormalDropOffSpace": 0, + "m_BlendPreserveSpecular": true, + "m_ReceiveDecals": true, + "m_ReceiveSSR": true, + "m_ReceiveSSRTransparent": false, + "m_SpecularAA": false, + "m_SpecularOcclusionMode": 1, + "m_OverrideBakedGI": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "9f6f0b738f2946c395d7094746087ee8", + "m_Id": 2, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "e00": 0.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 0.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 0.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 0.0 + }, + "m_DefaultValue": { + "e00": 1.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 1.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 1.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "a3f302f80ed844ffbf44b99dd893415e", + "m_Group": { + "m_Id": "" + }, + "m_Name": "VertexDescription.Tangent", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "3f29e230e3d24419aee114c671d1e1a2" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Tangent" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "a49108ec71074f20a0cf02b277733b3d", + "m_Id": 6, + "m_DisplayName": "B", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "ab9406cddef148cba7c487de1453ce4d", + "m_Id": 0, + "m_DisplayName": "Alpha Clip Threshold", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "AlphaClipThreshold", + "m_StageCapability": 2, + "m_Value": 0.5, + "m_DefaultValue": 0.5, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.FlipNode", + "m_ObjectId": "ad74695cfc12453188fbb4d17b6c96c2", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Flip", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -581.6859130859375, + "y": -123.50872039794922, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "0a2d6e54a269462995058e94217b6f82" + }, + { + "m_Id": "fc09e91bae1849668bd70c5e6114e1d4" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_RedChannel": true, + "m_GreenChannel": true, + "m_BlueChannel": true, + "m_AlphaChannel": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.HDLitSubTarget", + "m_ObjectId": "adea60d545ad41fbb866b87a2d93d5b6" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Texture2DInputMaterialSlot", + "m_ObjectId": "ae49a700327146e198ebe3d7cff9f16e", + "m_Id": 1, + "m_DisplayName": "Texture", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Texture", + "m_StageCapability": 3, + "m_BareResource": false, + "m_Texture": { + "m_SerializedTexture": "{\"texture\":{\"instanceID\":0}}", + "m_Guid": "" + }, + "m_DefaultType": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalLitSubTarget", + "m_ObjectId": "af49c364ed4a41e0ba8119d8d4b81eb7", + "m_WorkflowMode": 1, + "m_NormalDropOffSpace": 0, + "m_ClearCoat": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "b013472d231248eb9e4a9ee2821e973a", + "m_Id": 0, + "m_DisplayName": "RGBA", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "RGBA", + "m_StageCapability": 2, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "b3a7b8c6105d4a9d99f2c0e475229395", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.Smoothness", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "59f499593ce549cdbfb6c359ff36b6cc" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.Smoothness" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.TilingAndOffsetNode", + "m_ObjectId": "b75bfd40495a47c687573a825b006ec3", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Tiling And Offset", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1207.2000732421875, + "y": 247.20001220703126, + "width": 208.0, + "height": 325.60003662109377 + } + }, + "m_Slots": [ + { + "m_Id": "502dd87805614bd6bb2cd5674cb78d13" + }, + { + "m_Id": "bc751ddf1dc145dbbd262d1daa1dac42" + }, + { + "m_Id": "1cb440ca7c114bc7bbf5c85750d2a3b1" + }, + { + "m_Id": "6d50080048054afba4d078d72081b0a2" + } + ], + "synonyms": [ + "pan", + "scale" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.IsFrontFaceNode", + "m_ObjectId": "b91e9b998964417096174d43beedd509", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Is Front Face", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -784.8001098632813, + "y": 572.800048828125, + "width": 121.60003662109375, + "height": 76.800048828125 + } + }, + "m_Slots": [ + { + "m_Id": "0067ec270e2b4a6c8186ff77a4d24e90" + } + ], + "synonyms": [ + "face", + "side" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "baceccda18a146aabc489ed8fe66e00e", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Property", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1479.2000732421875, + "y": 317.6000061035156, + "width": 104.800048828125, + "height": 33.600006103515628 + } + }, + "m_Slots": [ + { + "m_Id": "649101757f0d46e8b214f02fa64ad916" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "f82b9f46e40e431fae1d5ec7c3707e42" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "bc751ddf1dc145dbbd262d1daa1dac42", + "m_Id": 1, + "m_DisplayName": "Tiling", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Tiling", + "m_StageCapability": 3, + "m_Value": { + "x": 1.0, + "y": 1.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.Rendering.BuiltIn.ShaderGraph.BuiltInLitSubTarget", + "m_ObjectId": "be4795b19cdd4426bcdabf79f1c24b0a", + "m_WorkflowMode": 1, + "m_NormalDropOffSpace": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "c3fae475af5f494782e2283aab0b42e4", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.BentNormal", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "f522747d6ff14b7d88ec8c4f780408c9" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.BentNormal" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BooleanMaterialSlot", + "m_ObjectId": "c7e2c7aeb45840969d6d7a1b48f1079c", + "m_Id": 0, + "m_DisplayName": "Predicate", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Predicate", + "m_StageCapability": 3, + "m_Value": false, + "m_DefaultValue": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.UVMaterialSlot", + "m_ObjectId": "c84e98391374467b949f3a300d8addbc", + "m_Id": 2, + "m_DisplayName": "UV", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "UV", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [], + "m_Channel": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "d62d1c4bb772482a93392ab836e9a3d9", + "m_Id": 0, + "m_DisplayName": "Ambient Occlusion", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Occlusion", + "m_StageCapability": 2, + "m_Value": 1.0, + "m_DefaultValue": 1.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "d8cd689a35ac40ccb7fc9fa38bfedb1b", + "m_Group": { + "m_Id": "" + }, + "m_Name": "VertexDescription.Normal", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "58f71dd6e7b94c619ccf281e00723d3d" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Normal" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "dad6f28cdb54429b9ec2c4474304b92c", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.Alpha", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "91a7d6a49b9e4cc4bd27f91c53781422" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.Alpha" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "dcc961838b80405199d4e7d4c1f4fd7d", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.BaseColor", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "5e169845faf04ef1a19dade797cadeed" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.BaseColor" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Internal.Texture2DShaderProperty", + "m_ObjectId": "ddfd2e0ff3934cee81c59223a6aff2c9", + "m_Guid": { + "m_GuidSerialized": "102ebb54-4113-4289-b8e8-e63ef7917ce0" + }, + "m_Name": "Main", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "Main", + "m_DefaultReferenceName": "_Main", + "m_OverrideReferenceName": "", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": { + "m_SerializedTexture": "{\"texture\":{\"instanceID\":0}}", + "m_Guid": "" + }, + "isMainTexture": false, + "useTilingAndOffset": false, + "m_Modifiable": true, + "m_DefaultType": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "e23d1fcbba0748deae4abff33d8460b2", + "m_Id": 2, + "m_DisplayName": "False", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "False", + "m_StageCapability": 3, + "m_Value": { + "x": 1.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "e34c98ea8e534dd09964fc90ab08bd91", + "m_Id": 0, + "m_DisplayName": "Metallic", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Metallic", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot", + "m_ObjectId": "f522747d6ff14b7d88ec8c4f780408c9", + "m_Id": 0, + "m_DisplayName": "Bent Normal", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "BentNormal", + "m_StageCapability": 2, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [], + "m_Space": 3 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "f538dbc91a2f4d8d8f4b21556d67960b", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Property", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -970.3999633789063, + "y": 225.60003662109376, + "width": 109.5999755859375, + "height": 33.600006103515628 + } + }, + "m_Slots": [ + { + "m_Id": "0e30156cfe4e4283a0dde082768d533e" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "ddfd2e0ff3934cee81c59223a6aff2c9" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.MultiplyNode", + "m_ObjectId": "f5609f11baf94d889ab3f8bf42aa2131", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Multiply", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -543.2000122070313, + "y": 200.0, + "width": 130.40005493164063, + "height": 117.60000610351563 + } + }, + "m_Slots": [ + { + "m_Id": "537ac3a52c2746868e48f15018591a5c" + }, + { + "m_Id": "8f07f80a79804412a5c2bb689ad58241" + }, + { + "m_Id": "9f6f0b738f2946c395d7094746087ee8" + } + ], + "synonyms": [ + "multiplication", + "times", + "x" + ], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector2ShaderProperty", + "m_ObjectId": "f82b9f46e40e431fae1d5ec7c3707e42", + "m_Guid": { + "m_GuidSerialized": "263a3129-1f2d-4f0f-bdf1-7ec3b3b8f8d7" + }, + "m_Name": "Tiling", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "Tiling", + "m_DefaultReferenceName": "_Tiling", + "m_OverrideReferenceName": "", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": { + "x": 1.0, + "y": 1.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalLitSubTarget", + "m_ObjectId": "f89b1f7ace834b6ab17c8f38c907dca5", + "m_WorkflowMode": 1, + "m_NormalDropOffSpace": 0, + "m_ClearCoat": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.SampleTexture2DNode", + "m_ObjectId": "f8ebcdc66077436288a397d204bbd8cd", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Sample Texture 2D", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -823.2000122070313, + "y": 226.4000244140625, + "width": 183.20001220703126, + "height": 247.99996948242188 + } + }, + "m_Slots": [ + { + "m_Id": "b013472d231248eb9e4a9ee2821e973a" + }, + { + "m_Id": "83b8eb9a889d43a684ef184301fd6e9e" + }, + { + "m_Id": "27a353a5cc96432fa692fdda747d8c67" + }, + { + "m_Id": "a49108ec71074f20a0cf02b277733b3d" + }, + { + "m_Id": "1c6b14984c74490d9e22845b989d3c38" + }, + { + "m_Id": "ae49a700327146e198ebe3d7cff9f16e" + }, + { + "m_Id": "c84e98391374467b949f3a300d8addbc" + }, + { + "m_Id": "88b967de53c84f6499f2cca8003c4851" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_TextureType": 0, + "m_NormalMapSpace": 0, + "m_EnableGlobalMipBias": true +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot", + "m_ObjectId": "fc09e91bae1849668bd70c5e6114e1d4", + "m_Id": 1, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + } +} + diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Shaders/MC2_Common_Lit_Back.shadergraph.meta b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Shaders/MC2_Common_Lit_Back.shadergraph.meta new file mode 100644 index 00000000..fb8787b3 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Shaders/MC2_Common_Lit_Back.shadergraph.meta @@ -0,0 +1,17 @@ +fileFormatVersion: 2 +guid: b969454d26657854a8fe82c813fb0876 +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3} +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/Common/Shaders/MC2_Common_Lit_Back.shadergraph + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Shaders/MC2_Common_Lit_Front.shadergraph b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Shaders/MC2_Common_Lit_Front.shadergraph new file mode 100644 index 00000000..80c75659 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Shaders/MC2_Common_Lit_Front.shadergraph @@ -0,0 +1,1889 @@ +{ + "m_SGVersion": 3, + "m_Type": "UnityEditor.ShaderGraph.GraphData", + "m_ObjectId": "f41d4d9b57ae4b59b26678b1f6073750", + "m_Properties": [ + { + "m_Id": "4ff00e04725b4223818808fa53a54254" + }, + { + "m_Id": "ddfd2e0ff3934cee81c59223a6aff2c9" + }, + { + "m_Id": "4e56b0554c1541eebaad6914417685a2" + }, + { + "m_Id": "a26b59565ef346af91775e92f420b09c" + } + ], + "m_Keywords": [], + "m_Dropdowns": [], + "m_CategoryData": [ + { + "m_Id": "4b4d7767a3c04b13992378fe6f0758c1" + } + ], + "m_Nodes": [ + { + "m_Id": "10be29e472174f9bac547bf66ae09a6e" + }, + { + "m_Id": "d8cd689a35ac40ccb7fc9fa38bfedb1b" + }, + { + "m_Id": "a3f302f80ed844ffbf44b99dd893415e" + }, + { + "m_Id": "dcc961838b80405199d4e7d4c1f4fd7d" + }, + { + "m_Id": "547c3a6093244b539b47f013a879b43a" + }, + { + "m_Id": "7d896f4d35f540dfb9dacc35ddec6afa" + }, + { + "m_Id": "b3a7b8c6105d4a9d99f2c0e475229395" + }, + { + "m_Id": "7f1e5a6638cc46108a2ef6f3335f7db6" + }, + { + "m_Id": "3e52a198523e4e8089a6a40a3969a3b7" + }, + { + "m_Id": "85cc4ac9d59d4ff9a65f96c816207a3f" + }, + { + "m_Id": "f538dbc91a2f4d8d8f4b21556d67960b" + }, + { + "m_Id": "f8ebcdc66077436288a397d204bbd8cd" + }, + { + "m_Id": "f5609f11baf94d889ab3f8bf42aa2131" + }, + { + "m_Id": "85fc068f71f9403e9b327a6076c0726d" + }, + { + "m_Id": "5c8b10ffa49c42de8989474a7c932e46" + }, + { + "m_Id": "a1bab1c7bfa0439ca12ea9ded5e1e9ff" + }, + { + "m_Id": "bb1de797d6b24fdd8548d1fa61c25fea" + }, + { + "m_Id": "25560879eb42491d9ea4f694cac78636" + } + ], + "m_GroupDatas": [], + "m_StickyNoteDatas": [], + "m_Edges": [ + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "5c8b10ffa49c42de8989474a7c932e46" + }, + "m_SlotId": 3 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "f8ebcdc66077436288a397d204bbd8cd" + }, + "m_SlotId": 2 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "85cc4ac9d59d4ff9a65f96c816207a3f" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "f5609f11baf94d889ab3f8bf42aa2131" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "85fc068f71f9403e9b327a6076c0726d" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "b3a7b8c6105d4a9d99f2c0e475229395" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "a1bab1c7bfa0439ca12ea9ded5e1e9ff" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "5c8b10ffa49c42de8989474a7c932e46" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "f538dbc91a2f4d8d8f4b21556d67960b" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "f8ebcdc66077436288a397d204bbd8cd" + }, + "m_SlotId": 1 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "f5609f11baf94d889ab3f8bf42aa2131" + }, + "m_SlotId": 2 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "dcc961838b80405199d4e7d4c1f4fd7d" + }, + "m_SlotId": 0 + } + }, + { + "m_OutputSlot": { + "m_Node": { + "m_Id": "f8ebcdc66077436288a397d204bbd8cd" + }, + "m_SlotId": 0 + }, + "m_InputSlot": { + "m_Node": { + "m_Id": "f5609f11baf94d889ab3f8bf42aa2131" + }, + "m_SlotId": 1 + } + } + ], + "m_VertexContext": { + "m_Position": { + "x": 0.0, + "y": 0.0 + }, + "m_Blocks": [ + { + "m_Id": "10be29e472174f9bac547bf66ae09a6e" + }, + { + "m_Id": "d8cd689a35ac40ccb7fc9fa38bfedb1b" + }, + { + "m_Id": "a3f302f80ed844ffbf44b99dd893415e" + } + ] + }, + "m_FragmentContext": { + "m_Position": { + "x": 0.0, + "y": 200.0 + }, + "m_Blocks": [ + { + "m_Id": "dcc961838b80405199d4e7d4c1f4fd7d" + }, + { + "m_Id": "547c3a6093244b539b47f013a879b43a" + }, + { + "m_Id": "7d896f4d35f540dfb9dacc35ddec6afa" + }, + { + "m_Id": "b3a7b8c6105d4a9d99f2c0e475229395" + }, + { + "m_Id": "7f1e5a6638cc46108a2ef6f3335f7db6" + }, + { + "m_Id": "3e52a198523e4e8089a6a40a3969a3b7" + }, + { + "m_Id": "bb1de797d6b24fdd8548d1fa61c25fea" + }, + { + "m_Id": "25560879eb42491d9ea4f694cac78636" + } + ] + }, + "m_PreviewData": { + "serializedMesh": { + "m_SerializedMesh": "{\"mesh\":{\"instanceID\":0}}", + "m_Guid": "" + }, + "preventRotation": false + }, + "m_Path": "Shader Graphs", + "m_GraphPrecision": 1, + "m_PreviewMode": 2, + "m_OutputNode": { + "m_Id": "" + }, + "m_ActiveTargets": [ + { + "m_Id": "1cefe9920a694056a32d6044c91eb117" + }, + { + "m_Id": "2bf6d014c6c1480c9cdd391006bd273a" + }, + { + "m_Id": "dd93478797c54e378dce24d430828d35" + } + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Texture2DMaterialSlot", + "m_ObjectId": "0e30156cfe4e4283a0dde082768d533e", + "m_Id": 0, + "m_DisplayName": "Main", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_BareResource": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "10be29e472174f9bac547bf66ae09a6e", + "m_Group": { + "m_Id": "" + }, + "m_Name": "VertexDescription.Position", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "79a8c2197a1843f58e31684f0ac49dcb" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Position" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "1c6b14984c74490d9e22845b989d3c38", + "m_Id": 7, + "m_DisplayName": "A", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 2, + "m_Type": "UnityEditor.Rendering.BuiltIn.ShaderGraph.BuiltInTarget", + "m_ObjectId": "1cefe9920a694056a32d6044c91eb117", + "m_ActiveSubTarget": { + "m_Id": "be4795b19cdd4426bcdabf79f1c24b0a" + }, + "m_AllowMaterialOverride": false, + "m_SurfaceType": 0, + "m_ZWriteControl": 0, + "m_ZTestMode": 4, + "m_AlphaMode": 0, + "m_RenderFace": 2, + "m_AlphaClip": false, + "m_CustomEditorGUI": "" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "25560879eb42491d9ea4f694cac78636", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.BentNormal", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "f52a98485db2455db11f6cdede9bae95" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.BentNormal" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "27a353a5cc96432fa692fdda747d8c67", + "m_Id": 5, + "m_DisplayName": "G", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "G", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.HDTarget", + "m_ObjectId": "2bf6d014c6c1480c9cdd391006bd273a", + "m_ActiveSubTarget": { + "m_Id": "a2b1c60a1f4e4d958112b90537480711" + }, + "m_Datas": [ + { + "m_Id": "34dbdb9f2f834fa99a6c1210b056dac1" + }, + { + "m_Id": "d8fb147345fe44deb67b06184c7aaf52" + }, + { + "m_Id": "e2857615bb264191854f0ddf6a91ee00" + }, + { + "m_Id": "521ef9d583b34a8fa6c639d38a592d88" + } + ], + "m_CustomEditorGUI": "", + "m_SupportVFX": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot", + "m_ObjectId": "30615abfe8e94f039230bb345e2dc291", + "m_Id": 0, + "m_DisplayName": "Emission", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Emission", + "m_StageCapability": 2, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [], + "m_ColorMode": 1, + "m_DefaultColor": { + "r": 0.0, + "g": 0.0, + "b": 0.0, + "a": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.HDLitData", + "m_ObjectId": "34dbdb9f2f834fa99a6c1210b056dac1", + "m_RayTracing": false, + "m_MaterialType": 0, + "m_RefractionModel": 0, + "m_SSSTransmission": true, + "m_EnergyConservingSpecular": true, + "m_ClearCoat": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "3e52a198523e4e8089a6a40a3969a3b7", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.Occlusion", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "d62d1c4bb772482a93392ab836e9a3d9" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.Occlusion" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.TangentMaterialSlot", + "m_ObjectId": "3f29e230e3d24419aee114c671d1e1a2", + "m_Id": 0, + "m_DisplayName": "Tangent", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Tangent", + "m_StageCapability": 1, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [], + "m_Space": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "48bfc27e7f46426d98a47ecf41075042", + "m_Id": 0, + "m_DisplayName": "Alpha", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Alpha", + "m_StageCapability": 2, + "m_Value": 1.0, + "m_DefaultValue": 1.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.CategoryData", + "m_ObjectId": "4b4d7767a3c04b13992378fe6f0758c1", + "m_Name": "", + "m_ChildObjectList": [ + { + "m_Id": "4ff00e04725b4223818808fa53a54254" + }, + { + "m_Id": "ddfd2e0ff3934cee81c59223a6aff2c9" + }, + { + "m_Id": "4e56b0554c1541eebaad6914417685a2" + }, + { + "m_Id": "a26b59565ef346af91775e92f420b09c" + } + ] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "4ba45cb2affc4a64a6fcfc68e4e4469b", + "m_Id": 3, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty", + "m_ObjectId": "4e56b0554c1541eebaad6914417685a2", + "m_Guid": { + "m_GuidSerialized": "291c9d7d-b925-4410-9719-cbd950781678" + }, + "m_Name": "Smoothness", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "Smoothness", + "m_DefaultReferenceName": "_Smoothness", + "m_OverrideReferenceName": "", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": 0.0, + "m_FloatType": 1, + "m_RangeValues": { + "x": 0.0, + "y": 1.0 + } +} + +{ + "m_SGVersion": 3, + "m_Type": "UnityEditor.ShaderGraph.Internal.ColorShaderProperty", + "m_ObjectId": "4ff00e04725b4223818808fa53a54254", + "m_Guid": { + "m_GuidSerialized": "2b85b46b-4c2e-4207-b64c-9ea0d9e7fe37" + }, + "m_Name": "Color", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "Color", + "m_DefaultReferenceName": "_Color", + "m_OverrideReferenceName": "", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": { + "r": 1.0, + "g": 1.0, + "b": 1.0, + "a": 1.0 + }, + "isMainColor": false, + "m_ColorMode": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.SystemData", + "m_ObjectId": "521ef9d583b34a8fa6c639d38a592d88", + "m_MaterialNeedsUpdateHash": 529, + "m_SurfaceType": 0, + "m_RenderingPass": 1, + "m_BlendMode": 0, + "m_ZTest": 4, + "m_ZWrite": false, + "m_TransparentCullMode": 2, + "m_OpaqueCullMode": 2, + "m_SortPriority": 0, + "m_AlphaTest": false, + "m_TransparentDepthPrepass": false, + "m_TransparentDepthPostpass": false, + "m_SupportLodCrossFade": false, + "m_DoubleSidedMode": 0, + "m_DOTSInstancing": false, + "m_CustomVelocity": false, + "m_Tessellation": false, + "m_TessellationMode": 0, + "m_TessellationFactorMinDistance": 20.0, + "m_TessellationFactorMaxDistance": 50.0, + "m_TessellationFactorTriangleSize": 100.0, + "m_TessellationShapeFactor": 0.75, + "m_TessellationBackFaceCullEpsilon": -0.25, + "m_TessellationMaxDisplacement": 0.009999999776482582, + "m_Version": 1, + "inspectorFoldoutMask": 1 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "537ac3a52c2746868e48f15018591a5c", + "m_Id": 0, + "m_DisplayName": "A", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "A", + "m_StageCapability": 3, + "m_Value": { + "e00": 0.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 0.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 0.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 0.0 + }, + "m_DefaultValue": { + "e00": 1.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 1.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 1.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "5431740a337c4f00863d1124e4bcd0be", + "m_Id": 0, + "m_DisplayName": "Smoothness", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "547c3a6093244b539b47f013a879b43a", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.NormalTS", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "89193339fb5f4aa8ae1e5d4a9385e8ac" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.NormalTS" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot", + "m_ObjectId": "58f71dd6e7b94c619ccf281e00723d3d", + "m_Id": 0, + "m_DisplayName": "Normal", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Normal", + "m_StageCapability": 1, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [], + "m_Space": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "59f499593ce549cdbfb6c359ff36b6cc", + "m_Id": 0, + "m_DisplayName": "Smoothness", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Smoothness", + "m_StageCapability": 2, + "m_Value": 0.5, + "m_DefaultValue": 0.5, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.TilingAndOffsetNode", + "m_ObjectId": "5c8b10ffa49c42de8989474a7c932e46", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Tiling And Offset", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1164.800048828125, + "y": 259.20001220703127, + "width": 207.99993896484376, + "height": 325.5999755859375 + } + }, + "m_Slots": [ + { + "m_Id": "5df0959b90a842269f9e687ac72571c1" + }, + { + "m_Id": "e85243155cd34b7d945bc4b2d2cab6b3" + }, + { + "m_Id": "fe52d187880e4a4781987f545692006d" + }, + { + "m_Id": "4ba45cb2affc4a64a6fcfc68e4e4469b" + } + ], + "synonyms": [ + "pan", + "scale" + ], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.UVMaterialSlot", + "m_ObjectId": "5df0959b90a842269f9e687ac72571c1", + "m_Id": 0, + "m_DisplayName": "UV", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "UV", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [], + "m_Channel": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot", + "m_ObjectId": "5e169845faf04ef1a19dade797cadeed", + "m_Id": 0, + "m_DisplayName": "Base Color", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "BaseColor", + "m_StageCapability": 2, + "m_Value": { + "x": 0.5, + "y": 0.5, + "z": 0.5 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [], + "m_ColorMode": 0, + "m_DefaultColor": { + "r": 0.5, + "g": 0.5, + "b": 0.5, + "a": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PositionMaterialSlot", + "m_ObjectId": "79a8c2197a1843f58e31684f0ac49dcb", + "m_Id": 0, + "m_DisplayName": "Position", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Position", + "m_StageCapability": 1, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [], + "m_Space": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "7d896f4d35f540dfb9dacc35ddec6afa", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.Metallic", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "e34c98ea8e534dd09964fc90ab08bd91" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.Metallic" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "7f1e5a6638cc46108a2ef6f3335f7db6", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.Emission", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "30615abfe8e94f039230bb345e2dc291" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.Emission" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "83b8eb9a889d43a684ef184301fd6e9e", + "m_Id": 4, + "m_DisplayName": "R", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "R", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "85cc4ac9d59d4ff9a65f96c816207a3f", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Property", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -956.7999877929688, + "y": 140.80003356933595, + "width": 105.5999755859375, + "height": 33.59999084472656 + } + }, + "m_Slots": [ + { + "m_Id": "99e14767e4d44dbbb5e5e436f5b1e92f" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "4ff00e04725b4223818808fa53a54254" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "85fc068f71f9403e9b327a6076c0726d", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Property", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -391.20001220703127, + "y": 360.8000183105469, + "width": 139.99996948242188, + "height": 33.5999755859375 + } + }, + "m_Slots": [ + { + "m_Id": "5431740a337c4f00863d1124e4bcd0be" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "4e56b0554c1541eebaad6914417685a2" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.SamplerStateMaterialSlot", + "m_ObjectId": "88b967de53c84f6499f2cca8003c4851", + "m_Id": 3, + "m_DisplayName": "Sampler", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Sampler", + "m_StageCapability": 3, + "m_BareResource": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot", + "m_ObjectId": "89193339fb5f4aa8ae1e5d4a9385e8ac", + "m_Id": 0, + "m_DisplayName": "Normal (Tangent Space)", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "NormalTS", + "m_StageCapability": 2, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [], + "m_Space": 3 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "8f07f80a79804412a5c2bb689ad58241", + "m_Id": 1, + "m_DisplayName": "B", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 3, + "m_Value": { + "e00": 2.0, + "e01": 2.0, + "e02": 2.0, + "e03": 2.0, + "e10": 2.0, + "e11": 2.0, + "e12": 2.0, + "e13": 2.0, + "e20": 2.0, + "e21": 2.0, + "e22": 2.0, + "e23": 2.0, + "e30": 2.0, + "e31": 2.0, + "e32": 2.0, + "e33": 2.0 + }, + "m_DefaultValue": { + "e00": 1.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 1.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 1.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "99e14767e4d44dbbb5e5e436f5b1e92f", + "m_Id": 0, + "m_DisplayName": "Color", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.DynamicValueMaterialSlot", + "m_ObjectId": "9f6f0b738f2946c395d7094746087ee8", + "m_Id": 2, + "m_DisplayName": "Out", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "e00": 0.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 0.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 0.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 0.0 + }, + "m_DefaultValue": { + "e00": 1.0, + "e01": 0.0, + "e02": 0.0, + "e03": 0.0, + "e10": 0.0, + "e11": 1.0, + "e12": 0.0, + "e13": 0.0, + "e20": 0.0, + "e21": 0.0, + "e22": 1.0, + "e23": 0.0, + "e30": 0.0, + "e31": 0.0, + "e32": 0.0, + "e33": 1.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "a0603a6937e446e8a883475a9b0f69b2", + "m_Id": 0, + "m_DisplayName": "Tiling", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "Out", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "a1bab1c7bfa0439ca12ea9ded5e1e9ff", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Property", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -1449.60009765625, + "y": 327.20001220703127, + "width": 104.800048828125, + "height": 33.5999755859375 + } + }, + "m_Slots": [ + { + "m_Id": "a0603a6937e446e8a883475a9b0f69b2" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "a26b59565ef346af91775e92f420b09c" + } +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.ShaderGraph.Internal.Vector2ShaderProperty", + "m_ObjectId": "a26b59565ef346af91775e92f420b09c", + "m_Guid": { + "m_GuidSerialized": "557f4917-de3d-4160-8fdd-6b016172ce32" + }, + "m_Name": "Tiling", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "Tiling", + "m_DefaultReferenceName": "_Tiling", + "m_OverrideReferenceName": "", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": { + "x": 1.0, + "y": 1.0, + "z": 0.0, + "w": 0.0 + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.HDLitSubTarget", + "m_ObjectId": "a2b1c60a1f4e4d958112b90537480711" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "a3f302f80ed844ffbf44b99dd893415e", + "m_Group": { + "m_Id": "" + }, + "m_Name": "VertexDescription.Tangent", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "3f29e230e3d24419aee114c671d1e1a2" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Tangent" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "a49108ec71074f20a0cf02b277733b3d", + "m_Id": 6, + "m_DisplayName": "B", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "B", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Texture2DInputMaterialSlot", + "m_ObjectId": "ae49a700327146e198ebe3d7cff9f16e", + "m_Id": 1, + "m_DisplayName": "Texture", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Texture", + "m_StageCapability": 3, + "m_BareResource": false, + "m_Texture": { + "m_SerializedTexture": "{\"texture\":{\"instanceID\":0}}", + "m_Guid": "" + }, + "m_DefaultType": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalLitSubTarget", + "m_ObjectId": "af49c364ed4a41e0ba8119d8d4b81eb7", + "m_WorkflowMode": 1, + "m_NormalDropOffSpace": 0, + "m_ClearCoat": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot", + "m_ObjectId": "b013472d231248eb9e4a9ee2821e973a", + "m_Id": 0, + "m_DisplayName": "RGBA", + "m_SlotType": 1, + "m_Hidden": false, + "m_ShaderOutputName": "RGBA", + "m_StageCapability": 2, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "w": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "b3a7b8c6105d4a9d99f2c0e475229395", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.Smoothness", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "59f499593ce549cdbfb6c359ff36b6cc" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.Smoothness" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "bb1de797d6b24fdd8548d1fa61c25fea", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.Alpha", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "48bfc27e7f46426d98a47ecf41075042" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.Alpha" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.Rendering.BuiltIn.ShaderGraph.BuiltInLitSubTarget", + "m_ObjectId": "be4795b19cdd4426bcdabf79f1c24b0a", + "m_WorkflowMode": 1, + "m_NormalDropOffSpace": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.UVMaterialSlot", + "m_ObjectId": "c84e98391374467b949f3a300d8addbc", + "m_Id": 2, + "m_DisplayName": "UV", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "UV", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [], + "m_Channel": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "d62d1c4bb772482a93392ab836e9a3d9", + "m_Id": 0, + "m_DisplayName": "Ambient Occlusion", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Occlusion", + "m_StageCapability": 2, + "m_Value": 1.0, + "m_DefaultValue": 1.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "d8cd689a35ac40ccb7fc9fa38bfedb1b", + "m_Group": { + "m_Id": "" + }, + "m_Name": "VertexDescription.Normal", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "58f71dd6e7b94c619ccf281e00723d3d" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "VertexDescription.Normal" +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.BuiltinData", + "m_ObjectId": "d8fb147345fe44deb67b06184c7aaf52", + "m_Distortion": false, + "m_DistortionMode": 0, + "m_DistortionDepthTest": true, + "m_AddPrecomputedVelocity": false, + "m_TransparentWritesMotionVec": false, + "m_AlphaToMask": false, + "m_DepthOffset": false, + "m_ConservativeDepthOffset": false, + "m_TransparencyFog": true, + "m_AlphaTestShadow": false, + "m_BackThenFrontRendering": false, + "m_TransparentDepthPrepass": false, + "m_TransparentDepthPostpass": false, + "m_SupportLodCrossFade": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.BlockNode", + "m_ObjectId": "dcc961838b80405199d4e7d4c1f4fd7d", + "m_Group": { + "m_Id": "" + }, + "m_Name": "SurfaceDescription.BaseColor", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": 0.0, + "y": 0.0, + "width": 0.0, + "height": 0.0 + } + }, + "m_Slots": [ + { + "m_Id": "5e169845faf04ef1a19dade797cadeed" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_SerializedDescriptor": "SurfaceDescription.BaseColor" +} + +{ + "m_SGVersion": 1, + "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalTarget", + "m_ObjectId": "dd93478797c54e378dce24d430828d35", + "m_ActiveSubTarget": { + "m_Id": "af49c364ed4a41e0ba8119d8d4b81eb7" + }, + "m_AllowMaterialOverride": false, + "m_SurfaceType": 0, + "m_ZTestMode": 4, + "m_ZWriteControl": 0, + "m_AlphaMode": 0, + "m_RenderFace": 2, + "m_AlphaClip": false, + "m_CastShadows": true, + "m_ReceiveShadows": true, + "m_CustomEditorGUI": "", + "m_SupportVFX": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Internal.Texture2DShaderProperty", + "m_ObjectId": "ddfd2e0ff3934cee81c59223a6aff2c9", + "m_Guid": { + "m_GuidSerialized": "102ebb54-4113-4289-b8e8-e63ef7917ce0" + }, + "m_Name": "Main", + "m_DefaultRefNameVersion": 1, + "m_RefNameGeneratedByDisplayName": "Main", + "m_DefaultReferenceName": "_Main", + "m_OverrideReferenceName": "", + "m_GeneratePropertyBlock": true, + "m_UseCustomSlotLabel": false, + "m_CustomSlotLabel": "", + "m_Precision": 0, + "overrideHLSLDeclaration": false, + "hlslDeclarationOverride": 0, + "m_Hidden": false, + "m_Value": { + "m_SerializedTexture": "{\"texture\":{\"instanceID\":0}}", + "m_Guid": "" + }, + "isMainTexture": false, + "useTilingAndOffset": false, + "m_Modifiable": true, + "m_DefaultType": 0 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.Rendering.HighDefinition.ShaderGraph.LightingData", + "m_ObjectId": "e2857615bb264191854f0ddf6a91ee00", + "m_NormalDropOffSpace": 0, + "m_BlendPreserveSpecular": true, + "m_ReceiveDecals": true, + "m_ReceiveSSR": true, + "m_ReceiveSSRTransparent": false, + "m_SpecularAA": false, + "m_SpecularOcclusionMode": 1, + "m_OverrideBakedGI": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot", + "m_ObjectId": "e34c98ea8e534dd09964fc90ab08bd91", + "m_Id": 0, + "m_DisplayName": "Metallic", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Metallic", + "m_StageCapability": 2, + "m_Value": 0.0, + "m_DefaultValue": 0.0, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "e85243155cd34b7d945bc4b2d2cab6b3", + "m_Id": 1, + "m_DisplayName": "Tiling", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Tiling", + "m_StageCapability": 3, + "m_Value": { + "x": 1.0, + "y": 1.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [] +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot", + "m_ObjectId": "f52a98485db2455db11f6cdede9bae95", + "m_Id": 0, + "m_DisplayName": "Bent Normal", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "BentNormal", + "m_StageCapability": 2, + "m_Value": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0, + "z": 0.0 + }, + "m_Labels": [], + "m_Space": 3 +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.PropertyNode", + "m_ObjectId": "f538dbc91a2f4d8d8f4b21556d67960b", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Property", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -970.3999633789063, + "y": 225.60003662109376, + "width": 109.5999755859375, + "height": 33.600006103515628 + } + }, + "m_Slots": [ + { + "m_Id": "0e30156cfe4e4283a0dde082768d533e" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": true, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_Property": { + "m_Id": "ddfd2e0ff3934cee81c59223a6aff2c9" + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.MultiplyNode", + "m_ObjectId": "f5609f11baf94d889ab3f8bf42aa2131", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Multiply", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -543.2000122070313, + "y": 200.0, + "width": 130.40005493164063, + "height": 117.60000610351563 + } + }, + "m_Slots": [ + { + "m_Id": "537ac3a52c2746868e48f15018591a5c" + }, + { + "m_Id": "8f07f80a79804412a5c2bb689ad58241" + }, + { + "m_Id": "9f6f0b738f2946c395d7094746087ee8" + } + ], + "synonyms": [ + "multiplication", + "times", + "x" + ], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + } +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalLitSubTarget", + "m_ObjectId": "f89b1f7ace834b6ab17c8f38c907dca5", + "m_WorkflowMode": 1, + "m_NormalDropOffSpace": 0, + "m_ClearCoat": false +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.SampleTexture2DNode", + "m_ObjectId": "f8ebcdc66077436288a397d204bbd8cd", + "m_Group": { + "m_Id": "" + }, + "m_Name": "Sample Texture 2D", + "m_DrawState": { + "m_Expanded": true, + "m_Position": { + "serializedVersion": "2", + "x": -823.2000122070313, + "y": 226.4000244140625, + "width": 183.20001220703126, + "height": 247.99996948242188 + } + }, + "m_Slots": [ + { + "m_Id": "b013472d231248eb9e4a9ee2821e973a" + }, + { + "m_Id": "83b8eb9a889d43a684ef184301fd6e9e" + }, + { + "m_Id": "27a353a5cc96432fa692fdda747d8c67" + }, + { + "m_Id": "a49108ec71074f20a0cf02b277733b3d" + }, + { + "m_Id": "1c6b14984c74490d9e22845b989d3c38" + }, + { + "m_Id": "ae49a700327146e198ebe3d7cff9f16e" + }, + { + "m_Id": "c84e98391374467b949f3a300d8addbc" + }, + { + "m_Id": "88b967de53c84f6499f2cca8003c4851" + } + ], + "synonyms": [], + "m_Precision": 0, + "m_PreviewExpanded": false, + "m_PreviewMode": 0, + "m_CustomColors": { + "m_SerializableColors": [] + }, + "m_TextureType": 0, + "m_NormalMapSpace": 0, + "m_EnableGlobalMipBias": true +} + +{ + "m_SGVersion": 0, + "m_Type": "UnityEditor.ShaderGraph.Vector2MaterialSlot", + "m_ObjectId": "fe52d187880e4a4781987f545692006d", + "m_Id": 2, + "m_DisplayName": "Offset", + "m_SlotType": 0, + "m_Hidden": false, + "m_ShaderOutputName": "Offset", + "m_StageCapability": 3, + "m_Value": { + "x": 0.0, + "y": 0.0 + }, + "m_DefaultValue": { + "x": 0.0, + "y": 0.0 + }, + "m_Labels": [] +} + diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Shaders/MC2_Common_Lit_Front.shadergraph.meta b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Shaders/MC2_Common_Lit_Front.shadergraph.meta new file mode 100644 index 00000000..2b3043a4 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Shaders/MC2_Common_Lit_Front.shadergraph.meta @@ -0,0 +1,17 @@ +fileFormatVersion: 2 +guid: e0b73429f84a56840ba17b216237f806 +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3} +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/Common/Shaders/MC2_Common_Lit_Front.shadergraph + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Textures.meta b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Textures.meta new file mode 100644 index 00000000..33aeff4b --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Textures.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2233c08f69efaa348b41487c7aece386 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Textures/SD_UnityChan_Skirt_PaintMap.png b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Textures/SD_UnityChan_Skirt_PaintMap.png new file mode 100644 index 00000000..1ede3f46 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Textures/SD_UnityChan_Skirt_PaintMap.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7b523a0fd463fba6d3398a9d7bf0b5540e2a2927f35f0e44d43975eef6d4f612 +size 4676 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/Common/Textures/SD_UnityChan_Skirt_PaintMap.png.meta b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Textures/SD_UnityChan_Skirt_PaintMap.png.meta new file mode 100644 index 00000000..6356f122 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/Common/Textures/SD_UnityChan_Skirt_PaintMap.png.meta @@ -0,0 +1,142 @@ +fileFormatVersion: 2 +guid: 00d6a209303f1804a81aee79794da3a4 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 1 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 0 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 128 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/Common/Textures/SD_UnityChan_Skirt_PaintMap.png + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes.meta b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes.meta new file mode 100644 index 00000000..08fe6db2 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ec893c380aa139943a8cb29f3a934540 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/CoreRP.meta b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/CoreRP.meta new file mode 100644 index 00000000..577cc500 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/CoreRP.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 34a0a79e78943c44b8e0dbdbb3f7ab58 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/CoreRP/RuntimeBuild_CoreRP.unity b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/CoreRP/RuntimeBuild_CoreRP.unity new file mode 100644 index 00000000..ba7a7d5d --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/CoreRP/RuntimeBuild_CoreRP.unity @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:860b4833c5b666c3c0e8f7eedf41f0a72f5dd521ecc966ea4f0e4360ea1f0c36 +size 21524 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/CoreRP/RuntimeBuild_CoreRP.unity.meta b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/CoreRP/RuntimeBuild_CoreRP.unity.meta new file mode 100644 index 00000000..2f7a8e89 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/CoreRP/RuntimeBuild_CoreRP.unity.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 93948452698a73449bbea353e91d29c7 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/CoreRP/RuntimeBuild_CoreRP.unity + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/CoreRP/RuntimeDressUp_CoreRP.unity b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/CoreRP/RuntimeDressUp_CoreRP.unity new file mode 100644 index 00000000..e90f237a --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/CoreRP/RuntimeDressUp_CoreRP.unity @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:afb28bb52e03d0d30504ec4dadf0d1a5dc422ceaa0b06bd6242e44a16bf788e1 +size 24859 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/CoreRP/RuntimeDressUp_CoreRP.unity.meta b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/CoreRP/RuntimeDressUp_CoreRP.unity.meta new file mode 100644 index 00000000..cfdfc6e9 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/CoreRP/RuntimeDressUp_CoreRP.unity.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: f270683cd8624d64d8d14af230cc8463 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/CoreRP/RuntimeDressUp_CoreRP.unity + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/CoreRP/UnityChanKAGURA_CoreRP.unity b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/CoreRP/UnityChanKAGURA_CoreRP.unity new file mode 100644 index 00000000..78a5aa64 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/CoreRP/UnityChanKAGURA_CoreRP.unity @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6fe3dc5720a8c5fad181a0d26496c40a37ac6d36d4adaa54682a75eaf87a33c9 +size 22305 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/CoreRP/UnityChanKAGURA_CoreRP.unity.meta b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/CoreRP/UnityChanKAGURA_CoreRP.unity.meta new file mode 100644 index 00000000..c2c9de61 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/CoreRP/UnityChanKAGURA_CoreRP.unity.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: e4876628e0b615548a27a4e96ec1f4fe +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/CoreRP/UnityChanKAGURA_CoreRP.unity + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/CoreRP/Wind_CoreRP.unity b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/CoreRP/Wind_CoreRP.unity new file mode 100644 index 00000000..488e5bdf --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/CoreRP/Wind_CoreRP.unity @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a0770ad95b644ffda1533781775e1c1fc885a33f5c3a564706f3ac38e145aec8 +size 32414 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/CoreRP/Wind_CoreRP.unity.meta b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/CoreRP/Wind_CoreRP.unity.meta new file mode 100644 index 00000000..8463bcb8 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/CoreRP/Wind_CoreRP.unity.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 267e0138a7a8ede409cd7c4e4381c7c8 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/CoreRP/Wind_CoreRP.unity + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/HDRP.meta b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/HDRP.meta new file mode 100644 index 00000000..71114a88 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/HDRP.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 23d215c402a80c14bac570f542a2b396 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/HDRP/MC2_SkyandFogSettingsProfile.asset b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/HDRP/MC2_SkyandFogSettingsProfile.asset new file mode 100644 index 00000000..da8b7981 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/HDRP/MC2_SkyandFogSettingsProfile.asset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:76065a65cfc41247023e102f0b33db175791727ec7cf7bc7fc7275f757a45898 +size 13446 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/HDRP/MC2_SkyandFogSettingsProfile.asset.meta b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/HDRP/MC2_SkyandFogSettingsProfile.asset.meta new file mode 100644 index 00000000..2e3223a3 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/HDRP/MC2_SkyandFogSettingsProfile.asset.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: b1b25245d5b864343a133fabb2dc80f7 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/HDRP/MC2_SkyandFogSettingsProfile.asset + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/HDRP/RuntimeBuild_HDRP.unity b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/HDRP/RuntimeBuild_HDRP.unity new file mode 100644 index 00000000..d6ba10af --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/HDRP/RuntimeBuild_HDRP.unity @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7fea7725e8efb1b47c7a169ca2bab7c8e6e94b2f0212e92cabb97976ad0db966 +size 32248 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/HDRP/RuntimeBuild_HDRP.unity.meta b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/HDRP/RuntimeBuild_HDRP.unity.meta new file mode 100644 index 00000000..b1e7c16f --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/HDRP/RuntimeBuild_HDRP.unity.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 36ece2ce79b44ae45a27a708761e0f07 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/HDRP/RuntimeBuild_HDRP.unity + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/HDRP/RuntimeDressUp_HDRP.unity b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/HDRP/RuntimeDressUp_HDRP.unity new file mode 100644 index 00000000..11155491 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/HDRP/RuntimeDressUp_HDRP.unity @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ec09c465c007e7870e26e30432253206ef5b9f32e7ea80f3f4dabf3956fce4bd +size 35251 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/HDRP/RuntimeDressUp_HDRP.unity.meta b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/HDRP/RuntimeDressUp_HDRP.unity.meta new file mode 100644 index 00000000..f763c148 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/HDRP/RuntimeDressUp_HDRP.unity.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 94497b725e0bd3c4f9c615f7162394ce +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/HDRP/RuntimeDressUp_HDRP.unity + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/HDRP/UnityChanKAGURA_HDRP.unity b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/HDRP/UnityChanKAGURA_HDRP.unity new file mode 100644 index 00000000..0e1620b4 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/HDRP/UnityChanKAGURA_HDRP.unity @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7a4bb6799f0716f2084e18d45ccea9d4863cd0005e0a2e38dd9d886609fb4059 +size 31077 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/HDRP/UnityChanKAGURA_HDRP.unity.meta b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/HDRP/UnityChanKAGURA_HDRP.unity.meta new file mode 100644 index 00000000..ab7f3a4d --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/HDRP/UnityChanKAGURA_HDRP.unity.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: bf9e8cbc74c20384b9a7d2a354ddde18 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/HDRP/UnityChanKAGURA_HDRP.unity + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/HDRP/Wind_HDRP.unity b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/HDRP/Wind_HDRP.unity new file mode 100644 index 00000000..9e1c1035 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/HDRP/Wind_HDRP.unity @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:99cce3af172187c84045b975c0b30a2f58a206250d982ec647d0277c3d83f27d +size 42992 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/HDRP/Wind_HDRP.unity.meta b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/HDRP/Wind_HDRP.unity.meta new file mode 100644 index 00000000..76601cfa --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/HDRP/Wind_HDRP.unity.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: cceffaba687d4f54c9223904abae4103 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/HDRP/Wind_HDRP.unity + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/URP.meta b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/URP.meta new file mode 100644 index 00000000..291f9cdb --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/URP.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 47028f8811dde3346914715fcf46e622 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/URP/RuntimeBuild_URP.unity b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/URP/RuntimeBuild_URP.unity new file mode 100644 index 00000000..6e3554d7 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/URP/RuntimeBuild_URP.unity @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ce17c28cce82a3330d1a68ef3ddbd31c1a0d41f5e0d80e22d26cd200565e7fca +size 24160 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/URP/RuntimeBuild_URP.unity.meta b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/URP/RuntimeBuild_URP.unity.meta new file mode 100644 index 00000000..d971f531 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/URP/RuntimeBuild_URP.unity.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 92dcb0677c9b85043b57cf704d41960b +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/URP/RuntimeBuild_URP.unity + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/URP/RuntimeDressUp_URP.unity b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/URP/RuntimeDressUp_URP.unity new file mode 100644 index 00000000..71a87d60 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/URP/RuntimeDressUp_URP.unity @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:091135f278c3d1a33b2674c4dc57076599bb9b882c71bb03cf5dad6cfec09dd6 +size 27146 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/URP/RuntimeDressUp_URP.unity.meta b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/URP/RuntimeDressUp_URP.unity.meta new file mode 100644 index 00000000..6ccc4f06 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/URP/RuntimeDressUp_URP.unity.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: f4b046e16bdc56641bf93aa9cb3bb0f1 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/URP/RuntimeDressUp_URP.unity + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/URP/UnityChanKAGURA_URP.unity b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/URP/UnityChanKAGURA_URP.unity new file mode 100644 index 00000000..ea99b0d2 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/URP/UnityChanKAGURA_URP.unity @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:af0e36ae0b62065438bd0cb146c47337c36c77875c4677b602ac9dff422a71dc +size 21908 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/URP/UnityChanKAGURA_URP.unity.meta b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/URP/UnityChanKAGURA_URP.unity.meta new file mode 100644 index 00000000..7d451bed --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/URP/UnityChanKAGURA_URP.unity.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 4912343a4ca12104c85e528a3f53cf36 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/URP/UnityChanKAGURA_URP.unity + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/URP/Wind_URP.unity b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/URP/Wind_URP.unity new file mode 100644 index 00000000..b8808ac8 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/URP/Wind_URP.unity @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e04238994ca5748524d1d0145a243edbb8b478215317eed413b665398967b485 +size 33251 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/URP/Wind_URP.unity.meta b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/URP/Wind_URP.unity.meta new file mode 100644 index 00000000..e595de53 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/URP/Wind_URP.unity.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: c9634d62ab15660448216ecd2d46d7a7 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes/URP/Wind_URP.unity + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher.meta b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher.meta new file mode 100644 index 00000000..74824a62 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 20f694a56cb3ba842b35402189c3b2f6 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/HighDefinition3D.meta b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/HighDefinition3D.meta new file mode 100644 index 00000000..a52c053f --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/HighDefinition3D.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 098d9df8397d80f45baed0214420d1cf +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/HighDefinition3D/RuntimeBuild_HighDefinition3D.unity b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/HighDefinition3D/RuntimeBuild_HighDefinition3D.unity new file mode 100644 index 00000000..3f6cc57d --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/HighDefinition3D/RuntimeBuild_HighDefinition3D.unity @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1344538bb448c3f15d0aa4c3ccf0527dbe7cea8b115f959fecdb099f9e40c58d +size 35742 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/HighDefinition3D/RuntimeBuild_HighDefinition3D.unity.meta b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/HighDefinition3D/RuntimeBuild_HighDefinition3D.unity.meta new file mode 100644 index 00000000..37dcbc40 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/HighDefinition3D/RuntimeBuild_HighDefinition3D.unity.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 8a0637df5c1ee8a4d8d6c5d2f3807cde +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/HighDefinition3D/RuntimeBuild_HighDefinition3D.unity + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/HighDefinition3D/RuntimeDressUp_HighDefinition3D.unity b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/HighDefinition3D/RuntimeDressUp_HighDefinition3D.unity new file mode 100644 index 00000000..c23bafbe --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/HighDefinition3D/RuntimeDressUp_HighDefinition3D.unity @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:425ee3749faad5217ec23076fe0ec0a8dba02c1e24e64d425f87cab0e1d4ced3 +size 38769 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/HighDefinition3D/RuntimeDressUp_HighDefinition3D.unity.meta b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/HighDefinition3D/RuntimeDressUp_HighDefinition3D.unity.meta new file mode 100644 index 00000000..bdf79c55 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/HighDefinition3D/RuntimeDressUp_HighDefinition3D.unity.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 30700d501f109174891f340ae1fc1833 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/HighDefinition3D/RuntimeDressUp_HighDefinition3D.unity + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/HighDefinition3D/UnityChanKAGURA_HighDefinition3D.unity b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/HighDefinition3D/UnityChanKAGURA_HighDefinition3D.unity new file mode 100644 index 00000000..71564526 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/HighDefinition3D/UnityChanKAGURA_HighDefinition3D.unity @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:73cb2e8ccc8c4db1d827759ef27c59305c8e40160b46a3788ae65706ba821f0c +size 35263 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/HighDefinition3D/UnityChanKAGURA_HighDefinition3D.unity.meta b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/HighDefinition3D/UnityChanKAGURA_HighDefinition3D.unity.meta new file mode 100644 index 00000000..687ccdee --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/HighDefinition3D/UnityChanKAGURA_HighDefinition3D.unity.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: ca2d4f8e19e54d642bbc386701570fd4 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/HighDefinition3D/UnityChanKAGURA_HighDefinition3D.unity + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/HighDefinition3D/Wind_HighDefinition3D.unity b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/HighDefinition3D/Wind_HighDefinition3D.unity new file mode 100644 index 00000000..244111f0 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/HighDefinition3D/Wind_HighDefinition3D.unity @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7aea3460aabbbee2de0bcb7b926a64e0187975a7e24f265bb57a57252d86e30b +size 44593 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/HighDefinition3D/Wind_HighDefinition3D.unity.meta b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/HighDefinition3D/Wind_HighDefinition3D.unity.meta new file mode 100644 index 00000000..efd8ad59 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/HighDefinition3D/Wind_HighDefinition3D.unity.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 8ef5d38bbe84ef44cb76386cf579b78d +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/HighDefinition3D/Wind_HighDefinition3D.unity + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/Universal3D.meta b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/Universal3D.meta new file mode 100644 index 00000000..c51f6ec4 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/Universal3D.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ee41de38686ef9b439643dd695fd9f9d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/Universal3D/RuntimeBuild_Universal3D.unity b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/Universal3D/RuntimeBuild_Universal3D.unity new file mode 100644 index 00000000..6571ff92 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/Universal3D/RuntimeBuild_Universal3D.unity @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cb85169ab67c2f674187b692f0efe495f7ee2f6f2723132ddec09dc0e6d60fde +size 27478 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/Universal3D/RuntimeBuild_Universal3D.unity.meta b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/Universal3D/RuntimeBuild_Universal3D.unity.meta new file mode 100644 index 00000000..7136957d --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/Universal3D/RuntimeBuild_Universal3D.unity.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 9d96bb6c1a7bbf14b95fba198bd36558 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/Universal3D/RuntimeBuild_Universal3D.unity + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/Universal3D/RuntimeDressUp_Universal3D.unity b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/Universal3D/RuntimeDressUp_Universal3D.unity new file mode 100644 index 00000000..18f566a9 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/Universal3D/RuntimeDressUp_Universal3D.unity @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bfc77efbc86c3ba7859690d352fb5b0a81febd4dc8f30d38846819e0d4c6d74a +size 30517 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/Universal3D/RuntimeDressUp_Universal3D.unity.meta b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/Universal3D/RuntimeDressUp_Universal3D.unity.meta new file mode 100644 index 00000000..2b793885 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/Universal3D/RuntimeDressUp_Universal3D.unity.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 01f984873de94d845a6f0dad6e1764ce +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/Universal3D/RuntimeDressUp_Universal3D.unity + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/Universal3D/UnityChanKAGURA_Universal3D.unity b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/Universal3D/UnityChanKAGURA_Universal3D.unity new file mode 100644 index 00000000..c9715c26 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/Universal3D/UnityChanKAGURA_Universal3D.unity @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bf136fcfed91b4bf1b09194afdbda5cf3446527584d73ea128f0b86fb8bec9b9 +size 23282 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/Universal3D/UnityChanKAGURA_Universal3D.unity.meta b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/Universal3D/UnityChanKAGURA_Universal3D.unity.meta new file mode 100644 index 00000000..a08e6a26 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/Universal3D/UnityChanKAGURA_Universal3D.unity.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 54b38eb7d538c7f44b7fd7a9df0478d3 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/Universal3D/UnityChanKAGURA_Universal3D.unity + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/Universal3D/Wind_Universal3D.unity b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/Universal3D/Wind_Universal3D.unity new file mode 100644 index 00000000..e0bd9e1b --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/Universal3D/Wind_Universal3D.unity @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d36cd32becfcb97c511df00aa9e6f2c9b43a908600d68ffc4de28505eaf19b05 +size 34225 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/Universal3D/Wind_Universal3D.unity.meta b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/Universal3D/Wind_Universal3D.unity.meta new file mode 100644 index 00000000..5f6e7665 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/Universal3D/Wind_Universal3D.unity.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 44a8005bc0be2894fb5f7cec86f3eeae +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/DemoScenes_Unity_6.1_or_Higher/Universal3D/Wind_Universal3D.unity + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan.meta new file mode 100644 index 00000000..5650d751 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9a72e6cc61880e442925c90b4d716ed9 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/Logo.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/Logo.meta new file mode 100644 index 00000000..ffaa2b3a --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/Logo.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 363d8d90514d2954fb7650c0d002a4c9 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/Logo/Dark_Silhouette.png b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/Logo/Dark_Silhouette.png new file mode 100644 index 00000000..55314890 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/Logo/Dark_Silhouette.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d5d7e2941aeec38349c36dfdac07022cdcbb09ff6925c6195f819dacd956df19 +size 45873 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/Logo/Dark_Silhouette.png.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/Logo/Dark_Silhouette.png.meta new file mode 100644 index 00000000..e3a07935 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/Logo/Dark_Silhouette.png.meta @@ -0,0 +1,142 @@ +fileFormatVersion: 2 +guid: 3563c26f39220f4409514929be083788 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 1024 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/Logo/Dark_Silhouette.png + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz.meta new file mode 100644 index 00000000..33390cc9 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d33cde9a16d475d45a6eb80526380702 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials.meta new file mode 100644 index 00000000..192e7613 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4191a0e9ba79553429f9c9409c0326b0 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/SB_def_mat.mat b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/SB_def_mat.mat new file mode 100644 index 00000000..7a170d6e --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/SB_def_mat.mat @@ -0,0 +1,133 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-9142388720324707925 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Editor::UnityEditor.Rendering.Universal.AssetVersion + version: 10 +--- !u!114 &-5755898939291106094 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 639247ca83abc874e893eb93af2b5e44, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 0 +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: SB_def_mat + m_Shader: {fileID: -6465566751694194690, guid: e0b73429f84a56840ba17b216237f806, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: + - MOTIONVECTORS + m_LockedProperties: + 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} + - _Main: + m_Texture: {fileID: 2800000, guid: 27570a5ee19caed4d9a04e5b88b3fb55, type: 3} + 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} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _BUILTIN_QueueControl: 0 + - _BUILTIN_QueueOffset: 0 + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 10 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 3 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _QueueControl: 0 + - _QueueOffset: 0 + - _Smoothness: 0 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 0 + m_Colors: + - _Color: {r: 0.9056604, g: 0.9056604, b: 0.9056604, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _Tiling: {r: 1, g: 1, b: 0, a: 0} + m_BuildTextureStacks: [] + m_AllowLocking: 1 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/SB_def_mat.mat.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/SB_def_mat.mat.meta new file mode 100644 index 00000000..fe3cdb7d --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/SB_def_mat.mat.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 59f12daf366f95d4984b921d3b5fb893 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/SB_def_mat.mat + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/SB_nol_mat.mat b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/SB_nol_mat.mat new file mode 100644 index 00000000..ab4d0dff --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/SB_nol_mat.mat @@ -0,0 +1,133 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-199350739714699963 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Editor::UnityEditor.Rendering.Universal.AssetVersion + version: 10 +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: SB_nol_mat + m_Shader: {fileID: -6465566751694194690, guid: e0b73429f84a56840ba17b216237f806, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: + - MOTIONVECTORS + m_LockedProperties: + 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} + - _Main: + m_Texture: {fileID: 2800000, guid: 27570a5ee19caed4d9a04e5b88b3fb55, type: 3} + 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} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _BUILTIN_QueueControl: 0 + - _BUILTIN_QueueOffset: 0 + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 10 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 3 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _QueueControl: 0 + - _QueueOffset: 0 + - _Smoothness: 0 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 0 + m_Colors: + - _Color: {r: 0.9056604, g: 0.9056604, b: 0.9056604, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _Tiling: {r: 1, g: 1, b: 0, a: 0} + m_BuildTextureStacks: [] + m_AllowLocking: 1 +--- !u!114 &5988364977265673585 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 639247ca83abc874e893eb93af2b5e44, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 0 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/SB_nol_mat.mat.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/SB_nol_mat.mat.meta new file mode 100644 index 00000000..ea928749 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/SB_nol_mat.mat.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: bbcadcb4bdd67154bbd0f71cc5a89cb1 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/SB_nol_mat.mat + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/SB_skin_mat.mat b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/SB_skin_mat.mat new file mode 100644 index 00000000..d25afd99 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/SB_skin_mat.mat @@ -0,0 +1,133 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-8280027471669481933 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Editor::UnityEditor.Rendering.Universal.AssetVersion + version: 10 +--- !u!114 &-4086932747498456647 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 639247ca83abc874e893eb93af2b5e44, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 0 +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: SB_skin_mat + m_Shader: {fileID: -6465566751694194690, guid: e0b73429f84a56840ba17b216237f806, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: + - MOTIONVECTORS + m_LockedProperties: + 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} + - _Main: + m_Texture: {fileID: 2800000, guid: 27570a5ee19caed4d9a04e5b88b3fb55, type: 3} + 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} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _BUILTIN_QueueControl: 0 + - _BUILTIN_QueueOffset: 0 + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 10 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 3 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _QueueControl: 0 + - _QueueOffset: 0 + - _Smoothness: 0 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 0 + m_Colors: + - _Color: {r: 0.9056604, g: 0.9056604, b: 0.9056604, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _Tiling: {r: 1, g: 1, b: 0, a: 0} + m_BuildTextureStacks: [] + m_AllowLocking: 1 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/SB_skin_mat.mat.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/SB_skin_mat.mat.meta new file mode 100644 index 00000000..1d68f6ed --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/SB_skin_mat.mat.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: cdced10803944d84ca8836a329489c09 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/SB_skin_mat.mat + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/def_mat.mat b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/def_mat.mat new file mode 100644 index 00000000..638bf621 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/def_mat.mat @@ -0,0 +1,133 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-1839986918002453301 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 639247ca83abc874e893eb93af2b5e44, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 0 +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: def_mat + m_Shader: {fileID: -6465566751694194690, guid: e0b73429f84a56840ba17b216237f806, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: + - MOTIONVECTORS + m_LockedProperties: + 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} + - _Main: + m_Texture: {fileID: 2800000, guid: e3db91f76893de24ca17abe2afcd3672, type: 3} + 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} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _BUILTIN_QueueControl: 0 + - _BUILTIN_QueueOffset: 0 + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 10 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 3 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _QueueControl: 0 + - _QueueOffset: 0 + - _Smoothness: 0 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 0 + m_Colors: + - _Color: {r: 0.9056604, g: 0.9056604, b: 0.9056604, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _Tiling: {r: 1, g: 1, b: 0, a: 0} + m_BuildTextureStacks: [] + m_AllowLocking: 1 +--- !u!114 &5919757528438359737 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Editor::UnityEditor.Rendering.Universal.AssetVersion + version: 10 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/def_mat.mat.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/def_mat.mat.meta new file mode 100644 index 00000000..87780e4c --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/def_mat.mat.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 163929bef874a5a47b9eeaa1af0d9409 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/def_mat.mat + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/hair_mat.mat b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/hair_mat.mat new file mode 100644 index 00000000..a7a9bcf6 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/hair_mat.mat @@ -0,0 +1,133 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-3408648073975475262 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 639247ca83abc874e893eb93af2b5e44, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 0 +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: hair_mat + m_Shader: {fileID: -6465566751694194690, guid: e0b73429f84a56840ba17b216237f806, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: + - MOTIONVECTORS + m_LockedProperties: + 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} + - _Main: + m_Texture: {fileID: 2800000, guid: e3db91f76893de24ca17abe2afcd3672, type: 3} + 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} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _BUILTIN_QueueControl: 0 + - _BUILTIN_QueueOffset: 0 + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 10 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 3 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _QueueControl: 0 + - _QueueOffset: 0 + - _Smoothness: 0 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 0 + m_Colors: + - _Color: {r: 0.9056604, g: 0.9056604, b: 0.9056604, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _Tiling: {r: 1, g: 1, b: 0, a: 0} + m_BuildTextureStacks: [] + m_AllowLocking: 1 +--- !u!114 &8780273825324758544 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Editor::UnityEditor.Rendering.Universal.AssetVersion + version: 10 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/hair_mat.mat.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/hair_mat.mat.meta new file mode 100644 index 00000000..0ae00a24 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/hair_mat.mat.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 4a800f51326d0df4a89423faffd109e6 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/hair_mat.mat + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/mouth_mat.mat b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/mouth_mat.mat new file mode 100644 index 00000000..35213f98 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/mouth_mat.mat @@ -0,0 +1,133 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-6329500939640827849 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Editor::UnityEditor.Rendering.Universal.AssetVersion + version: 10 +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: mouth_mat + m_Shader: {fileID: -6465566751694194690, guid: e0b73429f84a56840ba17b216237f806, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: + - MOTIONVECTORS + m_LockedProperties: + 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} + - _Main: + m_Texture: {fileID: 2800000, guid: e3db91f76893de24ca17abe2afcd3672, type: 3} + 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} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _BUILTIN_QueueControl: 0 + - _BUILTIN_QueueOffset: 0 + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 10 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 3 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _QueueControl: 0 + - _QueueOffset: 0 + - _Smoothness: 0 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 0 + m_Colors: + - _Color: {r: 0.9056604, g: 0.9056604, b: 0.9056604, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _Tiling: {r: 1, g: 1, b: 0, a: 0} + m_BuildTextureStacks: [] + m_AllowLocking: 1 +--- !u!114 &121759418820508836 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 639247ca83abc874e893eb93af2b5e44, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 0 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/mouth_mat.mat.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/mouth_mat.mat.meta new file mode 100644 index 00000000..100d8b3c --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/mouth_mat.mat.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 463c6f29901dda148bc86247837ca2b7 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/mouth_mat.mat + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/nol_mat.mat b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/nol_mat.mat new file mode 100644 index 00000000..f7895ab3 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/nol_mat.mat @@ -0,0 +1,133 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-6991097911196341467 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Editor::UnityEditor.Rendering.Universal.AssetVersion + version: 10 +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: nol_mat + m_Shader: {fileID: -6465566751694194690, guid: e0b73429f84a56840ba17b216237f806, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: + - MOTIONVECTORS + m_LockedProperties: + 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} + - _Main: + m_Texture: {fileID: 2800000, guid: e3db91f76893de24ca17abe2afcd3672, type: 3} + 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} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _BUILTIN_QueueControl: 0 + - _BUILTIN_QueueOffset: 0 + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 10 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 3 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _QueueControl: 0 + - _QueueOffset: 0 + - _Smoothness: 0 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 0 + m_Colors: + - _Color: {r: 0.9056604, g: 0.9056604, b: 0.9056604, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _Tiling: {r: 1, g: 1, b: 0, a: 0} + m_BuildTextureStacks: [] + m_AllowLocking: 1 +--- !u!114 &6265247899772061283 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 639247ca83abc874e893eb93af2b5e44, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 0 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/nol_mat.mat.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/nol_mat.mat.meta new file mode 100644 index 00000000..d5211912 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/nol_mat.mat.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 7f9e816ced8528d49a5302b7c88ad155 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/nol_mat.mat + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/skin_mat.mat b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/skin_mat.mat new file mode 100644 index 00000000..2b3f8782 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/skin_mat.mat @@ -0,0 +1,133 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: skin_mat + m_Shader: {fileID: -6465566751694194690, guid: e0b73429f84a56840ba17b216237f806, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: + - MOTIONVECTORS + m_LockedProperties: + 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} + - _Main: + m_Texture: {fileID: 2800000, guid: e3db91f76893de24ca17abe2afcd3672, type: 3} + 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} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _BUILTIN_QueueControl: 0 + - _BUILTIN_QueueOffset: 0 + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 10 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 3 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _QueueControl: 0 + - _QueueOffset: 0 + - _Smoothness: 0 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 0 + m_Colors: + - _Color: {r: 0.9056604, g: 0.9056604, b: 0.9056604, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _Tiling: {r: 1, g: 1, b: 0, a: 0} + m_BuildTextureStacks: [] + m_AllowLocking: 1 +--- !u!114 &5046530880951960719 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 639247ca83abc874e893eb93af2b5e44, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 0 +--- !u!114 &7950376295448117369 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Editor::UnityEditor.Rendering.Universal.AssetVersion + version: 10 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/skin_mat.mat.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/skin_mat.mat.meta new file mode 100644 index 00000000..e8c4368c --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/skin_mat.mat.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: b2196d7da1a53294aae46258e3d23d51 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Materials/skin_mat.mat + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/SD_UnityChan.controller b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/SD_UnityChan.controller new file mode 100644 index 00000000..aa605901 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/SD_UnityChan.controller @@ -0,0 +1,159 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1102 &-7982639091996884250 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: WALK00_F + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: [] + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 1 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: be35c3e99cdcca3439901f433aab54b2, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!1102 &-6546539397642646782 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: WAIT04 + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: [] + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 0 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: 3a954c05a2f94004eaff3df94a45c3ed, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!1102 &-5063388297046124761 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: RUN00_F + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: [] + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 1 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: d57512b99bc2cc84f92c873f858d9714, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: SD_UnityChan + serializedVersion: 5 + m_AnimatorParameters: [] + m_AnimatorLayers: + - serializedVersion: 5 + m_Name: Base Layer + m_StateMachine: {fileID: 558329607340261005} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 0 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} +--- !u!1107 &558329607340261005 +AnimatorStateMachine: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Base Layer + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: 6978213238113248026} + m_Position: {x: 50, y: 220, z: 0} + - serializedVersion: 1 + m_State: {fileID: -5063388297046124761} + m_Position: {x: 290, y: 220, z: 0} + - serializedVersion: 1 + m_State: {fileID: -6546539397642646782} + m_Position: {x: 530, y: 220, z: 0} + - serializedVersion: 1 + m_State: {fileID: -7982639091996884250} + m_Position: {x: 70, y: 300, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: -6546539397642646782} +--- !u!1102 &6978213238113248026 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: WAIT02 + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: [] + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 1 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: 2a7cc8d66d3c2fc46a54cbf3d95e3b2d, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/SD_UnityChan.controller.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/SD_UnityChan.controller.meta new file mode 100644 index 00000000..b1a50035 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/SD_UnityChan.controller.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 4ba06a656e1b0f94f996f86d809f5362 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 9100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/SD_UnityChan.controller + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Textures.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Textures.meta new file mode 100644 index 00000000..122137e3 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Textures.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a8ab178aa3b1f574c95414d151171d2c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Textures/body_sum.png b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Textures/body_sum.png new file mode 100644 index 00000000..77d344da --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Textures/body_sum.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ed4b4f7765ea8e9dbde76eef051ff7c9c1e0cd4c263e76a1532e8be77f181d27 +size 217430 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Textures/body_sum.png.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Textures/body_sum.png.meta new file mode 100644 index 00000000..6593d530 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Textures/body_sum.png.meta @@ -0,0 +1,142 @@ +fileFormatVersion: 2 +guid: 27570a5ee19caed4d9a04e5b88b3fb55 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Textures/body_sum.png + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Textures/body_win.png b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Textures/body_win.png new file mode 100644 index 00000000..eab1d0be --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Textures/body_win.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:65c3797b70c6d0109d2457811e305c2753fba7ddd4298cc7bbc70409cfae543b +size 209966 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Textures/body_win.png.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Textures/body_win.png.meta new file mode 100644 index 00000000..07cc09bc --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Textures/body_win.png.meta @@ -0,0 +1,142 @@ +fileFormatVersion: 2 +guid: 6e7b3359dea6deb4591905e4c01daaaa +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Textures/body_win.png + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Textures/misaki_head.png b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Textures/misaki_head.png new file mode 100644 index 00000000..f592edd7 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Textures/misaki_head.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f3283df0153df1c612a03f707570414d59549ed9db2edc218f7953133e68d3ba +size 214354 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Textures/misaki_head.png.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Textures/misaki_head.png.meta new file mode 100644 index 00000000..5443b7f6 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Textures/misaki_head.png.meta @@ -0,0 +1,142 @@ +fileFormatVersion: 2 +guid: f3b3d2d3302bfcd429625b8601f356ae +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Textures/misaki_head.png + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Textures/utc_all2.png b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Textures/utc_all2.png new file mode 100644 index 00000000..9bc3901a --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Textures/utc_all2.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b01c21a0e020d09b752499ceaa94e1ae8a5a06a55cf1b113f9ec77d86b824c4b +size 338399 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Textures/utc_all2.png.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Textures/utc_all2.png.meta new file mode 100644 index 00000000..39a3c4e9 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Textures/utc_all2.png.meta @@ -0,0 +1,142 @@ +fileFormatVersion: 2 +guid: e3db91f76893de24ca17abe2afcd3672 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Textures/utc_all2.png + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Textures/yuko_head.png b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Textures/yuko_head.png new file mode 100644 index 00000000..f2b52086 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Textures/yuko_head.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b0eeeacc934ffc4667276f4eb0e50b84388da940b0c3562ee180f79aa85becc8 +size 211031 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Textures/yuko_head.png.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Textures/yuko_head.png.meta new file mode 100644 index 00000000..c616c752 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Textures/yuko_head.png.meta @@ -0,0 +1,142 @@ +fileFormatVersion: 2 +guid: 683728d077857944cbe122f32302a197 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Textures/yuko_head.png + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Utc_sum_humanoid (Body).prefab b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Utc_sum_humanoid (Body).prefab new file mode 100644 index 00000000..2e175432 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Utc_sum_humanoid (Body).prefab @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:65425706988a58d5797e6383be3c3c3f073e26decefa6e16acd3474a16477045 +size 230271 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Utc_sum_humanoid (Body).prefab.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Utc_sum_humanoid (Body).prefab.meta new file mode 100644 index 00000000..0a8aeea7 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Utc_sum_humanoid (Body).prefab.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: f7b297d5cbbb2ae49a5b986f90674b9e +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Utc_sum_humanoid + (Body).prefab + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Utc_sum_humanoid (Hair).prefab b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Utc_sum_humanoid (Hair).prefab new file mode 100644 index 00000000..7f8d6581 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Utc_sum_humanoid (Hair).prefab @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f1d1e9c1b01e53284c9e76f151987e27c12bd36e7fcadb114ea5b7b69a379bd4 +size 185523 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Utc_sum_humanoid (Hair).prefab.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Utc_sum_humanoid (Hair).prefab.meta new file mode 100644 index 00000000..17b29844 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Utc_sum_humanoid (Hair).prefab.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 0769e110b29a40b4fa617aadaa1e2ea6 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Utc_sum_humanoid + (Hair).prefab + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Utc_sum_humanoid (Skeleton).prefab b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Utc_sum_humanoid (Skeleton).prefab new file mode 100644 index 00000000..66880eb6 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Utc_sum_humanoid (Skeleton).prefab @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c27f2b3acc151f1a180ec201a41716983749c0a480b80462757faf38b0e0aa95 +size 122005 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Utc_sum_humanoid (Skeleton).prefab.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Utc_sum_humanoid (Skeleton).prefab.meta new file mode 100644 index 00000000..a968327f --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Utc_sum_humanoid (Skeleton).prefab.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 4e3c7d56d063a904c9dad4bf2ccea5ad +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Utc_sum_humanoid + (Skeleton).prefab + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Utc_sum_humanoid Variant.prefab b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Utc_sum_humanoid Variant.prefab new file mode 100644 index 00000000..4902faf5 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Utc_sum_humanoid Variant.prefab @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:258752548dc2cb31bd7c86b5fd03f00f28c4d57b22c0c09d99520d93fa8b9878 +size 14985 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Utc_sum_humanoid Variant.prefab.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Utc_sum_humanoid Variant.prefab.meta new file mode 100644 index 00000000..25184abe --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Utc_sum_humanoid Variant.prefab.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 2e7240c8003a64b478effd2a812f4d31 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Utc_sum_humanoid + Variant.prefab + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Utc_sum_humanoid.fbx b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Utc_sum_humanoid.fbx new file mode 100644 index 00000000..8fe527f7 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Utc_sum_humanoid.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c7f9d4d3d86ae5f7e903ba2c8e1a3a687d105d5d36b91adfd48412136cce31c4 +size 822048 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Utc_sum_humanoid.fbx.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Utc_sum_humanoid.fbx.meta new file mode 100644 index 00000000..1527d1e8 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Utc_sum_humanoid.fbx.meta @@ -0,0 +1,1107 @@ +fileFormatVersion: 2 +guid: 5c78fba67bb448b42b8dc9ef978170e0 +ModelImporter: + serializedVersion: 21300 + internalIDToNameTable: [] + externalObjects: {} + materials: + materialImportMode: 2 + materialName: 0 + materialSearch: 1 + materialLocation: 1 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + resampleCurves: 1 + optimizeGameObjects: 0 + removeConstantScaleCurves: 1 + motionNodeName: + rigImportErrors: + rigImportWarnings: + animationImportErrors: + animationImportWarnings: + animationRetargetingWarnings: + animationDoRetargetingWarnings: 0 + importAnimatedCustomProperties: 0 + importConstraints: 0 + animationCompression: 3 + animationRotationError: 0.5 + animationPositionError: 0.5 + animationScaleError: 0.5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + extraUserProperties: [] + clipAnimations: [] + isReadable: 1 + meshes: + lODScreenPercentages: [] + globalScale: 1 + meshCompression: 0 + addColliders: 0 + useSRGBMaterialColor: 1 + sortHierarchyByName: 1 + importVisibility: 0 + importBlendShapes: 0 + importCameras: 0 + importLights: 0 + nodeNameCollisionStrategy: 1 + fileIdsGeneration: 2 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + keepQuads: 0 + weldVertices: 1 + bakeAxisConversion: 0 + preserveHierarchy: 0 + skinWeightsMode: 0 + maxBonesPerVertex: 4 + minBoneWeight: 0.001 + optimizeBones: 1 + meshOptimizationFlags: 1 + indexFormat: 0 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVMarginMethod: 1 + secondaryUVMinLightmapResolution: 40 + secondaryUVMinObjectScale: 1 + secondaryUVPackMargin: 4 + useFileScale: 1 + strictVertexDataChecks: 0 + tangentSpace: + normalSmoothAngle: 60 + normalImportMode: 0 + tangentImportMode: 3 + normalCalculationMode: 4 + legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0 + blendShapeNormalImportMode: 1 + normalSmoothingSource: 0 + referencedClips: [] + importAnimation: 1 + humanDescription: + serializedVersion: 3 + human: + - boneName: Character1_Hips + humanName: Hips + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Character1_LeftUpLeg + humanName: LeftUpperLeg + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Character1_RightUpLeg + humanName: RightUpperLeg + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Character1_LeftLeg + humanName: LeftLowerLeg + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Character1_RightLeg + humanName: RightLowerLeg + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Character1_LeftFoot + humanName: LeftFoot + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Character1_RightFoot + humanName: RightFoot + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Character1_Spine1 + humanName: Spine + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Character1_Neck + humanName: Neck + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Character1_Head + humanName: Head + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Character1_LeftShoulder + humanName: LeftShoulder + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Character1_RightShoulder + humanName: RightShoulder + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Character1_LeftArm + humanName: LeftUpperArm + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Character1_RightArm + humanName: RightUpperArm + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Character1_LeftForeArm + humanName: LeftLowerArm + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Character1_RightForeArm + humanName: RightLowerArm + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Character1_LeftHand + humanName: LeftHand + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Character1_RightHand + humanName: RightHand + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: bone_eye_L + humanName: LeftEye + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: bone_eye_R + humanName: RightEye + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Character1_LeftHandThumb1 + humanName: Left Thumb Proximal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Character1_LeftHandThumb2 + humanName: Left Thumb Intermediate + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Character1_LeftHandThumb3 + humanName: Left Thumb Distal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Character1_LeftHandIndex1 + humanName: Left Index Proximal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Character1_LeftHandIndex2 + humanName: Left Index Intermediate + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Character1_LeftHandMiddle1 + humanName: Left Middle Proximal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Character1_LeftHandMiddle2 + humanName: Left Middle Intermediate + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Character1_LeftHandRing1 + humanName: Left Ring Proximal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Character1_LeftHandRing2 + humanName: Left Ring Intermediate + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Character1_LeftHandPinky1 + humanName: Left Little Proximal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Character1_LeftHandPinky2 + humanName: Left Little Intermediate + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Character1_RightHandThumb1 + humanName: Right Thumb Proximal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Character1_RightHandThumb2 + humanName: Right Thumb Intermediate + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Character1_RightHandThumb3 + humanName: Right Thumb Distal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Character1_RightHandIndex1 + humanName: Right Index Proximal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Character1_RightHandIndex2 + humanName: Right Index Intermediate + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Character1_RightHandMiddle1 + humanName: Right Middle Proximal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Character1_RightHandMiddle2 + humanName: Right Middle Intermediate + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Character1_RightHandRing1 + humanName: Right Ring Proximal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Character1_RightHandRing2 + humanName: Right Ring Intermediate + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Character1_RightHandPinky1 + humanName: Right Little Proximal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Character1_RightHandPinky2 + humanName: Right Little Intermediate + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Character1_Spine2 + humanName: Chest + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Character1_LeftToeBase + humanName: LeftToes + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: Character1_RightToeBase + humanName: RightToes + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + skeleton: + - name: Utc_sum_humanoid(Clone) + parentName: + position: {x: 0, y: 0, z: 0} + rotation: {x: 0, y: 0, z: 0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: Character1_Reference + parentName: Utc_sum_humanoid(Clone) + position: {x: -0, y: 0, z: -0.000000002661807} + rotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071068} + scale: {x: 1, y: 1, z: 1} + - name: Character1_Hips + parentName: Character1_Reference + position: {x: -0, y: -0.049120344, z: 0.41803354} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: Character1_Spine + parentName: Character1_Hips + position: {x: -0, y: -0.00017591476, z: 0.001539917} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: Character1_Spine1 + parentName: Character1_Spine + position: {x: -0, y: 0.000000009536743, z: 0.04283531} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: Character1_Spine2 + parentName: Character1_Spine1 + position: {x: -0, y: 0.00015314102, z: 0.041275635} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: Character1_LeftShoulder + parentName: Character1_Spine2 + position: {x: -0.026731491, y: 0.046953294, z: 0.10265426} + rotation: {x: 6.416709e-10, y: -0.14720343, z: -0.012063365, w: 0.9890327} + scale: {x: 0.99999994, y: 1.0000001, z: 1.0000001} + - name: Character1_LeftArm + parentName: Character1_LeftShoulder + position: {x: -0.046947505, y: -0.0003006166, z: 0.0036682128} + rotation: {x: 0.025138553, y: 0.12145908, z: 0.00800092, w: 0.99224585} + scale: {x: 1.0000001, y: 1.0000001, z: 0.9999998} + - name: J_L_Arm_00_tw + parentName: Character1_LeftArm + position: {x: 0.00061920163, y: 0.0000003504753, z: 0.000030059813} + rotation: {x: -0.019484477, y: -0.000087756256, z: -0.0000014493895, w: 0.99981016} + scale: {x: 0.99999994, y: 0.9999999, z: 1.0000002} + - name: Character1_LeftForeArm + parentName: Character1_LeftArm + position: {x: -0.11878532, y: 0.000000009536743, z: 0.000000076293944} + rotation: {x: 0.012962691, y: 0.0029668726, z: 0.0336384, w: 0.99934566} + scale: {x: 0.99999994, y: 0.99999994, z: 1.0000002} + - name: Character1_LeftHand + parentName: Character1_LeftForeArm + position: {x: -0.112707324, y: -0.0000000047683715, z: -0.000000038146972} + rotation: {x: -0.025144951, y: 0.0009263517, z: -0.000049031725, w: 0.9996834} + scale: {x: 1.0000001, y: 0.9999999, z: 1.0000001} + - name: Character1_LeftHandRing1 + parentName: Character1_LeftHand + position: {x: -0.049339905, y: 0.008889142, z: 0.0041249082} + rotation: {x: -0.0031778018, y: -0.008010217, z: 0.014246811, w: 0.9998614} + scale: {x: 1, y: 1, z: 0.9999999} + - name: Character1_LeftHandRing2 + parentName: Character1_LeftHandRing1 + position: {x: -0.013061695, y: 0.000000007152557, z: -0.000000038146972} + rotation: {x: -0.005074419, y: -0.01721808, z: -0.011732383, w: 0.99977005} + scale: {x: 0.99999976, y: 0.9999999, z: 0.9999999} + - name: Character1_LeftHandRing3 + parentName: Character1_LeftHandRing2 + position: {x: -0.010001297, y: 0.0000000017881393, z: 0} + rotation: {x: 6.765418e-17, y: -0.000000044703473, z: 0.0000000015133989, w: 1} + scale: {x: 1.0000002, y: 1.0000001, z: 1} + - name: Character1_LeftHandPinky1 + parentName: Character1_LeftHand + position: {x: -0.046355017, y: 0.022602014, z: 0.0009494018} + rotation: {x: 0.0022179454, y: -0.017407462, z: 0.05259034, w: 0.998462} + scale: {x: 1, y: 1.0000001, z: 0.99999994} + - name: Character1_LeftHandPinky2 + parentName: Character1_LeftHandPinky1 + position: {x: -0.009598923, y: 0.000000007152557, z: 0.000000076293944} + rotation: {x: -0.0041052187, y: -0.02118038, z: -0.00477994, w: 0.99975586} + scale: {x: 1, y: 0.9999999, z: 0.99999994} + - name: Character1_LeftHandPinky3 + parentName: Character1_LeftHandPinky2 + position: {x: -0.0075915335, y: -0.000000009536743, z: 0} + rotation: {x: -0.000000002793968, y: -0.000000029802322, z: -0.000000007450581, + w: 1} + scale: {x: 0.9999999, y: 1, z: 0.99999994} + - name: Character1_LeftHandIndex1 + parentName: Character1_LeftHand + position: {x: -0.046978243, y: -0.022182073, z: 0.0025979613} + rotation: {x: 0.0048259627, y: -0.018998887, z: 0.045703307, w: 0.99876267} + scale: {x: 0.99999994, y: 1.0000001, z: 1} + - name: Character1_LeftHandIndex2 + parentName: Character1_LeftHandIndex1 + position: {x: -0.014227028, y: -0.00000000834465, z: 0.000000076293944} + rotation: {x: 0.0058518304, y: 0.04137672, z: 0.0068952497, w: 0.9991027} + scale: {x: 0.9999998, y: 0.9999998, z: 0.99999964} + - name: Character1_LeftHandIndex3 + parentName: Character1_LeftHandIndex2 + position: {x: -0.0107357595, y: 0.000000014305114, z: -0.000000076293944} + rotation: {x: -0.0000000018626456, y: -0.00000014901154, z: -0.0000000037252887, + w: 1} + scale: {x: 1.0000004, y: 0.9999999, z: 1.0000004} + - name: Character1_LeftHandThumb1 + parentName: Character1_LeftHand + position: {x: -0.016437054, y: -0.01568381, z: -0.017473105} + rotation: {x: 0.6827791, y: 0.28976816, z: 0.23807746, w: 0.6270297} + scale: {x: 0.9999999, y: 0.9999999, z: 1} + - name: Character1_LeftHandThumb2 + parentName: Character1_LeftHandThumb1 + position: {x: -0.017500991, y: 0, z: -0.000000076293944} + rotation: {x: -0.007327673, y: -0.020293944, z: 0.030798841, w: 0.99929273} + scale: {x: 1, y: 0.9999998, z: 0.99999994} + - name: Character1_LeftHandThumb3 + parentName: Character1_LeftHandThumb2 + position: {x: -0.010315971, y: 0, z: 0.00000007152557} + rotation: {x: -0.01386693, y: -0.019060507, z: -0.00015807952, w: 0.9997222} + scale: {x: 0.99999994, y: 0.9999999, z: 1} + - name: Character1_LeftHandThumb4 + parentName: Character1_LeftHandThumb3 + position: {x: -0.012429466, y: -0.000000038146972, z: 0.000000038146972} + rotation: {x: 0.00000014156107, y: 0.00000002607702, z: -0.000000089406974, + w: 1} + scale: {x: 1.0000001, y: 0.99999946, z: 0.9999998} + - name: Character1_LeftHandMiddle1 + parentName: Character1_LeftHand + position: {x: -0.05140888, y: -0.0063463617, z: 0.006106071} + rotation: {x: 0.0023525557, y: -0.018158944, z: 0.040574767, w: 0.9990088} + scale: {x: 1, y: 1.0000001, z: 0.99999976} + - name: Character1_LeftHandMiddle2 + parentName: Character1_LeftHandMiddle1 + position: {x: -0.016781254, y: 0.000000019073486, z: 0} + rotation: {x: -0.0038751021, y: 0.017281516, z: -0.010274473, w: 0.9997904} + scale: {x: 1.0000002, y: 1, z: 1.0000001} + - name: Character1_LeftHandMiddle3 + parentName: Character1_LeftHandMiddle2 + position: {x: -0.012807655, y: -0.000000005960464, z: -0.000000076293944} + rotation: {x: 0.000000007450579, y: -0.000000014901163, z: -0.0000000037252907, + w: 1} + scale: {x: 1, y: 1.0000001, z: 0.99999994} + - name: J_L_Elbow + parentName: Character1_LeftForeArm + position: {x: 0.00022022247, y: 0.0046890355, z: -0.00008010864} + rotation: {x: -0.006511218, y: -0.0007156488, z: -0.017952144, w: 0.9998174} + scale: {x: 1.0000001, y: 0.99999964, z: 0.9999998} + - name: J_L_ForeArm_00_tw + parentName: Character1_LeftForeArm + position: {x: -0.10891037, y: 0.00009298801, z: -0.00038040162} + rotation: {x: -0.012573468, y: 0.00046314506, z: -0.00002451689, w: 0.99992085} + scale: {x: 1.0000002, y: 0.9999999, z: 1} + - name: Character1_Neck + parentName: Character1_Spine2 + position: {x: -0, y: 0.047267172, z: 0.1330844} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: Character1_Head + parentName: Character1_Neck + position: {x: 2.5015806e-10, y: -0.00804217, z: 0.030468559} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: utc_face + parentName: Character1_Head + position: {x: -0, y: 0.009918099, z: -0.6672374} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: J_L_HairSide2_00 + parentName: Character1_Head + position: {x: -0.13977991, y: -0.032653578, z: 0.14276138} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: J_L_HairSide2_01 + parentName: J_L_HairSide2_00 + position: {x: -0, y: 0, z: -0.07184112} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: J_L_HairTail_00 + parentName: Character1_Head + position: {x: -0.08453446, y: 0.12091128, z: 0.07472458} + rotation: {x: 0.27495223, y: 0.14915642, z: 0.13304274, w: 0.94045377} + scale: {x: 1.0000001, y: 1, z: 1} + - name: J_L_HairTail_01 + parentName: J_L_HairTail_00 + position: {x: 0.000000019073486, y: -0.000000076293944, z: -0.19820912} + rotation: {x: 0.000000029802326, y: -0.000000022351744, z: 0.000000011175873, + w: 1} + scale: {x: 1, y: 0.99999994, z: 1.0000001} + - name: J_L_HairTail_02 + parentName: J_L_HairTail_01 + position: {x: -0, y: 0.000000114440915, z: -0.2224917} + rotation: {x: -4.9960047e-16, y: -0.00000006705523, z: -0.0000000074505815, + w: 1} + scale: {x: 0.9999999, y: 1.0000002, z: 0.99999994} + - name: J_L_HairTail_03 + parentName: J_L_HairTail_02 + position: {x: 0.000000019073486, y: 0.000000076293944, z: -0.17191942} + rotation: {x: 0.000000014901161, y: -0.000000007450581, z: -0.000000007450581, + w: 1} + scale: {x: 1, y: 1, z: 1} + - name: J_L_HeadRibbon_00 + parentName: Character1_Head + position: {x: -0.079515405, y: -0.068754226, z: 0.3136406} + rotation: {x: -0.2504739, y: -0.2833735, z: -0.049994256, w: 0.9243716} + scale: {x: 0.99999994, y: 0.99999964, z: 0.99999976} + - name: J_L_HeadRibbon_01 + parentName: J_L_HeadRibbon_00 + position: {x: 0.000000076293944, y: -0.000000114440915, z: 0.2478369} + rotation: {x: -0.8290727, y: -0.12707953, z: 0.09669092, w: 0.5358546} + scale: {x: 1, y: 1.0000001, z: 1.0000004} + - name: J_L_HeadRibbon_02 + parentName: J_L_HeadRibbon_01 + position: {x: -0, y: 0.00000022888183, z: 0.13667938} + rotation: {x: 0.68807155, y: -0.053607468, z: -0.044375025, w: 0.7222982} + scale: {x: 1, y: 0.9999997, z: 0.99999994} + - name: J_L_HeadRibbon_03 + parentName: J_L_HeadRibbon_02 + position: {x: -0.000000076293944, y: -0.00000015258789, z: 0.16675673} + rotation: {x: -0.00000022351746, y: -0.00000011920929, z: 0.0000000149011345, + w: 1} + scale: {x: 1, y: 0.9999999, z: 1.0000001} + - name: J_R_HairSide2_00 + parentName: Character1_Head + position: {x: 0.13977984, y: -0.032653518, z: 0.14276077} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: J_R_HairSide2_01 + parentName: J_R_HairSide2_00 + position: {x: -0, y: 0, z: -0.07184112} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: J_R_HairTail_00 + parentName: Character1_Head + position: {x: 0.08453457, y: 0.12091121, z: 0.074723355} + rotation: {x: 0.27495188, y: -0.14915672, z: -0.13304274, w: 0.9404538} + scale: {x: 1, y: 1, z: 1} + - name: J_R_HairTail_01 + parentName: J_R_HairTail_00 + position: {x: -0.000000095367426, y: 0.0000009918213, z: -0.19820796} + rotation: {x: 0.000000029802322, y: -0.0000000074505815, z: -0.00000010058282, + w: 1} + scale: {x: 1.0000001, y: 0.99999994, z: 1} + - name: J_R_HairTail_02 + parentName: J_R_HairTail_01 + position: {x: -0.0000004196167, y: -0.0000005340576, z: -0.2224927} + rotation: {x: 0.000000089406925, y: 0.000000014901161, z: -0.000000040978207, + w: 1} + scale: {x: 0.99999964, y: 1.0000002, z: 1} + - name: J_R_HairTail_03 + parentName: J_R_HairTail_02 + position: {x: -0.000000038146972, y: -0.000000038146972, z: -0.17191932} + rotation: {x: -1.6653337e-16, y: -0.000000014901158, z: -0.000000011175868, + w: 1} + scale: {x: 1.0000001, y: 1.0000001, z: 1.0000001} + - name: J_R_HeadRibbon_00 + parentName: Character1_Head + position: {x: 0.0795154, y: -0.06875421, z: 0.31363952} + rotation: {x: -0.25047436, y: 0.28337345, z: 0.04999436, w: 0.92437154} + scale: {x: 0.9999998, y: 1, z: 1} + - name: J_R_HeadRibbon_01 + parentName: J_R_HeadRibbon_00 + position: {x: -0.0000011062622, y: -0.0000010299682, z: 0.24783768} + rotation: {x: -0.82907134, y: 0.12707938, z: -0.096691504, w: 0.5358566} + scale: {x: 1.0000002, y: 1.0000001, z: 0.99999994} + - name: J_R_HeadRibbon_02 + parentName: J_R_HeadRibbon_01 + position: {x: 0.0000008010864, y: 0.000001335144, z: 0.13668053} + rotation: {x: 0.68807024, y: 0.05360729, z: 0.0443758, w: 0.7222994} + scale: {x: 1.0000002, y: 0.9999999, z: 1.0000001} + - name: J_R_HeadRibbon_03 + parentName: J_R_HeadRibbon_02 + position: {x: -0.0000009536743, y: -0.0000010681152, z: 0.16675788} + rotation: {x: 0.0000007748599, y: -0.00000043213427, z: -0.00000084936573, w: 1} + scale: {x: 1.0000001, y: 1, z: 0.9999997} + - name: J_L_HairSide_00 + parentName: Character1_Head + position: {x: -0.07298515, y: -0.0934125, z: 0.27946135} + rotation: {x: 0.032767124, y: -0.43403226, z: -0.092962936, w: 0.89548886} + scale: {x: 1, y: 0.9999999, z: 0.99999994} + - name: J_L_HairSide_01 + parentName: J_L_HairSide_00 + position: {x: -0.124109186, y: 0.000000047683713, z: -0.00000030517577} + rotation: {x: 0.029233634, y: -0.33951724, z: -0.06338306, w: 0.93800646} + scale: {x: 0.99999976, y: 1.0000002, z: 1.0000001} + - name: J_L_HairSide_02 + parentName: J_L_HairSide_01 + position: {x: -0.17118454, y: 0.000000009536743, z: 0.00000022888183} + rotation: {x: 0.000000077299774, y: -0.00000008475035, z: -0.000000014901153, + w: 1} + scale: {x: 1.0000002, y: 1, z: 0.9999998} + - name: J_R_HairSide_00 + parentName: Character1_Head + position: {x: 0.072985135, y: -0.09341254, z: 0.27946243} + rotation: {x: 0.03276742, y: 0.4340327, z: 0.09296258, w: 0.8954887} + scale: {x: 1, y: 1, z: 0.99999994} + - name: J_R_HairSide_01 + parentName: J_R_HairSide_00 + position: {x: 0.124110945, y: -0.00000016212464, z: -0.0000010681152} + rotation: {x: 0.029233143, y: 0.33951682, z: 0.063383006, w: 0.9380066} + scale: {x: 1.0000001, y: 1, z: 1.0000002} + - name: J_R_HairSide_02 + parentName: J_R_HairSide_01 + position: {x: 0.17118447, y: 0.000000009536743, z: -0.00000016212464} + rotation: {x: -0.00000069662923, y: 0.00000008195637, z: 0.000000029802383, + w: 1} + scale: {x: 0.9999999, y: 1.0000001, z: 0.9999996} + - name: bone_eye_L + parentName: Character1_Head + position: {x: -0.026893321, y: 0.04649828, z: 0.102056116} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: bone_eye_R + parentName: Character1_Head + position: {x: 0.026893293, y: 0.046498314, z: 0.10205597} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: J_L_HairFront_00 + parentName: Character1_Head + position: {x: 0.00047761618, y: -0.102207325, z: 0.28018036} + rotation: {x: -0.032923594, y: 0.012465945, z: 0.003332434, w: 0.99937457} + scale: {x: 1, y: 0.99999994, z: 0.9999999} + - name: J_L_HairFront_01 + parentName: J_L_HairFront_00 + position: {x: 0.0000000023841857, y: 0, z: -0.18115325} + rotation: {x: 0.14653109, y: -0.012764544, z: -0.0018909584, w: 0.9891219} + scale: {x: 0.99999994, y: 1.0000001, z: 1.0000001} + - name: J_R_HairFront_00 + parentName: Character1_Head + position: {x: 0.014399265, y: -0.09940759, z: 0.28018036} + rotation: {x: -0.06683042, y: -0.07431372, z: 0.0030237695, w: 0.9949885} + scale: {x: 1, y: 0.99999994, z: 0.9999999} + - name: J_R_HairFront_01 + parentName: J_R_HairFront_00 + position: {x: -0.000000028610229, y: 0.000000019073486, z: -0.18115318} + rotation: {x: 0.14653113, y: -0.012764582, z: -0.0018909615, w: 0.9891219} + scale: {x: 1, y: 1.0000002, z: 1.0000002} + - name: Collar + parentName: Character1_Spine2 + position: {x: -0, y: 0.08650589, z: 0.12216255} + rotation: {x: 0.000000014901161, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: Ribbon_L + parentName: Character1_Spine2 + position: {x: -0.004597386, y: -0.05966402, z: 0.048371542} + rotation: {x: 0.000000014901161, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: Character1_RightShoulder + parentName: Character1_Spine2 + position: {x: 0.02673147, y: 0.046953294, z: 0.1026548} + rotation: {x: 0.000000017829457, y: 0.14720337, z: 0.012063239, w: 0.9890327} + scale: {x: 1, y: 0.99999994, z: 0.99999994} + - name: Character1_RightArm + parentName: Character1_RightShoulder + position: {x: 0.04694744, y: -0.0003006053, z: 0.0036683274} + rotation: {x: 0.025114838, y: -0.12146138, z: -0.008003939, w: 0.9922461} + scale: {x: 1.0000001, y: 1.0000001, z: 1} + - name: J_R_Arm_00_tw + parentName: Character1_RightArm + position: {x: -0.0006183624, y: 0.00000034093856, z: 0.000029029845} + rotation: {x: -0.019467765, y: 0.0000867438, z: 0.0000013984002, w: 0.9998105} + scale: {x: 0.99999994, y: 0.9999999, z: 1.0000001} + - name: Character1_RightForeArm + parentName: Character1_RightArm + position: {x: 0.11878662, y: -0.0000000023841857, z: -0.0000005340576} + rotation: {x: 0.012962643, y: -0.0029668876, z: -0.03363779, w: 0.9993456} + scale: {x: 1, y: 0.9999999, z: 1} + - name: Character1_RightHand + parentName: Character1_RightForeArm + position: {x: 0.11270626, y: -0.00000007152557, z: -0.0000009536743} + rotation: {x: -0.024933074, y: -0.0007821354, z: 0.000042964955, w: 0.9996888} + scale: {x: 0.99999994, y: 1, z: 1.0000004} + - name: Character1_RightHandThumb1 + parentName: Character1_RightHand + position: {x: 0.016436901, y: -0.015683817, z: -0.017472915} + rotation: {x: 0.68275243, y: -0.28985518, z: -0.23803082, w: 0.6270362} + scale: {x: 0.9999999, y: 1, z: 1.0000001} + - name: Character1_RightHandThumb2 + parentName: Character1_RightHandThumb1 + position: {x: 0.017501583, y: 0.000000114440915, z: -0.00000050544736} + rotation: {x: -0.0073244264, y: 0.020301742, z: -0.030826923, w: 0.9992917} + scale: {x: 1.0000001, y: 0.9999997, z: 0.99999994} + - name: Character1_RightHandThumb3 + parentName: Character1_RightHandThumb2 + position: {x: 0.010316124, y: 0.0000005340576, z: -0.00000010967254} + rotation: {x: -0.01386646, y: 0.019060291, z: 0.00015806762, w: 0.9997222} + scale: {x: 1.0000001, y: 1.0000004, z: 1.0000002} + - name: Character1_RightHandThumb4 + parentName: Character1_RightHandThumb3 + position: {x: 0.012428941, y: -0.0000006866455, z: 0.00000018596648} + rotation: {x: 0.00000030919912, y: 0.000000108033525, z: 0.00000022351746, w: 1} + scale: {x: 0.99999964, y: 0.9999999, z: 0.9999998} + - name: Character1_RightHandPinky1 + parentName: Character1_RightHand + position: {x: 0.046354044, y: 0.022601992, z: 0.00095024105} + rotation: {x: 0.00222267, y: 0.017453691, z: -0.052590676, w: 0.9984611} + scale: {x: 0.9999998, y: 1.0000001, z: 1} + - name: Character1_RightHandPinky2 + parentName: Character1_RightHandPinky1 + position: {x: 0.009599628, y: 0.00000007390976, z: 0.0000011444091} + rotation: {x: -0.0041054687, y: 0.021180103, z: 0.004780198, w: 0.99975586} + scale: {x: 1.0000004, y: 1, z: 1.0000001} + - name: Character1_RightHandPinky3 + parentName: Character1_RightHandPinky2 + position: {x: 0.0075922012, y: 0.00000013589859, z: -0.00000030517577} + rotation: {x: -0.00000024121255, y: 0.00000025331983, z: -0.000000014901105, + w: 1} + scale: {x: 0.99999964, y: 1.0000001, z: 1} + - name: Character1_RightHandRing1 + parentName: Character1_RightHand + position: {x: 0.049340207, y: 0.008889168, z: 0.0041255187} + rotation: {x: -0.0031775192, y: 0.008009321, z: -0.014247004, w: 0.9998615} + scale: {x: 1, y: 1.0000001, z: 0.99999994} + - name: Character1_RightHandRing2 + parentName: Character1_RightHandRing1 + position: {x: 0.013061752, y: 0.000000005960464, z: 0.00000015258789} + rotation: {x: -0.0050746724, y: 0.017218595, z: 0.01173241, w: 0.99977005} + scale: {x: 0.99999994, y: 0.9999998, z: 0.9999997} + - name: Character1_RightHandRing3 + parentName: Character1_RightHandRing2 + position: {x: 0.0100004, y: -0.000000009834766, z: -0.00000034332274} + rotation: {x: 0.0000002421438, y: 0.000000029802315, z: -0.0000000022118978, + w: 1} + scale: {x: 1.0000004, y: 1.0000001, z: 1.0000001} + - name: Character1_RightHandIndex1 + parentName: Character1_RightHand + position: {x: 0.046977613, y: -0.02218206, z: 0.002598419} + rotation: {x: 0.0048251827, y: 0.018980803, z: -0.045706283, w: 0.9987629} + scale: {x: 1.0000001, y: 1.0000001, z: 0.99999994} + - name: Character1_RightHandIndex2 + parentName: Character1_RightHandIndex1 + position: {x: 0.014227294, y: 0.00000006437301, z: -0.00000015258789} + rotation: {x: 0.0058521065, y: -0.04137672, z: -0.0068952506, w: 0.9991027} + scale: {x: 0.99999994, y: 0.9999998, z: 0.99999976} + - name: Character1_RightHandIndex3 + parentName: Character1_RightHandIndex2 + position: {x: 0.010736103, y: -0.000000085830685, z: -0.00000015258789} + rotation: {x: -0.000000007450581, y: 0.000000104308135, z: -0.000000016763806, + w: 1} + scale: {x: 0.9999998, y: 0.9999999, z: 1.0000004} + - name: Character1_RightHandMiddle1 + parentName: Character1_RightHand + position: {x: 0.051409397, y: -0.006346327, z: 0.006106949} + rotation: {x: 0.002352232, y: 0.018152952, z: -0.040573914, w: 0.9990089} + scale: {x: 1.0000001, y: 1.0000002, z: 0.99999994} + - name: Character1_RightHandMiddle2 + parentName: Character1_RightHandMiddle1 + position: {x: 0.01678072, y: -0.000000042915342, z: 0.000000076293944} + rotation: {x: -0.0038748826, y: -0.017280553, z: 0.010274474, w: 0.9997904} + scale: {x: 0.9999999, y: 0.99999994, z: 1.0000001} + - name: Character1_RightHandMiddle3 + parentName: Character1_RightHandMiddle2 + position: {x: 0.012807674, y: 0.0000000667572, z: -0.00000087738033} + rotation: {x: -0.0000000018626964, y: -0.00000092387177, z: -0.000000055879344, + w: 1} + scale: {x: 1.0000001, y: 1, z: 0.9999999} + - name: J_R_ForeArm_00_tw + parentName: Character1_RightForeArm + position: {x: 0.1089093, y: 0.00009293079, z: -0.00038059233} + rotation: {x: -0.012467529, y: -0.0003910812, z: 0.000021479957, w: 0.9999222} + scale: {x: 0.9999999, y: 1, z: 1.0000004} + - name: J_R_Elbow + parentName: Character1_RightForeArm + position: {x: -0.00022066115, y: 0.0046890113, z: -0.000079879756} + rotation: {x: -0.0065112305, y: 0.00071536575, z: 0.017952092, w: 0.9998174} + scale: {x: 1.0000001, y: 1.0000001, z: 1.0000005} + - name: Ribbon_R + parentName: Character1_Spine2 + position: {x: 0.00459739, y: -0.059663896, z: 0.04837158} + rotation: {x: 0.000000014901184, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: Skirt11_L + parentName: Character1_Hips + position: {x: -0.08134019, y: -0.07278677, z: 0.017924575} + rotation: {x: -0.08120375, y: 0.06756295, z: -0.00025305356, w: 0.9944049} + scale: {x: 1, y: 1, z: 1} + - name: Skirt12_L + parentName: Skirt11_L + position: {x: -0, y: 0, z: -0.06362396} + rotation: {x: 0, y: 0.000000007450581, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: Skirt13_L + parentName: Skirt12_L + position: {x: -0, y: 0, z: -0.071057506} + rotation: {x: 0, y: 0.000000007450581, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: Skirt11_R + parentName: Character1_Hips + position: {x: 0.081340194, y: -0.07278665, z: 0.017924422} + rotation: {x: -0.08120376, y: -0.06756316, z: 0.00025289616, w: 0.9944049} + scale: {x: 1, y: 1, z: 1} + - name: Skirt12_R + parentName: Skirt11_R + position: {x: -0.000000019073486, y: -0.00000020980835, z: -0.06362419} + rotation: {x: 0.00000006705523, y: -0.000000014901163, z: 9.992008e-16, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: Skirt13_R + parentName: Skirt12_R + position: {x: -0.000000019073486, y: 0.000000057220458, z: -0.07105742} + rotation: {x: -0.000000007450581, y: -0.000000014901163, z: 9.313225e-10, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: Skirt20_L + parentName: Character1_Hips + position: {x: -0.11579351, y: 0.002001705, z: 0.025276184} + rotation: {x: 0, y: 0.2754431, z: -0, w: 0.96131736} + scale: {x: 1, y: 1, z: 1} + - name: Skirt21_L + parentName: Skirt20_L + position: {x: -0.000000038146972, y: 0, z: -0.07196762} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: Skirt22_L + parentName: Skirt21_L + position: {x: 0.000000038146972, y: 0, z: -0.079026185} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: Skirt30_L + parentName: Character1_Hips + position: {x: -0.068905, y: 0.06840348, z: 0.025949707} + rotation: {x: 0.16488287, y: 0.07006175, z: -0.008561788, w: 0.9837844} + scale: {x: 1.0000001, y: 0.9999999, z: 0.99999994} + - name: Skirt31_L + parentName: Skirt30_L + position: {x: -0, y: 0, z: -0.06441368} + rotation: {x: 0, y: -0.0000000074505815, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: Skirt32_L + parentName: Skirt31_L + position: {x: -0, y: 0, z: -0.070049495} + rotation: {x: 0, y: -0.0000000074505815, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: Skirt30_R + parentName: Character1_Hips + position: {x: 0.068904996, y: 0.06840344, z: 0.025949402} + rotation: {x: 0.16488269, y: -0.07006178, z: 0.008561828, w: 0.98378444} + scale: {x: 1, y: 1, z: 1} + - name: Skirt31_R + parentName: Skirt30_R + position: {x: 0.000000038146972, y: 0.00000020980835, z: -0.06441322} + rotation: {x: 0.000000014901163, y: -5.551116e-17, z: -0.0000000037252903, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: Skirt32_R + parentName: Skirt31_R + position: {x: 0.000000057220458, y: 0.000000047683713, z: -0.07004946} + rotation: {x: 0.000000014901163, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: Skirt20_R + parentName: Character1_Hips + position: {x: 0.115793996, y: 0.0020017338, z: 0.02527649} + rotation: {x: 0, y: -0.27544278, z: -0, w: 0.9613175} + scale: {x: 1, y: 1, z: 1} + - name: Skirt21_R + parentName: Skirt20_R + position: {x: -0.00000057220456, y: 0, z: -0.071967945} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: Skirt22_R + parentName: Skirt21_R + position: {x: 0.000000038146972, y: 0, z: -0.0790262} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: Character1_LeftUpLeg + parentName: Character1_Hips + position: {x: -0.09838927, y: 0.0002046585, z: -0.06464721} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: Character1_LeftLeg + parentName: Character1_LeftUpLeg + position: {x: -0, y: 0.021834202, z: -0.15186352} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: Character1_LeftFoot + parentName: Character1_LeftLeg + position: {x: -0, y: 0.03391635, z: -0.16433224} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: Character1_LeftToeBase + parentName: Character1_LeftFoot + position: {x: -0.00009206772, y: -0.044022497, z: -0.041161656} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: J_L_knee + parentName: Character1_LeftLeg + position: {x: -0, y: 0.00028729916, z: -0.0016981125} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: Character1_RightUpLeg + parentName: Character1_Hips + position: {x: 0.09838916, y: 0.0002045536, z: -0.06464706} + rotation: {x: 0.0000000050956612, y: -0.00002997581, z: 0.00016999245, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: Character1_RightLeg + parentName: Character1_RightUpLeg + position: {x: -0, y: 0.02183431, z: -0.1518638} + rotation: {x: 8.881784e-16, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: Character1_RightFoot + parentName: Character1_RightLeg + position: {x: -0, y: 0.033916343, z: -0.16433214} + rotation: {x: -0.00000000509566, y: 0.000029975812, z: -0.00016999245, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: Character1_RightToeBase + parentName: Character1_RightFoot + position: {x: 0.00009202957, y: -0.044022463, z: -0.041161664} + rotation: {x: 0, y: 0, z: 6.1098625e-13, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: J_R_knee + parentName: Character1_RightUpLeg + position: {x: -0, y: 0.022121582, z: -0.15356168} + rotation: {x: 0.0000000025893838, y: 0.000000009194991, z: 0.0000000023283064, + w: 1} + scale: {x: 1, y: 1, z: 1} + - name: utc_head + parentName: Utc_sum_humanoid(Clone) + position: {x: -0, y: 0, z: 0} + rotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071068} + scale: {x: 1, y: 1, z: 1} + - name: utc_Fhair + parentName: Utc_sum_humanoid(Clone) + position: {x: -0, y: 0, z: 0} + rotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071068} + scale: {x: 1, y: 1, z: 1} + - name: utc_eye + parentName: Utc_sum_humanoid(Clone) + position: {x: -0, y: 0, z: 0} + rotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071068} + scale: {x: 1, y: 1, z: 1} + - name: utc_Fhair2 + parentName: Utc_sum_humanoid(Clone) + position: {x: -0, y: 0, z: 0} + rotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071068} + scale: {x: 1, y: 1, z: 1} + - name: _body_summer + parentName: Utc_sum_humanoid(Clone) + position: {x: -0, y: 0, z: 0} + rotation: {x: -0.7071068, y: 0, z: -0, w: 0.7071068} + scale: {x: 1, y: 1, z: 1} + armTwist: 0.5 + foreArmTwist: 0.5 + upperLegTwist: 0.5 + legTwist: 0.5 + armStretch: 0.05 + legStretch: 0.05 + feetSpacing: 0 + globalScale: 1 + rootMotionBoneName: + hasTranslationDoF: 0 + hasExtraRoot: 1 + skeletonHasParents: 1 + lastHumanDescriptionAvatarSource: {instanceID: 0} + autoGenerateAvatarMappingIfUnspecified: 1 + animationType: 3 + humanoidOversampling: 1 + avatarSetup: 1 + addHumanoidExtraRootOnlyWhenUsingAvatar: 1 + remapMaterialsIfMaterialImportModeIsNone: 0 + additionalBone: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/SD_Kohaku_chanz/Utc_sum_humanoid.fbx + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0.meta new file mode 100644 index 00000000..0299acde --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 47c03d36119db17499adc298abd98858 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/English.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/English.meta new file mode 100644 index 00000000..1932952b --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/English.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8c8a0c5fda6952146b147b03cd881920 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/English/01Unity-Chan License Terms and Condition_EN_UCL2.0.pdf b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/English/01Unity-Chan License Terms and Condition_EN_UCL2.0.pdf new file mode 100644 index 00000000..ba976875 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/English/01Unity-Chan License Terms and Condition_EN_UCL2.0.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cddf37e09b03fefb43f659932b6035078cadc2b38c52ea08f3b15fcd25b929e6 +size 80324 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/English/01Unity-Chan License Terms and Condition_EN_UCL2.0.pdf.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/English/01Unity-Chan License Terms and Condition_EN_UCL2.0.pdf.meta new file mode 100644 index 00000000..f8d2dca7 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/English/01Unity-Chan License Terms and Condition_EN_UCL2.0.pdf.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: e1a0622442b06c949aaca91bb8151c74 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/English/01Unity-Chan + License Terms and Condition_EN_UCL2.0.pdf + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/English/02Unity-Chan License Terms and Condition_Summary_EN_UCL2.0.pdf b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/English/02Unity-Chan License Terms and Condition_Summary_EN_UCL2.0.pdf new file mode 100644 index 00000000..3506e235 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/English/02Unity-Chan License Terms and Condition_Summary_EN_UCL2.0.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4d36e4b0b89737f22153f66dda501c589f0fe4c9e0071146059f129563bb77f5 +size 136809 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/English/02Unity-Chan License Terms and Condition_Summary_EN_UCL2.0.pdf.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/English/02Unity-Chan License Terms and Condition_Summary_EN_UCL2.0.pdf.meta new file mode 100644 index 00000000..44d0c157 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/English/02Unity-Chan License Terms and Condition_Summary_EN_UCL2.0.pdf.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: e534652dc977c9848b6c4c54586507c4 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/English/02Unity-Chan + License Terms and Condition_Summary_EN_UCL2.0.pdf + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/English/03Indication of License_EN_UCL2.0.pdf b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/English/03Indication of License_EN_UCL2.0.pdf new file mode 100644 index 00000000..36cc6296 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/English/03Indication of License_EN_UCL2.0.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8979542ada869149067e2452c964931f56a34929659b5a2ac7c42e40f09226ac +size 138089 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/English/03Indication of License_EN_UCL2.0.pdf.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/English/03Indication of License_EN_UCL2.0.pdf.meta new file mode 100644 index 00000000..9225482e --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/English/03Indication of License_EN_UCL2.0.pdf.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: a6382741dc950ac40a8170412014620a +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/English/03Indication + of License_EN_UCL2.0.pdf + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/Japanese.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/Japanese.meta new file mode 100644 index 00000000..94a6656a --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/Japanese.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a8dc8df451dda2c47ba136a8f8c09e11 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/Japanese/01Unity-Chan License Terms and Condition_JP_UCL2.0.pdf b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/Japanese/01Unity-Chan License Terms and Condition_JP_UCL2.0.pdf new file mode 100644 index 00000000..8e207e09 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/Japanese/01Unity-Chan License Terms and Condition_JP_UCL2.0.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8f0005b9e84c73e803f7d32b216d5318970fd32e8545183a9b13c9afb4303d8e +size 130507 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/Japanese/01Unity-Chan License Terms and Condition_JP_UCL2.0.pdf.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/Japanese/01Unity-Chan License Terms and Condition_JP_UCL2.0.pdf.meta new file mode 100644 index 00000000..e31c0e48 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/Japanese/01Unity-Chan License Terms and Condition_JP_UCL2.0.pdf.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 8dc3224c2a02525478fb6fe5cc1a4b56 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/Japanese/01Unity-Chan + License Terms and Condition_JP_UCL2.0.pdf + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/Japanese/02Unity-Chan License Terms and Condition_Summary_JP_UCL2.0.pdf b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/Japanese/02Unity-Chan License Terms and Condition_Summary_JP_UCL2.0.pdf new file mode 100644 index 00000000..8fcf5e6f --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/Japanese/02Unity-Chan License Terms and Condition_Summary_JP_UCL2.0.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b384fd009be74be506bd44c7c9cde335cdab775ed41641011b4cf827b4746ef3 +size 162142 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/Japanese/02Unity-Chan License Terms and Condition_Summary_JP_UCL2.0.pdf.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/Japanese/02Unity-Chan License Terms and Condition_Summary_JP_UCL2.0.pdf.meta new file mode 100644 index 00000000..001bb8ed --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/Japanese/02Unity-Chan License Terms and Condition_Summary_JP_UCL2.0.pdf.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 5cd0c7ea8d999e94e916266891ae8e1b +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/Japanese/02Unity-Chan + License Terms and Condition_Summary_JP_UCL2.0.pdf + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/Japanese/03Indication of License_JP_UCL2.0.pdf b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/Japanese/03Indication of License_JP_UCL2.0.pdf new file mode 100644 index 00000000..2d3e9d81 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/Japanese/03Indication of License_JP_UCL2.0.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aae2bb2fb1560166e6bd0dc3655844d6f9c19012dd62a8aea2cc67372ac81703 +size 139414 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/Japanese/03Indication of License_JP_UCL2.0.pdf.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/Japanese/03Indication of License_JP_UCL2.0.pdf.meta new file mode 100644 index 00000000..74b3925d --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/Japanese/03Indication of License_JP_UCL2.0.pdf.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: e6d5edea9833d1f4d8b0ee91b8c75fca +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/Japanese/03Indication + of License_JP_UCL2.0.pdf + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo.meta new file mode 100644 index 00000000..43c02ac9 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6312541dd95342f499d6cc3ab68a2a19 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/LUUL_LOGO_rules02.ai b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/LUUL_LOGO_rules02.ai new file mode 100644 index 00000000..7cebee47 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/LUUL_LOGO_rules02.ai @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:29e3496972cbf7427bb73f5aa29ad33ac76e145eab947f969f606ab2f0e5b1d3 +size 203502 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/LUUL_LOGO_rules02.ai.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/LUUL_LOGO_rules02.ai.meta new file mode 100644 index 00000000..561791a5 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/LUUL_LOGO_rules02.ai.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 1617c1395163ac64bae61a3ff56a3bcf +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License + Logo/LUUL_LOGO_rules02.ai + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/LUUL_LOGO_rules02.psd b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/LUUL_LOGO_rules02.psd new file mode 100644 index 00000000..87a5f3dc --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/LUUL_LOGO_rules02.psd @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:79bf93338777bcd70b3fe49367c8676626b651c300c98b7188a65ab29e51eced +size 390557 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/LUUL_LOGO_rules02.psd.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/LUUL_LOGO_rules02.psd.meta new file mode 100644 index 00000000..c0abdb4e --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/LUUL_LOGO_rules02.psd.meta @@ -0,0 +1,143 @@ +fileFormatVersion: 2 +guid: 06a4adb20e6561b4a9e89e59f9722b6b +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License + Logo/LUUL_LOGO_rules02.psd + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/LUUL_logo-guideline.pdf b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/LUUL_logo-guideline.pdf new file mode 100644 index 00000000..f7ca742f --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/LUUL_logo-guideline.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3ff94c47d633f8b8b13ec34633c90570b014b2a25f32bef79449ebd6c04b24dd +size 2444810 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/LUUL_logo-guideline.pdf.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/LUUL_logo-guideline.pdf.meta new file mode 100644 index 00000000..f29705b6 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/LUUL_logo-guideline.pdf.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 12e168b41c4c4aa4f814e627039cf805 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License + Logo/LUUL_logo-guideline.pdf + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/LUUL_logo-guideline_en.pdf b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/LUUL_logo-guideline_en.pdf new file mode 100644 index 00000000..919e4844 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/LUUL_logo-guideline_en.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:670599e9287b3b325ae177e7b82f4d1a792dd239fb065c27acbb430222f96281 +size 3229950 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/LUUL_logo-guideline_en.pdf.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/LUUL_logo-guideline_en.pdf.meta new file mode 100644 index 00000000..a5a7c45d --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/LUUL_logo-guideline_en.pdf.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 8749e0bd2469ebf45b4b27bc3492eca5 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License + Logo/LUUL_logo-guideline_en.pdf + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others.meta new file mode 100644 index 00000000..2306d963 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 503574da3b90e8c49a6727c11d6ab22f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/jpg.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/jpg.meta new file mode 100644 index 00000000..2371b4cd --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/jpg.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d829eb4a497a68c49a76e37c06e4ab72 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/jpg/Dark_Silhouette.jpg b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/jpg/Dark_Silhouette.jpg new file mode 100644 index 00000000..98333928 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/jpg/Dark_Silhouette.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9d9dfccc7f5e239ce865ebd4a3b002696536af7ec0b6ad734084047f08a1c32f +size 13704 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/jpg/Dark_Silhouette.jpg.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/jpg/Dark_Silhouette.jpg.meta new file mode 100644 index 00000000..71810ebf --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/jpg/Dark_Silhouette.jpg.meta @@ -0,0 +1,143 @@ +fileFormatVersion: 2 +guid: 497d11b1c639389469a4e171337e4c33 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License + Logo/Others/jpg/Dark_Silhouette.jpg + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/jpg/Light_Silhouette.jpg b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/jpg/Light_Silhouette.jpg new file mode 100644 index 00000000..c995e594 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/jpg/Light_Silhouette.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6e512059ffc94c07f8b6ade9ef17ee53308d558819679a9d4e39008d0e802f51 +size 13700 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/jpg/Light_Silhouette.jpg.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/jpg/Light_Silhouette.jpg.meta new file mode 100644 index 00000000..d866c24e --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/jpg/Light_Silhouette.jpg.meta @@ -0,0 +1,143 @@ +fileFormatVersion: 2 +guid: bac27a6732cd46a4bb51a28a3419820b +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License + Logo/Others/jpg/Light_Silhouette.jpg + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/png.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/png.meta new file mode 100644 index 00000000..6ba53431 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/png.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: cf8a994e76d5df04e978a66a2a1c945a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/png/Dark_Silhouette.png b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/png/Dark_Silhouette.png new file mode 100644 index 00000000..72dcbee6 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/png/Dark_Silhouette.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a6553d5a928b34067f40a7775218c88c26d61df750974c165cac873599697b80 +size 9251 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/png/Dark_Silhouette.png.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/png/Dark_Silhouette.png.meta new file mode 100644 index 00000000..fcba3027 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/png/Dark_Silhouette.png.meta @@ -0,0 +1,143 @@ +fileFormatVersion: 2 +guid: 6b5e4d02329861a47a0dc02fddd443fc +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License + Logo/Others/png/Dark_Silhouette.png + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/png/Light_Frame.png b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/png/Light_Frame.png new file mode 100644 index 00000000..a60cca31 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/png/Light_Frame.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e347a9f3d48a61a42a2b1d24da81cfe604a0595187c128f930ba1bc43618768d +size 12620 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/png/Light_Frame.png.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/png/Light_Frame.png.meta new file mode 100644 index 00000000..67bd29a1 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/png/Light_Frame.png.meta @@ -0,0 +1,143 @@ +fileFormatVersion: 2 +guid: 76d945996802d79408a971d78e8b6769 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License + Logo/Others/png/Light_Frame.png + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/png/Light_Silhouette.png b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/png/Light_Silhouette.png new file mode 100644 index 00000000..f2b3a630 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/png/Light_Silhouette.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e8d36c6c34c264a14a4bef08580b363ef0b2a12f0c69d28f9081ca065629e00c +size 9102 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/png/Light_Silhouette.png.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/png/Light_Silhouette.png.meta new file mode 100644 index 00000000..eefc89f8 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/png/Light_Silhouette.png.meta @@ -0,0 +1,143 @@ +fileFormatVersion: 2 +guid: 86eefddfd681aba4f8b1381d34f2d086 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License + Logo/Others/png/Light_Silhouette.png + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/svg.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/svg.meta new file mode 100644 index 00000000..13da16f6 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/svg.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 28c4ee9e1f450cb4689aa7de7a021340 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/svg/Dark_Silhouette.svg b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/svg/Dark_Silhouette.svg new file mode 100644 index 00000000..e6f2807c --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/svg/Dark_Silhouette.svg @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/svg/Dark_Silhouette.svg.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/svg/Dark_Silhouette.svg.meta new file mode 100644 index 00000000..131fc157 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/svg/Dark_Silhouette.svg.meta @@ -0,0 +1,61 @@ +fileFormatVersion: 2 +guid: 149180168381eb44d947d82ed4e54d91 +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License + Logo/Others/svg/Dark_Silhouette.svg + uploadId: 893596 +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 12408, guid: 0000000000000000e000000000000000, type: 0} + svgType: 3 + texturedSpriteMeshType: 0 + svgPixelsPerUnit: 100 + gradientResolution: 64 + alignment: 0 + customPivot: {x: 0, y: 0} + generatePhysicsShape: 0 + viewportOptions: 0 + preserveViewport: 0 + advancedMode: 0 + tessellationMode: 1 + predefinedResolutionIndex: 1 + targetResolution: 1080 + resolutionMultiplier: 1 + stepDistance: 10 + samplingStepDistance: 100 + maxCordDeviationEnabled: 0 + maxCordDeviation: 1 + maxTangentAngleEnabled: 0 + maxTangentAngle: 5 + keepTextureAspectRatio: 1 + textureSize: 256 + textureWidth: 256 + textureHeight: 256 + wrapMode: 0 + filterMode: 1 + sampleCount: 4 + preserveSVGImageAspect: 0 + useSVGPixelsPerUnit: 0 + spriteData: + TessellationDetail: 0 + SpriteName: + SpritePivot: {x: 0, y: 0} + SpriteAlignment: 0 + SpriteBorder: {x: 0, y: 0, z: 0, w: 0} + SpriteRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + SpriteID: + PhysicsOutlines: [] diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/svg/Light_Frame.svg b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/svg/Light_Frame.svg new file mode 100644 index 00000000..51aa48f9 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/svg/Light_Frame.svg @@ -0,0 +1,153 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/svg/Light_Frame.svg.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/svg/Light_Frame.svg.meta new file mode 100644 index 00000000..2212d309 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/svg/Light_Frame.svg.meta @@ -0,0 +1,61 @@ +fileFormatVersion: 2 +guid: 62e7de5702ca2f34bbe1af809b3ba3c4 +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License + Logo/Others/svg/Light_Frame.svg + uploadId: 893596 +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 12408, guid: 0000000000000000e000000000000000, type: 0} + svgType: 3 + texturedSpriteMeshType: 0 + svgPixelsPerUnit: 100 + gradientResolution: 64 + alignment: 0 + customPivot: {x: 0, y: 0} + generatePhysicsShape: 0 + viewportOptions: 0 + preserveViewport: 0 + advancedMode: 0 + tessellationMode: 1 + predefinedResolutionIndex: 1 + targetResolution: 1080 + resolutionMultiplier: 1 + stepDistance: 10 + samplingStepDistance: 100 + maxCordDeviationEnabled: 0 + maxCordDeviation: 1 + maxTangentAngleEnabled: 0 + maxTangentAngle: 5 + keepTextureAspectRatio: 1 + textureSize: 256 + textureWidth: 256 + textureHeight: 256 + wrapMode: 0 + filterMode: 1 + sampleCount: 4 + preserveSVGImageAspect: 0 + useSVGPixelsPerUnit: 0 + spriteData: + TessellationDetail: 0 + SpriteName: + SpritePivot: {x: 0, y: 0} + SpriteAlignment: 0 + SpriteBorder: {x: 0, y: 0, z: 0, w: 0} + SpriteRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + SpriteID: + PhysicsOutlines: [] diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/svg/Light_Silhouette.svg b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/svg/Light_Silhouette.svg new file mode 100644 index 00000000..7a4e5df1 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/svg/Light_Silhouette.svg @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/svg/Light_Silhouette.svg.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/svg/Light_Silhouette.svg.meta new file mode 100644 index 00000000..9822f9ac --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License Logo/Others/svg/Light_Silhouette.svg.meta @@ -0,0 +1,61 @@ +fileFormatVersion: 2 +guid: cfdb094a636fe3d4499b2563b44b02cb +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UCL2.0/License + Logo/Others/svg/Light_Silhouette.svg + uploadId: 893596 +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 12408, guid: 0000000000000000e000000000000000, type: 0} + svgType: 3 + texturedSpriteMeshType: 0 + svgPixelsPerUnit: 100 + gradientResolution: 64 + alignment: 0 + customPivot: {x: 0, y: 0} + generatePhysicsShape: 0 + viewportOptions: 0 + preserveViewport: 0 + advancedMode: 0 + tessellationMode: 1 + predefinedResolutionIndex: 1 + targetResolution: 1080 + resolutionMultiplier: 1 + stepDistance: 10 + samplingStepDistance: 100 + maxCordDeviationEnabled: 0 + maxCordDeviation: 1 + maxTangentAngleEnabled: 0 + maxTangentAngle: 5 + keepTextureAspectRatio: 1 + textureSize: 256 + textureWidth: 256 + textureHeight: 256 + wrapMode: 0 + filterMode: 1 + sampleCount: 4 + preserveSVGImageAspect: 0 + useSVGPixelsPerUnit: 0 + spriteData: + TessellationDetail: 0 + SpriteName: + SpritePivot: {x: 0, y: 0} + SpriteAlignment: 0 + SpriteBorder: {x: 0, y: 0, z: 0, w: 0} + SpriteRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 0 + height: 0 + SpriteID: + PhysicsOutlines: [] diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/Unity-Chan License.txt b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/Unity-Chan License.txt new file mode 100644 index 00000000..1fbf757b --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/Unity-Chan License.txt @@ -0,0 +1,18 @@ +- ƒĤƒ‹ƒ†‚£Ħ‚ƒ‚“ƒİ‚¤‚ğƒ³‚ıĞ¤„Ĥ + +“‚˘‚ğƒƒƒˆŻ€€ŽƒĤƒ‹ƒ†‚£Ħ‚ƒ‚“ƒİ‚¤‚ğƒ³‚ı€(https://unity-chan.com/contents/license_jp/)§ĉä›•‚ŒĤ„™€‚ +“‚˘‚ğƒƒƒˆ‚’”ċˆİ用•‚Œ‚‹ċ ´ċˆŻ€€Ž‚­ƒ£ƒİ‚Ż‚żƒĵċˆİ用‚Ĵ‚¤ƒ‰ƒİ‚¤ƒ³€(https://unity-chan.com/contents/guideline/)‚‚ä½µ›Ĥ”確èލ •„€‚ + + + +- "Unity-Chan" License Notice + +These contents are licensed under the "Unity-Chan" License Terms and Conditions (https://unity-chan.com/contents/license_en/). +You are allowed to use these contents only if you follow the Character Use Guidelines (https://unity-chan.com/contents/guideline_en/) +set by Unity Technologies Japan G.K, for the usage of its characters. + + + +Âİ Unity Technologies Japan/UCL + + diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/Unity-Chan License.txt.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/Unity-Chan License.txt.meta new file mode 100644 index 00000000..d4abe977 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/Unity-Chan License.txt.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: d113a5a2048656542ac2af56b09ec186 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/Unity-Chan License.txt + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA.meta new file mode 100644 index 00000000..f9e34730 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a80f50620f244964096eade0620fa59e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation.meta new file mode 100644 index 00000000..3fa6543c --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5e25e364af1d1754e9b3493961e9cc6f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation/RUN00_F.anim b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation/RUN00_F.anim new file mode 100644 index 00000000..6ae33e45 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation/RUN00_F.anim @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ec5187d084d6cfaea06084cd27748ae750bbbda84527d5d07b7d53fd676c00aa +size 2721173 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation/RUN00_F.anim.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation/RUN00_F.anim.meta new file mode 100644 index 00000000..d21ca2d5 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation/RUN00_F.anim.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: d57512b99bc2cc84f92c873f858d9714 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation/RUN00_F.anim + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation/UC01_001_UniteInTheSky -WA-.fbx b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation/UC01_001_UniteInTheSky -WA-.fbx new file mode 100644 index 00000000..5335153a --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation/UC01_001_UniteInTheSky -WA-.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:587ae56d783c5e7b4e2957853d20f4a0e804c6c22d3e43dd39db52ed1f68ed46 +size 31696400 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation/UC01_001_UniteInTheSky -WA-.fbx.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation/UC01_001_UniteInTheSky -WA-.fbx.meta new file mode 100644 index 00000000..a7ff7699 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation/UC01_001_UniteInTheSky -WA-.fbx.meta @@ -0,0 +1,1149 @@ +fileFormatVersion: 2 +guid: 6f7e0371a1f07ea49b5d6fe4d634ae6c +ModelImporter: + serializedVersion: 21300 + internalIDToNameTable: + - first: + 1: 100000 + second: CH_Chest + - first: + 1: 100002 + second: CH_FingerIn0_L + - first: + 1: 100004 + second: CH_FingerIn0_R + - first: + 1: 100006 + second: CH_FingerIn1_L + - first: + 1: 100008 + second: CH_FingerIn1_R + - first: + 1: 100010 + second: CH_FingerIn2_L + - first: + 1: 100012 + second: CH_FingerIn2_R + - first: + 1: 100014 + second: CH_FingerMid0_L + - first: + 1: 100016 + second: CH_FingerMid0_R + - first: + 1: 100018 + second: CH_FingerMid1_L + - first: + 1: 100020 + second: CH_FingerMid1_R + - first: + 1: 100022 + second: CH_FingerMid2_L + - first: + 1: 100024 + second: CH_FingerMid2_R + - first: + 1: 100026 + second: CH_FingerP0_L + - first: + 1: 100028 + second: CH_FingerP0_R + - first: + 1: 100030 + second: CH_FingerP1_L + - first: + 1: 100032 + second: CH_FingerP1_R + - first: + 1: 100034 + second: CH_FingerP2_L + - first: + 1: 100036 + second: CH_FingerP2_R + - first: + 1: 100038 + second: CH_FingerR0_L + - first: + 1: 100040 + second: CH_FingerR0_R + - first: + 1: 100042 + second: CH_FingerR1_L + - first: + 1: 100044 + second: CH_FingerR1_R + - first: + 1: 100046 + second: CH_FingerR2_L + - first: + 1: 100048 + second: CH_FingerR2_R + - first: + 1: 100050 + second: CH_FingerTh0_L + - first: + 1: 100052 + second: CH_FingerTh0_R + - first: + 1: 100054 + second: CH_FingerTh1_L + - first: + 1: 100056 + second: CH_FingerTh1_R + - first: + 1: 100058 + second: CH_FingerTh2_L + - first: + 1: 100060 + second: CH_FingerTh2_R + - first: + 1: 100062 + second: CH_Foot_L + - first: + 1: 100064 + second: CH_Foot_R + - first: + 1: 100066 + second: CH_For_L + - first: + 1: 100068 + second: CH_For_R + - first: + 1: 100070 + second: CH_Hand_L + - first: + 1: 100072 + second: CH_Hand_R + - first: + 1: 100074 + second: CH_Head + - first: + 1: 100076 + second: CH_Hips + - first: + 1: 100078 + second: CH_Neck + - first: + 1: 100080 + second: CH_Shin_L + - first: + 1: 100082 + second: CH_Shin_R + - first: + 1: 100084 + second: CH_Shou_L + - first: + 1: 100086 + second: CH_Shou_R + - first: + 1: 100088 + second: CH_Spine + - first: + 1: 100090 + second: CH_Thigh_L + - first: + 1: 100092 + second: CH_Thigh_R + - first: + 1: 100094 + second: CH_Uppe_L + - first: + 1: 100096 + second: CH_Uppe_R + - first: + 1: 100098 + second: //RootNode + - first: + 4: 400000 + second: CH_Chest + - first: + 4: 400002 + second: CH_FingerIn0_L + - first: + 4: 400004 + second: CH_FingerIn0_R + - first: + 4: 400006 + second: CH_FingerIn1_L + - first: + 4: 400008 + second: CH_FingerIn1_R + - first: + 4: 400010 + second: CH_FingerIn2_L + - first: + 4: 400012 + second: CH_FingerIn2_R + - first: + 4: 400014 + second: CH_FingerMid0_L + - first: + 4: 400016 + second: CH_FingerMid0_R + - first: + 4: 400018 + second: CH_FingerMid1_L + - first: + 4: 400020 + second: CH_FingerMid1_R + - first: + 4: 400022 + second: CH_FingerMid2_L + - first: + 4: 400024 + second: CH_FingerMid2_R + - first: + 4: 400026 + second: CH_FingerP0_L + - first: + 4: 400028 + second: CH_FingerP0_R + - first: + 4: 400030 + second: CH_FingerP1_L + - first: + 4: 400032 + second: CH_FingerP1_R + - first: + 4: 400034 + second: CH_FingerP2_L + - first: + 4: 400036 + second: CH_FingerP2_R + - first: + 4: 400038 + second: CH_FingerR0_L + - first: + 4: 400040 + second: CH_FingerR0_R + - first: + 4: 400042 + second: CH_FingerR1_L + - first: + 4: 400044 + second: CH_FingerR1_R + - first: + 4: 400046 + second: CH_FingerR2_L + - first: + 4: 400048 + second: CH_FingerR2_R + - first: + 4: 400050 + second: CH_FingerTh0_L + - first: + 4: 400052 + second: CH_FingerTh0_R + - first: + 4: 400054 + second: CH_FingerTh1_L + - first: + 4: 400056 + second: CH_FingerTh1_R + - first: + 4: 400058 + second: CH_FingerTh2_L + - first: + 4: 400060 + second: CH_FingerTh2_R + - first: + 4: 400062 + second: CH_Foot_L + - first: + 4: 400064 + second: CH_Foot_R + - first: + 4: 400066 + second: CH_For_L + - first: + 4: 400068 + second: CH_For_R + - first: + 4: 400070 + second: CH_Hand_L + - first: + 4: 400072 + second: CH_Hand_R + - first: + 4: 400074 + second: CH_Head + - first: + 4: 400076 + second: CH_Hips + - first: + 4: 400078 + second: CH_Neck + - first: + 4: 400080 + second: CH_Shin_L + - first: + 4: 400082 + second: CH_Shin_R + - first: + 4: 400084 + second: CH_Shou_L + - first: + 4: 400086 + second: CH_Shou_R + - first: + 4: 400088 + second: CH_Spine + - first: + 4: 400090 + second: CH_Thigh_L + - first: + 4: 400092 + second: CH_Thigh_R + - first: + 4: 400094 + second: CH_Uppe_L + - first: + 4: 400096 + second: CH_Uppe_R + - first: + 4: 400098 + second: //RootNode + - first: + 74: 7400000 + second: UC01_001_JAK01_003 + - first: + 95: 9500000 + second: //RootNode + externalObjects: {} + materials: + materialImportMode: 1 + materialName: 0 + materialSearch: 1 + materialLocation: 1 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + resampleCurves: 1 + optimizeGameObjects: 0 + removeConstantScaleCurves: 0 + motionNodeName: + rigImportErrors: + rigImportWarnings: + animationImportErrors: + animationImportWarnings: + animationRetargetingWarnings: + animationDoRetargetingWarnings: 0 + importAnimatedCustomProperties: 0 + importConstraints: 0 + animationCompression: 3 + animationRotationError: 0.5 + animationPositionError: 0.5 + animationScaleError: 0.5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + extraUserProperties: [] + clipAnimations: + - serializedVersion: 16 + name: UC01_001_JAK01_003 + takeName: UC01_001_JAK01_003 + internalID: 0 + firstFrame: 0 + lastFrame: 8628 + wrapMode: 0 + orientationOffsetY: 0 + level: 0 + cycleOffset: 0 + loop: 0 + hasAdditiveReferencePose: 0 + loopTime: 1 + loopBlend: 0 + loopBlendOrientation: 1 + loopBlendPositionY: 1 + loopBlendPositionXZ: 1 + keepOriginalOrientation: 0 + keepOriginalPositionY: 1 + keepOriginalPositionXZ: 0 + heightFromFeet: 0 + mirror: 0 + bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000 + curves: [] + events: [] + transformMask: [] + maskType: 3 + maskSource: {instanceID: 0} + additiveReferencePoseFrame: 0 + - serializedVersion: 16 + name: UC01_001_JAK01_003 (short) + takeName: UC01_001_JAK01_003 + internalID: -6150270346426837497 + firstFrame: 904 + lastFrame: 6104 + wrapMode: 0 + orientationOffsetY: 0 + level: 0 + cycleOffset: 0 + loop: 0 + hasAdditiveReferencePose: 0 + loopTime: 1 + loopBlend: 0 + loopBlendOrientation: 1 + loopBlendPositionY: 1 + loopBlendPositionXZ: 0 + keepOriginalOrientation: 0 + keepOriginalPositionY: 1 + keepOriginalPositionXZ: 0 + heightFromFeet: 0 + mirror: 0 + bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000 + curves: [] + events: [] + transformMask: [] + maskType: 3 + maskSource: {instanceID: 0} + additiveReferencePoseFrame: 0 + - serializedVersion: 16 + name: UC01_001_INIT_POSE + takeName: UC01_001_JAK01_003 + internalID: 5322403403441133380 + firstFrame: 0 + lastFrame: 33 + wrapMode: 0 + orientationOffsetY: 0 + level: 0 + cycleOffset: 0 + loop: 0 + hasAdditiveReferencePose: 0 + loopTime: 1 + loopBlend: 1 + loopBlendOrientation: 1 + loopBlendPositionY: 1 + loopBlendPositionXZ: 0 + keepOriginalOrientation: 0 + keepOriginalPositionY: 1 + keepOriginalPositionXZ: 0 + heightFromFeet: 0 + mirror: 0 + bodyMask: 01000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000 + curves: [] + events: [] + transformMask: [] + maskType: 3 + maskSource: {instanceID: 0} + additiveReferencePoseFrame: 0 + isReadable: 1 + meshes: + lODScreenPercentages: [] + globalScale: 1 + meshCompression: 0 + addColliders: 0 + useSRGBMaterialColor: 1 + sortHierarchyByName: 1 + importVisibility: 1 + importBlendShapes: 1 + importCameras: 1 + importLights: 1 + nodeNameCollisionStrategy: 0 + fileIdsGeneration: 1 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + keepQuads: 0 + weldVertices: 1 + bakeAxisConversion: 0 + preserveHierarchy: 0 + skinWeightsMode: 0 + maxBonesPerVertex: 4 + minBoneWeight: 0.001 + optimizeBones: 1 + meshOptimizationFlags: -1 + indexFormat: 0 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVMarginMethod: 1 + secondaryUVMinLightmapResolution: 40 + secondaryUVMinObjectScale: 1 + secondaryUVPackMargin: 4 + useFileScale: 1 + tangentSpace: + normalSmoothAngle: 60 + normalImportMode: 0 + tangentImportMode: 3 + normalCalculationMode: 4 + legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0 + blendShapeNormalImportMode: 1 + normalSmoothingSource: 0 + referencedClips: [] + importAnimation: 1 + humanDescription: + serializedVersion: 3 + human: + - boneName: CH_Hips + humanName: Hips + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_Thigh_L + humanName: LeftUpperLeg + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_Thigh_R + humanName: RightUpperLeg + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_Shin_L + humanName: LeftLowerLeg + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_Shin_R + humanName: RightLowerLeg + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_Foot_L + humanName: LeftFoot + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_Foot_R + humanName: RightFoot + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_Spine + humanName: Spine + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_Chest + humanName: Chest + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_Neck + humanName: Neck + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_Head + humanName: Head + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_Shou_L + humanName: LeftShoulder + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_Shou_R + humanName: RightShoulder + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_Uppe_L + humanName: LeftUpperArm + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_Uppe_R + humanName: RightUpperArm + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_For_L + humanName: LeftLowerArm + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_For_R + humanName: RightLowerArm + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_Hand_L + humanName: LeftHand + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_Hand_R + humanName: RightHand + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerTh0_L + humanName: Left Thumb Proximal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerTh1_L + humanName: Left Thumb Intermediate + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerTh2_L + humanName: Left Thumb Distal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerIn0_L + humanName: Left Index Proximal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerIn1_L + humanName: Left Index Intermediate + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerIn2_L + humanName: Left Index Distal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerMid0_L + humanName: Left Middle Proximal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerMid1_L + humanName: Left Middle Intermediate + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerMid2_L + humanName: Left Middle Distal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerR0_L + humanName: Left Ring Proximal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerR1_L + humanName: Left Ring Intermediate + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerR2_L + humanName: Left Ring Distal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerP0_L + humanName: Left Little Proximal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerP1_L + humanName: Left Little Intermediate + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerP2_L + humanName: Left Little Distal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerTh0_R + humanName: Right Thumb Proximal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerTh1_R + humanName: Right Thumb Intermediate + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerTh2_R + humanName: Right Thumb Distal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerIn0_R + humanName: Right Index Proximal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerIn1_R + humanName: Right Index Intermediate + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerIn2_R + humanName: Right Index Distal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerMid0_R + humanName: Right Middle Proximal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerMid1_R + humanName: Right Middle Intermediate + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerMid2_R + humanName: Right Middle Distal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerR0_R + humanName: Right Ring Proximal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerR1_R + humanName: Right Ring Intermediate + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerR2_R + humanName: Right Ring Distal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerP0_R + humanName: Right Little Proximal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerP1_R + humanName: Right Little Intermediate + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerP2_R + humanName: Right Little Distal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + skeleton: + - name: UC01_001_UniteInTheSky(Clone) + parentName: + position: {x: -0, y: 0, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: CH_Hips + parentName: UC01_001_UniteInTheSky(Clone) + position: {x: -0.000072773546, y: 0.8797906, z: 0.070019096} + rotation: {x: 0.008795875, y: 0.02702195, z: 0.0010814383, w: 0.9995956} + scale: {x: 1, y: 1, z: 1} + - name: CH_Spine + parentName: CH_Hips + position: {x: 1.4901161e-10, y: 0.05238224, z: 0.003530197} + rotation: {x: -0.008975765, y: -0.0030821536, z: -0.0014939619, w: 0.99995387} + scale: {x: 1, y: 1.0000005, z: 1.0000005} + - name: CH_Chest + parentName: CH_Spine + position: {x: -1.862645e-10, y: 0.16491231, z: 0.006577148} + rotation: {x: 0.01025283, y: -0.00003700082, z: -0.009826875, w: 0.99989915} + scale: {x: 1, y: 0.99999976, z: 0.99999976} + - name: CH_Neck + parentName: CH_Chest + position: {x: -0.0000000013783574, y: 0.24534911, z: -0.035706326} + rotation: {x: -0.019598613, y: -0.0015617736, z: -0.0032422806, w: 0.99980146} + scale: {x: 1, y: 1.0000005, z: 1.0000005} + - name: CH_Head + parentName: CH_Neck + position: {x: -3.0527952e-10, y: 0.0970388, z: -0.0062348065} + rotation: {x: 0.04305692, y: -0.0057739904, z: 0.006471334, w: 0.999035} + scale: {x: 1, y: 0.99999994, z: 0.99999994} + - name: CH_Shou_L + parentName: CH_Chest + position: {x: -0.012281969, y: 0.23065636, z: -0.023482818} + rotation: {x: -0.058675427, y: -0.049061775, z: -0.14489128, w: 0.98648703} + scale: {x: 1, y: 1.0000002, z: 1.0000002} + - name: CH_Uppe_L + parentName: CH_Shou_L + position: {x: -0.10911131, y: -0.0052890014, z: -0.00843935} + rotation: {x: -0.091201335, y: -0.009756492, z: 0.13481009, w: 0.98661715} + scale: {x: 1.0000006, y: 1.0000001, z: 1.0000007} + - name: CH_For_L + parentName: CH_Uppe_L + position: {x: -0.24872932, y: -0.0068639717, z: 0.006644745} + rotation: {x: 0.06885329, y: 0.033358697, z: 0.067166924, w: 0.994804} + scale: {x: 0.9999993, y: 1.0000004, z: 0.99999905} + - name: CH_Hand_L + parentName: CH_For_L + position: {x: -0.21798706, y: 0.0024363708, z: -0.001611715} + rotation: {x: 0.055273533, y: 0.022377921, z: 0.00855618, w: 0.9981838} + scale: {x: 1.0000005, y: 0.9999999, z: 1.0000001} + - name: CH_FingerIn0_L + parentName: CH_Hand_L + position: {x: -0.06406102, y: 0.007037311, z: 0.030024793} + rotation: {x: -0.0721098, y: 0.058076605, z: -0.020419743, w: 0.995495} + scale: {x: 0.9999995, y: 1.0000002, z: 0.9999999} + - name: CH_FingerIn1_L + parentName: CH_FingerIn0_L + position: {x: -0.03864456, y: 0.001219635, z: 0.000000026226044} + rotation: {x: -0.00000030174837, y: -0.0000016391269, z: 0.029626999, w: 0.9995611} + scale: {x: 1, y: 1, z: 0.99999994} + - name: CH_FingerIn2_L + parentName: CH_FingerIn1_L + position: {x: -0.019831618, y: 0.00048400878, z: 0.00000009298324} + rotation: {x: 0, y: 0, z: 0.20096508, w: 0.9795984} + scale: {x: 1.0000001, y: 1, z: 1.0000001} + - name: CH_FingerMid0_L + parentName: CH_Hand_L + position: {x: -0.06557449, y: 0.011041107, z: 0.008100586} + rotation: {x: 0.004228337, y: 0.037817065, z: -0.025989868, w: 0.9989377} + scale: {x: 0.99999994, y: 1.0000002, z: 0.99999964} + - name: CH_FingerMid1_L + parentName: CH_FingerMid0_L + position: {x: -0.041185796, y: -0.0007038879, z: -0.00014655113} + rotation: {x: 0.0007604414, y: 0.00058571255, z: 0.052795976, w: 0.99860483} + scale: {x: 1.0000001, y: 1.0000001, z: 1.0000001} + - name: CH_FingerMid2_L + parentName: CH_FingerMid1_L + position: {x: -0.021683998, y: 0.00048583985, z: -0.00010738373} + rotation: {x: 0, y: 0, z: 0.22624305, w: 0.9740709} + scale: {x: 1, y: 0.9999997, z: 0.99999994} + - name: CH_FingerP0_L + parentName: CH_Hand_L + position: {x: -0.052998427, y: 0.004468918, z: -0.02733322} + rotation: {x: -0.01587042, y: 0.05055333, z: -0.03912815, w: 0.99782836} + scale: {x: 0.99999976, y: 0.9999999, z: 1.0000001} + - name: CH_FingerP1_L + parentName: CH_FingerP0_L + position: {x: -0.030735435, y: -0.0015520477, z: 0} + rotation: {x: -0.00000013969839, y: -0.0000012814999, z: 0.07282637, w: 0.99734473} + scale: {x: 1.0000006, y: 1.0000002, z: 1.0000005} + - name: CH_FingerP2_L + parentName: CH_FingerP1_L + position: {x: -0.016274987, y: 0.00048400878, z: 0} + rotation: {x: 0, y: 0, z: 0.25102088, w: 0.9679817} + scale: {x: 1.0000002, y: 1.0000002, z: 1.0000001} + - name: CH_FingerR0_L + parentName: CH_Hand_L + position: {x: -0.06365898, y: 0.01094162, z: -0.011445865} + rotation: {x: -0.0060580475, y: 0.043660592, z: -0.030851023, w: 0.99855167} + scale: {x: 0.99999994, y: 1.0000002, z: 1.0000002} + - name: CH_FingerR1_L + parentName: CH_FingerR0_L + position: {x: -0.037883833, y: -0.0011924744, z: -0.000000038146972} + rotation: {x: 0.0000004996544, y: 0.0000019446009, z: 0.04791813, w: 0.9988513} + scale: {x: 0.9999999, y: 1.0000001, z: 1.0000001} + - name: CH_FingerR2_L + parentName: CH_FingerR1_L + position: {x: -0.019339943, y: -0.00000015258789, z: -0.000000076293944} + rotation: {x: 0, y: 0, z: 0.23865104, w: 0.9711054} + scale: {x: 1, y: 1.0000001, z: 1} + - name: CH_FingerTh0_L + parentName: CH_Hand_L + position: {x: -0.0064083505, y: -0.012739102, z: 0.020647034} + rotation: {x: 0.6994364, y: 0.252594, z: -0.32049552, w: 0.58674324} + scale: {x: 0.9999998, y: 1.0000002, z: 1} + - name: CH_FingerTh1_L + parentName: CH_FingerTh0_L + position: {x: -0.04057995, y: -0.0009107208, z: 0.0018043518} + rotation: {x: -0.0037802155, y: 0.018734846, z: 0.062868975, w: 0.99783885} + scale: {x: 1.0000005, y: 0.99999994, z: 1.0000008} + - name: CH_FingerTh2_L + parentName: CH_FingerTh1_L + position: {x: -0.022210578, y: 0.0008297729, z: 0} + rotation: {x: 0, y: 0, z: 0.23422016, w: 0.9721836} + scale: {x: 0.99999994, y: 0.99999976, z: 1.0000005} + - name: CH_Shou_R + parentName: CH_Chest + position: {x: 0.012124489, y: 0.23065633, z: -0.0234831} + rotation: {x: -0.17077981, y: 0.98363066, z: -0.056415632, w: -0.011055562} + scale: {x: 1, y: 1.0000004, z: 1.0000004} + - name: CH_Uppe_R + parentName: CH_Shou_R + position: {x: -0.109111294, y: -0.0052891704, z: 0.008439026} + rotation: {x: 0.14516506, y: 0.04554295, z: 0.15130717, w: 0.9767083} + scale: {x: 0.99999976, y: 1.0000013, z: 1.0000002} + - name: CH_For_R + parentName: CH_Uppe_R + position: {x: -0.24872936, y: -0.006864166, z: -0.0066439817} + rotation: {x: -0.06835322, y: -0.014880213, z: 0.05765317, w: 0.9958828} + scale: {x: 0.99999994, y: 0.99999946, z: 0.9999995} + - name: CH_Hand_R + parentName: CH_For_R + position: {x: -0.21798724, y: 0.0024362183, z: 0.0016114789} + rotation: {x: -0.11417606, y: 0.015187072, z: -0.00067673635, w: 0.99334425} + scale: {x: 1.000001, y: 1.0000005, z: 1} + - name: CH_FingerIn0_R + parentName: CH_Hand_R + position: {x: -0.06406123, y: 0.0070372773, z: -0.030024713} + rotation: {x: 0.080078, y: -0.087642126, z: -0.015874794, w: 0.9928013} + scale: {x: 1, y: 1.0000002, z: 0.99999964} + - name: CH_FingerIn1_R + parentName: CH_FingerIn0_R + position: {x: -0.038644485, y: 0.0012197304, z: 0} + rotation: {x: 0.00000039488063, y: 0.0000023543826, z: 0.031828728, w: 0.99949336} + scale: {x: 0.99999976, y: 1.0000002, z: 1.0000001} + - name: CH_FingerIn2_R + parentName: CH_FingerIn1_R + position: {x: -0.019831695, y: 0.00048395872, z: -0.00000015258789} + rotation: {x: 0, y: 0, z: 0.15879549, w: 0.98731154} + scale: {x: 1.0000001, y: 0.9999999, z: 0.99999976} + - name: CH_FingerMid0_R + parentName: CH_Hand_R + position: {x: -0.065574415, y: 0.011041174, z: -0.008099975} + rotation: {x: 0.010693147, y: -0.04940608, z: -0.019562306, w: 0.99853003} + scale: {x: 0.9999994, y: 1.0000001, z: 0.99999917} + - name: CH_FingerMid1_R + parentName: CH_FingerMid0_R + position: {x: -0.041185685, y: -0.0007039541, z: 0.00014663696} + rotation: {x: -0.0005796822, y: -0.0005516259, z: 0.05480971, w: 0.9984965} + scale: {x: 0.99999994, y: 1.0000007, z: 1.0000002} + - name: CH_FingerMid2_R + parentName: CH_FingerMid1_R + position: {x: -0.02168396, y: 0.00048599957, z: 0.000107421874} + rotation: {x: 0, y: 0, z: 0.18801899, w: 0.9821654} + scale: {x: 0.99999964, y: 0.9999999, z: 1.0000001} + - name: CH_FingerP0_R + parentName: CH_Hand_R + position: {x: -0.052998427, y: 0.004468865, z: 0.027333297} + rotation: {x: 0.013489184, y: -0.0488795, z: -0.037809677, w: 0.99799764} + scale: {x: 1.0000005, y: 0.9999999, z: 0.9999995} + - name: CH_FingerP1_R + parentName: CH_FingerP0_R + position: {x: -0.030735472, y: -0.0015520048, z: 0} + rotation: {x: 0.00000070128584, y: 0.000003870576, z: 0.07462892, w: 0.99721146} + scale: {x: 1.0000001, y: 1.0000008, z: 1.0000004} + - name: CH_FingerP2_R + parentName: CH_FingerP1_R + position: {x: -0.016274948, y: 0.0004840374, z: -0.00000015258789} + rotation: {x: 0, y: 0, z: 0.21707165, w: 0.9761557} + scale: {x: 0.99999994, y: 1.0000007, z: 1.0000004} + - name: CH_FingerR0_R + parentName: CH_Hand_R + position: {x: -0.06365902, y: 0.010941544, z: 0.011445903} + rotation: {x: 0.012175316, y: -0.04851308, z: -0.02769646, w: 0.99836427} + scale: {x: 1.0000004, y: 1.0000001, z: 0.99999994} + - name: CH_FingerR1_R + parentName: CH_FingerR0_R + position: {x: -0.037883643, y: -0.0011924744, z: 0} + rotation: {x: 0.00000059138983, y: 0.0000035651026, z: 0.04982696, w: 0.9987579} + scale: {x: 0.9999999, y: 0.99999994, z: 1.0000001} + - name: CH_FingerR2_R + parentName: CH_FingerR1_R + position: {x: -0.01933979, y: -0.00000015258789, z: -0.00000015258789} + rotation: {x: 0, y: 0, z: 0.20256762, w: 0.9792683} + scale: {x: 1.0000002, y: 1.0000002, z: 1.0000001} + - name: CH_FingerTh0_R + parentName: CH_Hand_R + position: {x: -0.006407836, y: -0.012739294, z: -0.020646468} + rotation: {x: -0.6049892, y: -0.31676987, z: -0.31446207, w: 0.6593623} + scale: {x: 0.99999994, y: 1.0000002, z: 0.99999946} + - name: CH_FingerTh1_R + parentName: CH_FingerTh0_R + position: {x: -0.04057995, y: -0.00091072556, z: -0.0018042754} + rotation: {x: 0.004750162, y: -0.019504545, z: 0.060898073, w: 0.9979421} + scale: {x: 1.0000008, y: 0.9999999, z: 1.0000004} + - name: CH_FingerTh2_R + parentName: CH_FingerTh1_R + position: {x: -0.02221054, y: 0.0008296919, z: 0.00000022888183} + rotation: {x: 0, y: 0, z: 0.27279678, w: 0.9620717} + scale: {x: 1.0000012, y: 0.9999992, z: 1.0000001} + - name: CH_Thigh_L + parentName: CH_Hips + position: {x: -0.08826721, y: -0.014284587, z: 0.0023556517} + rotation: {x: 0.66444254, y: 0.025450764, z: 0.74656063, w: 0.022706961} + scale: {x: 1, y: 0.99999976, z: 0.9999996} + - name: CH_Shin_L + parentName: CH_Thigh_L + position: {x: -0.007925682, y: 0.36190096, z: 0.007466621} + rotation: {x: -0.05703204, y: -0.016010901, z: 0.09999778, w: 0.9932228} + scale: {x: 1.0000001, y: 1.0000005, z: 1.0000002} + - name: CH_Foot_L + parentName: CH_Shin_L + position: {x: 0.029875869, y: 0.38749614, z: 0.008091049} + rotation: {x: 0.046352614, y: 0.024369337, z: -0.31717333, w: 0.94692063} + scale: {x: 1.0000007, y: 0.9999995, z: 1.0000001} + - name: CH_Thigh_R + parentName: CH_Hips + position: {x: 0.08810974, y: -0.014284577, z: 0.0023555756} + rotation: {x: 0.74175715, y: 0.024268737, z: 0.67003995, w: 0.01593194} + scale: {x: 1, y: 0.9999999, z: 0.99999976} + - name: CH_Shin_R + parentName: CH_Thigh_R + position: {x: -0.007925891, y: 0.36190093, z: -0.007466888} + rotation: {x: 0.05868911, y: -0.0013824374, z: 0.08882158, w: 0.99431604} + scale: {x: 1.0000007, y: 1.0000005, z: 0.99999976} + - name: CH_Foot_R + parentName: CH_Shin_R + position: {x: 0.029875746, y: 0.38749602, z: -0.008090438} + rotation: {x: -0.03313012, y: -0.033069517, z: -0.31789255, w: 0.9469705} + scale: {x: 1.0000007, y: 1.0000004, z: 1.000001} + armTwist: 0.5 + foreArmTwist: 0.5 + upperLegTwist: 0.5 + legTwist: 0.5 + armStretch: 0.05 + legStretch: 0.05 + feetSpacing: 0 + globalScale: 1 + rootMotionBoneName: + hasTranslationDoF: 0 + hasExtraRoot: 0 + skeletonHasParents: 1 + lastHumanDescriptionAvatarSource: {instanceID: 0} + autoGenerateAvatarMappingIfUnspecified: 1 + animationType: 3 + humanoidOversampling: 1 + avatarSetup: 1 + addHumanoidExtraRootOnlyWhenUsingAvatar: 0 + remapMaterialsIfMaterialImportModeIsNone: 1 + additionalBone: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation/UC01_001_UniteInTheSky + -WA-.fbx + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation/WAIT02.anim b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation/WAIT02.anim new file mode 100644 index 00000000..cc2218c2 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation/WAIT02.anim @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7827af0acb04f7f5f6b8569a0fbc708dff4b0e381f031f8605bf3a607161333d +size 25064552 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation/WAIT02.anim.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation/WAIT02.anim.meta new file mode 100644 index 00000000..a6fadf25 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation/WAIT02.anim.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 2a7cc8d66d3c2fc46a54cbf3d95e3b2d +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation/WAIT02.anim + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation/WAIT04.anim b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation/WAIT04.anim new file mode 100644 index 00000000..54609b28 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation/WAIT04.anim @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ccd5c7d567c916601ee4d0e3d8506d44fdc4e4cd2b64d7a628283b3b0d2b5a30 +size 16168563 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation/WAIT04.anim.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation/WAIT04.anim.meta new file mode 100644 index 00000000..f3be5339 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation/WAIT04.anim.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 3a954c05a2f94004eaff3df94a45c3ed +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation/WAIT04.anim + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation/WALK00_F.anim b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation/WALK00_F.anim new file mode 100644 index 00000000..df75be74 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation/WALK00_F.anim @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:286cfc46c72ddda7671fdcba313066d07983320aff1729689c88df33779065a8 +size 4192184 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation/WALK00_F.anim.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation/WALK00_F.anim.meta new file mode 100644 index 00000000..b92b211a --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation/WALK00_F.anim.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: be35c3e99cdcca3439901f433aab54b2 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation/WALK00_F.anim + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation/WIN00.anim b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation/WIN00.anim new file mode 100644 index 00000000..7f487e5c --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation/WIN00.anim @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e46057c115918c40c09aba4424a69ff8582e34c3cefbfebc010ec0f743a9d2e8 +size 9027442 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation/WIN00.anim.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation/WIN00.anim.meta new file mode 100644 index 00000000..7a634ada --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation/WIN00.anim.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: b5c22dfc5073c0c4f8c6d57c904f221e +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 7400000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Animation/WIN00.anim + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials.meta new file mode 100644 index 00000000..eb9cb0bd --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5d11ee2c7b51931438dd5531964bf875 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Albedo.mat b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Albedo.mat new file mode 100644 index 00000000..bf1472c8 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Albedo.mat @@ -0,0 +1,83 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Albedo + m_Shader: {fileID: 4800000, guid: a3912d0e93a0b6f40b1f31f0bee7cac9, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: [] + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_LockedProperties: + 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_Ints: [] + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.09901475 + - _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.8, g: 0.8, b: 0.8, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 0} + m_BuildTextureStacks: [] diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Albedo.mat.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Albedo.mat.meta new file mode 100644 index 00000000..f7c1b078 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Albedo.mat.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 20a9ba0b540ef7841a222d3574fad507 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Albedo.mat + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Body Back.mat b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Body Back.mat new file mode 100644 index 00000000..3f7c374e --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Body Back.mat @@ -0,0 +1,405 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Body Back + m_Shader: {fileID: -6465566751694194690, guid: b969454d26657854a8fe82c813fb0876, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: + - _DISABLE_SSR_TRANSPARENT + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 2450 + stringTagMap: + IgnoreProjection: False + disabledShaderPasses: + - TransparentDepthPrepass + - TransparentDepthPostpass + - TransparentBackface + - RayTracingPrepass + - MOTIONVECTORS + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _1st_ShadeMap: + m_Texture: {fileID: 2800000, guid: f180dfef53ad0924882657e28833a60b, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _2nd_ShadeMap: + m_Texture: {fileID: 2800000, guid: 9cd90983043e3974e971a6c8d66cc42d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AngelRing_Sampler: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BakedNormal: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BaseMap: + m_Texture: {fileID: 2800000, guid: d6a0b548a02e12e4e954cb6c5bb20e70, 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} + - _ClippingMask: + 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} + - _Emissive_Tex: + m_Texture: {fileID: 2800000, guid: dc71d88ff73488f45ac239b21f552745, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _HighColor_Tex: + m_Texture: {fileID: 2800000, guid: a01adb17bdc53ba4da348b3cba074154, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main: + m_Texture: {fileID: 2800000, guid: d1e50199c6f08ed46bf2d136ab225409, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: d1e50199c6f08ed46bf2d136ab225409, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCap_Sampler: + 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} + - _NormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _NormalMapForMatCap: + 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} + - _OutlineTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Outline_Sampler: + 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} + - _Set_1st_ShadePosition: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Set_2nd_ShadePosition: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Set_HighColorMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Set_MatcapMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Set_RimLightMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadingGradeMap: + m_Texture: {fileID: 2800000, guid: 7c75a3dfe8927774ea56a0777d1edcf1, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _1st2nd_Shades_Feather: 0.776 + - _1st_ShadeColor_Feather: 0.335 + - _1st_ShadeColor_Step: 0.677 + - _2nd_ShadeColor_Feather: 0.776 + - _2nd_ShadeColor_Step: 0.618 + - _ARSampler_AlphaOn: 0 + - _AR_OffsetU: 0 + - _AR_OffsetV: 0.3 + - _AddPrecomputedVelocity: 0 + - _Add_Antipodean_RimLight: 0 + - _AlphaCutoffEnable: 0 + - _AlphaDstBlend: 0 + - _AlphaSrcBlend: 1 + - _AlphaToMask: 0 + - _AlphaToMaskInspectorValue: 0 + - _AngelRing: 0 + - _Ap_RimLight_FeatherOff: 0 + - _Ap_RimLight_Power: 0.1 + - _AutoRenderQueue: 1 + - _BUILTIN_QueueControl: 0 + - _BUILTIN_QueueOffset: 0 + - _BaseColor_Step: 0.677 + - _BaseShade_Feather: 0.335 + - _Base_Speed: 0 + - _BlendMode: 0 + - _BlurLevelMatcap: 0 + - _BlurLevelSGM: 0 + - _BumpScale: 1 + - _BumpScaleMatcap: 1 + - _CameraRolling_Stabilizer: 0 + - _ClippingMode: 0 + - _Clipping_Level: 0 + - _ColorBoost: 1 + - _ColorShift_Speed: 0 + - _ConservativeDepthOffsetEnable: 0 + - _CullMode: 1 + - _CullModeForward: 1 + - _Cutoff: 0.5 + - _DepthOffsetEnable: 0 + - _DetailNormalMapScale: 1 + - _DoubleSidedEnable: 0 + - _DoubleSidedGIMode: 0 + - _DoubleSidedNormalMode: 2 + - _DstBlend: 0 + - _EMISSIVE: 0 + - _EnableBlendModePreserveSpecularLighting: 1 + - _EnableFogOnTransparent: 1 + - _Farthest_Distance: 0 + - _GI_Intensity: 0 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _HighColor_Power: 0.48 + - _Inverse_Clipping: 0 + - _Inverse_MatcapMask: 0 + - _Inverse_Z_Axis_BLD: 1 + - _IsBaseMapAlphaAsClippingMask: 0 + - _Is_1st_ShadeColorOnly: 0 + - _Is_BLD: 0 + - _Is_BakedNormal: 0 + - _Is_BlendAddToHiColor: 1 + - _Is_BlendAddToMatCap: 1 + - _Is_BlendBaseColor: 1 + - _Is_ColorShift: 0 + - _Is_Filter_HiCutPointLightColor: 1 + - _Is_Filter_LightColor: 0 + - _Is_LightColor_1st_Shade: 1 + - _Is_LightColor_2nd_Shade: 1 + - _Is_LightColor_AR: 1 + - _Is_LightColor_Ap_RimLight: 1 + - _Is_LightColor_Base: 1 + - _Is_LightColor_HighColor: 0 + - _Is_LightColor_MatCap: 1 + - _Is_LightColor_Outline: 1 + - _Is_LightColor_RimLight: 1 + - _Is_NormalMap: 0 + - _Is_NormalMapForMatCap: 0 + - _Is_NormalMapToBase: 0 + - _Is_NormalMapToHighColor: 0 + - _Is_NormalMapToRimLight: 0 + - _Is_Ortho: 0 + - _Is_OutlineTex: 1 + - _Is_PingPong_Base: 0 + - _Is_SpecularToHighColor: 0 + - _Is_UseTweakHighColorOnShadow: 0 + - _Is_UseTweakMatCapOnShadow: 0 + - _Is_ViewCoord_Scroll: 0 + - _Is_ViewShift: 0 + - _LightDirection_MaskOn: 0 + - _MatCap: 0 + - _Metallic: 0 + - _Mode: 0 + - _Nearest_Distance: 1 + - _OUTLINE: 0 + - _OcclusionStrength: 1 + - _Offset_X_Axis_BLD: -0.05 + - _Offset_Y_Axis_BLD: 0.09 + - _Offset_Z: 0 + - _OpaqueCullMode: 1 + - _Outline_Width: 1 + - _Parallax: 0.02 + - _QueueControl: 0 + - _QueueOffset: 0 + - _RayTracing: 0 + - _ReceivesSSR: 1 + - _ReceivesSSRTransparent: 0 + - _RefractionModel: 0 + - _RenderQueueType: 1 + - _RequireSplitLighting: 0 + - _RimLight: 0 + - _RimLight_FeatherOff: 1 + - _RimLight_InsideMask: 0.47 + - _RimLight_Power: 0.01 + - _Rotate_EmissiveUV: 0 + - _Rotate_MatCapUV: 0 + - _Rotate_NormalMapForMatCapUV: 0 + - _SPRDefaultUnlitColorMask: 15 + - _SRPDefaultUnlitColMode: 1 + - _Scroll_EmissiveU: 0 + - _Scroll_EmissiveV: 0 + - _Set_SystemShadowsToBase: 1 + - _ShadeColor_Step: 0.618 + - _Smoothness: 0 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _StencilComp: 0 + - _StencilMode: 0 + - _StencilNo: 1 + - _StencilOpFail: 0 + - _StencilOpPass: 0 + - _StencilRef: 0 + - _StencilRefDepth: 8 + - _StencilRefDistortionVec: 4 + - _StencilRefGBuffer: 10 + - _StencilRefMV: 40 + - _StencilWriteMask: 6 + - _StencilWriteMaskDepth: 8 + - _StencilWriteMaskDistortionVec: 4 + - _StencilWriteMaskGBuffer: 14 + - _StencilWriteMaskMV: 40 + - _StepOffset: 0 + - _SupportDecals: 1 + - _SurfaceType: 0 + - _TessEdgeLength: 5 + - _TessExtrusionAmount: 0 + - _TessPhongStrength: 0.5 + - _TransparentBackfaceEnable: 0 + - _TransparentCullMode: 2 + - _TransparentDepthPostpassEnable: 0 + - _TransparentDepthPrepassEnable: 0 + - _TransparentEnabled: 0 + - _TransparentSortPriority: 0 + - _TransparentWritingMotionVec: 0 + - _TransparentZWrite: 0 + - _TweakHighColorOnShadow: 0 + - _TweakMatCapOnShadow: 0 + - _Tweak_HighColorMaskLevel: 0 + - _Tweak_LightDirection_MaskLevel: 0 + - _Tweak_MatCapUV: 0 + - _Tweak_MatcapMaskLevel: 0 + - _Tweak_RimLightMaskLevel: 0 + - _Tweak_ShadingGradeMapLevel: 0 + - _Tweak_SystemShadowsLevel: 0 + - _Tweak_transparency: 0 + - _UVSec: 0 + - _Unlit_Intensity: 1 + - _UseShadowThreshold: 0 + - _Use_1stAs2nd: 0 + - _Use_BaseAs1st: 0 + - _ZOverDrawMode: 0 + - _ZTestDepthEqualForOpaque: 3 + - _ZTestGBuffer: 4 + - _ZTestTransparent: 4 + - _ZWrite: 1 + - _ZWriteMode: 1 + - _simpleUI: 0 + - _utsTechnique: 1 + - _utsVersion: 2.07 + - _utsVersionX: 2 + - _utsVersionY: 2 + - _utsVersionZ: 0 + m_Colors: + - _1st_ShadeColor: {r: 1, g: 1, b: 1, a: 1} + - _2nd_ShadeColor: {r: 1, g: 1, b: 1, a: 1} + - _AngelRing_Color: {r: 1, g: 1, b: 1, a: 1} + - _Ap_RimLightColor: {r: 1, g: 1, b: 1, a: 1} + - _BaseColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorShift: {r: 0, g: 0, b: 0, a: 1} + - _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0} + - _EmissionColor: {r: 1, g: 1, b: 1, a: 1} + - _Emissive_Color: {r: 1.319508, g: 1.319508, b: 1.319508, a: 1} + - _HighColor: {r: 0.3962264, g: 0.33053476, b: 0.25978997, a: 1} + - _MatCapColor: {r: 1, g: 1, b: 1, a: 1} + - _Outline_Color: {r: 0, g: 0, b: 0, a: 1} + - _RimLightColor: {r: 0, g: 0.8758622, b: 1, a: 1} + - _Tiling: {r: 1, g: 1, b: 0, a: 0} + - _ViewShift: {r: 0, g: 0, b: 0, a: 1} + m_BuildTextureStacks: [] + m_AllowLocking: 1 +--- !u!114 &2594153067871760303 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 10 +--- !u!114 &5151949587641123878 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: da692e001514ec24dbc4cca1949ff7e8, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 12 + hdPluginSubTargetMaterialVersions: + m_Keys: [] + m_Values: +--- !u!114 &7694048184109273949 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 639247ca83abc874e893eb93af2b5e44, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 0 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Body Back.mat.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Body Back.mat.meta new file mode 100644 index 00000000..308384c3 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Body Back.mat.meta @@ -0,0 +1,16 @@ +fileFormatVersion: 2 +guid: 77f776792836777419e18b9aa061fb0b +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Body + Back.mat + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Body.mat b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Body.mat new file mode 100644 index 00000000..bde3aeb3 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Body.mat @@ -0,0 +1,405 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Body + m_Shader: {fileID: -6465566751694194690, guid: e0b73429f84a56840ba17b216237f806, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: + - _DISABLE_SSR_TRANSPARENT + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 2000 + stringTagMap: + IgnoreProjection: False + disabledShaderPasses: + - TransparentDepthPrepass + - TransparentDepthPostpass + - TransparentBackface + - RayTracingPrepass + - MOTIONVECTORS + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _1st_ShadeMap: + m_Texture: {fileID: 2800000, guid: f180dfef53ad0924882657e28833a60b, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _2nd_ShadeMap: + m_Texture: {fileID: 2800000, guid: 9cd90983043e3974e971a6c8d66cc42d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AngelRing_Sampler: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BakedNormal: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BaseMap: + m_Texture: {fileID: 2800000, guid: d6a0b548a02e12e4e954cb6c5bb20e70, 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} + - _ClippingMask: + 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} + - _Emissive_Tex: + m_Texture: {fileID: 2800000, guid: dc71d88ff73488f45ac239b21f552745, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _HighColor_Tex: + m_Texture: {fileID: 2800000, guid: a01adb17bdc53ba4da348b3cba074154, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main: + m_Texture: {fileID: 2800000, guid: d1e50199c6f08ed46bf2d136ab225409, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: d1e50199c6f08ed46bf2d136ab225409, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCap_Sampler: + 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} + - _NormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _NormalMapForMatCap: + 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} + - _OutlineTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Outline_Sampler: + 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} + - _Set_1st_ShadePosition: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Set_2nd_ShadePosition: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Set_HighColorMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Set_MatcapMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Set_RimLightMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadingGradeMap: + m_Texture: {fileID: 2800000, guid: 7c75a3dfe8927774ea56a0777d1edcf1, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _1st2nd_Shades_Feather: 0.776 + - _1st_ShadeColor_Feather: 0.335 + - _1st_ShadeColor_Step: 0.677 + - _2nd_ShadeColor_Feather: 0.776 + - _2nd_ShadeColor_Step: 0.618 + - _ARSampler_AlphaOn: 0 + - _AR_OffsetU: 0 + - _AR_OffsetV: 0.3 + - _AddPrecomputedVelocity: 0 + - _Add_Antipodean_RimLight: 0 + - _AlphaCutoffEnable: 0 + - _AlphaDstBlend: 0 + - _AlphaSrcBlend: 1 + - _AlphaToMask: 0 + - _AlphaToMaskInspectorValue: 0 + - _AngelRing: 0 + - _Ap_RimLight_FeatherOff: 0 + - _Ap_RimLight_Power: 0.1 + - _AutoRenderQueue: 1 + - _BUILTIN_QueueControl: 0 + - _BUILTIN_QueueOffset: 0 + - _BaseColor_Step: 0.677 + - _BaseShade_Feather: 0.335 + - _Base_Speed: 0 + - _BlendMode: 0 + - _BlurLevelMatcap: 0 + - _BlurLevelSGM: 0 + - _BumpScale: 1 + - _BumpScaleMatcap: 1 + - _CameraRolling_Stabilizer: 0 + - _ClippingMode: 0 + - _Clipping_Level: 0 + - _ColorBoost: 1 + - _ColorShift_Speed: 0 + - _ConservativeDepthOffsetEnable: 0 + - _CullMode: 2 + - _CullModeForward: 2 + - _Cutoff: 0.5 + - _DepthOffsetEnable: 0 + - _DetailNormalMapScale: 1 + - _DoubleSidedEnable: 0 + - _DoubleSidedGIMode: 0 + - _DoubleSidedNormalMode: 2 + - _DstBlend: 0 + - _EMISSIVE: 0 + - _EnableBlendModePreserveSpecularLighting: 1 + - _EnableFogOnTransparent: 1 + - _Farthest_Distance: 0 + - _GI_Intensity: 0 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _HighColor_Power: 0.48 + - _Inverse_Clipping: 0 + - _Inverse_MatcapMask: 0 + - _Inverse_Z_Axis_BLD: 1 + - _IsBaseMapAlphaAsClippingMask: 0 + - _Is_1st_ShadeColorOnly: 0 + - _Is_BLD: 0 + - _Is_BakedNormal: 0 + - _Is_BlendAddToHiColor: 1 + - _Is_BlendAddToMatCap: 1 + - _Is_BlendBaseColor: 1 + - _Is_ColorShift: 0 + - _Is_Filter_HiCutPointLightColor: 1 + - _Is_Filter_LightColor: 0 + - _Is_LightColor_1st_Shade: 1 + - _Is_LightColor_2nd_Shade: 1 + - _Is_LightColor_AR: 1 + - _Is_LightColor_Ap_RimLight: 1 + - _Is_LightColor_Base: 1 + - _Is_LightColor_HighColor: 0 + - _Is_LightColor_MatCap: 1 + - _Is_LightColor_Outline: 1 + - _Is_LightColor_RimLight: 1 + - _Is_NormalMap: 0 + - _Is_NormalMapForMatCap: 0 + - _Is_NormalMapToBase: 0 + - _Is_NormalMapToHighColor: 0 + - _Is_NormalMapToRimLight: 0 + - _Is_Ortho: 0 + - _Is_OutlineTex: 1 + - _Is_PingPong_Base: 0 + - _Is_SpecularToHighColor: 0 + - _Is_UseTweakHighColorOnShadow: 0 + - _Is_UseTweakMatCapOnShadow: 0 + - _Is_ViewCoord_Scroll: 0 + - _Is_ViewShift: 0 + - _LightDirection_MaskOn: 0 + - _MatCap: 0 + - _Metallic: 0 + - _Mode: 0 + - _Nearest_Distance: 1 + - _OUTLINE: 0 + - _OcclusionStrength: 1 + - _Offset_X_Axis_BLD: -0.05 + - _Offset_Y_Axis_BLD: 0.09 + - _Offset_Z: 0 + - _OpaqueCullMode: 2 + - _Outline_Width: 1 + - _Parallax: 0.02 + - _QueueControl: 0 + - _QueueOffset: 0 + - _RayTracing: 0 + - _ReceivesSSR: 1 + - _ReceivesSSRTransparent: 0 + - _RefractionModel: 0 + - _RenderQueueType: 1 + - _RequireSplitLighting: 0 + - _RimLight: 0 + - _RimLight_FeatherOff: 1 + - _RimLight_InsideMask: 0.47 + - _RimLight_Power: 0.01 + - _Rotate_EmissiveUV: 0 + - _Rotate_MatCapUV: 0 + - _Rotate_NormalMapForMatCapUV: 0 + - _SPRDefaultUnlitColorMask: 15 + - _SRPDefaultUnlitColMode: 1 + - _Scroll_EmissiveU: 0 + - _Scroll_EmissiveV: 0 + - _Set_SystemShadowsToBase: 1 + - _ShadeColor_Step: 0.618 + - _Smoothness: 0 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _StencilComp: 0 + - _StencilMode: 0 + - _StencilNo: 1 + - _StencilOpFail: 0 + - _StencilOpPass: 0 + - _StencilRef: 0 + - _StencilRefDepth: 8 + - _StencilRefDistortionVec: 4 + - _StencilRefGBuffer: 10 + - _StencilRefMV: 40 + - _StencilWriteMask: 6 + - _StencilWriteMaskDepth: 8 + - _StencilWriteMaskDistortionVec: 4 + - _StencilWriteMaskGBuffer: 14 + - _StencilWriteMaskMV: 40 + - _StepOffset: 0 + - _SupportDecals: 1 + - _SurfaceType: 0 + - _TessEdgeLength: 5 + - _TessExtrusionAmount: 0 + - _TessPhongStrength: 0.5 + - _TransparentBackfaceEnable: 0 + - _TransparentCullMode: 2 + - _TransparentDepthPostpassEnable: 0 + - _TransparentDepthPrepassEnable: 0 + - _TransparentEnabled: 0 + - _TransparentSortPriority: 0 + - _TransparentWritingMotionVec: 0 + - _TransparentZWrite: 0 + - _TweakHighColorOnShadow: 0 + - _TweakMatCapOnShadow: 0 + - _Tweak_HighColorMaskLevel: 0 + - _Tweak_LightDirection_MaskLevel: 0 + - _Tweak_MatCapUV: 0 + - _Tweak_MatcapMaskLevel: 0 + - _Tweak_RimLightMaskLevel: 0 + - _Tweak_ShadingGradeMapLevel: 0 + - _Tweak_SystemShadowsLevel: 0 + - _Tweak_transparency: 0 + - _UVSec: 0 + - _Unlit_Intensity: 1 + - _UseShadowThreshold: 0 + - _Use_1stAs2nd: 0 + - _Use_BaseAs1st: 0 + - _ZOverDrawMode: 0 + - _ZTestDepthEqualForOpaque: 3 + - _ZTestGBuffer: 4 + - _ZTestTransparent: 4 + - _ZWrite: 1 + - _ZWriteMode: 1 + - _simpleUI: 0 + - _utsTechnique: 1 + - _utsVersion: 2.07 + - _utsVersionX: 2 + - _utsVersionY: 2 + - _utsVersionZ: 0 + m_Colors: + - _1st_ShadeColor: {r: 1, g: 1, b: 1, a: 1} + - _2nd_ShadeColor: {r: 1, g: 1, b: 1, a: 1} + - _AngelRing_Color: {r: 1, g: 1, b: 1, a: 1} + - _Ap_RimLightColor: {r: 1, g: 1, b: 1, a: 1} + - _BaseColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorShift: {r: 0, g: 0, b: 0, a: 1} + - _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0} + - _EmissionColor: {r: 1, g: 1, b: 1, a: 1} + - _Emissive_Color: {r: 1.319508, g: 1.319508, b: 1.319508, a: 1} + - _HighColor: {r: 0.3962264, g: 0.33053476, b: 0.25978997, a: 1} + - _MatCapColor: {r: 1, g: 1, b: 1, a: 1} + - _Outline_Color: {r: 0, g: 0, b: 0, a: 1} + - _RimLightColor: {r: 0, g: 0.8758622, b: 1, a: 1} + - _Tiling: {r: 1, g: 1, b: 0, a: 0} + - _ViewShift: {r: 0, g: 0, b: 0, a: 1} + m_BuildTextureStacks: [] + m_AllowLocking: 1 +--- !u!114 &2129366640030291598 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: da692e001514ec24dbc4cca1949ff7e8, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 12 + hdPluginSubTargetMaterialVersions: + m_Keys: [] + m_Values: +--- !u!114 &2594153067871760303 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 10 +--- !u!114 &7694048184109273949 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 639247ca83abc874e893eb93af2b5e44, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 0 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Body.mat.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Body.mat.meta new file mode 100644 index 00000000..2a563cba --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Body.mat.meta @@ -0,0 +1,16 @@ +fileFormatVersion: 2 +guid: 2f1752b96ee4af7438efa446bf057ee1 +timeCreated: 1544184610 +licenseType: Store +NativeFormatImporter: + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Body.mat + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Eyes.mat b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Eyes.mat new file mode 100644 index 00000000..3109cd38 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Eyes.mat @@ -0,0 +1,405 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Eyes + m_Shader: {fileID: -6465566751694194690, guid: e0b73429f84a56840ba17b216237f806, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: + - _DISABLE_SSR_TRANSPARENT + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 2000 + stringTagMap: + IgnoreProjection: False + disabledShaderPasses: + - TransparentDepthPrepass + - TransparentDepthPostpass + - TransparentBackface + - RayTracingPrepass + - MOTIONVECTORS + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _1st_ShadeMap: + m_Texture: {fileID: 2800000, guid: 6ff07624f73f6184f84deb5ba5242590, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _2nd_ShadeMap: + m_Texture: {fileID: 2800000, guid: 7d84fa1a7f8997342ba010124f77b1e8, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AngelRing_Sampler: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BakedNormal: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BaseMap: + m_Texture: {fileID: 2800000, guid: caf3fd65fe2194f4a9458d9689902a73, 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} + - _ClippingMask: + 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} + - _Emissive_Tex: + m_Texture: {fileID: 2800000, guid: 5a8dc6b89c866b546a4b2beebade28a1, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _HighColor_Tex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main: + m_Texture: {fileID: 2800000, guid: 6ff07624f73f6184f84deb5ba5242590, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 7275e6b9fb5d06847b114e33f0ab8ca6, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCap_Sampler: + 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} + - _NormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _NormalMapForMatCap: + 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} + - _OutlineTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Outline_Sampler: + m_Texture: {fileID: 2800000, guid: c5acb3acbd64e734b838b254bb0ee4d8, type: 3} + 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} + - _Set_1st_ShadePosition: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Set_2nd_ShadePosition: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Set_HighColorMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Set_MatcapMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Set_RimLightMask: + m_Texture: {fileID: 2800000, guid: c5acb3acbd64e734b838b254bb0ee4d8, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadingGradeMap: + m_Texture: {fileID: 2800000, guid: ec3cb3dfef7e49a4eb0c10040e9733df, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _1st2nd_Shades_Feather: 1 + - _1st_ShadeColor_Feather: 0.0001 + - _1st_ShadeColor_Step: 0.254 + - _2nd_ShadeColor_Feather: 1 + - _2nd_ShadeColor_Step: 0.848 + - _ARSampler_AlphaOn: 0 + - _AR_OffsetU: 0 + - _AR_OffsetV: 0.3 + - _AddPrecomputedVelocity: 0 + - _Add_Antipodean_RimLight: 1 + - _AlphaCutoffEnable: 0 + - _AlphaDstBlend: 0 + - _AlphaSrcBlend: 1 + - _AlphaToMask: 0 + - _AlphaToMaskInspectorValue: 0 + - _AngelRing: 0 + - _Ap_RimLight_FeatherOff: 0 + - _Ap_RimLight_Power: 0.59 + - _AutoRenderQueue: 1 + - _BUILTIN_QueueControl: 1 + - _BUILTIN_QueueOffset: 0 + - _BaseColor_Step: 0.254 + - _BaseShade_Feather: 0.0001 + - _Base_Speed: 0 + - _BlendMode: 0 + - _BlurLevelMatcap: 0 + - _BlurLevelSGM: 0 + - _BumpScale: 1 + - _BumpScaleMatcap: 1 + - _CameraRolling_Stabilizer: 0 + - _ClippingMode: 0 + - _Clipping_Level: 0 + - _ColorBoost: 1 + - _ColorShift_Speed: 0 + - _ConservativeDepthOffsetEnable: 0 + - _CullMode: 2 + - _CullModeForward: 2 + - _Cutoff: 0.5 + - _DepthOffsetEnable: 0 + - _DetailNormalMapScale: 1 + - _DoubleSidedEnable: 0 + - _DoubleSidedGIMode: 0 + - _DoubleSidedNormalMode: 2 + - _DstBlend: 0 + - _EMISSIVE: 0 + - _EnableBlendModePreserveSpecularLighting: 1 + - _EnableFogOnTransparent: 1 + - _Farthest_Distance: 0 + - _GI_Intensity: 0 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _HighColor_Power: 0 + - _Inverse_Clipping: 0 + - _Inverse_MatcapMask: 0 + - _Inverse_Z_Axis_BLD: 1 + - _IsBaseMapAlphaAsClippingMask: 0 + - _Is_1st_ShadeColorOnly: 0 + - _Is_BLD: 0 + - _Is_BakedNormal: 0 + - _Is_BlendAddToHiColor: 0 + - _Is_BlendAddToMatCap: 1 + - _Is_BlendBaseColor: 1 + - _Is_ColorShift: 0 + - _Is_Filter_HiCutPointLightColor: 1 + - _Is_Filter_LightColor: 0 + - _Is_LightColor_1st_Shade: 1 + - _Is_LightColor_2nd_Shade: 1 + - _Is_LightColor_AR: 1 + - _Is_LightColor_Ap_RimLight: 1 + - _Is_LightColor_Base: 1 + - _Is_LightColor_HighColor: 1 + - _Is_LightColor_MatCap: 1 + - _Is_LightColor_Outline: 1 + - _Is_LightColor_RimLight: 1 + - _Is_NormalMap: 0 + - _Is_NormalMapForMatCap: 0 + - _Is_NormalMapToBase: 0 + - _Is_NormalMapToHighColor: 0 + - _Is_NormalMapToRimLight: 0 + - _Is_Ortho: 0 + - _Is_OutlineTex: 0 + - _Is_PingPong_Base: 0 + - _Is_SpecularToHighColor: 0 + - _Is_UseTweakHighColorOnShadow: 0 + - _Is_UseTweakMatCapOnShadow: 0 + - _Is_ViewCoord_Scroll: 0 + - _Is_ViewShift: 0 + - _LightDirection_MaskOn: 0 + - _MatCap: 0 + - _Metallic: 0 + - _Mode: 0 + - _Nearest_Distance: 1 + - _OUTLINE: 0 + - _OcclusionStrength: 1 + - _Offset_X_Axis_BLD: -0.05 + - _Offset_Y_Axis_BLD: 0.09 + - _Offset_Z: 0 + - _OpaqueCullMode: 2 + - _Outline_Width: 1 + - _Parallax: 0.02 + - _QueueControl: 0 + - _QueueOffset: 0 + - _RayTracing: 0 + - _ReceivesSSR: 1 + - _ReceivesSSRTransparent: 0 + - _RefractionModel: 0 + - _RenderQueueType: 1 + - _RequireSplitLighting: 0 + - _RimLight: 0 + - _RimLight_FeatherOff: 0 + - _RimLight_InsideMask: 0.0001 + - _RimLight_Power: 1 + - _Rotate_EmissiveUV: 0 + - _Rotate_MatCapUV: 0 + - _Rotate_NormalMapForMatCapUV: 0 + - _SPRDefaultUnlitColorMask: 15 + - _SRPDefaultUnlitColMode: 1 + - _Scroll_EmissiveU: 0 + - _Scroll_EmissiveV: 0 + - _Set_SystemShadowsToBase: 1 + - _ShadeColor_Step: 0.848 + - _Smoothness: 0 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _StencilComp: 0 + - _StencilMode: 0 + - _StencilNo: 1 + - _StencilOpFail: 0 + - _StencilOpPass: 0 + - _StencilRef: 0 + - _StencilRefDepth: 8 + - _StencilRefDistortionVec: 4 + - _StencilRefGBuffer: 10 + - _StencilRefMV: 40 + - _StencilWriteMask: 6 + - _StencilWriteMaskDepth: 8 + - _StencilWriteMaskDistortionVec: 4 + - _StencilWriteMaskGBuffer: 14 + - _StencilWriteMaskMV: 40 + - _StepOffset: 0.04 + - _SupportDecals: 1 + - _SurfaceType: 0 + - _TessEdgeLength: 5 + - _TessExtrusionAmount: 0 + - _TessPhongStrength: 0.5 + - _TransparentBackfaceEnable: 0 + - _TransparentCullMode: 2 + - _TransparentDepthPostpassEnable: 0 + - _TransparentDepthPrepassEnable: 0 + - _TransparentEnabled: 0 + - _TransparentSortPriority: 0 + - _TransparentWritingMotionVec: 0 + - _TransparentZWrite: 0 + - _TweakHighColorOnShadow: 0 + - _TweakMatCapOnShadow: 0 + - _Tweak_HighColorMaskLevel: 0 + - _Tweak_LightDirection_MaskLevel: 0 + - _Tweak_MatCapUV: 0 + - _Tweak_MatcapMaskLevel: 0 + - _Tweak_RimLightMaskLevel: 0 + - _Tweak_ShadingGradeMapLevel: 0 + - _Tweak_SystemShadowsLevel: -0.5 + - _Tweak_transparency: 0 + - _UVSec: 0 + - _Unlit_Intensity: 1 + - _UseShadowThreshold: 0 + - _Use_1stAs2nd: 0 + - _Use_BaseAs1st: 0 + - _ZOverDrawMode: 0 + - _ZTestDepthEqualForOpaque: 3 + - _ZTestGBuffer: 4 + - _ZTestTransparent: 4 + - _ZWrite: 1 + - _ZWriteMode: 1 + - _simpleUI: 0 + - _utsTechnique: 1 + - _utsVersion: 2.07 + - _utsVersionX: 2 + - _utsVersionY: 2 + - _utsVersionZ: 0 + m_Colors: + - _1st_ShadeColor: {r: 1, g: 1, b: 1, a: 1} + - _2nd_ShadeColor: {r: 0.6021844, g: 0.59278214, b: 0.7264151, a: 1} + - _AngelRing_Color: {r: 1, g: 1, b: 1, a: 1} + - _Ap_RimLightColor: {r: 1, g: 0.80689657, b: 0, a: 1} + - _BaseColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorShift: {r: 0, g: 0, b: 0, a: 1} + - _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0} + - _EmissionColor: {r: 1, g: 1, b: 1, a: 1} + - _Emissive_Color: {r: 0.21323532, g: 0, b: 0, a: 1} + - _HighColor: {r: 0, g: 0, b: 0, a: 1} + - _MatCapColor: {r: 1, g: 1, b: 1, a: 1} + - _Outline_Color: {r: 0.36764705, g: 0.059472308, b: 0.28263327, a: 1} + - _RimLightColor: {r: 1, g: 0, b: 0, a: 1} + - _Tiling: {r: 1, g: 1, b: 0, a: 0} + - _ViewShift: {r: 0, g: 0, b: 0, a: 1} + m_BuildTextureStacks: [] + m_AllowLocking: 1 +--- !u!114 &953996833678100074 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: da692e001514ec24dbc4cca1949ff7e8, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 12 + hdPluginSubTargetMaterialVersions: + m_Keys: [] + m_Values: +--- !u!114 &5432644595444900209 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 639247ca83abc874e893eb93af2b5e44, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 0 +--- !u!114 &5578569521361078589 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 10 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Eyes.mat.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Eyes.mat.meta new file mode 100644 index 00000000..2896036e --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Eyes.mat.meta @@ -0,0 +1,16 @@ +fileFormatVersion: 2 +guid: f72ba1415e9cdcf4eb6a64dd69cc4b31 +timeCreated: 1544184610 +licenseType: Store +NativeFormatImporter: + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Eyes.mat + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Eyes_HL.mat b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Eyes_HL.mat new file mode 100644 index 00000000..47462ca8 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Eyes_HL.mat @@ -0,0 +1,410 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-2020739770036755877 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 639247ca83abc874e893eb93af2b5e44, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 0 +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Eyes_HL + m_Shader: {fileID: -6465566751694194690, guid: e0b73429f84a56840ba17b216237f806, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: + - _DISABLE_SSR_TRANSPARENT + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 2000 + stringTagMap: + IgnoreProjection: False + disabledShaderPasses: + - TransparentDepthPrepass + - TransparentDepthPostpass + - TransparentBackface + - RayTracingPrepass + - MOTIONVECTORS + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _1st_ShadeMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _2nd_ShadeMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AngelRing_Sampler: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BakedNormal: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BaseMap: + m_Texture: {fileID: 0} + 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} + - _ClippingMask: + 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} + - _Emissive_Tex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _HighColor_Tex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main: + m_Texture: {fileID: 2800000, guid: 7d84fa1a7f8997342ba010124f77b1e8, type: 3} + 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} + - _MatCap_Sampler: + 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} + - _NormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _NormalMapForMatCap: + 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} + - _OutlineTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Outline_Sampler: + 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} + - _Set_1st_ShadePosition: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Set_2nd_ShadePosition: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Set_HighColorMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Set_MatcapMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Set_RimLightMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadingGradeMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SpecGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _1st2nd_Shades_Feather: 0.0001 + - _1st_ShadeColor_Feather: 0.0001 + - _1st_ShadeColor_Step: 0.5 + - _2nd_ShadeColor_Feather: 0.0001 + - _2nd_ShadeColor_Step: 0 + - _ARSampler_AlphaOn: 0 + - _AR_OffsetU: 0 + - _AR_OffsetV: 0.3 + - _AddPrecomputedVelocity: 0 + - _Add_Antipodean_RimLight: 0 + - _AlphaClip: 0 + - _AlphaCutoffEnable: 0 + - _AlphaDstBlend: 0 + - _AlphaSrcBlend: 1 + - _AlphaToMask: 0 + - _AlphaToMaskInspectorValue: 0 + - _AngelRing: 0 + - _Ap_RimLight_FeatherOff: 0 + - _Ap_RimLight_Power: 0.1 + - _AutoRenderQueue: 1 + - _BUILTIN_QueueControl: 1 + - _BUILTIN_QueueOffset: 0 + - _BaseColor_Step: 0.5 + - _BaseShade_Feather: 0.0001 + - _Base_Speed: 0 + - _Blend: 0 + - _BlendMode: 0 + - _BlurLevelMatcap: 0 + - _BlurLevelSGM: 0 + - _BumpScale: 1 + - _BumpScaleMatcap: 1 + - _CameraRolling_Stabilizer: 0 + - _ClippingMode: 0 + - _Clipping_Level: 0 + - _ColorShift_Speed: 0 + - _ConservativeDepthOffsetEnable: 0 + - _Cull: 2 + - _CullMode: 2 + - _CullModeForward: 2 + - _Cutoff: 0.5 + - _DepthOffsetEnable: 0 + - _DetailNormalMapScale: 1 + - _DoubleSidedEnable: 0 + - _DoubleSidedGIMode: 0 + - _DoubleSidedNormalMode: 2 + - _DstBlend: 0 + - _EMISSIVE: 0 + - _EnableBlendModePreserveSpecularLighting: 1 + - _EnableFogOnTransparent: 1 + - _EnvironmentReflections: 1 + - _Farthest_Distance: 0 + - _GI_Intensity: 0 + - _GlossMapScale: 0 + - _Glossiness: 0 + - _GlossyReflections: 0 + - _HighColor_Power: 0 + - _Inverse_Clipping: 0 + - _Inverse_MatcapMask: 0 + - _Inverse_Z_Axis_BLD: 1 + - _IsBaseMapAlphaAsClippingMask: 0 + - _Is_BLD: 0 + - _Is_BakedNormal: 0 + - _Is_BlendAddToHiColor: 0 + - _Is_BlendAddToMatCap: 1 + - _Is_BlendBaseColor: 0 + - _Is_ColorShift: 0 + - _Is_Filter_HiCutPointLightColor: 1 + - _Is_Filter_LightColor: 0 + - _Is_LightColor_1st_Shade: 1 + - _Is_LightColor_2nd_Shade: 1 + - _Is_LightColor_AR: 1 + - _Is_LightColor_Ap_RimLight: 1 + - _Is_LightColor_Base: 1 + - _Is_LightColor_HighColor: 1 + - _Is_LightColor_MatCap: 1 + - _Is_LightColor_Outline: 1 + - _Is_LightColor_RimLight: 1 + - _Is_NormalMapForMatCap: 0 + - _Is_NormalMapToBase: 0 + - _Is_NormalMapToHighColor: 0 + - _Is_NormalMapToRimLight: 0 + - _Is_Ortho: 0 + - _Is_OutlineTex: 0 + - _Is_PingPong_Base: 0 + - _Is_SpecularToHighColor: 0 + - _Is_UseTweakHighColorOnShadow: 0 + - _Is_UseTweakMatCapOnShadow: 0 + - _Is_ViewCoord_Scroll: 0 + - _Is_ViewShift: 0 + - _LightDirection_MaskOn: 0 + - _MatCap: 0 + - _Metallic: 0 + - _Mode: 0 + - _Nearest_Distance: 1 + - _OUTLINE: 0 + - _OcclusionStrength: 1 + - _Offset_X_Axis_BLD: -0.05 + - _Offset_Y_Axis_BLD: 0.09 + - _Offset_Z: 0 + - _OpaqueCullMode: 2 + - _Outline_Width: 0 + - _Parallax: 0.02 + - _QueueControl: 0 + - _QueueOffset: 0 + - _RayTracing: 0 + - _ReceiveShadows: 1 + - _ReceivesSSR: 1 + - _ReceivesSSRTransparent: 0 + - _RefractionModel: 0 + - _RenderQueueType: 1 + - _RequireSplitLighting: 0 + - _RimLight: 0 + - _RimLight_FeatherOff: 0 + - _RimLight_InsideMask: 0.0001 + - _RimLight_Power: 0.1 + - _Rotate_EmissiveUV: 0 + - _Rotate_MatCapUV: 0 + - _Rotate_NormalMapForMatCapUV: 0 + - _SPRDefaultUnlitColorMask: 15 + - _SRPDefaultUnlitColMode: 1 + - _Scroll_EmissiveU: 0 + - _Scroll_EmissiveV: 0 + - _Set_SystemShadowsToBase: 1 + - _ShadeColor_Step: 0 + - _Smoothness: 0.5 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _StencilComp: 0 + - _StencilMode: 0 + - _StencilNo: 1 + - _StencilOpFail: 0 + - _StencilOpPass: 0 + - _StencilRef: 0 + - _StencilRefDepth: 8 + - _StencilRefDistortionVec: 4 + - _StencilRefGBuffer: 10 + - _StencilRefMV: 40 + - _StencilWriteMask: 6 + - _StencilWriteMaskDepth: 8 + - _StencilWriteMaskDistortionVec: 4 + - _StencilWriteMaskGBuffer: 14 + - _StencilWriteMaskMV: 40 + - _StepOffset: 0 + - _SupportDecals: 1 + - _Surface: 0 + - _SurfaceType: 0 + - _TransparentBackfaceEnable: 0 + - _TransparentCullMode: 2 + - _TransparentDepthPostpassEnable: 0 + - _TransparentDepthPrepassEnable: 0 + - _TransparentEnabled: 0 + - _TransparentSortPriority: 0 + - _TransparentWritingMotionVec: 0 + - _TransparentZWrite: 0 + - _TweakHighColorOnShadow: 0 + - _TweakMatCapOnShadow: 0 + - _Tweak_HighColorMaskLevel: 0 + - _Tweak_LightDirection_MaskLevel: 0 + - _Tweak_MatCapUV: 0 + - _Tweak_MatcapMaskLevel: 0 + - _Tweak_RimLightMaskLevel: 0 + - _Tweak_ShadingGradeMapLevel: 0 + - _Tweak_SystemShadowsLevel: 0 + - _Tweak_transparency: 0 + - _UVSec: 0 + - _Unlit_Intensity: 1 + - _UseShadowThreshold: 0 + - _Use_1stAs2nd: 0 + - _Use_BaseAs1st: 0 + - _WorkflowMode: 1 + - _ZOverDrawMode: 0 + - _ZTestDepthEqualForOpaque: 3 + - _ZTestGBuffer: 4 + - _ZTestTransparent: 4 + - _ZWrite: 1 + - _ZWriteMode: 1 + - _simpleUI: 0 + - _utsTechnique: 0 + - _utsVersionX: 2 + - _utsVersionY: 2 + - _utsVersionZ: 0 + m_Colors: + - _1st_ShadeColor: {r: 1, g: 1, b: 1, a: 1} + - _2nd_ShadeColor: {r: 1, g: 1, b: 1, a: 1} + - _AngelRing_Color: {r: 1, g: 1, b: 1, a: 1} + - _Ap_RimLightColor: {r: 1, g: 1, b: 1, a: 1} + - _BaseColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorShift: {r: 0, g: 0, b: 0, a: 1} + - _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0} + - _EmissionColor: {r: 1, g: 1, b: 1, a: 1} + - _Emissive_Color: {r: 2, g: 2, b: 2, a: 1} + - _HighColor: {r: 0, g: 0, b: 0, a: 1} + - _MatCapColor: {r: 1, g: 1, b: 1, a: 1} + - _Outline_Color: {r: 0.5, g: 0.5, b: 0.5, a: 1} + - _RimLightColor: {r: 1, g: 1, b: 1, a: 1} + - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} + - _Tiling: {r: 1, g: 1, b: 0, a: 0} + - _ViewShift: {r: 0, g: 0, b: 0, a: 1} + m_BuildTextureStacks: [] + m_AllowLocking: 1 +--- !u!114 &1141793881992010275 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: da692e001514ec24dbc4cca1949ff7e8, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 12 + hdPluginSubTargetMaterialVersions: + m_Keys: [] + m_Values: +--- !u!114 &4074571565025144848 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 10 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Eyes_HL.mat.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Eyes_HL.mat.meta new file mode 100644 index 00000000..75a8bcd8 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Eyes_HL.mat.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: b252b15c283524a45afa12c94b5a2853 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Eyes_HL.mat + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Face.mat b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Face.mat new file mode 100644 index 00000000..ad919034 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Face.mat @@ -0,0 +1,405 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-5292109544577297850 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 639247ca83abc874e893eb93af2b5e44, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 0 +--- !u!114 &-4702967822752667190 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 10 +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Face + m_Shader: {fileID: -6465566751694194690, guid: e0b73429f84a56840ba17b216237f806, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: + - _DISABLE_SSR_TRANSPARENT + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 2000 + stringTagMap: + IgnoreProjection: False + disabledShaderPasses: + - TransparentDepthPrepass + - TransparentDepthPostpass + - TransparentBackface + - RayTracingPrepass + - MOTIONVECTORS + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _1st_ShadeMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _2nd_ShadeMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AngelRing_Sampler: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BakedNormal: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BaseMap: + m_Texture: {fileID: 2800000, guid: caf3fd65fe2194f4a9458d9689902a73, 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} + - _ClippingMask: + 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} + - _Emissive_Tex: + m_Texture: {fileID: 2800000, guid: 5a8dc6b89c866b546a4b2beebade28a1, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _HighColor_Tex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main: + m_Texture: {fileID: 2800000, guid: 7275e6b9fb5d06847b114e33f0ab8ca6, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 7275e6b9fb5d06847b114e33f0ab8ca6, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCap_Sampler: + 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} + - _NormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _NormalMapForMatCap: + 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} + - _OutlineTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Outline_Sampler: + m_Texture: {fileID: 2800000, guid: c5acb3acbd64e734b838b254bb0ee4d8, type: 3} + 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} + - _Set_1st_ShadePosition: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Set_2nd_ShadePosition: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Set_HighColorMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Set_MatcapMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Set_RimLightMask: + m_Texture: {fileID: 2800000, guid: b925033b206f79942b43d77ac699fc72, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadingGradeMap: + m_Texture: {fileID: 2800000, guid: ec3cb3dfef7e49a4eb0c10040e9733df, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _1st2nd_Shades_Feather: 0.25 + - _1st_ShadeColor_Feather: 0.54 + - _1st_ShadeColor_Step: 0.39 + - _2nd_ShadeColor_Feather: 0.25 + - _2nd_ShadeColor_Step: 0.33 + - _ARSampler_AlphaOn: 0 + - _AR_OffsetU: 0 + - _AR_OffsetV: 0.3 + - _AddPrecomputedVelocity: 0 + - _Add_Antipodean_RimLight: 1 + - _AlphaCutoffEnable: 0 + - _AlphaDstBlend: 0 + - _AlphaSrcBlend: 1 + - _AlphaToMask: 0 + - _AlphaToMaskInspectorValue: 0 + - _AngelRing: 0 + - _Ap_RimLight_FeatherOff: 0 + - _Ap_RimLight_Power: 0.59 + - _AutoRenderQueue: 1 + - _BUILTIN_QueueControl: 1 + - _BUILTIN_QueueOffset: 0 + - _BaseColor_Step: 0.39 + - _BaseShade_Feather: 0.54 + - _Base_Speed: 0 + - _BlendMode: 0 + - _BlurLevelMatcap: 0 + - _BlurLevelSGM: 0 + - _BumpScale: 1 + - _BumpScaleMatcap: 1 + - _CameraRolling_Stabilizer: 0 + - _ClippingMode: 0 + - _Clipping_Level: 0 + - _ColorBoost: 1 + - _ColorShift_Speed: 0 + - _ConservativeDepthOffsetEnable: 0 + - _CullMode: 2 + - _CullModeForward: 2 + - _Cutoff: 0.5 + - _DepthOffsetEnable: 0 + - _DetailNormalMapScale: 1 + - _DoubleSidedEnable: 0 + - _DoubleSidedGIMode: 0 + - _DoubleSidedNormalMode: 2 + - _DstBlend: 0 + - _EMISSIVE: 0 + - _EnableBlendModePreserveSpecularLighting: 1 + - _EnableFogOnTransparent: 1 + - _Farthest_Distance: 0 + - _GI_Intensity: 0 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _HighColor_Power: 0 + - _Inverse_Clipping: 0 + - _Inverse_MatcapMask: 0 + - _Inverse_Z_Axis_BLD: 1 + - _IsBaseMapAlphaAsClippingMask: 0 + - _Is_1st_ShadeColorOnly: 0 + - _Is_BLD: 0 + - _Is_BakedNormal: 0 + - _Is_BlendAddToHiColor: 0 + - _Is_BlendAddToMatCap: 1 + - _Is_BlendBaseColor: 1 + - _Is_ColorShift: 0 + - _Is_Filter_HiCutPointLightColor: 1 + - _Is_Filter_LightColor: 0 + - _Is_LightColor_1st_Shade: 1 + - _Is_LightColor_2nd_Shade: 1 + - _Is_LightColor_AR: 1 + - _Is_LightColor_Ap_RimLight: 1 + - _Is_LightColor_Base: 1 + - _Is_LightColor_HighColor: 1 + - _Is_LightColor_MatCap: 1 + - _Is_LightColor_Outline: 0 + - _Is_LightColor_RimLight: 1 + - _Is_NormalMap: 0 + - _Is_NormalMapForMatCap: 0 + - _Is_NormalMapToBase: 0 + - _Is_NormalMapToHighColor: 0 + - _Is_NormalMapToRimLight: 0 + - _Is_Ortho: 0 + - _Is_OutlineTex: 0 + - _Is_PingPong_Base: 0 + - _Is_SpecularToHighColor: 0 + - _Is_UseTweakHighColorOnShadow: 0 + - _Is_UseTweakMatCapOnShadow: 0 + - _Is_ViewCoord_Scroll: 0 + - _Is_ViewShift: 0 + - _LightDirection_MaskOn: 1 + - _MatCap: 0 + - _Metallic: 0 + - _Mode: 0 + - _Nearest_Distance: 1.2 + - _OUTLINE: 0 + - _OcclusionStrength: 1 + - _Offset_X_Axis_BLD: -0.05 + - _Offset_Y_Axis_BLD: 0.09 + - _Offset_Z: 0 + - _OpaqueCullMode: 2 + - _Outline_Width: 2 + - _Parallax: 0.02 + - _QueueControl: 0 + - _QueueOffset: 0 + - _RayTracing: 0 + - _ReceivesSSR: 1 + - _ReceivesSSRTransparent: 0 + - _RefractionModel: 0 + - _RenderQueueType: 1 + - _RequireSplitLighting: 0 + - _RimLight: 0 + - _RimLight_FeatherOff: 0 + - _RimLight_InsideMask: 0.0001 + - _RimLight_Power: 1 + - _Rotate_EmissiveUV: 0 + - _Rotate_MatCapUV: 0 + - _Rotate_NormalMapForMatCapUV: 0 + - _SPRDefaultUnlitColorMask: 15 + - _SRPDefaultUnlitColMode: 1 + - _Scroll_EmissiveU: 0 + - _Scroll_EmissiveV: 0 + - _Set_SystemShadowsToBase: 1 + - _ShadeColor_Step: 0.33 + - _Smoothness: 0 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _StencilComp: 0 + - _StencilMode: 0 + - _StencilNo: 1 + - _StencilOpFail: 0 + - _StencilOpPass: 0 + - _StencilRef: 0 + - _StencilRefDepth: 8 + - _StencilRefDistortionVec: 4 + - _StencilRefGBuffer: 10 + - _StencilRefMV: 40 + - _StencilWriteMask: 6 + - _StencilWriteMaskDepth: 8 + - _StencilWriteMaskDistortionVec: 4 + - _StencilWriteMaskGBuffer: 14 + - _StencilWriteMaskMV: 40 + - _StepOffset: 0.04 + - _SupportDecals: 1 + - _SurfaceType: 0 + - _TessEdgeLength: 5 + - _TessExtrusionAmount: 0 + - _TessPhongStrength: 0.5 + - _TransparentBackfaceEnable: 0 + - _TransparentCullMode: 2 + - _TransparentDepthPostpassEnable: 0 + - _TransparentDepthPrepassEnable: 0 + - _TransparentEnabled: 0 + - _TransparentSortPriority: 0 + - _TransparentWritingMotionVec: 0 + - _TransparentZWrite: 0 + - _TweakHighColorOnShadow: 0 + - _TweakMatCapOnShadow: 0 + - _Tweak_HighColorMaskLevel: 0 + - _Tweak_LightDirection_MaskLevel: 0 + - _Tweak_MatCapUV: 0 + - _Tweak_MatcapMaskLevel: 0 + - _Tweak_RimLightMaskLevel: 0 + - _Tweak_ShadingGradeMapLevel: 0 + - _Tweak_SystemShadowsLevel: -0.5 + - _Tweak_transparency: 0 + - _UVSec: 0 + - _Unlit_Intensity: 1 + - _UseShadowThreshold: 0 + - _Use_1stAs2nd: 1 + - _Use_BaseAs1st: 1 + - _ZOverDrawMode: 0 + - _ZTestDepthEqualForOpaque: 3 + - _ZTestGBuffer: 4 + - _ZTestTransparent: 4 + - _ZWrite: 1 + - _ZWriteMode: 1 + - _simpleUI: 0 + - _utsTechnique: 1 + - _utsVersion: 2.07 + - _utsVersionX: 2 + - _utsVersionY: 2 + - _utsVersionZ: 0 + m_Colors: + - _1st_ShadeColor: {r: 0.49264705, g: 0.304282, b: 0.304282, a: 1} + - _2nd_ShadeColor: {r: 0.50735295, g: 0.39543685, b: 0.4533245, a: 1} + - _AngelRing_Color: {r: 1, g: 1, b: 1, a: 1} + - _Ap_RimLightColor: {r: 1, g: 0.80689657, b: 0, a: 1} + - _BaseColor: {r: 0.9433962, g: 0.9137382, b: 0.7698469, a: 1} + - _Color: {r: 0.990566, g: 0.83280253, b: 0.6952652, a: 1} + - _ColorShift: {r: 0, g: 0, b: 0, a: 1} + - _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0} + - _EmissionColor: {r: 1, g: 1, b: 1, a: 1} + - _Emissive_Color: {r: 0.21323532, g: 0, b: 0, a: 1} + - _HighColor: {r: 0, g: 0, b: 0, a: 1} + - _MatCapColor: {r: 1, g: 1, b: 1, a: 1} + - _Outline_Color: {r: 0.5294118, g: 0.22352937, b: 0.34159288, a: 1} + - _RimLightColor: {r: 1, g: 0, b: 0, a: 1} + - _Tiling: {r: 1, g: 1, b: 0, a: 0} + - _ViewShift: {r: 0, g: 0, b: 0, a: 1} + m_BuildTextureStacks: [] + m_AllowLocking: 1 +--- !u!114 &1856632363856593404 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: da692e001514ec24dbc4cca1949ff7e8, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 12 + hdPluginSubTargetMaterialVersions: + m_Keys: [] + m_Values: diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Face.mat.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Face.mat.meta new file mode 100644 index 00000000..c70fa8ce --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Face.mat.meta @@ -0,0 +1,16 @@ +fileFormatVersion: 2 +guid: 4bfb8e345eea4574ea3848039a393243 +timeCreated: 1544184610 +licenseType: Store +NativeFormatImporter: + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Face.mat + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Hair.mat b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Hair.mat new file mode 100644 index 00000000..bc323c93 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Hair.mat @@ -0,0 +1,405 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-3276637965404939782 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 639247ca83abc874e893eb93af2b5e44, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 0 +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Hair + m_Shader: {fileID: -6465566751694194690, guid: e0b73429f84a56840ba17b216237f806, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: + - _DISABLE_SSR_TRANSPARENT + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 2000 + stringTagMap: + IgnoreProjection: False + disabledShaderPasses: + - TransparentDepthPrepass + - TransparentDepthPostpass + - TransparentBackface + - RayTracingPrepass + - MOTIONVECTORS + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _1st_ShadeMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _2nd_ShadeMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AngelRing_Sampler: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BakedNormal: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BaseMap: + m_Texture: {fileID: 0} + 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} + - _ClippingMask: + 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} + - _Emissive_Tex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _HighColor_Tex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main: + 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} + - _MatCap_Sampler: + 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} + - _NormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _NormalMapForMatCap: + 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} + - _OutlineTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Outline_Sampler: + 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} + - _Set_1st_ShadePosition: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Set_2nd_ShadePosition: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Set_HighColorMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Set_MatcapMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Set_RimLightMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadingGradeMap: + m_Texture: {fileID: 2800000, guid: 0620c25d224d4d543936ec89321802b6, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _1st2nd_Shades_Feather: 0.591 + - _1st_ShadeColor_Feather: 0.307 + - _1st_ShadeColor_Step: 0.67 + - _2nd_ShadeColor_Feather: 0.591 + - _2nd_ShadeColor_Step: 0.55 + - _ARSampler_AlphaOn: 0 + - _AR_OffsetU: 0 + - _AR_OffsetV: 0.3 + - _AddPrecomputedVelocity: 0 + - _Add_Antipodean_RimLight: 0 + - _AlphaCutoffEnable: 0 + - _AlphaDstBlend: 0 + - _AlphaSrcBlend: 1 + - _AlphaToMask: 0 + - _AlphaToMaskInspectorValue: 0 + - _AngelRing: 0 + - _Ap_RimLight_FeatherOff: 0 + - _Ap_RimLight_Power: 0.1 + - _AutoRenderQueue: 1 + - _BUILTIN_QueueControl: 1 + - _BUILTIN_QueueOffset: 0 + - _BaseColor_Step: 0.67 + - _BaseShade_Feather: 0.307 + - _Base_Speed: 0 + - _BlendMode: 0 + - _BlurLevelMatcap: 0 + - _BlurLevelSGM: 0 + - _BumpScale: 1 + - _BumpScaleMatcap: 1 + - _CameraRolling_Stabilizer: 0 + - _ClippingMode: 0 + - _Clipping_Level: 0 + - _ColorBoost: 1 + - _ColorShift_Speed: 0 + - _ConservativeDepthOffsetEnable: 0 + - _CullMode: 2 + - _CullModeForward: 2 + - _Cutoff: 0.5 + - _DepthOffsetEnable: 0 + - _DetailNormalMapScale: 1 + - _DoubleSidedEnable: 0 + - _DoubleSidedGIMode: 0 + - _DoubleSidedNormalMode: 2 + - _DstBlend: 0 + - _EMISSIVE: 0 + - _EnableBlendModePreserveSpecularLighting: 1 + - _EnableFogOnTransparent: 1 + - _Farthest_Distance: 0 + - _GI_Intensity: 0 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _HighColor_Power: 0 + - _Inverse_Clipping: 0 + - _Inverse_MatcapMask: 0 + - _Inverse_Z_Axis_BLD: 1 + - _IsBaseMapAlphaAsClippingMask: 0 + - _Is_1st_ShadeColorOnly: 0 + - _Is_BLD: 0 + - _Is_BakedNormal: 0 + - _Is_BlendAddToHiColor: 0 + - _Is_BlendAddToMatCap: 1 + - _Is_BlendBaseColor: 1 + - _Is_ColorShift: 0 + - _Is_Filter_HiCutPointLightColor: 1 + - _Is_Filter_LightColor: 0 + - _Is_LightColor_1st_Shade: 1 + - _Is_LightColor_2nd_Shade: 1 + - _Is_LightColor_AR: 1 + - _Is_LightColor_Ap_RimLight: 1 + - _Is_LightColor_Base: 1 + - _Is_LightColor_HighColor: 1 + - _Is_LightColor_MatCap: 1 + - _Is_LightColor_Outline: 0 + - _Is_LightColor_RimLight: 1 + - _Is_NormalMap: 0 + - _Is_NormalMapForMatCap: 0 + - _Is_NormalMapToBase: 0 + - _Is_NormalMapToHighColor: 0 + - _Is_NormalMapToRimLight: 0 + - _Is_Ortho: 0 + - _Is_OutlineTex: 0 + - _Is_PingPong_Base: 0 + - _Is_SpecularToHighColor: 0 + - _Is_UseTweakHighColorOnShadow: 0 + - _Is_UseTweakMatCapOnShadow: 0 + - _Is_ViewCoord_Scroll: 0 + - _Is_ViewShift: 0 + - _LightDirection_MaskOn: 0 + - _MatCap: 0 + - _Metallic: 0 + - _Mode: 0 + - _Nearest_Distance: 1 + - _OUTLINE: 0 + - _OcclusionStrength: 1 + - _Offset_X_Axis_BLD: -0.05 + - _Offset_Y_Axis_BLD: 0.09 + - _Offset_Z: 1 + - _OpaqueCullMode: 2 + - _Outline_Width: 1.58 + - _Parallax: 0.02 + - _QueueControl: 0 + - _QueueOffset: 0 + - _RayTracing: 0 + - _ReceivesSSR: 1 + - _ReceivesSSRTransparent: 0 + - _RefractionModel: 0 + - _RenderQueueType: 1 + - _RequireSplitLighting: 0 + - _RimLight: 0 + - _RimLight_FeatherOff: 0 + - _RimLight_InsideMask: 0.0001 + - _RimLight_Power: 0.1 + - _Rotate_EmissiveUV: 0 + - _Rotate_MatCapUV: 0 + - _Rotate_NormalMapForMatCapUV: 0 + - _SPRDefaultUnlitColorMask: 15 + - _SRPDefaultUnlitColMode: 1 + - _Scroll_EmissiveU: 0 + - _Scroll_EmissiveV: 0 + - _Set_SystemShadowsToBase: 1 + - _ShadeColor_Step: 0.55 + - _Smoothness: 0 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _StencilComp: 0 + - _StencilMode: 0 + - _StencilNo: 1 + - _StencilOpFail: 0 + - _StencilOpPass: 0 + - _StencilRef: 0 + - _StencilRefDepth: 8 + - _StencilRefDistortionVec: 4 + - _StencilRefGBuffer: 10 + - _StencilRefMV: 40 + - _StencilWriteMask: 6 + - _StencilWriteMaskDepth: 8 + - _StencilWriteMaskDistortionVec: 4 + - _StencilWriteMaskGBuffer: 14 + - _StencilWriteMaskMV: 40 + - _StepOffset: 0 + - _SupportDecals: 1 + - _SurfaceType: 0 + - _TessEdgeLength: 5 + - _TessExtrusionAmount: 0 + - _TessPhongStrength: 0.5 + - _TransparentBackfaceEnable: 0 + - _TransparentCullMode: 2 + - _TransparentDepthPostpassEnable: 0 + - _TransparentDepthPrepassEnable: 0 + - _TransparentEnabled: 0 + - _TransparentSortPriority: 0 + - _TransparentWritingMotionVec: 0 + - _TransparentZWrite: 0 + - _TweakHighColorOnShadow: 0 + - _TweakMatCapOnShadow: 0 + - _Tweak_HighColorMaskLevel: 0 + - _Tweak_LightDirection_MaskLevel: 0 + - _Tweak_MatCapUV: 0 + - _Tweak_MatcapMaskLevel: 0 + - _Tweak_RimLightMaskLevel: 0 + - _Tweak_ShadingGradeMapLevel: 0 + - _Tweak_SystemShadowsLevel: 0 + - _Tweak_transparency: 0 + - _UVSec: 0 + - _Unlit_Intensity: 1 + - _UseShadowThreshold: 0 + - _Use_1stAs2nd: 1 + - _Use_BaseAs1st: 1 + - _ZOverDrawMode: 0 + - _ZTestDepthEqualForOpaque: 3 + - _ZTestGBuffer: 4 + - _ZTestTransparent: 4 + - _ZWrite: 1 + - _ZWriteMode: 1 + - _simpleUI: 0 + - _utsTechnique: 1 + - _utsVersion: 2.07 + - _utsVersionX: 2 + - _utsVersionY: 2 + - _utsVersionZ: 0 + m_Colors: + - _1st_ShadeColor: {r: 0.745283, g: 0.58061665, b: 0.46755964, a: 1} + - _2nd_ShadeColor: {r: 0.37334698, g: 0.29411766, b: 0.40392157, a: 1} + - _AngelRing_Color: {r: 1, g: 1, b: 1, a: 1} + - _Ap_RimLightColor: {r: 1, g: 1, b: 1, a: 1} + - _BaseColor: {r: 0.8962264, g: 0.83836275, b: 0.58762014, a: 1} + - _Color: {r: 0.8962264, g: 0.8383627, b: 0.58762014, a: 1} + - _ColorShift: {r: 0, g: 0, b: 0, a: 1} + - _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0} + - _EmissionColor: {r: 1, g: 1, b: 1, a: 1} + - _Emissive_Color: {r: 0, g: 0, b: 0, a: 1} + - _HighColor: {r: 0, g: 0, b: 0, a: 1} + - _MatCapColor: {r: 1, g: 1, b: 1, a: 1} + - _Outline_Color: {r: 0.6792453, g: 0.1505874, b: 0.1505874, a: 1} + - _RimLightColor: {r: 1, g: 1, b: 1, a: 1} + - _Tiling: {r: 1, g: 1, b: 0, a: 0} + - _ViewShift: {r: 0, g: 0, b: 0, a: 1} + m_BuildTextureStacks: [] + m_AllowLocking: 1 +--- !u!114 &5923415025961005905 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 10 +--- !u!114 &6202150226457244543 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: da692e001514ec24dbc4cca1949ff7e8, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 12 + hdPluginSubTargetMaterialVersions: + m_Keys: [] + m_Values: diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Hair.mat.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Hair.mat.meta new file mode 100644 index 00000000..0d86b7e9 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Hair.mat.meta @@ -0,0 +1,16 @@ +fileFormatVersion: 2 +guid: 8d079bda1b056ab40aa9dc79da22441f +timeCreated: 1544072709 +licenseType: Store +NativeFormatImporter: + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Hair.mat + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/HairPony.mat b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/HairPony.mat new file mode 100644 index 00000000..b784c4d1 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/HairPony.mat @@ -0,0 +1,405 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-8801799964885519558 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 10 +--- !u!114 &-7482000731104837112 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 639247ca83abc874e893eb93af2b5e44, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 0 +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: HairPony + m_Shader: {fileID: -6465566751694194690, guid: e0b73429f84a56840ba17b216237f806, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: + - _DISABLE_SSR_TRANSPARENT + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 2000 + stringTagMap: + IgnoreProjection: False + disabledShaderPasses: + - TransparentDepthPrepass + - TransparentDepthPostpass + - TransparentBackface + - RayTracingPrepass + - MOTIONVECTORS + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _1st_ShadeMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _2nd_ShadeMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AngelRing_Sampler: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BakedNormal: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BaseMap: + m_Texture: {fileID: 0} + 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} + - _ClippingMask: + 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} + - _Emissive_Tex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _HighColor_Tex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main: + 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} + - _MatCap_Sampler: + 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} + - _NormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _NormalMapForMatCap: + 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} + - _OutlineTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Outline_Sampler: + 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} + - _Set_1st_ShadePosition: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Set_2nd_ShadePosition: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Set_HighColorMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Set_MatcapMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Set_RimLightMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadingGradeMap: + m_Texture: {fileID: 2800000, guid: 0620c25d224d4d543936ec89321802b6, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _1st2nd_Shades_Feather: 0.625 + - _1st_ShadeColor_Feather: 0.055 + - _1st_ShadeColor_Step: 0.798 + - _2nd_ShadeColor_Feather: 0.625 + - _2nd_ShadeColor_Step: 0.625 + - _ARSampler_AlphaOn: 0 + - _AR_OffsetU: 0 + - _AR_OffsetV: 0.3 + - _AddPrecomputedVelocity: 0 + - _Add_Antipodean_RimLight: 0 + - _AlphaCutoffEnable: 0 + - _AlphaDstBlend: 0 + - _AlphaSrcBlend: 1 + - _AlphaToMask: 0 + - _AlphaToMaskInspectorValue: 0 + - _AngelRing: 0 + - _Ap_RimLight_FeatherOff: 0 + - _Ap_RimLight_Power: 0.1 + - _AutoRenderQueue: 1 + - _BUILTIN_QueueControl: 1 + - _BUILTIN_QueueOffset: 0 + - _BaseColor_Step: 0.798 + - _BaseShade_Feather: 0.055 + - _Base_Speed: 0 + - _BlendMode: 0 + - _BlurLevelMatcap: 0 + - _BlurLevelSGM: 0 + - _BumpScale: 1 + - _BumpScaleMatcap: 1 + - _CameraRolling_Stabilizer: 0 + - _ClippingMode: 0 + - _Clipping_Level: 0 + - _ColorBoost: 1 + - _ColorShift_Speed: 0 + - _ConservativeDepthOffsetEnable: 0 + - _CullMode: 2 + - _CullModeForward: 2 + - _Cutoff: 0.5 + - _DepthOffsetEnable: 0 + - _DetailNormalMapScale: 1 + - _DoubleSidedEnable: 0 + - _DoubleSidedGIMode: 0 + - _DoubleSidedNormalMode: 2 + - _DstBlend: 0 + - _EMISSIVE: 0 + - _EnableBlendModePreserveSpecularLighting: 1 + - _EnableFogOnTransparent: 1 + - _Farthest_Distance: 0 + - _GI_Intensity: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _HighColor_Power: 0 + - _Inverse_Clipping: 0 + - _Inverse_MatcapMask: 0 + - _Inverse_Z_Axis_BLD: 1 + - _IsBaseMapAlphaAsClippingMask: 0 + - _Is_1st_ShadeColorOnly: 0 + - _Is_BLD: 0 + - _Is_BakedNormal: 0 + - _Is_BlendAddToHiColor: 0 + - _Is_BlendAddToMatCap: 1 + - _Is_BlendBaseColor: 1 + - _Is_ColorShift: 0 + - _Is_Filter_HiCutPointLightColor: 1 + - _Is_Filter_LightColor: 0 + - _Is_LightColor_1st_Shade: 1 + - _Is_LightColor_2nd_Shade: 1 + - _Is_LightColor_AR: 1 + - _Is_LightColor_Ap_RimLight: 1 + - _Is_LightColor_Base: 1 + - _Is_LightColor_HighColor: 1 + - _Is_LightColor_MatCap: 1 + - _Is_LightColor_Outline: 0 + - _Is_LightColor_RimLight: 1 + - _Is_NormalMap: 0 + - _Is_NormalMapForMatCap: 0 + - _Is_NormalMapToBase: 0 + - _Is_NormalMapToHighColor: 0 + - _Is_NormalMapToRimLight: 0 + - _Is_Ortho: 0 + - _Is_OutlineTex: 0 + - _Is_PingPong_Base: 0 + - _Is_SpecularToHighColor: 0 + - _Is_UseTweakHighColorOnShadow: 0 + - _Is_UseTweakMatCapOnShadow: 0 + - _Is_ViewCoord_Scroll: 0 + - _Is_ViewShift: 0 + - _LightDirection_MaskOn: 0 + - _MatCap: 0 + - _Metallic: 0 + - _Mode: 0 + - _Nearest_Distance: 1 + - _OUTLINE: 0 + - _OcclusionStrength: 1 + - _Offset_X_Axis_BLD: -0.05 + - _Offset_Y_Axis_BLD: 0.09 + - _Offset_Z: 25 + - _OpaqueCullMode: 2 + - _Outline_Width: 2.32 + - _Parallax: 0.02 + - _QueueControl: 0 + - _QueueOffset: 0 + - _RayTracing: 0 + - _ReceivesSSR: 1 + - _ReceivesSSRTransparent: 0 + - _RefractionModel: 0 + - _RenderQueueType: 1 + - _RequireSplitLighting: 0 + - _RimLight: 0 + - _RimLight_FeatherOff: 0 + - _RimLight_InsideMask: 0.0001 + - _RimLight_Power: 0.1 + - _Rotate_EmissiveUV: 0 + - _Rotate_MatCapUV: 0 + - _Rotate_NormalMapForMatCapUV: 0 + - _SPRDefaultUnlitColorMask: 15 + - _SRPDefaultUnlitColMode: 1 + - _Scroll_EmissiveU: 0 + - _Scroll_EmissiveV: 0 + - _Set_SystemShadowsToBase: 1 + - _ShadeColor_Step: 0.625 + - _Smoothness: 0 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _StencilComp: 0 + - _StencilMode: 0 + - _StencilNo: 1 + - _StencilOpFail: 0 + - _StencilOpPass: 0 + - _StencilRef: 0 + - _StencilRefDepth: 8 + - _StencilRefDistortionVec: 4 + - _StencilRefGBuffer: 10 + - _StencilRefMV: 40 + - _StencilWriteMask: 6 + - _StencilWriteMaskDepth: 8 + - _StencilWriteMaskDistortionVec: 4 + - _StencilWriteMaskGBuffer: 14 + - _StencilWriteMaskMV: 40 + - _StepOffset: 0 + - _SupportDecals: 1 + - _SurfaceType: 0 + - _TessEdgeLength: 5 + - _TessExtrusionAmount: 0 + - _TessPhongStrength: 0.5 + - _TransparentBackfaceEnable: 0 + - _TransparentCullMode: 2 + - _TransparentDepthPostpassEnable: 0 + - _TransparentDepthPrepassEnable: 0 + - _TransparentEnabled: 0 + - _TransparentSortPriority: 0 + - _TransparentWritingMotionVec: 0 + - _TransparentZWrite: 0 + - _TweakHighColorOnShadow: 0 + - _TweakMatCapOnShadow: 0 + - _Tweak_HighColorMaskLevel: 0 + - _Tweak_LightDirection_MaskLevel: 0 + - _Tweak_MatCapUV: 0 + - _Tweak_MatcapMaskLevel: 0 + - _Tweak_RimLightMaskLevel: 0 + - _Tweak_ShadingGradeMapLevel: 0 + - _Tweak_SystemShadowsLevel: 0 + - _Tweak_transparency: 0 + - _UVSec: 0 + - _Unlit_Intensity: 1 + - _UseShadowThreshold: 0 + - _Use_1stAs2nd: 1 + - _Use_BaseAs1st: 1 + - _ZOverDrawMode: 0 + - _ZTestDepthEqualForOpaque: 3 + - _ZTestGBuffer: 4 + - _ZTestTransparent: 4 + - _ZWrite: 1 + - _ZWriteMode: 1 + - _simpleUI: 0 + - _utsTechnique: 1 + - _utsVersion: 2.07 + - _utsVersionX: 2 + - _utsVersionY: 2 + - _utsVersionZ: 0 + m_Colors: + - _1st_ShadeColor: {r: 0.745283, g: 0.58061665, b: 0.46755964, a: 1} + - _2nd_ShadeColor: {r: 0.37334698, g: 0.29411766, b: 0.40392157, a: 1} + - _AngelRing_Color: {r: 1, g: 1, b: 1, a: 1} + - _Ap_RimLightColor: {r: 1, g: 1, b: 1, a: 1} + - _BaseColor: {r: 0.8962264, g: 0.83836275, b: 0.58762014, a: 1} + - _Color: {r: 0.8962264, g: 0.8383627, b: 0.58762014, a: 1} + - _ColorShift: {r: 0, g: 0, b: 0, a: 1} + - _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0} + - _EmissionColor: {r: 1, g: 1, b: 1, a: 1} + - _Emissive_Color: {r: 0, g: 0, b: 0, a: 1} + - _HighColor: {r: 0, g: 0, b: 0, a: 1} + - _MatCapColor: {r: 1, g: 1, b: 1, a: 1} + - _Outline_Color: {r: 0.6792453, g: 0.1505874, b: 0.1505874, a: 1} + - _RimLightColor: {r: 1, g: 1, b: 1, a: 1} + - _Tiling: {r: 1, g: 1, b: 0, a: 0} + - _ViewShift: {r: 0, g: 0, b: 0, a: 1} + m_BuildTextureStacks: [] + m_AllowLocking: 1 +--- !u!114 &6789783673373974753 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: da692e001514ec24dbc4cca1949ff7e8, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 12 + hdPluginSubTargetMaterialVersions: + m_Keys: [] + m_Values: diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/HairPony.mat.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/HairPony.mat.meta new file mode 100644 index 00000000..702688ca --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/HairPony.mat.meta @@ -0,0 +1,16 @@ +fileFormatVersion: 2 +guid: 3ef43a7ac036e284a87d9da91a23d66d +timeCreated: 1544072709 +licenseType: Store +NativeFormatImporter: + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/HairPony.mat + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Headgear.mat b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Headgear.mat new file mode 100644 index 00000000..30426bb6 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Headgear.mat @@ -0,0 +1,405 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-2815431603641581785 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 10 +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Headgear + m_Shader: {fileID: -6465566751694194690, guid: e0b73429f84a56840ba17b216237f806, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: + - _DISABLE_SSR_TRANSPARENT + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 2000 + stringTagMap: + IgnoreProjection: False + disabledShaderPasses: + - TransparentDepthPrepass + - TransparentDepthPostpass + - TransparentBackface + - RayTracingPrepass + - MOTIONVECTORS + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _1st_ShadeMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _2nd_ShadeMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AngelRing_Sampler: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BakedNormal: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BaseMap: + m_Texture: {fileID: 2800000, guid: 1c7c498cd2a3d8a469703921d8e5a9c6, 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} + - _ClippingMask: + 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} + - _Emissive_Tex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _HighColor_Tex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main: + m_Texture: {fileID: 2800000, guid: a4a14922fc4479241aef660b68c498f5, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: a4a14922fc4479241aef660b68c498f5, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCap_Sampler: + 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} + - _NormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _NormalMapForMatCap: + 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} + - _OutlineTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Outline_Sampler: + 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} + - _Set_1st_ShadePosition: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Set_2nd_ShadePosition: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Set_HighColorMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Set_MatcapMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Set_RimLightMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadingGradeMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _1st2nd_Shades_Feather: 0.776 + - _1st_ShadeColor_Feather: 0.316 + - _1st_ShadeColor_Step: 0.56 + - _2nd_ShadeColor_Feather: 0.776 + - _2nd_ShadeColor_Step: 0.619 + - _ARSampler_AlphaOn: 0 + - _AR_OffsetU: 0 + - _AR_OffsetV: 0.3 + - _AddPrecomputedVelocity: 0 + - _Add_Antipodean_RimLight: 0 + - _AlphaCutoffEnable: 0 + - _AlphaDstBlend: 0 + - _AlphaSrcBlend: 1 + - _AlphaToMask: 0 + - _AlphaToMaskInspectorValue: 0 + - _AngelRing: 0 + - _Ap_RimLight_FeatherOff: 0 + - _Ap_RimLight_Power: 0.1 + - _AutoRenderQueue: 1 + - _BUILTIN_QueueControl: 1 + - _BUILTIN_QueueOffset: 0 + - _BaseColor_Step: 0.56 + - _BaseShade_Feather: 0.316 + - _Base_Speed: 0 + - _BlendMode: 0 + - _BlurLevelMatcap: 0 + - _BlurLevelSGM: 0 + - _BumpScale: 1 + - _BumpScaleMatcap: 1 + - _CameraRolling_Stabilizer: 0 + - _ClippingMode: 0 + - _Clipping_Level: 0 + - _ColorBoost: 1 + - _ColorShift_Speed: 0 + - _ConservativeDepthOffsetEnable: 0 + - _CullMode: 2 + - _CullModeForward: 2 + - _Cutoff: 0.5 + - _DepthOffsetEnable: 0 + - _DetailNormalMapScale: 1 + - _DoubleSidedEnable: 0 + - _DoubleSidedGIMode: 0 + - _DoubleSidedNormalMode: 2 + - _DstBlend: 0 + - _EMISSIVE: 0 + - _EnableBlendModePreserveSpecularLighting: 1 + - _EnableFogOnTransparent: 1 + - _Farthest_Distance: 0 + - _GI_Intensity: 0 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _HighColor_Power: 0 + - _Inverse_Clipping: 0 + - _Inverse_MatcapMask: 0 + - _Inverse_Z_Axis_BLD: 1 + - _IsBaseMapAlphaAsClippingMask: 0 + - _Is_1st_ShadeColorOnly: 0 + - _Is_BLD: 0 + - _Is_BakedNormal: 0 + - _Is_BlendAddToHiColor: 0 + - _Is_BlendAddToMatCap: 1 + - _Is_BlendBaseColor: 1 + - _Is_ColorShift: 0 + - _Is_Filter_HiCutPointLightColor: 1 + - _Is_Filter_LightColor: 0 + - _Is_LightColor_1st_Shade: 1 + - _Is_LightColor_2nd_Shade: 1 + - _Is_LightColor_AR: 1 + - _Is_LightColor_Ap_RimLight: 1 + - _Is_LightColor_Base: 1 + - _Is_LightColor_HighColor: 1 + - _Is_LightColor_MatCap: 1 + - _Is_LightColor_Outline: 1 + - _Is_LightColor_RimLight: 1 + - _Is_NormalMap: 0 + - _Is_NormalMapForMatCap: 0 + - _Is_NormalMapToBase: 0 + - _Is_NormalMapToHighColor: 0 + - _Is_NormalMapToRimLight: 0 + - _Is_Ortho: 0 + - _Is_OutlineTex: 0 + - _Is_PingPong_Base: 0 + - _Is_SpecularToHighColor: 0 + - _Is_UseTweakHighColorOnShadow: 0 + - _Is_UseTweakMatCapOnShadow: 0 + - _Is_ViewCoord_Scroll: 0 + - _Is_ViewShift: 0 + - _LightDirection_MaskOn: 0 + - _MatCap: 0 + - _Metallic: 0 + - _Mode: 0 + - _Nearest_Distance: 1 + - _OUTLINE: 0 + - _OcclusionStrength: 1 + - _Offset_X_Axis_BLD: -0.05 + - _Offset_Y_Axis_BLD: 0.09 + - _Offset_Z: 0 + - _OpaqueCullMode: 2 + - _Outline_Width: 1.5 + - _Parallax: 0.02 + - _QueueControl: 0 + - _QueueOffset: 0 + - _RayTracing: 0 + - _ReceivesSSR: 1 + - _ReceivesSSRTransparent: 0 + - _RefractionModel: 0 + - _RenderQueueType: 1 + - _RequireSplitLighting: 0 + - _RimLight: 0 + - _RimLight_FeatherOff: 0 + - _RimLight_InsideMask: 0.0001 + - _RimLight_Power: 0.1 + - _Rotate_EmissiveUV: 0 + - _Rotate_MatCapUV: 0 + - _Rotate_NormalMapForMatCapUV: 0 + - _SPRDefaultUnlitColorMask: 15 + - _SRPDefaultUnlitColMode: 1 + - _Scroll_EmissiveU: 0 + - _Scroll_EmissiveV: 0 + - _Set_SystemShadowsToBase: 1 + - _ShadeColor_Step: 0.619 + - _Smoothness: 0 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _StencilComp: 0 + - _StencilMode: 0 + - _StencilNo: 1 + - _StencilOpFail: 0 + - _StencilOpPass: 0 + - _StencilRef: 0 + - _StencilRefDepth: 8 + - _StencilRefDistortionVec: 4 + - _StencilRefGBuffer: 10 + - _StencilRefMV: 40 + - _StencilWriteMask: 6 + - _StencilWriteMaskDepth: 8 + - _StencilWriteMaskDistortionVec: 4 + - _StencilWriteMaskGBuffer: 14 + - _StencilWriteMaskMV: 40 + - _StepOffset: 0 + - _SupportDecals: 1 + - _SurfaceType: 0 + - _TessEdgeLength: 5 + - _TessExtrusionAmount: 0 + - _TessPhongStrength: 0.5 + - _TransparentBackfaceEnable: 0 + - _TransparentCullMode: 2 + - _TransparentDepthPostpassEnable: 0 + - _TransparentDepthPrepassEnable: 0 + - _TransparentEnabled: 0 + - _TransparentSortPriority: 0 + - _TransparentWritingMotionVec: 0 + - _TransparentZWrite: 0 + - _TweakHighColorOnShadow: 0 + - _TweakMatCapOnShadow: 0 + - _Tweak_HighColorMaskLevel: 0 + - _Tweak_LightDirection_MaskLevel: 0 + - _Tweak_MatCapUV: 0 + - _Tweak_MatcapMaskLevel: 0 + - _Tweak_RimLightMaskLevel: 0 + - _Tweak_ShadingGradeMapLevel: 0 + - _Tweak_SystemShadowsLevel: 0 + - _Tweak_transparency: 0 + - _UVSec: 0 + - _Unlit_Intensity: 1 + - _UseShadowThreshold: 0 + - _Use_1stAs2nd: 1 + - _Use_BaseAs1st: 1 + - _ZOverDrawMode: 0 + - _ZTestDepthEqualForOpaque: 3 + - _ZTestGBuffer: 4 + - _ZTestTransparent: 4 + - _ZWrite: 1 + - _ZWriteMode: 1 + - _simpleUI: 0 + - _utsTechnique: 1 + - _utsVersion: 2.07 + - _utsVersionX: 2 + - _utsVersionY: 2 + - _utsVersionZ: 0 + m_Colors: + - _1st_ShadeColor: {r: 0.5580278, g: 0.6476488, b: 0.7169812, a: 1} + - _2nd_ShadeColor: {r: 0.2654909, g: 0.2524475, b: 0.2924528, a: 1} + - _AngelRing_Color: {r: 1, g: 1, b: 1, a: 1} + - _Ap_RimLightColor: {r: 1, g: 1, b: 1, a: 1} + - _BaseColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorShift: {r: 0, g: 0, b: 0, a: 1} + - _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0} + - _EmissionColor: {r: 1, g: 1, b: 1, a: 1} + - _Emissive_Color: {r: 0, g: 0, b: 0, a: 1} + - _HighColor: {r: 0, g: 0, b: 0, a: 1} + - _MatCapColor: {r: 1, g: 1, b: 1, a: 1} + - _Outline_Color: {r: 0.4056604, g: 0.33340088, b: 0.2238786, a: 1} + - _RimLightColor: {r: 1, g: 1, b: 1, a: 1} + - _Tiling: {r: 1, g: 1, b: 0, a: 0} + - _ViewShift: {r: 0, g: 0, b: 0, a: 1} + m_BuildTextureStacks: [] + m_AllowLocking: 1 +--- !u!114 &4572752908142662559 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 639247ca83abc874e893eb93af2b5e44, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 0 +--- !u!114 &7100622548993059210 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: da692e001514ec24dbc4cca1949ff7e8, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 12 + hdPluginSubTargetMaterialVersions: + m_Keys: [] + m_Values: diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Headgear.mat.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Headgear.mat.meta new file mode 100644 index 00000000..23aa5060 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Headgear.mat.meta @@ -0,0 +1,16 @@ +fileFormatVersion: 2 +guid: c16b248a968fde5488f78283549588ca +timeCreated: 1544072709 +licenseType: Store +NativeFormatImporter: + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Headgear.mat + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/LongSleeve Back.mat b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/LongSleeve Back.mat new file mode 100644 index 00000000..36abf9be --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/LongSleeve Back.mat @@ -0,0 +1,405 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: LongSleeve Back + m_Shader: {fileID: -6465566751694194690, guid: e0b73429f84a56840ba17b216237f806, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: + - _DISABLE_SSR_TRANSPARENT + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 2000 + stringTagMap: + IgnoreProjection: False + disabledShaderPasses: + - TransparentDepthPrepass + - TransparentDepthPostpass + - TransparentBackface + - RayTracingPrepass + - MOTIONVECTORS + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _1st_ShadeMap: + m_Texture: {fileID: 2800000, guid: f180dfef53ad0924882657e28833a60b, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _2nd_ShadeMap: + m_Texture: {fileID: 2800000, guid: 9cd90983043e3974e971a6c8d66cc42d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AngelRing_Sampler: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BakedNormal: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BaseMap: + m_Texture: {fileID: 2800000, guid: d6a0b548a02e12e4e954cb6c5bb20e70, 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} + - _ClippingMask: + 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} + - _Emissive_Tex: + m_Texture: {fileID: 2800000, guid: dc71d88ff73488f45ac239b21f552745, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _HighColor_Tex: + m_Texture: {fileID: 2800000, guid: a01adb17bdc53ba4da348b3cba074154, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: d1e50199c6f08ed46bf2d136ab225409, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCap_Sampler: + 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} + - _NormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _NormalMapForMatCap: + 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} + - _OutlineTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Outline_Sampler: + 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} + - _Set_1st_ShadePosition: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Set_2nd_ShadePosition: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Set_HighColorMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Set_MatcapMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Set_RimLightMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadingGradeMap: + m_Texture: {fileID: 2800000, guid: 7c75a3dfe8927774ea56a0777d1edcf1, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _1st2nd_Shades_Feather: 0.776 + - _1st_ShadeColor_Feather: 0.335 + - _1st_ShadeColor_Step: 0.677 + - _2nd_ShadeColor_Feather: 0.776 + - _2nd_ShadeColor_Step: 0.618 + - _ARSampler_AlphaOn: 0 + - _AR_OffsetU: 0 + - _AR_OffsetV: 0.3 + - _AddPrecomputedVelocity: 0 + - _Add_Antipodean_RimLight: 0 + - _AlphaCutoffEnable: 0 + - _AlphaDstBlend: 0 + - _AlphaSrcBlend: 1 + - _AlphaToMask: 0 + - _AlphaToMaskInspectorValue: 0 + - _AngelRing: 0 + - _Ap_RimLight_FeatherOff: 0 + - _Ap_RimLight_Power: 0.1 + - _AutoRenderQueue: 1 + - _BUILTIN_QueueControl: -1 + - _BUILTIN_QueueOffset: 0 + - _BaseColor_Step: 0.677 + - _BaseShade_Feather: 0.335 + - _Base_Speed: 0 + - _BlendMode: 0 + - _BlurLevelMatcap: 0 + - _BlurLevelSGM: 0 + - _BumpScale: 1 + - _BumpScaleMatcap: 1 + - _CameraRolling_Stabilizer: 0 + - _ClippingMode: 0 + - _Clipping_Level: 0 + - _ColorBoost: 1 + - _ColorShift_Speed: 0 + - _ConservativeDepthOffsetEnable: 0 + - _CullMode: 2 + - _CullModeForward: 2 + - _Cutoff: 0.5 + - _DepthOffsetEnable: 0 + - _DetailNormalMapScale: 1 + - _DoubleSidedEnable: 0 + - _DoubleSidedGIMode: 0 + - _DoubleSidedNormalMode: 2 + - _DstBlend: 0 + - _EMISSIVE: 0 + - _EnableBlendModePreserveSpecularLighting: 1 + - _EnableFogOnTransparent: 1 + - _Farthest_Distance: 0 + - _GI_Intensity: 0 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _HighColor_Power: 0.48 + - _Inverse_Clipping: 0 + - _Inverse_MatcapMask: 0 + - _Inverse_Z_Axis_BLD: 1 + - _IsBaseMapAlphaAsClippingMask: 0 + - _Is_1st_ShadeColorOnly: 0 + - _Is_BLD: 0 + - _Is_BakedNormal: 0 + - _Is_BlendAddToHiColor: 1 + - _Is_BlendAddToMatCap: 1 + - _Is_BlendBaseColor: 1 + - _Is_ColorShift: 0 + - _Is_Filter_HiCutPointLightColor: 1 + - _Is_Filter_LightColor: 0 + - _Is_LightColor_1st_Shade: 1 + - _Is_LightColor_2nd_Shade: 1 + - _Is_LightColor_AR: 1 + - _Is_LightColor_Ap_RimLight: 1 + - _Is_LightColor_Base: 1 + - _Is_LightColor_HighColor: 0 + - _Is_LightColor_MatCap: 1 + - _Is_LightColor_Outline: 1 + - _Is_LightColor_RimLight: 1 + - _Is_NormalMap: 0 + - _Is_NormalMapForMatCap: 0 + - _Is_NormalMapToBase: 0 + - _Is_NormalMapToHighColor: 0 + - _Is_NormalMapToRimLight: 0 + - _Is_Ortho: 0 + - _Is_OutlineTex: 1 + - _Is_PingPong_Base: 0 + - _Is_SpecularToHighColor: 0 + - _Is_UseTweakHighColorOnShadow: 0 + - _Is_UseTweakMatCapOnShadow: 0 + - _Is_ViewCoord_Scroll: 0 + - _Is_ViewShift: 0 + - _LightDirection_MaskOn: 0 + - _MatCap: 0 + - _Metallic: 0 + - _Mode: 0 + - _Nearest_Distance: 1 + - _OUTLINE: 0 + - _OcclusionStrength: 1 + - _Offset_X_Axis_BLD: -0.05 + - _Offset_Y_Axis_BLD: 0.09 + - _Offset_Z: 2 + - _OpaqueCullMode: 2 + - _Outline_Width: 1.5 + - _Parallax: 0.02 + - _QueueControl: 0 + - _QueueOffset: 0 + - _RayTracing: 0 + - _ReceivesSSR: 1 + - _ReceivesSSRTransparent: 0 + - _RefractionModel: 0 + - _RenderQueueType: 1 + - _RequireSplitLighting: 0 + - _RimLight: 0 + - _RimLight_FeatherOff: 1 + - _RimLight_InsideMask: 0.47 + - _RimLight_Power: 0.01 + - _Rotate_EmissiveUV: 0 + - _Rotate_MatCapUV: 0 + - _Rotate_NormalMapForMatCapUV: 0 + - _SPRDefaultUnlitColorMask: 15 + - _SRPDefaultUnlitColMode: 1 + - _Scroll_EmissiveU: 0 + - _Scroll_EmissiveV: 0 + - _Set_SystemShadowsToBase: 1 + - _ShadeColor_Step: 0.618 + - _Smoothness: 0 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _StencilComp: 0 + - _StencilMode: 0 + - _StencilNo: 1 + - _StencilOpFail: 0 + - _StencilOpPass: 0 + - _StencilRef: 0 + - _StencilRefDepth: 8 + - _StencilRefDistortionVec: 4 + - _StencilRefGBuffer: 10 + - _StencilRefMV: 40 + - _StencilWriteMask: 6 + - _StencilWriteMaskDepth: 8 + - _StencilWriteMaskDistortionVec: 4 + - _StencilWriteMaskGBuffer: 14 + - _StencilWriteMaskMV: 40 + - _StepOffset: 0 + - _SupportDecals: 1 + - _SurfaceType: 0 + - _TessEdgeLength: 5 + - _TessExtrusionAmount: 0 + - _TessPhongStrength: 0.5 + - _TransparentBackfaceEnable: 0 + - _TransparentCullMode: 2 + - _TransparentDepthPostpassEnable: 0 + - _TransparentDepthPrepassEnable: 0 + - _TransparentEnabled: 0 + - _TransparentSortPriority: 0 + - _TransparentWritingMotionVec: 0 + - _TransparentZWrite: 0 + - _TweakHighColorOnShadow: 0 + - _TweakMatCapOnShadow: 0 + - _Tweak_HighColorMaskLevel: 0 + - _Tweak_LightDirection_MaskLevel: 0 + - _Tweak_MatCapUV: 0 + - _Tweak_MatcapMaskLevel: 0 + - _Tweak_RimLightMaskLevel: 0 + - _Tweak_ShadingGradeMapLevel: 0 + - _Tweak_SystemShadowsLevel: 0 + - _Tweak_transparency: 0 + - _UVSec: 0 + - _Unlit_Intensity: 1 + - _UseShadowThreshold: 0 + - _Use_1stAs2nd: 0 + - _Use_BaseAs1st: 0 + - _ZOverDrawMode: 0 + - _ZTestDepthEqualForOpaque: 3 + - _ZTestGBuffer: 4 + - _ZTestTransparent: 4 + - _ZWrite: 1 + - _ZWriteMode: 1 + - _simpleUI: 2 + - _utsTechnique: 1 + - _utsVersion: 2.07 + - _utsVersionX: 2 + - _utsVersionY: 2 + - _utsVersionZ: 0 + m_Colors: + - _1st_ShadeColor: {r: 1, g: 1, b: 1, a: 1} + - _2nd_ShadeColor: {r: 1, g: 1, b: 1, a: 1} + - _AngelRing_Color: {r: 1, g: 1, b: 1, a: 1} + - _Ap_RimLightColor: {r: 1, g: 1, b: 1, a: 1} + - _BaseColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorShift: {r: 0, g: 0, b: 0, a: 1} + - _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0} + - _EmissionColor: {r: 1, g: 1, b: 1, a: 1} + - _Emissive_Color: {r: 5.2780313, g: 5.2780313, b: 5.2780313, a: 1} + - _HighColor: {r: 0.3962264, g: 0.33053476, b: 0.25978997, a: 1} + - _MatCapColor: {r: 1, g: 1, b: 1, a: 1} + - _Outline_Color: {r: 0, g: 0, b: 0, a: 1} + - _RimLightColor: {r: 0, g: 0.8758622, b: 1, a: 1} + - _Tiling: {r: 1, g: 1, b: 0, a: 0} + - _ViewShift: {r: 0, g: 0, b: 0, a: 1} + m_BuildTextureStacks: [] + m_AllowLocking: 1 +--- !u!114 &242505081636331739 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 10 +--- !u!114 &1781190763146025199 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: da692e001514ec24dbc4cca1949ff7e8, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 12 + hdPluginSubTargetMaterialVersions: + m_Keys: [] + m_Values: +--- !u!114 &6621973610829896646 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 639247ca83abc874e893eb93af2b5e44, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 0 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/LongSleeve Back.mat.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/LongSleeve Back.mat.meta new file mode 100644 index 00000000..740db15a --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/LongSleeve Back.mat.meta @@ -0,0 +1,16 @@ +fileFormatVersion: 2 +guid: 1f9555b9b84a8db44b796ecf62912b2a +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/LongSleeve + Back.mat + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/LongSleeve.mat b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/LongSleeve.mat new file mode 100644 index 00000000..cf100497 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/LongSleeve.mat @@ -0,0 +1,405 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-2573086500142053668 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: da692e001514ec24dbc4cca1949ff7e8, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 12 + hdPluginSubTargetMaterialVersions: + m_Keys: [] + m_Values: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: LongSleeve + m_Shader: {fileID: -6465566751694194690, guid: e0b73429f84a56840ba17b216237f806, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: + - _DISABLE_SSR_TRANSPARENT + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 2000 + stringTagMap: + IgnoreProjection: False + disabledShaderPasses: + - TransparentDepthPrepass + - TransparentDepthPostpass + - TransparentBackface + - RayTracingPrepass + - MOTIONVECTORS + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _1st_ShadeMap: + m_Texture: {fileID: 2800000, guid: f180dfef53ad0924882657e28833a60b, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _2nd_ShadeMap: + m_Texture: {fileID: 2800000, guid: 9cd90983043e3974e971a6c8d66cc42d, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AngelRing_Sampler: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BakedNormal: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BaseMap: + m_Texture: {fileID: 2800000, guid: d6a0b548a02e12e4e954cb6c5bb20e70, 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} + - _ClippingMask: + 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} + - _Emissive_Tex: + m_Texture: {fileID: 2800000, guid: dc71d88ff73488f45ac239b21f552745, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _HighColor_Tex: + m_Texture: {fileID: 2800000, guid: a01adb17bdc53ba4da348b3cba074154, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main: + m_Texture: {fileID: 2800000, guid: d1e50199c6f08ed46bf2d136ab225409, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: d1e50199c6f08ed46bf2d136ab225409, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCap_Sampler: + 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} + - _NormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _NormalMapForMatCap: + 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} + - _OutlineTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Outline_Sampler: + 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} + - _Set_1st_ShadePosition: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Set_2nd_ShadePosition: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Set_HighColorMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Set_MatcapMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Set_RimLightMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadingGradeMap: + m_Texture: {fileID: 2800000, guid: 7c75a3dfe8927774ea56a0777d1edcf1, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _1st2nd_Shades_Feather: 0.776 + - _1st_ShadeColor_Feather: 0.335 + - _1st_ShadeColor_Step: 0.677 + - _2nd_ShadeColor_Feather: 0.776 + - _2nd_ShadeColor_Step: 0.618 + - _ARSampler_AlphaOn: 0 + - _AR_OffsetU: 0 + - _AR_OffsetV: 0.3 + - _AddPrecomputedVelocity: 0 + - _Add_Antipodean_RimLight: 0 + - _AlphaCutoffEnable: 0 + - _AlphaDstBlend: 0 + - _AlphaSrcBlend: 1 + - _AlphaToMask: 0 + - _AlphaToMaskInspectorValue: 0 + - _AngelRing: 0 + - _Ap_RimLight_FeatherOff: 0 + - _Ap_RimLight_Power: 0.1 + - _AutoRenderQueue: 1 + - _BUILTIN_QueueControl: 1 + - _BUILTIN_QueueOffset: 0 + - _BaseColor_Step: 0.677 + - _BaseShade_Feather: 0.335 + - _Base_Speed: 0 + - _BlendMode: 0 + - _BlurLevelMatcap: 0 + - _BlurLevelSGM: 0 + - _BumpScale: 1 + - _BumpScaleMatcap: 1 + - _CameraRolling_Stabilizer: 0 + - _ClippingMode: 0 + - _Clipping_Level: 0 + - _ColorBoost: 1 + - _ColorShift_Speed: 0 + - _ConservativeDepthOffsetEnable: 0 + - _CullMode: 2 + - _CullModeForward: 2 + - _Cutoff: 0.5 + - _DepthOffsetEnable: 0 + - _DetailNormalMapScale: 1 + - _DoubleSidedEnable: 0 + - _DoubleSidedGIMode: 0 + - _DoubleSidedNormalMode: 2 + - _DstBlend: 0 + - _EMISSIVE: 0 + - _EnableBlendModePreserveSpecularLighting: 1 + - _EnableFogOnTransparent: 1 + - _Farthest_Distance: 0 + - _GI_Intensity: 0 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _HighColor_Power: 0.48 + - _Inverse_Clipping: 0 + - _Inverse_MatcapMask: 0 + - _Inverse_Z_Axis_BLD: 1 + - _IsBaseMapAlphaAsClippingMask: 0 + - _Is_1st_ShadeColorOnly: 0 + - _Is_BLD: 0 + - _Is_BakedNormal: 0 + - _Is_BlendAddToHiColor: 1 + - _Is_BlendAddToMatCap: 1 + - _Is_BlendBaseColor: 1 + - _Is_ColorShift: 0 + - _Is_Filter_HiCutPointLightColor: 1 + - _Is_Filter_LightColor: 0 + - _Is_LightColor_1st_Shade: 1 + - _Is_LightColor_2nd_Shade: 1 + - _Is_LightColor_AR: 1 + - _Is_LightColor_Ap_RimLight: 1 + - _Is_LightColor_Base: 1 + - _Is_LightColor_HighColor: 0 + - _Is_LightColor_MatCap: 1 + - _Is_LightColor_Outline: 1 + - _Is_LightColor_RimLight: 1 + - _Is_NormalMap: 0 + - _Is_NormalMapForMatCap: 0 + - _Is_NormalMapToBase: 0 + - _Is_NormalMapToHighColor: 0 + - _Is_NormalMapToRimLight: 0 + - _Is_Ortho: 0 + - _Is_OutlineTex: 1 + - _Is_PingPong_Base: 0 + - _Is_SpecularToHighColor: 0 + - _Is_UseTweakHighColorOnShadow: 0 + - _Is_UseTweakMatCapOnShadow: 0 + - _Is_ViewCoord_Scroll: 0 + - _Is_ViewShift: 0 + - _LightDirection_MaskOn: 0 + - _MatCap: 0 + - _Metallic: 0 + - _Mode: 0 + - _Nearest_Distance: 1 + - _OUTLINE: 0 + - _OcclusionStrength: 1 + - _Offset_X_Axis_BLD: -0.05 + - _Offset_Y_Axis_BLD: 0.09 + - _Offset_Z: 2 + - _OpaqueCullMode: 2 + - _Outline_Width: 1.5 + - _Parallax: 0.02 + - _QueueControl: 0 + - _QueueOffset: 0 + - _RayTracing: 0 + - _ReceivesSSR: 1 + - _ReceivesSSRTransparent: 0 + - _RefractionModel: 0 + - _RenderQueueType: 1 + - _RequireSplitLighting: 0 + - _RimLight: 0 + - _RimLight_FeatherOff: 1 + - _RimLight_InsideMask: 0.47 + - _RimLight_Power: 0.01 + - _Rotate_EmissiveUV: 0 + - _Rotate_MatCapUV: 0 + - _Rotate_NormalMapForMatCapUV: 0 + - _SPRDefaultUnlitColorMask: 15 + - _SRPDefaultUnlitColMode: 1 + - _Scroll_EmissiveU: 0 + - _Scroll_EmissiveV: 0 + - _Set_SystemShadowsToBase: 1 + - _ShadeColor_Step: 0.618 + - _Smoothness: 0 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _StencilComp: 0 + - _StencilMode: 0 + - _StencilNo: 1 + - _StencilOpFail: 0 + - _StencilOpPass: 0 + - _StencilRef: 0 + - _StencilRefDepth: 8 + - _StencilRefDistortionVec: 4 + - _StencilRefGBuffer: 10 + - _StencilRefMV: 40 + - _StencilWriteMask: 6 + - _StencilWriteMaskDepth: 8 + - _StencilWriteMaskDistortionVec: 4 + - _StencilWriteMaskGBuffer: 14 + - _StencilWriteMaskMV: 40 + - _StepOffset: 0 + - _SupportDecals: 1 + - _SurfaceType: 0 + - _TessEdgeLength: 5 + - _TessExtrusionAmount: 0 + - _TessPhongStrength: 0.5 + - _TransparentBackfaceEnable: 0 + - _TransparentCullMode: 2 + - _TransparentDepthPostpassEnable: 0 + - _TransparentDepthPrepassEnable: 0 + - _TransparentEnabled: 0 + - _TransparentSortPriority: 0 + - _TransparentWritingMotionVec: 0 + - _TransparentZWrite: 0 + - _TweakHighColorOnShadow: 0 + - _TweakMatCapOnShadow: 0 + - _Tweak_HighColorMaskLevel: 0 + - _Tweak_LightDirection_MaskLevel: 0 + - _Tweak_MatCapUV: 0 + - _Tweak_MatcapMaskLevel: 0 + - _Tweak_RimLightMaskLevel: 0 + - _Tweak_ShadingGradeMapLevel: 0 + - _Tweak_SystemShadowsLevel: 0 + - _Tweak_transparency: 0 + - _UVSec: 0 + - _Unlit_Intensity: 1 + - _UseShadowThreshold: 0 + - _Use_1stAs2nd: 0 + - _Use_BaseAs1st: 0 + - _ZOverDrawMode: 0 + - _ZTestDepthEqualForOpaque: 3 + - _ZTestGBuffer: 4 + - _ZTestTransparent: 4 + - _ZWrite: 1 + - _ZWriteMode: 1 + - _simpleUI: 2 + - _utsTechnique: 1 + - _utsVersion: 2.07 + - _utsVersionX: 2 + - _utsVersionY: 2 + - _utsVersionZ: 0 + m_Colors: + - _1st_ShadeColor: {r: 1, g: 1, b: 1, a: 1} + - _2nd_ShadeColor: {r: 1, g: 1, b: 1, a: 1} + - _AngelRing_Color: {r: 1, g: 1, b: 1, a: 1} + - _Ap_RimLightColor: {r: 1, g: 1, b: 1, a: 1} + - _BaseColor: {r: 1, g: 1, b: 1, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _ColorShift: {r: 0, g: 0, b: 0, a: 1} + - _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0} + - _EmissionColor: {r: 1, g: 1, b: 1, a: 1} + - _Emissive_Color: {r: 5.2780313, g: 5.2780313, b: 5.2780313, a: 1} + - _HighColor: {r: 0.3962264, g: 0.33053476, b: 0.25978997, a: 1} + - _MatCapColor: {r: 1, g: 1, b: 1, a: 1} + - _Outline_Color: {r: 0, g: 0, b: 0, a: 1} + - _RimLightColor: {r: 0, g: 0.8758622, b: 1, a: 1} + - _Tiling: {r: 1, g: 1, b: 0, a: 0} + - _ViewShift: {r: 0, g: 0, b: 0, a: 1} + m_BuildTextureStacks: [] + m_AllowLocking: 1 +--- !u!114 &242505081636331739 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 10 +--- !u!114 &6621973610829896646 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 639247ca83abc874e893eb93af2b5e44, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 0 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/LongSleeve.mat.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/LongSleeve.mat.meta new file mode 100644 index 00000000..eb5e6184 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/LongSleeve.mat.meta @@ -0,0 +1,16 @@ +fileFormatVersion: 2 +guid: 002064652c69eba4699de7e0319b02dc +timeCreated: 1544184610 +licenseType: Store +NativeFormatImporter: + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/LongSleeve.mat + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Skin.mat b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Skin.mat new file mode 100644 index 00000000..4e8a1e47 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Skin.mat @@ -0,0 +1,405 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-7024018919946654760 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 10 +--- !u!114 &-2976717314438926610 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 639247ca83abc874e893eb93af2b5e44, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 0 +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Skin + m_Shader: {fileID: -6465566751694194690, guid: e0b73429f84a56840ba17b216237f806, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: + - _DISABLE_SSR_TRANSPARENT + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 2000 + stringTagMap: + IgnoreProjection: False + disabledShaderPasses: + - TransparentDepthPrepass + - TransparentDepthPostpass + - TransparentBackface + - RayTracingPrepass + - MOTIONVECTORS + m_LockedProperties: + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _1st_ShadeMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _2nd_ShadeMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _AngelRing_Sampler: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BakedNormal: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BaseMap: + m_Texture: {fileID: 0} + 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} + - _ClippingMask: + 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} + - _Emissive_Tex: + m_Texture: {fileID: 2800000, guid: 5ca59e98250004241ac83aa8c82eecd3, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _HighColor_Tex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Main: + m_Texture: {fileID: 2800000, guid: 415a7cc21eec4e94fa9ae0b2078f352c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 415a7cc21eec4e94fa9ae0b2078f352c, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MatCap_Sampler: + 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} + - _NormalMap: + m_Texture: {fileID: 2800000, guid: 4243081d0d648654ead0ba36af1cc134, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _NormalMapForMatCap: + 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} + - _OutlineTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Outline_Sampler: + 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} + - _Set_1st_ShadePosition: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Set_2nd_ShadePosition: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Set_HighColorMask: + m_Texture: {fileID: 2800000, guid: 3f05059980aad7443bb782b29a2af1c3, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Set_MatcapMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Set_RimLightMask: + m_Texture: {fileID: 2800000, guid: 55e006481a55b4947b38566992e7bfd0, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ShadingGradeMap: + m_Texture: {fileID: 2800000, guid: 98574cca734649441bf1127cbec80f76, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _1st2nd_Shades_Feather: 0.25 + - _1st_ShadeColor_Feather: 0.54 + - _1st_ShadeColor_Step: 0.39 + - _2nd_ShadeColor_Feather: 0.25 + - _2nd_ShadeColor_Step: 0.33 + - _ARSampler_AlphaOn: 0 + - _AR_OffsetU: 0 + - _AR_OffsetV: 0.3 + - _AddPrecomputedVelocity: 0 + - _Add_Antipodean_RimLight: 1 + - _AlphaCutoffEnable: 0 + - _AlphaDstBlend: 0 + - _AlphaSrcBlend: 1 + - _AlphaToMask: 0 + - _AlphaToMaskInspectorValue: 0 + - _AngelRing: 0 + - _Ap_RimLight_FeatherOff: 0 + - _Ap_RimLight_Power: 0.59 + - _AutoRenderQueue: 1 + - _BUILTIN_QueueControl: 1 + - _BUILTIN_QueueOffset: 0 + - _BaseColor_Step: 0.39 + - _BaseShade_Feather: 0.54 + - _Base_Speed: 0 + - _BlendMode: 0 + - _BlurLevelMatcap: 0 + - _BlurLevelSGM: 0 + - _BumpScale: 0.252 + - _BumpScaleMatcap: 1 + - _CameraRolling_Stabilizer: 0 + - _ClippingMode: 0 + - _Clipping_Level: 0 + - _ColorBoost: 1 + - _ColorShift_Speed: 0 + - _ConservativeDepthOffsetEnable: 0 + - _CullMode: 2 + - _CullModeForward: 2 + - _Cutoff: 0.5 + - _DepthOffsetEnable: 0 + - _DetailNormalMapScale: 1 + - _DoubleSidedEnable: 0 + - _DoubleSidedGIMode: 0 + - _DoubleSidedNormalMode: 2 + - _DstBlend: 0 + - _EMISSIVE: 0 + - _EnableBlendModePreserveSpecularLighting: 1 + - _EnableFogOnTransparent: 1 + - _Farthest_Distance: 0 + - _GI_Intensity: 0 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _HighColor_Power: 0.872 + - _Inverse_Clipping: 0 + - _Inverse_MatcapMask: 0 + - _Inverse_Z_Axis_BLD: 1 + - _IsBaseMapAlphaAsClippingMask: 0 + - _Is_1st_ShadeColorOnly: 0 + - _Is_BLD: 0 + - _Is_BakedNormal: 0 + - _Is_BlendAddToHiColor: 1 + - _Is_BlendAddToMatCap: 1 + - _Is_BlendBaseColor: 1 + - _Is_ColorShift: 0 + - _Is_Filter_HiCutPointLightColor: 1 + - _Is_Filter_LightColor: 0 + - _Is_LightColor_1st_Shade: 1 + - _Is_LightColor_2nd_Shade: 1 + - _Is_LightColor_AR: 1 + - _Is_LightColor_Ap_RimLight: 1 + - _Is_LightColor_Base: 1 + - _Is_LightColor_HighColor: 1 + - _Is_LightColor_MatCap: 1 + - _Is_LightColor_Outline: 0 + - _Is_LightColor_RimLight: 1 + - _Is_NormalMap: 0 + - _Is_NormalMapForMatCap: 0 + - _Is_NormalMapToBase: 0 + - _Is_NormalMapToHighColor: 1 + - _Is_NormalMapToRimLight: 0 + - _Is_Ortho: 0 + - _Is_OutlineTex: 0 + - _Is_PingPong_Base: 0 + - _Is_SpecularToHighColor: 1 + - _Is_UseTweakHighColorOnShadow: 1 + - _Is_UseTweakMatCapOnShadow: 0 + - _Is_ViewCoord_Scroll: 0 + - _Is_ViewShift: 0 + - _LightDirection_MaskOn: 1 + - _MatCap: 0 + - _Metallic: 0 + - _Mode: 0 + - _Nearest_Distance: 2 + - _OUTLINE: 0 + - _OcclusionStrength: 1 + - _Offset_X_Axis_BLD: -0.05 + - _Offset_Y_Axis_BLD: 0.09 + - _Offset_Z: 0 + - _OpaqueCullMode: 2 + - _Outline_Width: 2 + - _Parallax: 0.02 + - _QueueControl: 0 + - _QueueOffset: 0 + - _RayTracing: 0 + - _ReceivesSSR: 1 + - _ReceivesSSRTransparent: 0 + - _RefractionModel: 0 + - _RenderQueueType: 1 + - _RequireSplitLighting: 0 + - _RimLight: 0 + - _RimLight_FeatherOff: 0 + - _RimLight_InsideMask: 0.0001 + - _RimLight_Power: 1 + - _Rotate_EmissiveUV: 0 + - _Rotate_MatCapUV: 0 + - _Rotate_NormalMapForMatCapUV: 0 + - _SPRDefaultUnlitColorMask: 15 + - _SRPDefaultUnlitColMode: 1 + - _Scroll_EmissiveU: 0 + - _Scroll_EmissiveV: 0 + - _Set_SystemShadowsToBase: 1 + - _ShadeColor_Step: 0.33 + - _Smoothness: 0 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _StencilComp: 0 + - _StencilMode: 0 + - _StencilNo: 1 + - _StencilOpFail: 0 + - _StencilOpPass: 0 + - _StencilRef: 0 + - _StencilRefDepth: 8 + - _StencilRefDistortionVec: 4 + - _StencilRefGBuffer: 10 + - _StencilRefMV: 40 + - _StencilWriteMask: 6 + - _StencilWriteMaskDepth: 8 + - _StencilWriteMaskDistortionVec: 4 + - _StencilWriteMaskGBuffer: 14 + - _StencilWriteMaskMV: 40 + - _StepOffset: 0.04 + - _SupportDecals: 1 + - _SurfaceType: 0 + - _TessEdgeLength: 5 + - _TessExtrusionAmount: 0 + - _TessPhongStrength: 0.5 + - _TransparentBackfaceEnable: 0 + - _TransparentCullMode: 2 + - _TransparentDepthPostpassEnable: 0 + - _TransparentDepthPrepassEnable: 0 + - _TransparentEnabled: 0 + - _TransparentSortPriority: 0 + - _TransparentWritingMotionVec: 0 + - _TransparentZWrite: 0 + - _TweakHighColorOnShadow: 0 + - _TweakMatCapOnShadow: 0 + - _Tweak_HighColorMaskLevel: 0 + - _Tweak_LightDirection_MaskLevel: 0 + - _Tweak_MatCapUV: 0 + - _Tweak_MatcapMaskLevel: 0 + - _Tweak_RimLightMaskLevel: 0 + - _Tweak_ShadingGradeMapLevel: 0 + - _Tweak_SystemShadowsLevel: -0.5 + - _Tweak_transparency: 0 + - _UVSec: 0 + - _Unlit_Intensity: 1 + - _UseShadowThreshold: 0 + - _Use_1stAs2nd: 1 + - _Use_BaseAs1st: 1 + - _ZOverDrawMode: 0 + - _ZTestDepthEqualForOpaque: 3 + - _ZTestGBuffer: 4 + - _ZTestTransparent: 4 + - _ZWrite: 1 + - _ZWriteMode: 1 + - _simpleUI: 0 + - _utsTechnique: 1 + - _utsVersion: 2.07 + - _utsVersionX: 2 + - _utsVersionY: 2 + - _utsVersionZ: 0 + m_Colors: + - _1st_ShadeColor: {r: 0.49264705, g: 0.304282, b: 0.304282, a: 1} + - _2nd_ShadeColor: {r: 0.50735295, g: 0.39543685, b: 0.4533245, a: 1} + - _AngelRing_Color: {r: 1, g: 1, b: 1, a: 1} + - _Ap_RimLightColor: {r: 1, g: 0.80689657, b: 0, a: 1} + - _BaseColor: {r: 0.9433962, g: 0.9137382, b: 0.7698469, a: 1} + - _Color: {r: 0.9811321, g: 0.81316864, b: 0.69789964, a: 1} + - _ColorShift: {r: 0, g: 0, b: 0, a: 1} + - _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0} + - _EmissionColor: {r: 1, g: 1, b: 1, a: 1} + - _Emissive_Color: {r: 0.21323532, g: 0, b: 0, a: 1} + - _HighColor: {r: 0.33962262, g: 0.20665716, b: 0.20665716, a: 1} + - _MatCapColor: {r: 1, g: 1, b: 1, a: 1} + - _Outline_Color: {r: 0.5294118, g: 0.22352937, b: 0.34159288, a: 1} + - _RimLightColor: {r: 1, g: 0, b: 0, a: 1} + - _Tiling: {r: 1, g: 1, b: 0, a: 0} + - _ViewShift: {r: 0, g: 0, b: 0, a: 1} + m_BuildTextureStacks: [] + m_AllowLocking: 1 +--- !u!114 &3673746192689313980 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: da692e001514ec24dbc4cca1949ff7e8, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 12 + hdPluginSubTargetMaterialVersions: + m_Keys: [] + m_Values: diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Skin.mat.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Skin.mat.meta new file mode 100644 index 00000000..055cbbbe --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Skin.mat.meta @@ -0,0 +1,16 @@ +fileFormatVersion: 2 +guid: cc28b9ef0843c9746a5a8276ed0f876a +timeCreated: 1544184610 +licenseType: Store +NativeFormatImporter: + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/Skin.mat + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX.meta new file mode 100644 index 00000000..8ececb57 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: efacb57bb1f8f0340a7d27ddde68f694 +folderAsset: yes +timeCreated: 1544184608 +licenseType: Store +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG.meta new file mode 100644 index 00000000..df409db0 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6b19b3993b4a0e14096972aa4c5b57ce +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Body_Base.png b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Body_Base.png new file mode 100644 index 00000000..1e469a4a --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Body_Base.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:413d2b06b45982532a23fced5cc6f47bf645e42edccf7ff163d9c273772fef47 +size 9543528 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Body_Base.png.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Body_Base.png.meta new file mode 100644 index 00000000..f1a35075 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Body_Base.png.meta @@ -0,0 +1,147 @@ +fileFormatVersion: 2 +guid: d1e50199c6f08ed46bf2d136ab225409 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 2 + mipBias: -100 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Windows Store Apps + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Body_Base.png + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Body_Emi.png b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Body_Emi.png new file mode 100644 index 00000000..d60ec4c1 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Body_Emi.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c262520fd86d46d5c8726347171b20f1a10691eee57f973aa2fbd5e4e1b93488 +size 3170257 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Body_Emi.png.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Body_Emi.png.meta new file mode 100644 index 00000000..30e1d01f --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Body_Emi.png.meta @@ -0,0 +1,147 @@ +fileFormatVersion: 2 +guid: dc71d88ff73488f45ac239b21f552745 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 2 + mipBias: -100 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Windows Store Apps + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Body_Emi.png + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Body_SGM.png b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Body_SGM.png new file mode 100644 index 00000000..0d845478 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Body_SGM.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5eb3b34acefe0e43f3b499bb679b91eb322daf963ea63b4cb4e09c9a1679eb17 +size 1765521 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Body_SGM.png.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Body_SGM.png.meta new file mode 100644 index 00000000..aef65e2d --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Body_SGM.png.meta @@ -0,0 +1,147 @@ +fileFormatVersion: 2 +guid: 7c75a3dfe8927774ea56a0777d1edcf1 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 0 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 2 + mipBias: -100 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Windows Store Apps + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Body_SGM.png + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Body_Shd1.png b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Body_Shd1.png new file mode 100644 index 00000000..336ec407 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Body_Shd1.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:da051ffea3268e6d3bd8baaca33a02bfee336169b5d9493d2f2a76b433e4cb48 +size 10374433 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Body_Shd1.png.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Body_Shd1.png.meta new file mode 100644 index 00000000..c6fa27a7 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Body_Shd1.png.meta @@ -0,0 +1,147 @@ +fileFormatVersion: 2 +guid: f180dfef53ad0924882657e28833a60b +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 2 + mipBias: -100 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Windows Store Apps + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Body_Shd1.png + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Body_Shd2.png b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Body_Shd2.png new file mode 100644 index 00000000..4519b00f --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Body_Shd2.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6a7b180ce3ca5e3546920c1293a9a46d5e7d51122437161d7309e5721e2c51b2 +size 9765866 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Body_Shd2.png.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Body_Shd2.png.meta new file mode 100644 index 00000000..f21ddfd1 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Body_Shd2.png.meta @@ -0,0 +1,147 @@ +fileFormatVersion: 2 +guid: 9cd90983043e3974e971a6c8d66cc42d +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 2 + mipBias: -100 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Windows Store Apps + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Body_Shd2.png + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Body_Spc.png b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Body_Spc.png new file mode 100644 index 00000000..a2d0dded --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Body_Spc.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e47f968aa338e0b9701d6e4fec1ec6a6103e5e4c2a3582f2b120f297cc14375f +size 321265 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Body_Spc.png.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Body_Spc.png.meta new file mode 100644 index 00000000..f41842fc --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Body_Spc.png.meta @@ -0,0 +1,147 @@ +fileFormatVersion: 2 +guid: a01adb17bdc53ba4da348b3cba074154 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 0 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 2 + mipBias: -100 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Windows Store Apps + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Body_Spc.png + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_Base.png b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_Base.png new file mode 100644 index 00000000..bdcb329c --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_Base.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5cf66c73c477e167c528d4c8ee309d2f511ea08a7fa729dbb1355a153b4ddc75 +size 260026 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_Base.png.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_Base.png.meta new file mode 100644 index 00000000..6a307388 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_Base.png.meta @@ -0,0 +1,147 @@ +fileFormatVersion: 2 +guid: 7275e6b9fb5d06847b114e33f0ab8ca6 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 2 + mipBias: -100 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Windows Store Apps + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_Base.png + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_Emi.png b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_Emi.png new file mode 100644 index 00000000..664deb23 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_Emi.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7158ee0b8947b690d57c7ebe365d43ceed951af27de4ede5465f08a0d8b4d32e +size 230512 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_Emi.png.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_Emi.png.meta new file mode 100644 index 00000000..56f2fd29 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_Emi.png.meta @@ -0,0 +1,147 @@ +fileFormatVersion: 2 +guid: 5a8dc6b89c866b546a4b2beebade28a1 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 0 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 2 + mipBias: -100 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Windows Store Apps + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_Emi.png + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_LSM.png b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_LSM.png new file mode 100644 index 00000000..57411113 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_LSM.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bf12eabc1da69ba191742a44d0f6f6e1b96b63087688a8783f3acca29d42aa81 +size 102715 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_LSM.png.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_LSM.png.meta new file mode 100644 index 00000000..90b37ae7 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_LSM.png.meta @@ -0,0 +1,147 @@ +fileFormatVersion: 2 +guid: c5acb3acbd64e734b838b254bb0ee4d8 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 0 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 2 + mipBias: -100 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Windows Store Apps + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_LSM.png + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_Rim.png b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_Rim.png new file mode 100644 index 00000000..c3c449a6 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_Rim.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b9c68db6072ad182cea54cca38a6a4a25b49cd87ec952c5ed2dcabf05ff05b65 +size 86398 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_Rim.png.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_Rim.png.meta new file mode 100644 index 00000000..3307e274 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_Rim.png.meta @@ -0,0 +1,147 @@ +fileFormatVersion: 2 +guid: b925033b206f79942b43d77ac699fc72 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 0 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 2 + mipBias: -100 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Windows Store Apps + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_Rim.png + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_SGM.png b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_SGM.png new file mode 100644 index 00000000..c28475d4 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_SGM.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3b9ac40f88f5bf17e0b2ef428ff3312d1f447d1815fc2444973e30cb6b5f7841 +size 98781 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_SGM.png.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_SGM.png.meta new file mode 100644 index 00000000..0f5b78ca --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_SGM.png.meta @@ -0,0 +1,147 @@ +fileFormatVersion: 2 +guid: ec3cb3dfef7e49a4eb0c10040e9733df +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 0 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 2 + mipBias: -100 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Windows Store Apps + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_SGM.png + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_Shd1.png b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_Shd1.png new file mode 100644 index 00000000..9945893e --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_Shd1.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8db3560c1424d3ba10c2ba06f19819eb0462425810d71bc6a55d788ea9479859 +size 268553 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_Shd1.png.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_Shd1.png.meta new file mode 100644 index 00000000..1e0dbeaf --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_Shd1.png.meta @@ -0,0 +1,147 @@ +fileFormatVersion: 2 +guid: 6ff07624f73f6184f84deb5ba5242590 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 2 + mipBias: -100 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Windows Store Apps + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_Shd1.png + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_Shd2.png b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_Shd2.png new file mode 100644 index 00000000..8b873223 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_Shd2.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dd28c03f9d89091ee7a82bfa4a9e5d230421dcb1aba9caf75e743337c2adf609 +size 268629 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_Shd2.png.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_Shd2.png.meta new file mode 100644 index 00000000..a893f4da --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_Shd2.png.meta @@ -0,0 +1,147 @@ +fileFormatVersion: 2 +guid: 7d84fa1a7f8997342ba010124f77b1e8 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 2 + mipBias: -100 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Windows Store Apps + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Face_Shd2.png + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Hair_SGM.png b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Hair_SGM.png new file mode 100644 index 00000000..8ffb3a00 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Hair_SGM.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4d8620f39fbaad23dc56ec31df23f3f4d46c9be6c1a8ff19d080e84d66882f35 +size 372684 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Hair_SGM.png.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Hair_SGM.png.meta new file mode 100644 index 00000000..533635bc --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Hair_SGM.png.meta @@ -0,0 +1,147 @@ +fileFormatVersion: 2 +guid: 0620c25d224d4d543936ec89321802b6 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 0 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 2 + mipBias: -100 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Windows Store Apps + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Hair_SGM.png + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Headfgear_Base.png b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Headfgear_Base.png new file mode 100644 index 00000000..2dbbd3a9 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Headfgear_Base.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:da00d9d928e847d49fe1ec22263432932153c05ec68349b39db07340c6255a2a +size 2521344 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Headfgear_Base.png.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Headfgear_Base.png.meta new file mode 100644 index 00000000..f4695d41 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Headfgear_Base.png.meta @@ -0,0 +1,147 @@ +fileFormatVersion: 2 +guid: a4a14922fc4479241aef660b68c498f5 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 2 + mipBias: -100 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Windows Store Apps + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Headfgear_Base.png + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_Base.png b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_Base.png new file mode 100644 index 00000000..009f5850 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_Base.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:10e54eebda12bc8de706e629932a2b1d241da9e9d8a4fad33a0ea821ce7447f5 +size 406064 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_Base.png.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_Base.png.meta new file mode 100644 index 00000000..1fcb02f9 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_Base.png.meta @@ -0,0 +1,147 @@ +fileFormatVersion: 2 +guid: 415a7cc21eec4e94fa9ae0b2078f352c +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 2 + mipBias: -100 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Windows Store Apps + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_Base.png + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_Emi.png b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_Emi.png new file mode 100644 index 00000000..6a7e69ee --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_Emi.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1242757658345a7c7bfaddfec2a9944c61daa1f794fbe465a8dbea653768f457 +size 293959 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_Emi.png.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_Emi.png.meta new file mode 100644 index 00000000..f41252c7 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_Emi.png.meta @@ -0,0 +1,147 @@ +fileFormatVersion: 2 +guid: 5ca59e98250004241ac83aa8c82eecd3 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 0 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 2 + mipBias: -100 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Windows Store Apps + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_Emi.png + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_Nrm.png b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_Nrm.png new file mode 100644 index 00000000..6ef09a62 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_Nrm.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aabf7397cffbbf5e209157f5ec1c47717f14370a392d9afa8cd18638db6a0fa9 +size 608907 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_Nrm.png.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_Nrm.png.meta new file mode 100644 index 00000000..57209d6c --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_Nrm.png.meta @@ -0,0 +1,147 @@ +fileFormatVersion: 2 +guid: 4d07b49e5565791478554cb770c6f8d2 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 0 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 1 + externalNormalMap: 0 + heightScale: 0.148 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 2 + mipBias: -100 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 1 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Windows Store Apps + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_Nrm.png + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_Rim.png b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_Rim.png new file mode 100644 index 00000000..ca539077 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_Rim.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:774a8fe5d58bf0a48898206672ac24ca0f0ae40dd422f5af225e189c18bf9fa0 +size 286855 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_Rim.png.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_Rim.png.meta new file mode 100644 index 00000000..617474f7 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_Rim.png.meta @@ -0,0 +1,147 @@ +fileFormatVersion: 2 +guid: 55e006481a55b4947b38566992e7bfd0 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 0 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 2 + mipBias: -100 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Windows Store Apps + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_Rim.png + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_SGM.png b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_SGM.png new file mode 100644 index 00000000..67363986 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_SGM.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f0d13bdf956f09705154514a3f861e3cea51bf7776a7718834993c084f161118 +size 537789 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_SGM.png.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_SGM.png.meta new file mode 100644 index 00000000..0b989ade --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_SGM.png.meta @@ -0,0 +1,147 @@ +fileFormatVersion: 2 +guid: 98574cca734649441bf1127cbec80f76 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 0 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 2 + mipBias: -100 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Windows Store Apps + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_SGM.png + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_Spc.png b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_Spc.png new file mode 100644 index 00000000..4cd0a67d --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_Spc.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0b47f16c94dc4b99d7d6907669db8cef8917c79897a713ff5f3ee935960b65e5 +size 444876 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_Spc.png.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_Spc.png.meta new file mode 100644 index 00000000..9a0bf564 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_Spc.png.meta @@ -0,0 +1,147 @@ +fileFormatVersion: 2 +guid: 3f05059980aad7443bb782b29a2af1c3 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 0 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 2 + mipBias: -100 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Windows Store Apps + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_Spc.png + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_SpcCol.png b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_SpcCol.png new file mode 100644 index 00000000..7f45a35c --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_SpcCol.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ca028916e819332ed16de576c9c89d3b871b92139faeb9fe6d31ac4fdb5ed1aa +size 350979 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_SpcCol.png.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_SpcCol.png.meta new file mode 100644 index 00000000..68eab35c --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_SpcCol.png.meta @@ -0,0 +1,147 @@ +fileFormatVersion: 2 +guid: b992e82399d98b44e85ee1318110377d +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: 2 + mipBias: -100 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Windows Store Apps + maxTextureSize: 8192 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/TEX/PNG/Skin_SpcCol.png + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/face3_main.mat b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/face3_main.mat new file mode 100644 index 00000000..a257a470 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/face3_main.mat @@ -0,0 +1,201 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-3956095719398336066 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 639247ca83abc874e893eb93af2b5e44, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 0 +--- !u!114 &-2131633107486826859 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: da692e001514ec24dbc4cca1949ff7e8, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 12 + hdPluginSubTargetMaterialVersions: + m_Keys: [] + m_Values: +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: face3_main + m_Shader: {fileID: -6465566751694194690, guid: e0b73429f84a56840ba17b216237f806, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: + - _DISABLE_SSR_TRANSPARENT + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 2000 + stringTagMap: {} + disabledShaderPasses: + - TransparentDepthPrepass + - TransparentDepthPostpass + - TransparentBackface + - RayTracingPrepass + - MOTIONVECTORS + m_LockedProperties: + 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} + - _Main: + 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} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _AddPrecomputedVelocity: 0 + - _AlphaCutoffEnable: 0 + - _AlphaDstBlend: 0 + - _AlphaSrcBlend: 1 + - _AlphaToMask: 0 + - _AlphaToMaskInspectorValue: 0 + - _BUILTIN_QueueControl: -1 + - _BUILTIN_QueueOffset: 0 + - _BlendMode: 0 + - _BumpScale: 1 + - _ConservativeDepthOffsetEnable: 0 + - _CullMode: 2 + - _CullModeForward: 2 + - _Cutoff: 0.5 + - _DepthOffsetEnable: 0 + - _DetailNormalMapScale: 1 + - _DoubleSidedEnable: 0 + - _DoubleSidedGIMode: 0 + - _DoubleSidedNormalMode: 2 + - _DstBlend: 0 + - _EnableBlendModePreserveSpecularLighting: 1 + - _EnableFogOnTransparent: 1 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _OpaqueCullMode: 2 + - _Parallax: 0.02 + - _QueueControl: 0 + - _QueueOffset: 0 + - _RayTracing: 0 + - _ReceivesSSR: 1 + - _ReceivesSSRTransparent: 0 + - _RefractionModel: 0 + - _RenderQueueType: 1 + - _RequireSplitLighting: 0 + - _Smoothness: 0 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _StencilRef: 0 + - _StencilRefDepth: 8 + - _StencilRefDistortionVec: 4 + - _StencilRefGBuffer: 10 + - _StencilRefMV: 40 + - _StencilWriteMask: 6 + - _StencilWriteMaskDepth: 8 + - _StencilWriteMaskDistortionVec: 4 + - _StencilWriteMaskGBuffer: 14 + - _StencilWriteMaskMV: 40 + - _SupportDecals: 1 + - _SurfaceType: 0 + - _TransparentBackfaceEnable: 0 + - _TransparentCullMode: 2 + - _TransparentDepthPostpassEnable: 0 + - _TransparentDepthPrepassEnable: 0 + - _TransparentSortPriority: 0 + - _TransparentWritingMotionVec: 0 + - _TransparentZWrite: 0 + - _UVSec: 0 + - _UseShadowThreshold: 0 + - _ZTestDepthEqualForOpaque: 3 + - _ZTestGBuffer: 4 + - _ZTestTransparent: 4 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 0.8, g: 0.8, b: 0.8, a: 1} + - _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0} + - _EmissionColor: {r: 1, g: 1, b: 1, a: 1} + - _Tiling: {r: 1, g: 1, b: 0, a: 0} + m_BuildTextureStacks: [] + m_AllowLocking: 1 +--- !u!114 &2718186772625287269 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 10 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/face3_main.mat.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/face3_main.mat.meta new file mode 100644 index 00000000..88657fb0 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/face3_main.mat.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 4eea2ba65c52fad4b88ac8e9d67c594f +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/face3_main.mat + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/headExt.mat b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/headExt.mat new file mode 100644 index 00000000..0285fc0c --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/headExt.mat @@ -0,0 +1,201 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &-8845708009397242001 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 10 +--- !u!114 &-8324562969990519675 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: da692e001514ec24dbc4cca1949ff7e8, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 12 + hdPluginSubTargetMaterialVersions: + m_Keys: [] + m_Values: +--- !u!114 &-3939152729430346464 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 639247ca83abc874e893eb93af2b5e44, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 0 +--- !u!21 &2100000 +Material: + serializedVersion: 8 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: headExt + m_Shader: {fileID: -6465566751694194690, guid: e0b73429f84a56840ba17b216237f806, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: + - _DISABLE_SSR_TRANSPARENT + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 2000 + stringTagMap: {} + disabledShaderPasses: + - TransparentDepthPrepass + - TransparentDepthPostpass + - TransparentBackface + - RayTracingPrepass + - MOTIONVECTORS + m_LockedProperties: + 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} + - _Main: + 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} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _AddPrecomputedVelocity: 0 + - _AlphaCutoffEnable: 0 + - _AlphaDstBlend: 0 + - _AlphaSrcBlend: 1 + - _AlphaToMask: 0 + - _AlphaToMaskInspectorValue: 0 + - _BUILTIN_QueueControl: -1 + - _BUILTIN_QueueOffset: 0 + - _BlendMode: 0 + - _BumpScale: 1 + - _ConservativeDepthOffsetEnable: 0 + - _CullMode: 2 + - _CullModeForward: 2 + - _Cutoff: 0.5 + - _DepthOffsetEnable: 0 + - _DetailNormalMapScale: 1 + - _DoubleSidedEnable: 0 + - _DoubleSidedGIMode: 0 + - _DoubleSidedNormalMode: 2 + - _DstBlend: 0 + - _EnableBlendModePreserveSpecularLighting: 1 + - _EnableFogOnTransparent: 1 + - _GlossMapScale: 1 + - _Glossiness: 0.09901475 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _OpaqueCullMode: 2 + - _Parallax: 0.02 + - _QueueControl: 0 + - _QueueOffset: 0 + - _RayTracing: 0 + - _ReceivesSSR: 1 + - _ReceivesSSRTransparent: 0 + - _RefractionModel: 0 + - _RenderQueueType: 1 + - _RequireSplitLighting: 0 + - _Smoothness: 0 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _StencilRef: 0 + - _StencilRefDepth: 8 + - _StencilRefDistortionVec: 4 + - _StencilRefGBuffer: 10 + - _StencilRefMV: 40 + - _StencilWriteMask: 6 + - _StencilWriteMaskDepth: 8 + - _StencilWriteMaskDistortionVec: 4 + - _StencilWriteMaskGBuffer: 14 + - _StencilWriteMaskMV: 40 + - _SupportDecals: 1 + - _SurfaceType: 0 + - _TransparentBackfaceEnable: 0 + - _TransparentCullMode: 2 + - _TransparentDepthPostpassEnable: 0 + - _TransparentDepthPrepassEnable: 0 + - _TransparentSortPriority: 0 + - _TransparentWritingMotionVec: 0 + - _TransparentZWrite: 0 + - _UVSec: 0 + - _UseShadowThreshold: 0 + - _ZTestDepthEqualForOpaque: 3 + - _ZTestGBuffer: 4 + - _ZTestTransparent: 4 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 0.8, g: 0.8, b: 0.8, a: 1} + - _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0} + - _EmissionColor: {r: 1, g: 1, b: 1, a: 1} + - _Tiling: {r: 1, g: 1, b: 0, a: 0} + m_BuildTextureStacks: [] + m_AllowLocking: 1 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/headExt.mat.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/headExt.mat.meta new file mode 100644 index 00000000..db5b81f8 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/headExt.mat.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 2907c0cac24ed4b4c93075f883200c46 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/Materials/headExt.mat + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/UniteInTheSky.controller b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/UniteInTheSky.controller new file mode 100644 index 00000000..7eaf3433 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/UniteInTheSky.controller @@ -0,0 +1,460 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1101 &-5330246061505920765 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: + - m_ConditionMode: 1 + m_ConditionEvent: Next + m_EventTreshold: 0 + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: -2037826335270817655} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0.25 + m_TransitionOffset: 0 + m_ExitTime: 0.9985577 + m_HasExitTime: 0 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 +--- !u!1101 &-4051815149419108730 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: + - m_ConditionMode: 1 + m_ConditionEvent: Next + m_EventTreshold: 0 + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 6956152088544691744} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0.25 + m_TransitionOffset: 0 + m_ExitTime: 0.6875 + m_HasExitTime: 0 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 +--- !u!1101 &-3630659354654148562 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: + - m_ConditionMode: 1 + m_ConditionEvent: Back + m_EventTreshold: 0 + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 696072945675995140} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0.25 + m_TransitionOffset: 0 + m_ExitTime: 0.9698795 + m_HasExitTime: 0 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 +--- !u!1107 &-2476057408743069352 +AnimatorStateMachine: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Base Layer + m_ChildStates: + - serializedVersion: 1 + m_State: {fileID: 2495779494147398468} + m_Position: {x: 250, y: 80, z: 0} + - serializedVersion: 1 + m_State: {fileID: 696072945675995140} + m_Position: {x: 30, y: 330, z: 0} + - serializedVersion: 1 + m_State: {fileID: 1912442270958618819} + m_Position: {x: 300, y: 410, z: 0} + - serializedVersion: 1 + m_State: {fileID: 6956152088544691744} + m_Position: {x: 300, y: 330, z: 0} + - serializedVersion: 1 + m_State: {fileID: -1561510447695394969} + m_Position: {x: 30, y: 230, z: 0} + - serializedVersion: 1 + m_State: {fileID: -2037826335270817655} + m_Position: {x: 30, y: 410, z: 0} + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: -1561510447695394969} +--- !u!1102 &-2037826335270817655 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: WAIT02 + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: + - {fileID: 5192254936906539051} + - {fileID: -3630659354654148562} + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 1 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: 2a7cc8d66d3c2fc46a54cbf3d95e3b2d, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!1102 &-1561510447695394969 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: UC01_001_INIT_POSE + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: + - {fileID: 568215038525939242} + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 1 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 5322403403441133380, guid: 6f7e0371a1f07ea49b5d6fe4d634ae6c, type: 3} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!1101 &-916830137542702695 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: + - m_ConditionMode: 1 + m_ConditionEvent: Back + m_EventTreshold: 0 + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: -2037826335270817655} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0.25 + m_TransitionOffset: 0 + m_ExitTime: 0.6875 + m_HasExitTime: 0 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 +--- !u!91 &9100000 +AnimatorController: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: UniteInTheSky + serializedVersion: 5 + m_AnimatorParameters: + - m_Name: Next + m_Type: 9 + m_DefaultFloat: 0 + m_DefaultInt: 0 + m_DefaultBool: 0 + m_Controller: {fileID: 0} + - m_Name: Back + m_Type: 9 + m_DefaultFloat: 0 + m_DefaultInt: 0 + m_DefaultBool: 0 + m_Controller: {fileID: 0} + m_AnimatorLayers: + - serializedVersion: 5 + m_Name: Base Layer + m_StateMachine: {fileID: -2476057408743069352} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 0 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} +--- !u!1101 &568215038525939242 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: [] + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 696072945675995140} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0.25 + m_TransitionOffset: 0 + m_ExitTime: 0.77272725 + m_HasExitTime: 1 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 +--- !u!1102 &696072945675995140 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: UC01_001_JAK01_003 (short) + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: + - {fileID: -5330246061505920765} + - {fileID: 3175375460379069471} + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 1 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: -6150270346426837497, guid: 6f7e0371a1f07ea49b5d6fe4d634ae6c, type: 3} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!1102 &1912442270958618819 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: RUN00_F + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: + - {fileID: -4051815149419108730} + - {fileID: -916830137542702695} + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 1 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: d57512b99bc2cc84f92c873f858d9714, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!1102 &2495779494147398468 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: UC01_001_JAK01_003 + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: [] + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 1 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: 6f7e0371a1f07ea49b5d6fe4d634ae6c, type: 3} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!1101 &3175375460379069471 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: + - m_ConditionMode: 1 + m_ConditionEvent: Back + m_EventTreshold: 0 + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 6956152088544691744} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0.25 + m_TransitionOffset: 0 + m_ExitTime: 0.9985577 + m_HasExitTime: 0 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 +--- !u!1101 &5192254936906539051 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: + - m_ConditionMode: 1 + m_ConditionEvent: Next + m_EventTreshold: 0 + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 1912442270958618819} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0.25 + m_TransitionOffset: 0 + m_ExitTime: 0.9698795 + m_HasExitTime: 0 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 +--- !u!1102 &6956152088544691744 +AnimatorState: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: WAIT04 + m_Speed: 1 + m_CycleOffset: 0 + m_Transitions: + - {fileID: 7249238807102717173} + - {fileID: 7236196480753496729} + m_StateMachineBehaviours: [] + m_Position: {x: 50, y: 50, z: 0} + m_IKOnFeet: 1 + m_WriteDefaultValues: 1 + m_Mirror: 0 + m_SpeedParameterActive: 0 + m_MirrorParameterActive: 0 + m_CycleOffsetParameterActive: 0 + m_TimeParameterActive: 0 + m_Motion: {fileID: 7400000, guid: 3a954c05a2f94004eaff3df94a45c3ed, type: 2} + m_Tag: + m_SpeedParameter: + m_MirrorParameter: + m_CycleOffsetParameter: + m_TimeParameter: +--- !u!1101 &7236196480753496729 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: + - m_ConditionMode: 1 + m_ConditionEvent: Back + m_EventTreshold: 0 + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 1912442270958618819} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0.25 + m_TransitionOffset: 0 + m_ExitTime: 0.9516129 + m_HasExitTime: 0 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 +--- !u!1101 &7249238807102717173 +AnimatorStateTransition: + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: + m_Conditions: + - m_ConditionMode: 1 + m_ConditionEvent: Next + m_EventTreshold: 0 + m_DstStateMachine: {fileID: 0} + m_DstState: {fileID: 696072945675995140} + m_Solo: 0 + m_Mute: 0 + m_IsExit: 0 + serializedVersion: 3 + m_TransitionDuration: 0.25 + m_TransitionOffset: 0 + m_ExitTime: 0.9516129 + m_HasExitTime: 0 + m_HasFixedDuration: 1 + m_InterruptionSource: 0 + m_OrderedInterruption: 1 + m_CanTransitionToSelf: 1 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/UniteInTheSky.controller.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/UniteInTheSky.controller.meta new file mode 100644 index 00000000..7f54f5ec --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/UniteInTheSky.controller.meta @@ -0,0 +1,15 @@ +fileFormatVersion: 2 +guid: 5d5603d7af037e1498d1f99450574dca +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 9100000 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/UniteInTheSky.controller + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/UnityCHanKAGURA.fbx b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/UnityCHanKAGURA.fbx new file mode 100644 index 00000000..030c246e --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/UnityCHanKAGURA.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0b3e2eb35233f716fa175d5da35f8ae55c4e20e92025bb12f45f819e404b03f1 +size 7144380 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/UnityCHanKAGURA.fbx.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/UnityCHanKAGURA.fbx.meta new file mode 100644 index 00000000..13338b1c --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/UnityCHanKAGURA.fbx.meta @@ -0,0 +1,2266 @@ +fileFormatVersion: 2 +guid: 13d8e3dd1da9f6845b5d673e9ac54ecf +ModelImporter: + serializedVersion: 22200 + internalIDToNameTable: [] + externalObjects: {} + materials: + materialImportMode: 2 + materialName: 0 + materialSearch: 1 + materialLocation: 1 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + resampleCurves: 1 + optimizeGameObjects: 0 + removeConstantScaleCurves: 0 + motionNodeName: + rigImportErrors: + rigImportWarnings: + animationImportErrors: + animationImportWarnings: + animationRetargetingWarnings: + animationDoRetargetingWarnings: 0 + importAnimatedCustomProperties: 0 + importConstraints: 0 + animationCompression: 3 + animationRotationError: 0.5 + animationPositionError: 0.5 + animationScaleError: 0.5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + extraUserProperties: [] + clipAnimations: [] + isReadable: 1 + meshes: + lODScreenPercentages: [] + globalScale: 1 + meshCompression: 0 + addColliders: 0 + useSRGBMaterialColor: 1 + sortHierarchyByName: 1 + importVisibility: 1 + importBlendShapes: 1 + importCameras: 1 + importLights: 1 + nodeNameCollisionStrategy: 1 + fileIdsGeneration: 2 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + keepQuads: 0 + weldVertices: 1 + bakeAxisConversion: 0 + preserveHierarchy: 0 + skinWeightsMode: 0 + maxBonesPerVertex: 4 + minBoneWeight: 0.001 + optimizeBones: 1 + meshOptimizationFlags: -1 + indexFormat: 0 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVMarginMethod: 1 + secondaryUVMinLightmapResolution: 40 + secondaryUVMinObjectScale: 1 + secondaryUVPackMargin: 4 + useFileScale: 1 + strictVertexDataChecks: 0 + tangentSpace: + normalSmoothAngle: 60 + normalImportMode: 0 + tangentImportMode: 3 + normalCalculationMode: 4 + legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0 + blendShapeNormalImportMode: 1 + normalSmoothingSource: 0 + referencedClips: [] + importAnimation: 1 + humanDescription: + serializedVersion: 3 + human: + - boneName: CH_Hips + humanName: Hips + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_Thigh_L + humanName: LeftUpperLeg + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_Thigh_R + humanName: RightUpperLeg + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_Shin_L + humanName: LeftLowerLeg + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_Shin_R + humanName: RightLowerLeg + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_Foot_L + humanName: LeftFoot + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_Foot_R + humanName: RightFoot + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_Spine + humanName: Spine + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_Chest + humanName: Chest + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_Neck + humanName: Neck + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_Head + humanName: Head + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_Shou_L + humanName: LeftShoulder + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_Shou_R + humanName: RightShoulder + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_Uppe_L + humanName: LeftUpperArm + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_Uppe_R + humanName: RightUpperArm + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_For_L + humanName: LeftLowerArm + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_For_R + humanName: RightLowerArm + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_Hand_L + humanName: LeftHand + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_Hand_R + humanName: RightHand + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_Toe_L + humanName: LeftToes + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_Toe_R + humanName: RightToes + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_eye_L + humanName: LeftEye + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_eye_R + humanName: RightEye + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerTh0_L + humanName: Left Thumb Proximal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerTh1_L + humanName: Left Thumb Intermediate + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerTh2_L + humanName: Left Thumb Distal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerIn0_L + humanName: Left Index Proximal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerIn1_L + humanName: Left Index Intermediate + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerIn2_L + humanName: Left Index Distal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerMid0_L + humanName: Left Middle Proximal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerMid1_L + humanName: Left Middle Intermediate + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerMid2_L + humanName: Left Middle Distal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerR0_L + humanName: Left Ring Proximal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerR1_L + humanName: Left Ring Intermediate + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerR2_L + humanName: Left Ring Distal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerP0_L + humanName: Left Little Proximal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerP1_L + humanName: Left Little Intermediate + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerP2_L + humanName: Left Little Distal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerTh0_R + humanName: Right Thumb Proximal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerTh1_R + humanName: Right Thumb Intermediate + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerTh2_R + humanName: Right Thumb Distal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerIn0_R + humanName: Right Index Proximal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerIn1_R + humanName: Right Index Intermediate + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerIn2_R + humanName: Right Index Distal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerMid0_R + humanName: Right Middle Proximal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerMid1_R + humanName: Right Middle Intermediate + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerMid2_R + humanName: Right Middle Distal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerR0_R + humanName: Right Ring Proximal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerR1_R + humanName: Right Ring Intermediate + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerR2_R + humanName: Right Ring Distal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerP0_R + humanName: Right Little Proximal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerP1_R + humanName: Right Little Intermediate + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + - boneName: CH_FingerP2_R + humanName: Right Little Distal + limit: + min: {x: 0, y: 0, z: 0} + max: {x: 0, y: 0, z: 0} + value: {x: 0, y: 0, z: 0} + length: 0 + modified: 0 + skeleton: + - name: UnityCHanKAGURA_B(Clone) + parentName: + position: {x: 0, y: 0, z: 0} + rotation: {x: 0, y: 0, z: 0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: Character1_Reference + parentName: UnityCHanKAGURA_B(Clone) + position: {x: -0, y: 0, z: 0} + rotation: {x: 0.019478308, y: 6.7074776e-11, z: 0.000000006886462, w: 0.9998103} + scale: {x: 1, y: 0.99999994, z: 0.99999994} + - name: CH_Hips + parentName: Character1_Reference + position: {x: 1.8092397e-12, y: 0.84116226, z: -0.01639} + rotation: {x: -0.019478302, y: -7.177182e-18, z: 6.3360314e-16, w: 0.9998103} + scale: {x: 1, y: 1, z: 1} + - name: CH_Thigh_L + parentName: CH_Hips + position: {x: -0.08826721, y: -0.014284544, z: 0.002355653} + rotation: {x: -0.13432857, y: -0.17403738, z: 0.5565042, w: 0.8012303} + scale: {x: 0.9999999, y: 0.9999998, z: 0.9999999} + - name: CH_Shin_L + parentName: CH_Thigh_L + position: {x: -0.33039492, y: -0.14232448, z: -0.040917292} + rotation: {x: 0.6617167, y: -0.5369391, z: 0.44836724, w: 0.2698041} + scale: {x: 0.99999994, y: 1.0000001, z: 1.0000001} + - name: DB_Leg_D_01_L + parentName: CH_Shin_L + position: {x: -0.015720347, y: 0.36488265, z: 0.018263556} + rotation: {x: -0.6654126, y: 0.6857607, z: -0.20170403, w: 0.21511385} + scale: {x: 1, y: 1.0000002, z: 0.99999994} + - name: DB_Leg_D_02_L + parentName: DB_Leg_D_01_L + position: {x: -0.020465324, y: -0.0057213255, z: -0.0148777515} + rotation: {x: 0.83505213, y: 0.2453058, z: 0.21297534, w: -0.44402093} + scale: {x: 1.0000001, y: 1, z: 1} + - name: DB_Leg_D_02_L_end + parentName: DB_Leg_D_02_L + position: {x: -0, y: 0.02594052, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Leg_B_01_L + parentName: CH_Shin_L + position: {x: -0.015909798, y: 0.3523997, z: 0.018111004} + rotation: {x: 0.8541138, y: -0.31677046, z: -0.35583758, w: -0.208628} + scale: {x: 1.0000001, y: 1.0000001, z: 0.9999998} + - name: DB_Leg_B_02_L + parentName: DB_Leg_B_01_L + position: {x: -0.019698037, y: -0.002069448, z: -0.016751628} + rotation: {x: -0.33618087, y: -0.33662862, z: -0.08369401, w: 0.8755906} + scale: {x: 1.0000001, y: 1.0000004, z: 1.0000002} + - name: DB_Leg_B_02_L_end + parentName: DB_Leg_B_02_L + position: {x: -0, y: 0.025940558, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Leg_A_01_L + parentName: CH_Shin_L + position: {x: -0.016215084, y: 0.3530168, z: 0.008331124} + rotation: {x: 0.8030182, y: -0.111592114, z: 0.5777915, w: 0.09415919} + scale: {x: 0.9999973, y: 0.9999997, z: 1.0000002} + - name: DB_Leg_A_02_L + parentName: DB_Leg_A_01_L + position: {x: -0.025264768, y: -0.0006684357, z: 0.0058448003} + rotation: {x: 0.114606865, y: 0.11413812, z: -0.00020055493, w: 0.9868322} + scale: {x: 1.0000002, y: 1.0000002, z: 1} + - name: DB_Leg_A_02_L_end + parentName: DB_Leg_A_02_L + position: {x: -0, y: 0.025940567, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Leg_C_01_L + parentName: CH_Shin_L + position: {x: -0.015241163, y: 0.36570385, z: 0.007816298} + rotation: {x: 0.12014065, y: -0.30020246, z: -0.5220277, w: 0.7892604} + scale: {x: 0.9999999, y: 0.99999994, z: 1.0000001} + - name: DB_Leg_C_02_L + parentName: DB_Leg_C_01_L + position: {x: -0.024774697, y: 0.0006814647, z: -0.0076592406} + rotation: {x: 0.460765, y: -0.13830368, z: 0.05783245, w: 0.87477034} + scale: {x: 1.0000001, y: 0.99999994, z: 1} + - name: DB_Leg_C_02_L_end + parentName: DB_Leg_C_02_L + position: {x: -0, y: 0.02594055, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: CH_Foot_L + parentName: CH_Shin_L + position: {x: 0.029875912, y: 0.3874966, z: 0.008091103} + rotation: {x: 0.061005134, y: 0.21119405, z: 0.92646635, w: -0.30550867} + scale: {x: 0.9999999, y: 1.0000001, z: 0.99999994} + - name: CH_Toe_L + parentName: CH_Foot_L + position: {x: -0.11841869, y: 0.013799544, z: 0.025782034} + rotation: {x: -0.12559782, y: 0.19541794, z: 0.38654023, w: 0.89253783} + scale: {x: 1.0000001, y: 1.0000001, z: 1.0000002} + - name: CH_Toe_L_end + parentName: CH_Toe_L + position: {x: -0, y: 0.12197585, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: CH_Thigh_R + parentName: CH_Hips + position: {x: 0.08810974, y: -0.014284541, z: 0.0023555718} + rotation: {x: 0.5563986, y: 0.80125886, z: -0.13458051, w: -0.17404875} + scale: {x: 0.9999998, y: 0.9999997, z: 0.9999997} + - name: CH_Shin_R + parentName: CH_Thigh_R + position: {x: -0.33036518, y: -0.14234428, z: 0.041079752} + rotation: {x: 0.66174173, y: -0.5370415, z: -0.44836113, w: -0.26954895} + scale: {x: 1, y: 1.0000001, z: 1} + - name: CH_Foot_R + parentName: CH_Shin_R + position: {x: 0.02987569, y: 0.3874962, z: -0.008090359} + rotation: {x: -0.060998213, y: -0.21113306, z: 0.9264768, w: -0.30552068} + scale: {x: 1.0000005, y: 1.0000002, z: 1} + - name: CH_Toe_R + parentName: CH_Foot_R + position: {x: -0.11841994, y: 0.013798753, z: -0.025776036} + rotation: {x: 0.12555602, y: -0.19537207, z: 0.38653955, w: 0.892554} + scale: {x: 1, y: 1.0000001, z: 1.0000001} + - name: CH_Toe_R_end + parentName: CH_Toe_R + position: {x: -0, y: 0.12197583, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Leg_D_01_R + parentName: CH_Shin_R + position: {x: -0.015720518, y: 0.36488253, z: -0.018263748} + rotation: {x: -0.6654132, y: 0.68576103, z: 0.20170169, w: -0.21511294} + scale: {x: 0.99999964, y: 0.9999996, z: 0.9999998} + - name: DB_Leg_D_02_R + parentName: DB_Leg_D_01_R + position: {x: -0.020465378, y: -0.0057213013, z: 0.014877751} + rotation: {x: 0.83505267, y: 0.24530488, z: -0.21297555, w: 0.44402036} + scale: {x: 1.0000001, y: 1.0000001, z: 1} + - name: DB_Leg_D_02_R_end + parentName: DB_Leg_D_02_R + position: {x: -0, y: 0.025940496, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Leg_B_01_R + parentName: CH_Shin_R + position: {x: -0.015910042, y: 0.3523994, z: -0.018111194} + rotation: {x: 0.8541113, y: -0.31677485, z: 0.35583863, w: 0.2086299} + scale: {x: 0.9999997, y: 0.9999997, z: 0.99999976} + - name: DB_Leg_B_02_R + parentName: DB_Leg_B_01_R + position: {x: -0.019698039, y: -0.002069446, z: 0.016751638} + rotation: {x: 0.33618426, y: 0.33662817, z: -0.08369033, w: 0.87558985} + scale: {x: 1, y: 0.9999998, z: 0.9999998} + - name: DB_Leg_B_02_R_end + parentName: DB_Leg_B_02_R + position: {x: -0, y: 0.025940554, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Leg_A_01_R + parentName: CH_Shin_R + position: {x: -0.016215283, y: 0.35301623, z: -0.008331298} + rotation: {x: 0.8030201, y: -0.11158819, z: -0.57778937, w: -0.094161056} + scale: {x: 0.99999917, y: 0.99999976, z: 1.0000001} + - name: DB_Leg_A_02_R + parentName: DB_Leg_A_01_R + position: {x: -0.025264671, y: -0.0006686662, z: -0.005844774} + rotation: {x: -0.11460477, y: -0.11413833, z: -0.00020045551, w: 0.9868324} + scale: {x: 1.0000001, y: 1, z: 0.9999997} + - name: DB_Leg_A_02_R_end + parentName: DB_Leg_A_02_R + position: {x: -0, y: 0.025940524, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Leg_C_01_R + parentName: CH_Shin_R + position: {x: -0.0152413435, y: 0.36570352, z: -0.0078165} + rotation: {x: -0.12014231, y: 0.3002036, z: -0.52202654, w: 0.78926045} + scale: {x: 0.9999998, y: 1, z: 1} + - name: DB_Leg_C_02_R + parentName: DB_Leg_C_01_R + position: {x: -0.024774678, y: 0.0006814384, z: 0.007659211} + rotation: {x: -0.46076074, y: 0.13830246, z: 0.057832856, w: 0.8747728} + scale: {x: 1.0000001, y: 0.9999999, z: 1} + - name: DB_Leg_C_02_R_end + parentName: DB_Leg_C_02_R + position: {x: -0, y: 0.025940556, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: CH_Spine + parentName: CH_Hips + position: {x: 8.7094215e-10, y: 0.052382283, z: 0.003530197} + rotation: {x: 0.013204711, y: 5.156483e-12, z: -0.0000000083063645, w: 0.99991286} + scale: {x: 1, y: 0.99999994, z: 0.9999999} + - name: CH_Chest + parentName: CH_Spine + position: {x: -6.7333555e-10, y: 0.16491224, z: 0.0065771495} + rotation: {x: -0.031049041, y: -7.781174e-11, z: 0.0000000020394886, w: 0.99951786} + scale: {x: 1, y: 0.9999998, z: 0.9999999} + - name: CH_Neck + parentName: CH_Chest + position: {x: -0.0000000010773759, y: 0.24534914, z: -0.035706315} + rotation: {x: 0.18392648, y: 3.824621e-10, z: 0.0000000021234396, w: 0.98294} + scale: {x: 1, y: 1, z: 1} + - name: CH_Head + parentName: CH_Neck + position: {x: -2.0999868e-14, y: 0.090854794, z: -0.034652326} + rotation: {x: -0.16635364, y: 8.074895e-16, z: 2.1137224e-15, w: 0.98606616} + scale: {x: 1, y: 1, z: 1} + - name: CH_eye_L + parentName: CH_Head + position: {x: -0.017834922, y: 0.04682619, z: 0.015588715} + rotation: {x: 0.13649605, y: -0.17832369, z: 0.06646494, w: 0.97218925} + scale: {x: 1.0000001, y: 0.9999998, z: 1} + - name: CH_eye_L_end + parentName: CH_eye_L + position: {x: -0, y: 0.067616336, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: CH_eye_R + parentName: CH_Head + position: {x: 0.017834948, y: 0.04682619, z: 0.01558871} + rotation: {x: 0.061989237, y: 0.96416754, z: 0.13923119, w: -0.21714754} + scale: {x: 0.9999999, y: 0.9999999, z: 0.99999994} + - name: CH_eye_R_end + parentName: CH_eye_R + position: {x: -0, y: 0.067616336, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: CH_HairRoot + parentName: CH_Head + position: {x: -0.000078737154, y: 0.09505858, z: 0.023397414} + rotation: {x: -0.7071067, y: 0.7071068, z: 0.00000009487339, w: -0.00000018048416} + scale: {x: 1, y: 0.99999976, z: 1} + - name: DB_Hair_F1_01_L + parentName: CH_HairRoot + position: {x: -0.0022801124, y: 0.02419522, z: -0.10100859} + rotation: {x: 0.030597411, y: 0.96931905, z: 0.24035265, w: -0.041411996} + scale: {x: 1, y: 1.0000005, z: 0.9999999} + - name: DB_Hair_F1_02_L + parentName: DB_Hair_F1_01_L + position: {x: -0.03985014, y: -0.005924668, z: -0.0063618347} + rotation: {x: -0.013739697, y: -0.16939762, z: 0.014907225, w: 0.9853393} + scale: {x: 1.0000001, y: 0.99999994, z: 0.9999998} + - name: DB_Hair_F1_02_L_end + parentName: DB_Hair_F1_02_L + position: {x: -0, y: 0.040787358, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Hair_F1_01_R + parentName: CH_HairRoot + position: {x: -0.020420857, y: -0.02655642, z: -0.097100414} + rotation: {x: 0.022290053, y: 0.96187854, z: -0.26513365, w: -0.06322205} + scale: {x: 0.9999999, y: 0.99999994, z: 0.99999994} + - name: DB_Hair_F1_01_R_end + parentName: DB_Hair_F1_01_R + position: {x: -0, y: 0.11285751, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Hair_F2_01_L + parentName: CH_HairRoot + position: {x: 0.011319053, y: 0.07265613, z: -0.074083224} + rotation: {x: -0.20547554, y: 0.92748624, z: 0.27937216, w: 0.13964385} + scale: {x: 0.9999999, y: 1, z: 1.0000001} + - name: DB_Hair_F2_01_L_end + parentName: DB_Hair_F2_01_L + position: {x: -0, y: 0.11285751, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Hair_F3_01_L + parentName: CH_HairRoot + position: {x: -0.034934714, y: 0.068165414, z: -0.09195771} + rotation: {x: 0.81319416, y: -0.33171567, z: 0.46750733, w: 0.10058277} + scale: {x: 1.0000001, y: 1.0000002, z: 0.9999998} + - name: DB_Hair_F3_02_L + parentName: DB_Hair_F3_01_L + position: {x: 0.0045398497, y: -0.039559294, z: 0.016659176} + rotation: {x: -0.48918706, y: -0.26743877, z: 0.7575304, w: 0.3395884} + scale: {x: 1.0000002, y: 1.0000002, z: 1.0000002} + - name: DB_Hair_F3_02_L_end + parentName: DB_Hair_F3_02_L + position: {x: -0, y: 0.04316329, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Hair_S1_01_L + parentName: CH_HairRoot + position: {x: -0.019978656, y: 0.08724394, z: -0.06901977} + rotation: {x: -0.20777045, y: 0.6752454, z: 0.70667404, w: -0.038560253} + scale: {x: 1, y: 0.9999992, z: 1.0000001} + - name: DB_Hair_S1_02_L + parentName: DB_Hair_S1_01_L + position: {x: -0.06366916, y: 0.0037784262, z: -0.013001636} + rotation: {x: -0.14839575, y: -0.17151457, z: -0.059975024, w: 0.97209287} + scale: {x: 0.9999999, y: 1, z: 1.0000001} + - name: DB_Hair_S1_03_L + parentName: DB_Hair_S1_02_L + position: {x: -0.049858354, y: -0.010453356, z: -0.00893953} + rotation: {x: 0.08697805, y: -0.13373399, z: 0.14230917, w: 0.97688186} + scale: {x: 1, y: 1, z: 0.99999994} + - name: DB_Hair_S1_03_L_end + parentName: DB_Hair_S1_03_L + position: {x: -0, y: 0.05172089, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Hair_S2_01_L + parentName: CH_HairRoot + position: {x: -0.028588507, y: 0.09171348, z: -0.047888175} + rotation: {x: -0.2981027, y: 0.6886669, z: 0.65323377, w: -0.10078889} + scale: {x: 0.9999999, y: 0.9999995, z: 0.9999998} + - name: DB_Hair_S2_02_L + parentName: DB_Hair_S2_01_L + position: {x: -0.065382436, y: -0.0035510426, z: -0.016678598} + rotation: {x: 0.91674775, y: 0.12557316, z: 0.12861632, w: 0.35673907} + scale: {x: 1.0000001, y: 1.0000004, z: 1.0000001} + - name: DB_Hair_S2_03_L + parentName: DB_Hair_S2_02_L + position: {x: -0.04668184, y: -0.017777428, z: 0.011950299} + rotation: {x: 0.9063441, y: 0.09186723, z: -0.19777134, w: -0.3619216} + scale: {x: 1.0000001, y: 1, z: 0.99999964} + - name: DB_Hair_S2_03_L_end + parentName: DB_Hair_S2_03_L + position: {x: -0, y: 0.0513617, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Hair_S3_02_L + parentName: DB_Hair_S2_01_L + position: {x: -0.05340869, y: 0.019261943, z: -0.0020288706} + rotation: {x: -0.038595226, y: -0.0036078964, z: -0.16786668, w: 0.98504734} + scale: {x: 1.0000001, y: 1.0000001, z: 1.0000004} + - name: DB_Hair_S3_03_L + parentName: DB_Hair_S3_02_L + position: {x: -0.028766641, y: 0.0014682745, z: -0.00022172167} + rotation: {x: 0.05522288, y: 0.0009373553, z: -0.13676472, w: 0.98906267} + scale: {x: 1, y: 1.0000001, z: 1} + - name: DB_Hair_S3_03_L_end + parentName: DB_Hair_S3_03_L + position: {x: -0, y: 0.02880491, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Hair_S4_01_L + parentName: DB_Hair_S2_01_L + position: {x: -0.013684165, y: 0.032540567, z: 0.008590495} + rotation: {x: -0.017482588, y: -0.2846315, z: 0.20225425, w: 0.93689513} + scale: {x: 1.0000001, y: 1.0000004, z: 1} + - name: DB_Hair_S4_02_L + parentName: DB_Hair_S4_01_L + position: {x: -0.008308211, y: 0.01992834, z: 0.008190181} + rotation: {x: -0.09751992, y: 0.24453256, z: -0.60901856, w: 0.74819124} + scale: {x: 1, y: 0.99999994, z: 1.0000001} + - name: DB_Hair_S4_02_L_end + parentName: DB_Hair_S4_02_L + position: {x: -0, y: 0.023092227, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Hontai_01_L + parentName: CH_HairRoot + position: {x: -0.086341955, y: 0.062616855, z: -0.042004235} + rotation: {x: -0.3612036, y: 0.20890346, z: 0.90290606, w: 0.10320863} + scale: {x: 0.99999946, y: 0.99999994, z: 0.99999976} + - name: DB_Hontai_02_L + parentName: DB_Hontai_01_L + position: {x: 0.013905792, y: -0.003743007, z: 0.07425396} + rotation: {x: 0.30036432, y: 0.883534, z: -0.33884135, w: 0.11973093} + scale: {x: 1, y: 0.9999997, z: 1} + - name: DB_Hontai_03_L + parentName: DB_Hontai_02_L + position: {x: 0.068108946, y: -0.04859436, z: -0.015849028} + rotation: {x: 0.2806118, y: 0.89910394, z: -0.26827514, w: -0.20223151} + scale: {x: 1.0000001, y: 1.0000001, z: 0.99999994} + - name: DB_Hontai_03_L_end + parentName: DB_Hontai_03_L + position: {x: -0, y: 0.08515516, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Hontai_01_R + parentName: CH_HairRoot + position: {x: -0.086341955, y: -0.06261684, z: -0.042004287} + rotation: {x: -0.10320989, y: 0.9029046, z: 0.20890565, w: 0.36120546} + scale: {x: 1, y: 1.0000001, z: 1.0000001} + - name: DB_Hontai_02_R + parentName: DB_Hontai_01_R + position: {x: 0.013905919, y: -0.0037429333, z: -0.074253894} + rotation: {x: 0.30036542, y: 0.8835329, z: 0.33884236, w: -0.11973349} + scale: {x: 0.9999998, y: 1.0000002, z: 0.99999976} + - name: DB_Hontai_03_R + parentName: DB_Hontai_02_R + position: {x: 0.06810854, y: -0.04859424, z: 0.01584912} + rotation: {x: 0.2806133, y: 0.8991033, z: 0.26827475, w: 0.20223276} + scale: {x: 0.99999994, y: 0.9999998, z: 0.9999999} + - name: DB_Hontai_03_R_end + parentName: DB_Hontai_03_R + position: {x: -0, y: 0.08515518, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Hair_F2_01_R + parentName: CH_HairRoot + position: {x: 0.011319056, y: -0.072656065, z: -0.07408326} + rotation: {x: -0.13964343, y: 0.2793721, z: 0.92748624, w: 0.20547579} + scale: {x: 0.99999994, y: 0.99999994, z: 0.9999998} + - name: DB_Hair_F2_01_R_end + parentName: DB_Hair_F2_01_R + position: {x: -0, y: 0.11285753, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Hair_S1_01_R + parentName: CH_HairRoot + position: {x: -0.019978652, y: -0.08724391, z: -0.06901983} + rotation: {x: 0.0385596, y: 0.7066755, z: 0.6752447, w: 0.20776786} + scale: {x: 1, y: 1.0000001, z: 1.0000001} + - name: DB_Hair_S1_02_R + parentName: DB_Hair_S1_01_R + position: {x: -0.06366941, y: 0.0037786753, z: 0.013001638} + rotation: {x: 0.14843307, y: 0.17151333, z: -0.059982203, w: 0.9720869} + scale: {x: 1.0000001, y: 1.0000002, z: 1} + - name: DB_Hair_S1_03_R + parentName: DB_Hair_S1_02_R + position: {x: -0.04985849, y: -0.010452575, z: 0.008940113} + rotation: {x: -0.08701619, y: 0.13373652, z: 0.14230235, w: 0.9768791} + scale: {x: 1.0000001, y: 0.99999964, z: 0.9999999} + - name: DB_Hair_S1_03_R_end + parentName: DB_Hair_S1_03_R + position: {x: -0, y: 0.0517209, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Hair_F3_01_R + parentName: CH_HairRoot + position: {x: -0.034934867, y: -0.06816536, z: -0.09195772} + rotation: {x: 0.10057529, y: -0.4675015, z: 0.33172283, w: 0.8131955} + scale: {x: 0.9999999, y: 0.9999999, z: 0.9999999} + - name: DB_Hair_F3_02_R + parentName: DB_Hair_F3_01_R + position: {x: 0.0045397305, y: -0.03955913, z: -0.016659042} + rotation: {x: 0.48918247, y: 0.26743096, z: 0.75753194, w: 0.33959767} + scale: {x: 0.9999999, y: 0.99999994, z: 1} + - name: DB_Hair_F3_02_R_end + parentName: DB_Hair_F3_02_R + position: {x: -0, y: 0.043163467, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Hair_S2_01_R + parentName: CH_HairRoot + position: {x: -0.028588654, y: -0.09171347, z: -0.047888234} + rotation: {x: 0.10078835, y: 0.65323323, z: 0.6886672, w: 0.29810333} + scale: {x: 0.99999994, y: 0.9999999, z: 1} + - name: DB_Hair_S2_02_R + parentName: DB_Hair_S2_01_R + position: {x: -0.06538262, y: -0.0035510769, z: 0.016678328} + rotation: {x: 0.9167256, y: 0.12555085, z: -0.12861982, w: -0.3568027} + scale: {x: 1, y: 0.9999999, z: 0.9999999} + - name: DB_Hair_S2_03_R + parentName: DB_Hair_S2_02_R + position: {x: -0.04668216, y: -0.017778108, z: -0.011948963} + rotation: {x: 0.90631807, y: 0.09186826, z: 0.19777018, w: 0.3619872} + scale: {x: 0.99999994, y: 0.99999994, z: 1} + - name: DB_Hair_S2_03_R_end + parentName: DB_Hair_S2_03_R + position: {x: -0, y: 0.05136217, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Hair_S4_01_R + parentName: DB_Hair_S2_01_R + position: {x: -0.01368458, y: 0.032540515, z: -0.008590757} + rotation: {x: 0.017483542, y: 0.2846338, z: 0.20225787, w: 0.93689364} + scale: {x: 1.0000001, y: 1.0000002, z: 1} + - name: DB_Hair_S4_02_R + parentName: DB_Hair_S4_01_R + position: {x: -0.008308558, y: 0.019928548, z: -0.008190398} + rotation: {x: 0.09752138, y: -0.24453498, z: -0.609021, w: 0.74818826} + scale: {x: 1.0000001, y: 1, z: 1.0000002} + - name: DB_Hair_S4_02_R_end + parentName: DB_Hair_S4_02_R + position: {x: -0, y: 0.023092402, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Hair_S3_02_R + parentName: DB_Hair_S2_01_R + position: {x: -0.053408917, y: 0.019262014, z: 0.0020285498} + rotation: {x: 0.03860505, y: 0.0036029941, z: -0.16787569, w: 0.98504543} + scale: {x: 1.0000001, y: 1.0000001, z: 1.0000001} + - name: DB_Hair_S3_03_R + parentName: DB_Hair_S3_02_R + position: {x: -0.028766662, y: 0.0014681387, z: 0.0002216579} + rotation: {x: -0.05523268, y: -0.0009354825, z: -0.13675581, w: 0.9890634} + scale: {x: 0.9999999, y: 1, z: 1} + - name: DB_Hair_S3_03_R_end + parentName: DB_Hair_S3_03_R + position: {x: -0, y: 0.028805094, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_HairPonny_E_01 + parentName: CH_HairRoot + position: {x: -0.076593205, y: -0.00000007631247, z: 0.1200824} + rotation: {x: -0.4518244, y: 0.000000019738934, z: 0.8921069, w: 0.000000038989693} + scale: {x: 0.99999976, y: 1, z: 0.9999998} + - name: DB_HairPonny_E_02 + parentName: DB_HairPonny_E_01 + position: {x: -0.015404844, y: 0.0000000023629063, z: 0.018801402} + rotation: {x: -0.000000037458047, y: 0.31132665, z: -0.00000016296224, w: 0.95030296} + scale: {x: 1, y: 1, z: 1} + - name: DB_HairPonny_B_01 + parentName: DB_HairPonny_E_02 + position: {x: -0.030487511, y: 0.06311817, z: -0.00020403988} + rotation: {x: 0.22563586, y: -0.13498113, z: 0.11822663, w: 0.95754427} + scale: {x: 1.0000001, y: 0.99999994, z: 1} + - name: DB_HairPonny_B_02 + parentName: DB_HairPonny_B_01 + position: {x: -0.0677792, y: 0.05507448, z: 0.00058921333} + rotation: {x: -0.28047216, y: 0.10022667, z: -0.2812756, w: 0.91223574} + scale: {x: 1.0000001, y: 1.0000001, z: 1.0000001} + - name: DB_HairPonny_B_03 + parentName: DB_HairPonny_B_02 + position: {x: -0.1008447, y: -0.000000019073486, z: -0.00000053584574} + rotation: {x: 0.04653713, y: -0.001043574, z: 0.046271287, w: 0.9978438} + scale: {x: 0.9999998, y: 1, z: 0.9999998} + - name: DB_HairPonny_B_04 + parentName: DB_HairPonny_B_03 + position: {x: -0.13735363, y: 0.0000000047683715, z: 0.00000050276515} + rotation: {x: 0.043263245, y: 0.007867728, z: 0.042844687, w: 0.9981136} + scale: {x: 0.99999994, y: 0.99999976, z: 0.99999994} + - name: DB_HairPonny_B_05 + parentName: DB_HairPonny_B_04 + position: {x: -0.1275559, y: 0.000000085830685, z: 0.0000000333786} + rotation: {x: 0.07223201, y: 0.022419963, z: 0.07054564, w: 0.9946372} + scale: {x: 1.0000002, y: 1, z: 1} + - name: DB_HairPonny_B_06 + parentName: DB_HairPonny_B_05 + position: {x: -0.05926093, y: -0.000000011920928, z: -0.000000007152557} + rotation: {x: -0.0000008771457, y: 0.00000004516914, z: -0.00000022945459, w: 1} + scale: {x: 1, y: 1.0000001, z: 1.0000001} + - name: DB_HairPonny_B_06_end + parentName: DB_HairPonny_B_06 + position: {x: -0, y: 0.05926101, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_HairPonny_C_01 + parentName: DB_HairPonny_E_02 + position: {x: -0.035185028, y: 0.031058721, z: -0.000032242842} + rotation: {x: -0.10873754, y: -0.22070637, z: 0.959001, w: -0.14064851} + scale: {x: 1.0000004, y: 1, z: 1.0000002} + - name: DB_HairPonny_C_02 + parentName: DB_HairPonny_C_01 + position: {x: 0.10580997, y: -0.058940616, z: 0.0035568618} + rotation: {x: 0.24596307, y: -0.0785421, z: -0.23920205, w: 0.93601054} + scale: {x: 1.0000004, y: 1.0000001, z: 1.0000004} + - name: DB_HairPonny_C_03 + parentName: DB_HairPonny_C_02 + position: {x: 0.19330133, y: 0.0000001168251, z: -0.0000007882714} + rotation: {x: -0.06542371, y: 0.0000032108858, z: 0.09619262, w: 0.9932103} + scale: {x: 1.0000001, y: 1.0000002, z: 1.0000002} + - name: DB_HairPonny_C_04 + parentName: DB_HairPonny_C_03 + position: {x: 0.20366955, y: -0.026317017, z: -0.0008639145} + rotation: {x: -0.044628434, y: -0.0055368403, z: 0.09611654, w: 0.9943537} + scale: {x: 0.9999998, y: 0.9999998, z: 0.9999996} + - name: DB_HairPonny_C_05 + parentName: DB_HairPonny_C_04 + position: {x: 0.19776306, y: -0.043082256, z: -0.0023708176} + rotation: {x: 0.108746506, y: -0.0058536273, z: -0.10703975, w: 0.9882725} + scale: {x: 1, y: 1.0000001, z: 1.0000001} + - name: DB_HairPonny_C_05_end + parentName: DB_HairPonny_C_05 + position: {x: -0, y: 0.20241505, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_HairPonny_R_01 + parentName: DB_HairPonny_E_02 + position: {x: -0.03397737, y: 0.030513538, z: -0.0000000020680442} + rotation: {x: -0.13481951, y: -0.29193133, z: 0.9050875, w: -0.27823818} + scale: {x: 1.0000005, y: 1.0000004, z: 1.0000001} + - name: DB_HairPonny_R_02 + parentName: DB_HairPonny_R_01 + position: {x: 0.09520173, y: -0.07487118, z: 0.0036545396} + rotation: {x: 0.31161192, y: -0.122890264, z: -0.30340883, w: 0.8920421} + scale: {x: 1, y: 1.0000001, z: 1.0000001} + - name: DB_HairPonny_R_03 + parentName: DB_HairPonny_R_02 + position: {x: 0.19330154, y: 0.000000047683713, z: -0.00000016614794} + rotation: {x: 0.0000009291107, y: -0.00000047113275, z: 0.000000025058398, w: 1} + scale: {x: 1.0000001, y: 0.99999994, z: 1.0000001} + - name: DB_HairPonny_R_04 + parentName: DB_HairPonny_R_03 + position: {x: 0.20536458, y: 0.000000023841856, z: -0.0000011861324} + rotation: {x: 0.0000011089725, y: -0.0000017062997, z: -0.000000352884, w: 1} + scale: {x: 0.9999998, y: 0.99999994, z: 0.99999994} + - name: DB_HairPonny_R_05 + parentName: DB_HairPonny_R_04 + position: {x: 0.20241499, y: 0.00000021934508, z: -0.000000008791685} + rotation: {x: -0.0000002695015, y: 0.0000035446137, z: 0.00000017951245, w: 1} + scale: {x: 1, y: 0.99999976, z: 1} + - name: DB_HairPonny_R_06 + parentName: DB_HairPonny_R_05 + position: {x: 0.15935068, y: 0.000000076293944, z: 0.0000001603365} + rotation: {x: -0.00000044138864, y: -0.00000256038, z: -0.00000040221488, w: 1} + scale: {x: 1.0000002, y: 1.0000001, z: 1.0000001} + - name: DB_HairPonny_R_06_end + parentName: DB_HairPonny_R_06 + position: {x: -0, y: 0.1593509, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_HairPonny_E_03 + parentName: DB_HairPonny_E_02 + position: {x: -0.03397736, y: -0.000000037964142, z: 0.017013572} + rotation: {x: 0.0000007290279, y: -0.23003776, z: 0.0000003042932, w: 0.9731817} + scale: {x: 1.0000001, y: 1, z: 1} + - name: DB_HairPonny_E_04 + parentName: DB_HairPonny_E_03 + position: {x: -0.1083464, y: -0.000000009533905, z: 0.054253176} + rotation: {x: -0.00000013284787, y: 0.230036, z: -0.00000043942063, w: 0.97318214} + scale: {x: 1, y: 1, z: 1} + - name: DB_HairPonny_E_05 + parentName: DB_HairPonny_E_04 + position: {x: -0.19330136, y: -1.0618351e-11, z: 0.0000008250285} + rotation: {x: -0.000000007257256, y: 0.0000019455329, z: 0.00000013692186, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_HairPonny_E_06 + parentName: DB_HairPonny_E_05 + position: {x: -0.20536478, y: 0.0000000181024, z: -0.000000052352917} + rotation: {x: 0.000000010306467, y: 0.00000037532288, z: -0.00000015743396, + w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_HairPonny_E_07 + parentName: DB_HairPonny_E_06 + position: {x: -0.20241548, y: -0.000000007486665, z: -0.000000014204306} + rotation: {x: -0.000000013092317, y: -0.0000013895333, z: 0.000000036315225, + w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_HairPonny_E_08 + parentName: DB_HairPonny_E_07 + position: {x: -0.15935099, y: -3.2014213e-12, z: 0.000000019172244} + rotation: {x: 8.3466567e-13, y: 0.0000010160729, z: -5.8440364e-11, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_HairPonny_E_08_end + parentName: DB_HairPonny_E_08 + position: {x: -0, y: 0.15935089, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_HairPonny_D_01 + parentName: DB_HairPonny_E_02 + position: {x: -0.033977345, y: -0.000000014100426, z: -0.01103328} + rotation: {x: 0.016233122, y: 0.122253954, z: 0.035176937, w: 0.99174243} + scale: {x: 1, y: 0.99999994, z: 0.99999994} + - name: DB_HairPonny_D_02 + parentName: DB_HairPonny_D_01 + position: {x: -0.11640387, y: 0.0038259223, z: -0.033434466} + rotation: {x: -0.01912243, y: -0.13901094, z: -0.018632984, w: 0.98993087} + scale: {x: 0.9999999, y: 0.99999994, z: 0.99999994} + - name: DB_HairPonny_D_03 + parentName: DB_HairPonny_D_02 + position: {x: -0.1933014, y: -0.0000000020861626, z: 0.0000009214996} + rotation: {x: 0.00000008922146, y: 0.0000038673716, z: 0.00000015285693, w: 1} + scale: {x: 1.0000002, y: 1, z: 1} + - name: DB_HairPonny_D_04 + parentName: DB_HairPonny_D_03 + position: {x: -0.20536436, y: -0.000000020861625, z: 0.0000002304108} + rotation: {x: -0.0000025832887, y: 0.0000015817075, z: 0.00000028815703, w: 1} + scale: {x: 1, y: 0.99999994, z: 0.9999998} + - name: DB_HairPonny_D_05 + parentName: DB_HairPonny_D_04 + position: {x: -0.20241575, y: 0.00000013411045, z: -0.0000002967932} + rotation: {x: -0.0000004515385, y: -0.0000044915355, z: -0.00000030900992, w: 1} + scale: {x: 0.99999994, y: 1, z: 1.0000001} + - name: DB_HairPonny_D_06 + parentName: DB_HairPonny_D_05 + position: {x: -0.15935072, y: 0.000000022649765, z: -0.00000053849504} + rotation: {x: 0.00000238543, y: 0.000001792688, z: 0.00000032581374, w: 1} + scale: {x: 1, y: 1.0000001, z: 1.0000001} + - name: DB_HairPonny_D_06_end + parentName: DB_HairPonny_D_06 + position: {x: -0, y: 0.15935075, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_HairPonny_A_01 + parentName: DB_HairPonny_E_02 + position: {x: -0.032159887, y: -0.04864208, z: 0.00024610577} + rotation: {x: -0.34053177, y: -0.13434239, z: -0.2023523, w: 0.90831923} + scale: {x: 1, y: 1.0000001, z: 1.0000001} + - name: DB_HairPonny_A_02 + parentName: DB_HairPonny_A_01 + position: {x: -0.060427006, y: -0.057195153, z: 0.0015233612} + rotation: {x: 0.38153645, y: 0.08539931, z: 0.32513162, w: 0.86106116} + scale: {x: 1.0000002, y: 1, z: 1.0000001} + - name: DB_HairPonny_A_03 + parentName: DB_HairPonny_A_02 + position: {x: -0.10396774, y: -0.001286521, z: -0.000004790425} + rotation: {x: -0.02355242, y: 0.0009919491, z: -0.023307087, w: 0.9994504} + scale: {x: 0.9999998, y: 1, z: 0.99999976} + - name: DB_HairPonny_A_04 + parentName: DB_HairPonny_A_03 + position: {x: -0.13334043, y: -0.0000013965368, z: -0.00000037036835} + rotation: {x: -0.016839607, y: -0.0059545627, z: -0.016580204, w: 0.999703} + scale: {x: 1.0000001, y: 1.0000002, z: 1.0000001} + - name: DB_HairPonny_A_05 + parentName: DB_HairPonny_A_04 + position: {x: -0.13329972, y: 0, z: -0.0000006523728} + rotation: {x: -0.012541608, y: -0.025554592, z: -0.012928888, w: 0.9995112} + scale: {x: 0.99999994, y: 0.9999998, z: 0.99999976} + - name: DB_HairPonny_A_06 + parentName: DB_HairPonny_A_05 + position: {x: -0.10290304, y: -0.000000047683713, z: -0.00000046253203} + rotation: {x: 0.0000005918554, y: 0.00000011036171, z: -0.000000102212645, w: 1} + scale: {x: 1, y: 1.0000001, z: 1.0000002} + - name: DB_HairPonny_A_06_end + parentName: DB_HairPonny_A_06 + position: {x: -0, y: 0.102903135, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_HairPonny_L_01 + parentName: DB_HairPonny_E_02 + position: {x: -0.03397739, y: -0.030513402, z: 0.0000000014796052} + rotation: {x: -0.29188433, y: -0.11182668, z: -0.2533033, w: 0.9154976} + scale: {x: 1, y: 0.9999999, z: 0.99999976} + - name: DB_HairPonny_L_02 + parentName: DB_HairPonny_L_01 + position: {x: -0.09749372, y: -0.07195403, z: 0.0000005674362} + rotation: {x: 0.2969104, y: 0.09770134, z: 0.29690993, w: 0.90229887} + scale: {x: 1.0000001, y: 1.0000001, z: 1.0000002} + - name: DB_HairPonny_L_03 + parentName: DB_HairPonny_L_02 + position: {x: -0.19330142, y: 0.000000044107438, z: 0.0000006964048} + rotation: {x: 0.00000029348203, y: 0.0000012077221, z: 0.0000001961271, w: 1} + scale: {x: 1, y: 0.9999997, z: 0.9999999} + - name: DB_HairPonny_L_04 + parentName: DB_HairPonny_L_03 + position: {x: -0.20536473, y: 0.0000000923872, z: 0.00000050125306} + rotation: {x: -0.0000011663931, y: 0.00000074995114, z: -0.00000041768004, w: 1} + scale: {x: 1, y: 0.9999998, z: 1} + - name: DB_HairPonny_L_05 + parentName: DB_HairPonny_L_04 + position: {x: -0.20241515, y: -0.000000076293944, z: -0.00000088384604} + rotation: {x: 0.0000022095112, y: -0.0000017900721, z: 0.0000004180764, w: 1} + scale: {x: 1.0000002, y: 1.0000002, z: 1} + - name: DB_HairPonny_L_06 + parentName: DB_HairPonny_L_05 + position: {x: -0.15935083, y: 0.00000012934207, z: 0.0000006139952} + rotation: {x: -0.0000008710208, y: 0.0000009949636, z: 0.00000045876016, w: 1} + scale: {x: 0.9999998, y: 0.99999976, z: 0.99999994} + - name: DB_HairPonny_L_06_end + parentName: DB_HairPonny_L_06 + position: {x: -0, y: 0.1593509, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: CH_Shou_L + parentName: CH_Chest + position: {x: -0.012281971, y: 0.23065643, z: -0.023482827} + rotation: {x: 0.014697773, y: -0.009911863, z: 0.0014211069, w: 0.99984187} + scale: {x: 0.99999994, y: 0.99999994, z: 0.9999999} + - name: CH_Uppe_L + parentName: CH_Shou_L + position: {x: -0.109260835, y: -0.0060280543, z: -0.0054961955} + rotation: {x: -0.07411655, y: -0.0069532236, z: -0.024625355, w: 0.99692124} + scale: {x: 1, y: 1, z: 0.99999994} + - name: CH_For_L + parentName: CH_Uppe_L + position: {x: -0.24869129, y: -0.008231178, z: 0.0065248893} + rotation: {x: 0.07697588, y: 0.01682714, z: 0.027497811, w: 0.99651164} + scale: {x: 1, y: 1, z: 1.0000001} + - name: CH_Hand_L + parentName: CH_For_L + position: {x: -0.21798696, y: 0.0024355208, z: -0.001611712} + rotation: {x: -0.06779544, y: -0.01867086, z: 0.0018385081, w: 0.9975229} + scale: {x: 0.9999999, y: 0.9999999, z: 1} + - name: CH_FingerTh0_L + parentName: CH_Hand_L + position: {x: -0.0064078174, y: -0.012739353, z: 0.020646686} + rotation: {x: 0.7523961, y: 0.27812934, z: -0.282658, w: 0.525974} + scale: {x: 1.0000001, y: 1.0000001, z: 1.0000001} + - name: CH_FingerTh1_L + parentName: CH_FingerTh0_L + position: {x: -0.040618904, y: 0.00044472812, z: -0.00085017324} + rotation: {x: -0.03575346, y: -0.035349116, z: 0.05900386, w: 0.99699086} + scale: {x: 1, y: 0.99999994, z: 0.9999999} + - name: CH_FingerTh2_L + parentName: CH_FingerTh1_L + position: {x: -0.022189535, y: 0.0012206697, z: 0.00036219208} + rotation: {x: -0.012374924, y: 0.024664043, z: 0.68249154, w: 0.7303724} + scale: {x: 0.9999999, y: 0.99999994, z: 0.99999994} + - name: CH_FingerTh2_L_end + parentName: CH_FingerTh2_L + position: {x: -0, y: 0.022226112, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: CH_FingerIn0_L + parentName: CH_Hand_L + position: {x: -0.06406116, y: 0.007037236, z: 0.03002478} + rotation: {x: 0.07969865, y: 0.063763246, z: 0.0037595606, w: 0.99477047} + scale: {x: 0.9999998, y: 1, z: 0.99999994} + - name: CH_FingerIn1_L + parentName: CH_FingerIn0_L + position: {x: -0.038648907, y: 0.0006460066, z: -0.0008567846} + rotation: {x: -0.01450446, y: -0.0106268395, z: 0.014400414, w: 0.99973464} + scale: {x: 1, y: 1, z: 1} + - name: CH_FingerIn2_L + parentName: CH_FingerIn1_L + position: {x: -0.019822689, y: 0.0007674566, z: -0.00000007867813} + rotation: {x: -0.000010812651, y: 0.000008268279, z: 0.68969834, w: 0.72409683} + scale: {x: 1, y: 0.99999994, z: 1.0000002} + - name: CH_FingerIn2_L_end + parentName: CH_FingerIn2_L + position: {x: -0, y: 0.019837333, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: CH_FingerP0_L + parentName: CH_Hand_L + position: {x: -0.052998576, y: 0.00446907, z: -0.027333174} + rotation: {x: -0.09557177, y: 0.0049860994, z: -0.018023178, w: 0.99524695} + scale: {x: 0.9999999, y: 1, z: 0.9999999} + - name: CH_FingerP1_L + parentName: CH_FingerP0_L + position: {x: -0.03074476, y: 0.0013185358, z: 0.0003040218} + rotation: {x: -0.014836681, y: 0.0056708795, z: 0.0041301586, w: 0.99986535} + scale: {x: 0.9999999, y: 0.9999999, z: 0.99999994} + - name: CH_FingerP2_L + parentName: CH_FingerP1_L + position: {x: -0.016266566, y: 0.0007143402, z: -0.00000027656554} + rotation: {x: -0.00210764, y: 0.0021708312, z: 0.68771875, w: 0.7259709} + scale: {x: 1, y: 0.9999998, z: 0.99999994} + - name: CH_FingerP2_L_end + parentName: CH_FingerP2_L + position: {x: -0, y: 0.016282415, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: CH_FingerR0_L + parentName: CH_Hand_L + position: {x: -0.06365903, y: 0.010941673, z: -0.011445877} + rotation: {x: -0.041732516, y: 0.011810722, z: 0.0091352295, w: 0.9990173} + scale: {x: 1, y: 1, z: 0.99999976} + - name: CH_FingerR1_L + parentName: CH_FingerR0_L + position: {x: -0.0377971, y: 0.0028271007, z: -0.0000045108795} + rotation: {x: -0.026200145, y: 0.0016578037, z: -0.01384464, w: 0.99955946} + scale: {x: 0.9999998, y: 0.99999976, z: 0.99999994} + - name: CH_FingerR2_L + parentName: CH_FingerR1_L + position: {x: -0.019330274, y: 0.0006054902, z: -0.0000016498566} + rotation: {x: -0.0035992144, y: 0.0036179835, z: 0.6928014, w: 0.72111034} + scale: {x: 0.99999994, y: 1.0000002, z: 1.0000001} + - name: CH_FingerR2_L_end + parentName: CH_FingerR2_L + position: {x: -0, y: 0.01933992, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: CH_FingerMid0_L + parentName: CH_Hand_L + position: {x: -0.06557485, y: 0.01104105, z: 0.008100617} + rotation: {x: 0.05079656, y: 0.020697264, z: -0.0005694582, w: 0.9984944} + scale: {x: 1, y: 1.0000002, z: 0.99999994} + - name: CH_FingerMid1_L + parentName: CH_FingerMid0_L + position: {x: -0.041175857, y: 0.001160005, z: -0.00007615566} + rotation: {x: 0.019365929, y: -0.0014335193, z: 0.016425578, w: 0.9996765} + scale: {x: 0.9999999, y: 0.9999999, z: 1} + - name: CH_FingerMid2_L + parentName: CH_FingerMid1_L + position: {x: -0.0216646, y: 0.0010436233, z: -0.00004650235} + rotation: {x: -0.0013041307, y: -0.00015591593, z: 0.68631154, w: 0.7273065} + scale: {x: 0.99999994, y: 1, z: 0.9999998} + - name: CH_FingerMid2_L_end + parentName: CH_FingerMid2_L + position: {x: -0, y: 0.021689612, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Sode_Twist_L + parentName: CH_For_L + position: {x: -0.07072553, y: 0.0012443771, z: 0.004065677} + rotation: {x: -0.7070428, y: 0.0025758967, z: -0.0027394951, w: 0.7071608} + scale: {x: 0.99999994, y: 1, z: 1} + - name: DB_Sode_B_01_L + parentName: DB_Sode_Twist_L + position: {x: 0.07515088, y: -0.00000006259258, z: 0.00000079365947} + rotation: {x: 0.5000002, y: 0.49999982, z: -0.49999985, w: 0.5000002} + scale: {x: 1, y: 1, z: 1.0000001} + - name: DB_Sode_B_02_L + parentName: DB_Sode_B_01_L + position: {x: 0.00000013556924, y: -0.000000053831403, z: -0.041921053} + rotation: {x: 0.50000006, y: 0.5000001, z: -0.49999997, w: -0.49999988} + scale: {x: 1, y: 0.99999994, z: 1} + - name: DB_Sode_B_03_L + parentName: DB_Sode_B_02_L + position: {x: -0.00000003495618, y: 0.16377598, z: 0.00000008490355} + rotation: {x: 0.00000043213367, y: -0.000000017451445, z: 0.000000006864544, + w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Sode_B_04_L + parentName: DB_Sode_B_03_L + position: {x: 0.000000008950094, y: 0.20569701, z: 0.00000005475743} + rotation: {x: -0.0000014510006, y: 0.00000047640458, z: -0.00000047733556, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Sode_B_05_L + parentName: DB_Sode_B_04_L + position: {x: -0.000000017032507, y: 0.20018175, z: 0.000000035189622} + rotation: {x: 0.0000029280782, y: -0.0000006263043, z: 0.0000006202216, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Sode_B_06_L + parentName: DB_Sode_B_05_L + position: {x: 0.00000003035513, y: 0.13229717, z: -0.000000066826814} + rotation: {x: -0.0000031776726, y: 0.00000029980117, z: -0.00000028831255, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Sode_B_06_L_end + parentName: DB_Sode_B_06_L + position: {x: -0, y: 0.13229713, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Sode_A_01_L + parentName: DB_Sode_Twist_L + position: {x: -0.07054015, y: 0.000000031305326, z: -0.0000005795574} + rotation: {x: 0.5000002, y: -0.49999982, z: 0.49999985, w: 0.5000002} + scale: {x: 1, y: 1, z: 1.0000001} + - name: DB_Sode_A_02_L + parentName: DB_Sode_A_01_L + position: {x: -0.00000018392808, y: 0.00000004780384, z: -0.062379215} + rotation: {x: 0.5000001, y: -0.5000001, z: 0.50000757, w: -0.49999225} + scale: {x: 1, y: 0.99999994, z: 1} + - name: DB_Sode_A_03_L + parentName: DB_Sode_A_02_L + position: {x: 0.000000028639041, y: 0.14331773, z: 0.00000008029514} + rotation: {x: 0.00000010064001, y: -0.000007730376, z: 0.00000016145212, w: 1} + scale: {x: 1, y: 0.99999994, z: 1} + - name: DB_Sode_A_04_L + parentName: DB_Sode_A_03_L + position: {x: 0.000000007277849, y: 0.20569688, z: -0.00000012074027} + rotation: {x: 0.0000011185168, y: 0.00000024678076, z: -0.00000007896757, w: 1} + scale: {x: 1, y: 0.9999999, z: 0.99999994} + - name: DB_Sode_A_05_L + parentName: DB_Sode_A_04_L + position: {x: 0.0000000058321894, y: 0.18826447, z: -0.000000033450405} + rotation: {x: -0.0000031758095, y: -0.00000007047311, z: -0.000000009660246, + w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Sode_A_06_L + parentName: DB_Sode_A_05_L + position: {x: -0.00000004670306, y: 0.10419001, z: -0.00000009729876} + rotation: {x: 0.0000025499612, y: -0.0000000085358245, z: 0.0000000013564954, + w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Sode_A_06_L_end + parentName: DB_Sode_A_06_L + position: {x: -0, y: 0.104189925, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Sode_C_01_L + parentName: CH_Uppe_L + position: {x: -0.15429343, y: 0.037458476, z: 0.0076287184} + rotation: {x: -0.60594916, y: -0.16883437, z: 0.19716953, w: 0.7519607} + scale: {x: 1.0000001, y: 1.0000004, z: 1.0000002} + - name: DB_Sode_C_02_L + parentName: DB_Sode_C_01_L + position: {x: -0.07601813, y: 0.0045141396, z: 0.049572352} + rotation: {x: -0.020481449, y: 0.26066628, z: -0.019464942, w: 0.9650154} + scale: {x: 0.9999998, y: 0.9999998, z: 1} + - name: DB_Sode_C_02_L_end + parentName: DB_Sode_C_02_L + position: {x: -0, y: 0.09086549, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: CH_Shou_R + parentName: CH_Chest + position: {x: 0.012124489, y: 0.23065645, z: -0.0234831} + rotation: {x: 0.00043337568, y: 0.99987835, z: 0.014768094, w: -0.0050086207} + scale: {x: 1, y: 1.0000002, z: 1} + - name: CH_Uppe_R + parentName: CH_Shou_R + position: {x: -0.109188795, y: -0.0062610856, z: 0.0065627876} + rotation: {x: 0.06908981, y: 0.011750795, z: -0.024362924, w: 0.9972437} + scale: {x: 0.9999999, y: 0.99999994, z: 1.0000004} + - name: CH_For_R + parentName: CH_Uppe_R + position: {x: -0.24868745, y: -0.008401483, z: -0.0064525628} + rotation: {x: -0.07200974, y: -0.016691286, z: 0.02790731, w: 0.99687374} + scale: {x: 1, y: 1.0000004, z: 0.9999999} + - name: CH_Hand_R + parentName: CH_For_R + position: {x: -0.21798757, y: 0.0024348153, z: 0.0016114794} + rotation: {x: 0.06779566, y: 0.018671023, z: 0.0018410026, w: 0.99752283} + scale: {x: 1, y: 1, z: 1} + - name: CH_FingerTh0_R + parentName: CH_Hand_R + position: {x: -0.006407766, y: -0.012739203, z: -0.020646522} + rotation: {x: -0.28265387, y: -0.5259759, z: 0.75239724, w: -0.2781271} + scale: {x: 1.0000004, y: 1.0000006, z: 1.0000006} + - name: CH_FingerTh1_R + parentName: CH_FingerTh0_R + position: {x: 0.04061907, y: 0.00044467687, z: -0.00085032044} + rotation: {x: -0.035751946, y: 0.035347506, z: -0.059002396, w: 0.99699104} + scale: {x: 1.0000001, y: 0.9999999, z: 0.9999998} + - name: CH_FingerTh2_R + parentName: CH_FingerTh1_R + position: {x: 0.022189597, y: 0.0012205862, z: 0.00036210386} + rotation: {x: 0.68249387, y: 0.73037034, z: -0.012374707, w: 0.024662556} + scale: {x: 1, y: 1.0000001, z: 1.0000001} + - name: CH_FingerTh2_R_end + parentName: CH_FingerTh2_R + position: {x: -0, y: 0.02222597, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: CH_FingerIn0_R + parentName: CH_Hand_R + position: {x: -0.06406104, y: 0.0070373523, z: -0.030024698} + rotation: {x: -0.0037601765, y: 0.99477065, z: -0.07969837, w: 0.06376127} + scale: {x: 1, y: 1.0000001, z: 1} + - name: CH_FingerIn1_R + parentName: CH_FingerIn0_R + position: {x: 0.03864901, y: 0.00064615294, z: -0.00085680245} + rotation: {x: 0.0144177945, y: 0.9997345, z: -0.014499862, w: -0.010622344} + scale: {x: 1.0000001, y: 0.9999999, z: 1.0000002} + - name: CH_FingerIn2_R + parentName: CH_FingerIn1_R + position: {x: -0.019822806, y: 0.00076747005, z: 0.00000019073485} + rotation: {x: 0.000014294293, y: -0.000007946972, z: 0.68970054, w: 0.7240947} + scale: {x: 1, y: 0.99999994, z: 1} + - name: CH_FingerIn2_R_end + parentName: CH_FingerIn2_R + position: {x: -0, y: 0.019837638, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: CH_FingerR0_R + parentName: CH_Hand_R + position: {x: -0.06365899, y: 0.010941697, z: 0.011445911} + rotation: {x: -0.0091353385, y: 0.99901736, z: 0.041730713, w: 0.0118083395} + scale: {x: 1, y: 1.0000001, z: 0.99999976} + - name: CH_FingerR1_R + parentName: CH_FingerR0_R + position: {x: 0.037796896, y: 0.0028271053, z: -0.0000045490265} + rotation: {x: -0.0138390055, y: 0.9995598, z: -0.026189053, w: 0.0016663147} + scale: {x: 1, y: 1, z: 1} + - name: CH_FingerR2_R + parentName: CH_FingerR1_R + position: {x: -0.019330401, y: 0.000605638, z: 0.0000017547607} + rotation: {x: 0.003605214, y: -0.0036217193, z: 0.69279695, w: 0.72111464} + scale: {x: 0.9999999, y: 0.99999994, z: 1} + - name: CH_FingerR2_R_end + parentName: CH_FingerR2_R + position: {x: -0, y: 0.019339915, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: CH_FingerP0_R + parentName: CH_Hand_R + position: {x: -0.052998446, y: 0.0044688727, z: 0.027333299} + rotation: {x: 0.01802347, y: 0.9952471, z: 0.09557006, w: 0.004981065} + scale: {x: 0.99999976, y: 1, z: 0.99999976} + - name: CH_FingerP1_R + parentName: CH_FingerP0_R + position: {x: 0.030745046, y: 0.0013184547, z: 0.00030395508} + rotation: {x: 0.00413538, y: 0.9998654, z: -0.014828406, w: 0.0056751473} + scale: {x: 1.0000002, y: 1, z: 1} + - name: CH_FingerP2_R + parentName: CH_FingerP1_R + position: {x: -0.016266353, y: 0.00071466924, z: 0.00000032424927} + rotation: {x: 0.0021126827, y: -0.002169545, z: 0.6877082, w: 0.72598094} + scale: {x: 1, y: 1.0000001, z: 1.0000002} + - name: CH_FingerP2_R_end + parentName: CH_FingerP2_R + position: {x: -0, y: 0.016281962, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: CH_FingerMid0_R + parentName: CH_Hand_R + position: {x: -0.06557463, y: 0.011041118, z: -0.00809997} + rotation: {x: 0.0005642458, y: 0.99849457, z: -0.050796404, w: 0.020691592} + scale: {x: 1, y: 1.0000004, z: 1} + - name: CH_FingerMid1_R + parentName: CH_FingerMid0_R + position: {x: 0.04117568, y: 0.0011602625, z: -0.000076138975} + rotation: {x: 0.01642544, y: 0.9996765, z: 0.019367091, w: -0.0014327726} + scale: {x: 1.0000001, y: 1.0000001, z: 1.0000001} + - name: CH_FingerMid2_R + parentName: CH_FingerMid1_R + position: {x: -0.021664495, y: 0.0010435178, z: 0.00004654884} + rotation: {x: 0.0013057459, y: 0.00015577854, z: 0.6863129, w: 0.7273053} + scale: {x: 0.99999994, y: 1, z: 0.9999999} + - name: CH_FingerMid2_R_end + parentName: CH_FingerMid2_R + position: {x: -0, y: 0.021689605, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Sode_Twist_R + parentName: CH_For_R + position: {x: -0.0707259, y: 0.001245186, z: -0.0040661404} + rotation: {x: 0.70704305, y: -0.0025753796, z: -0.0027401797, w: 0.70716053} + scale: {x: 1.0000001, y: 1.0000001, z: 0.99999994} + - name: DB_Sode_A_01_R + parentName: DB_Sode_Twist_R + position: {x: -0.07054018, y: 0.000000019160511, z: 0.0000011134423} + rotation: {x: -0.5039202, y: 0.49604595, z: 0.50392306, w: 0.49604887} + scale: {x: 0.99999994, y: 0.9999998, z: 1} + - name: DB_Sode_A_02_R + parentName: DB_Sode_A_01_R + position: {x: -0.000000102927224, y: 0.00000007994764, z: 0.06237919} + rotation: {x: 0.49999756, y: -0.4999977, z: -0.50000125, w: 0.5000035} + scale: {x: 1, y: 0.9999998, z: 0.9999999} + - name: DB_Sode_A_03_R + parentName: DB_Sode_A_02_R + position: {x: -0.000000027283749, y: 0.14331758, z: 0.0000000045852357} + rotation: {x: 0.0000039525153, y: -0.0000007035201, z: 0.00000030958725, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Sode_A_04_R + parentName: DB_Sode_A_03_R + position: {x: -0.00000005695081, y: 0.2056968, z: -0.00000008667848} + rotation: {x: -0.000001151127, y: -0.00000047408884, z: -0.00000022679427, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Sode_A_05_R + parentName: DB_Sode_A_04_R + position: {x: 0.000000023280444, y: 0.1882643, z: -0.000000077367545} + rotation: {x: -0.0000020712544, y: 0.00000036774742, z: 0.00000012400066, w: 1} + scale: {x: 1, y: 1, z: 1.0000001} + - name: DB_Sode_A_06_R + parentName: DB_Sode_A_05_R + position: {x: 3.8970027e-10, y: 0.104189634, z: 0.00000014024864} + rotation: {x: 0.0000010654262, y: -0.00000023841983, z: 6.6368244e-10, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Sode_A_06_R_end + parentName: DB_Sode_A_06_R + position: {x: -0, y: 0.10418984, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Sode_B_01_R + parentName: DB_Sode_Twist_R + position: {x: 0.07515107, y: 0.00000007838026, z: -0.00000013202978} + rotation: {x: -0.49812663, y: -0.5018625, z: -0.49813053, w: 0.50186646} + scale: {x: 1.0000001, y: 1, z: 1.0000001} + - name: DB_Sode_B_02_R + parentName: DB_Sode_B_01_R + position: {x: -0.000000047871534, y: -0.000000029715883, z: 0.041921005} + rotation: {x: 0.49999803, y: 0.49999794, z: 0.5000028, w: 0.50000125} + scale: {x: 1, y: 0.99999994, z: 0.99999994} + - name: DB_Sode_B_03_R + parentName: DB_Sode_B_02_R + position: {x: 0.000000030147493, y: 0.16377567, z: 0.0000010480799} + rotation: {x: 0.00000057740147, y: -0.00000048672365, z: 0.00000019854585, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Sode_B_04_R + parentName: DB_Sode_B_03_R + position: {x: -0.000000009375799, y: 0.2056968, z: -0.000000070580974} + rotation: {x: 0.0000030118667, y: -0.00000080360417, z: -0.00000054368763, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Sode_B_05_R + parentName: DB_Sode_B_04_R + position: {x: -0.00000005803653, y: 0.20018135, z: 0.0000012537765} + rotation: {x: -0.0000030193087, y: 0.0000010308081, z: 0.0000005335727, w: 1} + scale: {x: 1, y: 0.99999994, z: 1} + - name: DB_Sode_B_06_R + parentName: DB_Sode_B_05_R + position: {x: -0.000000017018756, y: 0.1322969, z: -0.000000110429426} + rotation: {x: 0.0000028815002, y: -0.0000003269356, z: 0.00000014373873, w: 1} + scale: {x: 1, y: 0.99999994, z: 0.99999994} + - name: DB_Sode_B_06_R_end + parentName: DB_Sode_B_06_R + position: {x: -0, y: 0.132297, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Sode_C_01_R + parentName: CH_Uppe_R + position: {x: -0.1544906, y: 0.037378874, z: -0.007165909} + rotation: {x: 0.60965884, y: 0.1683714, z: 0.19816935, w: 0.74879646} + scale: {x: 1, y: 1, z: 1.0000001} + - name: DB_Sode_C_02_R + parentName: DB_Sode_C_01_R + position: {x: -0.07601836, y: 0.004513822, z: -0.049571924} + rotation: {x: 0.02048045, y: -0.26065883, z: -0.019462926, w: 0.9650175} + scale: {x: 0.99999994, y: 1, z: 0.99999976} + - name: DB_Sode_C_02_R_end + parentName: DB_Sode_C_02_R + position: {x: -0, y: 0.09086549, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Yui_01 + parentName: CH_Chest + position: {x: -0.00007873828, y: -0.0055533135, z: 0.09300276} + rotation: {x: 0.012621869, y: -0.012622002, z: 0.7069941, w: 0.7069941} + scale: {x: 1.0000001, y: 0.9999993, z: 1.0000001} + - name: DB_Yui_01_end + parentName: DB_Yui_01 + position: {x: -0, y: 0.15502922, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Se_A_01_L + parentName: CH_Chest + position: {x: -0.035720672, y: -0.027678194, z: -0.10499585} + rotation: {x: 0.37955755, y: 0.6959062, z: -0.5971699, w: 0.12263277} + scale: {x: 1, y: 0.9999998, z: 1} + - name: DB_Se_A_02_L + parentName: DB_Se_A_01_L + position: {x: 0.0061411737, y: 0.012879329, z: 0.075529404} + rotation: {x: -0.24811666, y: 0.72953796, z: 0.14364325, w: 0.62095016} + scale: {x: 1.0000001, y: 0.9999998, z: 1.0000001} + - name: DB_Se_A_02_L_end + parentName: DB_Se_A_02_L + position: {x: -0, y: 0.076865315, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Ribbon_01_L + parentName: CH_Chest + position: {x: -0.02973076, y: 0.038719244, z: -0.11095828} + rotation: {x: 0.47502026, y: 0.5103168, z: 0.5036692, w: 0.5101469} + scale: {x: 1, y: 0.99999994, z: 0.99999994} + - name: DB_Ribbon_02_L + parentName: DB_Ribbon_01_L + position: {x: 0.006333625, y: -0.028709888, z: -0.06914581} + rotation: {x: 0.5488721, y: 0.64759505, z: 0.2970563, w: -0.43717} + scale: {x: 1.0000001, y: 1, z: 0.9999998} + - name: DB_Ribbon_02_L_end + parentName: DB_Ribbon_02_L + position: {x: -0, y: 0.07513666, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Wing_01_L + parentName: CH_Chest + position: {x: -0.09459109, y: 0.019864999, z: -0.11785887} + rotation: {x: -0.03509301, y: 0.54361415, z: 0.8148731, w: -0.19807579} + scale: {x: 1.0000001, y: 1.0000001, z: 1} + - name: DB_Wing_02_L + parentName: DB_Wing_01_L + position: {x: 0.08566747, y: -0.009382233, z: -0.10407833} + rotation: {x: 0.33157405, y: 0.64837986, z: 0.62494457, w: -0.28125867} + scale: {x: 0.9999999, y: 1, z: 0.99999976} + - name: DB_Wing_03_L + parentName: DB_Wing_02_L + position: {x: -0.21784946, y: 0.01103724, z: -0.0012900734} + rotation: {x: 0.12758519, y: 0.15889907, z: 0.12734312, w: 0.9706992} + scale: {x: 1.0000001, y: 1.0000002, z: 1.0000004} + - name: DB_Wing_04_L + parentName: DB_Wing_03_L + position: {x: -0.24561739, y: 0.051883504, z: -0.049193997} + rotation: {x: -0.7049644, y: 0.09990609, z: 0.11619699, w: 0.6924899} + scale: {x: 1, y: 0.99999994, z: 1} + - name: DB_Wing_05_L + parentName: DB_Wing_04_L + position: {x: -0.1814758, y: 0.06948755, z: 0.017430376} + rotation: {x: 0.65725267, y: -0.08469431, z: -0.15790564, w: 0.7320599} + scale: {x: 1, y: 0.9999999, z: 0.99999994} + - name: DB_Wing_05_L_end + parentName: DB_Wing_05_L + position: {x: -0, y: 0.19510457, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Se_A_01_R + parentName: CH_Chest + position: {x: 0.035563193, y: -0.027678115, z: -0.10499586} + rotation: {x: -0.5984501, y: 0.12135365, z: 0.37896076, w: 0.6953558} + scale: {x: 1, y: 1, z: 1.0000001} + - name: DB_Se_A_02_R + parentName: DB_Se_A_01_R + position: {x: 0.006114845, y: 0.013139727, z: -0.07548661} + rotation: {x: 0.24994868, y: -0.7295034, z: 0.14315614, w: 0.62036824} + scale: {x: 0.9999999, y: 1.0000001, z: 1.0000001} + - name: DB_Se_A_02_R_end + parentName: DB_Se_A_02_R + position: {x: -0, y: 0.07686509, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Ribbon_01_R + parentName: CH_Chest + position: {x: 0.02957328, y: 0.038719166, z: -0.11095828} + rotation: {x: 0.50431395, y: 0.5088831, z: 0.4749981, w: 0.51096207} + scale: {x: 1, y: 0.9999997, z: 0.9999999} + - name: DB_Ribbon_02_R + parentName: DB_Ribbon_01_R + position: {x: 0.0064747725, y: -0.028799247, z: 0.06909559} + rotation: {x: 0.5491629, y: 0.64797735, z: -0.29766905, w: 0.4358194} + scale: {x: 1, y: 0.9999997, z: 1.0000001} + - name: DB_Ribbon_02_R_end + parentName: DB_Ribbon_02_R + position: {x: -0, y: 0.07513666, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Wing_01_R + parentName: CH_Chest + position: {x: 0.09457092, y: 0.019297248, z: -0.11766987} + rotation: {x: 0.81443703, y: -0.195344, z: -0.036799707, w: 0.54514116} + scale: {x: 1.0000002, y: 1.0000002, z: 1.0000001} + - name: DB_Wing_02_R + parentName: DB_Wing_01_R + position: {x: 0.08528502, y: -0.009584007, z: 0.10372579} + rotation: {x: 0.3303919, y: 0.6504693, z: -0.62272114, w: 0.28275302} + scale: {x: 1, y: 1.0000002, z: 1.0000001} + - name: DB_Wing_03_R + parentName: DB_Wing_02_R + position: {x: -0.21784933, y: 0.011036229, z: 0.0012900209} + rotation: {x: -0.12757559, y: -0.15889944, z: 0.12734507, w: 0.9707001} + scale: {x: 1, y: 0.99999976, z: 0.9999998} + - name: DB_Wing_04_R + parentName: DB_Wing_03_R + position: {x: -0.24561688, y: 0.051883724, z: 0.049193278} + rotation: {x: 0.7049765, y: -0.09990848, z: 0.116198815, w: 0.6924769} + scale: {x: 1.0000001, y: 1.0000002, z: 1.0000002} + - name: DB_Wing_05_R + parentName: DB_Wing_04_R + position: {x: -0.18147565, y: 0.069487825, z: -0.017431352} + rotation: {x: -0.6572682, y: 0.08469687, z: -0.15790655, w: 0.73204535} + scale: {x: 0.99999994, y: 0.9999999, z: 0.99999964} + - name: DB_Wing_05_R_end + parentName: DB_Wing_05_R + position: {x: -0, y: 0.19510466, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Bust_01_L + parentName: CH_Chest + position: {x: -0.045915846, y: 0.13167338, z: 0.008157868} + rotation: {x: 0.6831262, y: 0.1243552, z: 0.71066463, w: -0.11327015} + scale: {x: 0.9999992, y: 1, z: 1.0000001} + - name: DB_Bust_02_L + parentName: DB_Bust_01_L + position: {x: 0.04555152, y: 0.0007748288, z: -0.015781386} + rotation: {x: -0.033195987, y: 0.9703462, z: -0.17722182, w: -0.16099273} + scale: {x: 0.9999998, y: 1.0000002, z: 0.99999994} + - name: DB_Bust_02_L_end + parentName: DB_Bust_02_L + position: {x: -0, y: 0.048214015, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Bust_01_R + parentName: CH_Chest + position: {x: 0.045758367, y: 0.13167323, z: 0.008157874} + rotation: {x: -0.68313026, y: 0.12435394, z: 0.7106616, w: 0.113266855} + scale: {x: 1.0000008, y: 1.0000002, z: 1} + - name: DB_Bust_02_R + parentName: DB_Bust_01_R + position: {x: -0.045551334, y: 0.00077503204, z: -0.015781404} + rotation: {x: 0.033200588, y: 0.9703504, z: -0.17722109, w: 0.16096777} + scale: {x: 0.9999999, y: 0.9999996, z: 0.9999998} + - name: DB_Bust_02_R_end + parentName: DB_Bust_02_R + position: {x: -0, y: 0.048213854, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Skirt_Root + parentName: CH_Spine + position: {x: -0.00007874018, y: 0.10784568, z: 0.008305135} + rotation: {x: 0.5065588, y: 0.4933541, z: -0.5065587, w: -0.49335402} + scale: {x: 0.9999998, y: 0.99999964, z: 0.9999996} + - name: DB_Skirt_A_00_L + parentName: DB_Skirt_Root + position: {x: -0.005919308, y: -0.081187926, z: 0.037028134} + rotation: {x: 0.9886333, y: 0.068873234, z: -0.06886442, w: 0.11453576} + scale: {x: 1.0000018, y: 0.99999994, z: 1.0000037} + - name: DB_Skirt_A_01_L + parentName: DB_Skirt_A_00_L + position: {x: -0.048206225, y: -0.00000002503395, z: 0.00000026106835} + rotation: {x: -0.5190421, y: -0.13519114, z: -0.08883795, w: 0.8393012} + scale: {x: 1.0000001, y: 1.0000001, z: 0.9999998} + - name: DB_Skirt_A_02_L + parentName: DB_Skirt_A_01_L + position: {x: -0.04316255, y: -0.00000019192696, z: 0.00000007867813} + rotation: {x: 0.6788012, y: 0.16176912, z: -0.028153837, w: 0.7157284} + scale: {x: 1.0000001, y: 1.0000001, z: 1} + - name: DB_Skirt_A_03_L + parentName: DB_Skirt_A_02_L + position: {x: -0.07563619, y: 0.00000017166137, z: 0.00000030755996} + rotation: {x: -0.30099624, y: -0.06077376, z: 0.021307869, w: 0.9514483} + scale: {x: 0.9999999, y: 1.0000001, z: 0.9999999} + - name: DB_Skirt_A_04_L + parentName: DB_Skirt_A_03_L + position: {x: -0.06269684, y: -0.000000038146972, z: 0.0000003480911} + rotation: {x: 0.12105323, y: 0.027283242, z: -0.0041861553, w: 0.9922622} + scale: {x: 0.9999999, y: 0.99999976, z: 0.99999964} + - name: DB_Skirt_A_05_L + parentName: DB_Skirt_A_04_L + position: {x: -0.068666436, y: -0.0000000667572, z: 0.00000034332274} + rotation: {x: 0.0000002160668, y: -0.00000008475034, z: 0.000000051222738, w: 1} + scale: {x: 1, y: 1.0000001, z: 1.0000002} + - name: DB_Skirt_A_05_L_end + parentName: DB_Skirt_A_05_L + position: {x: -0, y: 0.06866649, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Skirt_B_01_L + parentName: DB_Skirt_Root + position: {x: -0.026402013, y: -0.0495657, z: 0.09382382} + rotation: {x: 0.84656805, y: 0.12749854, z: -0.12749875, w: 0.5008102} + scale: {x: 1.0000001, y: 1.0000002, z: 0.9999998} + - name: DB_Skirt_B_02_L + parentName: DB_Skirt_B_01_L + position: {x: -0.061201446, y: 0.00000005483627, z: -0.000000014305114} + rotation: {x: -0.11362099, y: -0.010648978, z: 0.04229765, w: 0.9925663} + scale: {x: 0.99999994, y: 0.9999998, z: 0.9999998} + - name: DB_Skirt_B_03_L + parentName: DB_Skirt_B_02_L + position: {x: -0.06120112, y: -0.000000044107438, z: -0.0000000037439167} + rotation: {x: 0.113623716, y: 0.010649163, z: -0.0422995, w: 0.9925659} + scale: {x: 1, y: 1.0000001, z: 1.0000001} + - name: DB_Skirt_B_04_L + parentName: DB_Skirt_B_03_L + position: {x: -0.061201286, y: -0.00000004053116, z: 0.000000009536743} + rotation: {x: 0.00000006798655, y: -0.000000013969839, z: 0.0000005578622, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Skirt_B_04_L_end + parentName: DB_Skirt_B_04_L + position: {x: -0, y: 0.06120149, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Skirt_C_01_L + parentName: DB_Skirt_Root + position: {x: -0.015127751, y: 0.0036500238, z: 0.11416566} + rotation: {x: 0.62223047, y: 0.16748916, z: -0.16748913, w: 0.7461394} + scale: {x: 1.0000001, y: 1.0000001, z: 0.99999976} + - name: DB_Skirt_C_02_L + parentName: DB_Skirt_C_01_L + position: {x: -0.061201252, y: 0.000000060945744, z: -0.00000000834465} + rotation: {x: -0.025608357, y: -0.010111154, z: 0.042430107, w: 0.99872005} + scale: {x: 1, y: 1, z: 1.0000001} + - name: DB_Skirt_C_03_L + parentName: DB_Skirt_C_02_L + position: {x: -0.061201274, y: -0.00000005841255, z: -0.0000000023841857} + rotation: {x: 0.025599128, y: 0.010109475, z: -0.042431254, w: 0.9987202} + scale: {x: 0.99999976, y: 0.9999998, z: 0.99999976} + - name: DB_Skirt_C_04_L + parentName: DB_Skirt_C_03_L + position: {x: -0.06120142, y: 0.00000006407499, z: -0.000000013113022} + rotation: {x: -0.000000059604645, y: 2.3283064e-10, z: 0.00000012564124, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Skirt_C_04_L_end + parentName: DB_Skirt_C_04_L + position: {x: -0, y: 0.061201546, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Skirt_E_01_L + parentName: DB_Skirt_Root + position: {x: -0.017052164, y: 0.09371286, z: 0.027265651} + rotation: {x: -0.4943337, y: 0.17446516, z: -0.17446527, w: 0.8335215} + scale: {x: 1, y: 1.0000002, z: 1} + - name: DB_Skirt_E_02_L + parentName: DB_Skirt_E_01_L + position: {x: -0.061201446, y: -0.000000028610229, z: -0.000000022649765} + rotation: {x: 0.009058533, y: -0.04163055, z: 0.01301367, w: 0.9990072} + scale: {x: 0.9999999, y: 0.9999996, z: 0.99999994} + - name: DB_Skirt_E_03_L + parentName: DB_Skirt_E_02_L + position: {x: -0.06120128, y: -0.00000007867813, z: 0.000000077486035} + rotation: {x: 0.002835001, y: -0.011104343, z: 0.003562789, w: 0.999928} + scale: {x: 1, y: 0.99999994, z: 0.99999994} + - name: DB_Skirt_E_04_L + parentName: DB_Skirt_E_03_L + position: {x: -0.061201386, y: 0.0000000047683715, z: 0.00000004529953} + rotation: {x: 0.00000017229465, y: 0.0000000018626438, z: -0.00000020489097, + w: 1} + scale: {x: 0.99999994, y: 1.0000002, z: 1.0000001} + - name: DB_Skirt_E_04_L_end + parentName: DB_Skirt_E_04_L + position: {x: -0, y: 0.061201345, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Skirt_D_01_L + parentName: DB_Skirt_Root + position: {x: -0.014013145, y: 0.06532121, z: 0.07861873} + rotation: {x: -0.028069327, y: 0.1858796, z: -0.18587953, w: 0.9644219} + scale: {x: 1.0000001, y: 0.99999976, z: 1.0000001} + - name: DB_Skirt_D_02_L + parentName: DB_Skirt_D_01_L + position: {x: -0.061201207, y: -0.000000005960464, z: -0.000000032717363} + rotation: {x: -0.0033062762, y: -0.03233883, z: 0.029271381, w: 0.9990428} + scale: {x: 0.99999994, y: 1.0000001, z: 0.9999999} + - name: DB_Skirt_D_03_L + parentName: DB_Skirt_D_02_L + position: {x: -0.06120122, y: 0.000000028610229, z: -0.000000027120112} + rotation: {x: 0.0033009183, y: 0.032339223, z: -0.029273093, w: 0.99904275} + scale: {x: 0.99999976, y: 0.99999964, z: 0.9999997} + - name: DB_Skirt_D_04_L + parentName: DB_Skirt_D_03_L + position: {x: -0.06120134, y: 0.000000028610229, z: 0.00000008167233} + rotation: {x: -0.0000001379085, y: 0.000000059069862, z: -0.000000031664968, + w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Skirt_D_04_L_end + parentName: DB_Skirt_D_04_L + position: {x: -0, y: 0.06120126, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Skirt_F_01_C + parentName: DB_Skirt_Root + position: {x: -0.02845147, y: -0.07837399, z: 0.00000000941017} + rotation: {x: -0.7064357, y: -0.030843785, z: 0.030844036, w: 0.70643187} + scale: {x: 0.99999994, y: 1.0000002, z: 0.9999998} + - name: DB_Skirt_F_02_C + parentName: DB_Skirt_F_01_C + position: {x: -0.06276076, y: 0.000000028611911, z: 0.000000009116139} + rotation: {x: 0.000001963571, y: -0.043618415, z: -0.00000031387654, w: 0.9990483} + scale: {x: 0.9999998, y: 1, z: 0.9999999} + - name: DB_Skirt_F_03_C + parentName: DB_Skirt_F_02_C + position: {x: -0.06276092, y: 0.000000009541815, z: -0.00000001918153} + rotation: {x: 0.000001945809, y: -0.04362011, z: -0.0000005032294, w: 0.99904823} + scale: {x: 0.99999994, y: 1, z: 0.99999994} + - name: DB_Skirt_F_04_C + parentName: DB_Skirt_F_03_C + position: {x: -0.06276066, y: -0.000000019085018, z: -0.00000003795007} + rotation: {x: -6.883383e-14, y: 0.000000014901158, z: 1.021405e-14, w: 1} + scale: {x: 0.99999994, y: 1, z: 0.99999994} + - name: DB_Skirt_F_04_C_end + parentName: DB_Skirt_F_04_C + position: {x: -0, y: 0.06276062, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Skirt_D_01_R + parentName: DB_Skirt_Root + position: {x: -0.014013141, y: 0.0653212, z: -0.07861875} + rotation: {x: 0.9644182, y: -0.18589155, z: 0.18588704, w: -0.028071372} + scale: {x: 1.0000021, y: 1.0000002, z: 1.0000004} + - name: DB_Skirt_D_02_R + parentName: DB_Skirt_D_01_R + position: {x: -0.06120126, y: 0.00000004887581, z: 0.00000004546251} + rotation: {x: 0.0033094892, y: -0.032338366, z: -0.029269652, w: 0.99904287} + scale: {x: 1, y: 1.0000002, z: 1.0000002} + - name: DB_Skirt_D_03_R + parentName: DB_Skirt_D_02_R + position: {x: -0.06120096, y: -0.0000000011920929, z: 0.00000007659197} + rotation: {x: -0.0032966628, y: 0.032337006, z: 0.029272333, w: 0.99904287} + scale: {x: 0.9999998, y: 0.99999994, z: 0.9999999} + - name: DB_Skirt_D_04_R + parentName: DB_Skirt_D_03_R + position: {x: -0.061201222, y: 0.000000022649765, z: 0.0000000997819} + rotation: {x: 0.00000008333883, y: -0.00000006679329, z: 0.0000000046566138, + w: 1} + scale: {x: 1, y: 0.9999998, z: 0.9999999} + - name: DB_Skirt_D_04_R_end + parentName: DB_Skirt_D_04_R + position: {x: -0, y: 0.06120142, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Skirt_E_01_R + parentName: DB_Skirt_Root + position: {x: -0.017052162, y: 0.093712874, z: -0.027265625} + rotation: {x: 0.8335211, y: -0.17446595, z: 0.17446627, w: -0.49433368} + scale: {x: 0.99999994, y: 1.0000002, z: 1} + - name: DB_Skirt_E_02_R + parentName: DB_Skirt_E_01_R + position: {x: -0.06120119, y: -0.000000076293944, z: 0.000000102519984} + rotation: {x: -0.009059916, y: -0.041632082, z: -0.013013172, w: 0.99900717} + scale: {x: 1.0000001, y: 1.0000001, z: 1.0000001} + - name: DB_Skirt_E_03_R + parentName: DB_Skirt_E_02_R + position: {x: -0.061201505, y: 0.00000021934508, z: -0.000000102519984} + rotation: {x: -0.0030704609, y: -0.0110883545, z: -0.0036108461, w: 0.9999273} + scale: {x: 0.99999976, y: 1, z: 1} + - name: DB_Skirt_E_04_R + parentName: DB_Skirt_E_03_R + position: {x: -0.06120137, y: -0.000000052452087, z: 0.000000007152557} + rotation: {x: -0.000000073574476, y: -0.00000002328306, z: 0.00000030547378, + w: 1} + scale: {x: 1.0000001, y: 1.0000001, z: 1.0000001} + - name: DB_Skirt_E_04_R_end + parentName: DB_Skirt_E_04_R + position: {x: -0, y: 0.06120141, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Skirt_C_01_R + parentName: DB_Skirt_Root + position: {x: -0.015127669, y: 0.0036500357, z: -0.11416563} + rotation: {x: 0.7461397, y: -0.16748993, z: 0.16748971, w: 0.62222975} + scale: {x: 1, y: 1.0000001, z: 0.99999976} + - name: DB_Skirt_C_02_R + parentName: DB_Skirt_C_01_R + position: {x: -0.061201356, y: 0.00000007599592, z: 0.000000027418135} + rotation: {x: 0.025609408, y: -0.010111335, z: -0.042431355, w: 0.99872} + scale: {x: 1, y: 1.0000001, z: 1} + - name: DB_Skirt_C_03_R + parentName: DB_Skirt_C_02_R + position: {x: -0.061201304, y: -0.00000003516674, z: 0.0000000047683715} + rotation: {x: -0.025590483, y: 0.010107933, z: 0.04243304, w: 0.9987204} + scale: {x: 0.9999999, y: 1.0000001, z: 1.0000002} + - name: DB_Skirt_C_04_R + parentName: DB_Skirt_C_03_R + position: {x: -0.061201274, y: 0.000000007897615, z: 0.000000007152557} + rotation: {x: 0.000000013969838, y: 0.0000000015133992, z: 0.0000000942091, + w: 1} + scale: {x: 1, y: 1, z: 1.0000001} + - name: DB_Skirt_C_04_R_end + parentName: DB_Skirt_C_04_R + position: {x: -0, y: 0.061201405, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Skirt_B_01_R + parentName: DB_Skirt_Root + position: {x: -0.02640216, y: -0.049565695, z: -0.09382382} + rotation: {x: 0.5008093, y: -0.12749927, z: 0.12749895, w: 0.84656835} + scale: {x: 1, y: 1.0000002, z: 1} + - name: DB_Skirt_B_02_R + parentName: DB_Skirt_B_01_R + position: {x: -0.06120146, y: 0.0000000166893, z: 0.000000023841856} + rotation: {x: 0.11361794, y: -0.010647971, z: -0.042299516, w: 0.9925666} + scale: {x: 0.9999998, y: 1, z: 0.99999994} + - name: DB_Skirt_B_03_R + parentName: DB_Skirt_B_02_R + position: {x: -0.06120115, y: -0.000000059604645, z: 0.000000011743977} + rotation: {x: -0.113616526, y: 0.010647851, z: 0.042300668, w: 0.9925667} + scale: {x: 0.9999999, y: 0.99999994, z: 1} + - name: DB_Skirt_B_04_R + parentName: DB_Skirt_B_03_R + position: {x: -0.061201327, y: 0.000000023841856, z: -0.000000014305114} + rotation: {x: -0.000000018626448, y: -0.00000012479722, z: -0.00000025518239, + w: 1} + scale: {x: 1, y: 1.0000001, z: 1.0000001} + - name: DB_Skirt_B_04_R_end + parentName: DB_Skirt_B_04_R + position: {x: -0, y: 0.061201423, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: DB_Skirt_A_00_R + parentName: DB_Skirt_Root + position: {x: -0.005919383, y: -0.08118793, z: -0.037028152} + rotation: {x: 0.114535645, y: -0.068863116, z: 0.06886332, w: 0.9886341} + scale: {x: 0.99999994, y: 0.9999999, z: 1.0000002} + - name: DB_Skirt_A_01_R + parentName: DB_Skirt_A_00_R + position: {x: -0.048206396, y: 0.000000022053719, z: -0.0000000011920929} + rotation: {x: 0.51904047, y: -0.13519132, z: 0.08883778, w: 0.8393022} + scale: {x: 1.0000001, y: 0.9999999, z: 0.9999996} + - name: DB_Skirt_A_02_R + parentName: DB_Skirt_A_01_R + position: {x: -0.043162618, y: -0.00000007033348, z: 0.000000020861625} + rotation: {x: -0.6787974, y: 0.16176796, z: 0.028152978, w: 0.7157322} + scale: {x: 1.0000001, y: 1.0000004, z: 1} + - name: DB_Skirt_A_03_R + parentName: DB_Skirt_A_02_R + position: {x: -0.075636156, y: -0.000000034570693, z: -0.000000005960464} + rotation: {x: 0.3009944, y: -0.060773686, z: -0.021306733, w: 0.9514489} + scale: {x: 1, y: 1.0000004, z: 1.0000004} + - name: DB_Skirt_A_04_R + parentName: DB_Skirt_A_03_R + position: {x: -0.06269685, y: 0.000000052452087, z: 0} + rotation: {x: -0.12105262, y: 0.02728288, z: 0.0041858335, w: 0.9922623} + scale: {x: 0.99999994, y: 0.99999964, z: 0.99999946} + - name: DB_Skirt_A_05_R + parentName: DB_Skirt_A_04_R + position: {x: -0.068666466, y: -0.0000000011920929, z: 0.000000023841856} + rotation: {x: -0.000000070780516, y: -0.000000027008351, z: 0.000000088475645, + w: 1} + scale: {x: 1.0000001, y: 1, z: 1.0000001} + - name: DB_Skirt_A_05_R_end + parentName: DB_Skirt_A_05_R + position: {x: -0, y: 0.06866663, z: 0} + rotation: {x: 0, y: -0, z: -0, w: 1} + scale: {x: 1, y: 1, z: 1} + - name: BodyTop.005 + parentName: UnityCHanKAGURA_B(Clone) + position: {x: 0.028763741, y: 0.0000000141331675, z: 0.02928832} + rotation: {x: 0.000000011641534, y: 4.6566306e-10, z: -0.0000000018626443, w: 1} + scale: {x: 1, y: 0.9999999, z: 0.9999999} + - name: BodyTop.004 + parentName: UnityCHanKAGURA_B(Clone) + position: {x: 0.028763741, y: 0.0000000141331675, z: 0.02928832} + rotation: {x: 0.000000011641534, y: 4.6566306e-10, z: -0.0000000018626443, w: 1} + scale: {x: 1, y: 0.9999999, z: 0.9999999} + - name: BodyTop.003 + parentName: UnityCHanKAGURA_B(Clone) + position: {x: 0.028763741, y: 0.0000000141331675, z: 0.02928832} + rotation: {x: 0.000000011641534, y: 4.6566306e-10, z: -0.0000000018626443, w: 1} + scale: {x: 1, y: 0.9999999, z: 0.9999999} + - name: BodyTop.002 + parentName: UnityCHanKAGURA_B(Clone) + position: {x: 0.028763741, y: 0.0000000141331675, z: 0.02928832} + rotation: {x: 0.000000011641534, y: 4.6566306e-10, z: -0.0000000018626443, w: 1} + scale: {x: 1, y: 0.9999999, z: 0.9999999} + - name: BodyTop.001 + parentName: UnityCHanKAGURA_B(Clone) + position: {x: 0.028763741, y: 0.0000000141331675, z: 0.02928832} + rotation: {x: 0.000000011641534, y: 4.6566306e-10, z: -0.0000000018626443, w: 1} + scale: {x: 1, y: 0.9999999, z: 0.9999999} + - name: head_Def + parentName: UnityCHanKAGURA_B(Clone) + position: {x: -0.0000000047683715, y: 0.00000003665686, z: -0.00000000476837} + rotation: {x: 0.000000011641534, y: 4.6566306e-10, z: -0.0000000018626443, w: 1} + scale: {x: 1, y: 0.9999999, z: 0.9999999} + - name: Headgear + parentName: UnityCHanKAGURA_B(Clone) + position: {x: -0.0000000047683715, y: 0.00000003665686, z: -0.00000000476837} + rotation: {x: 0.000000011641534, y: 4.6566306e-10, z: -0.0000000018626443, w: 1} + scale: {x: 1, y: 0.9999999, z: 0.9999999} + - name: Hontai + parentName: UnityCHanKAGURA_B(Clone) + position: {x: 0.028763741, y: 0.0000000141331675, z: 0.02928832} + rotation: {x: 0.000000011641534, y: 4.6566306e-10, z: -0.0000000018626443, w: 1} + scale: {x: 1, y: 0.9999999, z: 0.9999999} + - name: HairB01 + parentName: UnityCHanKAGURA_B(Clone) + position: {x: 0.028763741, y: 0.0000000141331675, z: 0.02928832} + rotation: {x: 0.000000011641534, y: 4.6566306e-10, z: -0.0000000018626443, w: 1} + scale: {x: 1, y: 0.9999999, z: 0.9999999} + - name: Gohei + parentName: UnityCHanKAGURA_B(Clone) + position: {x: 0.028763741, y: 0.0000000141331675, z: 0.02928832} + rotation: {x: 0.000000011641534, y: 4.6566306e-10, z: -0.0000000018626443, w: 1} + scale: {x: 1, y: 0.9999999, z: 0.9999999} + - name: BodyTop + parentName: UnityCHanKAGURA_B(Clone) + position: {x: 0.028763741, y: 0.0000000141331675, z: 0.02928832} + rotation: {x: 0.000000011641534, y: 4.6566306e-10, z: -0.0000000018626443, w: 1} + scale: {x: 1, y: 0.9999999, z: 0.9999999} + - name: BodyBottom + parentName: UnityCHanKAGURA_B(Clone) + position: {x: 0.028763741, y: 0.0000000141331675, z: 0.02928832} + rotation: {x: 0.000000011641534, y: 4.6566306e-10, z: -0.0000000018626443, w: 1} + scale: {x: 1, y: 0.9999999, z: 0.9999999} + - name: RibbonF + parentName: UnityCHanKAGURA_B(Clone) + position: {x: 0.028763741, y: 0.0000000141331675, z: 0.02928832} + rotation: {x: 0.000000011641534, y: 4.6566306e-10, z: -0.0000000018626443, w: 1} + scale: {x: 1, y: 0.9999999, z: 0.9999999} + - name: Skirt + parentName: UnityCHanKAGURA_B(Clone) + position: {x: 0.028763741, y: 0.0000000141331675, z: 0.02928832} + rotation: {x: 0.000000011641534, y: 4.6566306e-10, z: -0.0000000018626443, w: 1} + scale: {x: 1, y: 0.9999999, z: 0.9999999} + - name: EyeNose + parentName: UnityCHanKAGURA_B(Clone) + position: {x: 0.028763741, y: 0.0000000141331675, z: 0.02928832} + rotation: {x: 0.000000011641534, y: 4.6566306e-10, z: -0.0000000018626443, w: 1} + scale: {x: 1, y: 0.9999999, z: 0.9999999} + - name: HairS01 + parentName: UnityCHanKAGURA_B(Clone) + position: {x: 0.028763741, y: 0.0000000141331675, z: 0.02928832} + rotation: {x: 0.000000011641534, y: 4.6566306e-10, z: -0.0000000018626443, w: 1} + scale: {x: 1, y: 0.9999999, z: 0.9999999} + - name: HairP02 + parentName: UnityCHanKAGURA_B(Clone) + position: {x: 0.028763741, y: 0.0000000141331675, z: 0.02928832} + rotation: {x: 0.000000011641534, y: 4.6566306e-10, z: -0.0000000018626443, w: 1} + scale: {x: 1, y: 0.9999999, z: 0.9999999} + - name: Back + parentName: UnityCHanKAGURA_B(Clone) + position: {x: 0.028763741, y: 0.0000000141331675, z: 0.02928832} + rotation: {x: 0.000000011641534, y: 4.6566306e-10, z: -0.0000000018626443, w: 1} + scale: {x: 1, y: 0.9999999, z: 0.9999999} + - name: Lamp + parentName: UnityCHanKAGURA_B(Clone) + position: {x: -4.0762453, y: 5.903862, z: -1.005454} + rotation: {x: 0.52327543, y: -0.34203398, z: 0.72694236, w: 0.28416628} + scale: {x: 100.00001, y: 100, z: 100} + - name: Camera + parentName: UnityCHanKAGURA_B(Clone) + position: {x: -7.4811316, y: 5.343665, z: 6.5076394} + rotation: {x: 0.0906284, y: 0.8937962, z: -0.20997299, w: 0.38577998} + scale: {x: 100, y: 100.00001, z: 99.99999} + armTwist: 0.5 + foreArmTwist: 0.5 + upperLegTwist: 0.5 + legTwist: 0.5 + armStretch: 0.05 + legStretch: 0.05 + feetSpacing: 0 + globalScale: 1 + rootMotionBoneName: + hasTranslationDoF: 0 + hasExtraRoot: 1 + skeletonHasParents: 1 + lastHumanDescriptionAvatarSource: {instanceID: 0} + autoGenerateAvatarMappingIfUnspecified: 1 + animationType: 3 + humanoidOversampling: 1 + avatarSetup: 1 + addHumanoidExtraRootOnlyWhenUsingAvatar: 1 + importBlendShapeDeformPercent: 1 + remapMaterialsIfMaterialImportModeIsNone: 0 + additionalBone: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/UnityCHanKAGURA.fbx + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/UnityCHanKAGURA_MC2.prefab b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/UnityCHanKAGURA_MC2.prefab new file mode 100644 index 00000000..59845608 --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/UnityCHanKAGURA_MC2.prefab @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:14cdc785604144bb02b06bc56d2439eafe6035c3aa279ca90edc94824ab1c3c1 +size 1050073 diff --git a/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/UnityCHanKAGURA_MC2.prefab.meta b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/UnityCHanKAGURA_MC2.prefab.meta new file mode 100644 index 00000000..bf816ebb --- /dev/null +++ b/Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/UnityCHanKAGURA_MC2.prefab.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: c221ca113bd2c6847887aae336c65708 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Example (Can be deleted)/UnityChan/UnityChanKAGURA/UnityCHanKAGURA_MC2.prefab + uploadId: 893596 diff --git a/Assets/MagicaCloth2/MagicaCloth2.asmdef b/Assets/MagicaCloth2/MagicaCloth2.asmdef new file mode 100644 index 00000000..b08ade0b --- /dev/null +++ b/Assets/MagicaCloth2/MagicaCloth2.asmdef @@ -0,0 +1,37 @@ +{ + "name": "MagicaClothV2", + "rootNamespace": "", + "references": [ + "Unity.Burst", + "Unity.Collections", + "Unity.Mathematics" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": true, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [ + "MC2_BURST", + "MC2_COLLECTIONS" + ], + "versionDefines": [ + { + "name": "com.unity.burst", + "expression": "1.8.1", + "define": "MC2_BURST" + }, + { + "name": "com.unity.collections", + "expression": "1.4.0", + "define": "MC2_COLLECTIONS" + }, + { + "name": "com.unity.collections", + "expression": "2.0.0", + "define": "MC2_COLLECTIONS_200" + } + ], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Assets/MagicaCloth2/MagicaCloth2.asmdef.meta b/Assets/MagicaCloth2/MagicaCloth2.asmdef.meta new file mode 100644 index 00000000..8616d025 --- /dev/null +++ b/Assets/MagicaCloth2/MagicaCloth2.asmdef.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 406190ab8ee569c46bc05a890e5127a0 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/MagicaCloth2.asmdef + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Readme.txt b/Assets/MagicaCloth2/Readme.txt new file mode 100644 index 00000000..8c387a30 --- /dev/null +++ b/Assets/MagicaCloth2/Readme.txt @@ -0,0 +1,60 @@ +ïğż/------------------------------------------------------------------------------ +// Magica Cloth 2 +// Copyright (c) Magica Soft, 2023 +// https://magicasoft.jp +//------------------------------------------------------------------------------ + +### Overview +MagicaCloth2 is a general-purpose cloth simulation that can be used in Unity. + + +### Support Unity versions +Unity2021.3.20 or higher + + +### Required Unity package +Burst 1.8.2 or higher +Collections 1.4.0 or higher +Mathematics 1.2.6 or higher + + +### Feature +* Fast cloth simulation with DOTS +* Works on all platforms except WebGL +* Supports both BoneCloth driven by bones (Transform) and MeshCloth driven by mesh vertices +* MeshCloth is also available for skinning meshes +* Not affected by render pipeline or shader +* With full source code + + +### Install +The necessary packages are automatically installed when importing Magica Cloth. +If you get an error, manually install the Burst/Collections/Mathematics package. +See [Required Unity package] for each package version. + + +### Documentation +Since it is an online manual, please refer to the following URL for details. +https://magicasoft.jp/en/magica-cloth-2-2/ + + +### Support +Support email. +support@magicasoft.jp + +Unity Forum. +https://forum.unity.com/threads/coming-soon-magicacloth2-hybrid-cloth-simulation.1395865/ + +It would be helpful if you could include the versions of the Unity editor and MagicaCloth2 you are using to facilitate support. +You can check the version of MagicaCloth from the menu [Tools->Magica Cloth2->About]. + + +### License +MagicaCloth2 uses Unity-chan as a key image and sample. +Âİ Unity Technologies Japan/UCL +https://unity-chan.com/ + + +### Release Notes +https://magicasoft.jp/en/mc2_releasenote/ + diff --git a/Assets/MagicaCloth2/Readme.txt.meta b/Assets/MagicaCloth2/Readme.txt.meta new file mode 100644 index 00000000..96791033 --- /dev/null +++ b/Assets/MagicaCloth2/Readme.txt.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: c7df889e086412e46a2da4fb58d8fd0b +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Readme.txt + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Readme_jpn.txt b/Assets/MagicaCloth2/Readme_jpn.txt new file mode 100644 index 00000000..8ea4dc00 --- /dev/null +++ b/Assets/MagicaCloth2/Readme_jpn.txt @@ -0,0 +1,60 @@ +ïğż/------------------------------------------------------------------------------ +// Magica Cloth 2 +// Copyright (c) Magica Soft, 2023 +// https://magicasoft.jp +//------------------------------------------------------------------------------ + +■ĉĤ‚èĤ +MagicaCloth2ŻUnity§ċˆİ用§‚‹ĉħŽç”¨çš„Ş‚Żƒ­‚ı‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³§™€‚ + + +■èĤĉħ‚Unityƒƒĵ‚¸ƒ§ƒ³ +Unity2021.3.20äğ上 + + +■èĤĉħ‚ƒ‘ƒƒ‚ħƒĵ‚¸ +Burst 1.8.2äğ上 +Collections 1.4.0äğ上 +Mathematics 1.2.6äğ上 + + +■ĉݟ能 +* DOTSĞ‚ˆ‚‹éИ速Ş‚Żƒ­‚ı‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ +* WebGL‚’除™ıĤƒ—ƒİƒƒƒˆƒ•‚݃ĵƒ §ċ‹•作ċŻèƒ½ +* ƒœƒĵƒ³(Transform)§é§†ċ‹•™‚‹BoneCloth¨ƒĦƒƒ‚·ƒé ‚ç‚ı§é§†ċ‹•™‚‹MeshClothä¸Ħĉ–ıĞċŻċżœ +* MeshClothŻ‚ı‚­ƒ‹ƒ³‚°ƒĦƒƒ‚·ƒ§‚‚ċˆİ用ċŻèƒ½ +* ƒĴƒ³ƒ€ƒĵƒ‘‚¤ƒ—ƒİ‚¤ƒ³‚„‚·‚§ƒĵƒ€ƒĵĞċ½ħ響•‚Œ›‚“ +* ƒ•ƒĞ‚½ƒĵ‚ı‚³ƒĵƒ‰ä𘁍 + + +■‚¤ƒ³‚ıƒˆƒĵƒĞ +Magica Cloth‚¤ƒ³ƒƒĵƒˆĉ™‚Ğċż…èĤŞƒ‘ƒƒ‚ħƒĵ‚¸Żè‡Şċ‹•§‚¤ƒ³‚ıƒˆƒĵƒĞ•‚Œ™€‚ +‚‚—‚¨ƒİƒĵŒç™şç”Ÿ™‚‹ċ ´ċˆŻBurst / Collections / Mathematicsƒ‘ƒƒ‚ħƒĵ‚¸‚’ĉ‰‹ċ‹•§‚¤ƒ³‚ıƒˆƒĵƒĞ—Ĥ •„€‚ +ċ„ƒ‘ƒƒ‚ħƒĵ‚¸ƒƒĵ‚¸ƒ§ƒ³Ż[èĤĉħ‚ƒ‘ƒƒ‚ħƒĵ‚¸]‚’ċ‚ç…§—Ĥ •„€‚ + + +■ƒžƒ‹ƒ‚˘ƒĞ +‚ރ³ƒİ‚¤ƒ³ƒžƒ‹ƒ‚˘ƒĞ¨Ş£Ĥ„™§€èݳ—ŻĉĴĦURL‚’ċ‚ç…§—Ĥ •„€‚ +https://magicasoft.jp/magica-cloth-2/ + + +■‚µƒƒĵƒˆçŞ“ċ£ +‚µƒƒĵƒˆƒĦƒĵƒĞ +support@magicasoft.jp + +Unityƒ•‚݃ĵƒİƒ  +https://forum.unity.com/threads/coming-soon-magicacloth2-hybrid-cloth-simulation.1395865/ + +‚µƒƒĵƒˆ‚’ċ††ĉğ‘Ğ進‚‚‹Ÿ‚Ğä½żç”¨—Ĥ„‚‹Unity‚¨ƒ‡‚£‚żƒĵ¨MagicaCloth2ƒƒĵ‚¸ƒ§ƒ³‚’記èĵ‰—Ĥ„Ÿ ¨ċŠİ‹‚Ё™€‚ +MagicaClothƒƒĵ‚¸ƒ§ƒ³ŻƒĦƒ‹ƒƒĵ[Tools->Magica Cloth2->About]‹‚‰ç˘şèލċŻèƒ½§™€‚ + + +■ƒİ‚¤‚ğƒ³‚ı +MagicaCloth2Ż‚­ƒĵç”ğċƒŠ‚ˆ³‚µƒ³ƒ—ƒĞ¨—ĤUnityĦ‚ƒ‚“‚’ä½żç”¨—Ĥ„™ +Âİ Unity Technologies Japan/UCL +https://unity-chan.com/ + + +■ĉ›´ĉ–°ċħĉ­´ +https://magicasoft.jp/mc2_releasenote/ + diff --git a/Assets/MagicaCloth2/Readme_jpn.txt.meta b/Assets/MagicaCloth2/Readme_jpn.txt.meta new file mode 100644 index 00000000..bde28ce7 --- /dev/null +++ b/Assets/MagicaCloth2/Readme_jpn.txt.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 73816f2cd0da25345afb170423318b5d +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Readme_jpn.txt + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Res.meta b/Assets/MagicaCloth2/Res.meta new file mode 100644 index 00000000..21c2a352 --- /dev/null +++ b/Assets/MagicaCloth2/Res.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d6123dfb6786202488da533186450913 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Res/Icon.meta b/Assets/MagicaCloth2/Res/Icon.meta new file mode 100644 index 00000000..79c83063 --- /dev/null +++ b/Assets/MagicaCloth2/Res/Icon.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b423dff8e87989b4a97592892c3a6df4 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Res/Icon/icon-cloth.png b/Assets/MagicaCloth2/Res/Icon/icon-cloth.png new file mode 100644 index 00000000..fa721a09 --- /dev/null +++ b/Assets/MagicaCloth2/Res/Icon/icon-cloth.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0f8369c86b1695a0a80f25375715200b922a2c20ec6f3292be71ce23d6923421 +size 931 diff --git a/Assets/MagicaCloth2/Res/Icon/icon-cloth.png.meta b/Assets/MagicaCloth2/Res/Icon/icon-cloth.png.meta new file mode 100644 index 00000000..01e673ed --- /dev/null +++ b/Assets/MagicaCloth2/Res/Icon/icon-cloth.png.meta @@ -0,0 +1,131 @@ +fileFormatVersion: 2 +guid: cf7e3400035e987478c3a19e57b4cf75 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 32 + resizeAlgorithm: 0 + textureFormat: 4 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Res/Icon/icon-cloth.png + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Res/Icon/icon-collider.png b/Assets/MagicaCloth2/Res/Icon/icon-collider.png new file mode 100644 index 00000000..c3f77357 --- /dev/null +++ b/Assets/MagicaCloth2/Res/Icon/icon-collider.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9c87f0c91057a13f60265155b0b340f5535c6fc210f5a8dc80883e4ca2c819ef +size 4475 diff --git a/Assets/MagicaCloth2/Res/Icon/icon-collider.png.meta b/Assets/MagicaCloth2/Res/Icon/icon-collider.png.meta new file mode 100644 index 00000000..24f07b42 --- /dev/null +++ b/Assets/MagicaCloth2/Res/Icon/icon-collider.png.meta @@ -0,0 +1,143 @@ +fileFormatVersion: 2 +guid: db1f683d4db92254e93d234d88f6cd1d +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 1 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 32 + resizeAlgorithm: 0 + textureFormat: 4 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Res/Icon/icon-collider.png + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Res/Icon/icon-settings.png b/Assets/MagicaCloth2/Res/Icon/icon-settings.png new file mode 100644 index 00000000..8dfa9610 --- /dev/null +++ b/Assets/MagicaCloth2/Res/Icon/icon-settings.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fe828b360d4c32e569f13e8919d4b6a0a1a4de8d12d2b47bb99f5d361023f02e +size 3507 diff --git a/Assets/MagicaCloth2/Res/Icon/icon-settings.png.meta b/Assets/MagicaCloth2/Res/Icon/icon-settings.png.meta new file mode 100644 index 00000000..c95e9377 --- /dev/null +++ b/Assets/MagicaCloth2/Res/Icon/icon-settings.png.meta @@ -0,0 +1,142 @@ +fileFormatVersion: 2 +guid: 4b0d1adb21ff82e4e8e9ea02f486a85f +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 32 + resizeAlgorithm: 0 + textureFormat: 4 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Res/Icon/icon-settings.png + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Res/Icon/icon-wind.png b/Assets/MagicaCloth2/Res/Icon/icon-wind.png new file mode 100644 index 00000000..64781b82 --- /dev/null +++ b/Assets/MagicaCloth2/Res/Icon/icon-wind.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:573222aa068255bd58533a19e667a3a1f941a32589fd5961ff11658aba507892 +size 10349 diff --git a/Assets/MagicaCloth2/Res/Icon/icon-wind.png.meta b/Assets/MagicaCloth2/Res/Icon/icon-wind.png.meta new file mode 100644 index 00000000..3af6840f --- /dev/null +++ b/Assets/MagicaCloth2/Res/Icon/icon-wind.png.meta @@ -0,0 +1,142 @@ +fileFormatVersion: 2 +guid: 28008cd7b4b7bb24482a4260fbe8c25e +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + cookieLightType: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 32 + resizeAlgorithm: 0 + textureFormat: 4 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Android + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Res/Icon/icon-wind.png + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Res/Preset.meta b/Assets/MagicaCloth2/Res/Preset.meta new file mode 100644 index 00000000..183744cb --- /dev/null +++ b/Assets/MagicaCloth2/Res/Preset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1855ce0df2330234dbaf3ab95ef26ba6 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Res/Preset/MC2_Preset_Accessory.json b/Assets/MagicaCloth2/Res/Preset/MC2_Preset_Accessory.json new file mode 100644 index 00000000..4435d0d0 --- /dev/null +++ b/Assets/MagicaCloth2/Res/Preset/MC2_Preset_Accessory.json @@ -0,0 +1 @@ +{"clothType":0,"sourceRenderers":[],"meshWriteMode":0,"paintMode":0,"paintMaps":[],"rootBones":[],"connectionMode":0,"rotationalInterpolation":0.5,"rootRotation":0.5,"updateMode":10,"animationPoseRatio":0.0,"reductionSetting":{"simpleDistance":0.0,"shapeDistance":0.0},"customSkinningSetting":{"enable":false,"skinningBones":[]},"normalAlignmentSetting":{"alignmentMode":0,"adjustmentTransform":{"instanceID":0}},"cullingSettings":{"cameraCullingMode":30,"cameraCullingMethod":0,"cameraCullingRenderers":[],"distanceCullingLength":{"value":30.0,"use":false},"distanceCullingFadeRatio":0.20000000298023225,"distanceCullingReferenceObject":{"instanceID":0}},"normalAxis":1,"gravity":0.0,"gravityDirection":{"x":0.0,"y":-1.0,"z":0.0},"gravityFalloff":0.0,"stablizationTimeAfterReset":0.10000000149011612,"blendWeight":1.0,"damping":{"value":0.10000000149011612,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"radius":{"value":0.019999999552965165,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"inertiaConstraint":{"anchor":{"instanceID":0},"anchorInertia":0.0,"worldInertia":1.0,"movementInertiaSmoothing":0.4000000059604645,"movementSpeedLimit":{"value":5.0,"use":true},"rotationSpeedLimit":{"value":720.0,"use":true},"localInertia":1.0,"localMovementSpeedLimit":{"value":5.0,"use":false},"localRotationSpeedLimit":{"value":720.0,"use":false},"depthInertia":0.0,"centrifualAcceleration":0.0,"particleSpeedLimit":{"value":4.0,"use":true},"teleportMode":0,"teleportDistance":0.5,"teleportRotation":90.0},"tetherConstraint":{"distanceCompression":0.10000000149011612},"distanceConstraint":{"stiffness":{"value":1.0,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":-0.5,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":0.5,"inSlope":-0.5,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}}},"triangleBendingConstraint":{"stiffness":1.0},"angleRestorationConstraint":{"useAngleRestoration":true,"stiffness":{"value":0.15000000596046449,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":-0.699999988079071,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":0.30000001192092898,"inSlope":-0.699999988079071,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"velocityAttenuation":0.6000000238418579,"gravityFalloff":0.0},"angleLimitConstraint":{"useAngleLimit":true,"limitAngle":{"value":45.0,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":0.0,"inSlope":0.0,"outSlope":1.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":1.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"stiffness":1.0},"motionConstraint":{"useMaxDistance":false,"maxDistance":{"value":0.30000001192092898,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"useBackstop":false,"backstopRadius":10.0,"backstopDistance":{"value":0.0,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"stiffness":1.0},"colliderCollisionConstraint":{"mode":1,"friction":0.05000000074505806,"colliderList":[],"collisionBones":[],"limitDistance":{"value":0.05000000074505806,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}}},"selfCollisionConstraint":{"selfMode":0,"surfaceThickness":{"value":0.004999999888241291,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":0.5,"inSlope":0.0,"outSlope":0.5,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.5,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"syncMode":0,"syncPartner":{"instanceID":0},"clothMass":0.0},"wind":{"influence":1.0,"frequency":1.0,"turbulence":1.0,"blend":0.699999988079071,"synchronization":0.699999988079071,"depthWeight":0.0,"movingWind":0.0},"springConstraint":{"useSpring":true,"springPower":0.03999999910593033,"limitDistance":0.10000000149011612,"normalLimitRatio":1.0,"springNoise":0.0}} \ No newline at end of file diff --git a/Assets/MagicaCloth2/Res/Preset/MC2_Preset_Accessory.json.meta b/Assets/MagicaCloth2/Res/Preset/MC2_Preset_Accessory.json.meta new file mode 100644 index 00000000..3a5893ce --- /dev/null +++ b/Assets/MagicaCloth2/Res/Preset/MC2_Preset_Accessory.json.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 42bb4454dd53bc541be9d7166cbbf61e +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Res/Preset/MC2_Preset_Accessory.json + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Res/Preset/MC2_Preset_Cape.json b/Assets/MagicaCloth2/Res/Preset/MC2_Preset_Cape.json new file mode 100644 index 00000000..197a287c --- /dev/null +++ b/Assets/MagicaCloth2/Res/Preset/MC2_Preset_Cape.json @@ -0,0 +1 @@ +{"clothType":0,"sourceRenderers":[],"meshWriteMode":0,"paintMode":0,"paintMaps":[],"rootBones":[],"connectionMode":0,"rotationalInterpolation":0.5,"rootRotation":0.5,"updateMode":10,"animationPoseRatio":0.0,"reductionSetting":{"simpleDistance":0.0,"shapeDistance":0.0},"customSkinningSetting":{"enable":false,"skinningBones":[]},"normalAlignmentSetting":{"alignmentMode":0,"adjustmentTransform":{"instanceID":0}},"cullingSettings":{"cameraCullingMode":30,"cameraCullingMethod":0,"cameraCullingRenderers":[],"distanceCullingLength":{"value":30.0,"use":false},"distanceCullingFadeRatio":0.20000000298023225,"distanceCullingReferenceObject":{"instanceID":0}},"normalAxis":1,"gravity":7.0,"gravityDirection":{"x":0.0,"y":-1.0,"z":0.0},"gravityFalloff":0.0,"stablizationTimeAfterReset":0.10000000149011612,"blendWeight":1.0,"damping":{"value":0.10000000149011612,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"radius":{"value":0.019999999552965165,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"inertiaConstraint":{"anchor":{"instanceID":0},"anchorInertia":0.0,"worldInertia":1.0,"movementInertiaSmoothing":0.4000000059604645,"movementSpeedLimit":{"value":5.0,"use":true},"rotationSpeedLimit":{"value":720.0,"use":true},"localInertia":1.0,"localMovementSpeedLimit":{"value":5.0,"use":false},"localRotationSpeedLimit":{"value":720.0,"use":false},"depthInertia":0.699999988079071,"centrifualAcceleration":0.0,"particleSpeedLimit":{"value":4.0,"use":true},"teleportMode":0,"teleportDistance":0.5,"teleportRotation":90.0},"tetherConstraint":{"distanceCompression":0.5},"distanceConstraint":{"stiffness":{"value":1.0,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":-0.5,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":0.5,"inSlope":-0.5,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}}},"triangleBendingConstraint":{"stiffness":1.0},"angleRestorationConstraint":{"useAngleRestoration":true,"stiffness":{"value":0.15000000596046449,"useCurve":true,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":0.09678345918655396,"inSlope":-0.699999988079071,"outSlope":-0.699999988079071,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"velocityAttenuation":0.800000011920929,"gravityFalloff":0.0},"angleLimitConstraint":{"useAngleLimit":true,"limitAngle":{"value":45.0,"useCurve":true,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":0.0,"inSlope":2.0,"outSlope":2.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"stiffness":1.0},"motionConstraint":{"useMaxDistance":false,"maxDistance":{"value":0.30000001192092898,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"useBackstop":false,"backstopRadius":10.0,"backstopDistance":{"value":0.0,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"stiffness":1.0},"colliderCollisionConstraint":{"mode":1,"friction":0.10000000149011612,"colliderList":[],"collisionBones":[],"limitDistance":{"value":0.05000000074505806,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}}},"selfCollisionConstraint":{"selfMode":0,"surfaceThickness":{"value":0.004999999888241291,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":0.5,"inSlope":0.0,"outSlope":0.5,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.5,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"syncMode":0,"syncPartner":{"instanceID":0},"clothMass":0.0},"wind":{"influence":1.0,"frequency":1.0,"turbulence":1.0,"blend":0.699999988079071,"synchronization":0.699999988079071,"depthWeight":0.0,"movingWind":0.0},"springConstraint":{"useSpring":true,"springPower":0.03999999910593033,"limitDistance":0.10000000149011612,"normalLimitRatio":1.0,"springNoise":0.0}} \ No newline at end of file diff --git a/Assets/MagicaCloth2/Res/Preset/MC2_Preset_Cape.json.meta b/Assets/MagicaCloth2/Res/Preset/MC2_Preset_Cape.json.meta new file mode 100644 index 00000000..c42c0475 --- /dev/null +++ b/Assets/MagicaCloth2/Res/Preset/MC2_Preset_Cape.json.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 72735c72edd9bb340b389ee4f7ccc363 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Res/Preset/MC2_Preset_Cape.json + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Res/Preset/MC2_Preset_FrontHair.json b/Assets/MagicaCloth2/Res/Preset/MC2_Preset_FrontHair.json new file mode 100644 index 00000000..755a3676 --- /dev/null +++ b/Assets/MagicaCloth2/Res/Preset/MC2_Preset_FrontHair.json @@ -0,0 +1 @@ +{"clothType":0,"sourceRenderers":[],"meshWriteMode":0,"paintMode":0,"paintMaps":[],"rootBones":[],"connectionMode":0,"rotationalInterpolation":0.5,"rootRotation":0.5,"updateMode":10,"animationPoseRatio":0.0,"reductionSetting":{"simpleDistance":0.0,"shapeDistance":0.0},"customSkinningSetting":{"enable":false,"skinningBones":[]},"normalAlignmentSetting":{"alignmentMode":0,"adjustmentTransform":{"instanceID":0}},"cullingSettings":{"cameraCullingMode":30,"cameraCullingMethod":0,"cameraCullingRenderers":[],"distanceCullingLength":{"value":30.0,"use":false},"distanceCullingFadeRatio":0.20000000298023225,"distanceCullingReferenceObject":{"instanceID":0}},"normalAxis":1,"gravity":4.0,"gravityDirection":{"x":0.0,"y":-1.0,"z":0.0},"gravityFalloff":0.800000011920929,"stablizationTimeAfterReset":0.10000000149011612,"blendWeight":1.0,"damping":{"value":0.10000000149011612,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"radius":{"value":0.019999999552965165,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"inertiaConstraint":{"anchor":{"instanceID":0},"anchorInertia":0.0,"worldInertia":1.0,"movementInertiaSmoothing":0.4000000059604645,"movementSpeedLimit":{"value":3.0,"use":true},"rotationSpeedLimit":{"value":360.0,"use":true},"localInertia":1.0,"localMovementSpeedLimit":{"value":5.0,"use":false},"localRotationSpeedLimit":{"value":720.0,"use":false},"depthInertia":0.0,"centrifualAcceleration":0.0,"particleSpeedLimit":{"value":2.0,"use":true},"teleportMode":0,"teleportDistance":0.5,"teleportRotation":90.0},"tetherConstraint":{"distanceCompression":0.10000000149011612},"distanceConstraint":{"stiffness":{"value":1.0,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":-0.5,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":0.5,"inSlope":-0.5,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}}},"triangleBendingConstraint":{"stiffness":1.0},"angleRestorationConstraint":{"useAngleRestoration":true,"stiffness":{"value":0.15000000596046449,"useCurve":true,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":-0.699999988079071,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":0.30000001192092898,"inSlope":-0.699999988079071,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"velocityAttenuation":0.699999988079071,"gravityFalloff":0.5},"angleLimitConstraint":{"useAngleLimit":true,"limitAngle":{"value":15.0,"useCurve":true,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":0.0,"inSlope":0.0,"outSlope":1.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":1.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"stiffness":0.5},"motionConstraint":{"useMaxDistance":false,"maxDistance":{"value":0.30000001192092898,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"useBackstop":false,"backstopRadius":10.0,"backstopDistance":{"value":0.0,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"stiffness":1.0},"colliderCollisionConstraint":{"mode":1,"friction":0.05000000074505806,"colliderList":[],"collisionBones":[],"limitDistance":{"value":0.05000000074505806,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}}},"selfCollisionConstraint":{"selfMode":0,"surfaceThickness":{"value":0.004999999888241291,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":0.5,"inSlope":0.0,"outSlope":0.5,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.5,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"syncMode":0,"syncPartner":{"instanceID":0},"clothMass":0.0},"wind":{"influence":1.0,"frequency":1.0,"turbulence":1.0,"blend":0.699999988079071,"synchronization":0.699999988079071,"depthWeight":0.0,"movingWind":0.0},"springConstraint":{"useSpring":true,"springPower":0.03999999910593033,"limitDistance":0.10000000149011612,"normalLimitRatio":1.0,"springNoise":0.0}} \ No newline at end of file diff --git a/Assets/MagicaCloth2/Res/Preset/MC2_Preset_FrontHair.json.meta b/Assets/MagicaCloth2/Res/Preset/MC2_Preset_FrontHair.json.meta new file mode 100644 index 00000000..392bcbdb --- /dev/null +++ b/Assets/MagicaCloth2/Res/Preset/MC2_Preset_FrontHair.json.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 59cdb0fe679574d4fbd4caba5eef451b +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Res/Preset/MC2_Preset_FrontHair.json + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Res/Preset/MC2_Preset_HardSpring.json b/Assets/MagicaCloth2/Res/Preset/MC2_Preset_HardSpring.json new file mode 100644 index 00000000..dd41edb0 --- /dev/null +++ b/Assets/MagicaCloth2/Res/Preset/MC2_Preset_HardSpring.json @@ -0,0 +1 @@ +{"clothType":0,"sourceRenderers":[],"paintMode":0,"paintMaps":[],"rootBones":[],"connectionMode":0,"rotationalInterpolation":0.5,"rootRotation":0.5,"updateMode":10,"animationPoseRatio":0.0,"reductionSetting":{"simpleDistance":0.0,"shapeDistance":0.0},"customSkinningSetting":{"enable":false,"skinningBones":[]},"normalAlignmentSetting":{"alignmentMode":0,"adjustmentTransform":{"instanceID":0}},"cullingSettings":{"cameraCullingMode":30,"cameraCullingMethod":0,"cameraCullingRenderers":[]},"normalAxis":1,"gravity":0.0,"gravityDirection":{"x":0.0,"y":-1.0,"z":0.0},"gravityFalloff":0.0,"stablizationTimeAfterReset":0.10000000149011612,"damping":{"value":0.30000001192092898,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"radius":{"value":0.019999999552965165,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"inertiaConstraint":{"anchor":{"instanceID":0},"anchorInertia":0.0,"worldInertia":1.0,"movementInertiaSmoothing":0.4000000059604645,"movementSpeedLimit":{"value":1.0,"use":true},"rotationSpeedLimit":{"value":360.0,"use":true},"localInertia":1.0,"localMovementSpeedLimit":{"value":1.0,"use":true},"localRotationSpeedLimit":{"value":360.0,"use":true},"depthInertia":0.0,"centrifualAcceleration":0.0,"particleSpeedLimit":{"value":4.0,"use":true},"teleportMode":0,"teleportDistance":0.5,"teleportRotation":90.0},"tetherConstraint":{"distanceCompression":0.0989999994635582},"distanceConstraint":{"stiffness":{"value":0.24199999868869782,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":-0.5,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":0.5,"inSlope":-0.5,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}}},"triangleBendingConstraint":{"stiffness":0.2409999966621399},"angleRestorationConstraint":{"useAngleRestoration":true,"stiffness":{"value":0.6000000238418579,"useCurve":true,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":0.5023223757743836,"inSlope":-0.800000011920929,"outSlope":-0.800000011920929,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"velocityAttenuation":0.4000000059604645,"gravityFalloff":0.0},"angleLimitConstraint":{"useAngleLimit":false,"limitAngle":{"value":15.0,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":0.0,"inSlope":0.0,"outSlope":1.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":1.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"stiffness":0.5},"motionConstraint":{"useMaxDistance":false,"maxDistance":{"value":0.30000001192092898,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"useBackstop":false,"backstopRadius":10.0,"backstopDistance":{"value":0.0,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"stiffness":1.0},"colliderCollisionConstraint":{"mode":1,"friction":0.20000000298023225,"colliderList":[],"collisionBones":[],"limitDistance":{"value":0.05000000074505806,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}}},"selfCollisionConstraint":{"selfMode":0,"surfaceThickness":{"value":0.004999999888241291,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":0.5,"inSlope":0.0,"outSlope":0.5,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.5,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"syncMode":0,"syncPartner":{"instanceID":0},"clothMass":0.0},"wind":{"influence":0.20000000298023225,"frequency":1.0,"turbulence":1.0,"blend":0.699999988079071,"synchronization":0.699999988079071,"depthWeight":0.0,"movingWind":0.0},"springConstraint":{"useSpring":true,"springPower":0.05999999865889549,"limitDistance":0.05000000074505806,"normalLimitRatio":1.0,"springNoise":0.0}} \ No newline at end of file diff --git a/Assets/MagicaCloth2/Res/Preset/MC2_Preset_HardSpring.json.meta b/Assets/MagicaCloth2/Res/Preset/MC2_Preset_HardSpring.json.meta new file mode 100644 index 00000000..784db491 --- /dev/null +++ b/Assets/MagicaCloth2/Res/Preset/MC2_Preset_HardSpring.json.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 7c6ab357392efc7428b1f002db37b9f2 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Res/Preset/MC2_Preset_HardSpring.json + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Res/Preset/MC2_Preset_LongHair.json b/Assets/MagicaCloth2/Res/Preset/MC2_Preset_LongHair.json new file mode 100644 index 00000000..116e3da8 --- /dev/null +++ b/Assets/MagicaCloth2/Res/Preset/MC2_Preset_LongHair.json @@ -0,0 +1 @@ +{"clothType":0,"sourceRenderers":[],"meshWriteMode":0,"paintMode":0,"paintMaps":[],"rootBones":[],"connectionMode":0,"rotationalInterpolation":0.5,"rootRotation":0.5,"updateMode":10,"animationPoseRatio":0.0,"reductionSetting":{"simpleDistance":0.0,"shapeDistance":0.0},"customSkinningSetting":{"enable":false,"skinningBones":[]},"normalAlignmentSetting":{"alignmentMode":0,"adjustmentTransform":{"instanceID":0}},"cullingSettings":{"cameraCullingMode":30,"cameraCullingMethod":0,"cameraCullingRenderers":[],"distanceCullingLength":{"value":30.0,"use":false},"distanceCullingFadeRatio":0.20000000298023225,"distanceCullingReferenceObject":{"instanceID":0}},"normalAxis":1,"gravity":5.0,"gravityDirection":{"x":0.0,"y":-1.0,"z":0.0},"gravityFalloff":0.0,"stablizationTimeAfterReset":0.10000000149011612,"blendWeight":1.0,"damping":{"value":0.10000000149011612,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"radius":{"value":0.019999999552965165,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"inertiaConstraint":{"anchor":{"instanceID":0},"anchorInertia":0.0,"worldInertia":1.0,"movementInertiaSmoothing":0.4000000059604645,"movementSpeedLimit":{"value":5.0,"use":true},"rotationSpeedLimit":{"value":720.0,"use":true},"localInertia":1.0,"localMovementSpeedLimit":{"value":3.0,"use":true},"localRotationSpeedLimit":{"value":360.0,"use":true},"depthInertia":0.0,"centrifualAcceleration":0.0,"particleSpeedLimit":{"value":3.0,"use":true},"teleportMode":0,"teleportDistance":0.5,"teleportRotation":90.0},"tetherConstraint":{"distanceCompression":0.4000000059604645},"distanceConstraint":{"stiffness":{"value":1.0,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":-0.5,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":0.5,"inSlope":-0.5,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}}},"triangleBendingConstraint":{"stiffness":1.0},"angleRestorationConstraint":{"useAngleRestoration":true,"stiffness":{"value":0.20000000298023225,"useCurve":true,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":-2.279167652130127,"outSlope":-2.279167652130127,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.022117581218481065},{"serializedVersion":"3","time":1.0,"value":0.10624390840530396,"inSlope":-0.4003539979457855,"outSlope":-0.4003539979457855,"tangentMode":0,"weightedMode":0,"inWeight":0.03681504726409912,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"velocityAttenuation":0.800000011920929,"gravityFalloff":0.5},"angleLimitConstraint":{"useAngleLimit":true,"limitAngle":{"value":75.0,"useCurve":true,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":0.20166015625,"inSlope":1.901634693145752,"outSlope":1.901634693145752,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.03710045665502548},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.3574032187461853,"outSlope":0.3574032187461853,"tangentMode":0,"weightedMode":0,"inWeight":0.039668917655944827,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"stiffness":0.30000001192092898},"motionConstraint":{"useMaxDistance":false,"maxDistance":{"value":0.30000001192092898,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"useBackstop":false,"backstopRadius":10.0,"backstopDistance":{"value":0.0,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"stiffness":1.0},"colliderCollisionConstraint":{"mode":1,"friction":0.05000000074505806,"colliderList":[],"collisionBones":[],"limitDistance":{"value":0.05000000074505806,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}}},"selfCollisionConstraint":{"selfMode":0,"surfaceThickness":{"value":0.004999999888241291,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":0.5,"inSlope":0.0,"outSlope":0.5,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.5,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"syncMode":0,"syncPartner":{"instanceID":0},"clothMass":0.0},"wind":{"influence":0.20000000298023225,"frequency":1.0,"turbulence":1.0,"blend":0.699999988079071,"synchronization":0.699999988079071,"depthWeight":0.0,"movingWind":0.0},"springConstraint":{"useSpring":true,"springPower":0.05999999865889549,"limitDistance":0.05000000074505806,"normalLimitRatio":1.0,"springNoise":0.0}} \ No newline at end of file diff --git a/Assets/MagicaCloth2/Res/Preset/MC2_Preset_LongHair.json.meta b/Assets/MagicaCloth2/Res/Preset/MC2_Preset_LongHair.json.meta new file mode 100644 index 00000000..a3dc30bc --- /dev/null +++ b/Assets/MagicaCloth2/Res/Preset/MC2_Preset_LongHair.json.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: b688db48dba7a4b4f8c485ce7bd853aa +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Res/Preset/MC2_Preset_LongHair.json + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Res/Preset/MC2_Preset_MiddleSpring.json b/Assets/MagicaCloth2/Res/Preset/MC2_Preset_MiddleSpring.json new file mode 100644 index 00000000..7572dcad --- /dev/null +++ b/Assets/MagicaCloth2/Res/Preset/MC2_Preset_MiddleSpring.json @@ -0,0 +1 @@ +{"clothType":0,"sourceRenderers":[],"paintMode":0,"paintMaps":[],"rootBones":[],"connectionMode":0,"rotationalInterpolation":0.5,"rootRotation":0.5,"updateMode":10,"animationPoseRatio":0.0,"reductionSetting":{"simpleDistance":0.0,"shapeDistance":0.0},"customSkinningSetting":{"enable":false,"skinningBones":[]},"normalAlignmentSetting":{"alignmentMode":0,"adjustmentTransform":{"instanceID":0}},"cullingSettings":{"cameraCullingMode":30,"cameraCullingMethod":0,"cameraCullingRenderers":[]},"normalAxis":1,"gravity":0.0,"gravityDirection":{"x":0.0,"y":-1.0,"z":0.0},"gravityFalloff":0.0,"stablizationTimeAfterReset":0.10000000149011612,"damping":{"value":0.30000001192092898,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"radius":{"value":0.019999999552965165,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"inertiaConstraint":{"anchor":{"instanceID":0},"anchorInertia":0.0,"worldInertia":1.0,"movementInertiaSmoothing":0.4000000059604645,"movementSpeedLimit":{"value":1.0,"use":true},"rotationSpeedLimit":{"value":360.0,"use":true},"localInertia":1.0,"localMovementSpeedLimit":{"value":1.0,"use":true},"localRotationSpeedLimit":{"value":360.0,"use":true},"depthInertia":0.0,"centrifualAcceleration":0.0,"particleSpeedLimit":{"value":4.0,"use":true},"teleportMode":0,"teleportDistance":0.5,"teleportRotation":90.0},"tetherConstraint":{"distanceCompression":0.0989999994635582},"distanceConstraint":{"stiffness":{"value":0.24199999868869782,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":-0.5,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":0.5,"inSlope":-0.5,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}}},"triangleBendingConstraint":{"stiffness":0.2409999966621399},"angleRestorationConstraint":{"useAngleRestoration":true,"stiffness":{"value":0.4000000059604645,"useCurve":true,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":0.5023223757743836,"inSlope":-0.800000011920929,"outSlope":-0.800000011920929,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"velocityAttenuation":0.6000000238418579,"gravityFalloff":0.0},"angleLimitConstraint":{"useAngleLimit":false,"limitAngle":{"value":15.0,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":0.0,"inSlope":0.0,"outSlope":1.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":1.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"stiffness":0.5},"motionConstraint":{"useMaxDistance":false,"maxDistance":{"value":0.30000001192092898,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"useBackstop":false,"backstopRadius":10.0,"backstopDistance":{"value":0.0,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"stiffness":1.0},"colliderCollisionConstraint":{"mode":1,"friction":0.20000000298023225,"colliderList":[],"collisionBones":[],"limitDistance":{"value":0.05000000074505806,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}}},"selfCollisionConstraint":{"selfMode":0,"surfaceThickness":{"value":0.004999999888241291,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":0.5,"inSlope":0.0,"outSlope":0.5,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.5,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"syncMode":0,"syncPartner":{"instanceID":0},"clothMass":0.0},"wind":{"influence":0.20000000298023225,"frequency":1.0,"turbulence":1.0,"blend":0.699999988079071,"synchronization":0.699999988079071,"depthWeight":0.0,"movingWind":0.0},"springConstraint":{"useSpring":true,"springPower":0.029999999329447748,"limitDistance":0.05000000074505806,"normalLimitRatio":1.0,"springNoise":0.0}} \ No newline at end of file diff --git a/Assets/MagicaCloth2/Res/Preset/MC2_Preset_MiddleSpring.json.meta b/Assets/MagicaCloth2/Res/Preset/MC2_Preset_MiddleSpring.json.meta new file mode 100644 index 00000000..c47eca62 --- /dev/null +++ b/Assets/MagicaCloth2/Res/Preset/MC2_Preset_MiddleSpring.json.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 68a74e7b24d750e498085ac9fe297e4f +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Res/Preset/MC2_Preset_MiddleSpring.json + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Res/Preset/MC2_Preset_ShortHair.json b/Assets/MagicaCloth2/Res/Preset/MC2_Preset_ShortHair.json new file mode 100644 index 00000000..63cacf26 --- /dev/null +++ b/Assets/MagicaCloth2/Res/Preset/MC2_Preset_ShortHair.json @@ -0,0 +1 @@ +{"clothType":0,"sourceRenderers":[],"meshWriteMode":0,"paintMode":0,"paintMaps":[],"rootBones":[],"connectionMode":0,"rotationalInterpolation":0.5,"rootRotation":0.5,"updateMode":10,"animationPoseRatio":0.0,"reductionSetting":{"simpleDistance":0.0,"shapeDistance":0.0},"customSkinningSetting":{"enable":false,"skinningBones":[]},"normalAlignmentSetting":{"alignmentMode":0,"adjustmentTransform":{"instanceID":0}},"cullingSettings":{"cameraCullingMode":30,"cameraCullingMethod":0,"cameraCullingRenderers":[],"distanceCullingLength":{"value":30.0,"use":false},"distanceCullingFadeRatio":0.20000000298023225,"distanceCullingReferenceObject":{"instanceID":0}},"normalAxis":1,"gravity":2.0,"gravityDirection":{"x":0.0,"y":-1.0,"z":0.0},"gravityFalloff":1.0,"stablizationTimeAfterReset":0.10000000149011612,"blendWeight":1.0,"damping":{"value":0.10000000149011612,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"radius":{"value":0.019999999552965165,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"inertiaConstraint":{"anchor":{"instanceID":0},"anchorInertia":0.0,"worldInertia":1.0,"movementInertiaSmoothing":0.4000000059604645,"movementSpeedLimit":{"value":5.0,"use":true},"rotationSpeedLimit":{"value":720.0,"use":true},"localInertia":1.0,"localMovementSpeedLimit":{"value":1.0,"use":true},"localRotationSpeedLimit":{"value":360.0,"use":true},"depthInertia":1.0,"centrifualAcceleration":0.0,"particleSpeedLimit":{"value":4.0,"use":true},"teleportMode":0,"teleportDistance":0.5,"teleportRotation":90.0},"tetherConstraint":{"distanceCompression":0.20000000298023225},"distanceConstraint":{"stiffness":{"value":1.0,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":-0.5,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":0.5,"inSlope":-0.5,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}}},"triangleBendingConstraint":{"stiffness":1.0},"angleRestorationConstraint":{"useAngleRestoration":true,"stiffness":{"value":0.15000000596046449,"useCurve":true,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":-0.699999988079071,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":0.30000001192092898,"inSlope":-0.699999988079071,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"velocityAttenuation":0.6000000238418579,"gravityFalloff":0.0},"angleLimitConstraint":{"useAngleLimit":true,"limitAngle":{"value":45.0,"useCurve":true,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":0.19974899291992188,"inSlope":0.8002510070800781,"outSlope":0.8002510070800781,"tangentMode":34,"weightedMode":0,"inWeight":0.0,"outWeight":0.3333333432674408},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.8002510070800781,"outSlope":0.8002510070800781,"tangentMode":34,"weightedMode":0,"inWeight":0.3333333432674408,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"stiffness":1.0},"motionConstraint":{"useMaxDistance":false,"maxDistance":{"value":0.30000001192092898,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"useBackstop":false,"backstopRadius":10.0,"backstopDistance":{"value":0.0,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"stiffness":1.0},"colliderCollisionConstraint":{"mode":1,"friction":0.05000000074505806,"colliderList":[],"collisionBones":[],"limitDistance":{"value":0.05000000074505806,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}}},"selfCollisionConstraint":{"selfMode":0,"surfaceThickness":{"value":0.004999999888241291,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":0.5,"inSlope":0.0,"outSlope":0.5,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.5,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"syncMode":0,"syncPartner":{"instanceID":0},"clothMass":0.0},"wind":{"influence":0.20000000298023225,"frequency":1.0,"turbulence":1.0,"blend":0.699999988079071,"synchronization":0.699999988079071,"depthWeight":0.0,"movingWind":0.0},"springConstraint":{"useSpring":true,"springPower":0.029999999329447748,"limitDistance":0.05000000074505806,"normalLimitRatio":1.0,"springNoise":0.0}} \ No newline at end of file diff --git a/Assets/MagicaCloth2/Res/Preset/MC2_Preset_ShortHair.json.meta b/Assets/MagicaCloth2/Res/Preset/MC2_Preset_ShortHair.json.meta new file mode 100644 index 00000000..62fa5bc5 --- /dev/null +++ b/Assets/MagicaCloth2/Res/Preset/MC2_Preset_ShortHair.json.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 60b35931200639b4a834d868c78aef6a +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Res/Preset/MC2_Preset_ShortHair.json + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Res/Preset/MC2_Preset_Skirt.json b/Assets/MagicaCloth2/Res/Preset/MC2_Preset_Skirt.json new file mode 100644 index 00000000..e5be0843 --- /dev/null +++ b/Assets/MagicaCloth2/Res/Preset/MC2_Preset_Skirt.json @@ -0,0 +1 @@ +{"clothType":0,"sourceRenderers":[],"meshWriteMode":0,"paintMode":0,"paintMaps":[],"rootBones":[],"connectionMode":0,"rotationalInterpolation":0.5,"rootRotation":0.5,"updateMode":10,"animationPoseRatio":0.0,"reductionSetting":{"simpleDistance":0.0,"shapeDistance":0.0},"customSkinningSetting":{"enable":false,"skinningBones":[]},"normalAlignmentSetting":{"alignmentMode":0,"adjustmentTransform":{"instanceID":0}},"cullingSettings":{"cameraCullingMode":30,"cameraCullingMethod":0,"cameraCullingRenderers":[],"distanceCullingLength":{"value":30.0,"use":false},"distanceCullingFadeRatio":0.20000000298023225,"distanceCullingReferenceObject":{"instanceID":0}},"normalAxis":1,"gravity":5.0,"gravityDirection":{"x":0.0,"y":-1.0,"z":0.0},"gravityFalloff":0.0,"stablizationTimeAfterReset":0.10000000149011612,"blendWeight":1.0,"damping":{"value":0.10000000149011612,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"radius":{"value":0.019999999552965165,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"inertiaConstraint":{"anchor":{"instanceID":0},"anchorInertia":0.0,"worldInertia":1.0,"movementInertiaSmoothing":0.4000000059604645,"movementSpeedLimit":{"value":5.0,"use":true},"rotationSpeedLimit":{"value":720.0,"use":true},"localInertia":1.0,"localMovementSpeedLimit":{"value":3.0,"use":true},"localRotationSpeedLimit":{"value":360.0,"use":true},"depthInertia":0.699999988079071,"centrifualAcceleration":0.10000000149011612,"particleSpeedLimit":{"value":4.0,"use":true},"teleportMode":0,"teleportDistance":0.5,"teleportRotation":90.0},"tetherConstraint":{"distanceCompression":0.30000001192092898},"distanceConstraint":{"stiffness":{"value":1.0,"useCurve":true,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":-0.5,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":0.5,"inSlope":-0.5,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}}},"triangleBendingConstraint":{"stiffness":1.0},"angleRestorationConstraint":{"useAngleRestoration":true,"stiffness":{"value":0.20000000298023225,"useCurve":true,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":-0.7955245971679688,"outSlope":-0.7955245971679688,"tangentMode":34,"weightedMode":0,"inWeight":0.0,"outWeight":0.3333333432674408},{"serializedVersion":"3","time":1.0,"value":0.20447540283203126,"inSlope":-0.7955245971679688,"outSlope":-0.7955245971679688,"tangentMode":34,"weightedMode":0,"inWeight":0.3333333432674408,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"velocityAttenuation":0.699999988079071,"gravityFalloff":0.0},"angleLimitConstraint":{"useAngleLimit":true,"limitAngle":{"value":60.0,"useCurve":true,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":0.19974899291992188,"inSlope":0.8002510070800781,"outSlope":0.8002510070800781,"tangentMode":34,"weightedMode":0,"inWeight":0.0,"outWeight":0.3333333432674408},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.8002510070800781,"outSlope":0.8002510070800781,"tangentMode":34,"weightedMode":0,"inWeight":0.3333333432674408,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"stiffness":1.0},"motionConstraint":{"useMaxDistance":false,"maxDistance":{"value":0.30000001192092898,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"useBackstop":false,"backstopRadius":10.0,"backstopDistance":{"value":0.0,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"stiffness":1.0},"colliderCollisionConstraint":{"mode":1,"friction":0.05000000074505806,"colliderList":[],"collisionBones":[],"limitDistance":{"value":0.05000000074505806,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}}},"selfCollisionConstraint":{"selfMode":0,"surfaceThickness":{"value":0.004999999888241291,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":0.5,"inSlope":0.0,"outSlope":0.5,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.5,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"syncMode":0,"syncPartner":{"instanceID":0},"clothMass":0.0},"wind":{"influence":0.20000000298023225,"frequency":1.0,"turbulence":1.0,"blend":0.699999988079071,"synchronization":0.699999988079071,"depthWeight":0.0,"movingWind":0.0},"springConstraint":{"useSpring":true,"springPower":0.029999999329447748,"limitDistance":0.05000000074505806,"normalLimitRatio":1.0,"springNoise":0.0}} \ No newline at end of file diff --git a/Assets/MagicaCloth2/Res/Preset/MC2_Preset_Skirt.json.meta b/Assets/MagicaCloth2/Res/Preset/MC2_Preset_Skirt.json.meta new file mode 100644 index 00000000..19347ef0 --- /dev/null +++ b/Assets/MagicaCloth2/Res/Preset/MC2_Preset_Skirt.json.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: b94503c65e3e33243bd3dc5b47960b64 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Res/Preset/MC2_Preset_Skirt.json + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Res/Preset/MC2_Preset_SoftSkirt.json b/Assets/MagicaCloth2/Res/Preset/MC2_Preset_SoftSkirt.json new file mode 100644 index 00000000..b3815b6c --- /dev/null +++ b/Assets/MagicaCloth2/Res/Preset/MC2_Preset_SoftSkirt.json @@ -0,0 +1 @@ +{"clothType":0,"sourceRenderers":[],"meshWriteMode":0,"paintMode":0,"paintMaps":[],"rootBones":[],"connectionMode":0,"rotationalInterpolation":0.5,"rootRotation":0.5,"updateMode":10,"animationPoseRatio":0.0,"reductionSetting":{"simpleDistance":0.0,"shapeDistance":0.0},"customSkinningSetting":{"enable":false,"skinningBones":[]},"normalAlignmentSetting":{"alignmentMode":0,"adjustmentTransform":{"instanceID":0}},"cullingSettings":{"cameraCullingMode":30,"cameraCullingMethod":0,"cameraCullingRenderers":[],"distanceCullingLength":{"value":30.0,"use":false},"distanceCullingFadeRatio":0.20000000298023225,"distanceCullingReferenceObject":{"instanceID":0}},"normalAxis":1,"gravity":3.0,"gravityDirection":{"x":0.0,"y":-1.0,"z":0.0},"gravityFalloff":0.0,"stablizationTimeAfterReset":0.10000000149011612,"blendWeight":1.0,"damping":{"value":0.10000000149011612,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"radius":{"value":0.019999999552965165,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"inertiaConstraint":{"anchor":{"instanceID":0},"anchorInertia":0.0,"worldInertia":1.0,"movementInertiaSmoothing":0.4000000059604645,"movementSpeedLimit":{"value":5.0,"use":true},"rotationSpeedLimit":{"value":720.0,"use":true},"localInertia":1.0,"localMovementSpeedLimit":{"value":3.0,"use":true},"localRotationSpeedLimit":{"value":360.0,"use":true},"depthInertia":0.25,"centrifualAcceleration":0.10000000149011612,"particleSpeedLimit":{"value":4.0,"use":true},"teleportMode":0,"teleportDistance":0.5,"teleportRotation":90.0},"tetherConstraint":{"distanceCompression":0.30000001192092898},"distanceConstraint":{"stiffness":{"value":1.0,"useCurve":true,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":0.043365478515625,"inSlope":-0.20151586830615998,"outSlope":-0.20151586830615998,"tangentMode":0,"weightedMode":0,"inWeight":0.07299280166625977,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}}},"triangleBendingConstraint":{"stiffness":0.23000000417232514},"angleRestorationConstraint":{"useAngleRestoration":true,"stiffness":{"value":0.14000000059604646,"useCurve":true,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":-0.9402999877929688,"outSlope":-0.9402999877929688,"tangentMode":34,"weightedMode":0,"inWeight":0.0,"outWeight":0.3333333432674408},{"serializedVersion":"3","time":1.0,"value":0.05970001220703125,"inSlope":-0.28568774461746218,"outSlope":-0.28568774461746218,"tangentMode":0,"weightedMode":0,"inWeight":0.0834202766418457,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"velocityAttenuation":0.699999988079071,"gravityFalloff":0.0},"angleLimitConstraint":{"useAngleLimit":false,"limitAngle":{"value":60.0,"useCurve":true,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":0.19974899291992188,"inSlope":0.8002510070800781,"outSlope":0.8002510070800781,"tangentMode":34,"weightedMode":0,"inWeight":0.0,"outWeight":0.3333333432674408},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.8002510070800781,"outSlope":0.8002510070800781,"tangentMode":34,"weightedMode":0,"inWeight":0.3333333432674408,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"stiffness":1.0},"motionConstraint":{"useMaxDistance":false,"maxDistance":{"value":0.30000001192092898,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"useBackstop":false,"backstopRadius":10.0,"backstopDistance":{"value":0.0,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"stiffness":1.0},"colliderCollisionConstraint":{"mode":1,"friction":0.05000000074505806,"colliderList":[],"collisionBones":[],"limitDistance":{"value":0.05000000074505806,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}}},"selfCollisionConstraint":{"selfMode":0,"surfaceThickness":{"value":0.004999999888241291,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":0.5,"inSlope":0.0,"outSlope":0.5,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.5,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"syncMode":0,"syncPartner":{"instanceID":0},"clothMass":0.0},"wind":{"influence":0.20000000298023225,"frequency":1.0,"turbulence":1.0,"blend":0.699999988079071,"synchronization":0.699999988079071,"depthWeight":0.0,"movingWind":0.0},"springConstraint":{"useSpring":true,"springPower":0.029999999329447748,"limitDistance":0.05000000074505806,"normalLimitRatio":1.0,"springNoise":0.0}} \ No newline at end of file diff --git a/Assets/MagicaCloth2/Res/Preset/MC2_Preset_SoftSkirt.json.meta b/Assets/MagicaCloth2/Res/Preset/MC2_Preset_SoftSkirt.json.meta new file mode 100644 index 00000000..c810a45e --- /dev/null +++ b/Assets/MagicaCloth2/Res/Preset/MC2_Preset_SoftSkirt.json.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 95115815f2f656045acda9f116a05915 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Res/Preset/MC2_Preset_SoftSkirt.json + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Res/Preset/MC2_Preset_SoftSpring.json b/Assets/MagicaCloth2/Res/Preset/MC2_Preset_SoftSpring.json new file mode 100644 index 00000000..4c8d57ab --- /dev/null +++ b/Assets/MagicaCloth2/Res/Preset/MC2_Preset_SoftSpring.json @@ -0,0 +1 @@ +{"clothType":0,"sourceRenderers":[],"paintMode":0,"paintMaps":[],"rootBones":[],"connectionMode":0,"rotationalInterpolation":0.5,"rootRotation":0.5,"updateMode":10,"animationPoseRatio":0.0,"reductionSetting":{"simpleDistance":0.0,"shapeDistance":0.0},"customSkinningSetting":{"enable":false,"skinningBones":[]},"normalAlignmentSetting":{"alignmentMode":0,"adjustmentTransform":{"instanceID":0}},"cullingSettings":{"cameraCullingMode":30,"cameraCullingMethod":0,"cameraCullingRenderers":[]},"normalAxis":1,"gravity":0.0,"gravityDirection":{"x":0.0,"y":-1.0,"z":0.0},"gravityFalloff":0.0,"stablizationTimeAfterReset":0.10000000149011612,"damping":{"value":0.20000000298023225,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"radius":{"value":0.019999999552965165,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"inertiaConstraint":{"anchor":{"instanceID":0},"anchorInertia":0.0,"worldInertia":1.0,"movementInertiaSmoothing":0.4000000059604645,"movementSpeedLimit":{"value":1.0,"use":true},"rotationSpeedLimit":{"value":360.0,"use":true},"localInertia":1.0,"localMovementSpeedLimit":{"value":1.0,"use":true},"localRotationSpeedLimit":{"value":360.0,"use":true},"depthInertia":0.0,"centrifualAcceleration":0.0,"particleSpeedLimit":{"value":4.0,"use":true},"teleportMode":0,"teleportDistance":0.5,"teleportRotation":90.0},"tetherConstraint":{"distanceCompression":0.0989999994635582},"distanceConstraint":{"stiffness":{"value":0.24199999868869782,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":-0.5,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":0.5,"inSlope":-0.5,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}}},"triangleBendingConstraint":{"stiffness":0.2409999966621399},"angleRestorationConstraint":{"useAngleRestoration":true,"stiffness":{"value":0.20000000298023225,"useCurve":true,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":0.5023223757743836,"inSlope":-0.800000011920929,"outSlope":-0.800000011920929,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"velocityAttenuation":0.800000011920929,"gravityFalloff":0.0},"angleLimitConstraint":{"useAngleLimit":false,"limitAngle":{"value":15.0,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":0.0,"inSlope":0.0,"outSlope":1.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":1.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"stiffness":1.0},"motionConstraint":{"useMaxDistance":false,"maxDistance":{"value":0.30000001192092898,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"useBackstop":false,"backstopRadius":10.0,"backstopDistance":{"value":0.0,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"stiffness":1.0},"colliderCollisionConstraint":{"mode":1,"friction":0.20000000298023225,"colliderList":[],"collisionBones":[],"limitDistance":{"value":0.05000000074505806,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}}},"selfCollisionConstraint":{"selfMode":0,"surfaceThickness":{"value":0.004999999888241291,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":0.5,"inSlope":0.0,"outSlope":0.5,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.5,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"syncMode":0,"syncPartner":{"instanceID":0},"clothMass":0.0},"wind":{"influence":0.20000000298023225,"frequency":1.0,"turbulence":1.0,"blend":0.699999988079071,"synchronization":0.699999988079071,"depthWeight":0.0,"movingWind":0.0},"springConstraint":{"useSpring":true,"springPower":0.009999999776482582,"limitDistance":0.05000000074505806,"normalLimitRatio":1.0,"springNoise":0.0}} \ No newline at end of file diff --git a/Assets/MagicaCloth2/Res/Preset/MC2_Preset_SoftSpring.json.meta b/Assets/MagicaCloth2/Res/Preset/MC2_Preset_SoftSpring.json.meta new file mode 100644 index 00000000..ff72eed2 --- /dev/null +++ b/Assets/MagicaCloth2/Res/Preset/MC2_Preset_SoftSpring.json.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: a53c4836c458cc34bbe7fc971a0e8198 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Res/Preset/MC2_Preset_SoftSpring.json + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Res/Preset/MC2_Preset_Tail.json b/Assets/MagicaCloth2/Res/Preset/MC2_Preset_Tail.json new file mode 100644 index 00000000..f49ac2b7 --- /dev/null +++ b/Assets/MagicaCloth2/Res/Preset/MC2_Preset_Tail.json @@ -0,0 +1 @@ +{"clothType":0,"sourceRenderers":[],"meshWriteMode":0,"paintMode":0,"paintMaps":[],"rootBones":[],"connectionMode":0,"rotationalInterpolation":0.5,"rootRotation":0.5,"updateMode":10,"animationPoseRatio":0.0,"reductionSetting":{"simpleDistance":0.0,"shapeDistance":0.0},"customSkinningSetting":{"enable":false,"skinningBones":[]},"normalAlignmentSetting":{"alignmentMode":0,"adjustmentTransform":{"instanceID":0}},"cullingSettings":{"cameraCullingMode":30,"cameraCullingMethod":0,"cameraCullingRenderers":[],"distanceCullingLength":{"value":30.0,"use":false},"distanceCullingFadeRatio":0.20000000298023225,"distanceCullingReferenceObject":{"instanceID":0}},"normalAxis":1,"gravity":0.0,"gravityDirection":{"x":0.0,"y":-1.0,"z":0.0},"gravityFalloff":0.0,"stablizationTimeAfterReset":0.10000000149011612,"blendWeight":1.0,"damping":{"value":0.05000000074505806,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"radius":{"value":0.019999999552965165,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"inertiaConstraint":{"anchor":{"instanceID":0},"anchorInertia":0.0,"worldInertia":1.0,"movementInertiaSmoothing":0.4000000059604645,"movementSpeedLimit":{"value":5.0,"use":true},"rotationSpeedLimit":{"value":720.0,"use":true},"localInertia":1.0,"localMovementSpeedLimit":{"value":3.0,"use":true},"localRotationSpeedLimit":{"value":360.0,"use":true},"depthInertia":0.0,"centrifualAcceleration":0.0,"particleSpeedLimit":{"value":4.0,"use":true},"teleportMode":0,"teleportDistance":0.5,"teleportRotation":90.0},"tetherConstraint":{"distanceCompression":0.5},"distanceConstraint":{"stiffness":{"value":1.0,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":-0.5,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":0.5,"inSlope":-0.5,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}}},"triangleBendingConstraint":{"stiffness":0.5},"angleRestorationConstraint":{"useAngleRestoration":true,"stiffness":{"value":0.10000000149011612,"useCurve":true,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":-1.5032808780670167,"outSlope":-1.5032808780670167,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.03353310376405716},{"serializedVersion":"3","time":1.0,"value":0.09733137488365174,"inSlope":-0.1739719808101654,"outSlope":-0.1739719808101654,"tangentMode":0,"weightedMode":0,"inWeight":0.045376718044281009,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"velocityAttenuation":0.5,"gravityFalloff":0.0},"angleLimitConstraint":{"useAngleLimit":false,"limitAngle":{"value":80.0,"useCurve":true,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":0.0,"inSlope":0.0,"outSlope":1.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":1.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"stiffness":1.0},"motionConstraint":{"useMaxDistance":false,"maxDistance":{"value":0.30000001192092898,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"useBackstop":false,"backstopRadius":10.0,"backstopDistance":{"value":0.0,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"stiffness":1.0},"colliderCollisionConstraint":{"mode":1,"friction":0.05000000074505806,"colliderList":[],"collisionBones":[],"limitDistance":{"value":0.05000000074505806,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.0,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}}},"selfCollisionConstraint":{"selfMode":0,"surfaceThickness":{"value":0.004999999888241291,"useCurve":false,"curve":{"serializedVersion":"2","m_Curve":[{"serializedVersion":"3","time":0.0,"value":0.5,"inSlope":0.0,"outSlope":0.5,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0},{"serializedVersion":"3","time":1.0,"value":1.0,"inSlope":0.5,"outSlope":0.0,"tangentMode":0,"weightedMode":0,"inWeight":0.0,"outWeight":0.0}],"m_PreInfinity":2,"m_PostInfinity":2,"m_RotationOrder":4}},"syncMode":0,"syncPartner":{"instanceID":0},"clothMass":0.0},"wind":{"influence":0.20000000298023225,"frequency":1.0,"turbulence":1.0,"blend":0.699999988079071,"synchronization":0.699999988079071,"depthWeight":0.0,"movingWind":0.0},"springConstraint":{"useSpring":true,"springPower":0.009999999776482582,"limitDistance":0.05000000074505806,"normalLimitRatio":1.0,"springNoise":0.0}} \ No newline at end of file diff --git a/Assets/MagicaCloth2/Res/Preset/MC2_Preset_Tail.json.meta b/Assets/MagicaCloth2/Res/Preset/MC2_Preset_Tail.json.meta new file mode 100644 index 00000000..18c8150f --- /dev/null +++ b/Assets/MagicaCloth2/Res/Preset/MC2_Preset_Tail.json.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 7caaf9c3e9b56af468785ce6ca87d2bc +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Res/Preset/MC2_Preset_Tail.json + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts.meta b/Assets/MagicaCloth2/Scripts.meta new file mode 100644 index 00000000..9557b29a --- /dev/null +++ b/Assets/MagicaCloth2/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4bcf05bcd5b995944867a92f1bc9e86d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Scripts/Core.meta b/Assets/MagicaCloth2/Scripts/Core.meta new file mode 100644 index 00000000..deb2108d --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 59a207b400ba60d4781d33fac21726f1 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth.meta b/Assets/MagicaCloth2/Scripts/Core/Cloth.meta new file mode 100644 index 00000000..ce4ce894 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ab3867f2676a64143aaab90a3ac67059 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/CheckSliderSerializeData.cs b/Assets/MagicaCloth2/Scripts/Core/Cloth/CheckSliderSerializeData.cs new file mode 100644 index 00000000..9a32f936 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/CheckSliderSerializeData.cs @@ -0,0 +1,57 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using UnityEngine; + +namespace MagicaCloth2 +{ + [System.Serializable] + public class CheckSliderSerializeData + { + /// + /// slider value. + /// + public float value; + + /// + /// Use + /// + public bool use; + + public CheckSliderSerializeData() + { + } + + public CheckSliderSerializeData(bool use, float value) + { + this.use = use; + this.value = value; + } + + public float GetValue(float unusedValue) + { + return use ? value : unusedValue; + } + + public void SetValue(bool use, float value) + { + this.use = use; + this.value = value; + } + + public void DataValidate(float min, float max) + { + value = Mathf.Clamp(value, min, max); + } + + public CheckSliderSerializeData Clone() + { + var cdata = new CheckSliderSerializeData() + { + value = value, + use = use, + }; + return cdata; + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/CheckSliderSerializeData.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Cloth/CheckSliderSerializeData.cs.meta new file mode 100644 index 00000000..ed08f7f3 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/CheckSliderSerializeData.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: ffc5377e82b4dda4e9276efa83bcd59e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Cloth/CheckSliderSerializeData.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothBehaviour.cs b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothBehaviour.cs new file mode 100644 index 00000000..13c645cc --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothBehaviour.cs @@ -0,0 +1,29 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// MagicaClothMonoBehaviourċŸşç¤Ž‚Żƒİ‚ı + /// ™ıĤ‚³ƒ³ƒƒĵƒƒ³ƒˆŻ““‹‚‰ĉ´ç”Ÿ™‚‹ + /// + public abstract class ClothBehaviour : MonoBehaviour + { + /// + /// Hash code for checking changes when editing. + /// + /// + public virtual int GetMagicaHashCode() + { + return 0; + } + + /// + /// Gizmo display state. + /// + public bool IsGizmoVisible { get; set; } + protected virtual void OnDrawGizmos() => IsGizmoVisible = true; + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothBehaviour.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothBehaviour.cs.meta new file mode 100644 index 00000000..d1ee0a41 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothBehaviour.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: ad3b3cf159e43e1489f421d5b1f49fad +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Cloth/ClothBehaviour.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothDisableMode.cs b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothDisableMode.cs new file mode 100644 index 00000000..a41135ba --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothDisableMode.cs @@ -0,0 +1,22 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2026 MagicaSoft. +// https://magicasoft.jp + +namespace MagicaCloth2 +{ + /// + /// Simulation Disable Mode + /// + public enum ClothDisableMode + { + /// + /// Reset the simulation. + /// + Reset = 0, + + /// + /// Maintain the simulation. + /// + Keep = 1, + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothDisableMode.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothDisableMode.cs.meta new file mode 100644 index 00000000..35806cb0 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothDisableMode.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: b7f7df74e3431e84199fe50874a58668 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Cloth/ClothDisableMode.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothForceMode.cs b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothForceMode.cs new file mode 100644 index 00000000..022f3869 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothForceMode.cs @@ -0,0 +1,36 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp + +namespace MagicaCloth2 +{ + + public enum ClothForceMode + { + None, + + /// + /// 速ċşĤĞċŠ ç—ïĵˆĉ·ħ•ċ½ħ響‚’ċ—‘‚‹ïĵ‰ + /// Add to velocity (affected by depth). + /// + VelocityAdd, + + /// + /// 速ċşĤ‚’ċ¤‰ĉ›´ïĵˆĉ·ħ•ċ½ħ響‚’ċ—‘‚‹ïĵ‰ + /// Change velocity (affected by depth). + /// + VelocityChange, + + /// + /// 速ċşĤĞċŠ ç—ïĵˆĉ·ħ•ç„ĦèĤ–ïĵ‰ + /// Add to velocity (ignoring depth). + /// + VelocityAddWithoutDepth = 10, + + /// + /// 速ċşĤ‚’ċ¤‰ĉ›´ïĵˆĉ·ħ•ç„ĦèĤ–ïĵ‰ + /// Change velocity (ignoring depth). + /// + VelocityChangeWithoutDepth, + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothForceMode.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothForceMode.cs.meta new file mode 100644 index 00000000..62460d04 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothForceMode.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: f572ed4fa93dcd444a44e59253bd3913 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Cloth/ClothForceMode.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothInitSerializeData.cs b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothInitSerializeData.cs new file mode 100644 index 00000000..a4a3b465 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothInitSerializeData.cs @@ -0,0 +1,211 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2025 MagicaSoft. +// https://magicasoft.jp +using System.Collections.Generic; +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// ċˆĉœŸċŒ–ƒ‡ƒĵ‚ż + /// + [System.Serializable] + public class ClothInitSerializeData : ITransform + { + public const int InitDataVersion = 2; + + public int initVersion; + public int localHash; + public int globalHash; + public ClothProcess.ClothType clothType; + public TransformRecordSerializeData clothTransformRecord; + public TransformRecordSerializeData normalAdjustmentTransformRecord; + public List customSkinningBoneRecords; + public List clothSetupDataList; + + public bool HasData() + { + if (initVersion == 0) + return false; + if (localHash == 0 || globalHash == 0) + return false; + + return true; + } + + public void Clear() + { + initVersion = 0; + localHash = 0; + globalHash = 0; + clothType = ClothProcess.ClothType.MeshCloth; + clothTransformRecord = new TransformRecordSerializeData(); + normalAdjustmentTransformRecord = new TransformRecordSerializeData(); + customSkinningBoneRecords = new List(); + clothSetupDataList = new List(); + } + + public ResultCode DataValidate(ClothProcess cprocess) + { + if (localHash == 0 || globalHash == 0) + return new ResultCode(Define.Result.InitSerializeData_InvalidHash); + if (initVersion == 0) + return new ResultCode(Define.Result.InitSerializeData_InvalidVersion); + + if (clothSetupDataList == null || clothSetupDataList.Count == 0) + return new ResultCode(Define.Result.InitSerializeData_InvalidSetupData); + + var cloth = cprocess.cloth; + var sdata = cloth.SerializeData; + + if (clothType != sdata.clothType) + return new ResultCode(Define.Result.InitSerializeData_ClothTypeMismatch); + + if (clothType == ClothProcess.ClothType.MeshCloth) + { + int rendererCount = sdata.sourceRenderers.Count; + if (clothSetupDataList.Count != rendererCount) + return new ResultCode(Define.Result.InitSerializeData_SetupCountMismatch); + + // ċ„ƒĴƒ³ƒ€ƒİƒĵĉƒ…ċ ħĉ¤œè¨ĵ + for (int i = 0; i < rendererCount; i++) + { + if (clothSetupDataList[i].DataValidateMeshCloth(sdata.sourceRenderers[i]) == false) + return new ResultCode(Define.Result.InitSerializeData_MeshClothSetupValidationError); + } + } + else if (clothType == ClothProcess.ClothType.BoneCloth) + { + if (clothSetupDataList.Count != 1) + return new ResultCode(Define.Result.InitSerializeData_SetupCountMismatch); + + if (clothSetupDataList[0].DataValidateBoneCloth(sdata, RenderSetupData.SetupType.BoneCloth) == false) + return new ResultCode(Define.Result.InitSerializeData_BoneClothSetupValidationError); + } + else if (clothType == ClothProcess.ClothType.BoneSpring) + { + if (clothSetupDataList.Count != 1) + return new ResultCode(Define.Result.InitSerializeData_SetupCountMismatch); + + if (clothSetupDataList[0].DataValidateBoneCloth(sdata, RenderSetupData.SetupType.BoneSpring) == false) + return new ResultCode(Define.Result.InitSerializeData_BoneSpringSetupValidationError); + } + + // ‚Ğ‚ı‚żƒ ‚ı‚­ƒ‹ƒ³‚°ƒœƒĵƒ³ + if (sdata.customSkinningSetting.skinningBones.Count != customSkinningBoneRecords.Count) + return new ResultCode(Define.Result.InitSerializeData_CustomSkinningBoneCountMismatch); + + // V1‹¤MeshCloth‹¤SkinnedMeshRendererċ ´ċˆż€(Clone)ƒĦƒƒ‚·ƒċˆİ用ĉ™‚Żç„ĦċŠı¨™‚‹ + // “‚ŒŻ(Clone)ƒĦƒƒ‚·ƒ‚’ċ†ċşĤċŠ ċ·™‚‹“¨Ğ‚ˆ‚Šƒœƒĵƒ³‚Ĥ‚¨‚¤ƒˆŞİƒ‡ƒĵ‚żŒŠ‹—Ş‚Š‚¨ƒİƒĵŒç™şç”Ÿ™‚‹Ÿ‚ + if (initVersion <= 1 && clothType == ClothProcess.ClothType.MeshCloth) + { + for (int i = 0; i < sdata.sourceRenderers.Count; i++) + { + SkinnedMeshRenderer sren = sdata.sourceRenderers[i] as SkinnedMeshRenderer; + if (sren && sren.sharedMesh && sren.sharedMesh.name.Contains("(Clone)")) + { + return new ResultCode(Define.Result.InitSerializeData_InvalidCloneMesh); + } + } + } + + return ResultCode.Success; + } + + public bool Serialize( + ClothSerializeData sdata, + TransformRecord clothTransformRecord, + TransformRecord normalAdjustmentTransformRecord, + List setupList + ) + { + initVersion = InitDataVersion; // version + + clothType = sdata.clothType; + + this.clothTransformRecord = new TransformRecordSerializeData(); + this.clothTransformRecord.Serialize(clothTransformRecord); + + this.normalAdjustmentTransformRecord = new TransformRecordSerializeData(); + this.normalAdjustmentTransformRecord.Serialize(normalAdjustmentTransformRecord); + + // ‚Ğ‚ı‚żƒ ‚ı‚­ƒ‹ƒ³‚°ƒœƒĵƒ³ + customSkinningBoneRecords = new List(); + int bcnt = sdata.customSkinningSetting.skinningBones.Count; + for (int i = 0; i < bcnt; i++) + { + var tr = new TransformRecord(sdata.customSkinningSetting.skinningBones[i], read: true); + var trs = new TransformRecordSerializeData(); + trs.Serialize(tr); + customSkinningBoneRecords.Add(trs); + } + + // setup data + clothSetupDataList = new List(); + if (setupList != null && setupList.Count > 0) + { + foreach (var setup in setupList) + { + var meshSetupData = new RenderSetupSerializeData(); + meshSetupData.Serialize(setup); + clothSetupDataList.Add(meshSetupData); + } + } + + localHash = GetLocalHash(); + globalHash = GetGlobalHash(); + + return true; + } + + + public void GetUsedTransform(HashSet transformSet) + { + clothTransformRecord?.GetUsedTransform(transformSet); + normalAdjustmentTransformRecord?.GetUsedTransform(transformSet); + customSkinningBoneRecords?.ForEach(x => x.GetUsedTransform(transformSet)); + clothSetupDataList?.ForEach(x => x.GetUsedTransform(transformSet)); + } + + public void ReplaceTransform(Dictionary replaceDict) + { + clothTransformRecord?.ReplaceTransform(replaceDict); + normalAdjustmentTransformRecord?.ReplaceTransform(replaceDict); + customSkinningBoneRecords?.ForEach(x => x.ReplaceTransform(replaceDict)); + clothSetupDataList?.ForEach(x => x.ReplaceTransform(replaceDict)); + } + + int GetLocalHash() + { + // ƒ­ƒĵ‚ЃЃƒƒ‚·ƒ + // ƒğ編集用ƒĦƒƒ‚·ƒŒċ†ĉ§‹ç݉•‚Œ‚‹Ÿ³Ğ“ƒƒƒ‚·ƒ§äżċ­˜ƒ‚§ƒƒ‚݁•‚Œ‚‹ + // ƒğċ„稂ЂĤƒ³ƒˆïĵ‹é…ċˆ—ĉ•° + // ƒğTransformċ§żċ‹˘Żç„ĦèĤ–™‚‹€‚Ÿ —階ċħ¤ĉ§‹é€ ċ¤‰ĉ›´ŻèĤ‹‚‹ + int hash = 0; + hash += initVersion * 9876; + hash += (int)clothType * 5656; + hash += clothTransformRecord?.GetLocalHash() ?? 0; + hash += normalAdjustmentTransformRecord?.GetLocalHash() ?? 0; + customSkinningBoneRecords?.ForEach(x => hash += x?.GetLocalHash() ?? 0); + clothSetupDataList?.ForEach(x => hash += x?.GetLocalHash() ?? 0); + + return hash; + } + + int GetGlobalHash() + { + // ‚°ƒ­ƒĵƒƒĞƒƒƒ‚·ƒ + // ƒğ頂ç‚ıƒš‚¤ƒ³ƒˆçµ‚了ĉ™‚Ğ“ƒƒƒ‚·ƒ§äżċ­˜ƒ‚§ƒƒ‚݁•‚Œ‚‹ + // ƒğ保ċ­˜ƒ‚§ƒƒ‚ŻĞŻƒ­ƒĵ‚ЃЃƒƒ‚·ƒ‚‚ċĞ‚Œ‚‹ + // ƒğTransformƒ­ƒĵ‚ЃĞċ§żċ‹˘‚’èĤ‹‚‹(localPosition/localRotation/localScale) + // ƒğŸ —SetupDatainitRenderScależƒŻƒĵƒĞƒ‰‚ı‚ħƒĵƒĞ‚’ƒ‚§ƒƒ‚݁™‚‹ + int hash = 0; + hash += clothTransformRecord?.GetGlobalHash() ?? 0; + hash += normalAdjustmentTransformRecord?.GetGlobalHash() ?? 0; + customSkinningBoneRecords?.ForEach(x => hash += x?.GetGlobalHash() ?? 0); + clothSetupDataList?.ForEach(x => hash += x?.GetGlobalHash() ?? 0); + + return hash; + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothInitSerializeData.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothInitSerializeData.cs.meta new file mode 100644 index 00000000..33d8a4c5 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothInitSerializeData.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 87cb8cdfb6686334d904a1e0c0536944 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Cloth/ClothInitSerializeData.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothMeshWriteMode.cs b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothMeshWriteMode.cs new file mode 100644 index 00000000..f32a33a7 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothMeshWriteMode.cs @@ -0,0 +1,25 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2024 MagicaSoft. +// https://magicasoft.jp + +namespace MagicaCloth2 +{ + /// + /// ƒĦƒƒ‚·ƒ¸ĉ›¸èĵżċŻèħĦ + /// Write target to mesh. + /// + public enum ClothMeshWriteMode + { + /// + /// 位罁¨ĉ³•ç·š + /// Position, Normal + /// + PositionAndNormal = 0, + + /// + /// 位罁¨ĉ³•ç·š¨ĉŽç·š + /// Position, Normal, Tangent + /// + PositionAndNormalTangent = 1, + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothMeshWriteMode.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothMeshWriteMode.cs.meta new file mode 100644 index 00000000..6d91cd18 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothMeshWriteMode.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: c89429b06b0fde045af1104d0fe4d6b9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Cloth/ClothMeshWriteMode.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothNormalAxis.cs b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothNormalAxis.cs new file mode 100644 index 00000000..7d63b35d --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothNormalAxis.cs @@ -0,0 +1,27 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// Axis to use as normal. + /// ĉ³•ç·š¨—Ĥċˆİ用™‚‹èğ¸ + /// + public enum ClothNormalAxis + { + [InspectorName("Right (red)")] + Right = 0, + [InspectorName("Up (green)")] + Up = 1, + [InspectorName("Forward (blue)")] + Forward = 2, + [InspectorName("Inverse Right (red)")] + InverseRight = 3, + [InspectorName("Inverse Up (green)")] + InverseUp = 4, + [InspectorName("Inverse Forward (blue)")] + InverseForward = 5, + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothNormalAxis.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothNormalAxis.cs.meta new file mode 100644 index 00000000..c34af11c --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothNormalAxis.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 78c44c48c8886814eac01297e0df1b61 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Cloth/ClothNormalAxis.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothParameters.cs b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothParameters.cs new file mode 100644 index 00000000..90ac7c2f --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothParameters.cs @@ -0,0 +1,99 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using Unity.Mathematics; + +namespace MagicaCloth2 +{ + /// + /// ‚¸ƒ§ƒ–§ċˆİ用™‚‹Ÿ‚‚Żƒ­‚ıƒ‘ƒİƒĦƒĵ‚żĉ§‹é€ ä½“ + /// ‚¸ƒ§ƒ–§Żclass‚’ċ‚ç…§§Ş„Ÿ‚unmanagedċž‹Ğċ¤‰ĉ›™‚‹ċż…èĤŒ‚‚‹ + /// + public struct ClothParameters + { + /// + /// ïĵ‘ç§’é–“ĉ›´ĉ–°ċ›žĉ•° + /// + //public int solverFrequency; + + /// + /// 重ċŠ› + /// + public float gravity; + + /// + /// 重ċŠ›ĉ–ıċ‘ïĵˆƒŻƒĵƒĞƒ‰çİşé–“ïĵ‰ + /// + public float3 worldGravityDirection; + + /// + /// ċˆĉœŸċ§żċ‹˘§é‡ċŠ›ĉ¸›èĦ°çއ(0.0 ~ 1.0) + /// 1.0Ğ™‚‹“¨§ċˆĉœŸċ§żċ‹˘§Żé‡ċŠ›äż‚ĉ•°ŒïĵĞŞ‚‹€‚ + /// 0.0§Żċ¸¸Ğİċ§żċ‹˘§‚‚重ċŠ›Œ100%発生™‚‹€‚ + /// ċ§żċ‹˘è¨ˆç—Żĉ…£ĉ€§ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ §èĦŒ‚‚Œ‚‹€‚ + /// + public float gravityFalloff; + + /// + /// ƒŞ‚ğƒƒƒˆċŒé€ŸċşĤċ‰ċšċŒ–ĉ™‚é–“(s) + /// + public float stablizationTimeAfterReset; + + /// + /// ċ…ƒċ§żċ‹˘¨‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³çµĉžœƒ–ƒĴƒ³ƒ‰ċ‰²ċˆ(0.0 ~ 1.0) + /// + public float blendWeight; + + /// + /// ĉеĉŠ— + /// + public float4x4 dampingCurveData; + + /// + /// ƒ‘ƒĵƒ†‚£‚ŻƒĞċŠċ„ + /// + public float4x4 radiusCurveData; + + /// + /// ĉ³•ç·š¨—Ĥċˆİ用™‚‹èğ¸ + /// + public ClothNormalAxis normalAxis; + + // BoneCloth用 + public float rotationalInterpolation; + public float rootRotation; + + // ‚Ѓރ³‚°(Culling) + public CullingSettings.CullingParams culling; + + // ĉ…£ĉ€§ċˆĥ約(Inertia) + public InertiaConstraint.InertiaConstraintParams inertiaConstraint; + + // ĉœ€ċ¤§è·é›˘ċˆĥ約(Tether) + public TetherConstraint.TetherConstraintParams tetherConstraint; + + // è·é›˘ċˆĥ約(Distance) + public DistanceConstraint.DistanceConstraintParams distanceConstraint; + + // ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĉ›²’ċˆĥ約(TriangleBending) + public TriangleBendingConstraint.TriangleBendingConstraintParams triangleBendingConstraint; + + // 角ċşĤċİċ…ƒ/角ċşĤċˆĥ限 + public AngleConstraint.AngleConstraintParams angleConstraint; + + // ƒ˘ƒĵ‚·ƒ§ƒ³(MaxDistance/Backstop) + public MotionConstraint.MotionConstraintParams motionConstraint; + + // ‚³ƒİ‚¤ƒ€ƒĵ‚³ƒŞ‚¸ƒ§ƒ³(Collider Collision) + public ColliderCollisionConstraint.ColliderCollisionConstraintParams colliderCollisionConstraint; + + // ‚ğƒĞƒ•‚³ƒŞ‚¸ƒ§ƒ³(Self Collision) + public SelfCollisionConstraint.SelfCollisionConstraintParams selfCollisionConstraint; + + // 風(Wind) + public WindParams wind; + + // ‚ıƒ—ƒŞƒ³‚°(Spring) + public SpringConstraint.SpringConstraintParams springConstraint; + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothParameters.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothParameters.cs.meta new file mode 100644 index 00000000..8b5728e1 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothParameters.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 26334216fdc5aaa4ca50312fbad62c97 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Cloth/ClothParameters.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothProcess.cs b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothProcess.cs new file mode 100644 index 00000000..389388b8 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothProcess.cs @@ -0,0 +1,1588 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Unity.Burst; +using Unity.Collections; +using Unity.Jobs; +using Unity.Mathematics; +using Unity.Profiling; +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// MagicaCloth‚³ƒ³ƒƒĵƒƒ³ƒˆċ‡Ĥ理 + /// + public partial class ClothProcess + { + //========================================================================================= + static readonly ProfilerMarker initClothProfiler = new ProfilerMarker("InitCloth"); + + /// + /// ċˆĉœŸċŒ–ïĵˆċż…š‚˘ƒ‹ƒĦƒĵ‚·ƒ§ƒ³ċŸèĦŒċ‰ĞèĦŒ†ïĵ‰ + /// + internal void Init() + { + Debug.Assert(cloth); + Develop.DebugLog($"Init start [{cloth.name}]"); + initClothProfiler.Begin(); + result.SetSuccess(); + InitDataResult.Clear(); + + try + { + // ™§Ğç ´ĉ£„•‚ŒĤ„‚‹ċ ´ċˆŻ‚¨ƒİƒĵ¨™‚‹€‚ċ†ċˆĉœŸċŒ–Ż§Ş„ + if (isDestory) + { + Develop.LogError($"Already destroyed components cannot be reinitialized."); + throw new OperationCanceledException(); + } + + // ™§ĞċˆĉœŸċŒ–ĉ¸ˆżŞ‚‰‚ı‚­ƒƒƒ— + if (IsState(State_InitComplete)) + { + throw new OperationCanceledException(); + } + + var sdata = cloth.SerializeData; + var sdata2 = cloth.GetSerializeData2(); + + SetState(State_Valid, false); + + // ‚˘ƒ‹ƒĦƒĵ‚·ƒ§ƒ³ç”¨ƒ—ƒ­ƒ‘ƒ†‚£ċˆĉœŸċŒ– + cloth.InitAnimationProperty(); + + // ‚Żƒ­‚ı‚’生ĉˆ™‚‹Ÿ‚ĉœ€ä½Žé™ĉƒ…ċ ħŒĉƒ£Ĥ„‚‹‹ƒ‚§ƒƒ‚݁™‚‹ + if (sdata.IsValid() == false) + { + result.SetResult(sdata.VerificationResult); + throw new OperationCanceledException(); + } + + // ‚Żƒ­‚ıçŠĥĉ…‹ĉ¤œè¨ĵ + var statusResult = GenerateStatusCheck(); + result.Merge(statusResult); + if (statusResult.IsError()) + { + throw new MagicaClothProcessingException(); + } + + SetState(State_InitComplete, true); + + // PreBuildƒ‡ƒĵ‚żċˆİ用¨ĉ¤œè¨ĵ + bool usePreBuildData = sdata2.preBuildData.UsePreBuild(); + SharePreBuildData sharePreBuildData = null; + if (usePreBuildData) + { + SetState(State_UsePreBuild, true); + var r = sdata2.preBuildData.DataValidate(); + if (r.IsFaild()) + { + result.Merge(r); + throw new OperationCanceledException(); + } + + sharePreBuildData = sdata2.preBuildData.GetSharePreBuildData(); + } + + // ċˆĉœŸċŒ–ƒ‡ƒĵ‚żċˆİ用¨ĉ¤œè¨ĵ + bool useInitData = false; +#if !MC2_DISABLE_INITDATA + if (usePreBuildData == false && sdata2.initData != null && sdata2.initData.HasData()) + { + // ċˆĉœŸċŒ–ƒ‡ƒĵ‚żĉ¤œè¨ĵ + InitDataResult = sdata2.initData.DataValidate(this); + useInitData = InitDataResult.IsSuccess(); + if (InitDataResult.IsSuccess()) + Develop.DebugLog($"InitData validation [{cloth.name}] : {InitDataResult.GetResultString()}"); + else + { + Develop.DebugLogWarning($"InitData validation [{cloth.name}] : {InitDataResult.GetResultString()}"); + Develop.DebugLogWarning("Do not use InitData."); + } + } +#endif + + // ċŸşĉœĴĉƒ…ċ ħ + clothType = sdata.clothType; + reductionSettings = sdata.reductionSetting; + parameters = sdata.GetClothParameters(); + + // ċˆĉœŸƒˆƒİƒ³‚ıƒ•‚݃ĵƒ çŠĥĉ…‹ + clothTransformRecord = new TransformRecord(cloth.ClothTransform, read: useInitData == false); + if (usePreBuildData) + { + // Pre-Build§Żç·¨é›†ĉ™‚‚ı‚ħƒĵƒĞ‚’ċİċ…ƒ™‚‹ + clothTransformRecord.scale = sharePreBuildData.buildScale; + } + if (useInitData) + { + // initData‹‚‰ċİċ…ƒ + sdata2.initData.clothTransformRecord.Deserialize(clothTransformRecord); + } + + // ĉ³•ç·šèŞżĉ•´ç”¨ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ  + normalAdjustmentTransformRecord = new TransformRecord( + sdata.normalAlignmentSetting.adjustmentTransform ? + sdata.normalAlignmentSetting.adjustmentTransform : + cloth.ClothTransform, read: useInitData == false); + if (useInitData) + { + // initData‹‚‰ċİċ…ƒ + sdata2.initData.normalAdjustmentTransformRecord.Deserialize(normalAdjustmentTransformRecord); + } + + // PreBuildƒ‡ƒĵ‚żç™ğ録 + PreBuildManager.ShareDeserializationData sharePreBuildDeserializeData = usePreBuildData ? MagicaManager.PreBuild.RegisterPreBuildData(sharePreBuildData, true) : null; + UniquePreBuildData uniquePreBuildData = usePreBuildData ? sdata2.preBuildData.uniquePreBuildData : null; + + // ƒĴƒ³ƒ€ƒİƒĵ¨‚ğƒƒƒˆ‚˘ƒƒƒ—ĉƒ…ċ ħċˆĉœŸċŒ– + // ŞŠ‚ğƒƒƒˆ‚˘ƒƒƒ—ĉƒ…ċ ħŻVirtualMesh‚’生ĉˆ™‚‹Ÿ‚‚‚Ş§ƒ™‚¤‚Żĉ§‹ç݉ĉ™‚Żä¸èĤ + if (clothType == ClothType.MeshCloth) + { + // MeshCloth + // ċż…èĤŞƒĴƒ³ƒ€ƒİƒĵ‚’ç™ğ録™‚‹ + for (int i = 0; i < sdata.sourceRenderers.Count; i++) + { + var ren = sdata.sourceRenderers[i]; + if (ren) + { + // PreBuild§Ż‚ğƒƒƒˆ‚˘ƒƒƒ—ĉƒ…ċ ħ‚’ċİċ…ƒ™‚‹ + RenderSetupData setup = null; + RenderSetupData.UniqueSerializationData uniquePreBuildSetupData = null; + if (usePreBuildData) + { + setup = sharePreBuildDeserializeData.renderSetupDataList[i]; + uniquePreBuildSetupData = uniquePreBuildData.renderSetupDataList[i]; + + if (setup.result.IsFaild()) + { + setup.Dispose(); + result.SetError(Define.Result.PreBuild_SetupDeserializationError); + throw new OperationCanceledException(); + } + } + + // ċˆĉœŸċŒ–ƒ‡ƒĵ‚żċ‚ç…§ + RenderSetupSerializeData initSetupData = useInitData ? sdata2.initData.clothSetupDataList[i] : null; + + MagicaObjectId handle = AddRenderer(ren, setup, uniquePreBuildSetupData, initSetupData); + if (handle.IsValid() == false) + { + result.SetError(Define.Result.ClothInit_FailedAddRenderer); + throw new OperationCanceledException(); + } + var rdata = MagicaManager.Render.GetRendererData(handle); + result.Merge(rdata.Result); + if (rdata.Result.IsFaild()) + { + throw new OperationCanceledException(); + } + } + } + } + else if (clothType == ClothType.BoneCloth && usePreBuildData == false) + { + // BoneCloth + CreateBoneRenderSetupData( + useInitData ? sdata2.initData : null, + clothType, sdata.rootBones, null, sdata.connectionMode + ); + } + else if (clothType == ClothType.BoneSpring && usePreBuildData == false) + { + // BoneSpring + // BoneSpring§ŻLineĉŽçĥšż + CreateBoneRenderSetupData( + useInitData ? sdata2.initData : null, + clothType, sdata.rootBones, sdata.colliderCollisionConstraint.collisionBones, RenderSetupData.BoneConnectionMode.Line + ); + } + + // ‚Ğ‚ı‚żƒ ‚ı‚­ƒ‹ƒ³‚°ƒœƒĵƒ³ĉƒ…ċ ħ + int bcnt = sdata.customSkinningSetting.skinningBones.Count; + for (int i = 0; i < bcnt; i++) + { + var tr = new TransformRecord(sdata.customSkinningSetting.skinningBones[i], read: useInitData == false); + if (useInitData) + { + // initData‹‚‰ċİċ…ƒ + sdata2.initData.customSkinningBoneRecords[i].Deserialize(tr); + } + customSkinningBoneRecords.Add(tr); + } + + // ċŒĉœŸ‚³ƒ³ƒƒĵƒƒ³ƒˆè§£ĉħş¨ä½œĉ­ƒƒƒƒ•‚Ħ¸ç™ğ録 + var syncPartnerCloth = cloth.SyncPartnerCloth; + if (syncPartnerCloth) + { + // partner + MagicaManager.Team.comp2SyncPartnerCompMap.Add(cloth.GetMagicaId(), syncPartnerCloth.GetMagicaId()); + + // top + // ƒ‡ƒƒƒ‰ƒ­ƒƒ‚ŻċŻç­– + var c = syncPartnerCloth; + while (c) + { + if (c == cloth) + c = null; + else if (c.SyncPartnerCloth) + c = c.SyncPartnerCloth; + else + break; + } + Debug.Assert(c); + SyncTopCloth = c; + MagicaManager.Team.comp2SyncTopCompMap.Add(cloth.GetMagicaId(), SyncTopCloth.GetMagicaId()); + } + + result.SetSuccess(); + SetState(State_Valid, true); + SetState(State_InitSuccess, true); + SetState(State_Verification, true); + + // “ĉ™‚ç‚ı§‚Żƒ­‚ı‚³ƒ³ƒƒĵƒƒ³ƒˆŒéž‚˘‚Żƒ†‚£ƒ–ċ ´ċˆŻç ´ĉ£„監èĤ–ƒŞ‚ıƒˆĞç™ğ録™‚‹ + if (cloth.isActiveAndEnabled == false) + MagicaManager.Team.AddMonitoringProcess(this); + } + catch (OperationCanceledException) + { + } + catch (MagicaClothProcessingException) + { + } + catch (Exception exception) + { + Debug.LogException(exception); + result.SetError(Define.Result.ClothProcess_Exception); + } + + initClothProfiler.End(); + + if (result.IsSuccess()) + Develop.DebugLog($"Cloth Initialize Success! [{cloth.name}]"); + else + Develop.DebugLogError($"Cloth Initialize failure! [{cloth.name}] : {result.GetResultString()}"); + } + + /// + /// MeshClothċˆİ用‚’ç™ğ録™‚‹ïĵˆƒĦ‚¤ƒ³‚ıƒĴƒƒƒ‰żïĵ‰ + /// “‚ŒŻAwake()Şİ‚˘ƒ‹ƒĦƒĵ‚·ƒ§ƒ³ċ‰ĞċŸèĦŒ™‚‹“¨ + /// + /// + /// ƒĴƒ³ƒ€ƒĵĉƒ…ċ ħƒƒ³ƒ‰ƒĞ + MagicaObjectId AddRenderer( + Renderer ren, + RenderSetupData referenceSetupData, + RenderSetupData.UniqueSerializationData referenceUniqueSetupData, + RenderSetupSerializeData referenceInitSetupData + ) + { + if (ren == null) + return MagicaObjectId.Invalid; + if (renderHandleList == null) + return MagicaObjectId.Invalid; + + MagicaObjectId handle = ren.GetMagicaId(); + if (renderHandleList.Contains(handle) == false) + { + // ƒĴƒ³ƒ€ƒİƒĵċˆİ用開ċ§‹ + handle = MagicaManager.Render.AddRenderer(ren, referenceSetupData, referenceUniqueSetupData, referenceInitSetupData); + if (handle.IsValid()) + { + lock (lockObject) + { + if (renderHandleList.Contains(handle) == false) + renderHandleList.Add(handle); + } + } + } + + return handle; + } + + /// + /// BoneClothċˆİ用‚’é–‹ċ§‹™‚‹ïĵˆƒĦ‚¤ƒ³‚ıƒĴƒƒƒ‰żïĵ‰ + /// “‚ŒŻAwake()Şİ‚˘ƒ‹ƒĦƒĵ‚·ƒ§ƒ³ċ‰ĞċŸèĦŒ™‚‹“¨ + /// + /// + /// + void CreateBoneRenderSetupData( + ClothInitSerializeData initData, + ClothType ctype, + List rootTransforms, + List collisionBones, + RenderSetupData.BoneConnectionMode connectionMode + ) + { + // BoneCloth用‚ğƒƒƒˆ‚˘ƒƒƒ—ƒ‡ƒĵ‚żä½œĉˆ + boneClothSetupData = new RenderSetupData( + initData != null ? initData.clothSetupDataList[0] : null, + ctype == ClothType.BoneSpring ? RenderSetupData.SetupType.BoneSpring : RenderSetupData.SetupType.BoneCloth, + clothTransformRecord.transform, + rootTransforms, + collisionBones, + connectionMode, + cloth.name + ); + } + + /// + /// ĉœ‰ċŠıċŒ– + /// + internal void StartUse() + { + if (MagicaManager.IsPlaying() == false) + return; + + SetState(State_Component, true); + UpdateUse(); + } + + /// + /// ç„ĦċŠıċŒ– + /// + internal void EndUse() + { + if (MagicaManager.IsPlaying() == false) + return; + + SetState(State_Component, false); + UpdateUse(); + } + + internal void UpdateUse() + { + // ĉœ‰ċŠıçŠĥĉ…‹ċˆ¤ċš + bool now = IsState(State_Component) && IsState(State_Verification); + + // ċˆ‡‚Šĉ›żˆ + { + SetState(State_Enable, now); + + // ƒƒĵƒ  + MagicaManager.Team.SetEnable(this, TeamId, now); + + // ƒĴƒ³ƒ€ƒİƒĵ + if (renderHandleList != null) + { + foreach (MagicaObjectId renderHandle in renderHandleList) + { + if (now) + MagicaManager.Render.StartUse(this, renderHandle); + else + MagicaManager.Render.EndUse(this, renderHandle); + } + } + } + } + + /// + /// ƒ‘ƒİƒĦƒĵ‚ż/ƒ‡ƒĵ‚żċ¤‰ĉ›´é€šçŸ + /// + internal void DataUpdate() + { + // ƒ‘ƒİƒĦƒĵ‚żĉ¤œè¨ĵ + cloth.SerializeData.DataValidate(); + cloth.serializeData2.DataValidate(); + + // ƒ‘ƒİƒĦƒĵ‚żċ¤‰ĉ›´ïĵˆċŸèĦŒĉ™‚żïĵ‰ + if (MagicaManager.IsPlaying()) + { + // ““§Żċ¤‰ĉ›´ƒ•ƒİ‚°żçĞ‹Ĥ‚‹ + //SetState(State_ParameterDirty, true); + MagicaManager.Team.parameterDirtyList.Add(this); + } + } + + //========================================================================================= + /// + /// ĉ§‹ç݉‚’é–‹ċ§‹—ċŒäş†ċŒĞè‡Şċ‹•ċŸèĦŒ™‚‹ + /// + internal bool StartRuntimeBuild() + { + // ƒ“ƒĞƒ‰é–‹ċ§‹ + // -‚³ƒ³ƒƒĵƒƒ³ƒˆŒĉœ‰ċŠı§‚‚‹“¨ + // -ċˆĉœŸċŒ–ĉ¸ˆż§‚‚‹“¨ + // -ƒ“ƒĞƒ‰Œ ċŸèĦŒ•‚ŒĤ„Ş„“¨ + // -ƒ™‚¤‚Żƒ‡ƒĵ‚ż‚’ċˆİ用—Ş„“¨ + if (IsValid() && IsState(State_InitSuccess) && IsState(State_Build) == false && IsState(State_UsePreBuild) == false) + { + result.SetProcess(); + SetState(State_Build, true); + var _ = RuntimeBuildAsync(cts.Token); + return true; + } + else + { + if (result.IsError() == false) + result.SetError(Define.Result.CreateCloth_CanNotStart); + Develop.LogError($"Cloth runtime build failure! [{cloth.name}] : {result.GetResultString()}"); + return false; + } + } + + /// + /// è‡Şċ‹•ĉ§‹ç݉ïĵˆ‚³ƒ³ƒƒĵƒƒ³ƒˆStart()§ċ‘ĵ°‚Œ‚‹ïĵ‰ + /// + /// + internal bool AutoBuild() + { + bool ret; + bool buildComplate = true; + + if (IsState(State_DisableAutoBuild)) + { + ret = false; + } + else + { + if (IsState(State_UsePreBuild)) + ret = PreBuildDataConstruction(); + else + { + ret = StartRuntimeBuild(); + if (ret) + buildComplate = false; // OnBuildCompleteŻƒİƒ³‚ż‚¤ƒ ĉ§‹ç݉ċŒĞċ‘ĵ°‚Œ‚‹ + } + } + + // ƒ“ƒĞƒ‰ċŒäş†‚¤ƒ™ƒ³ƒˆ + if (buildComplate && cloth != null) + cloth.OnBuildComplete?.Invoke(cloth, ret); + + return ret; + } + + /// + /// ċŸèĦŒĉ™‚ĉ§‹ç݉‚ż‚ı‚Ż + /// + /// + /// + async Task RuntimeBuildAsync(CancellationToken ct) + { + isBuild = true; + Develop.DebugLog($"Build start : {Name}"); + result.SetProcess(); + + // 作ĉˆ•‚ŒŸƒĴƒ³ƒ€ƒİƒĵĉƒ…ċ ħ + var renderMeshInfos = new List(); + + // ProxyMesh + VirtualMesh proxyMesh = null; + + try + { + // ■ƒĦ‚¤ƒ³‚ıƒĴƒƒƒ‰ + var sdata = cloth.SerializeData; + var sdata2 = cloth.GetSerializeData2(); + + // ċ°‘—ĉ™‚é–“‚’é–‹‘Ĥ‹‚‰ċ‡Ĥ理‚’é–‹ċ§‹™‚‹ + await Task.Delay(5); + ct.ThrowIfCancellationRequested(); + + // ċŒĉœŸċŻèħĦŒ„‚‹ċ ´ċˆŻç›¸ĉ‰‹ä¸€ĉ™‚ċœĉ­˘‚Ğ‚Ĥƒ³‚żƒĵ‚’ċŠ ç—™‚‹ + if (cloth.SyncPartnerCloth) + { + var sync = cloth.SyncPartnerCloth; + while (sync != cloth && sync != null) + { + sync.Process.IncrementSuspendCounter(); + sync = sync.SyncPartnerCloth; + } + } + + // 頂ç‚ıċħžĉ€§é…ċˆ—ċˆİç”¨ç˘şèŞ + bool useManualVertexAttribute = false; + if (sdata.clothType == ClothType.MeshCloth && sdata2.vertexAttributeList != null && sdata2.vertexAttributeList.Count > 0) + { + // 頂ç‚ıċħžĉ€§é…ċˆ—ĉ¤œè¨ĵ + if (sdata2.vertexAttributeList.Count != renderHandleList.Count) + { + result.SetError(Define.Result.CreateCloth_VertexAttributeListCountMismatch); + throw new MagicaClothProcessingException(); + } + for (int i = 0; i < renderHandleList.Count; i++) + { + var vertexAttributeArray = sdata2.vertexAttributeList[i]; + if (vertexAttributeArray == null) + { + result.SetError(Define.Result.CreateCloth_VertexAttributeListIsNull); + throw new MagicaClothProcessingException(); + } + MagicaObjectId renderHandle = renderHandleList[i]; + var renderData = MagicaManager.Render.GetRendererData(renderHandle); + if (renderData.setupData.vertexCount != vertexAttributeArray.Length) + { + result.SetError(Define.Result.CreateCloth_VertexAttributeListDataMismatch); + throw new MagicaClothProcessingException(); + } + } + useManualVertexAttribute = true; + } + + // ƒš‚¤ƒ³ƒˆƒžƒƒƒ—ƒ‡ƒĵ‚żċˆİç”¨ç˘şèŞ¨ä½œĉˆïĵˆ“‚ŒŻƒĦ‚¤ƒ³‚ıƒĴƒƒƒ‰§żä½œĉˆċŻèƒ½ïĵ‰ + bool usePaintMap = false; + var paintMapDataList = new List(); + if (sdata.clothType == ClothType.MeshCloth && sdata.paintMode != ClothSerializeData.PaintMode.Manual && useManualVertexAttribute == false) + { + var ret = GeneratePaintMapDataList(paintMapDataList); + Develop.DebugLog($"Generate paint map data list. {ret.GetResultString()}"); + if (ret.IsError()) + { + result.Merge(ret); + throw new MagicaClothProcessingException(); + } + if (paintMapDataList.Count != renderHandleList.Count) + { + result.SetError(Define.Result.CreateCloth_PaintMapCountMismatch); + throw new MagicaClothProcessingException(); + } + usePaintMap = true; + } + + // ‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚ż + // ƒš‚¤ƒ³ƒˆƒžƒƒƒ—ĉŒ‡ċš‚‚—Żé ‚ç‚ıċħžĉ€§ĉŒ‡ċšċ ´ċˆŻçİş§ċˆĉœŸċŒ– + SelectionData selectionData = (usePaintMap || useManualVertexAttribute) ? new SelectionData() : sdata2.selectionData.Clone(); + + // BoneCloth/BoneSpring§‚·ƒŞ‚˘ƒİ‚¤‚şïĵ’ĞTransform¨ċħžĉ€§èžĉ›¸Œ‚‚‹ċ ´ċˆŻID¨ċħžĉ€§èžĉ›¸Ğċ¤‰ĉ›ïĵˆ‚ıƒĴƒƒƒ‰§Ż‚˘‚Ż‚ğ‚ı§Ş„Ÿ‚ïĵ‰ + Dictionary boneAttributeDict = null; + if (sdata2.boneAttributeDict.Count > 0) + { + boneAttributeDict = new Dictionary(sdata2.boneAttributeDict.Count); + foreach (var kv in sdata2.boneAttributeDict) + { + if (kv.Key) + { + boneAttributeDict.Add(kv.Key.GetMagicaId(), kv.Value); + } + } + } + + // ■‚ıƒĴƒƒƒ‰ + await Task.Run(() => + { + // 作ĉ­ç”¨ƒĦƒƒ‚·ƒ + VirtualMesh renderMesh = null; + + try + { + // ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒä½œĉˆ + ct.ThrowIfCancellationRequested(); + proxyMesh = new VirtualMesh("Proxy"); + proxyMesh.result.SetProcess(); + List copyRenderHandleList = null; + if (clothType == ClothType.MeshCloth) + { + // MeshCloth§Ż‚Żƒ­‚ıƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ‚’èż½ċŠ —ĤŠ + proxyMesh.SetTransform(clothTransformRecord); + + lock (lockObject) + { + copyRenderHandleList = new List(renderHandleList); + } + } + + // ‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚żĉœ‰ç„Ħ + bool isValidSelection = selectionData?.IsValid() ?? false; + + // MeshCloth/BoneCloth§ċ‡Ĥ理Œä¸€éƒ¨ç•°Ş‚‹ + if (clothType == ClothType.MeshCloth) + { + // ■MeshCloth + if (renderHandleList.Count == 0) + { + result.SetError(Define.Result.ClothProcess_InvalidRenderHandleList); + throw new MagicaClothProcessingException(); + } + + //-------------------------------------------------------------------- + // mesh import + selection + merge + for (int i = 0; i < copyRenderHandleList.Count; i++) + { + ct.ThrowIfCancellationRequested(); + + MagicaObjectId renderHandle = copyRenderHandleList[i]; + + // ƒĴƒ³ƒ€ƒĵƒĦƒƒ‚·ƒä½œĉˆ + var renderData = MagicaManager.Render.GetRendererData(renderHandle); + renderMesh = new VirtualMesh($"[{renderData.Name}]"); + renderMesh.result.SetProcess(); + + // import ------------------------------------------------- + renderMesh.ImportFrom(renderData, sdata.GetUvChannel()); + if (renderMesh.IsError) + { + result.Merge(renderMesh.result); + throw new MagicaClothProcessingException(); + } + Develop.DebugLog($"(IMPORT) {renderMesh}"); + + // selection ---------------------------------------------- + SelectionData renderSelectionData = selectionData; + + // MeshCloth§é ‚ç‚ıċħžĉ€§ĉŒ‡ċšŒ‚‚‹ċ ´ċˆŻ‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚ż‚’生ĉˆ™‚‹ + if (useManualVertexAttribute) + { + // ‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚żç”Ÿĉˆ + var ret = GenerateSelectionDataFromVertexAttributeData(clothTransformRecord, renderMesh, sdata2.vertexAttributeList[i], out renderSelectionData); + Develop.DebugLog($"Generate selection from vertex attribute data. {ret.GetResultString()}"); + if (ret.IsError()) + { + result.Merge(ret); + throw new MagicaClothProcessingException(); + } + + // ‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚żçµċˆ + selectionData.Merge(renderSelectionData); + } + + // MeshCloth§ƒš‚¤ƒ³ƒˆƒ†‚Ż‚ıƒƒ£ĉŒ‡ċšċ ´ċˆŻ‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚ż‚’生ĉˆ™‚‹ + if (usePaintMap) + { + // renderMesh‹‚‰‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚żç”Ÿĉˆ + var ret = GenerateSelectionDataFromPaintMap(clothTransformRecord, renderMesh, paintMapDataList[i], out renderSelectionData); + Develop.DebugLog($"Generate selection from paint map. {ret.GetResultString()}"); + if (ret.IsError()) + { + result.Merge(ret); + throw new MagicaClothProcessingException(); + } + + // ‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚żçµċˆ + selectionData.Merge(renderSelectionData); + } + isValidSelection = selectionData?.IsValid() ?? false; + + // ƒĦƒƒ‚·ƒċˆ‡‚Šċ–‚Š + ct.ThrowIfCancellationRequested(); + if (renderSelectionData?.IsValid() ?? false) + { + // 余白 + float mergin = renderMesh.CalcSelectionMergin(reductionSettings); + mergin = math.max(mergin, Define.System.MinimumGridSize); + + // ‚ğƒĴ‚Ż‚·ƒ§ƒ³ĉƒ…ċ ħ‹‚‰ċˆ‡‚Šċ–‚ЁċŸèĦŒ + // ƒš‚¤ƒ³ƒˆƒžƒƒƒ—ċ ´ċˆŻƒĴƒ³ƒ€ƒİƒĵ”¨‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚ż§ċˆ‡‚Šċ–‚Š + renderMesh.SelectionMesh(renderSelectionData, clothTransformRecord.localToWorldMatrix, mergin); + if (renderMesh.IsError) + { + result.Merge(renderMesh.result); + throw new MagicaClothProcessingException(); + } + Develop.DebugLog($"(SELECTION) {renderMesh}"); + } + ct.ThrowIfCancellationRequested(); + + // ƒĴƒ³ƒ€ƒĵƒĦƒƒ‚·ƒä½œĉˆċŒäş† + renderMesh.result.SetSuccess(); + + // merge -------------------------------------------------- + proxyMesh.AddMesh(renderMesh); + + // ƒĴƒ³ƒ€ƒĵƒĦƒƒ‚·ƒĉƒ…ċ ħ‚’作ĉˆ + var info = new RenderMeshInfo(); + //info.mixHash = mixHash; + info.renderHandle = renderHandle; + info.renderMeshContainer = new VirtualMeshContainer(renderMesh); + //info.renderMeshPositionAndNormalChunk = renderData.renderMeshPositionAndNormalChunk; + //info.renderMeshTangentChunk = renderData.renderMeshTangentChunk; + info.renderDataWorkIndex = renderData.renderDataWorkIndex; + renderMesh = null; + renderMeshInfos.Add(info); + } + Develop.DebugLog($"(MERGE) {proxyMesh}"); + } + else if (clothType == ClothType.BoneCloth || clothType == ClothType.BoneSpring) + { + // ■BoneCloth + // import + proxyMesh.ImportFrom(boneClothSetupData, 0); + if (proxyMesh.IsError) + { + result.Merge(proxyMesh.result); + throw new MagicaClothProcessingException(); + } + Develop.DebugLog($"(IMPORT) {proxyMesh}"); + + // ‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚żŒċ­˜ċœ¨—Ş„ċ ´ċˆŻç°Ħĉ˜“作ĉˆ™‚‹ + if (isValidSelection == false) + { + selectionData = new SelectionData(proxyMesh, float4x4.identity); + if (selectionData.Count > 0) + { + // š™ıĤç§ğċ‹•設ċš + selectionData.Fill(VertexAttribute.Move); + + // ĉĴĦĞƒĞƒĵƒˆżċ›şċš + foreach (MagicaObjectId id in boneClothSetupData.rootTransformIdList) + { + int rootIndex = boneClothSetupData.GetTransformIndexFromId(id); + selectionData.attributes[rootIndex] = VertexAttribute.Fixed; + } + isValidSelection = selectionData.IsValid(); + } + } + + // Transform¨ċħžĉ€§èžĉ›¸Œ‚‚‹ċ ´ċˆŻ‚ŒĞċ“£Ĥċħžĉ€§‚’ĉ›¸ĉ›ˆ‚‹ + if (boneAttributeDict != null) + { + foreach (var kv in boneAttributeDict) + { + int index = boneClothSetupData.GetTransformIndexFromId(kv.Key); + if (index >= 0) + { + selectionData.attributes[index] = kv.Value; + } + } + } + } + + //-------------------------------------------------------------------- + // reduction (MeshClothż) + if (clothType == ClothType.MeshCloth && proxyMesh.VertexCount > 1) + { + ct.ThrowIfCancellationRequested(); + if (reductionSettings.IsEnabled) + { + proxyMesh.Reduction(reductionSettings, ct); + if (proxyMesh.IsError) + { + result.Merge(proxyMesh.result); + throw new MagicaClothProcessingException(); + } + + Develop.DebugLog($"(REDUCTION) {proxyMesh}"); + } + } + if (proxyMesh.joinIndices.IsCreated == false) + { + // ċ…ƒé ‚ç‚ı‹‚‰çµċˆé ‚ç‚ı¸‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı‚’ċˆĉœŸċŒ– + ct.ThrowIfCancellationRequested(); + proxyMesh.joinIndices = new Unity.Collections.NativeArray(proxyMesh.VertexCount, Unity.Collections.Allocator.Persistent); + JobUtility.SerialNumberRun(proxyMesh.joinIndices, proxyMesh.VertexCount); // é€£ç•Ş‚’¤‘‚‹ + } + + //-------------------------------------------------------------------- + // optimization + ct.ThrowIfCancellationRequested(); + proxyMesh.Optimization(); + if (proxyMesh.IsError) + { + result.Merge(proxyMesh.result); + throw new MagicaClothProcessingException(); + } + Develop.DebugLog($"(OPTIMIZE) {proxyMesh}"); + + //-------------------------------------------------------------------- + // attribute + if (isValidSelection) + { + // ‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚ż‹‚‰é ‚ç‚ıċħžĉ€§‚’äğ˜ä¸Ž™‚‹ + proxyMesh.ApplySelectionAttribute(selectionData); + if (proxyMesh.IsError) + { + result.Merge(proxyMesh.result); + throw new MagicaClothProcessingException(); + } + } + + //-------------------------------------------------------------------- + // proxy meshïĵˆċħžĉ€§ĉħşċšċŒĞċŸèĦŒïĵ‰ + ct.ThrowIfCancellationRequested(); + { + proxyMesh.ConvertProxyMesh(sdata, clothTransformRecord, customSkinningBoneRecords, normalAdjustmentTransformRecord); + if (proxyMesh.IsError) + { + result.Merge(proxyMesh.result); + throw new MagicaClothProcessingException(); + } + Develop.DebugLog($"(PROXY) {proxyMesh}"); + } + + //-------------------------------------------------------------------- + // ProxyMeshĉœ€çµ‚ƒ‚§ƒƒ‚Ż + if (proxyMesh.VertexCount > Define.System.MaxProxyMeshVertexCount) + { + result.SetError(Define.Result.ProxyMesh_Over32767Vertices); + throw new MagicaClothProcessingException(); + } + if (proxyMesh.EdgeCount > Define.System.MaxProxyMeshEdgeCount) + { + result.SetError(Define.Result.ProxyMesh_Over32767Edges); + throw new MagicaClothProcessingException(); + } + if (proxyMesh.TriangleCount > Define.System.MaxProxyMeshTriangleCount) + { + result.SetError(Define.Result.ProxyMesh_Over32767Triangles); + throw new MagicaClothProcessingException(); + } + + //-------------------------------------------------------------------- + // finish + ct.ThrowIfCancellationRequested(); + if (proxyMesh.IsError) + { + result.Merge(proxyMesh.result); + throw new MagicaClothProcessingException(); + } + proxyMesh.result.SetSuccess(); + Develop.DebugLog("CreateProxyMesh finish!"); + + //------------------------------------------------------------------- + // Mapping(MeshClothż) + if (clothType == ClothType.MeshCloth) + { + foreach (var info in renderMeshInfos) + { + ct.ThrowIfCancellationRequested(); + var cmesh = info.renderMeshContainer; + var vmesh = cmesh.shareVirtualMesh; + vmesh.Mapping(proxyMesh); + if (vmesh.IsError) + { + result.Merge(vmesh.result); + throw new MagicaClothProcessingException(); + } + Develop.DebugLog($"(MAPPING) {vmesh}"); + } + } + } + catch (MagicaClothProcessingException) + { + throw; + } + catch (OperationCanceledException) + { + throw; + } + catch (Exception exception) + { + Debug.LogException(exception); + result.SetError(Define.Result.ClothProcess_Exception); + throw; + } + finally + { + // “ĉ™‚ç‚ı§ä½œĉ­ç”¨renderMeshŒċ­˜ċœ¨™‚‹ċ ´ċˆŻä¸­ĉ–­•‚ŒĤ„‚‹§é–‹ĉ”™‚‹ + renderMesh?.Dispose(); + } + }, ct); + + // ■ƒĦ‚¤ƒ³‚ıƒĴƒƒƒ‰ + // ċŒĉœŸċŻèħĦŒ„‚‹ċ ´ċˆŻç›¸ĉ‰‹ċˆĉœŸċŒ–ċŒäş†‚’ċ…¤ + ct.ThrowIfCancellationRequested(); + if (cloth == null) + throw new OperationCanceledException(); // ‚­ƒ£ƒ³‚ğƒĞĉ‰ħ„Ğ™‚‹ + var syncCloth = cloth.SyncPartnerCloth; + if (syncCloth != null) + { + int timeOutCount = 100; + while (syncCloth != null && syncCloth.Process.IsEnable == false && timeOutCount >= 0) + { + await Task.Delay(20); + ct.ThrowIfCancellationRequested(); + timeOutCount--; + } + if (syncCloth == null || syncCloth.Process.IsEnable == false) + { + syncCloth = null; + Develop.LogWarning($"Sync timeout! Is there a deadlock between synchronous cloths?"); + } + } + Develop.DebugLog($"Sync complete : {Name}"); + + // ■ƒĦ‚¤ƒ³‚ıƒĴƒƒƒ‰ + ct.ThrowIfCancellationRequested(); + if (cloth == null) + throw new OperationCanceledException(); // ‚­ƒ£ƒ³‚ğƒĞĉ‰ħ„Ğ™‚‹ + if (IsValid() == false) + { + result.SetError(Define.Result.ClothProcess_Invalid); + throw new MagicaClothProcessingException(); + } + if (MagicaManager.IsPlaying() == false) + { + result.SetError(Define.Result.ClothProcess_Invalid); + throw new MagicaClothProcessingException(); + } + + // ƒ‘ƒİƒĦƒĵ‚żċ¤‰ĉ›´ƒ•ƒİ‚° + //SetState(State_ParameterDirty, true); + + // ■‚ıƒĴƒƒƒ‰ + ct.ThrowIfCancellationRequested(); + await Task.Run(() => + { + // ■‚Żƒ­‚ıƒ‡ƒĵ‚żä½œĉˆ + try + { + // è·é›˘ċˆĥ約(Distance) + ct.ThrowIfCancellationRequested(); + distanceConstraintData = DistanceConstraint.CreateData(proxyMesh, parameters); + if (distanceConstraintData != null && distanceConstraintData.result.IsError()) + { + result.Merge(distanceConstraintData.result); + throw new MagicaClothProcessingException(); + } + + // ĉ›²’ċˆĥ約(Bending) + ct.ThrowIfCancellationRequested(); + bendingConstraintData = TriangleBendingConstraint.CreateData(proxyMesh, parameters); + if (bendingConstraintData != null && bendingConstraintData.result.IsError()) + { + result.Merge(bendingConstraintData.result); + throw new MagicaClothProcessingException(); + } + + // ĉ…£ĉ€§ċˆĥ約(Inertia) + ct.ThrowIfCancellationRequested(); + inertiaConstraintData = InertiaConstraint.CreateData(proxyMesh, parameters); + if (inertiaConstraintData != null && inertiaConstraintData.result.IsError()) + { + result.Merge(inertiaConstraintData.result); + throw new MagicaClothProcessingException(); + } + + if (result.IsError()) + throw new MagicaClothProcessingException(); + } + catch (MagicaClothProcessingException) + { + throw; + } + catch (OperationCanceledException) + { + throw; + } + catch (Exception exception) + { + Debug.LogException(exception); + result.SetError(Define.Result.Constraint_Exception); + throw; + } + }, ct); + + + // ■ƒĦ‚¤ƒ³‚ıƒĴƒƒƒ‰ + ct.ThrowIfCancellationRequested(); + if (cloth == null) + throw new OperationCanceledException(); // ‚­ƒ£ƒ³‚ğƒĞĉ‰ħ„Ğ™‚‹ + + // ç™ğ録 + lock (lockObject) + { + // ProxyMeshç™ğ録 + ProxyMeshContainer = new VirtualMeshContainer(proxyMesh); + proxyMesh = null; + + // ƒƒĵƒ ç™ğ録 + TeamId = MagicaManager.Cloth.AddCloth(this, parameters); + if (TeamId <= 0) + { + result.SetError(Define.Result.ClothProcess_OverflowTeamCount4096); + throw new MagicaClothProcessingException(); + } + + // ƒ‘ƒİƒĦƒĵ‚żċ¤‰ĉ›´ƒ•ƒİ‚° + MagicaManager.Team.parameterDirtyList.Add(this); + + // ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒç™ğ録 + MagicaManager.VMesh.RegisterProxyMesh(TeamId, ProxyMeshContainer); + MagicaManager.Simulation.RegisterProxyMesh(this); + + // ‚³ƒİ‚¤ƒ€ƒĵç™ğ録 + MagicaManager.Collider.Register(this); + } + + // ċˆĥ約ƒ‡ƒĵ‚żç™ğ録 + ct.ThrowIfCancellationRequested(); + MagicaManager.Simulation.RegisterConstraint(this); + + lock (lockObject) + { + // ƒžƒƒƒ”ƒ³‚°ƒĦƒƒ‚·ƒç™ğ録 + if (clothType == ClothType.MeshCloth) + { + foreach (var info in renderMeshInfos) + { + var renderMesh = info.renderMeshContainer.shareVirtualMesh; + + if (renderMesh.IsError == false && renderMesh.IsMapping) + { + // ƒžƒƒƒ”ƒ³‚°ƒĦƒƒ‚·ƒƒ‡ƒĵ‚żĉ¤œè¨ĵ + // ““§ĉ™‚間経過§RendererŒĉĥˆĉğ…—Ĥ„‚‹ŞİçŠĥĉ³Œ‚‚Šċ—‚‹Ÿ‚ + if (renderMesh.IsValid()) + { + // MappingMeshç™ğ録 + info.mappingChunk = MagicaManager.VMesh.RegisterMappingMesh( + TeamId, + info.renderMeshContainer, + info.renderDataWorkIndex + ); + } + } + } + } + + // ƒĴƒ³ƒ€ƒİƒĵĉƒ…ċ ħ‚’ç™ğ録 + foreach (var info in renderMeshInfos) + { + renderMeshInfoList.Add(info); + } + renderMeshInfos.Clear(); + } + ct.ThrowIfCancellationRequested(); + + // ƒƒĵƒ ĉœ‰ċŠıçŠĥĉ…‹è¨­ċš + UpdateUse(); + + // ƒ“ƒĞƒ‰ċŒäş† + result.SetSuccess(); + SetState(State_Running, true); + + Develop.DebugLog($"Build Complate : {Name}, TeamId:{TeamId}"); + } + catch (MagicaClothProcessingException) + { + if (result.IsError() == false) + result.SetError(Define.Result.ClothProcess_UnknownError); + result.DebugLog(); + } + catch (OperationCanceledException) + { + result.SetCancel(); + result.DebugLog(); + //Debug.LogWarning($"Cancel!"); + } + catch (Exception exception) + { + Debug.LogException(exception); + result.SetError(Define.Result.ClothProcess_Exception); + } + finally + { + // “ĉ™‚ç‚ı§ƒ‡ƒĵ‚żŒċ­˜ċœ¨™‚‹ċ ´ċˆŻċ¤ħĉ•——Ĥ„‚‹§ç ´ĉ£„™‚‹ + foreach (var info in renderMeshInfos) + { + info?.renderMeshContainer?.Dispose(); + } + proxyMesh?.Dispose(); + + // ċŒĉœŸċŻèħĦŒ„‚‹ċ ´ċˆŻç›¸ĉ‰‹ä¸€ĉ™‚ċœĉ­˘‚Ğ‚Ĥƒ³‚żƒĵ‚’ĉ¸›ç—™‚‹ + if (cloth != null && cloth.SyncPartnerCloth) + { + var sync = cloth.SyncPartnerCloth; + while (sync != cloth && sync != null) + { + sync.Process.DecrementSuspendCounter(); + sync = sync.SyncPartnerCloth; + } + } + + // ƒ“ƒĞƒ‰ċŒäş† + isBuild = false; + + // “ĉ™‚ç‚ı§‚³ƒ³ƒƒĵƒƒ³ƒˆŒċ‰Šé™¤•‚ŒĤ„‚‹ċ ´ċˆŻç ´ĉ£„™‚‹ + if (isDestory) + { + DisposeInternal(); + //Debug.LogWarning($"Delay Dispose!"); + } + else if (cloth != null) + { + if (result.IsFaild()) + Develop.LogError($"Cloth runtime build failure! [{cloth.name}] : {result.GetResultString()}"); + + // ƒ“ƒĞƒ‰ċŒäş†‚¤ƒ™ƒ³ƒˆ + cloth.OnBuildComplete?.Invoke(cloth, result.IsSuccess()); + } + } + } + + /// + /// ƒš‚¤ƒ³ƒˆƒžƒƒƒ—‹‚‰‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚ż‚’ĉ§‹ç݉™‚‹ + /// + /// + /// + /// + /// + /// + public ResultCode GenerateSelectionDataFromPaintMap( + TransformRecord clothTransformRecord, VirtualMesh renderMesh, PaintMapData paintMapData, out SelectionData selectionData + ) + { + ResultCode result = new ResultCode(); + result.SetProcess(); + selectionData = new SelectionData(); + + try + { + // ƒš‚¤ƒ³ƒˆƒžƒƒƒ—ƒ‚§ƒƒ‚Ż + if (paintMapData == null) + { + result.SetError(Define.Result.CreateCloth_PaintMapCountMismatch); + throw new MagicaClothProcessingException(); + } + + // ‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚żƒƒƒƒ•‚Ħ作ĉˆ + int vcnt = renderMesh.VertexCount; + using var positionList = new NativeArray(vcnt, Allocator.TempJob); + using var attributeList = new NativeArray(vcnt, Allocator.TempJob); + + // ƒĴƒ³ƒ€ƒĵƒĦƒƒ‚·ƒUVċ€¤‹‚‰ƒš‚¤ƒ³ƒˆƒžƒƒƒ—‚’ƒ•‚§ƒƒƒ—Ĥ‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚ż‚’作ĉˆ + // ċş§ĉ¨™Ż‚Żƒ­‚ıçİşé–“Ğċ¤‰ĉ›™‚‹ + var toM = MathUtility.Transform(renderMesh.initLocalToWorld, clothTransformRecord.worldToLocalMatrix); + int2 xySize = new int2(paintMapData.paintMapWidth, paintMapData.paintMapHeight); + using var paintData = new NativeArray(paintMapData.paintData, Allocator.TempJob); + + // BurstĞ‚ˆ‚Šċħžĉ€§ƒžƒƒƒ—‹‚‰‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚ż‚’設ċš + var job = new GenerateSelectionJob() + { + offset = 0, + positionList = positionList, + attributeList = attributeList, + + attributeMapWidth = paintMapData.paintMapWidth, + toM = toM, + xySize = xySize, + attributeReadFlag = paintMapData.paintReadFlag, + attributeMapData = paintData, + + uvs = renderMesh.uv.GetNativeArray(), // ƒĴƒ³ƒ€ƒĵƒĦƒƒ‚·ƒ‚¤ƒ³ƒƒĵƒˆç›´ċŒŻċ…ƒƒĦƒƒ‚·ƒuvŒċ…£Ĥ„‚‹ + vertexs = renderMesh.localPositions.GetNativeArray(), + }; + job.Run(vcnt); + + // ‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚żè¨­ċš + selectionData.positions = positionList.ToArray(); + selectionData.attributes = attributeList.ToArray(); + // ĉœ€ċ¤§è·é›˘Żƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒċş§ĉ¨™çİşé–“Ğċ¤‰ĉ›™‚‹ + selectionData.maxConnectionDistance = MathUtility.TransformDistance(renderMesh.maxVertexDistance.Value, toM); + //Develop.DebugLog($"GenerateSelectionDataFromPaintMap. maxConnectionDistance:{selectionData.maxConnectionDistance}, renderMesh.maxVertexDistance:{renderMesh.maxVertexDistance.Value}"); + selectionData.userEdit = true; + + result.SetSuccess(); + } + catch (MagicaClothProcessingException) + { + if (result.IsNone()) result.SetError(Define.Result.CreateCloth_InvalidPaintMap); + result.DebugLog(); + } + catch (Exception e) + { + Debug.LogException(e); + result.SetError(Define.Result.CreateCloth_InvalidPaintMap); + } + + return result; + } + + [BurstCompile] + struct GenerateSelectionJob : IJobParallelFor + { + public int offset; + [NativeDisableParallelForRestriction] + [Unity.Collections.WriteOnly] + public NativeArray positionList; + [NativeDisableParallelForRestriction] + [Unity.Collections.WriteOnly] + public NativeArray attributeList; + + public int attributeMapWidth; + public float4x4 toM; + public int2 xySize; + public ExBitFlag8 attributeReadFlag; + [Unity.Collections.ReadOnly] + public NativeArray attributeMapData; + + [Unity.Collections.ReadOnly] + public NativeArray uvs; + [Unity.Collections.ReadOnly] + public NativeArray vertexs; + + public void Execute(int vindex) + { + float2 uv = uvs[vindex]; + + // uvċ€¤‚’(0.0 ~ 0.99999..)範ċ›²Ğċ¤‰ĉ›™‚‹ + uv = (uv % 1.0f) + 1.0f; + uv = uv % 1.0f; + + int2 xy = (int2)(uv * xySize); + Color32 col = attributeMapData[xy.y * attributeMapWidth + xy.x]; + + // ċħžĉ€§ċˆ¤ċš + const byte border = 32; // 127 + var attr = new VertexAttribute(); + if (attributeReadFlag.IsSet(PaintMapData.ReadFlag_Move) && col.g > border) + attr.SetFlag(VertexAttribute.Flag_Move, true); + else if (attributeReadFlag.IsSet(PaintMapData.ReadFlag_Fixed) && col.r > border) + attr.SetFlag(VertexAttribute.Flag_Fixed, true); + if (attributeReadFlag.IsSet(PaintMapData.ReadFlag_Limit) && col.b <= border) + attr.SetFlag(VertexAttribute.Flag_InvalidMotion, true); // ċĦ—‚Ё¤ĥ—Ĥ„Ş„ç‡ĉ‰€Œç„ĦċŠı + + // 設ċš + var pos = math.transform(toM, vertexs[vindex]); // ‚Żƒ­‚ı‚³ƒ³ƒƒĵƒƒ³ƒˆçİşé–“Ğċ¤‰ĉ› + positionList[offset + vindex] = pos; + attributeList[offset + vindex] = attr; + } + } + + /// + /// ƒš‚¤ƒ³ƒˆƒžƒƒƒ—‹‚‰ƒ†‚Ż‚ıƒƒ£ƒ‡ƒĵ‚ż‚’ċ–ċ——Ĥĉƒ…ċ ħ‚’ƒŞ‚ıƒˆ§èż”™ + /// ƒŸƒƒƒ—ƒžƒƒƒ—Œċ­˜ċœ¨™‚‹ċ ´ċˆŻç´„128x128‚µ‚¤‚şäğ下ƒŸƒƒƒ—ƒžƒƒƒ—‚’ĉŽĦ用™‚‹ + /// “ċ‡Ĥ理ŻƒĦ‚¤ƒ³‚ıƒĴƒƒƒ‰§—‹ċ‹•作›š€Ÿ‚ŒŞ‚Šè² è·Œ‹‹‚‹§ĉ³¨ĉ„ïĵ + /// + /// + public ResultCode GeneratePaintMapDataList(List dataList) + { + var result = new ResultCode(); + result.SetProcess(); + + try + { + int mapCount = cloth.SerializeData.paintMaps.Count; + + // ƒ†‚Ż‚ıƒƒ£èŞ­żèĵżƒ•ƒİ‚° + var readFlag = new ExBitFlag8(PaintMapData.ReadFlag_Fixed | PaintMapData.ReadFlag_Move); + if (cloth.SerializeData.paintMode == ClothSerializeData.PaintMode.Texture_Fixed_Move_Limit) + readFlag.SetFlag(PaintMapData.ReadFlag_Limit, true); + + for (int i = 0; i < mapCount; i++) + { + var paintMap = cloth.SerializeData.paintMaps[i]; + if (paintMap == null) + { + result.SetError(Define.Result.Init_InvalidPaintMap); + throw new MagicaClothProcessingException(); + } + if (paintMap.isReadable == false) + { + result.SetError(Define.Result.Init_PaintMapNotReadable); + throw new MagicaClothProcessingException(); + } + int width = paintMap.width; + int height = paintMap.height; + int pixelCount = width * height; + int mip = 1; + while (mip < paintMap.mipmapCount && pixelCount > 16384) // 128 x 128 = 16384 + { + mip++; + pixelCount /= 4; + width /= 2; + height /= 2; + } + Develop.DebugLog($"[{paintMap.name}] target mipmap:{mip - 1} ,pixelCount:{pixelCount}, w:{width}, h:{height}"); + + // ƒ”‚Ż‚ğƒĞƒ‡ƒĵ‚żċ–ċ— + // !ççŠĥCPUċ´‹‚‰ċœ§ç¸ƒ†‚Ż‚ıƒƒ£ƒ”‚Ż‚ğƒĞƒ‡ƒĵ‚ż‚’ċ–ċ—™‚‹ĞŻ“ĉ–ıĉ³•—‹Ş„€‚ + // !GetPixelData()§ŻRGB32/RGBA32äğċ¤–ƒ•‚݃ĵƒžƒƒƒˆĞċŻċżœ§Ş„€‚ + // !“é–˘ĉ•°ŻƒĦ‚¤ƒ³‚ıƒĴƒƒƒ‰§—‹ċ‹•作›š€Ÿċ‡Ĥ理負荷‚‚‚ŒŞ‚ŠĞ‚‚‹§ĉ³¨ĉ„ïĵ(128x128§0.3msğİ) + var data = new PaintMapData(); + data.paintData = paintMap.GetPixels32(mip - 1); + Develop.DebugLog($"paintMapData:{data.paintData.Length}"); + data.paintMapWidth = width; + data.paintMapHeight = height; + data.paintReadFlag = readFlag; + dataList.Add(data); + } + + result.SetSuccess(); + } + catch (MagicaClothProcessingException) + { + result.DebugLog(); + } + catch (Exception e) + { + Debug.LogException(e); + result.SetError(Define.Result.Init_InvalidPaintMap); + } + + return result; + } + + /// + /// 頂ç‚ıċħžĉ€§ƒ‡ƒĵ‚żé…ċˆ—‹‚‰‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚ż‚’ĉ§‹ç݉™‚‹ + /// + /// + /// + /// + /// + /// + public ResultCode GenerateSelectionDataFromVertexAttributeData( + TransformRecord clothTransformRecord, VirtualMesh renderMesh, VertexAttribute[] vertexAttributeArray, out SelectionData selectionData + ) + { + ResultCode result = new ResultCode(); + result.SetProcess(); + selectionData = new SelectionData(); + + try + { + // ‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚żƒƒƒƒ•‚Ħ作ĉˆ + int vcnt = renderMesh.VertexCount; + using var positionList = new NativeArray(vcnt, Allocator.TempJob); + //using var attributeList = new NativeArray(vcnt, Allocator.TempJob); + + // 頂ç‚ıċş§ĉ¨™‚’‚Żƒ­‚ıçİşé–“Ğċ¤‰ĉ›™‚‹ + var toM = MathUtility.Transform(renderMesh.initLocalToWorld, clothTransformRecord.worldToLocalMatrix); + JobUtility.TransformPositionRun(renderMesh.localPositions.GetNativeArray(), positionList, vcnt, toM); + + // ‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚żè¨­ċš + selectionData.positions = positionList.ToArray(); + selectionData.attributes = vertexAttributeArray; // ċ‚ç…§ż + // ĉœ€ċ¤§è·é›˘Żƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒċş§ĉ¨™çİşé–“Ğċ¤‰ĉ›™‚‹ + selectionData.maxConnectionDistance = MathUtility.TransformDistance(renderMesh.maxVertexDistance.Value, toM); + //Develop.DebugLog($"GenerateSelectionDataFromPaintMap. maxConnectionDistance:{selectionData.maxConnectionDistance}, renderMesh.maxVertexDistance:{renderMesh.maxVertexDistance.Value}"); + selectionData.userEdit = true; + + result.SetSuccess(); + } + catch (MagicaClothProcessingException) + { + if (result.IsNone()) result.SetError(Define.Result.CreateCloth_InvalidVertexAttributeData); + result.DebugLog(); + } + catch (Exception e) + { + Debug.LogException(e); + result.SetError(Define.Result.CreateCloth_InvalidVertexAttributeData); + } + + return result; + } + + //========================================================================================= + static readonly ProfilerMarker preBuildProfiler = new ProfilerMarker("ClothProcess.PreBuild"); + static readonly ProfilerMarker preBuildDeserializationProfiler = new ProfilerMarker("ClothProcess.PreBuild.Deserialization"); + static readonly ProfilerMarker preBuildRegistrationProfiler = new ProfilerMarker("ClothProcess.PreBuild.Registration"); + + /// + /// PreBuildƒ‡ƒĵ‚żĞ‚ˆ‚‹ċ³ĉ™‚ĉ§‹ç݉ + /// + /// + internal bool PreBuildDataConstruction() + { + if (IsState(State_UsePreBuild) == false) + return false; + if (IsState(State_InitSuccess) == false) + return false; + + // ĉ§‹ç݉開ċ§‹ + Develop.DebugLog($"Pre-Build start [{cloth.name}]"); + preBuildProfiler.Begin(); + + result.SetProcess(); + var sdata = cloth.SerializeData; + var sdata2 = cloth.GetSerializeData2(); + + VirtualMeshContainer proxyMeshContainer = null; + List renderMeshContainerList = new List(); + + try + { + // ċ›şĉœ‰éƒ¨ċˆ†ƒ‡ƒĵ‚ż + var uniquePreBuildData = sdata2.preBuildData.uniquePreBuildData; + + // ċ…ħĉœ‰éƒ¨ċˆ†ƒ‡ƒĵ‚ż + var preBuildDeserializeData = MagicaManager.PreBuild.GetPreBuildData(sdata2.preBuildData.GetSharePreBuildData()); + + try + { + preBuildDeserializationProfiler.Begin(); + + // ProxyMeshċİċ…ƒ + proxyMeshContainer = new VirtualMeshContainer(preBuildDeserializeData.proxyMesh); + if (proxyMeshContainer.shareVirtualMesh.IsError) + { + result.Merge(proxyMeshContainer.shareVirtualMesh.result); + throw new MagicaClothProcessingException(); + } + proxyMeshContainer.uniqueData = uniquePreBuildData.proxyMesh; + + // RenderMeshċİċ…ƒ + for (int i = 0; i < preBuildDeserializeData.renderMeshList.Count; i++) + { + var renderMeshContainer = new VirtualMeshContainer(preBuildDeserializeData.renderMeshList[i]); + renderMeshContainerList.Add(renderMeshContainer); + if (renderMeshContainer.shareVirtualMesh.IsError) + { + result.Merge(renderMeshContainer.shareVirtualMesh.result); + throw new MagicaClothProcessingException(); + } + renderMeshContainer.uniqueData = uniquePreBuildData.renderMeshList[i]; + } + + // ċˆĥ約ƒ‡ƒĵ‚żċİċ…ƒ + inertiaConstraintData = preBuildDeserializeData.inertiaConstraintData; + distanceConstraintData = preBuildDeserializeData.distanceConstraintData; + bendingConstraintData = preBuildDeserializeData.bendingConstraintData; + } + catch + { + throw; + } + finally + { + preBuildDeserializationProfiler.End(); + } + + // ƒ‘ƒİƒĦƒĵ‚żċ¤‰ĉ›´ƒ•ƒİ‚° + //SetState(State_ParameterDirty, true); + + // ç™ğ録 + try + { + preBuildRegistrationProfiler.Begin(); + + // ProxyMeshç™ğ録 + ProxyMeshContainer = proxyMeshContainer; + proxyMeshContainer = null; + + // ƒƒĵƒ ç™ğ録 + TeamId = MagicaManager.Cloth.AddCloth(this, parameters); + if (TeamId <= 0) + { + result.SetError(Define.Result.ClothProcess_OverflowTeamCount4096); + throw new MagicaClothProcessingException(); + } + + // ƒ‘ƒİƒĦƒĵ‚żċ¤‰ĉ›´ƒ•ƒİ‚° + MagicaManager.Team.parameterDirtyList.Add(this); + + // ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒç™ğ録 + MagicaManager.VMesh.RegisterProxyMesh(TeamId, ProxyMeshContainer); + MagicaManager.Simulation.RegisterProxyMesh(this); + + // ‚³ƒİ‚¤ƒ€ƒĵç™ğ録 + MagicaManager.Collider.Register(this); + + // ċˆĥ約ƒ‡ƒĵ‚żç™ğ録 + MagicaManager.Simulation.RegisterConstraint(this); + + // ƒžƒƒƒ”ƒ³‚°ƒĦƒƒ‚·ƒç™ğ録 + for (int i = 0; i < renderMeshContainerList.Count; i++) + { + var renderMeshContainer = renderMeshContainerList[i]; + var renderMesh = renderMeshContainer.shareVirtualMesh; + if (renderMesh.IsError == false && renderMesh.IsMapping && renderMesh.IsValid()) + { + renderMeshContainerList[i] = null; + + // ƒĴƒ³ƒ€ƒĵƒƒ³ƒ‰ƒĞ + MagicaObjectId renderHandle = renderHandleList[i]; + var renderData = MagicaManager.Render.GetRendererData(renderHandle); + + // MappingMeshç™ğ録 + var mappingChunk = MagicaManager.VMesh.RegisterMappingMesh( + TeamId, + renderMeshContainer, + renderData.renderDataWorkIndex + ); + + // ċŒäş† + renderMesh.result.SetSuccess(); + + // ƒĴƒ³ƒ€ƒİƒĵĉƒ…ċ ħ‚’ç™ğ録 + var info = new RenderMeshInfo() + { + renderHandle = renderHandle, + renderMeshContainer = renderMeshContainer, + mappingChunk = mappingChunk, + renderDataWorkIndex = renderData.renderDataWorkIndex + }; + renderMeshInfoList.Add(info); + } + } + + // ƒƒĵƒ ĉœ‰ċŠıçŠĥĉ…‹è¨­ċš + UpdateUse(); + } + catch + { + throw; + } + finally + { + preBuildRegistrationProfiler.End(); + } + + // ƒ“ƒĞƒ‰ċŒäş† + result.SetSuccess(); + SetState(State_Running, true); + + Develop.DebugLog($"Pre-Build Complate : {Name}, TeamId:{TeamId}"); + } + catch (MagicaClothProcessingException) + { + if (result.IsError() == false) + result.SetError(Define.Result.PreBuild_UnknownError); + result.DebugLog(); + } + catch (Exception e) + { + Debug.LogException(e); + result.SetError(Define.Result.PreBuild_Exception); + } + finally + { + // “ĉ™‚ç‚ı§ƒ‡ƒĵ‚żŒċ­˜ċœ¨™‚‹ċ ´ċˆŻċ¤ħĉ•——Ĥ„‚‹§ç ´ĉ£„™‚‹ + renderMeshContainerList.ForEach(x => x?.Dispose()); + renderMeshContainerList.Clear(); + proxyMeshContainer?.Dispose(); + + // ƒ“ƒĞƒ‰ċŒäş† + //Develop.DebugLog($"PreBuild Construction Complate.[{cloth.name}] result:{result.GetResultString()}"); + if (result.IsFaild()) + Develop.LogError($"Cloth Pre-Build construction failure! [{cloth.name}] : {result.GetResultString()}"); + else + Develop.DebugLog($"Cloth Pre-Build Success! [{cloth.name}]"); + } + + preBuildProfiler.End(); + + return result.IsSuccess(); + } + + //========================================================================================= + /// + /// ‚Ѓރ³‚°é€£ċ‹•‚˘ƒ‹ƒĦƒĵ‚żƒĵ¨ƒĴƒ³ƒ€ƒİƒĵ‚’ĉ›´ĉ–° + /// + internal void UpdateCullingAnimatorAndRenderers() + { + var cullingSettings = cloth.SerializeData.cullingSettings; + + // 連ċ‹•‚˘ƒ‹ƒĦƒĵ‚żƒĵĉ›´ĉ–° + if (cullingSettings.cameraCullingMode == CullingSettings.CameraCullingMode.AnimatorLinkage + || cullingSettings.cameraCullingMethod == CullingSettings.CameraCullingMethod.AutomaticRenderer + || cloth.SerializeData.updateMode == ClothUpdateMode.AnimatorLinkage) + { + interlockingAnimator = cloth.GetComponentInParent(); + } + + // 連ċ‹•ƒĴƒ³ƒ€ƒİƒĵĉ›´ĉ–° + if (cullingSettings.cameraCullingMethod == CullingSettings.CameraCullingMethod.AutomaticRenderer && interlockingAnimator) + { + // ★GetComponentsInChildren‚³‚ıƒˆŻ‚­ƒ£ƒİ‚Ż‚ż100体§1msğİ€‚ + // ★‚‚—‚³‚ıƒˆŒċ•éĦŒ¨Ş‚‹‚ˆ†Ş‚‰°‚­ƒ£ƒƒ‚·ƒ™‚‹ + interlockingAnimatorRenderers.Clear(); + interlockingAnimator.GetComponentsInChildren(interlockingAnimatorRenderers); + } + } + + /// + /// 保ĉŒ—Ĥ„‚‹ƒĴƒ³ƒ€ƒĵƒ‡ƒĵ‚żĞċ݁—Ĥĉ›´ĉ–°‚’ĉŒ‡ç¤ş™‚‹ + /// + internal void UpdateRendererUse() + { + // ċŻċżœ™‚‹ƒĴƒ³ƒ€ƒĵƒ‡ƒĵ‚żĞĉ›´ĉ–°‚’ĉŒ‡ç¤ş™‚‹ + renderHandleList.ForEach(handle => MagicaManager.Render.GetRendererData(handle).UpdateUse(this, 0)); + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothProcess.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothProcess.cs.meta new file mode 100644 index 00000000..104f41c6 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothProcess.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 704c6153c380ba94f8548d02490cfaf6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Cloth/ClothProcess.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothProcessData.cs b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothProcessData.cs new file mode 100644 index 00000000..eb6a2239 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothProcessData.cs @@ -0,0 +1,509 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System; +using System.Collections.Generic; +using System.Threading; +using Unity.Collections; +using Unity.Mathematics; +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// MagicaCloth‚³ƒ³ƒƒĵƒƒ³ƒˆċ‡Ĥ理ƒ‡ƒĵ‚żéƒ¨ċˆ† + /// + public partial class ClothProcess : IDisposable, IValid, ITransform + { + public MagicaCloth cloth { get; internal set; } + + /// + /// ċŒĉœŸä¸­ċ‚ç…§‚Żƒ­‚ı€‚“‚ŒŻċŒĉœŸéšŽċħ¤ĉœ€ä¸Šä½‚Żƒ­‚ı‚’ĉŒ‡™ + /// + public MagicaCloth SyncTopCloth { get; internal set; } + + /// + /// çŠĥĉ…‹ƒ•ƒİ‚°(0 ~ 31) + /// + public const int State_Valid = 0; + public const int State_Enable = 1; + //public const int State_ParameterDirty = 2; + public const int State_InitSuccess = 3; + public const int State_InitComplete = 4; + public const int State_Build = 5; + public const int State_Running = 6; + public const int State_DisableAutoBuild = 7; + public const int State_CameraCullingInvisible = 8; // ƒƒĵƒ ƒ‡ƒĵ‚żċŒƒ•ƒİ‚°‚³ƒ”ƒĵ + public const int State_CameraCullingKeep = 9; // ƒƒĵƒ ƒ‡ƒĵ‚żċŒƒ•ƒİ‚°‚³ƒ”ƒĵ + public const int State_SkipWriting = 10; // ĉ›¸èĵżċœĉ­˘ïĵˆ‚ıƒˆƒƒƒ—ƒ˘ƒĵ‚·ƒ§ƒ³ç”¨ïĵ‰ + //public const int State_SkipWritingDirty = 11; // ĉ›¸èĵżċœĉ­˘ƒ•ƒİ‚°ĉ›´ĉ–°‚µ‚¤ƒ³ + public const int State_UsePreBuild = 12; // PreBuild‚’ċˆİ用 + public const int State_DistanceCullingInvisible = 13; // ƒƒĵƒ ƒ‡ƒĵ‚żċŒƒ•ƒİ‚°‚³ƒ”ƒĵ + public const int State_UpdateTangent = 14; // ĉŽç·šĉ›´ĉ–° + public const int State_Component = 15; // ‚³ƒ³ƒƒĵƒƒ³ƒˆĉœ‰ċŠıçŠĥĉ…‹ + public const int State_Verification = 16; // ĉ¤œè¨ĵ結ĉžœĞ‚ˆ‚‹ĉœ‰ċŠıçŠĥĉ…‹ + + /// + /// çċœ¨çŠĥĉ…‹ + /// + internal BitField32 stateFlag; + + /// + /// ċˆĉœŸ‚Żƒ­‚ı‚³ƒ³ƒƒĵƒƒ³ƒˆƒˆƒİƒ³‚ıƒ•‚݃ĵƒ çŠĥĉ…‹ + /// + internal TransformRecord clothTransformRecord { get; private set; } = null; + + /// + /// ƒĴƒ³ƒ€ƒĵĉƒ…ċ ħ¸ƒƒ³ƒ‰ƒĞ + /// ïĵˆƒĴƒ³ƒ€ƒİƒĵ‚ğƒƒƒˆ‚˘ƒƒƒ—ƒ‡ƒĵ‚żïĵ‰ + /// + internal List renderHandleList = new List(); + + /// + /// BoneCloth‚ğƒƒƒˆ‚˘ƒƒƒ—ƒ‡ƒĵ‚ż + /// + internal RenderSetupData boneClothSetupData; + + /// + /// ƒĴƒ³ƒ€ƒĵƒĦƒƒ‚·ƒçĦ理 + /// + public class RenderMeshInfo + { + public MagicaObjectId renderHandle; + public VirtualMeshContainer renderMeshContainer; + public DataChunk mappingChunk; + //public DataChunk renderMeshPositionAndNormalChunk; + //public DataChunk renderMeshTangentChunk; + public int renderDataWorkIndex; + } + internal List renderMeshInfoList = new List(); + + /// + /// ‚Ğ‚ı‚żƒ ‚ı‚­ƒ‹ƒ³‚°ƒœƒĵƒ³ĉƒ…ċ ħ + /// + internal List customSkinningBoneRecords = new List(); + + /// + /// ĉ³•ç·šèŞżĉ•´ç”¨ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ çŠĥĉ…‹ + /// + internal TransformRecord normalAdjustmentTransformRecord { get; private set; } = null; + + //========================================================================================= + /// + /// ƒš‚¤ƒ³ƒˆƒžƒƒƒ—ĉƒ…ċ ħ + /// + public class PaintMapData + { + public const byte ReadFlag_Fixed = 0x01; + public const byte ReadFlag_Move = 0x02; + public const byte ReadFlag_Limit = 0x04; + + public Color32[] paintData; + public int paintMapWidth; + public int paintMapHeight; + public ExBitFlag8 paintReadFlag; + } + + //========================================================================================= + /// + /// ċ‡Ĥ理結ĉžœ + /// + internal ResultCode result; + public ResultCode Result => result; + + /// + /// ċˆĉœŸċŒ–ƒ‡ƒĵ‚żċ‚照結ĉžœ + /// + public ResultCode InitDataResult { get; internal set; } + + /// + /// Cloth Type + /// + public enum ClothType + { + MeshCloth = 0, + BoneCloth = 1, + BoneSpring = 10, + } + internal ClothType clothType { get; private set; } + + /// + /// ƒŞƒ€‚Ż‚·ƒ§ƒ³è¨­ċšïĵˆċ¤–部‹‚‰è¨­ċš™‚‹ïĵ‰ + /// + ReductionSettings reductionSettings; + + /// + /// ‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ƒ‘ƒİƒĦƒĵ‚ż + /// + public ClothParameters parameters { get; private set; } + + /// + /// ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒ + /// + public VirtualMeshContainer ProxyMeshContainer { get; private set; } = null; + + /// + /// ç™ğ録中‚³ƒİ‚¤ƒ€ƒĵ + /// int2 (ƒĦ‚¤ƒ³‚³ƒİ‚¤ƒ€ƒĵƒğƒ­ƒĵ‚ЃЂ¤ƒ³ƒ‡ƒƒ‚Ż‚ı, ‚·ƒ³ƒĦƒˆƒŞƒĵ‚³ƒİ‚¤ƒ€ƒĵƒğƒ­ƒĵ‚ЃЂ¤ƒ³ƒ‡ƒƒ‚Ż‚ı) + /// ƒĦ‚¤ƒ³‚³ƒİ‚¤ƒ€ƒĵ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ıïĵŻ‚‚Šċ—‚‹ + /// ‚·ƒ³ƒĦƒˆƒŞƒĵ‚³ƒİ‚¤ƒ€ƒĵ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ıïĵŻ‚·ƒ³ƒĦƒˆƒŞƒĵŒċ­˜ċœ¨—Ş„“¨‚’示™ + /// + internal Dictionary colliderDict = new Dictionary(); + + //========================================================================================= + /// + /// ƒƒĵƒ ID + /// + public int TeamId { get; private set; } = 0; + + /// + /// ĉ…£ĉ€§ċˆĥ約ƒ‡ƒĵ‚ż + /// + internal InertiaConstraint.ConstraintData inertiaConstraintData; + + /// + /// è·é›˘ċˆĥ約ƒ‡ƒĵ‚ż + /// + internal DistanceConstraint.ConstraintData distanceConstraintData; + + /// + /// ĉ›²’ċˆĥ約ƒ‡ƒĵ‚ż + /// + internal TriangleBendingConstraint.ConstraintData bendingConstraintData; + + //========================================================================================= + /// + /// 連ċ‹•‚˘ƒ‹ƒĦƒĵ‚żƒĵ + /// ƒğ‚Ѓރ³‚° + /// ƒğĉ›´ĉ–°ƒ˘ƒĵƒ‰ + /// + internal Animator interlockingAnimator = null; + + /// + /// ‚Ѓރ³‚°ç”¨‚˘ƒ‹ƒĦƒĵ‚żƒĵ配下ƒĴƒ³ƒ€ƒİƒĵƒŞ‚ıƒˆ + /// + internal List interlockingAnimatorRenderers = new List(); + + /// + /// çċœ¨‚˘ƒ³‚Ѓĵ¨—Ĥ設ċš•‚ŒĤ„‚‹Transform‚¤ƒ³‚ı‚żƒ³‚ıID + /// + internal MagicaObjectId anchorTransformId = MagicaObjectId.Invalid; + + /// + /// çċœ¨è·é›˘‚Ѓރ³‚°ċ‚ç…§¨—Ĥ設ċš•‚ŒĤ„‚‹‚ރ–‚¸‚§‚Żƒˆ‚¤ƒ³‚ı‚żƒ³‚ıID + /// + internal MagicaObjectId distanceReferenceObjectId = MagicaObjectId.Invalid; + + /// + /// ‚³ƒ³ƒƒĵƒƒ³ƒˆç™ğ録TransformIndex + /// tdata.componentTransformIndex‚³ƒ”ƒĵ + /// + //internal int componentTransformIndex = 0; + + internal Animator cameraCullingAnimator = null; + internal List cameraCullingRenderers = null; + internal CullingSettings.CameraCullingMode cameraCullingMode; + internal bool cameraCullingOldInvisible = false; + + //========================================================================================= + /// + /// ‚­ƒ£ƒ³‚ğƒĞƒˆƒĵ‚Żƒ³ + /// + CancellationTokenSource cts = new CancellationTokenSource(); + volatile object lockObject = new object(); + //volatile object lockState = new object(); + + /// + /// ċˆĉœŸċŒ–ċ…ĉİŸ‚Ğ‚Ĥƒ³‚żƒĵ + /// + //volatile int suspendCounter = 0; + + /// + /// ç ´ĉ£„ƒ•ƒİ‚° + /// + volatile bool isDestory = false; + + /// + /// ċ†…部ƒ‡ƒĵ‚ż§ċŒċ…¨Ğç ´ĉ£„•‚ŒŸ‹İ†‹ + /// + volatile bool isDestoryInternal = false; + + /// + /// ĉ§‹ç݉䏭ƒ•ƒİ‚° + /// + volatile bool isBuild = false; + + public BitField32 GetStateFlag() + { + //lock (lockState) + { + // copy + var state = stateFlag; + return state; + } + } + + public bool IsState(int state) + { + //lock (lockState) + { + return stateFlag.IsSet(state); + } + } + + public void SetState(int state, bool sw) + { + //lock (lockState) + { + stateFlag.SetBits(state, sw); + } + } + + public bool IsValid() => IsState(State_Valid); + public bool IsRunning() => IsState(State_Running); + public bool IsCameraCullingInvisible() => IsState(State_CameraCullingInvisible); + public bool IsCameraCullingKeep() => IsState(State_CameraCullingKeep); + public bool IsDistanceCullingInvisible() => IsState(State_DistanceCullingInvisible); + public bool IsSkipWriting() => IsState(State_SkipWriting); + public bool IsUpdateTangent() => IsState(State_UpdateTangent); + + public bool IsEnable + { + get + { + if (IsValid() == false || TeamId == 0) + return false; + return MagicaManager.Team.IsEnable(TeamId); + } + } + + public bool HasProxyMesh + { + get + { + if (IsValid() == false || TeamId == 0) + return false; + return ProxyMeshContainer?.shareVirtualMesh?.IsSuccess ?? false; + } + } + + public string Name => cloth != null ? cloth.name : "(none)"; + + //========================================================================================= + public ClothProcess() + { + // ċˆĉœŸçŠĥĉ…‹ + result = ResultCode.Empty; + } + + public void Dispose() + { + lock (lockObject) + { + isDestory = true; + SetState(State_Valid, false); + result.Clear(); + cts.Cancel(); + } + + DisposeInternal(); + //Debug.Log($"ClothProcessData.Dispose()!"); + } + + void DisposeInternal() + { + lock (lockObject) + { + // ™§Ğç ´ĉ£„ċŒäş†Ş‚‰°ä¸èĤ + if (isDestoryInternal) + return; + + // ƒ“ƒĞƒ‰ä¸­Żç ´ĉ£„‚’äżç•™™‚‹ + if (isBuild) + return; + + // ƒžƒƒĵ‚¸ƒ£‹‚‰ċ‰Šé™¤ + MagicaManager.Simulation?.ExitProxyMesh(this); + MagicaManager.VMesh?.ExitProxyMesh(TeamId); // ƒžƒƒƒ”ƒ³‚°ƒĦƒƒ‚·ƒ‚‚è§£ĉ”•‚Œ‚‹ + MagicaManager.Collider?.Exit(this); + MagicaManager.Cloth?.RemoveCloth(this); + + // ƒĴƒ³ƒ€ƒĵƒĦƒƒ‚·ƒç ´ĉ£„ + foreach (var info in renderMeshInfoList) + { + if (info == null) + continue; + + // äğĉƒ³ƒĦƒƒ‚·ƒç ´ĉ£„ + info.renderMeshContainer?.Dispose(); + } + renderMeshInfoList.Clear(); + renderMeshInfoList = null; + + // ƒĴƒ³ƒ€ƒĵƒ‡ƒĵ‚żċˆİ用終了 + foreach (MagicaObjectId renderHandle in renderHandleList) + { + MagicaManager.Render?.RemoveRenderer(renderHandle); + } + renderHandleList.Clear(); + renderHandleList = null; + + // BoneCloth‚ğƒƒƒˆ‚˘ƒƒƒ—ƒ‡ƒĵ‚ż + boneClothSetupData?.Dispose(); + boneClothSetupData = null; + + // ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒç ´ĉ£„ + ProxyMeshContainer?.Dispose(); + ProxyMeshContainer = null; + + colliderDict.Clear(); + + interlockingAnimator = null; + interlockingAnimatorRenderers.Clear(); + + // PreBuildƒ‡ƒĵ‚żè§£é™¤ + MagicaManager.PreBuild?.UnregisterPreBuildData(cloth != null ? cloth.GetSerializeData2()?.preBuildData.GetSharePreBuildData() : null); + + // 作ĉ­ƒƒƒƒ•‚Ħç ´ĉ£„ + SyncTopCloth = null; + MagicaObjectId compId = cloth.GetMagicaId(); + MagicaManager.Team?.comp2SuspendCounterMap.Remove(compId); + MagicaManager.Team?.comp2TeamIdMap.Remove(compId); + MagicaManager.Team?.comp2SyncPartnerCompMap.Remove(compId); + MagicaManager.Team?.comp2SyncTopCompMap.Remove(compId); + + // ċŒċ…¨ç ´ĉ£„ƒ•ƒİ‚° + isDestoryInternal = true; + } + Develop.DebugLog($"Cloth dispose internal."); + + // ç ´ĉ£„監èĤ–ƒŞ‚ıƒˆ‹‚‰ċ‰Šé™¤™‚‹ + MagicaManager.Team?.RemoveMonitoringProcess(this); + } + + internal void IncrementSuspendCounter() + { + //suspendCounter++; + var tm = MagicaManager.Team; + MagicaObjectId compId = cloth.GetMagicaId(); + if (tm.comp2SuspendCounterMap.TryGetValue(compId, out int cnt)) + { + cnt++; + //tm.comp2SuspendCounterMap.Add(compId, cnt); + tm.comp2SuspendCounterMap[compId] = cnt; + } + else + tm.comp2SuspendCounterMap.Add(compId, 1); + } + + internal void DecrementSuspendCounter() + { + //suspendCounter--; + var tm = MagicaManager.Team; + MagicaObjectId compId = cloth.GetMagicaId(); + if (tm.comp2SuspendCounterMap.TryGetValue(compId, out int cnt)) + { + cnt--; + if (cnt > 0) + tm.comp2SuspendCounterMap[compId] = cnt; + else + tm.comp2SuspendCounterMap.Remove(compId); + } + } + + internal int GetSuspendCounter() + { + //return suspendCounter; + var tm = MagicaManager.Team; + MagicaObjectId compId = cloth.GetMagicaId(); + if (tm.comp2SuspendCounterMap.TryGetValue(compId, out int cnt)) + return cnt; + else + return 0; + } + + public RenderMeshInfo GetRenderMeshInfo(int index) + { + if (index >= 0 && index < renderMeshInfoList.Count) + return renderMeshInfoList[index]; + else + return null; + } + + internal void SyncParameters() + { + parameters = cloth.SerializeData.GetClothParameters(); + } + + public void GetUsedTransform(HashSet transformSet) + { + cloth.SerializeData.GetUsedTransform(transformSet); + cloth.serializeData2.GetUsedTransform(transformSet); + clothTransformRecord?.GetUsedTransform(transformSet); + boneClothSetupData?.GetUsedTransform(transformSet); + renderHandleList.ForEach(handle => MagicaManager.Render.GetRendererData(handle).GetUsedTransform(transformSet)); + customSkinningBoneRecords.ForEach(rd => rd.GetUsedTransform(transformSet)); + normalAdjustmentTransformRecord?.GetUsedTransform(transformSet); + + // null‚’除ċ¤–™‚‹ + if (transformSet.Contains(null)) + transformSet.Remove(null); + } + + public void ReplaceTransform(Dictionary replaceDict) + { + cloth.SerializeData.ReplaceTransform(replaceDict); + cloth.serializeData2.ReplaceTransform(replaceDict); + clothTransformRecord?.ReplaceTransform(replaceDict); + boneClothSetupData?.ReplaceTransform(replaceDict); + renderHandleList.ForEach(handle => MagicaManager.Render.GetRendererData(handle).ReplaceTransform(replaceDict)); + customSkinningBoneRecords.ForEach(rd => rd.ReplaceTransform(replaceDict)); + normalAdjustmentTransformRecord?.ReplaceTransform(replaceDict); + } + + internal void SetSkipWriting(bool sw) + { + // ““§Żƒ•ƒİ‚°żĉ›´ĉ–°™‚‹ + // ċŸéš›ĉ›´ĉ–°Żƒƒĵƒ AlwaysTeamUpdate()§èĦŒ‚‚Œ‚‹ + SetState(State_SkipWriting, sw); + //SetState(State_SkipWritingDirty, true); + MagicaManager.Team.skipWritingDirtyList.Add(this); + } + + internal ClothUpdateMode GetClothUpdateMode() + { + switch (cloth.SerializeData.updateMode) + { + case ClothUpdateMode.Normal: + case ClothUpdateMode.UnityPhysics: + case ClothUpdateMode.Unscaled: + return cloth.SerializeData.updateMode; + case ClothUpdateMode.AnimatorLinkage: + if (interlockingAnimator) + { + switch (interlockingAnimator.updateMode) + { + case AnimatorUpdateMode.Normal: + return ClothUpdateMode.Normal; +#if UNITY_2023_1_OR_NEWER + case AnimatorUpdateMode.Fixed: + return ClothUpdateMode.UnityPhysics; +#else + case AnimatorUpdateMode.AnimatePhysics: + return ClothUpdateMode.UnityPhysics; +#endif + case AnimatorUpdateMode.UnscaledTime: + return ClothUpdateMode.Unscaled; + default: + Develop.DebugLogWarning($"[{cloth.name}] Unknown Animator UpdateMode:{interlockingAnimator.updateMode}"); + break; + } + } + return ClothUpdateMode.Normal; + default: + Develop.LogError($"[{cloth.name}] Unknown Cloth Update Mode:{cloth.SerializeData.updateMode}"); + return ClothUpdateMode.Normal; + } + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothProcessData.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothProcessData.cs.meta new file mode 100644 index 00000000..25630786 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothProcessData.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: cd76571c8c560a348bedf4b213ae34c2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Cloth/ClothProcessData.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothProcessGeneration.cs b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothProcessGeneration.cs new file mode 100644 index 00000000..6533e44c --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothProcessGeneration.cs @@ -0,0 +1,120 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using Unity.Mathematics; +using UnityEngine; + +namespace MagicaCloth2 +{ + public partial class ClothProcess + { + public ResultCode GenerateStatusCheck() + { + ResultCode result = new ResultCode(); + + // ‚ı‚ħƒĵƒĞċ€¤ƒ‚§ƒƒ‚Ż + var scl = cloth.transform.lossyScale; + if (Mathf.Approximately(scl.x, 0.0f) || Mathf.Approximately(scl.y, 0.0f) || Mathf.Approximately(scl.z, 0.0f)) + { + // ‚ı‚ħƒĵƒĞċ€¤Œ‚ĵƒ­ + result.SetError(Define.Result.Init_ScaleIsZero); + } + else if (scl.x < 0.0f || scl.y < 0.0f || scl.z < 0.0f) + { + // è² ‚ı‚ħƒĵƒĞ + // è² ‚ı‚ħƒĵƒĞ§ċˆĉœŸċŒ–Ż€äş‹ċ‰ĉ§‹ç݉‚‚—ŻċˆĉœŸċŒ–ƒ‡ƒĵ‚ż‚‚Ёċ ´ċˆè¨ħċŻ™‚‹ + var sdata2 = cloth.GetSerializeData2(); + if (sdata2.preBuildData.UsePreBuild() || (sdata2.initData?.HasData() ?? false)) + { + // Ÿ —è¨ħċŻ•‚Œ‚‹Żä¸€è𸃕ƒŞƒƒƒ—ż + int flipCount = (scl.x < 0.0f ? 1 : 0) + (scl.y < 0.0f ? 1 : 0) + (scl.z < 0.0f ? 1 : 0); + if (flipCount != 1) + { + result.SetError(Define.Result.Init_NegativeScale); + } + } + else + result.SetError(Define.Result.Init_NegativeScale); + } + else + { + float diff1 = Mathf.Abs(1.0f - scl.x / scl.y); + float diff2 = Mathf.Abs(1.0f - scl.x / scl.z); + const float diffTolerance = 0.01f; // èŞ¤ċ·(1%) + if (diff1 > diffTolerance || diff2 > diffTolerance) + { + // 一ĉ§˜‚ı‚ħƒĵƒĞ§ŻŞ„ + result.SetWarning(Define.Result.Init_NonUniformScale); + } + } + + return result; + } + + internal bool GenerateInitialization() + { + result.SetProcess(); + + // ‚·ƒŞ‚˘ƒİ‚¤‚şƒ‡ƒĵ‚ż(1)ĉ¤œè¨ĵ + if (cloth.SerializeData.IsValid() == false) + { + if (cloth.SerializeData.VerificationResult == Define.Result.Empty) + result.SetError(Define.Result.CreateCloth_InvalidSerializeData); + else + result.SetError(cloth.SerializeData.VerificationResult); + return false; + } + cloth.SerializeData.DataValidate(); + cloth.serializeData2.DataValidate(); + + // ċˆĉœŸċŒ–ċŸèĦŒ + Init(); + if (result.IsError()) + return false; + + return true; + } + + internal bool GenerateBoneClothSelection() + { + // ‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚żĉ§‹ç݉ + var setupData = boneClothSetupData; + int tcnt = setupData.skinBoneCount; // ƒ‘ƒĵƒ†‚£‚ŻƒĞƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ç·ĉ•° + var selectionData = new SelectionData(tcnt); + for (int i = 0; i < tcnt; i++) + { + float3 lpos = math.transform(setupData.initRenderWorldtoLocal, setupData.transformPositions[i]); + selectionData.positions[i] = lpos; + selectionData.attributes[i] = VertexAttribute.Move; // ç§ğċ‹•§ċˆĉœŸċŒ– + } + + // ĉœ€ċ¤§ĉŽçĥšè·é›˘ + float maxLength = 0; + for (int i = 0; i < tcnt; i++) + { + int pi = setupData.GetParentTransformIndex(i, true); + if (pi >= 0) + { + float length = math.distance(selectionData.positions[i], selectionData.positions[pi]); + maxLength = math.max(maxLength, length); + } + } + selectionData.maxConnectionDistance = maxLength; + + // ƒĞƒĵƒˆ‚’ċ›şċšĞ設ċš + foreach (var rt in cloth.SerializeData.rootBones) + { + if (rt) + { + int index = setupData.GetTransformIndexFromId(rt.GetMagicaId()); + selectionData.attributes[index] = VertexAttribute.Fixed; + } + } + + selectionData.userEdit = true; // ċżµŸ‚ + cloth.GetSerializeData2().selectionData = selectionData; + + return true; + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothProcessGeneration.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothProcessGeneration.cs.meta new file mode 100644 index 00000000..eca99bf7 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothProcessGeneration.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 31501f387a912624eb66d16ddab79f29 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Cloth/ClothProcessGeneration.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothSerializeData.cs b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothSerializeData.cs new file mode 100644 index 00000000..1d8cf9ad --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothSerializeData.cs @@ -0,0 +1,278 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System.Collections.Generic; +using Unity.Mathematics; +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// Serialize data (1) + /// Contains all parameters that can be changed during execution. + /// The part that can be exported externally as Json. + /// + [System.Serializable] + public partial class ClothSerializeData + { + /// + /// simulation type. + /// [NG] Runtime changes. + /// [NG] Export/Import with Presets + /// + public ClothProcess.ClothType clothType = ClothProcess.ClothType.MeshCloth; + + /// + /// Renderer list used in MeshCloth. + /// [NG] Runtime changes. + /// [NG] Export/Import with Presets + /// + public List sourceRenderers = new List(); + + /// + /// Write target to mesh in MeshCloth. + /// [OK] Runtime changes. + /// [NG] Export/Import with Presets + /// + public ClothMeshWriteMode meshWriteMode = ClothMeshWriteMode.PositionAndNormal; + + public enum PaintMode + { + Manual = 0, + + [InspectorName("Texture Fixed(RD) Move(GR) Ignore(BK)")] + Texture_Fixed_Move = 1, + + [InspectorName("Texture Fixed(RD) Move(GR) Limit(BL) Ignore(BK)")] + Texture_Fixed_Move_Limit = 2, + } + + /// + /// vertex paint mode. + /// [NG] Runtime changes. + /// [NG] Export/Import with Presets + /// + public PaintMode paintMode = PaintMode.Manual; + + /// + /// texture for painting. + /// Sync to sourceRenderers. + /// [NG] Runtime changes. + /// [NG] Export/Import with Presets + /// + public List paintMaps = new List(); + + /// + /// The UV channel that references the paint map. + /// [NG] Runtime changes. + /// [NG] Export/Import with Presets + /// + [Range(0, 7)] + public int paintMapUvChannel = 0; + + /// + /// Root bone list used in BoneCloth. + /// [NG] Runtime changes. + /// [NG] Export/Import with Presets + /// + public List rootBones = new List(); + + /// + /// BoneCloth connection method. + /// [NG] Runtime changes. + /// [NG] Export/Import with Presets + /// + public RenderSetupData.BoneConnectionMode connectionMode = RenderSetupData.BoneConnectionMode.Line; + + /// + /// Transform rotation interpolation rate in BoneCloth.(0.0 ~ 1.0) + /// (0.0=parent-based, 0.5=middle, 1.0=child-based) + /// [OK] Runtime changes. + /// [NG] Export/Import with Presets + /// + [Range(0.0f, 1.0f)] + public float rotationalInterpolation = 0.5f; + + /// + /// Rotation interpolation rate of Root Transform in BoneCloth.(0.0 ~ 1.0) + /// (0.0=does not rotate, 0.5=middle, 1.0=child-based) + /// [OK] Runtime changes. + /// [NG] Export/Import with Presets + /// + [Range(0.0f, 1.0f)] + public float rootRotation = 0.5f; + + /// + /// Set the update timing. + /// [OK] Runtime changes. + /// [NG] Export/Import with Presets + /// + public ClothUpdateMode updateMode = ClothUpdateMode.AnimatorLinkage; + + /// + /// Set the disable mode. + /// Component inactive behavior. + /// [OK] Runtime changes. + /// [NG] Export/Import with Presets + /// + public ClothDisableMode disableMode = ClothDisableMode.Reset; + + /// + /// Blend ratio between initial pose and animation pose. + /// [OK] Runtime changes. + /// [NG] Export/Import with Presets + /// + [Range(0.0f, 1.0f)] + public float animationPoseRatio = 0.0f; + + /// + /// vertex reduction parameters. + /// + public ReductionSettings reductionSetting = new ReductionSettings(); + + /// + /// custom skinning parameters. + /// + public CustomSkinningSettings customSkinningSetting = new CustomSkinningSettings(); + + /// + /// Normal definition. + /// + public NormalAlignmentSettings normalAlignmentSetting = new NormalAlignmentSettings(); + + /// + /// culling settings. + /// + public CullingSettings cullingSettings = new CullingSettings(); + + /// + /// axis to use as normal. + /// [OK] Runtime changes. + /// [NG] Export/Import with Presets + /// + public ClothNormalAxis normalAxis = ClothNormalAxis.Up; + + /// + /// Gravity. + /// [OK] Runtime changes. + /// [OK] Export/Import with Presets + /// + [Range(0.0f, 10.0f)] + public float gravity = 5.0f; + + /// + /// Gravity world direction. + /// [OK] Runtime changes. + /// [OK] Export/Import with Presets + /// + public float3 gravityDirection = new float3(0, -1, 0); + + /// + /// ċˆĉœŸċ§żċ‹˘§é‡ċŠ›ĉ¸›èĦ°çއ(0.0 ~ 1.0) + /// 1.0Ğ™‚‹“¨§ċˆĉœŸċ§żċ‹˘§Żé‡ċŠ›äż‚ĉ•°ŒïĵĞŞ‚‹€‚ + /// 0.0§Żċ¸¸Ğİċ§żċ‹˘§‚‚重ċŠ›Œ100%発生™‚‹€‚ + /// + /// Attenuation rate of gravity at initial pose (0.0 ~ 1.0) + /// By setting it to 1.0, the gravity coefficient becomes 0 in the initial posture. + /// At 0.0, gravity is always 100% in any pose. + /// + /// [OK] Runtime changes. + /// [OK] Export/Import with Presets + /// + [Range(0.0f, 1.0f)] + public float gravityFalloff = 0.0f; + + /// + /// ƒŞ‚ğƒƒƒˆċŒé€ŸċşĤċ‰ċšċŒ–ĉ™‚é–“(s) + /// ĉ€ĉż€Şé€ŸċşĤċ¤‰ċŒ–‚’ĉŠ‘ˆ™€‚ + /// + /// Speed stabilization time after reset (s). + /// Avoid sudden speed changes. + /// + /// [OK] Runtime changes. + /// [NG] Export/Import with Presets + /// + [Range(0.0f, 1.0f)] + public float stablizationTimeAfterReset = 0.1f; + + /// + /// ċ…ƒċ§żċ‹˘¨‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³çµĉžœƒ–ƒĴƒ³ƒ‰ċ‰²ċˆ(0.0 ~ 1.0) + /// + /// Blend ratio of original posture and simulation result (0.0 ~ 1.0). + /// + /// [OK] Runtime changes. + /// [NG] Export/Import with Presets + /// + [Range(0.0f, 1.0f)] + public float blendWeight = 1.0f; + + /// + /// air resistance. + /// [OK] Runtime changes. + /// [OK] Export/Import with Presets + /// + public CurveSerializeData damping = new CurveSerializeData(0.05f); + + /// + /// Particle radius. + /// [OK] Runtime changes. + /// [OK] Export/Import with Presets + /// + public CurveSerializeData radius = new CurveSerializeData(0.02f); + + /// + /// Inertia. + /// + public InertiaConstraint.SerializeData inertiaConstraint = new InertiaConstraint.SerializeData(); + + /// + /// Tether. + /// + public TetherConstraint.SerializeData tetherConstraint = new TetherConstraint.SerializeData(); + + /// + /// Distance restoration. + /// + public DistanceConstraint.SerializeData distanceConstraint = new DistanceConstraint.SerializeData(); + + /// + /// Triangle bending / volume. + /// + public TriangleBendingConstraint.SerializeData triangleBendingConstraint = new TriangleBendingConstraint.SerializeData(); + + /// + /// Angle restoration. + /// + public AngleConstraint.RestorationSerializeData angleRestorationConstraint = new AngleConstraint.RestorationSerializeData(); + + /// + /// Angle Limit. + /// + public AngleConstraint.LimitSerializeData angleLimitConstraint = new AngleConstraint.LimitSerializeData(); + + /// + /// Max distance / Backstop + /// + public MotionConstraint.SerializeData motionConstraint = new MotionConstraint.SerializeData(); + + /// + /// Collider collision. + /// + public ColliderCollisionConstraint.SerializeData colliderCollisionConstraint = new ColliderCollisionConstraint.SerializeData(); + + /// + /// Self collision + /// + public SelfCollisionConstraint.SerializeData selfCollisionConstraint = new SelfCollisionConstraint.SerializeData(); + + /// + /// Wind + /// + public WindSettings wind = new WindSettings(); + + /// + /// Spring + /// + public SpringConstraint.SerializeData springConstraint = new SpringConstraint.SerializeData(); + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothSerializeData.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothSerializeData.cs.meta new file mode 100644 index 00000000..15d8d5fe --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothSerializeData.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: ffd56578b2bf3574b91062060c05a6c2 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Cloth/ClothSerializeData.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothSerializeData2.cs b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothSerializeData2.cs new file mode 100644 index 00000000..9fec43e0 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothSerializeData2.cs @@ -0,0 +1,94 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System.Collections.Generic; +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// Serialize data (2) + /// Parts that cannot be exported externally. + /// + [System.Serializable] + public class ClothSerializeData2 : IDataValidate, IValid, ITransform + { + /// + /// Initialization Data. + /// + [SerializeField] + public ClothInitSerializeData initData = new ClothInitSerializeData(); + + /// + /// 頂ç‚ıƒš‚¤ƒ³ƒˆƒ‡ƒĵ‚ż + /// vertex paint data. + /// + [SerializeField] + public SelectionData selectionData = new SelectionData(); + + /// + /// Transform¨é ‚ç‚ıċħžĉ€§èžĉ›¸ƒ‡ƒĵ‚ż + /// ċŸèĦŒĉ™‚§BoneCloth/BoneSpring作ĉˆĉ™‚ĞŻ“èžĉ›¸ĞTransform¨é ‚ç‚ıċħžĉ€§ƒš‚˘‚’ĉ ĵ納™‚‹“¨§é ‚ç‚ıƒš‚¤ƒ³ƒˆƒ‡ƒĵ‚żä𣂏‚ŠĞ™‚‹“¨Œ§™€‚ + /// Transform and vertex attribute dictionary data. + /// When creating BoneCloth/BoneSpring at runtime, you can store Transform and vertex attribute pairs in this dictionary and use it instead of vertex paint data. + /// + [System.NonSerialized] + public Dictionary boneAttributeDict = new Dictionary(); + + /// + /// RendererĞċŻċżœ™‚‹é ‚ç‚ıċħžĉ€§ƒ‡ƒĵ‚ż + /// ċŸèĦŒĉ™‚ĞMeshCloth‚’ĉ§‹ç݉™‚‹ċ ´ċˆĞ€“ƒŞ‚ıƒˆĞƒĴƒ³ƒ€ƒİƒĵ”¨ƒĦƒƒ‚·ƒé ‚ç‚ıĉ•°ċˆ†é ‚ç‚ıċħžĉ€§‚’ĉ ĵ納™‚‹“¨§‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚żä𣂏‚ŠĞ™‚‹“¨Œ§™ + /// Vertex attribute data corresponding to the Renderer. + /// When constructing MeshCloth at runtime, you can substitute selection data by storing vertex attributes in this list for the number of mesh vertices per renderer. + /// + [System.NonSerialized] + public List vertexAttributeList = new List(); + + /// + /// PreBuild Data. + /// + public PreBuildSerializeData preBuildData = new PreBuildSerializeData(); + + //========================================================================================= + public ClothSerializeData2() + { + } + + /// + /// ‚Żƒ­‚ı‚’ĉ§‹ç݉™‚‹Ÿ‚ĉœ€ä½Žé™ĉƒ…ċ ħŒĉƒ£Ĥ„‚‹‹ƒ‚§ƒƒ‚݁™‚‹ + /// Check if you have the minimum information to construct the cloth. + /// + /// + public bool IsValid() + { + return true; + } + + public void DataValidate() + { + } + + /// + /// ‚¨ƒ‡‚£‚żƒĦƒƒ‚·ƒĉ›´ĉ–°‚’ċˆ¤ċš™‚‹Ÿ‚ƒƒƒ‚·ƒ‚³ƒĵƒ‰ + /// Hashcode for determining editor mesh updates. + /// + /// + public override int GetHashCode() + { + int hash = 0; + return hash; + } + + public void GetUsedTransform(HashSet transformSet) + { + initData.GetUsedTransform(transformSet); + preBuildData.GetUsedTransform(transformSet); + } + + public void ReplaceTransform(Dictionary replaceDict) + { + initData.ReplaceTransform(replaceDict); + preBuildData.ReplaceTransform(replaceDict); + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothSerializeData2.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothSerializeData2.cs.meta new file mode 100644 index 00000000..b1d233e1 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothSerializeData2.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 02e311e7737a90a43a9a3d615e6b436e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Cloth/ClothSerializeData2.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothSerializeDataFunction.cs b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothSerializeDataFunction.cs new file mode 100644 index 00000000..14484f5e --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothSerializeDataFunction.cs @@ -0,0 +1,448 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System; +using System.Collections.Generic; +using System.Linq; +using Unity.Mathematics; +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// Serialize data (1) + /// function part. + /// + public partial class ClothSerializeData : IDataValidate, IValid, ITransform + { + /// + /// ĉ¤œè¨ĵ結ĉžœ + /// Verification Results. + /// + ResultCode verificationResult; + public Define.Result VerificationResult => verificationResult.Result; + + + public ClothSerializeData() + { + } + + /// + /// ‚Żƒ­‚ı‚’ĉ§‹ç݉™‚‹Ÿ‚ĉœ€ä½Žé™ĉƒ…ċ ħŒĉƒ£Ĥ„‚‹‹ĉ¤œè¨ĵ™‚‹ + /// Check if you have the minimum information to construct the cloth. + /// + /// + public bool IsValid() + { + verificationResult.SetResult(Define.Result.Empty); // çİşƒ‡ƒĵ‚ż + + switch (clothType) + { + case ClothProcess.ClothType.BoneCloth: + case ClothProcess.ClothType.BoneSpring: + if (rootBones == null || rootBones.Count == 0) + return false; + if (rootBones.Count(x => x != null) == 0) + return false; + if (rootBones.Distinct().Count() != rootBones.Count) + { + verificationResult.SetError(Define.Result.SerializeData_DuplicateRootBone); + return false; + } + break; + case ClothProcess.ClothType.MeshCloth: + if (sourceRenderers == null || sourceRenderers.Count == 0) + return false; + if (sourceRenderers.Count(x => x != null) == 0) + return false; + + // ƒĴƒ³ƒ€ƒİƒĵĉœ€ċ¤§ĉ•° + if (sourceRenderers.Count > Define.System.MaxRendererCount) + { + verificationResult.SetError(Define.Result.SerializeData_Over31Renderers); + return false; + } + if (sourceRenderers.Distinct().Count() != sourceRenderers.Count) + { + verificationResult.SetError(Define.Result.SerializeData_DuplicateRenderer); + return false; + } + break; + default: + return false; + } + + verificationResult.SetSuccess(); + return true; + } + + public void DataValidate() + { + rotationalInterpolation = Mathf.Clamp01(rotationalInterpolation); + rootRotation = Mathf.Clamp01(rootRotation); + animationPoseRatio = Mathf.Clamp01(animationPoseRatio); + + reductionSetting.DataValidate(); + customSkinningSetting.DataValidate(); + normalAlignmentSetting.DataValidate(); + cullingSettings.DataValidate(); + + gravity = Mathf.Clamp(gravity, 0.0f, 20.0f); + if (math.length(gravityDirection) > Define.System.Epsilon) + gravityDirection = math.normalize(gravityDirection); + else + gravityDirection = 0; + gravityFalloff = Mathf.Clamp01(gravityFalloff); + stablizationTimeAfterReset = Mathf.Clamp01(stablizationTimeAfterReset); + blendWeight = Mathf.Clamp01(blendWeight); + + damping.DataValidate(0.0f, 1.0f); + radius.DataValidate(0.001f, 1.0f); + inertiaConstraint.DataValidate(); + tetherConstraint.DataValidate(); + distanceConstraint.DataValidate(); + triangleBendingConstraint.DataValidate(); + angleRestorationConstraint.DataValidate(); + angleLimitConstraint.DataValidate(); + motionConstraint.DataValidate(); + colliderCollisionConstraint.DataValidate(); + selfCollisionConstraint.DataValidate(); + wind.DataValidate(); + } + + /// + /// ‚¨ƒ‡‚£‚żƒĦƒƒ‚·ƒĉ›´ĉ–°‚’ċˆ¤ċš™‚‹Ÿ‚ƒƒƒ‚·ƒ‚³ƒĵƒ‰ + /// Hashcode for determining editor mesh updates. + /// + /// + public override int GetHashCode() + { + const int NullHash = -3910836; + + int hash = 0; + hash += (int)clothType; + foreach (var ren in sourceRenderers) + hash += ren != null ? ren.GetMagicaId().GetHashCode() : NullHash; + foreach (var t in rootBones) + { + var stack = new Stack(30); + stack.Push(t); + while (stack.Count > 0) + { + var t2 = stack.Pop(); + if (t2 == null) + { + hash += NullHash; + continue; + } + hash += t2.GetMagicaId().GetHashCode(); + hash += t2.localPosition.GetHashCode(); + hash += t2.localRotation.GetHashCode(); + int cnt = t2.childCount; + for (int i = 0; i < cnt; i++) + stack.Push(t2.GetChild(i)); + } + } + hash += (int)connectionMode * 10; + hash += reductionSetting.GetHashCode(); + hash += customSkinningSetting.GetHashCode(); + hash += normalAlignmentSetting.GetHashCode(); + hash += cullingSettings.GetHashCode(); + hash += (int)paintMode; + foreach (var map in paintMaps) + { + if (map) + { + hash += map.GetMagicaId().GetHashCode(); + hash += map.isReadable ? 1 : 0; + } + } + hash += paintMapUvChannel * 123; + hash += colliderCollisionConstraint.GetHashCode(); + + return hash; + } + + /// + /// ‚¸ƒ§ƒ–§ċ‚ç…§™‚‹ĉ§‹é€ ä½“Ğċ¤‰ĉ›—Ĥèż”™ + /// Convert to a structure to be referenced in the job and return. + /// + /// + public ClothParameters GetClothParameters() + { + var cparams = new ClothParameters(); + + //cparams.solverFrequency = Define.System.SolverFrequency; + cparams.gravity = clothType == ClothProcess.ClothType.BoneSpring ? 0.0f : gravity; // BoneSpring has no gravity. + cparams.worldGravityDirection = gravityDirection; + cparams.gravityFalloff = gravityFalloff; + cparams.stablizationTimeAfterReset = stablizationTimeAfterReset; + cparams.blendWeight = blendWeight; + cparams.dampingCurveData = damping.ConvertFloatArray() * 0.2f; // 20% + cparams.radiusCurveData = radius.ConvertFloatArray(); + cparams.normalAxis = normalAxis; + + cparams.rotationalInterpolation = rotationalInterpolation; + cparams.rootRotation = rootRotation; + + cparams.culling.Convert(cullingSettings); + cparams.inertiaConstraint.Convert(inertiaConstraint); + cparams.tetherConstraint.Convert(tetherConstraint, clothType); + cparams.distanceConstraint.Convert(distanceConstraint, clothType); + cparams.triangleBendingConstraint.Convert(triangleBendingConstraint); + cparams.angleConstraint.Convert(angleRestorationConstraint, angleLimitConstraint); + cparams.motionConstraint.Convert(motionConstraint, clothType); + cparams.colliderCollisionConstraint.Convert(colliderCollisionConstraint, clothType); + cparams.selfCollisionConstraint.Convert(selfCollisionConstraint, clothType); + cparams.wind.Convert(wind, clothType); + cparams.springConstraint.Convert(springConstraint, clothType); + + return cparams; + } + + class TempBuffer + { + ClothProcess.ClothType clothType; + List sourceRenderers; + ClothMeshWriteMode meshWriteMode; + PaintMode paintMode; + List paintMaps; + int paintMapUvChannel; + List rootBones; + RenderSetupData.BoneConnectionMode connectionMode; + float rotationalInterpolation; + float rootRotation; + ClothUpdateMode updateMode; + ClothDisableMode disableMode; + float animationPoseRatio; + ReductionSettings reductionSetting; + CustomSkinningSettings customSkinningSetting; + NormalAlignmentSettings normalAlignmentSetting; + ClothNormalAxis normalAxis; + List colliderList; + List collisionBones; + MagicaCloth synchronization; + float stablizationTimeAfterReset; + float blendWeight; + CullingSettings cullingSetting; + Transform anchor; + float anchorInertia; + + internal TempBuffer(ClothSerializeData sdata) + { + Push(sdata); + } + + internal void Push(ClothSerializeData sdata) + { + clothType = sdata.clothType; + sourceRenderers = new List(sdata.sourceRenderers); + meshWriteMode = sdata.meshWriteMode; + paintMode = sdata.paintMode; + paintMaps = new List(sdata.paintMaps); + paintMapUvChannel = sdata.paintMapUvChannel; + rootBones = new List(sdata.rootBones); + connectionMode = sdata.connectionMode; + rotationalInterpolation = sdata.rotationalInterpolation; + rootRotation = sdata.rootRotation; + updateMode = sdata.updateMode; + disableMode = sdata.disableMode; + animationPoseRatio = sdata.animationPoseRatio; + reductionSetting = sdata.reductionSetting.Clone(); + customSkinningSetting = sdata.customSkinningSetting.Clone(); + normalAlignmentSetting = sdata.normalAlignmentSetting.Clone(); + normalAxis = sdata.normalAxis; + colliderList = new List(sdata.colliderCollisionConstraint.colliderList); + collisionBones = new List(sdata.colliderCollisionConstraint.collisionBones); + synchronization = sdata.selfCollisionConstraint.syncPartner; + stablizationTimeAfterReset = sdata.stablizationTimeAfterReset; + blendWeight = sdata.blendWeight; + cullingSetting = sdata.cullingSettings.Clone(); + anchor = sdata.inertiaConstraint.anchor; + anchorInertia = sdata.inertiaConstraint.anchorInertia; + } + + internal void Pop(ClothSerializeData sdata) + { + sdata.clothType = clothType; + sdata.sourceRenderers = sourceRenderers; + sdata.meshWriteMode = meshWriteMode; + sdata.paintMode = paintMode; + sdata.paintMaps = paintMaps; + sdata.paintMapUvChannel = paintMapUvChannel; + sdata.rootBones = rootBones; + sdata.connectionMode = connectionMode; + sdata.rotationalInterpolation = rotationalInterpolation; + sdata.rootRotation = rootRotation; + sdata.updateMode = updateMode; + sdata.disableMode = disableMode; + sdata.animationPoseRatio = animationPoseRatio; + sdata.reductionSetting = reductionSetting; + sdata.customSkinningSetting = customSkinningSetting; + sdata.normalAlignmentSetting = normalAlignmentSetting; + sdata.normalAxis = normalAxis; + sdata.colliderCollisionConstraint.colliderList = colliderList; + sdata.colliderCollisionConstraint.collisionBones = collisionBones; + sdata.selfCollisionConstraint.syncPartner = synchronization; + sdata.stablizationTimeAfterReset = stablizationTimeAfterReset; + sdata.blendWeight = blendWeight; + sdata.cullingSettings = cullingSetting; + sdata.inertiaConstraint.anchor = anchor; + sdata.inertiaConstraint.anchorInertia = anchorInertia; + } + } + + /// + /// ƒ‘ƒİƒĦƒĵ‚ż‚’Json¸‚¨‚Ż‚ıƒƒĵƒˆ™‚‹ + /// Export parameters to Json. + /// + /// + public string ExportJson() + { + return JsonUtility.ToJson(this); + } + + /// + /// ƒ‘ƒİƒĦƒĵ‚ż‚’Json‹‚‰‚¤ƒ³ƒƒĵƒˆ™‚‹ + /// Parameterƒ–ƒ­ƒƒ‚݁ċ€¤ċž‹żŒ‚¤ƒ³ƒƒĵƒˆ•‚Œ‚‹ + /// Import parameters from Json. + /// Only value types of Parameter blocks are imported. + /// + /// + /// + public bool ImportJson(string json) + { + try + { + // 上ĉ›¸—Ş„ƒ—ƒ­ƒ‘ƒ†‚£‚’保ĉŒ + var temp = new TempBuffer(this); + + // Import + JsonUtility.FromJsonOverwrite(json, this); + + // 上ĉ›¸—Ş„ƒ—ƒ­ƒ‘ƒ†‚£‚’ĉ›¸ĉˆğ— + temp.Pop(this); + + // ĉ¤œè¨ĵ + DataValidate(); + + return true; + } + catch (Exception e) + { + Debug.LogException(e); + return false; + } + } + + /// + /// ċˆ‚·ƒŞ‚˘ƒİ‚¤‚şƒ‡ƒĵ‚ż‹‚‰‚¤ƒ³ƒƒĵƒˆ™‚‹ + /// Import from another serialized data. + /// + /// + /// true = Copy all, false = parameter only + public void Import(ClothSerializeData sdata, bool deepCopy = false) + { + TempBuffer temp = deepCopy ? null : new TempBuffer(this); + + if (deepCopy) + { + clothType = sdata.clothType; + sourceRenderers = new List(sdata.sourceRenderers); + paintMode = sdata.paintMode; + paintMaps = new List(sdata.paintMaps); + paintMapUvChannel = sdata.paintMapUvChannel; + rootBones = new List(sdata.rootBones); + connectionMode = sdata.connectionMode; + rotationalInterpolation = sdata.rotationalInterpolation; + rootRotation = sdata.rootRotation; + updateMode = sdata.updateMode; + disableMode = sdata.disableMode; + animationPoseRatio = sdata.animationPoseRatio; + reductionSetting = sdata.reductionSetting.Clone(); + customSkinningSetting = sdata.customSkinningSetting.Clone(); + normalAlignmentSetting = sdata.normalAlignmentSetting.Clone(); + normalAxis = sdata.normalAxis; + stablizationTimeAfterReset = sdata.stablizationTimeAfterReset; + blendWeight = sdata.blendWeight; + cullingSettings = sdata.cullingSettings.Clone(); + } + + // parameters + gravity = sdata.gravity; + gravityDirection = sdata.gravityDirection; + gravityFalloff = sdata.gravityFalloff; + damping = sdata.damping.Clone(); + radius = sdata.radius.Clone(); + inertiaConstraint = sdata.inertiaConstraint.Clone(); + tetherConstraint = sdata.tetherConstraint.Clone(); + distanceConstraint = sdata.distanceConstraint.Clone(); + triangleBendingConstraint = sdata.triangleBendingConstraint.Clone(); + angleRestorationConstraint = sdata.angleRestorationConstraint.Clone(); + angleLimitConstraint = sdata.angleLimitConstraint.Clone(); + motionConstraint = sdata.motionConstraint.Clone(); + colliderCollisionConstraint = sdata.colliderCollisionConstraint.Clone(); + selfCollisionConstraint = sdata.selfCollisionConstraint.Clone(); + wind = sdata.wind.Clone(); + + if (deepCopy == false) + temp.Pop(this); + } + + /// + /// ċˆ‚Żƒ­‚ı‚³ƒ³ƒƒĵƒƒ³ƒˆ‹‚‰‚¤ƒ³ƒƒĵƒˆ™‚‹ + /// Import from another cloth component. + /// + /// + /// + public void Import(MagicaCloth src, bool deepCopy = false) + { + Import(src.SerializeData, deepCopy); + } + + public void GetUsedTransform(HashSet transformSet) + { + foreach (var t in rootBones) + { + if (t) + transformSet.Add(t); + } + customSkinningSetting.GetUsedTransform(transformSet); + normalAlignmentSetting.GetUsedTransform(transformSet); + colliderCollisionConstraint.GetUsedTransform(transformSet); + } + + public void ReplaceTransform(Dictionary replaceDict) + { + for (int i = 0; i < rootBones.Count; i++) + { + var t = rootBones[i]; + if (t && replaceDict.ContainsKey(t.GetMagicaId())) + { + rootBones[i] = replaceDict[t.GetMagicaId()]; + } + } + customSkinningSetting.ReplaceTransform(replaceDict); + normalAlignmentSetting.ReplaceTransform(replaceDict); + colliderCollisionConstraint.ReplaceTransform(replaceDict); + } + + /// + /// BoneSpringċˆ¤ċš + /// + /// + public bool IsBoneSpring() => clothType == ClothProcess.ClothType.BoneSpring; + + public int GetUvChannel() + { + switch (paintMode) + { + case PaintMode.Texture_Fixed_Move: + case PaintMode.Texture_Fixed_Move_Limit: + return paintMapUvChannel; + default: + return 0; + } + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothSerializeDataFunction.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothSerializeDataFunction.cs.meta new file mode 100644 index 00000000..6b2cfa22 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothSerializeDataFunction.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 8ef74f0c0b959154991c96c397b2ad52 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Cloth/ClothSerializeDataFunction.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothUpdateMode.cs b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothUpdateMode.cs new file mode 100644 index 00000000..111d9366 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothUpdateMode.cs @@ -0,0 +1,36 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp + +namespace MagicaCloth2 +{ + /// + /// Simulation Update Mode + /// + public enum ClothUpdateMode + { + /// + /// This mode assumes that normal Update() will perform the move and animation. + /// + Normal = 0, + + /// + /// This mode assumes that FixedUpdate() is used to perform movement and animation. + /// + UnityPhysics = 1, + + /// + /// Updates are independent of Unity's Time.timeScale. + /// + Unscaled = 2, + + /// + /// Automatically set from linked animator. + /// 連ċ‹•‚˘ƒ‹ƒĦƒĵ‚żƒĵ‹‚‰è‡Şċ‹•設ċš™‚‹ + /// - Animator.UpdateMode.Normal -> Normal + /// - Animator.UpdateMode.AnimatePhysics -> UnityPhysics + /// - Animator.UpdateMode.UnscaledTime -> Unscaled + /// + AnimatorLinkage = 10, + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothUpdateMode.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothUpdateMode.cs.meta new file mode 100644 index 00000000..ad0880e7 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/ClothUpdateMode.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 1377357dedc9a3344b49a8aa397d220d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Cloth/ClothUpdateMode.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/Collider.meta b/Assets/MagicaCloth2/Scripts/Core/Cloth/Collider.meta new file mode 100644 index 00000000..548e8a66 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/Collider.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 40021b99aa72bb340a13cdf419aa3226 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/Collider/ColliderComponent.cs b/Assets/MagicaCloth2/Scripts/Core/Cloth/Collider/ColliderComponent.cs new file mode 100644 index 00000000..6a70d2c8 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/Collider/ColliderComponent.cs @@ -0,0 +1,434 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System.Collections.Generic; +using System.Linq; +using UnityEngine; + +namespace MagicaCloth2 +{ + public abstract class ColliderComponent : ClothBehaviour, IDataValidate, ITransform + { + /// + /// ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ‹‚‰ä¸­ċżƒƒ­ƒĵ‚ЃЂރ•‚ğƒƒƒˆ + /// Center local offset from transform. + /// + public Vector3 center; + + /// + /// Size + /// Sphere(x:radius) + /// Capsule(x:start radius, y:end radius, z:length) + /// Box(x:size x, y:size y, z:size z) + /// + [SerializeField] + protected Vector3 size; + + /// + /// ‚·ƒ³ƒĦƒˆƒŞƒĵƒ˘ƒĵƒ‰ + /// Symmetry mode. + /// + public ColliderSymmetryMode symmetryMode = ColliderSymmetryMode.None; + + /// + /// ‚·ƒ³ƒĦƒˆƒŞƒĵĉŽçĥšċŻèħĦ + /// Symmetry connection target. + /// + public Transform symmetryTarget = null; + + //========================================================================================= + /// + /// Collider type. + /// + /// + public abstract ColliderManager.ColliderType GetColliderType(); + + /// + /// ƒ‘ƒİƒĦƒĵ‚żĉ¤œè¨ĵ + /// + public abstract void DataValidate(); + + //========================================================================================= + /// + /// ç™ğ録ƒƒĵƒ  + /// + private HashSet teamIdSet = new HashSet(); + + /// + /// çċœ¨ç™ğ録中‚·ƒ³ƒĦƒˆƒŞƒĵƒ˘ƒĵƒ‰ + /// + public ColliderSymmetryMode? ActiveSymmetryMode { get; private set; } = null; + + /// + /// çċœ¨ç™ğ録中‚·ƒ³ƒĦƒˆƒŞƒĵ‚żƒĵ‚²ƒƒƒˆ + /// + public Transform ActiveSymmetryTarget { get; private set; } + + //========================================================================================= + /// + /// Get collider size. + /// + /// Sphere(x:radius) + /// Capsule(x:start radius, y:end radius, z:length) + /// Box(x:size x, y:size y, z:size z) + /// + /// + /// + public virtual Vector3 GetSize() => size; + + public void SetSize(Vector3 size) => this.size = size; + + public void SetSizeX(float size) => this.size.x = size; + public void SetSizeY(float size) => this.size.y = size; + public void SetSizeZ(float size) => this.size.z = size; + + /// + /// ‚ı‚ħƒĵƒĞċ€¤‚’ċ–ċ— + /// + /// + public virtual float GetScale() + { + // Xè𸁁ż‚’èĤ‹‚‹ + return transform.lossyScale.x; + } + + /// + /// ĉ–ıċ‘é€†èğ˘ïĵˆċŸşĉœĴ的Ğ‚Ѓ—‚ğƒĞ‚³ƒİ‚¤ƒ€ƒĵ用ïĵ‰ + /// + /// + public virtual bool IsReverseDirection() => false; + + /// + /// ƒƒĵƒ ¸‚³ƒİ‚¤ƒ€ƒĵç™ğéŒ²é€šçŸ + /// + /// + internal void Register(int teamId) + { + teamIdSet.Add(teamId); + } + + /// + /// ƒƒĵƒ ‹‚‰‚³ƒİ‚¤ƒ€ƒĵè§£é™¤é€šçŸ + /// + /// + /// ċˆİ用者ïĵŞ‚‰true + internal bool Exit(int teamId) + { + teamIdSet.Remove(teamId); + return teamIdSet.Count == 0; + } + + /// + /// ƒ‘ƒİƒĦƒĵ‚żċĉ˜  + /// ™§ĞċŸèĦŒçŠĥĉ…‹ċ ´ċˆŻ“é–˘ĉ•°‚’ċ‘ĵ³ċ‡ş•Ş„¨ƒ—ƒ­ƒ‘ƒ†‚£ċ¤‰ĉ›´Œċĉ˜ •‚Œ›‚“€‚ + /// Reflection of parameters. + /// If it is already running, property changes will not be reflected unless this function is called. + /// + public void UpdateParameters() + { + // ƒ‘ƒİƒĦƒĵ‚żĉ¤œè¨ĵ + DataValidate(); + + // Symmetryĉ›´ĉ–° + // ‚·ƒ³ƒĦƒˆƒŞƒĵŻċ‰Šé™¤‚‚—Żèż½ċŠ Œ‚‚‹€‚ŸTransformŒċ¤‰ĉ›´•‚Œ‚‹ċ ´ċˆ‚‚‚‚‹ + var oldActiveSymmetryMode = ActiveSymmetryMode; + var oldActiveSymmetryTarget = ActiveSymmetryTarget; + SetActiveSymmetryMode(firstOnly: false); // ĉœ€ĉ–°çŠĥĉ…‹Ğĉ›´ĉ–° + bool changeSymmetry = oldActiveSymmetryMode != ActiveSymmetryMode || oldActiveSymmetryTarget != ActiveSymmetryTarget; + + // ċĉ˜  + foreach (int teamId in teamIdSet) + { + MagicaManager.Collider.UpdateParameters(this, teamId, changeSymmetry); + } + } + + /// + /// çċœ¨çŠĥĉ…‹‹‚‰éİċˆ‡Ş‚·ƒ³ƒĦƒˆƒŞƒĵƒ˘ƒĵƒ‰¨‚żƒĵ‚²ƒƒƒˆTransform‚’計痁—Ĥèż”™ + /// + /// + public ColliderSymmetryMode CalcSymmetryMode(out Transform symmetryParent) + { + symmetryParent = symmetryTarget; + + // èĤŞ + var parent = transform.parent; + if (parent == null) + return ColliderSymmetryMode.None; + + switch (symmetryMode) + { + case ColliderSymmetryMode.None: + return ColliderSymmetryMode.None; + case ColliderSymmetryMode.AutomaticHumanBody: + case ColliderSymmetryMode.AutomaticTarget: + break; + case ColliderSymmetryMode.X_Symmetry: + case ColliderSymmetryMode.Y_Symmetry: + case ColliderSymmetryMode.Z_Symmetry: + case ColliderSymmetryMode.XYZ_Symmetry: + // ‚żƒĵ‚²ƒƒƒˆnullċ ´ċˆŻèĤŞ + if (symmetryParent == null) + symmetryParent = parent; + return symmetryMode; + default: + Develop.LogError("Unknown symmetry mode."); + return ColliderSymmetryMode.None; + } + + // Automatic + Animator ani = symmetryMode == ColliderSymmetryMode.AutomaticHumanBody ? gameObject.GetComponentInParent(true) : null; + + // ċŻèħĦTransform + // Automatic§ŻSymmetryTargetŻç„ĦèĤ–•‚Œ‚‹ + var target = symmetryMode == ColliderSymmetryMode.AutomaticTarget ? symmetryTarget : null; + if (target == null && ani) + { + // è‡Şċ‹•ċˆ¤ċš + GetHumanoidSymmetryBone(ref target, parent, ani, HumanBodyBones.Hips, HumanBodyBones.Hips); + GetHumanoidSymmetryBone(ref target, parent, ani, HumanBodyBones.LeftUpperLeg, HumanBodyBones.RightUpperLeg); + GetHumanoidSymmetryBone(ref target, parent, ani, HumanBodyBones.RightUpperLeg, HumanBodyBones.LeftUpperLeg); + + GetHumanoidSymmetryBone(ref target, parent, ani, HumanBodyBones.LeftLowerLeg, HumanBodyBones.RightLowerLeg); + GetHumanoidSymmetryBone(ref target, parent, ani, HumanBodyBones.RightLowerLeg, HumanBodyBones.LeftLowerLeg); + + GetHumanoidSymmetryBone(ref target, parent, ani, HumanBodyBones.LeftFoot, HumanBodyBones.RightFoot); + GetHumanoidSymmetryBone(ref target, parent, ani, HumanBodyBones.RightFoot, HumanBodyBones.LeftFoot); + + GetHumanoidSymmetryBone(ref target, parent, ani, HumanBodyBones.Spine, HumanBodyBones.Spine); + GetHumanoidSymmetryBone(ref target, parent, ani, HumanBodyBones.Chest, HumanBodyBones.Chest); + GetHumanoidSymmetryBone(ref target, parent, ani, HumanBodyBones.Neck, HumanBodyBones.Neck); + GetHumanoidSymmetryBone(ref target, parent, ani, HumanBodyBones.Head, HumanBodyBones.Head); + + GetHumanoidSymmetryBone(ref target, parent, ani, HumanBodyBones.LeftShoulder, HumanBodyBones.RightShoulder); + GetHumanoidSymmetryBone(ref target, parent, ani, HumanBodyBones.RightShoulder, HumanBodyBones.LeftShoulder); + + GetHumanoidSymmetryBone(ref target, parent, ani, HumanBodyBones.LeftUpperArm, HumanBodyBones.RightUpperArm); + GetHumanoidSymmetryBone(ref target, parent, ani, HumanBodyBones.RightUpperArm, HumanBodyBones.LeftUpperArm); + + GetHumanoidSymmetryBone(ref target, parent, ani, HumanBodyBones.LeftLowerArm, HumanBodyBones.RightLowerArm); + GetHumanoidSymmetryBone(ref target, parent, ani, HumanBodyBones.RightLowerArm, HumanBodyBones.LeftLowerArm); + + GetHumanoidSymmetryBone(ref target, parent, ani, HumanBodyBones.LeftHand, HumanBodyBones.RightHand); + GetHumanoidSymmetryBone(ref target, parent, ani, HumanBodyBones.RightHand, HumanBodyBones.LeftHand); + + GetHumanoidSymmetryBone(ref target, parent, ani, HumanBodyBones.LeftToes, HumanBodyBones.RightToes); + GetHumanoidSymmetryBone(ref target, parent, ani, HumanBodyBones.RightToes, HumanBodyBones.LeftToes); + + GetHumanoidSymmetryBone(ref target, parent, ani, HumanBodyBones.Jaw, HumanBodyBones.Jaw); + GetHumanoidSymmetryBone(ref target, parent, ani, HumanBodyBones.UpperChest, HumanBodyBones.UpperChest); + } + if (target == null) + target = parent; + symmetryParent = target; + + // èĤށŒċŒä¸€‹İ†‹ + bool sameParent = target == parent; + + // ċ„èğ¸ + var x = parent.right; + var y = parent.up; + var z = parent.forward; + var sx = target.right; + var sy = target.up; + var sz = target.forward; + + // ƒ™‚ŻƒˆƒĞĉ–ıċ‘ĉ€§ĉƒ…ċ ħ + // AnimatorŒ‚‚‹ċ ´ċˆŻAnimator‹‚‰€Ş„ċ ´ċˆŻċ…ħ通èĤŞTransform‹‚‰€‚Œ§‚‚ç„Ħ„ċ ´ċˆŻƒŻƒĵƒĞƒ‰Xèğ¸ + Vector3 H = Vector3.right; + if (ani) + H = ani.transform.right; + else + { + var commonParent = FindCommonParent(transform, symmetryParent); + if (commonParent) + { + //Debug.Log($"Find common parent:{commonParent.name}"); + H = commonParent.right; + } + } + + float xdot = Mathf.Abs(Vector3.Dot(H, x)); + float ydot = Mathf.Abs(Vector3.Dot(H, y)); + float zdot = Mathf.Abs(Vector3.Dot(H, z)); + + bool xsign = Vector3.Dot(x, sx) >= 0.0f; + bool ysign = Vector3.Dot(y, sy) >= 0.0f; + bool zsign = Vector3.Dot(z, sz) >= 0.0f; + + if (xdot > ydot && xdot > zdot) + { + // (X) + if (sameParent) + return ColliderSymmetryMode.X_Symmetry; + if (Vector3.Dot(H, x) * Vector3.Dot(H, sx) > 0.0f) + { + if (ysign == false && zsign == false) + return ColliderSymmetryMode.XYZ_Symmetry; + else + return ColliderSymmetryMode.X_Symmetry; + } + else if (zsign) + return ColliderSymmetryMode.Y_Symmetry; + else + return ColliderSymmetryMode.Z_Symmetry; + } + else if (ydot > xdot && ydot > zdot) + { + // (Y) + if (sameParent) + return ColliderSymmetryMode.Y_Symmetry; + if (Vector3.Dot(H, y) * Vector3.Dot(H, sy) > 0.0f) + { + if (xsign == false && zsign == false) + return ColliderSymmetryMode.XYZ_Symmetry; + else + return ColliderSymmetryMode.Y_Symmetry; + } + else if (zsign) + return ColliderSymmetryMode.X_Symmetry; + else + return ColliderSymmetryMode.Z_Symmetry; + } + else + { + // (Z) + if (sameParent) + return ColliderSymmetryMode.Z_Symmetry; + if (Vector3.Dot(H, z) * Vector3.Dot(H, sz) > 0.0f) + { + if (xsign == false && ysign == false) + return ColliderSymmetryMode.XYZ_Symmetry; + else + return ColliderSymmetryMode.Z_Symmetry; + } + else if (xsign) + return ColliderSymmetryMode.Y_Symmetry; + else + return ColliderSymmetryMode.X_Symmetry; + } + } + + bool GetHumanoidSymmetryBone(ref Transform target, Transform parent, Animator ani, HumanBodyBones src, HumanBodyBones dst) + { + var bone = ani.GetBoneTransform(src); + if (bone && parent == bone) + { + var bone2 = ani.GetBoneTransform(dst); + if (bone2) + { + target = bone2; + return true; + } + } + + return false; + } + + /// + /// at/btċ…ħ通èĤŞ‚’èż”™€‚ç„Ħ„ċ ´ċˆŻnull€‚ + /// + /// + /// + /// + Transform FindCommonParent(Transform at, Transform bt) + { + if (at == null || bt == null) + return null; + + // ƒƒƒ‚·ƒ‚ğƒƒƒˆ§atèĤŞ‚’ĉ ĵ納 + var atParents = new HashSet(16); + Transform current = at; + while (current != null) + { + atParents.Add(current); + current = current.parent; + } + + // btèĤŞ‚’ƒ‚§ƒƒ‚Ż + current = bt; + while (current != null) + { + if (atParents.Contains(current)) + return current; + current = current.parent; + } + + return null; + } + + /// + /// çċœ¨‚·ƒ³ƒĦƒˆƒŞƒĵ設ċšĞċŸş„Ĥ€‚·ƒ³ƒĦƒˆƒŞƒĵƒ˘ƒĵƒ‰¨ċŻèħĦ‚’ĉħşċš™‚‹ + /// + internal void SetActiveSymmetryMode(bool firstOnly) + { + if (ActiveSymmetryMode.HasValue == false || firstOnly == false) + { + ActiveSymmetryMode = CalcSymmetryMode(out var target); + ActiveSymmetryTarget = target; + } + } + + public int UseTeamCount => teamIdSet.Count; + + //========================================================================================= + public void GetUsedTransform(HashSet transformSet) + { + if (symmetryTarget) + transformSet.Add(symmetryTarget); + } + + public void ReplaceTransform(Dictionary replaceDict) + { + if (symmetryTarget) + { + MagicaObjectId id = symmetryTarget.GetMagicaId(); + if (id.IsValid() && replaceDict.ContainsKey(id)) + symmetryTarget = replaceDict[id]; + } + } + + //========================================================================================= + protected virtual void Start() + { + SetActiveSymmetryMode(firstOnly: true); + } + + protected virtual void OnValidate() + { + UpdateParameters(); + } + + protected virtual void OnEnable() + { + // ‚³ƒİ‚¤ƒ€ƒĵ‚’ĉœ‰ċŠıĞ™‚‹ + foreach (int teamId in teamIdSet) + { + MagicaManager.Collider.EnableCollider(this, teamId, true); + } + } + + protected virtual void OnDisable() + { + // ‚³ƒİ‚¤ƒ€ƒĵ‚’ç„ĦċŠıĞ™‚‹ + foreach (int teamId in teamIdSet) + { + MagicaManager.Collider?.EnableCollider(this, teamId, false); + } + } + + protected virtual void OnDestroy() + { + // ‚³ƒİ‚¤ƒ€ƒĵ‚’ċ‰Šé™¤™‚‹ + if (teamIdSet.Count > 0) + { + var teamList = teamIdSet.ToList(); + foreach (int teamId in teamList) + { + MagicaManager.Collider?.RemoveCollider(this, teamId); + } + teamIdSet.Clear(); + } + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/Collider/ColliderComponent.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Cloth/Collider/ColliderComponent.cs.meta new file mode 100644 index 00000000..7a811223 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/Collider/ColliderComponent.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: ce7d80df3961a0449ba9ba73c0038b88 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Cloth/Collider/ColliderComponent.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/Collider/ColliderSymmetryMode.cs b/Assets/MagicaCloth2/Scripts/Core/Cloth/Collider/ColliderSymmetryMode.cs new file mode 100644 index 00000000..7be93a13 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/Collider/ColliderSymmetryMode.cs @@ -0,0 +1,52 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2025 MagicaSoft. +// https://magicasoft.jp +namespace MagicaCloth2 +{ + /// + /// ‚·ƒ³ƒĦƒˆƒŞƒĵƒ˘ƒĵƒ‰ + /// Symmetry mode. + /// + public enum ColliderSymmetryMode + { + None = 0, + + /// + /// äşşä½“éިĉ ĵ‚’ċ‚ç…§—™ıĤè‡Şċ‹•設ċš™‚‹ + /// ‚­ƒ£ƒİ‚Ż‚żƒĵĞAnimator‚³ƒ³ƒƒĵƒƒ³ƒˆŒċż…èĤ§™ + /// Automatically set everything based on the human skeleton. + /// Character must have an Animator component. + /// + AutomaticHumanBody = 1, + + /// + /// SymmetryTargetċ§żċ‹˘‹‚‰è‡Şċ‹•設ċš—™ + /// Automatically set based on the SymmetryTarget's posture. + /// + AutomaticTarget = 2, + + /// + /// Xè𸂒ċ·Ĥċ³ċŻç§° + /// Symmetry on the X axis. + /// + X_Symmetry = 100, + + /// + /// Yè𸂒ċ·Ĥċ³ċŻç§° + /// Symmetry on the Y axis. + /// + Y_Symmetry = 101, + + /// + /// Zè𸂒ċ·Ĥċ³ċŻç§° + /// Symmetry on the Z axis. + /// + Z_Symmetry = 102, + + /// + /// XYZè𸂒ċ·Ĥċ³ċŻç§° + /// Symmetry on the XYZ axis. + /// + XYZ_Symmetry = 200, + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/Collider/ColliderSymmetryMode.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Cloth/Collider/ColliderSymmetryMode.cs.meta new file mode 100644 index 00000000..a1fcc9d8 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/Collider/ColliderSymmetryMode.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 02f9b444838ae8a41916aab95109474e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Cloth/Collider/ColliderSymmetryMode.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/Collider/MagicaCapsuleCollider.cs b/Assets/MagicaCloth2/Scripts/Core/Cloth/Collider/MagicaCapsuleCollider.cs new file mode 100644 index 00000000..c832b499 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/Collider/MagicaCapsuleCollider.cs @@ -0,0 +1,132 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// Capsule‚³ƒİ‚¤ƒ€ƒĵ‚³ƒ³ƒƒĵƒƒ³ƒˆ + /// + [AddComponentMenu("MagicaCloth2/MagicaCapsuleCollider")] + [HelpURL("https://magicasoft.jp/en/mc2_capsulecollidercomponent/")] + public class MagicaCapsuleCollider : ColliderComponent + { + public enum Direction + { + [InspectorName("X-Axis")] + X = 0, + + [InspectorName("Y-Axis")] + Y = 1, + + [InspectorName("Z-Axis")] + Z = 2, + } + + /// + /// Reference transform axis. + /// + public Direction direction = Direction.X; + + /// + /// Reverse direction. + /// ĉ–ıċ‘‚’逆èğ˘•›‚‹ + /// + public bool reverseDirection = false; + + /// + /// ċŠċ„‚’Start/Endċˆ€…Ğ設ċš + /// Set radius separately for Start/End. + /// + public bool radiusSeparation = false; + + /// + /// 中ċ¤ĉƒˆ + /// Aligned on center. + /// + public bool alignedOnCenter = true; + + + public override ColliderManager.ColliderType GetColliderType() + { + if (direction == Direction.X) + return alignedOnCenter ? ColliderManager.ColliderType.CapsuleX_Center : ColliderManager.ColliderType.CapsuleX_Start; + else if (direction == Direction.Y) + return alignedOnCenter ? ColliderManager.ColliderType.CapsuleY_Center : ColliderManager.ColliderType.CapsuleY_Start; + else + return alignedOnCenter ? ColliderManager.ColliderType.CapsuleZ_Center : ColliderManager.ColliderType.CapsuleZ_Start; + } + + /// + /// set size. + /// + /// + /// + /// + public void SetSize(float startRadius, float endRadius, float length) + { + SetSize(new Vector3(startRadius, endRadius, length)); + radiusSeparation = startRadius != endRadius; + } + + /// + /// get size. + /// (x:start radius, y:end radius, z:length) + /// + /// + public override Vector3 GetSize() + { + if (radiusSeparation) + return size; + else + { + // (ċ§‹ç‚ıċŠċ„, 終ç‚ıċŠċ„, 長•) + return new Vector3(size.x, size.x, size.z); + } + } + + /// + /// ‚Ѓ—‚ğƒĞƒ­ƒĵ‚ЃĞĉ–ıċ‘‚’èż”™ + /// + /// + public Vector3 GetLocalDir() + { + float rev = reverseDirection ? -1 : 1; + + if (direction == Direction.X) + return Vector3.right * rev; + else if (direction == Direction.Y) + return Vector3.up * rev; + else + return Vector3.forward * rev; + } + + /// + /// ‚Ѓ—‚ğƒĞƒ­ƒĵ‚ЃĞ上ĉ–ıċ‘‚’èż”™ + /// + /// + public Vector3 GetLocalUp() + { + if (direction == Direction.X) + return Vector3.up; + else if (direction == Direction.Y) + return Vector3.forward; + else + return Vector3.up; + } + + /// + /// ĉ–ıċ‘é€†èğ˘ïĵˆċŸşĉœĴ的Ğ‚Ѓ—‚ğƒĞ‚³ƒİ‚¤ƒ€ƒĵ用ïĵ‰ + /// + /// + public override bool IsReverseDirection() => reverseDirection; + + public override void DataValidate() + { + size.x = Mathf.Max(size.x, 0.001f); + size.y = Mathf.Max(size.y, 0.001f); + size.z = Mathf.Max(size.z, 0.001f); + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/Collider/MagicaCapsuleCollider.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Cloth/Collider/MagicaCapsuleCollider.cs.meta new file mode 100644 index 00000000..8d0a30c7 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/Collider/MagicaCapsuleCollider.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: e6f5338a96461264fb9a1132c8509672 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: db1f683d4db92254e93d234d88f6cd1d, type: 3} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Cloth/Collider/MagicaCapsuleCollider.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/Collider/MagicaPlaneCollider.cs b/Assets/MagicaCloth2/Scripts/Core/Cloth/Collider/MagicaPlaneCollider.cs new file mode 100644 index 00000000..2195bb5c --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/Collider/MagicaPlaneCollider.cs @@ -0,0 +1,28 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp + +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// Plane‚³ƒİ‚¤ƒ€ƒĵ‚³ƒ³ƒƒĵƒƒ³ƒˆ + /// Yèğ¸ĉ–ıċ‘Ğċ݁™‚‹ç„Ħ限ċı³é˘ + /// Plane Collider. + /// Infinite plane for the Y-axis direction. + /// + [AddComponentMenu("MagicaCloth2/MagicaPlaneCollider")] + [HelpURL("https://magicasoft.jp/en/mc2_planecollidercomponent/")] + public class MagicaPlaneCollider : ColliderComponent + { + public override ColliderManager.ColliderType GetColliderType() + { + return ColliderManager.ColliderType.Plane; + } + + public override void DataValidate() + { + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/Collider/MagicaPlaneCollider.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Cloth/Collider/MagicaPlaneCollider.cs.meta new file mode 100644 index 00000000..aa22fe03 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/Collider/MagicaPlaneCollider.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 1771fb5869b59304e82522e24e85fd40 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: db1f683d4db92254e93d234d88f6cd1d, type: 3} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Cloth/Collider/MagicaPlaneCollider.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/Collider/MagicaSphereCollider.cs b/Assets/MagicaCloth2/Scripts/Core/Cloth/Collider/MagicaSphereCollider.cs new file mode 100644 index 00000000..746327ed --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/Collider/MagicaSphereCollider.cs @@ -0,0 +1,34 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// Sphere collider + /// + [AddComponentMenu("MagicaCloth2/MagicaSphereCollider")] + [HelpURL("https://magicasoft.jp/en/mc2_spherecollidercomponent/")] + public class MagicaSphereCollider : ColliderComponent + { + public override ColliderManager.ColliderType GetColliderType() + { + return ColliderManager.ColliderType.Sphere; + } + + public override void DataValidate() + { + size.x = Mathf.Max(size.x, 0.001f); + } + + /// + /// resize the sphere. + /// + /// + public void SetSize(float radius) + { + SetSize(new Vector3(radius, 0.0f, 0.0f)); + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/Collider/MagicaSphereCollider.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Cloth/Collider/MagicaSphereCollider.cs.meta new file mode 100644 index 00000000..9ffb9d46 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/Collider/MagicaSphereCollider.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: f2b68b2c7953ebb479b78627f19a6ccb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: db1f683d4db92254e93d234d88f6cd1d, type: 3} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Cloth/Collider/MagicaSphereCollider.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints.meta b/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints.meta new file mode 100644 index 00000000..ca8d97dc --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b697bf7b265fa5e4a92ce1e2e9f3c449 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/AngleConstraint.cs b/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/AngleConstraint.cs new file mode 100644 index 00000000..295b7af9 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/AngleConstraint.cs @@ -0,0 +1,594 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System; +using System.Text; +using Unity.Collections; +using Unity.Mathematics; +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// 角ċşĤċİċ…ƒ/角ċşĤċˆĥ限ċˆĥ約 + /// ċ†…部ċ‡Ĥ理ŒğĵċŒ˜ŞŸ‚ïĵ‘¤Ğçµħċˆ + /// + public class AngleConstraint : IDisposable + { + /// + /// angle restoration. + /// 角ċşĤċİċ…ƒ + /// + [System.Serializable] + public class RestorationSerializeData : IDataValidate + { + /// + /// Presence or absence of use. + /// [OK] Runtime changes. + /// [OK] Export/Import with Presets + /// + public bool useAngleRestoration; + + /// + /// resilience. + /// ċİċ…ƒċŠ› + /// [OK] Runtime changes. + /// [OK] Export/Import with Presets + /// + public CurveSerializeData stiffness; + + /// + /// Velocity decay during restoration. + /// ċİċ…ƒĉ™‚é€ŸċşĤĉ¸›èĦ° + /// [OK] Runtime changes. + /// [OK] Export/Import with Presets + /// + [Range(0.0f, 1.0f)] + public float velocityAttenuation; + + /// + /// Directional Attenuation of Gravity. + /// Note that this attenuation occurs even if the gravity is 0! + /// ċİċ…ƒé‡ċŠ›ĉ–ıċ‘ĉ¸›èĦ° + /// “ĉ¸›èĦ°Żé‡ċŠ›Œïĵ§‚‚ç™şç”Ÿ™‚‹§ĉ³¨ĉ„ïĵ + /// [OK] Runtime changes. + /// [OK] Export/Import with Presets + /// + [Range(0.0f, 1.0f)] + public float gravityFalloff; + + public RestorationSerializeData() + { + useAngleRestoration = true; + stiffness = new CurveSerializeData(0.2f, 1.0f, 0.2f, true); + velocityAttenuation = 0.8f; + gravityFalloff = 0.0f; + } + + public void DataValidate() + { + stiffness.DataValidate(0.0f, 1.0f); + velocityAttenuation = Mathf.Clamp01(velocityAttenuation); + gravityFalloff = Mathf.Clamp01(gravityFalloff); + } + + public RestorationSerializeData Clone() + { + return new RestorationSerializeData() + { + useAngleRestoration = useAngleRestoration, + stiffness = stiffness.Clone(), + velocityAttenuation = velocityAttenuation, + gravityFalloff = gravityFalloff, + }; + } + } + + /// + /// angle limit. + /// 角ċşĤċˆĥ限 + /// + [System.Serializable] + public class LimitSerializeData : IDataValidate + { + /// + /// Presence or absence of use. + /// [OK] Runtime changes. + /// [OK] Export/Import with Presets + /// + public bool useAngleLimit; + + /// + /// Limit angle (deg). + /// ċˆĥ限角ċşĤ(deg) + /// [OK] Runtime changes. + /// [OK] Export/Import with Presets + /// + public CurveSerializeData limitAngle; + + /// + /// Standard stiffness. + /// ċŸşĉş–ċ‰›ĉ€§ + /// [OK] Runtime changes. + /// [OK] Export/Import with Presets + /// + [Range(0.0f, 1.0f)] + public float stiffness; + + public LimitSerializeData() + { + useAngleLimit = false; + limitAngle = new CurveSerializeData(60.0f, 0.0f, 1.0f); + stiffness = 1.0f; + } + + public void DataValidate() + { + limitAngle.DataValidate(0.0f, 180.0f); + stiffness = Mathf.Clamp01(stiffness); + } + + public LimitSerializeData Clone() + { + return new LimitSerializeData() + { + useAngleLimit = useAngleLimit, + limitAngle = limitAngle.Clone(), + stiffness = stiffness, + }; + } + } + + //========================================================================================= + public struct AngleConstraintParams + { + public bool useAngleRestoration; + + /// + /// 角ċşĤċİċ…ƒċŠ› + /// + public float4x4 restorationStiffness; + + /// + /// 角ċşĤċİċ…ƒé€ŸċşĤĉ¸›èĦ° + /// + public float restorationVelocityAttenuation; + + /// + /// 角ċşĤċİċ…ƒé‡ċŠ›ĉ–ıċ‘ĉ¸›èĦ° + /// + public float restorationGravityFalloff; + + + public bool useAngleLimit; + + /// + /// ċˆĥ限角ċşĤ(deg) + /// + public float4x4 limitCurveData; + + /// + /// 角ċşĤċˆĥ限ċ‰›ĉ€§ + /// + public float limitstiffness; + + public void Convert(RestorationSerializeData restorationData, LimitSerializeData limitData) + { + useAngleRestoration = restorationData.useAngleRestoration; + // Restoration PowerŻè¨­ċšċ€¤20%¨™‚‹.¤‚Š1.0§ĉ—§0.2¨Ş‚‹ + restorationStiffness = restorationData.stiffness.ConvertFloatArray() * 0.2f; + restorationVelocityAttenuation = restorationData.velocityAttenuation; + restorationGravityFalloff = restorationData.gravityFalloff; + + useAngleLimit = limitData.useAngleLimit; + limitCurveData = limitData.limitAngle.ConvertFloatArray(); + limitstiffness = limitData.stiffness; + } + } + + //========================================================================================= + public AngleConstraint() + { + } + + public void Dispose() + { + } + + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.AppendLine($"[AngleConstraint]"); + return sb.ToString(); + } + + //========================================================================================= + // Solver + //========================================================================================= + internal static void SolverConstraint( + DataChunk chunk, + in float4 simulationPower, + // team + ref TeamManager.TeamData tdata, + ref ClothParameters param, + // vmesh + ref NativeArray attributes, + ref NativeArray vertexDepths, + ref NativeArray vertexParentIndices, + ref NativeArray baseLineStartDataIndices, + ref NativeArray baseLineDataCounts, + ref NativeArray baseLineData, + // particle + ref NativeArray nextPosArray, + ref NativeArray velocityPosArray, + ref NativeArray frictionArray, + // buffer + ref NativeArray stepBasicPositionBuffer, + ref NativeArray stepBasicRotationBuffer, + // buffer2 + ref NativeArray lengthBufferArray, + ref NativeArray localPosBufferArray, + ref NativeArray localRotBufferArray, + ref NativeArray rotationBufferArray, + ref NativeArray restorationVectorBufferArray + ) + { + var angleParam = param.angleConstraint; + if (angleParam.useAngleLimit == false && angleParam.useAngleRestoration == false) + return; + + int d_start = tdata.baseLineDataChunk.startIndex; + int p_start = tdata.particleChunk.startIndex; + int v_start = tdata.proxyCommonChunk.startIndex; + + bool useAngleLimit = angleParam.useAngleLimit; + bool useAngleRestoration = angleParam.useAngleRestoration; + + // ċ‰›ĉ€§ + float limitStiffness = angleParam.limitstiffness; + float restorationAttn = angleParam.restorationVelocityAttenuation; + + // ċİċ…ƒé‡ċŠ›ĉ¸›èĦ° + // !“ĉ¸›èĦ°Żé‡ċŠ›ïĵ§‚‚ç™şç”Ÿ™‚‹§ĉ³¨ĉ„ïĵ + float gravityFalloff = math.lerp(1.0f - angleParam.restorationGravityFalloff, 1.0f, tdata.gravityDot); + //Debug.Log($"gravityFalloff:{gravityFalloff}"); + //float gravity = param.gravity; + //float3 gravityVector = gravity > Define.System.Epsilon ? param.gravityDirection : 0; + + // ƒ™ƒĵ‚ıƒİ‚¤ƒ³”¨ + //int bindex = tdata.baseLineChunk.startIndex; + int bindex = tdata.baseLineChunk.startIndex + chunk.startIndex; + //for (int a = 0; a < tdata.baseLineChunk.dataLength; a++, bindex++) + for (int a = 0; a < chunk.dataLength; a++, bindex++) + { + int start = baseLineStartDataIndices[bindex]; + int dcnt = baseLineDataCounts[bindex]; + + // ƒƒƒƒ•‚ĦƒŞƒ³‚° + int dataIndex = start + d_start; + for (int i = 0; i < dcnt; i++, dataIndex++) + { + int l_index = baseLineData[dataIndex]; + int pindex = p_start + l_index; + int vindex = v_start + l_index; + + // è‡ŞèşĞ + var npos = nextPosArray[pindex]; + var bpos = stepBasicPositionBuffer[pindex]; + var brot = stepBasicRotationBuffer[pindex]; + + rotationBufferArray[pindex] = brot; + + // èĤŞ + if (i > 0) + { + int p_l_index = vertexParentIndices[vindex]; + int p_pindex = p_l_index + p_start; + var pnpos = nextPosArray[p_pindex]; + var pbpos = stepBasicPositionBuffer[p_pindex]; + var pbrot = stepBasicRotationBuffer[p_pindex]; + + if (useAngleLimit) + { + // çċœ¨ƒ™‚ŻƒˆƒĞ長 + float vlen = math.distance(npos, pnpos); + + // èĤށ‹‚‰ċŸşĉœĴċ§żċ‹˘ + var bv = bpos - pbpos; + float bvlen = math.length(bv); + if (vlen < Define.System.Epsilon || bvlen < Define.System.Epsilon) + { + // length=0 + //Debug.Log($"NG1"); + //‚¨ƒƒ‚¸é•·ïĵċŻċ‡Ĥ + lengthBufferArray[pindex] = 0; + localPosBufferArray[pindex] = 0; + localRotBufferArray[pindex] = quaternion.identity; + } + else + { + //Develop.Assert(math.length(bv) > 0.0f); + //var v = math.normalize(bv); + var v = bv / bvlen; + var ipq = math.inverse(pbrot); + float3 localPos = math.mul(ipq, v); + quaternion localRot = math.mul(ipq, brot); + + lengthBufferArray[pindex] = vlen; + localPosBufferArray[pindex] = localPos; + localRotBufferArray[pindex] = localRot; + } + } + + if (useAngleRestoration) + { + // ċİċ…ƒƒ™‚ŻƒˆƒĞ + float3 rv = bpos - pbpos; + restorationVectorBufferArray[pindex] = rv; + //Debug.Log($"[{pindex}] rv:{rv}"); + } + } + } + + // ċċİ + // 角ċşĤċˆĥ限ŻèĤށ¨ċ­ä½ç½‚’ċ€…Ğäżĉ­£—Ĥ„Ÿ‚ċċ݁Żċż…é ˆ€‚ + // ċċ݁Żċ¤š„ğİċ …牢ĉ€§Œċ˘—™€‚ + for (int k = 0; k < Define.System.AngleLimitIteration; k++) + { + float iterationRatio = (float)k / (Define.System.AngleLimitIteration - 1); // 0.0 ~ 1.0 + + // ċ›žèğ˘ä¸­ċżƒç‚ı€‚ + // èĤށĞèż‘„(ċ€¤Œċ°•„)ğİ角ċşĤċˆĥ限ċŠıĉžœŒċ˘—™Œé…·„ĉŒŻċ‹•ĉ¸İċşŠ¨‚‚Ş‚‹€‚ + // 中ċżƒç‚ıŒĦ‚‡†İ真‚“中(0.5)ċ ´ċˆŻċ …牢ĉ€§Œĉœ€ċ¤§¨Ş‚ŠĉŒŻċ‹•Œç™şç”Ÿ—ŞŞ‚‹Œ‹‚‚Šè§’ċşĤċİċ…ƒ/ċˆĥ限ċŠıĉžœŒċĵħŞ‚‹€‚ + // Ÿ‚ċċ݁”¨Ğċ›žèğ˘ä¸­ċżƒ‚’ċ€…ĞèĤŞ(0.0)‹‚‰ä¸­é–“(0.5)Ğèż‘‘‚‹“¨Ğ‚ˆ‚Šċ …牢ĉ€§¨ċ‰ċšĉ€§‚’確保™‚‹ + // “ċ‡Ĥ理Ğ‚ˆ‚ŠĉŒŻċ‹•ŒċŒċ…¨Ğç„ĦŞ‚‹è¨³§Żç„Ħ„Œè¨ħċı範ċ›²§‚‚‹—何‚ˆ‚Š‚‚è§’ċşĤċİċ…ƒ/ċˆĥ限ċŠıĉžœŒċ¤§ċı…Ğċ‘上™‚‹ + //float limitRotRatio = math.min(math.lerp(0.3f, 0.7f, iterationRatio), 0.5f); + //float limitRotRatio = math.min(math.lerp(0.4f, 0.7f, iterationRatio), 0.5f); + float limitRotRatio = 0.4f; + float restorationRotRatio = math.lerp(0.1f, 0.5f, iterationRatio); + + dataIndex = start + d_start; + for (int i = 0; i < dcnt; i++, dataIndex++) + { + int l_index = baseLineData[dataIndex]; + int pindex = p_start + l_index; + int vindex = v_start + l_index; + + //Debug.Log($"pindex:{pindex}"); + + // ċ­ + float3 cpos = nextPosArray[pindex]; + float cdepth = vertexDepths[vindex]; + var cattr = attributes[vindex]; + var cInvMass = MathUtility.CalcInverseMass(frictionArray[pindex]); + + // ċ­Œċ›şċšŞ‚‰°‚ı‚­ƒƒƒ— + if (cattr.IsMove() == false) + continue; + + // èĤŞ + int p_pindex = vertexParentIndices[vindex] + p_start; + int p_vindex = vertexParentIndices[vindex] + v_start; + float3 ppos = nextPosArray[p_pindex]; + //float pdepth = vertexDepths[p_vindex]; + var pattr = attributes[p_vindex]; + var pInvMass = MathUtility.CalcInverseMass(frictionArray[p_pindex]); + + //===================================================== + // Angle Limit + //===================================================== + if (useAngleLimit) + { + // èĤށ‹‚‰ċŸşĉş–ċ§żċ‹˘ + quaternion prot = rotationBufferArray[p_pindex]; + float3 localPos = localPosBufferArray[pindex]; + quaternion localRot = localRotBufferArray[pindex]; + + // çċœ¨ƒ™‚ŻƒˆƒĞ + float3 v = cpos - ppos; + float vlen = math.length(v); + if (vlen < Define.System.Epsilon) + { + //‚¨ƒƒ‚¸é•·ïĵċŻċ‡Ĥ + //Debug.Log($"NG2"); + goto EndAngleLimit; + } + + // ċİċ…ƒ™ıƒ™‚ŻƒˆƒĞ + float3 tv = math.mul(prot, localPos); + float tvlen = math.length(tv); + if (tvlen < Define.System.Epsilon) + { + //‚¨ƒƒ‚¸é•·ïĵċŻċ‡Ĥ + //Debug.Log($"NG3"); + float3 add = ppos - cpos; + nextPosArray[pindex] = ppos; + velocityPosArray[pindex] = velocityPosArray[pindex] + add; + rotationBufferArray[pindex] = math.mul(prot, localRot); + goto EndAngleLimit; + } + + v /= vlen; + tv /= tvlen; + + // ƒ™‚ŻƒˆƒĞ長äżĉ­£ + float blen = lengthBufferArray[pindex]; + vlen = math.lerp(vlen, blen, 0.5f); // 計ç—ċ‰è·é›˘Ğċ€…Ğèż‘‘‚‹ + if (blen < Define.System.Epsilon || vlen < Define.System.Epsilon) + { + //‚¨ƒƒ‚¸é•·ïĵċŻċ‡Ĥ + //Debug.Log($"NG4"); + goto EndAngleLimit; + } + //Develop.Assert(vlen > 0.0f); + //v = math.normalize(v) * vlen; + v = v * vlen; + + // ƒ™‚ŻƒˆƒĞ角ċşĤ‚Żƒİƒ³ƒ— + float maxAngleDeg = angleParam.limitCurveData.MC2EvaluateCurve(cdepth); + float maxAngleRad = math.radians(maxAngleDeg); + float angle = MathUtility.Angle(v, tv); + float3 rv = v; + if (angle > maxAngleRad) + { + // stiffness + float recoveryAngle = math.lerp(angle, maxAngleRad, limitStiffness); + + MathUtility.ClampAngle(v, tv, recoveryAngle, out rv); + } + + // ċ›žèğ˘ä¸­ċżƒċ‰²ċˆ + float3 rotPos = ppos + v * limitRotRatio; + + // èĤށ¨ċ­‚Œž‚Œĉ›´ĉ–°ä½ç½ + float3 pfpos = rotPos - rv * limitRotRatio; + float3 cfpos = rotPos + rv * (1.0f - limitRotRatio); + + // ċŠ ç— + float3 padd = pfpos - ppos; + float3 cadd = cfpos - cpos; + + // ĉ‘İĉ“Ĥ考ĉ… + cadd *= cInvMass; + padd *= pInvMass; + + const float attn = Define.System.AngleLimitAttenuation; + + // ċ­ĉ›¸èĵż + if (cattr.IsMove()) + { + cpos += cadd; + nextPosArray[pindex] = cpos; + velocityPosArray[pindex] = velocityPosArray[pindex] + cadd * attn; + } + + // èĤށĉ›¸èĵż + if (pattr.IsMove()) + { + ppos += padd; + nextPosArray[p_pindex] = ppos; + velocityPosArray[p_pindex] = velocityPosArray[p_pindex] + padd * attn; + } + + // ċ›žèğ˘è£œĉ­£ + v = cpos - ppos; + vlen = math.length(v); + if (vlen < Define.System.Epsilon) + { + //‚¨ƒƒ‚¸é•·ïĵċŻċ‡Ĥ + //Debug.Log($"NG5"); + goto EndAngleLimit; + } + v /= vlen; + var nrot = math.mul(prot, localRot); + //var q = MathUtility.FromToRotation(tv, v); + var q = MathUtility.FromToRotationWithoutNormalize(tv, v); + nrot = math.mul(q, nrot); + rotationBufferArray[pindex] = nrot; + } + + EndAngleLimit: + + //===================================================== + // Angle Restoration + //===================================================== + if (useAngleRestoration) + { + //Debug.Log($"pindex:{pindex}, p_pindex:{p_pindex}"); + + // ċİċ…ƒ™ıƒ™‚ŻƒˆƒĞ + float3 tv = restorationVectorBufferArray[pindex]; + float tvlen = math.length(tv); + if (tvlen < Define.System.Epsilon) + { + //‚¨ƒƒ‚¸é•·ïĵċŻċ‡Ĥ + //Debug.Log($"NG6"); + float3 add = ppos - cpos; + nextPosArray[pindex] = ppos; + velocityPosArray[pindex] = velocityPosArray[pindex] + add; + continue; + } + + // çċœ¨ƒ™‚ŻƒˆƒĞ + float3 v = cpos - ppos; + float vlen = math.length(v); + if (vlen < Define.System.Epsilon) + { + //‚¨ƒƒ‚¸é•·ïĵċŻċ‡Ĥ + //Debug.Log($"NG7"); + continue; + } + + // ċİċ…ƒċŠ› + float restorationStiffness = angleParam.restorationStiffness.MC2EvaluateCurveClamp01(cdepth); + restorationStiffness = math.saturate(restorationStiffness * simulationPower.w); + + //int _pindex = indexBuffer[i] + p_start; + //Debug.Log($"i:{i} [{_pindex}] stiffness:{restorationStiffness} cdepth:{cdepth}"); + + // 重ċŠ›ĉ–ıċ‘ĉ¸›èĦ° + restorationStiffness *= gravityFalloff; + + // çƒé˘ç·šċ½˘è£œé–“ + var q = MathUtility.FromToRotationWithoutNormalize(v / vlen, tv / tvlen, restorationStiffness); + float3 rv = math.mul(q, v); + + // ċ›žèğ˘ä¸­ċżƒċ‰²ċˆ + //float restorationRotRatio = GetRotRatio(tv, gravityVector, gravity, gravityFalloff, iterationRatio); + //int _pindex = indexBuffer[i] + p_start; + //Debug.Log($"i:{i} [{_pindex}] ratio:{restorationRotRatio} cdepth:{cdepth}"); + float3 rotPos = ppos + v * restorationRotRatio; + + // èĤށ¨ċ­‚Œž‚Œĉ›´ĉ–°ä½ç½ + float3 pfpos = rotPos - rv * restorationRotRatio; + float3 cfpos = rotPos + rv * (1.0f - restorationRotRatio); + + // ċŠ ç— + float3 padd = pfpos - ppos; + float3 cadd = cfpos - cpos; + + // ĉ‘İĉ“Ĥ考ĉ… + cadd *= cInvMass; + padd *= pInvMass; + + // ċ­ĉ›¸èĵż + if (cattr.IsMove()) + { + cpos += cadd; + nextPosArray[pindex] = cpos; + velocityPosArray[pindex] = velocityPosArray[pindex] + cadd * restorationAttn; + } + + // èĤށĉ›¸èĵż + if (pattr.IsMove()) + { + ppos += padd; + nextPosArray[p_pindex] = ppos; + velocityPosArray[p_pindex] = velocityPosArray[p_pindex] + padd * restorationAttn; + } + } + } + } + } + + // ƒƒƒƒ•‚Ħ‚ŻƒŞ‚˘ + bindex = tdata.baseLineChunk.startIndex + chunk.startIndex; + for (int a = 0; a < chunk.dataLength; a++, bindex++) + { + int start = baseLineStartDataIndices[bindex]; + int dcnt = baseLineDataCounts[bindex]; + + int dataIndex = start + d_start; + for (int i = 0; i < dcnt; i++, dataIndex++) + { + int l_index = baseLineData[dataIndex]; + int pindex = p_start + l_index; + + lengthBufferArray[pindex] = 0; + localPosBufferArray[pindex] = 0; + restorationVectorBufferArray[pindex] = 0; + } + } + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/AngleConstraint.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/AngleConstraint.cs.meta new file mode 100644 index 00000000..4981c8fc --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/AngleConstraint.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: ee1ebe8cef869d6439a8152a540713c4 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/AngleConstraint.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/ColliderCollisionConstraint.cs b/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/ColliderCollisionConstraint.cs new file mode 100644 index 00000000..8850b3ea --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/ColliderCollisionConstraint.cs @@ -0,0 +1,1065 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System; +using System.Collections.Generic; +using System.Text; +using Unity.Collections; +using Unity.Collections.LowLevel.Unsafe; +using Unity.Mathematics; +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// ‚³ƒİ‚¤ƒ€ƒĵĞ‚ˆ‚‹èĦçށċˆ¤ċšċˆĥ約 + /// + public class ColliderCollisionConstraint : IDisposable + { + /// + /// Collision judgment mode. + /// èĦçށċˆ¤ċšƒ˘ƒĵƒ‰ + /// + public enum Mode + { + None = 0, + Point = 1, + Edge = 2, + } + + [System.Serializable] + public class SerializeData : IDataValidate, ITransform + { + /// + /// Collision judgment mode. + /// èĦçށċˆ¤ċšƒ˘ƒĵƒ‰ + /// [OK] Runtime changes. + /// [OK] Export/Import with Presets + /// + public Mode mode; + + /// + /// Friction (0.0 ~ 1.0). + /// Dynamic friction/stationary friction combined use. + /// ĉ‘İĉ“Ĥ(0.0 ~ 1.0) + /// ċ‹•ĉ‘İĉ“Ĥïĵé™ĉ­˘ĉ‘İĉ“Ĥċ…ĵ用 + /// [OK] Runtime changes. + /// [OK] Export/Import with Presets + /// + [Range(0.0f, 0.5f)] + public float friction; + + /// + /// Collider list. + /// ‚³ƒİ‚¤ƒ€ƒĵƒŞ‚ıƒˆ + /// [OK] Runtime changes. + /// [NG] Export/Import with Presets + /// + public List colliderList = new List(); + + /// + /// List of Transforms that perform collision detection with BoneSpring. + /// BoneSpring§èĦçށċˆ¤ċš‚’èĦŒ†TransformƒŞ‚ıƒˆ + /// [OK] Runtime changes. + /// [NG] Export/Import with Presets + /// + public List collisionBones = new List(); + + /// + /// The maximum distance from the origin that a vertex will be pushed by the collider. Currently used only with BoneSpring. + /// ‚³ƒİ‚¤ƒ€ƒĵĞ‚ˆ‚Šé ‚ç‚ıŒĉŠĵ—ċ‡ş•‚Œ‚‹ċŽŸç‚ı‹‚‰ĉœ€ċ¤§è·é›˘€‚çċœ¨ŻBoneSpringż§ċˆİ用€‚ + /// [OK] Runtime changes. + /// [OK] Export/Import with Presets + /// + public CurveSerializeData limitDistance = new CurveSerializeData(0.05f); + + + public SerializeData() + { + mode = Mode.Point; + friction = 0.05f; + } + + public void DataValidate() + { + friction = Mathf.Clamp(friction, 0.0f, 0.5f); + limitDistance.DataValidate(0.0f, 1.0f); + } + + public SerializeData Clone() + { + return new SerializeData() + { + mode = mode, + friction = friction, + colliderList = new List(colliderList), + collisionBones = new List(collisionBones), + }; + } + + public override int GetHashCode() + { + int hash = 0; + foreach (var t in collisionBones) + { + if (t) + hash += t.GetMagicaId().GetHashCode(); + } + + return hash; + } + + public void GetUsedTransform(HashSet transformSet) + { + colliderList.ForEach(x => + { + if (x) + x.GetUsedTransform(transformSet); + }); + foreach (var t in collisionBones) + { + if (t) + transformSet.Add(t); + } + } + + public void ReplaceTransform(Dictionary replaceDict) + { + colliderList.ForEach(x => + { + if (x) + x.ReplaceTransform(replaceDict); + }); + for (int i = 0; i < collisionBones.Count; i++) + { + var t = collisionBones[i]; + if (t && replaceDict.ContainsKey(t.GetMagicaId())) + { + collisionBones[i] = replaceDict[t.GetMagicaId()]; + } + } + } + + public int ColliderLength => colliderList.Count; + } + + public struct ColliderCollisionConstraintParams + { + /// + /// èĦçށċˆ¤ċšƒ˘ƒĵƒ‰ + /// BoneSpring§ŻPointĞċ›şċš•‚Œ‚‹ + /// + public Mode mode; + + /// + /// ċ‹•ĉ‘İĉ“Ĥ係ĉ•°(0.0 ~ 1.0) + /// ĉ‘İĉ“Ĥ1.0Ğċ݁™‚‹‚ıƒ†ƒƒƒ—”¨ĉŽç·šĉ–ıċ‘é€ŸċşĤĉ¸›é€Ÿçއ + /// + public float dynamicFriction; + + /// + /// 静ĉ­˘ĉ‘İĉ“Ĥ係ĉ•°(0.0 ~ 1.0) + /// 静ĉ­˘é€ŸċşĤ(m/s) + /// + public float staticFriction; + + /// + /// ‚³ƒİ‚¤ƒ€ƒĵĞ‚ˆ‚Šé ‚ç‚ıŒĉŠĵ—ċ‡ş•‚Œ‚‹ċŽŸç‚ı‹‚‰ĉœ€ċ¤§è·é›˘€‚çċœ¨ŻBoneSpringż§ċˆİ用€‚ + /// + public float4x4 limitDistance; + + public void Convert(SerializeData sdata, ClothProcess.ClothType clothType) + { + switch (clothType) + { + case ClothProcess.ClothType.BoneCloth: + case ClothProcess.ClothType.MeshCloth: + mode = sdata.mode; + // ċ‹•ĉ‘İĉ“Ĥ/静ĉ­˘ĉ‘İĉ“ĤŻè¨­ċšĉ‘İĉ“ĤĞ係ĉ•°‚’ĉŽ›‘Ÿ‚‚‚’ä½żç”¨™‚‹ + dynamicFriction = sdata.friction * Define.System.ColliderCollisionDynamicFrictionRatio; + staticFriction = sdata.friction * Define.System.ColliderCollisionStaticFrictionRatio; + break; + case ClothProcess.ClothType.BoneSpring: + // BoneSpringŻçƒż + mode = Mode.Point; + // BoneSpringżĉŠĵ—ċ‡ş—è·é›˘ċˆĥ限‚’設‘‚‹ + limitDistance = sdata.limitDistance.ConvertFloatArray(); + // ĉ‘İĉ“ĤŻċšĉ•° + dynamicFriction = Define.System.BoneSpringCollisionFriction; + staticFriction = Define.System.BoneSpringCollisionFriction; + break; + } + } + } + + //========================================================================================= + public ColliderCollisionConstraint() + { + } + + + public void Dispose() + { + } + + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.AppendLine($"[ColliderCollisionConstraint]"); + return sb.ToString(); + } + + //========================================================================================= + // Point Solver + //========================================================================================= + internal static void SolverPointConstraint( + DataChunk chunk, + // team + ref TeamManager.TeamData tdata, + ref ClothParameters param, + // vmesh + ref NativeArray attributes, + ref NativeArray vertexDepths, + // particle + ref NativeArray nextPosArray, + ref NativeArray frictionArray, + ref NativeArray collisionNormalArray, + ref NativeArray velocityPosArray, + ref NativeArray basePosArray, + // collider + ref NativeArray colliderFlagArray, + ref NativeArray colliderWorkDataArray + ) + { + if (tdata.UseColliderCount == 0) + return; + if (param.colliderCollisionConstraint.mode != Mode.Point) + return; + if (chunk.IsValid == false) + return; + + bool isSpring = tdata.IsSpring; + + // ■Point + // ƒ‘ƒĵƒ†‚£‚ŻƒĞ”¨ + //int pindex = tdata.particleChunk.startIndex; + //int vindex = tdata.proxyCommonChunk.startIndex; + int pindex = tdata.particleChunk.startIndex + chunk.startIndex; + int vindex = tdata.proxyCommonChunk.startIndex + chunk.startIndex; + //for (int k = 0; k < tdata.particleChunk.dataLength; k++, pindex++, vindex++) + for (int k = 0; k < chunk.dataLength; k++, pindex++, vindex++) + { + // ƒ‘ƒĵƒ†‚£‚ŻƒĞĉƒ…ċ ħ + var nextPos = nextPosArray[pindex]; + var attr = attributes[vindex]; + if (attr.IsInvalid() || attr.IsDisableCollision()) + continue; + if (attr.IsMove() == false && tdata.IsSpring == false) // ‚ıƒ—ƒŞƒ³‚°ċˆİ用ĉ™‚Żċ›şċšé ‚ç‚ı‚‚通™ + continue; + float depth = vertexDepths[vindex]; + + // BoneSpring§Żè‡Şċ‹•çš„Ğ‚½ƒ•ƒˆ‚³ƒİ‚¤ƒ€ƒĵ¨Ş‚‹ + var basePos = isSpring ? basePosArray[pindex] : float3.zero; // ‚½ƒ•ƒˆ‚³ƒİ‚¤ƒ€ƒĵżbasePosŒċż…èĤ + + // ƒ‘ƒĵƒ†‚£‚ŻƒĞċŠċ„ + float radius = math.max(param.radiusCurveData.MC2EvaluateCurve(depth), 0.0001f); // safe; + + // ƒƒĵƒ ‚ı‚ħƒĵƒĞċ€çއ + radius *= tdata.scaleRatio; + + // ‚³ƒİ‚¤ƒ€ƒĵ¨è·é›˘ + float mindist = float.MaxValue; + + // ĉŽè§Ĥ‚³ƒİ‚¤ƒ€ƒĵĉƒ…ċ ħ + int collisionColliderId = -1; + float3 collisionNormal = 0; + float3 n = 0; + + // ƒ‘ƒĵƒ†‚£‚ŻƒĞĉŠĵ—ċ‡ş—ĉƒ…ċ ħ + float3 addPos = 0; + int addCnt = 0; + float3 addN = 0; + + // ĉŽè§Ĥċˆ¤ċš‚’èĦŒ†‚³ƒİ‚¤ƒ€ƒĵ‹‚‰ĉœ€ċ¤§è·é›˘(collisionFrictionRange) + // ƒ‘ƒĵƒ†‚£‚ŻƒĞ‚µ‚¤‚ş‹‚‰ç—ċ‡ş™‚‹ + float cfr = radius * 1.0f; // 1.0f? + + // ƒ‘ƒĵƒ†‚£‚ŻƒĞAABB + var aabb = new AABB(nextPos - radius, nextPos + radius); + aabb.Expand(cfr); + + // BoneSpring§ĉœ€ċ¤§ĉŠĵ—ċ‡ş—è·é›˘ + float maxLength = isSpring ? math.max(param.colliderCollisionConstraint.limitDistance.MC2EvaluateCurve(depth), 0.0001f) * tdata.scaleRatio : -1; // ƒƒĵƒ ‚ı‚ħƒĵƒĞċ€çއ + + // ƒƒĵƒ ċ†…‚³ƒİ‚¤ƒ€ƒĵ‚’ƒĞƒĵƒ— + int cindex = tdata.colliderChunk.startIndex; + int ccnt = tdata.colliderCount; + for (int i = 0; i < ccnt; i++, cindex++) + { + var cflag = colliderFlagArray[cindex]; + if (cflag.IsSet(ColliderManager.Flag_Valid) == false) + continue; + if (cflag.IsSet(ColliderManager.Flag_Enable) == false) + continue; + + var ctype = DataUtility.GetColliderType(cflag); + var cwork = colliderWorkDataArray[cindex]; + float dist = 100.0f; + float3 _nextPos = nextPos; + switch (ctype) + { + case ColliderManager.ColliderType.Sphere: + // ‚½ƒ•ƒˆ‚³ƒİ‚¤ƒ€ƒĵŻSphereż + dist = PointSphereColliderDetection(ref _nextPos, basePos, radius, aabb, cwork, isSpring, maxLength, out n); + break; + case ColliderManager.ColliderType.CapsuleX_Center: + case ColliderManager.ColliderType.CapsuleY_Center: + case ColliderManager.ColliderType.CapsuleZ_Center: + case ColliderManager.ColliderType.CapsuleX_Start: + case ColliderManager.ColliderType.CapsuleY_Start: + case ColliderManager.ColliderType.CapsuleZ_Start: + dist = PointCapsuleColliderDetection(ref _nextPos, radius, aabb, cwork, out n); + break; + case ColliderManager.ColliderType.Plane: + dist = PointPlaneColliderDetction(ref _nextPos, radius, cwork, out n); + break; + default: + Debug.LogError($"unknown collider type:{ctype}"); + break; + } + + // ĉ˜Žç˘şŞĉŽè§Ĥ¨ĉŠĵ—ċ‡ş—‚‚Š + if (dist <= 0.0f) + { + // ĉŠĵ—ċ‡ş•‚ŒŸƒ™‚ŻƒˆƒĞ¨ĉŽè§Ĥĉ³•ç·š‚’™ıĤċŠ ç—™‚‹ + addPos += (_nextPos - nextPos); + addN += n; + addCnt++; + //Debug.Log($"Collision!"); + } + + // ‚³ƒİ‚¤ƒ€ƒĵĞ一ċšè·é›˘èż‘„Ĥ„‚‹ċ ´ċˆïĵˆċ‹•ĉ‘İĉ“Ĥïĵé™ĉ­˘ĉ‘İĉ“ĤŒċ½ħ響™‚‹ïĵ‰ + if (dist <= cfr) + { + // ĉŽè§Ĥĉ³•ç·š‚’™ıĤċŠ ç——€Ÿ‚³ƒİ‚¤ƒ€ƒĵ§ĉœ€èż‘è·é›˘‚’記録™‚‹ + collisionColliderId = cindex; + collisionNormal += n; // ™ıĤċŠ ç—™‚‹ + mindist = math.min(mindist, dist); + } + } + + // ĉœ€çµ‚ä½ç½ + // ċı³ċ‡ċŒ–™‚‹ + if (addCnt > 0) + { + // ċˆĉˆ•‚ŒŸĉŽè§Ĥĉ³•ç·šé•·•Ğĉݔ䋁—Ĥƒ‘ƒĵƒ†‚£‚ŻƒĞç§ğċ‹•‚’ċˆĥ限™‚‹ + // “‚ŒĞ‚ˆ‚Šïĵ’¤‚³ƒİ‚¤ƒ€ƒĵĞĉŒŸ‚ŒŸƒ‘ƒĵƒ†‚£‚ŻƒĞŒĉš´‚ŒŞŞ‚‹ + addN /= addCnt; + float len = math.length(addN); + if (len < Define.System.Epsilon) + { + addPos = 0; + } + else + { + float t = math.min(len, 1.0f); + addPos /= addCnt; + nextPos += addPos * t; + } + } + + // ĉ‘İĉ“Ĥ係ĉ•°(friction)è¨ˆç— + if (collisionColliderId >= 0 && cfr > 0.0f && math.lengthsq(collisionNormal) > 1e-06f) + { + // ‚³ƒİ‚¤ƒ€ƒĵ‹‚‰è·é›˘Ğ‚ˆ‚Šċ¤‰ċŒ–(0.0~ĉŽċœ°é˘1.0) + //Develop.Assert(cfr > 0.0f); + var friction = 1.0f - math.saturate(mindist / cfr); + frictionArray[pindex] = math.max(friction, frictionArray[pindex]); // ċ¤§„ĉ–ı + + // ĉ‘İĉ“Ĥ用ĉŽè§Ĥĉ³•ç·šċı³ċ‡ċŒ– + //Develop.Assert(math.length(collisionNormal) > 0.0f); + collisionNormal = math.normalize(collisionNormal); + } + collisionNormalArray[pindex] = collisionNormal; + // todo:一ċżœ‚³ƒİ‚¤ƒ€ƒĵID‚’記録—Ĥ„‚‹Œçċœ¨ĉœŞä½żç”¨! + //colliderIdArray[pindex] = collisionColliderId + 1; // +1™‚‹§ĉ³¨ĉ„ïĵ + + // ĉ›¸ĉˆğ— + nextPosArray[pindex] = nextPos; + + // 速ċşĤċ½ħ響(BoneSpringż) + if (isSpring && addCnt > 0) + { + // BoneSpring§Żé€ŸċşĤċ½ħ響‚’ïĵĞ™‚‹ + velocityPosArray[pindex] = velocityPosArray[pindex] + addPos; + } + } + } + + static float PointSphereColliderDetection( + ref float3 nextpos, + in float3 basePos, + float radius, + in AABB aabb, + in ColliderManager.WorkData cwork, + bool isSpring, + float maxLength, + out float3 normal + ) + { + // ★Ÿ¨ˆĉŽè§Ĥ—Ĥ„Ş¨‚‚‚³ƒİ‚¤ƒ€ƒĵ§è·é›˘¨ĉ³•ç·š‚’èż”•Ş‘‚Œ°Ş‚‰Ş„ïĵ + normal = 0; + + //========================================================= + // AABBċˆ¤ċš + //========================================================= + if (aabb.Overlaps(cwork.aabb) == false) + return float.MaxValue; + + var oldpos = nextpos; + + //========================================================= + // èĦçށ解ĉħş + //========================================================= + float3 coldpos = cwork.oldPos.c0; + float3 cpos = cwork.nextPos.c0; + float cradius = cwork.radius.x; + + // ç§ğċ‹•ċ‰‚³ƒİ‚¤ƒ€ƒĵĞċ݁™‚‹ƒ­ƒĵ‚ЃĞ位罁‹‚‰ç§ğċ‹•ċŒ‚³ƒİ‚¤ƒ€ƒĵĉŠĵ—ċ‡ş—ċı³é˘‚’ĉħ‚‚‚‹ + float3 c, n, v; + v = nextpos - coldpos; + Develop.Assert(math.length(v) > 0.0f); + n = math.normalize(v); + c = cpos + n * (cradius + radius); + + // èĦçށĉ³•ç·š + normal = n; + + // c = ċı³é˘ä½ç½ + // n = ċı³é˘ĉ–ıċ‘ + // ċı³é˘èĦçށċˆ¤ċš¨ĉŠĵ—ċ‡ş— + //return MathUtility.IntersectPointPlaneDist(c, n, nextpos, out nextpos); + float dist = MathUtility.IntersectPointPlaneDist(c, n, nextpos, out nextpos); + +#if true + // BoneSpring + if (maxLength > 0.0f) + { + // (1)è·é›˘ċˆĥ限 + nextpos = MathUtility.ClampDistance(basePos, nextpos, maxLength); + + // (2)ċç™şċŠ›ĉ¸›èĦ° + float l = math.distance(basePos, nextpos); + float t = math.saturate(l / radius); // ċŠċ„ċŸşĉş– + //float t = math.saturate(l / maxLength); + t = math.lerp(0.0f, 0.85f, t); // ĉœ€ä½Ž§‚‚ċ°‘—ċç™ş‚’ĉ‹™ + nextpos = math.lerp(nextpos, oldpos, t); + + // èĦçށċı³é˘§è·é›˘Żĉ‘İĉ“Ĥċ½ħ響‚’ĉŠ‘ˆ‚‹Ÿ‚‚ı‚ħƒĵƒĞ™‚‹ + dist *= 3.0f; + } +#endif + + return dist; + } + + static float PointPlaneColliderDetction( + ref float3 nextpos, + float radius, + in ColliderManager.WorkData cwork, + out float3 normal + ) + { + // ★Ÿ¨ˆĉŽè§Ĥ—Ĥ„Ş¨‚‚‚³ƒİ‚¤ƒ€ƒĵ§è·é›˘¨ĉ³•ç·š‚’èż”•Ş‘‚Œ°Ş‚‰Ş„ïĵ + + // ‚³ƒİ‚¤ƒ€ƒĵĉƒ…ċ ħ + var cpos = cwork.nextPos.c0; + var n = cwork.oldPos.c0; // ““ĞĉŠĵ—ċ‡ş—ĉ³•ç·š + + // èĦçށĉ³•ç·š + normal = n; + + // c = ċı³é˘ä½ç½ïĵˆƒ‘ƒĵƒ†‚£‚ŻƒĞċŠċ„ċˆ†‚ރ•‚ğƒƒƒˆïĵ‰ + // n = ċı³é˘ĉ–ıċ‘ + // ċı³é˘èĦçށċˆ¤ċš¨ĉŠĵ—ċ‡ş— + // ċı³é˘¨è·é›˘‚’èż”™ïĵˆĉŠĵ—ċ‡ş—ċ ´ċˆŻ0.0ïĵ‰ + return MathUtility.IntersectPointPlaneDist(cpos + n * radius, n, nextpos, out nextpos); + } + + static float PointCapsuleColliderDetection( + ref float3 nextpos, + float radius, + in AABB aabb, + in ColliderManager.WorkData cwork, + out float3 normal + ) + { + // ★Ÿ¨ˆĉŽè§Ĥ—Ĥ„Ş¨‚‚‚³ƒİ‚¤ƒ€ƒĵ§è·é›˘¨ĉ³•ç·š‚’èż”•Ş‘‚Œ°Ş‚‰Ş„ïĵ + normal = 0; + + //========================================================= + // AABBċˆ¤ċš + //========================================================= + if (aabb.Overlaps(cwork.aabb) == false) + return float.MaxValue; + + // ‚³ƒİ‚¤ƒ€ƒĵĉƒ…ċ ħ + float3 soldpos = cwork.oldPos.c0; + float3 eoldpos = cwork.oldPos.c1; + float3 spos = cwork.nextPos.c0; + float3 epos = cwork.nextPos.c1; + float sr = cwork.radius.x; + float er = cwork.radius.y; + + //========================================================= + // èĦçށ解ĉħş + //========================================================= + // ç§ğċ‹•ċ‰‚³ƒİ‚¤ƒ€ƒĵ位罁‹‚‰ĉŠĵ—ċ‡ş—ċı³é˘‚’ċ‰²‚Šċ‡ş™ + float t = MathUtility.ClosestPtPointSegmentRatio(nextpos, soldpos, eoldpos); + float r = math.lerp(sr, er, t); + float3 d = math.lerp(soldpos, eoldpos, t); + float3 v = nextpos - d; + + // ç§ğċ‹•ċ‰‚³ƒİ‚¤ƒ€ƒĵƒ­ƒĵ‚ЃЃ™‚ŻƒˆƒĞ + float3 lv = math.mul(cwork.inverseOldRot, v); + + // ç§ğċ‹•ċŒ‚³ƒİ‚¤ƒ€ƒĵĞċ¤‰ĉ› + d = math.lerp(spos, epos, t); + v = math.mul(cwork.rot, lv); + Develop.Assert(math.length(v) > 0.0f); + float3 n = math.normalize(v); + float3 c = d + n * (r + radius); + + // èĦçށĉ³•ç·š + normal = n; + + // c = ċı³é˘ä½ç½ + // n = ċı³é˘ĉ–ıċ‘ + // ċı³é˘èĦçށċˆ¤ċš¨ĉŠĵ—ċ‡ş— + return MathUtility.IntersectPointPlaneDist(c, n, nextpos, out nextpos); + } + + //========================================================================================= + // Edge Solver + //========================================================================================= + internal unsafe static void SolverEdgeConstraint( + DataChunk chunk, + // team + ref TeamManager.TeamData tdata, + ref ClothParameters param, + // vmesh + ref NativeArray attributes, + ref NativeArray vertexDepths, + ref NativeArray edges, + // particle + ref NativeArray nextPosArray, + // collider + ref NativeArray colliderFlagArray, + ref NativeArray colliderWorkDataArray, + // buffer2 + ref NativeArray tempVectorBufferA, + ref NativeArray tempVectorBufferB, + ref NativeArray tempCountBuffer, + ref NativeArray tempFloatBufferA + ) + { + if (tdata.UseColliderCount == 0) + return; + if (param.colliderCollisionConstraint.mode != Mode.Edge) + return; + if (chunk.IsValid == false) + return; + + // ■Edge + int* vecAPt = (int*)tempVectorBufferA.GetUnsafePtr(); + int* vecBPt = (int*)tempVectorBufferB.GetUnsafePtr(); + int* cntPt = (int*)tempCountBuffer.GetUnsafePtr(); + int* floatPt = (int*)tempFloatBufferA.GetUnsafePtr(); + + // â– è¨ˆç— + // ‚¨ƒƒ‚¸”¨ + int vstart = tdata.proxyCommonChunk.startIndex; + //int eindex = tdata.proxyEdgeChunk.startIndex; + int eindex = tdata.proxyEdgeChunk.startIndex + chunk.startIndex; + //for (int k = 0; k < tdata.proxyEdgeChunk.dataLength; k++, eindex++) + for (int k = 0; k < chunk.dataLength; k++, eindex++) + { + // ‚¨ƒƒ‚¸ĉƒ…ċ ħ + int2 edge = edges[eindex]; + int2 vE = edge + vstart; + var attrE0 = attributes[vE.x]; + var attrE1 = attributes[vE.y]; + // ä¸Ħĉ–ı¨‚‚ċ›şċšŞ‚‰ä¸èĤ + bool isMove0 = attrE0.IsMove(); + bool isMove1 = attrE1.IsMove(); + if (isMove0 == false && isMove1 == false) + continue; + int pstart = tdata.particleChunk.startIndex; + int2 pE = edge + pstart; + float3x2 nextPosE = new float3x2(nextPosArray[pE.x], nextPosArray[pE.y]); + float2 depthE = new float2(vertexDepths[vE.x], vertexDepths[vE.y]); + float2 radiusE = new float2(param.radiusCurveData.MC2EvaluateCurve(depthE.x), param.radiusCurveData.MC2EvaluateCurve(depthE.y)); + + // ƒƒĵƒ ‚ı‚ħƒĵƒĞċ€çއ + radiusE *= tdata.scaleRatio; + + // ĉŽè§Ĥċˆ¤ċš‚’èĦŒ†‚³ƒİ‚¤ƒ€ƒĵ‹‚‰ĉœ€ċ¤§è·é›˘ + // ƒ‘ƒĵƒ†‚£‚ŻƒĞ‚µ‚¤‚ş‹‚‰ç—ċ‡ş™‚‹ + float cfr = (radiusE.x + radiusE.y) * 0.5f * 1.0f; // 1.0f? + + // ĉŽè§Ĥ‚³ƒİ‚¤ƒ€ƒĵĉƒ…ċ ħ + float mindist = float.MaxValue; + int collisionColliderId = -1; + float3 collisionNormal = 0; + float3 n = 0; + + // ‚¨ƒƒ‚¸AABB + var aabbE = new AABB(nextPosE.c0 - radiusE.x, nextPosE.c0 + radiusE.x); + var aabbE1 = new AABB(nextPosE.c1 - radiusE.y, nextPosE.c1 + radiusE.y); + aabbE.Encapsulate(aabbE1); + aabbE.Expand(cfr); + + // ƒ‘ƒĵƒ†‚£‚ŻƒĞĉŠĵ—ċ‡ş—ĉƒ…ċ ħ + float3x2 addPos = 0; + int addCnt = 0; + float3 addN = 0; + + // ƒƒĵƒ ċ†…‚³ƒİ‚¤ƒ€ƒĵ‚’ƒĞƒĵƒ— + int cindex = tdata.colliderChunk.startIndex; + int ccnt = tdata.colliderCount; + for (int i = 0; i < ccnt; i++, cindex++) + { + var cflag = colliderFlagArray[cindex]; + if (cflag.IsSet(ColliderManager.Flag_Valid) == false) + continue; + if (cflag.IsSet(ColliderManager.Flag_Enable) == false) + continue; + + var ctype = DataUtility.GetColliderType(cflag); + var cwork = colliderWorkDataArray[cindex]; + float dist = 100.0f; + float3x2 _nextPos = nextPosE; + switch (ctype) + { + case ColliderManager.ColliderType.Sphere: + dist = EdgeSphereColliderDetection(ref _nextPos, radiusE, aabbE, cfr, cwork, out n); + break; + case ColliderManager.ColliderType.CapsuleX_Center: + case ColliderManager.ColliderType.CapsuleY_Center: + case ColliderManager.ColliderType.CapsuleZ_Center: + case ColliderManager.ColliderType.CapsuleX_Start: + case ColliderManager.ColliderType.CapsuleY_Start: + case ColliderManager.ColliderType.CapsuleZ_Start: + dist = EdgeCapsuleColliderDetection(ref _nextPos, radiusE, aabbE, cfr, cwork, out n); + break; + case ColliderManager.ColliderType.Plane: + dist = EdgePlaneColliderDetection(ref _nextPos, radiusE, cwork, out n); + break; + default: + Debug.LogError($"Unknown collider type:{ctype}"); + break; + } + + // ĉ˜Žç˘şŞĉŽè§Ĥ¨ĉŠĵ—ċ‡ş—‚‚Š + if (dist <= 0.0f) + { + // ĉŠĵ—ċ‡ş•‚ŒŸƒ™‚ŻƒˆƒĞ¨ĉŽè§Ĥĉ³•ç·š‚’™ıĤċŠ ç—™‚‹ + addPos += (_nextPos - nextPosE); + addN += n; + addCnt++; + } + + // ‚³ƒİ‚¤ƒ€ƒĵĞ一ċšè·é›˘èż‘„Ĥ„‚‹ċ ´ċˆïĵˆċ‹•ĉ‘İĉ“Ĥïĵé™ĉ­˘ĉ‘İĉ“ĤŒċ½ħ響™‚‹ïĵ‰ + if (dist <= cfr) + { + // ĉŽè§Ĥĉ³•ç·š‚’™ıĤċŠ ç——€Ÿ‚³ƒİ‚¤ƒ€ƒĵ§ĉœ€èż‘è·é›˘‚’記録™‚‹ + collisionColliderId = cindex; + collisionNormal += n; // ™ıĤċŠ ç—™‚‹ + mindist = math.min(mindist, dist); + } + } + + // ĉœ€çµ‚ä½ç½ + // ċı³ċ‡ċŒ–™‚‹ + if (addCnt > 0) + { + // ċˆĉˆ•‚ŒŸĉŽè§Ĥĉ³•ç·šé•·•Ğĉݔ䋁—Ĥƒ‘ƒĵƒ†‚£‚ŻƒĞç§ğċ‹•‚’ċˆĥ限™‚‹ + // “‚ŒĞ‚ˆ‚Šïĵ’¤‚³ƒİ‚¤ƒ€ƒĵĞĉŒŸ‚ŒŸƒ‘ƒĵƒ†‚£‚ŻƒĞŒĉš´‚ŒŞŞ‚‹ + addN /= addCnt; + float len = math.length(addN); + if (len > Define.System.Epsilon) + { + float t = math.min(len, 1.0f); + addPos /= addCnt; + addPos *= t; + + // ĉ›¸ĉˆğ— + InterlockUtility.AddFloat3(pE.x, addPos.c0, cntPt, vecAPt); + InterlockUtility.AddFloat3(pE.y, addPos.c1, cntPt, vecAPt); + } + } + + // ĉ‘İĉ“Ĥ係ĉ•°(friction)集計 + if (collisionColliderId >= 0 && cfr > 0.0f && math.lengthsq(collisionNormal) > 1e-06f) + { + // ‚³ƒİ‚¤ƒ€ƒĵ‹‚‰è·é›˘Ğ‚ˆ‚Šċ¤‰ċŒ–(0.0~ĉŽċœ°é˘1.0) + //Develop.Assert(cfr > 0.0f); + var friction = 1.0f - math.saturate(mindist / cfr); + + // ĉ‘İĉ“Ĥ用ĉŽè§Ĥĉ³•ç·šċı³ċ‡ċŒ– + //Develop.Assert(math.length(collisionNormal) > 0.0f); + collisionNormal = math.normalize(collisionNormal); + + if (isMove0) + { + InterlockUtility.Max(pE.x, friction, floatPt); + InterlockUtility.AddFloat3(pE.x, collisionNormal, vecBPt); + } + if (isMove1) + { + InterlockUtility.Max(pE.y, friction, floatPt); + InterlockUtility.AddFloat3(pE.y, collisionNormal, vecBPt); + } + } + } + } + + internal unsafe static void SumEdgeConstraint( + DataChunk chunk, + // team + ref TeamManager.TeamData tdata, + ref ClothParameters param, + // particle + ref NativeArray nextPosArray, + ref NativeArray frictionArray, + ref NativeArray collisionNormalArray, + // buffer2 + ref NativeArray tempVectorBufferA, + ref NativeArray tempVectorBufferB, + ref NativeArray tempCountBuffer, + ref NativeArray tempFloatBufferA + ) + { + if (tdata.UseColliderCount == 0) + return; + if (param.colliderCollisionConstraint.mode != Mode.Edge) + return; + if (chunk.IsValid == false) + return; + + // ■Edge + int* vecAPt = (int*)tempVectorBufferA.GetUnsafePtr(); + int* vecBPt = (int*)tempVectorBufferB.GetUnsafePtr(); + int* cntPt = (int*)tempCountBuffer.GetUnsafePtr(); + int* floatPt = (int*)tempFloatBufferA.GetUnsafePtr(); + + // ■集計 + // ƒ‘ƒĵƒ†‚£‚ŻƒĞ”¨ + //int pindex = tdata.particleChunk.startIndex; + //int vindex = tdata.proxyCommonChunk.startIndex; + int pindex = tdata.particleChunk.startIndex + chunk.startIndex; + int vindex = tdata.proxyCommonChunk.startIndex + chunk.startIndex; + //for (int k = 0; k < tdata.particleChunk.dataLength; k++, pindex++, vindex++) + for (int k = 0; k < chunk.dataLength; k++, pindex++, vindex++) + { + // nextpos + int count = tempCountBuffer[pindex]; + if (count > 0) + { + float3 add = InterlockUtility.ReadAverageFloat3(pindex, cntPt, vecAPt); + + // ĉ›¸ċ‡ş— + nextPosArray[pindex] = nextPosArray[pindex] + add; + } + + // friction + float f = InterlockUtility.ReadFloat(pindex, floatPt); + if (f > 0.0f && f > frictionArray[pindex]) + { + frictionArray[pindex] = f; + } + + // collision normal + float3 n = InterlockUtility.ReadFloat3(pindex, vecBPt); + if (math.lengthsq(n) > 0.0f) + { + n = math.normalize(n); + collisionNormalArray[pindex] = n; + } + + // ƒƒƒƒ•‚Ħ‚ŻƒŞ‚˘ + tempVectorBufferA[pindex] = 0; + tempVectorBufferB[pindex] = 0; + tempCountBuffer[pindex] = 0; + tempFloatBufferA[pindex] = 0; + } + } + + static float EdgeSphereColliderDetection( + ref float3x2 nextPosE, + in float2 radiusE, + in AABB aabbE, + float cfr, + in ColliderManager.WorkData cwork, + out float3 normal + ) + { + // ★Ÿ¨ˆĉŽè§Ĥ—Ĥ„Ş¨‚‚‚³ƒİ‚¤ƒ€ƒĵ§è·é›˘¨ĉ³•ç·š‚’èż”•Ş‘‚Œ°Ş‚‰Ş„ïĵ + normal = 0; + + //========================================================= + // AABBċˆ¤ċš + //========================================================= + if (aabbE.Overlaps(cwork.aabb) == false) + return float.MaxValue; + + // ‚³ƒİ‚¤ƒ€ƒĵĉƒ…ċ ħ + float3 coldpos = cwork.oldPos.c0; + float3 cpos = cwork.nextPos.c0; + float cradius = cwork.radius.x; + + //========================================================= + // èĦçށċˆ¤ċš + //========================================================= + // ç§ğċ‹•ċ‰çƒĞċ݁™‚‹ç·šċˆ†ĉœ€èż‘ĉŽç‚ı + float s; + s = MathUtility.ClosestPtPointSegmentRatio(coldpos, nextPosE.c0, nextPosE.c1); + float3 c = math.lerp(nextPosE.c0, nextPosE.c1, s); + + // ĉœ€èż‘ĉŽç‚ıè·é›˘ + var v = c - coldpos; + float clen = math.length(v); + if (clen < 1e-09f) + return float.MaxValue; + + // ĉŠĵ—ċ‡ş—ĉ³•ç·š + float3 n = v / clen; + normal = n; + + // ċ¤‰ä½ + float3 db = cpos - coldpos; + + // ċ¤‰ä½‚’nĞĉŠ•ċ½ħ—Ĥè·é›˘ƒ‚§ƒƒ‚Ż + float l1 = math.dot(n, db); + float l = clen - l1; + + // ċŽšż + float rA = math.lerp(radiusE.x, radiusE.y, s); + float rB = cradius; + float thickness = rA + rB; + + // ĉŽè§Ĥċˆ¤ċš + if (l > (thickness + cfr)) + return float.MaxValue; + + //========================================================= + // èĦçށ解ĉħş + //========================================================= + // ĉŽè§Ĥĉ³•ç·šĞçċœ¨è·é›˘‚’ĉŠ•ċ½ħ•›‚‹ + v = c - cpos; + l = math.dot(n, v); + if (l > thickness) + { + // ĉŽè§ĤŞ— + // ĉŽè§Ĥ面§è·é›˘‚’èż”™ + return l - thickness; + } + + // 離™è·é›˘ + float C = thickness - l; + + // ‚¨ƒƒ‚¸ż‚’ċĵ•é›˘™ + //float b0 = 1.0f - t; + //float b1 = t; + float2 b = new float2(1.0f - s, s); + + //float3 grad0 = n * b0; + //float3 grad1 = n * b1; + float3x2 grad = new float3x2(n * b.x, n * b.y); + + //float S = b0 * b0 + b1 * b1; + float S = math.dot(b, b); + if (S == 0.0f) + return float.MaxValue; + + S = C / S; + + //float3 corr0 = S * grad0; + //float3 corr1 = S * grad1; + float3x2 corr = grad * S; + + //========================================================= + // ċĉ˜  + //========================================================= + nextPosE += corr; + + // ĉŠĵ—ċ‡ş—è·é›˘‚’èż”™ + return -C; + } + + static float EdgeCapsuleColliderDetection( + ref float3x2 nextPosE, + in float2 radiusE, + in AABB aabbE, + float cfr, + in ColliderManager.WorkData cwork, + out float3 normal + ) + { + // ★Ÿ¨ˆĉŽè§Ĥ—Ĥ„Ş¨‚‚‚³ƒİ‚¤ƒ€ƒĵ§è·é›˘¨ĉ³•ç·š‚’èż”•Ş‘‚Œ°Ş‚‰Ş„ïĵ + normal = 0; + + //========================================================= + // AABBċˆ¤ċš + //========================================================= + if (aabbE.Overlaps(cwork.aabb) == false) + return float.MaxValue; + + // ‚³ƒİ‚¤ƒ€ƒĵĉƒ…ċ ħ + float3 soldpos = cwork.oldPos.c0; + float3 eoldpos = cwork.oldPos.c1; + float3 spos = cwork.nextPos.c0; + float3 epos = cwork.nextPos.c1; + float sr = cwork.radius.x; + float er = cwork.radius.y; + + //========================================================= + // èĦçށċˆ¤ċš + //========================================================= + // ç§ğċ‹•ċ‰ïĵ’¤ç·šċˆ†ĉœ€èż‘ĉŽç‚ı + float s, t; + float3 cA, cB; + float csqlen = MathUtility.ClosestPtSegmentSegment(nextPosE.c0, nextPosE.c1, soldpos, eoldpos, out s, out t, out cA, out cB); + float clen = math.sqrt(csqlen); // ĉœ€èż‘ĉŽç‚ıè·é›˘ + if (clen < 1e-09f) + return float.MaxValue; + + // ĉŠĵċ‡şĉ³•ç·š + var v = cA - cB; + float3 n = v / clen; + normal = n; + +#if !MC2_DISABLE_EDGE_COLLISION_EXTENSION + // ★‚Ѓ—‚ğƒĞċŠċ„‚’考ĉ…—Ÿè£œĉ­£ + // “‚Œ§‚¨ƒƒ‚¸-‚Ѓ—‚ğƒĞċˆ¤ċšŻ‚Ğƒ—‚ğƒĞċŠċ„Œċ§‹ç‚ı¨çµ‚ç‚ı§ċŒ˜§‚‚‹“¨Œċ‰ĉ¨Ş£Ĥ„Ÿ + // Ÿ‚‚Ѓ—‚ğƒĞċ§‹ç‚ı¨çµ‚ç‚ıċŠċ„Œç•°Ş‚‹¨é–“違£ŸèĦçށċˆ¤ċšŒèĦŒ‚‚ŒĤ—„€‚ŒŒċŽŸċ› §ċ¤§ŞĉŒŻċ‹•Œç™şç”Ÿ—Ĥ„Ÿ + // ïĵˆ“‚ŒŻBoneCloth‚ˆ†Ğ‚Ѓ—‚ğƒĞ‚¨ƒƒ‚¸‚ˆ‚ŠƒĦƒƒ‚·ƒ‚¨ƒƒ‚¸ğ†Œé•·„ċ ´ċˆĞéĦ•è‘—ĞŞ‚‹ïĵ‰ + // “§ċ§‹ç‚ı¨çµ‚ç‚ıċŠċ„Œç•°Ş‚‹ċ ´ċˆŻ€ĉœ€ċˆè¨ˆç—ĉœ€èż‘ĉŽç‚ıĉ–ıċ‘‹‚‰‚Ѓ—‚ğƒĞ‚¨ƒƒ‚¸‚’ċŠċ„ċˆ†‚·ƒ•ƒˆ—€ + // ‚Œ‚’‚‚¨Ğċ†ċşĤ‚¨ƒƒ‚¸-‚¨ƒƒ‚¸ċˆ¤ċš‚’èĦŒ†‚ˆ†Ğäżĉ­£—Ÿ + // “‚ŒŻċŒç’§§ŻŞ„ŒŠŠ‚ˆç†ĉƒ³çš„Şċˆ¤ċš‚’èĦŒ†‚ˆ†ĞŞ‚Š€ŸĉŒŻċ‹•ċ•éĦŒ‚‚ċ¤§ċı…Ğè§£ĉħş§‚‹ + // ïĵˆŸ —ċ°ċˆğżŞĉŒŻċ‹•Ż ç™şç”Ÿ™‚‹“¨Œ‚‚‹ïĵ‰ + if (sr != er) + { + // ĉŠĵ—ċ‡ş—ĉ³•ç·šĉ–ıċ‘Ğ‚Ѓ—‚ğƒĞċŠċ„‚’考ĉ…—Ĥ‚Ѓ—‚ğƒĞä¸­ċżƒç·š‚’‚·ƒ•ƒˆ•›‚‹ + float3 soldpos2 = soldpos + n * sr; + float3 eoldpos2 = eoldpos + n * er; + + // “ç·šċˆ†§ċ†³ĉœ€èż‘ĉŽç‚ı(s/t)‚’計痁™‚‹ + MathUtility.ClosestPtSegmentSegment2(nextPosE.c0, nextPosE.c1, soldpos2, eoldpos2, out s, out t); + + // ĉœ€çµ‚çš„ĞŻ“‚·ƒ•ƒˆċŒs¨t‚’ċˆİ用™‚‹‚ˆ†Ğ結ĉžœ‚’ĉ›¸ĉ›ˆ‚‹ + cA = math.lerp(nextPosE.c0, nextPosE.c1, s); + cB = math.lerp(soldpos, eoldpos, t); + v = cA - cB; + clen = math.length(v); + n = v / clen; + normal = n; + } +#endif + + // ċ¤‰ä½ + float3 dB0 = spos - soldpos; + float3 dB1 = epos - eoldpos; + + + // ĉœ€èż‘ĉŽç‚ı§ċ¤‰ä½ + float3 db = math.lerp(dB0, dB1, t); + + // ċ¤‰ä½da,db‚’nĞĉŠ•ċ½ħ—Ĥè·é›˘ƒ‚§ƒƒ‚Ż + float l1 = math.dot(n, db); + float l = clen - l1; + + // ċŽšż + float rA = math.lerp(radiusE.x, radiusE.y, s); + float rB = math.lerp(sr, er, t); + float thickness = rA + rB; + + // ĉŽè§Ĥċˆ¤ċš + if (l > (thickness + cfr)) + return float.MaxValue; + + //========================================================= + // èĦçށ解ĉħş + //========================================================= + // ĉŽè§Ĥĉ³•ç·šĞçċœ¨è·é›˘‚’ĉŠ•ċ½ħ•›‚‹ + var d = math.lerp(spos, epos, t); + v = cA - d; + l = math.dot(n, v); + //Debug.Log($"l:{l}"); + if (l > thickness) + { + // ĉŽè§ĤŞ— + // ĉŽè§Ĥ面§è·é›˘‚’èż”™ + return l - thickness; + } + + // 離™è·é›˘ + float C = thickness - l; + //Debug.Log($"C:{C}"); + + // ‚¨ƒƒ‚¸ż‚’ċĵ•é›˘™ + //float b0 = 1.0f - s; + //float b1 = s; + float2 b = new float2(1.0f - s, s); + + //float3 grad0 = n * b0; + //float3 grad1 = n * b1; + float3x2 grad = new float3x2(n * b.x, n * b.y); + + //float S = invMass0 * b0 * b0 + invMass1 * b1 * b1; + float S = math.dot(b, b); + if (S == 0.0f) + return float.MaxValue; + + S = C / S; + + //float3 corr0 = S * invMass0 * grad0; + //float3 corr1 = S * invMass1 * grad1; + float3x2 corr = grad * S; + + //========================================================= + // ċĉ˜  + //========================================================= + nextPosE += corr; + + // ĉŠĵ—ċ‡ş—è·é›˘‚’èż”™ + return -C; + } + + static float EdgePlaneColliderDetection( + ref float3x2 nextPosE, + in float2 radiusE, + in ColliderManager.WorkData cwork, + out float3 normal + ) + { + // ★Ÿ¨ˆĉŽè§Ĥ—Ĥ„Ş¨‚‚‚³ƒİ‚¤ƒ€ƒĵ§è·é›˘¨ĉ³•ç·š‚’èż”•Ş‘‚Œ°Ş‚‰Ş„ïĵ + + // ‚³ƒİ‚¤ƒ€ƒĵĉƒ…ċ ħ + var cpos = cwork.nextPos.c0; + var n = cwork.oldPos.c0; // ““ĞĉŠĵ—ċ‡ş—ĉ³•ç·š + + // èĦçށĉ³•ç·š + normal = n; + + // c = ċı³é˘ä½ç½ + // n = ċı³é˘ĉ–ıċ‘ + // ċı³é˘èĦçށċˆ¤ċš¨ĉŠĵ—ċ‡ş— + // ċı³é˘¨è·é›˘‚’èż”™ïĵˆĉŠĵ—ċ‡ş—ċ ´ċˆŻ0.0ïĵ‰ + float dist0 = MathUtility.IntersectPointPlaneDist(cpos + n * radiusE.x, n, nextPosE.c0, out nextPosE.c0); + float dist1 = MathUtility.IntersectPointPlaneDist(cpos + n * radiusE.y, n, nextPosE.c1, out nextPosE.c1); + + return math.min(dist0, dist1); + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/ColliderCollisionConstraint.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/ColliderCollisionConstraint.cs.meta new file mode 100644 index 00000000..a387541d --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/ColliderCollisionConstraint.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 2fd00990cb70cd54d99a32756b3ccc84 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/ColliderCollisionConstraint.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/DistanceConstraint.cs b/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/DistanceConstraint.cs new file mode 100644 index 00000000..55fd7174 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/DistanceConstraint.cs @@ -0,0 +1,536 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System; +using System.Collections.Generic; +using System.Text; +using Unity.Collections; +using Unity.Mathematics; +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// è·é›˘ċˆĥ約 + /// + public class DistanceConstraint : IDisposable + { + [System.Serializable] + public class SerializeData : IDataValidate + { + /// + /// Overall connection stiffness (0.0 ~ 1.0). + /// ċ…¨ä½“çš„ŞĉŽçĥšċ‰›ĉ€§(0.0 ~ 1.0) + /// [OK] Runtime changes. + /// [OK] Export/Import with Presets + /// + public CurveSerializeData stiffness; + + public SerializeData() + { + stiffness = new CurveSerializeData(1.0f, 1.0f, 0.5f, false); + } + + public void DataValidate() + { + stiffness.DataValidate(0.0f, 1.0f); + } + + public SerializeData Clone() + { + return new SerializeData() + { + stiffness = stiffness.Clone(), + }; + } + } + + public struct DistanceConstraintParams + { + /// + /// ċ‰›ĉ€§ + /// + public float4x4 restorationStiffness; + + /// + /// è·é›˘ċˆĥ約é€ŸċşĤĉ¸›èĦ°çއ(0.0 ~ 1.0) + /// + public float velocityAttenuation; + + public void Convert(SerializeData sdata, ClothProcess.ClothType clothType) + { + switch (clothType) + { + case ClothProcess.ClothType.BoneCloth: + case ClothProcess.ClothType.MeshCloth: + restorationStiffness = sdata.stiffness.ConvertFloatArray(); + break; + case ClothProcess.ClothType.BoneSpring: + // BoneSpringŻċšĉ•° + restorationStiffness = Define.System.BoneSpringDistanceStiffness; + break; + } + velocityAttenuation = Define.System.DistanceVelocityAttenuation; + } + } + + //========================================================================================= + /// + /// ĉŽçĥš‚ż‚¤ƒ—ĉ•° + /// + public const int TypeCount = 2; + + /// + /// ċˆĥ約ƒ‡ƒĵ‚ż + /// + [System.Serializable] + public class ConstraintData : IValid + { + public ResultCode result; + + public uint[] indexArray; + public ushort[] dataArray; + public float[] distanceArray; + + public bool IsValid() + { + return indexArray != null && indexArray.Length > 0; + } + } + + /// + /// ƒ‘ƒĵƒ†‚£‚ŻƒĞ”¨ƒ‡ƒĵ‚żé–‹ċ§‹‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı¨ƒ‡ƒĵ‚żĉ•°‚’ïĵ‘¤uint(10-22)Ğƒ‘ƒƒ‚݁—Ÿ‚‚ + /// + public ExNativeArray indexArray; + + /// + /// ĉŽçĥšƒ‘ƒĵƒ†‚£‚ŻƒĞƒŞ‚ıƒˆ + /// + public ExNativeArray dataArray; + + /// + /// ċŻèħĦ¸ċŸşĉş–è·é›˘ƒŞ‚ıƒˆ + /// Ÿ —çĴĤċ·Ğ‚ˆ‚Š‚ż‚¤ƒ—‚’示™(+:Vertical, -:Horizontal) + /// + public ExNativeArray distanceArray; + + /// + /// ç™ğ録ƒ‡ƒĵ‚żĉ•°‚’èż”™ + /// + public int DataCount => indexArray?.Count ?? 0; + + //========================================================================================= + public DistanceConstraint() + { + indexArray = new ExNativeArray(0, true); + dataArray = new ExNativeArray(0, true); + distanceArray = new ExNativeArray(0, true); + } + + public void Dispose() + { + indexArray?.Dispose(); + dataArray?.Dispose(); + distanceArray?.Dispose(); + } + + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.AppendLine($"[DistanceConstraint]"); + sb.AppendLine($" -indexArray:{indexArray.ToSummary()}"); + sb.AppendLine($" -dataArray:{dataArray.ToSummary()}"); + sb.AppendLine($" -distanceArray:{distanceArray.ToSummary()}"); + + return sb.ToString(); + } + + //========================================================================================= + /// + /// ċˆĥ約ƒ‡ƒĵ‚żä½œĉˆ + /// + /// + public static ConstraintData CreateData(VirtualMesh proxyMesh, in ClothParameters parameters) + { + var constraintData = new ConstraintData(); + + NativeParallelMultiHashMap vvMap = default; + + try + { + int vcnt = proxyMesh.VertexCount; + + // 頂ç‚ıĉŽçĥšé ‚ç‚ı配ċˆ—‚’MultiHashMapĞċ¤‰ĉ›™‚‹ + vvMap = JobUtility.ToNativeMultiHashMap(proxyMesh.vertexToVertexIndexArray, proxyMesh.vertexToVertexDataArray); + + var connectSet = new HashSet(); + using var verticalConnection = new MultiDataBuilder(vcnt, vcnt * 2); + using var horizontalConnection = new MultiDataBuilder(vcnt, vcnt * 2); + + // ĉ§‹é€ ĉŽçĥš + for (int i = 0; i < vcnt; i++) + { + if (vvMap.ContainsKey(i) == false) + continue; + + var attr = proxyMesh.attributes[i]; + int pindex = proxyMesh.vertexParentIndices[i]; + + foreach (var data in vvMap.GetValuesForKey(i)) + { + int tindex = data; + var t_attr = proxyMesh.attributes[tindex]; + int t_pindex = proxyMesh.vertexParentIndices[tindex]; + + // ä¸Ħĉ–ı¨‚‚ċ›şċšŞ‚‰°ç„ĦċŠı + if (attr.IsMove() == false && t_attr.IsMove() == false) + continue; + + // ïĵ‘ç‚ı§‚‚ç„ĦċŠıŞ‚‰é™¤ċ¤–™‚‹ + if (attr.IsInvalid() || t_attr.IsInvalid()) + continue; + + // ç™ğ録 + if (tindex == pindex || i == t_pindex) + { + // ƒ™ƒĵ‚ıƒİ‚¤ƒ³ + verticalConnection.Add(i, data); + } + else + { + // ‚Œäğċ¤– + horizontalConnection.Add(i, data); + } + uint pack = DataUtility.Pack32Sort(i, tindex); + connectSet.Add(pack); + //Debug.Log($"({i} - {tindex})"); + } + } + +#if true + // shearĉŽçĥšïĵˆĉ¨ŞĉŽçĥš¨—Ĥç™ğ録ïĵ‰ + if (proxyMesh.edgeToTriangles.IsCreated) + { + int ecnt = proxyMesh.EdgeCount; + for (int l = 0; l < ecnt; l++) + { + int2 edge = proxyMesh.edges[l]; + var tset = proxyMesh.edgeToTriangles.MC2ToFixedList128Bytes(edge); + int tcnt = tset.Length; + if (tcnt < 2) + continue; + + // p3 + + // / \ + // p1 +---+ p2 + // \ / + // p4 + + var p1 = proxyMesh.localPositions[edge.x]; + var p2 = proxyMesh.localPositions[edge.y]; + float edgeLength1 = math.length(p1 - p2); + if (edgeLength1 < Define.System.Epsilon) + continue; + var v1 = math.normalize(p1 - p2); + var cen = (p1 + p2) * 0.5f; + + for (int i = 0; i < tcnt - 1; i++) + { + int3 tri1 = proxyMesh.triangles[tset[i]]; + int e3 = MathUtility.GetUnuseTriangleIndex(tri1, edge); + var p3 = proxyMesh.localPositions[e3]; + var attr3 = proxyMesh.attributes[e3]; + var n1 = MathUtility.TriangleNormal(p1, p2, p3); + for (int j = i + 1; j < tcnt; j++) + { + int3 tri2 = proxyMesh.triangles[tset[j]]; + int e4 = MathUtility.GetUnuseTriangleIndex(tri2, edge); + var p4 = proxyMesh.localPositions[e4]; + var attr4 = proxyMesh.attributes[e4]; + var n2 = MathUtility.TriangleNormal(p1, p2, p4); + + // ä¸Ħĉ–ı¨‚‚ċ›şċšŞ‚‰°ç„ĦċŠı + if (attr3.IsMove() == false && attr4.IsMove() == false) + continue; + + // (1)ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞċ†…è§’Œğĵĉ°´ċı³‹ƒ‚§ƒƒ‚Ż + // 20ċşĤ:0.9396926f + float dot = math.abs(math.dot(n1, n2)); + if (dot < 0.9396926f) + continue; + + // (2)ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞƒš‚˘ïĵ’¤ċŻè§’ç·šé•·•Œä¸€ċšäğċ†…Ş‚‰ĉ­£ĉ–ıċ½˘¨ċˆ¤ċš™‚‹ + float edgeLength2 = math.length(p3 - p4); + float ratio = math.abs(edgeLength2 / edgeLength1 - 1.0f); + if (ratio <= 0.3f) + { + // ĉ­£ĉ–ıċ½˘ + // ċŻè§’ç·š(p3-p4)‚’Shear¨—ĤĉŽçĥš™‚‹ + uint pack = DataUtility.Pack32Sort(e3, e4); + if (connectSet.Contains(pack) == false) + { + connectSet.Add(pack); + horizontalConnection.Add(e3, (ushort)e4); + horizontalConnection.Add(e4, (ushort)e3); + } + } + } + } + } + } +#endif + // ċˆĥ約ƒ‡ƒĵ‚żç™ğ録 + (var dataArryaV, var indexArrayV) = verticalConnection.ToArray(); + (var dataArryaH, var indexArrayH) = horizontalConnection.ToArray(); + + // ™ıĤç„ĦċŠıċħžĉ€§Şİƒ‡ƒĵ‚żŒnullċ ´ċˆ‚‚‚‚‹ + int total = (dataArryaV?.Length ?? 0) + (dataArryaH?.Length ?? 0); + if (total > 0) + { + var indexList = new List(vcnt); + var dataList = new List(total); + var distanceList = new List(total); + for (int i = 0; i < vcnt; i++) + { + int start = dataList.Count; + int cnt = 0; + + float3 pos = proxyMesh.localPositions[i]; + + for (int k = 0; k < TypeCount; k++) + { + DataUtility.Unpack12_20(k == 0 ? indexArrayV[i] : indexArrayH[i], out var dcnt, out var dstart); + for (int j = 0; j < dcnt; j++) + { + ushort data = k == 0 ? dataArryaV[dstart + j] : dataArryaH[dstart + j]; + var tpos = proxyMesh.localPositions[data]; + float dist = math.distance(pos, tpos); + + // ‚ĵƒ­è·é›˘‚‚èލ‚‚‹(v2.17.0) + dataList.Add(data); + distanceList.Add(dist < 1e-08f ? 0.0f : (k == 0 ? dist : -dist)); // ƒž‚¤ƒŠ‚ıŻhorizontal‚ż‚¤ƒ— + cnt++; + } + } + + uint pack = DataUtility.Pack12_20(cnt, start); + indexList.Add(pack); + } + + constraintData.indexArray = indexList.ToArray(); + constraintData.dataArray = dataList.ToArray(); + constraintData.distanceArray = distanceList.ToArray(); + } + + constraintData.result.SetSuccess(); + } + catch (Exception exception) + { + Debug.LogError(exception); + constraintData.result.SetError(Define.Result.Constraint_CreateDistanceException); + throw; + } + finally + { + if (vvMap.IsCreated) + vvMap.Dispose(); + } + + return constraintData; + } + + //========================================================================================= + /// + /// ċˆĥ約ƒ‡ƒĵ‚ż‚’ç™ğ録™‚‹ + /// + /// + internal void Register(ClothProcess cprocess) + { + if (cprocess?.distanceConstraintData?.IsValid() ?? false) + { + ref var tdata = ref MagicaManager.Team.GetTeamDataRef(cprocess.TeamId); + + tdata.distanceStartChunk = indexArray.AddRange(cprocess.distanceConstraintData.indexArray); + tdata.distanceDataChunk = dataArray.AddRange(cprocess.distanceConstraintData.dataArray); + distanceArray.AddRange(cprocess.distanceConstraintData.distanceArray); + } + } + + /// + /// ċˆĥ約ƒ‡ƒĵ‚ż‚’解除™‚‹ + /// + /// + internal void Exit(ClothProcess cprocess) + { + if (cprocess != null && cprocess.TeamId > 0) + { + ref var tdata = ref MagicaManager.Team.GetTeamDataRef(cprocess.TeamId); + + indexArray.Remove(tdata.distanceStartChunk); + dataArray.Remove(tdata.distanceDataChunk); + distanceArray.Remove(tdata.distanceDataChunk); + + tdata.distanceStartChunk.Clear(); + tdata.distanceDataChunk.Clear(); + } + } + + //========================================================================================= + // Solver + //========================================================================================= + internal static void SolverConstraint( + DataChunk chunk, + float4 simulationPower, + // team + ref TeamManager.TeamData tdata, + ref ClothParameters param, + // vmesh + ref NativeArray attributes, + ref NativeArray depthArray, + // particle + ref NativeArray nextPosArray, + ref NativeArray basePosArray, + ref NativeArray velocityPosArray, + ref NativeArray frictionArray, + // constrants + ref NativeArray indexArray, + ref NativeArray dataArray, + ref NativeArray distanceArray + ) + { + var sc = tdata.distanceStartChunk; + var dc = tdata.distanceDataChunk; + if (sc.dataLength == 0) + return; + int c_start = sc.startIndex; + int d_start = dc.startIndex; + + // ċİċ…ƒ‚’ċŸşĉœĴċ§żċ‹˘§èĦŒ†‹‚˘ƒ‹ƒĦƒĵ‚·ƒ§ƒ³ċŒċ§żċ‹˘§èĦŒ†‹ċˆ¤ċš + float animeRatio = tdata.animationPoseRatio; + + // ‚ı‚ħƒĵƒĞċ€çއ + float scl = tdata.InitScale * tdata.scaleRatio; + + bool isSpring = tdata.IsSpring; + + // ƒ‘ƒĵƒ†‚£‚ŻƒĞ”¨ + int p_start = tdata.particleChunk.startIndex; + int pindex = p_start + chunk.startIndex; + //int pindex = p_start; + int v_start = tdata.proxyCommonChunk.startIndex; + int vindex = v_start + chunk.startIndex; + //int vindex = v_start; + int dataIndex = chunk.startIndex; + //int dataIndex = 0; + //for (int k = 0; k < tdata.particleChunk.dataLength; k++, pindex++, vindex++, dataIndex++) + for (int k = 0; k < chunk.dataLength; k++, pindex++, vindex++, dataIndex++) + { + // ƒ‘ƒĵƒ†‚£‚ŻƒĞĉƒ…ċ ħ + var nextPos = nextPosArray[pindex]; + var attr = attributes[vindex]; + float depth = depthArray[vindex]; + float friction = frictionArray[pindex]; + + if (attr.IsInvalid()) + continue; + + // Springċˆİ用中Żċ›şċš‚‚通™ + if (attr.IsDontMove() && isSpring == false) + continue; + + // ċ›şċšç‚ıé‡é‡ + float fixMass = isSpring ? 10.0f : 50.0f; + + // 重量 + // BoneSpring§Żċ›şċšç‚ıé‡é‡ċŠ ç—‚’èĦŒ‚Ş„ + float invMass = MathUtility.CalcInverseMass(friction, depth, attr.IsDontMove(), fixMass); + + // ċŸşĉœĴċ‰›ĉ€§ + float stiffness = param.distanceConstraint.restorationStiffness.MC2EvaluateCurveClamp01(depth); + stiffness *= simulationPower.y; + + //var pack = indexArray[c_start + k]; + var pack = indexArray[c_start + dataIndex]; + DataUtility.Unpack12_20(pack, out int dcnt, out int dstart); + + if (dcnt > 0) + { + // ċŸşĉş–ċş§ĉ¨™‚’ċˆ‡‚Šĉ›żˆ + float3 basePos = basePosArray[pindex]; + + float3 addPos = 0; + int addCnt = 0; + + int start = d_start + dstart; + for (int i = 0; i < dcnt; i++) + { + int t_l_index = dataArray[start + i]; + float restDist = distanceArray[start + i]; + + // ‚ż‚¤ƒ—ċˆċ‰›ĉ€§ + float finalStiffness = math.saturate(restDist >= 0.0f ? stiffness : stiffness * Define.System.DistanceHorizontalStiffness); + + // 相ĉ‰‹ƒ‘ƒĵƒ†‚£‚ŻƒĞĉƒ…ċ ħ + int tpindex = p_start + t_l_index; + int tvindex = v_start + t_l_index; + var t_nextPos = nextPosArray[tpindex]; + float3 t_basePos = basePosArray[tpindex]; + float t_depth = depthArray[tvindex]; + float t_friction = frictionArray[tpindex]; + var t_attr = attributes[tvindex]; + + var v = t_nextPos - nextPos; + + // ‚ĵƒ­è·é›˘ċŻċżœ(v2.17.0) + if(restDist == 0.0f) + { + // ‚ĵƒ­è·é›˘Żċ˜Ğ中ç‚ı§çµċˆ•›‚‹ + // AnimationPoseRatio‚‚ç„Ħ関係 + addPos = v * 0.5f; + addCnt++; + } + else + { + // 重量 + // BoneSpring§Żċ›şċšç‚ıé‡é‡ċŠ ç—‚’èĦŒ‚Ş„ + float t_invMass = MathUtility.CalcInverseMass(t_friction, t_depth, t_attr.IsDontMove(), fixMass); + + // ċİċ…ƒ™‚‹é•·• + // !Distanceċˆĥ約ŻċˆĉœŸċŒ–ĉ™‚Ğ保ċ­˜—Ÿè·é›˘‚’èĤ‹‚‹‚ˆ†Ğ—Ş„¨é§„ç› + // ƒ•ƒİ‚°Ğ‚ˆ‚ŠċˆĉœŸċ€¤‹‚˘ƒ‹ƒĦƒĵ‚·ƒ§ƒ³ċŒċ§żċ‹˘‹‚’ċˆ‡‚Šĉ›żˆ‚‹ + float restLength = math.lerp(math.abs(restDist) * scl, math.distance(basePos, t_basePos), animeRatio); + + // çċœ¨é•·• + float distance = math.length(v); + + // è·é›˘ŒğĵïĵŞ‚‰°ċ‡Ĥ理‚’‚ı‚­ƒƒƒ—™‚‹ïĵˆ‚¨ƒİƒĵċ›žéżïĵ‰ + if (distance < Define.System.Epsilon) + continue; + + // äĵ¸ç¸ + float3 n = math.normalize(v); + float3 corr = (distance - restLength) * finalStiffness * n / (invMass + t_invMass); + float3 corr0 = invMass * corr; + //float3 corr1 = -t_invMass * corr; // 相ĉ‰‹ċ´(ä½żç”¨—Ş„) + + // ™ıĤċŠ ç—™‚‹ + addPos += corr0; + addCnt++; + } + } + + // ĉœ€çµ‚ä½ç½ + if (addCnt > 0) + { + addPos = addPos / addCnt; // ċı³ċ‡ċŒ– + nextPos += addPos; + nextPosArray[pindex] = nextPos; + + // 速ċşĤċ½ħ響 + float attn = param.distanceConstraint.velocityAttenuation; + velocityPosArray[pindex] = velocityPosArray[pindex] + addPos * attn; + } + } + } + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/DistanceConstraint.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/DistanceConstraint.cs.meta new file mode 100644 index 00000000..305dd349 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/DistanceConstraint.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 78c9fce0ef596d444be169932d9e9b6d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/DistanceConstraint.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/InertiaConstraint.cs b/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/InertiaConstraint.cs new file mode 100644 index 00000000..02892b47 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/InertiaConstraint.cs @@ -0,0 +1,636 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System; +using System.Text; +using Unity.Mathematics; +using UnityEngine; +using UnityEngine.Serialization; + +namespace MagicaCloth2 +{ + /// + /// Inertia and travel/rotation limits. + /// ĉ…£ĉ€§¨ç§ğċ‹•/ċ›žèğ˘ċˆĥ限 + /// + public class InertiaConstraint : IDisposable + { + /// + /// ƒ†ƒĴƒƒĵƒˆƒ˘ƒĵƒ‰ + /// Teleport processing mode. + /// + public enum TeleportMode + { + None = 0, + + /// + /// ‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³‚’ƒŞ‚ğƒƒƒˆ—™ + /// Reset the simulation. + /// + Reset = 1, + + /// + /// ƒ†ƒĴƒƒĵƒˆċ‰çŠĥĉ…‹‚’çĥ™çĥš—™ + /// Continue the state before the teleport. + /// + Keep = 2, + } + + [System.Serializable] + public class SerializeData : IDataValidate + { + /// + /// Anchor that cancels inertia. + /// Anchor translation and rotation are excluded from simulation. + /// This is useful if your character rides a vehicle. + /// ĉ…£ĉ€§‚’ĉ‰“Ħĉĥˆ™‚˘ƒ³‚Ѓĵ + /// ‚˘ƒ³‚Ѓĵç§ğċ‹•¨ċ›žèğ˘Ż‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³‹‚‰é™¤ċ¤–•‚Œ™ + /// “‚ŒŻ‚­ƒ£ƒİ‚Ż‚żƒĵŒäı—‚Šç‰İĞäı—‚‹ċ ´ċˆĞäżċˆİ§™ + /// [OK] Runtime changes. + /// [NG] Export/Import with Presets + /// + public Transform anchor; + + /// + /// Anchor Influence (0.0 ~ 1.0) + /// ‚˘ƒ³‚Ѓĵċ½ħ響(0.0 ~ 1.0) + /// [OK] Runtime changes. + /// [NG] Export/Import with Presets + /// + [Range(0.0f, 1.0f)] + public float anchorInertia; + + + /// + /// World Influence (0.0 ~ 1.0). + /// ƒŻƒĵƒĞƒ‰ç§ğċ‹•ċ½ħ響(0.0 ~ 1.0) + /// [OK] Runtime changes. + /// [OK] Export/Import with Presets + /// + [FormerlySerializedAs("movementInertia")] + [Range(0.0f, 1.0f)] + public float worldInertia; + + /// + /// World Influence Smoothing (0.0 ~ 1.0). + /// ƒŻƒĵƒĞƒ‰ç§ğċ‹•ċ½ħ響ċı³ĉğ‘ċŒ–(0.0 ~ 1.0) + /// [OK] Runtime changes. + /// [OK] Export/Import with Presets + /// + [Range(0.0f, 1.0f)] + public float movementInertiaSmoothing; + + /// + /// World movement speed limit (m/s). + /// ƒŻƒĵƒĞƒ‰ç§ğċ‹•速ċşĤċˆĥ限(m/s) + /// [OK] Runtime changes. + /// [OK] Export/Import with Presets + /// + public CheckSliderSerializeData movementSpeedLimit; + + /// + /// World rotation speed limit (deg/s). + /// ƒŻƒĵƒĞƒ‰ċ›žèğ˘é€ŸċşĤċˆĥ限(deg/s) + /// [OK] Runtime changes. + /// [OK] Export/Import with Presets + /// + public CheckSliderSerializeData rotationSpeedLimit; + + /// + /// Local Influence (0.0 ~ 1.0). + /// ƒ­ƒĵ‚ЃĞĉ…£ĉ€§ċ½ħ響(0.0 ~ 1.0) + /// [OK] Runtime changes. + /// [OK] Export/Import with Presets + /// + [Range(0.0f, 1.0f)] + public float localInertia; + + /// + /// Local movement speed limit (m/s). + /// ƒ­ƒĵ‚ЃĞç§ğċ‹•速ċşĤċˆĥ限(m/s) + /// [OK] Runtime changes. + /// [OK] Export/Import with Presets + /// + public CheckSliderSerializeData localMovementSpeedLimit; + + /// + /// Local rotation speed limit (deg/s). + /// ƒ­ƒĵ‚ЃĞċ›žèğ˘é€ŸċşĤċˆĥ限(deg/s) + /// [OK] Runtime changes. + /// [OK] Export/Import with Presets + /// + public CheckSliderSerializeData localRotationSpeedLimit; + + /// + /// depth inertia (0.0 ~ 1.0). + /// Increasing the effect weakens the inertia near the root (makes it difficult to move). + /// ĉ·ħċşĤĉ…£ĉ€§(0.0 ~ 1.0) + /// ċ½ħ響‚’ċ¤§™‚‹¨ƒĞƒĵƒˆäğ˜èż‘ĉ…£ĉ€§ŒċĵħŞ‚‹ïĵˆċ‹•ĞŞ‚‹ïĵ‰ + /// [OK] Runtime changes. + /// [OK] Export/Import with Presets + /// + [Range(0.0f, 1.0f)] + public float depthInertia; + + /// + /// Centrifugal acceleration (0.0 ~ 1.0). + /// 遠ċżƒċŠ›ċŠ é€Ÿ(0.0 ~ 1.0) + /// [OK] Runtime changes. + /// [OK] Export/Import with Presets + /// + [Range(0.0f, 1.0f)] + public float centrifualAcceleration; + + /// + /// Particle Velocity Limit (m/s). + /// ƒ‘ƒĵƒ†‚£‚ŻƒĞ速ċşĤċˆĥ限(m/s) + /// [OK] Runtime changes. + /// [OK] Export/Import with Presets + /// + public CheckSliderSerializeData particleSpeedLimit; + + /// + /// Teleport determination method. + /// ƒ†ƒĴƒƒĵƒˆċˆ¤ċšƒ˘ƒĵƒ‰ + /// [OK] Runtime changes. + /// [OK] Export/Import with Presets + /// + public TeleportMode teleportMode; + + /// + /// Teleport detection distance. + /// ƒ†ƒĴƒƒĵƒˆċˆ¤ċšè·é›˘ + /// [OK] Runtime changes. + /// [OK] Export/Import with Presets + /// + public float teleportDistance; + + /// + /// Teleport detection angle(deg). + /// ƒ†ƒĴƒƒĵƒˆċˆ¤ċšċ›žèğ˘è§’ċşĤ(deg) + /// [OK] Runtime changes. + /// [OK] Export/Import with Presets + /// + public float teleportRotation; + + public SerializeData() + { + anchor = null; + anchorInertia = 0.0f; + worldInertia = 1.0f; + //movementInertiaSmoothing = 0.65f; // ->0.0524 + //movementInertiaSmoothing = 0.5f; // ->0.13375 + movementInertiaSmoothing = 0.4f; + movementSpeedLimit = new CheckSliderSerializeData(true, 5.0f); + rotationSpeedLimit = new CheckSliderSerializeData(true, 720.0f); + localInertia = 1.0f; + localMovementSpeedLimit = new CheckSliderSerializeData(false, 5.0f); + localRotationSpeedLimit = new CheckSliderSerializeData(false, 720.0f); + depthInertia = 0.0f; + centrifualAcceleration = 0.0f; + particleSpeedLimit = new CheckSliderSerializeData(true, 4.0f); + teleportMode = TeleportMode.None; + teleportDistance = 0.5f; + teleportRotation = 90.0f; + } + + public SerializeData Clone() + { + return new SerializeData() + { + anchor = anchor, + anchorInertia = anchorInertia, + worldInertia = worldInertia, + movementInertiaSmoothing = movementInertiaSmoothing, + movementSpeedLimit = movementSpeedLimit.Clone(), + rotationSpeedLimit = rotationSpeedLimit.Clone(), + localInertia = localInertia, + localMovementSpeedLimit = localMovementSpeedLimit.Clone(), + localRotationSpeedLimit = localRotationSpeedLimit.Clone(), + depthInertia = depthInertia, + centrifualAcceleration = centrifualAcceleration, + particleSpeedLimit = particleSpeedLimit.Clone(), + teleportMode = teleportMode, + teleportDistance = teleportDistance, + teleportRotation = teleportRotation, + }; + } + + public void DataValidate() + { + anchorInertia = Mathf.Clamp01(anchorInertia); + worldInertia = Mathf.Clamp01(worldInertia); + movementInertiaSmoothing = Mathf.Clamp01(movementInertiaSmoothing); + movementSpeedLimit.DataValidate(0.0f, Define.System.MaxMovementSpeedLimit); + rotationSpeedLimit.DataValidate(0.0f, Define.System.MaxRotationSpeedLimit); + localInertia = Mathf.Clamp01(localInertia); + localMovementSpeedLimit.DataValidate(0.0f, Define.System.MaxMovementSpeedLimit); + localRotationSpeedLimit.DataValidate(0.0f, Define.System.MaxRotationSpeedLimit); + centrifualAcceleration = Mathf.Clamp01(centrifualAcceleration); + depthInertia = Mathf.Clamp01(depthInertia); + particleSpeedLimit.DataValidate(0.0f, Define.System.MaxParticleSpeedLimit); + teleportDistance = Mathf.Max(teleportDistance, 0.0f); + teleportRotation = Mathf.Max(teleportRotation, 0.0f); + } + } + + public struct InertiaConstraintParams + { + /// + /// ‚˘ƒ³‚Ѓĵċ½ħ響率(0.0 ~ 1.0) + /// + public float anchorInertia; + + /// + /// ƒŻƒĵƒĞƒ‰ĉ…£ĉ€§ċ½ħ響(0.0 ~ 1.0) + /// + public float worldInertia; + + /// + /// ƒŻƒĵƒĞƒ‰ĉ…£ĉ€§‚ıƒ ƒĵ‚¸ƒ³‚°çއ(0.0 ~ 1.0) + /// + public float movementInertiaSmoothing; + + /// + /// ƒŻƒĵƒĞƒ‰ç§ğċ‹•速ċşĤċˆĥ限(m/s) + /// ç„Ħċˆĥ限ĉ™‚Ż(-1) + /// + public float movementSpeedLimit; + + /// + /// ƒŻƒĵƒĞƒ‰ċ›žèğ˘é€ŸċşĤċˆĥ限(deg/s) + /// ç„Ħċˆĥ限ĉ™‚Ż(-1) + /// + public float rotationSpeedLimit; + + /// + /// ƒ­ƒĵ‚ЃĞĉ…£ĉ€§ċ½ħ響(0.0 ~ 1.0) + /// + public float localInertia; + + /// + /// ƒ­ƒĵ‚ЃĞç§ğċ‹•速ċşĤċˆĥ限(m/s) + /// + public float localMovementSpeedLimit; + + /// + /// ƒ­ƒĵ‚ЃĞċ›žèğ˘é€ŸċşĤċˆĥ限(deg/s) + /// + public float localRotationSpeedLimit; + + /// + /// ĉ·ħċşĤĉ…£ĉ€§(0.0 ~ 1.0) + /// ċ½ħ響‚’ċ¤§™‚‹¨ƒĞƒĵƒˆäğ˜èż‘ĉ…£ĉ€§ŒċĵħŞ‚‹ïĵˆċ‹•ĞŞ‚‹ïĵ‰ + /// + public float depthInertia; + + /// + /// 遠ċżƒċŠ›ċŠ é€Ÿ(0.0 ~ 1.0) + /// + public float centrifualAcceleration; + + /// + /// ƒ‘ƒĵƒ†‚£‚ŻƒĞ速ċşĤċˆĥ限(m/s) + /// + public float particleSpeedLimit; + + /// + /// ƒ†ƒĴƒƒĵƒˆƒ˘ƒĵƒ‰ + /// + public TeleportMode teleportMode; + + /// + /// ƒ†ƒĴƒƒĵƒˆċˆ¤ċšè·é›˘ + /// + public float teleportDistance; + + /// + /// ƒ†ƒĴƒƒĵƒˆċˆ¤ċšè§’ċşĤ(deg) + /// + public float teleportRotation; + + public void Convert(SerializeData sdata) + { + anchorInertia = sdata.anchorInertia; + worldInertia = sdata.worldInertia; + movementInertiaSmoothing = sdata.movementInertiaSmoothing; + movementSpeedLimit = sdata.movementSpeedLimit.GetValue(-1); + rotationSpeedLimit = sdata.rotationSpeedLimit.GetValue(-1); + localInertia = sdata.localInertia; + localMovementSpeedLimit = sdata.localMovementSpeedLimit.GetValue(-1); + localRotationSpeedLimit = sdata.localRotationSpeedLimit.GetValue(-1); + depthInertia = sdata.depthInertia; + centrifualAcceleration = sdata.centrifualAcceleration; + particleSpeedLimit = sdata.particleSpeedLimit.GetValue(-1); + teleportMode = sdata.teleportMode; + teleportDistance = sdata.teleportDistance; + teleportRotation = sdata.teleportRotation; + } + } + + //========================================================================================= + /// + /// ‚ğƒ³‚żƒĵƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ƒ‡ƒĵ‚ż + /// + [System.Serializable] + public struct CenterData + { + /// + /// çċœ¨‚˘ƒ³‚Ѓĵċ§żċ‹˘ + /// + public float3 anchorPosition; + public quaternion anchorRotation; + + /// + /// ċ‰ƒ•ƒĴƒĵƒ ‚˘ƒ³‚Ѓĵċ§żċ‹˘ + /// + public float3 oldAnchorPosition; + public quaternion oldAnchorRotation; + + /// + /// ‚˘ƒ³‚Ѓĵçİşé–“§‚³ƒ³ƒƒĵƒƒ³ƒˆƒ­ƒĵ‚ЃĞċş§ĉ¨™ + /// + public float3 anchorComponentLocalPosition; + + /// + /// ċ‚ç…§™ı‚ğƒ³‚żƒĵƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı + /// ċŒĉœŸĉ™‚ŻċŒĉœŸċ…ˆƒƒĵƒ ‚‚ĞĞŞ‚‹ + /// + public int centerTransformIndex; + + /// + /// 珃•ƒĴƒĵƒ ‚³ƒ³ƒƒĵƒƒ³ƒˆċ§żċ‹˘ + /// + public float3 componentWorldPosition; + public quaternion componentWorldRotation; + public float3 componentWorldScale; + + /// + /// ċ‰ƒ•ƒĴƒĵƒ ‚³ƒ³ƒƒĵƒƒ³ƒˆċ§żċ‹˘ + /// + public float3 oldComponentWorldPosition; + public quaternion oldComponentWorldRotation; + public float3 oldComponentWorldScale; + + /// + /// 珃•ƒĴƒĵƒ ‚³ƒ³ƒƒĵƒƒ³ƒˆç§ğċ‹•量 + /// + public float3 frameComponentShiftVector; + public quaternion frameComponentShiftRotation; + + /// + /// 珃•ƒĴƒĵƒ ‚³ƒ³ƒƒĵƒƒ³ƒˆç§ğċ‹•速ċşĤ¨ĉ–ıċ‘ + /// + public float frameMovingSpeed; + public float3 frameMovingDirection; + + /// + /// 珃•ƒĴƒĵƒ ċ§żċ‹˘ + /// + public float3 frameWorldPosition; + public quaternion frameWorldRotation; + public float3 frameWorldScale; + public float3 frameLocalPosition; + + /// + /// ċ‰ƒ•ƒĴƒĵƒ ċ§żċ‹˘ + /// + public float3 oldFrameWorldPosition; + public quaternion oldFrameWorldRotation; + public float3 oldFrameWorldScale; + + /// + /// 珂ıƒ†ƒƒƒ—§ċ§żċ‹˘ + /// + public float3 nowWorldPosition; + public quaternion nowWorldRotation; + //public float3 nowWorldScale; // â€ğçċœ¨ĉœŞä½żç”¨ + + /// + /// ċ‰ċ›ž‚ıƒ†ƒƒƒ—§ċ§żċ‹˘ + /// + public float3 oldWorldPosition; + public quaternion oldWorldRotation; + + /// + /// ‚ıƒ†ƒƒƒ—”¨ç§ğċ‹•ċŠ›ċ‰Šĉ¸›ċ‰²ċˆ(0.0~1.0) + /// + public float stepMoveInertiaRatio; + + /// + /// ‚ıƒ†ƒƒƒ—”¨ċ›žèğ˘ċŠ›ċ‰Šĉ¸›ċ‰²ċˆ(0.0~1.0) + /// + public float stepRotationInertiaRatio; + + /// + /// ‚ıƒ†ƒƒƒ—”¨ç§ğċ‹•ƒ™‚ŻƒˆƒĞ + /// “‚ŒŻċ‰Šĉ¸›ċ‰ç´”粋ŞƒŻƒĵƒĞƒ‰ƒ™‚ŻƒˆƒĞ + /// + public float3 stepVector; + + /// + /// ‚ıƒ†ƒƒƒ—”¨ċ›žèğ˘ƒ™‚ŻƒˆƒĞ + /// “‚ŒŻċ‰Šĉ¸›ċ‰ç´”粋ŞƒŻƒĵƒĞƒ‰ċ›žèğ˘ + /// + public quaternion stepRotation; + + /// + /// ‚ıƒ†ƒƒƒ—”¨ĉ…£ĉ€§ċ…¨ä½“ç§ğċ‹•‚·ƒ•ƒˆƒ™‚ŻƒˆƒĞ + /// + public float3 inertiaVector; + + /// + /// ‚ıƒ†ƒƒƒ—”¨ĉ…£ĉ€§ċ…¨ä½“‚·ƒ•ƒˆċ›žèğ˘ + /// + public quaternion inertiaRotation; + + /// + /// ‚ıƒ†ƒƒƒ—”¨ĉ…£ĉ€§ċ‰Šĉ¸›ċŒç§ğċ‹•速ċşĤ(m/s) + /// + public float stepMovingSpeed; + + /// + /// ‚ıƒ†ƒƒƒ—”¨ĉ…£ĉ€§ċ‰Šĉ¸›ċŒç§ğċ‹•ĉ–ıċ‘ + /// + public float3 stepMovingDirection; + + /// + /// ċ›žèğ˘è§’速ċşĤ(rad/s) + /// + public float angularVelocity; + + /// + /// ċ›žèğ˘èğ¸(角速ċşĤ0ċ ´ċˆŻ(0,0,0)) + /// + public float3 rotationAxis; + + /// + /// ċˆĉœŸċŒ–ĉ™‚ĉ…£ĉ€§ä¸­ċżƒċ§żċ‹˘§ƒ­ƒĵ‚ЃĞ重ċŠ›ĉ–ıċ‘ + /// 重ċŠ›falloff計痁§ä½żç”¨ + /// + public float3 initLocalGravityDirection; + + /// + /// ‚ıƒ ƒĵ‚¸ƒ³‚°•‚ŒŸçċœ¨ƒŻƒĵƒĞƒ‰ĉ…£ĉ€§é€ŸċşĤƒ™‚ŻƒˆƒĞ + /// + public float3 smoothingVelocity; // (m/s) + + /// + /// ƒž‚¤ƒŠ‚ı‚ı‚ħƒĵƒĞĞ‚ˆ‚‹ċèğ˘‚’ĉ‰“Ħĉĥˆ™Ÿ‚ċ¤‰ĉ›ƒžƒˆƒŞƒƒ‚Ż‚ı + /// ‚ğƒ³‚żƒĵçİşé–“ + /// + public float4x4 negativeScaleMatrix; + + internal void Initialize() + { + anchorRotation = quaternion.identity; + oldAnchorRotation = quaternion.identity; + + componentWorldRotation = quaternion.identity; + componentWorldScale = 1; + oldComponentWorldRotation = quaternion.identity; + oldComponentWorldScale = 1; + frameComponentShiftRotation = quaternion.identity; + + frameWorldRotation = quaternion.identity; + oldFrameWorldRotation = quaternion.identity; + nowWorldRotation = quaternion.identity; + oldWorldRotation = quaternion.identity; + stepRotation = quaternion.identity; + } + } + + /// + /// ċˆĥ約ƒ‡ƒĵ‚ż + /// + [System.Serializable] + public class ConstraintData + { + public ResultCode result; + public CenterData centerData; + public float3 initLocalGravityDirection; + } + + /// + /// ƒƒĵƒ ”¨ċ›şċšç‚ıƒŞ‚ıƒˆ + /// + internal ExNativeArray fixedArray; + + //========================================================================================= + public InertiaConstraint() + { + fixedArray = new ExNativeArray(0, true); + } + + public void Dispose() + { + fixedArray?.Dispose(); + fixedArray = null; + } + + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.AppendLine($"[InertiaConstraint]"); + sb.AppendLine($" -fixedArray:{fixedArray.ToSummary()}"); + + return sb.ToString(); + } + + //========================================================================================= + /// + /// ċˆĥ約ƒ‡ƒĵ‚żä½œĉˆ + /// + /// + public static ConstraintData CreateData(VirtualMesh proxyMesh, in ClothParameters parameters) + { + var constraintData = new ConstraintData(); + + try + { + // ■‚ğƒ³‚żƒĵ + var cdata = new CenterData(); + cdata.Initialize(); + cdata.centerTransformIndex = proxyMesh.centerTransformIndex; + constraintData.centerData = cdata; + + // ċ›şċšç‚ıƒŞ‚ıƒˆŻ™§ĞproxyMeshcenterFixedListĞĉ ĵ納•‚ŒĤ„‚‹ + float3 nor = 0; + float3 tan = 0; + int ccnt = proxyMesh.CenterFixedPointCount; + if (ccnt > 0) + { + for (int i = 0; i < ccnt; i++) + { + int fixedIndex = proxyMesh.centerFixedList[i]; + + // ċˆĉœŸċ§żċ‹˘‚’ĉħ‚‚‚‹ + var lnor = proxyMesh.localNormals[fixedIndex]; + var ltan = proxyMesh.localTangents[fixedIndex]; + var lrot = MathUtility.ToRotation(lnor, ltan); + var bindRot = proxyMesh.vertexBindPoseRotations[fixedIndex]; + var q = math.mul(lrot, bindRot); + nor += MathUtility.ToNormal(q); + tan += MathUtility.ToTangent(q); + } + } + + float3 localGravityDirection = new float3(0, -1, 0); + if (ccnt > 0) + { + // ċˆĉœŸ‚ğƒ³‚żƒĵċ§żċ‹˘‹‚‰ƒ­ƒĵ‚ЃĞ重ċŠ›ĉ–ıċ‘‚’ç—ċ‡ş™‚‹ + var rot = MathUtility.ToRotation(math.normalize(nor), math.normalize(tan)); + var irot = math.inverse(rot); + localGravityDirection = math.mul(irot, parameters.worldGravityDirection); + } + constraintData.initLocalGravityDirection = localGravityDirection; + + constraintData.result.SetSuccess(); + + //Develop.Log($"Create [InertiaConstraint]."); + } + catch (Exception exception) + { + Debug.LogError(exception); + constraintData.result.SetError(Define.Result.Constraint_CreateInertiaException); + throw; + } + finally + { + } + + return constraintData; + } + + internal void Register(ClothProcess cprocess) + { + // ‚ğƒ³‚żƒĵƒ‡ƒĵ‚ż‚ğƒ³‚żƒĵƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı‚’ƒ€‚¤ƒĴ‚Żƒˆċ€¤Ğċ¤‰ĉ›´ + ref var tdata = ref MagicaManager.Team.GetTeamDataRef(cprocess.TeamId); + ref var cdata = ref MagicaManager.Team.centerDataArray.GetRef(cprocess.TeamId); + cdata.centerTransformIndex = tdata.centerTransformIndex; + + // ċˆĉœŸċŒ–ĉ™‚ƒ­ƒĵ‚ЃĞ重ċŠ›ĉ–ıċ‘ + cdata.initLocalGravityDirection = cprocess.inertiaConstraintData.initLocalGravityDirection; + //Debug.Log($"[{cprocess.TeamId}] initLocalGravityDirection:{cdata.initLocalGravityDirection}"); + + // ċ›şċšç‚ıƒŞ‚ıƒˆ + var c = new DataChunk(); + if (cprocess.ProxyMeshContainer.shareVirtualMesh.CenterFixedPointCount > 0) + { + c = fixedArray.AddRange(cprocess.ProxyMeshContainer.shareVirtualMesh.centerFixedList); + } + tdata.fixedDataChunk = c; + } + + internal void Exit(ClothProcess cprocess) + { + if (cprocess != null && cprocess.TeamId > 0) + { + ref var tdata = ref MagicaManager.Team.GetTeamDataRef(cprocess.TeamId); + + fixedArray.Remove(tdata.fixedDataChunk); + tdata.fixedDataChunk.Clear(); + } + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/InertiaConstraint.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/InertiaConstraint.cs.meta new file mode 100644 index 00000000..b9331085 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/InertiaConstraint.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: ac7ce6c753c84f24ca87c6d1b2f7efd8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/InertiaConstraint.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/MotionConstraint.cs b/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/MotionConstraint.cs new file mode 100644 index 00000000..d856e0d3 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/MotionConstraint.cs @@ -0,0 +1,292 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System; +using Unity.Collections; +using Unity.Mathematics; +using UnityEngine; + +namespace MagicaCloth2 +{ + public class MotionConstraint : IDisposable + { + [System.Serializable] + public class SerializeData : IDataValidate + { + /// + /// Whether or not to use maximum travel range + /// ĉœ€ċ¤§ç§ğċ‹•範ċ›² + /// [OK] Runtime changes. + /// [OK] Export/Import with Presets + /// + public bool useMaxDistance; + + /// + /// Maximum travel range. + /// [OK] Runtime changes. + /// [OK] Export/Import with Presets + /// + public CurveSerializeData maxDistance; + + /// + /// Use of backstop. + /// ƒƒƒ‚Ż‚ıƒˆƒƒƒ—ä½żç”¨ĉœ‰ç„Ħ + /// [OK] Runtime changes. + /// [OK] Export/Import with Presets + /// + public bool useBackstop; + + /// + /// Backstop sphere radius. + /// [OK] Runtime changes. + /// [OK] Export/Import with Presets + /// + [Range(0.1f, 10.0f)] + public float backstopRadius; + + /// + /// Distance from vertex to backstop sphere. + /// [OK] Runtime changes. + /// [OK] Export/Import with Presets + /// + public CurveSerializeData backstopDistance; + + /// + /// repulsive force(0.0 ~ 1.0) + /// [OK] Runtime changes. + /// [OK] Export/Import with Presets + /// + [Range(0.0f, 1.0f)] + public float stiffness; + + public SerializeData() + { + useMaxDistance = false; + maxDistance = new CurveSerializeData(0.3f); + useBackstop = false; + backstopRadius = 10.0f; + backstopDistance = new CurveSerializeData(0.0f); + stiffness = 1.0f; + } + + public void DataValidate() + { + maxDistance.DataValidate(0.0f, 5.0f); + //maxDistanceOffset = Mathf.Clamp01(maxDistanceOffset); + + backstopRadius = Mathf.Clamp(backstopRadius, 0.0f, 10.0f); + backstopDistance.DataValidate(0.0f, 1.0f); + + stiffness = Mathf.Clamp01(stiffness); + } + + public SerializeData Clone() + { + return new SerializeData() + { + useMaxDistance = useMaxDistance, + maxDistance = maxDistance.Clone(), + useBackstop = useBackstop, + backstopRadius = backstopRadius, + backstopDistance = backstopDistance.Clone(), + stiffness = stiffness, + }; + } + } + + public struct MotionConstraintParams + { + /// + /// ĉœ€ċ¤§ç§ğċ‹•範ċ›² + /// + public bool useMaxDistance; + public float4x4 maxDistanceCurveData; + //public float maxDistanceOffset; + + /// + /// ƒƒƒ‚Ż‚ıƒˆƒƒƒ—è·é›˘ + /// + public bool useBackstop; + public float backstopRadius; + public float4x4 backstopDistanceCurveData; + + // stiffness + public float stiffness; + + public void Convert(SerializeData sdata, ClothProcess.ClothType clothType) + { + useMaxDistance = clothType == ClothProcess.ClothType.BoneSpring ? false : sdata.useMaxDistance; + maxDistanceCurveData = sdata.maxDistance.ConvertFloatArray(); + //maxDistanceOffset = sdata.maxDistanceOffset; + + useBackstop = clothType == ClothProcess.ClothType.BoneSpring ? false : sdata.useBackstop; + backstopRadius = sdata.backstopRadius; + backstopDistanceCurveData = sdata.backstopDistance.ConvertFloatArray(); + + stiffness = sdata.stiffness; + } + } + + public void Dispose() + { + } + + //========================================================================================= + // Solver + //========================================================================================= + internal static void SolverConstraint( + DataChunk chunk, + // team + ref TeamManager.TeamData tdata, + ref ClothParameters param, + // vmesh + ref NativeArray attributes, + ref NativeArray vertexDepths, + // particle + ref NativeArray basePosArray, + ref NativeArray baseRotArray, + ref NativeArray nextPosArray, + ref NativeArray velocityPosArray, + ref NativeArray frictionArray, + ref NativeArray collisionNormalArray + ) + { + if (param.motionConstraint.useMaxDistance == false && param.motionConstraint.useBackstop == false) + return; + + // stiffness + float stiffness = param.motionConstraint.stiffness; + + float backstopRadius = param.motionConstraint.backstopRadius; + + // ƒ‘ƒĵƒ†‚£‚ŻƒĞ”¨ + //int pindex = tdata.particleChunk.startIndex; + //int vindex = tdata.proxyCommonChunk.startIndex; + int pindex = tdata.particleChunk.startIndex + chunk.startIndex; + int vindex = tdata.proxyCommonChunk.startIndex + chunk.startIndex; + //for (int k = 0; k < tdata.particleChunk.dataLength; k++, pindex++, vindex++) + for (int k = 0; k < chunk.dataLength; k++, pindex++, vindex++) + { + // ç§ğċ‹•ƒ‘ƒĵƒ†‚£‚ŻƒĞż + var attr = attributes[vindex]; + if (attr.IsMove() == false) + continue; + + var nextPos = nextPosArray[pindex]; + var basePos = basePosArray[pindex]; + float depth = vertexDepths[vindex]; + + // !MaxDistance¨Backstopċˆĥ約Żċ¸¸Ğ‚˘ƒ‹ƒĦƒĵ‚·ƒ§ƒ³ċ§żċ‹˘(basePose)‹‚‰è¨ˆç—•‚Œ‚‹§ĉ³¨ĉ„ïĵ + // !Ÿ‚AnimationBlendRatioŻċ½ħ響—Ş„€‚ + + // éİ用頂ç‚ıċħžĉ€§ƒ‚§ƒƒ‚Ż + if (attr.IsMotion()) + { + var opos = nextPos; + + // ƒ‘ƒĵƒ†‚£‚ŻƒĞċŠċ„ + float radius = math.max(param.radiusCurveData.MC2EvaluateCurve(depth), 0.0001f); // safe + + // ĉ‘İĉ“Ĥċ½ħéŸżè·é›˘ + float cfr = radius * 1.0f; + + // ĉ·ħ•ŻäşŒĉĴĦĉ›²ç·šĞ™‚‹(test) + depth = depth * depth; + + //========================================================= + // axis + //========================================================= + var baseRot = baseRotArray[pindex]; + float3 dir = math.up(); + switch (param.normalAxis) + { + case ClothNormalAxis.Right: + dir = math.right(); + break; + case ClothNormalAxis.Up: + dir = math.up(); + break; + case ClothNormalAxis.Forward: + dir = math.forward(); + break; + case ClothNormalAxis.InverseRight: + dir = -math.right(); + break; + case ClothNormalAxis.InverseUp: + dir = -math.up(); + break; + case ClothNormalAxis.InverseForward: + dir = -math.forward(); + break; + } + dir = math.mul(baseRot, dir); + + //========================================================= + // Max Distance + //========================================================= + if (param.motionConstraint.useMaxDistance) + { + float maxDistance = param.motionConstraint.maxDistanceCurveData.MC2EvaluateCurve(depth); + //var cen = basePos + dir * (motionParam.maxDistanceOffset * maxDistance); + var cen = basePos; + var v = MathUtility.ClampVector(nextPos - cen, maxDistance); + nextPos = cen + v; + } + + //========================================================= + // Backstop + //========================================================= + if (param.motionConstraint.useBackstop) + { + float backstopDistance = param.motionConstraint.backstopDistanceCurveData.MC2EvaluateCurve(depth); + if (backstopRadius > 0.0f) + { + // ƒƒƒ‚Ż‚ıƒˆƒƒƒ—Żĉ³•線逆ĉ–ıċ‘ + float3 cen = basePos + -dir * (backstopDistance + backstopRadius); + var v = nextPos - cen; + float len = math.length(v); + if (len > Define.System.Epsilon && len < (backstopRadius + cfr)) + { + var n = v / len; + if (len < backstopRadius) + { + nextPos = cen + n * backstopRadius; + } + +#if false // ĉ‘İĉ“ĤŻ‚‚Šè‰ŻŞ„ĉ°—Œ™‚‹§¨‚Ё‚ˆšOFF + // ĉ‘İĉ“Ĥ + float friction = 1.0f - math.saturate((len - backstopRadius) / cfr); + float nowFriction = frictionArray[pindex]; + if (friction > nowFriction) + { + // ċ¤§‘‚Œ°ĉ›´ĉ–° + frictionArray[pindex] = friction; + + // ĉŽè§Ĥĉ³•ç·š + collisionNormalArray[pindex] = n; + } +#endif + } + } + } + + //========================================================= + // Stiffness + //========================================================= + nextPos = math.lerp(opos, nextPos, stiffness); + + //========================================================= + // ĉ ĵ納 + //========================================================= + // ä½ç½ + nextPosArray[pindex] = nextPos; + + // 速ċşĤċ½ħ響 + var add = nextPos - opos; + const float attn = 0.95f; + velocityPosArray[pindex] = velocityPosArray[pindex] + add * attn; + } + } + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/MotionConstraint.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/MotionConstraint.cs.meta new file mode 100644 index 00000000..d7f063c7 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/MotionConstraint.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 659973f118f2eb64295ac6e523fdafff +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/MotionConstraint.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/SelfCollisionConstraint.cs b/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/SelfCollisionConstraint.cs new file mode 100644 index 00000000..3058a647 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/SelfCollisionConstraint.cs @@ -0,0 +1,2320 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2025 MagicaSoft. +// https://magicasoft.jp +using System; +using System.Runtime.CompilerServices; +using System.Text; +using Unity.Burst; +using Unity.Collections; +using Unity.Collections.LowLevel.Unsafe; +using Unity.Jobs; +using Unity.Mathematics; +using UnityEngine; + +namespace MagicaCloth2 +{ + public partial class SelfCollisionConstraint : IDisposable + { + public enum SelfCollisionMode + { + None = 0, + + /// + /// PointPoint + /// + //Point = 1, // omit! + + /// + /// PointTriangle + EdgeEdge + Intersect + /// + FullMesh = 2, + } + + [System.Serializable] + public class SerializeData : IDataValidate + { + /// + /// self-collision mode + /// [OK] Runtime changes. + /// [OK] Export/Import with Presets + /// + public SelfCollisionMode selfMode; + + /// + /// primitive thickness. + /// [OK] Runtime changes. + /// [OK] Export/Import with Presets + /// + public CurveSerializeData surfaceThickness = new CurveSerializeData(0.005f, 0.5f, 1.0f, false); + + /// + /// mutual collision mode. + /// [OK] Runtime changes. + /// [OK] Export/Import with Presets + /// + public SelfCollisionMode syncMode; + + /// + /// Mutual Collision Opponent. + /// [OK] Runtime changes. + /// [OK] Export/Import with Presets + /// + public MagicaCloth syncPartner; + + /// + /// cloth weight. + /// [OK] Runtime changes. + /// [OK] Export/Import with Presets + /// + [Range(0.0f, 1.0f)] + public float clothMass = 0.0f; + + public SerializeData() + { + selfMode = SelfCollisionMode.None; + syncMode = SelfCollisionMode.None; + } + + public void DataValidate() + { + surfaceThickness.DataValidate(Define.System.SelfCollisionThicknessMin, Define.System.SelfCollisionThicknessMax); + clothMass = Mathf.Clamp01(clothMass); + } + + public SerializeData Clone() + { + return new SerializeData() + { + selfMode = selfMode, + surfaceThickness = surfaceThickness.Clone(), + syncMode = syncMode, + syncPartner = syncPartner, + clothMass = clothMass, + }; + } + + public MagicaCloth GetSyncPartner() + { + return syncMode != SelfCollisionMode.None ? syncPartner : null; + } + } + + public struct SelfCollisionConstraintParams + { + public SelfCollisionMode selfMode; + public float4x4 surfaceThicknessCurveData; + public SelfCollisionMode syncMode; + public float clothMass; + + public void Convert(SerializeData sdata, ClothProcess.ClothType clothType) + { + selfMode = clothType == ClothProcess.ClothType.BoneSpring ? SelfCollisionMode.None : sdata.selfMode; + surfaceThicknessCurveData = sdata.surfaceThickness.ConvertFloatArray(); + syncMode = clothType == ClothProcess.ClothType.BoneSpring ? SelfCollisionMode.None : sdata.syncMode; + clothMass = sdata.clothMass; + } + } + + //========================================================================================= + /// + /// ƒ—ƒŞƒŸƒ†‚£ƒ– + /// Point/Edge/TriangleçĦ理 + /// + public const uint KindPoint = 0; + public const uint KindEdge = 1; + public const uint KindTriangle = 2; + + public const uint Flag_KindMask = 0x03000000; // 24~25bit + public const uint Flag_Fix0 = 0x04000000; + public const uint Flag_Fix1 = 0x08000000; + public const uint Flag_Fix2 = 0x10000000; + public const uint Flag_AllFix = 0x20000000; + public const uint Flag_Ignore = 0x40000000; // ç„ĦċŠı‚‚—Żç„ĦèĤ–é ‚ç‚ıŒċĞ‚Œ‚‹ + public const uint Flag_Enable = 0x80000000; // ĉŽè§Ĥċˆ¤ċšĉœ‰ċŠı + public const uint Flag_Intersect0 = 0x00000001; + public const uint Flag_Intersect1 = 0x00000002; + public const uint Flag_Intersect2 = 0x00000004; + + public const uint Flag_FixIntersect0 = (Flag_Fix0 | Flag_Intersect0); + public const uint Flag_FixIntersect1 = (Flag_Fix1 | Flag_Intersect1); + public const uint Flag_FixIntersect2 = (Flag_Fix2 | Flag_Intersect2); + + unsafe internal struct Primitive : IComparable + { + /// + /// ƒ•ƒİ‚° + /// + public uint flag; + + /// + /// ƒ—ƒŞƒŸƒ†‚£ƒ–‚’ĉ§‹ĉˆ™‚‹ƒ‘ƒĵƒ†‚£‚ŻƒĞ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı + /// 不èĤŞèğ¸Ż(-1)Œè¨­ċš•‚ŒĤ„‚‹ + /// + public int3 particleIndices; + + public float3 invMass; + + /// + /// ƒ—ƒŞƒŸƒ†‚£ƒ–AABB + /// + public AABB aabb; + + /// + /// UniformGirdċş§ĉ¨™ + /// + public int3 grid; + + public float depth; + + /// + /// ċŽšż + /// + public float thickness; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool IsIgnore() + { + return (flag & Flag_Ignore) != 0; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool IsAllFix() + { + return (flag & Flag_AllFix) != 0; + } + + /// + /// ƒ‘ƒĵƒ†‚£‚ŻƒĞ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ıŒïĵ‘¤äğ上重複—Ĥ„‚‹‹ċˆ¤ċš™‚‹ + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool AnyParticle(ref Primitive pri) + { + uint kind = ((flag & Flag_KindMask) >> 24) + 1; + + for (int i = 0; i < kind; i++) + { + int p = particleIndices[i]; + + // ċ…ċŠ›™ıĤŒéžïĵŞ‚‰true + if (math.all(pri.particleIndices - p) == false) + return true; + } + + return false; + } + + /// + /// ‚½ƒĵƒˆç”¨ + /// ‚°ƒŞƒƒƒ‰X->Y->Zé †§‚½ƒĵƒˆ + /// + /// + /// + public int CompareTo(Primitive other) + { + if (grid.x != other.grid.x) + return grid.x - other.grid.x; + if (grid.y != other.grid.y) + return grid.y - other.grid.y; + return grid.z - other.grid.z; + } + } + internal ExNativeArray primitiveArrayB; + + /// + /// ‚°ƒŞƒƒƒ‰ + /// ƒ—ƒŞƒŸƒ†‚£ƒ–ĉ¤œċ‡şç”¨‚°ƒŞƒƒƒ‰ĉƒ…ċ ħ + /// + internal struct GridInfo : IComparable + { + // “‚°ƒŞƒƒƒ‰ƒƒƒ‚·ƒċ€¤ + public int hash; + + // “‚°ƒŞƒƒƒ‰é–‹ċ§‹ƒ—ƒŞƒŸƒ†‚£ƒ–‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı + public int start; + + // “‚°ƒŞƒƒƒ‰Ğĉ ĵ納•‚ŒĤ„‚‹ƒ—ƒŞƒŸƒ†‚£ƒ–ĉ•° + public int count; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public int CompareTo(GridInfo other) + { + if (hash < other.hash) + return -1; + else if (hash > other.hash) + return 1; + else + return 0; + } + } + internal ExNativeArray uniformGridStartCountBuffer; + + /// + /// ‚³ƒ³‚ż‚Żƒˆ + /// èĦçށƒ—ƒŞƒŸƒ†‚£ƒ–ƒš‚˘çĦ理 + /// + internal const byte ContactType_EdgeEdge = 0; + internal const byte ContactType_PointTriangle = 1; + internal const byte ContactType_TrianglePoint = 2; + + internal struct ContactInfo + { + public int primitiveIndex0; + public int primitiveIndex1; + public byte contactType; + public byte enable; + public half thickness; + public half s; + public half t; + public half3 n; + } + + internal NativeQueue contactQueue; + internal NativeList contactList; + + /// + /// ‚¤ƒ³‚żƒĵ‚ğ‚Żƒˆ + /// çµĦ‚Šé˜²ĉ­˘EdgeTriangleƒš‚˘çĦ理 + /// + internal struct IntersectInfo + { + public int2 edgeParticeIndices; + public int3 triangleParticleIndices; + } + + internal NativeQueue intersectQueue; + internal NativeList intersectList; + + //========================================================================================= + /// + /// ƒ‚¤ƒ³ƒˆƒ—ƒŞƒŸƒ†‚£ƒ–総ĉ•° + /// + public int PointPrimitiveCount { get; private set; } = 0; + + /// + /// ‚¨ƒƒ‚¸ƒ—ƒŞƒŸƒ†‚£ƒ–総ĉ•° + /// + public int EdgePrimitiveCount { get; private set; } = 0; + + /// + /// ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞƒ—ƒŞƒŸƒ†‚£ƒ–総ĉ•° + /// + public int TrianglePrimitiveCount { get; private set; } = 0; + + //========================================================================================= + /// + /// 交ċ·è§£ĉħşƒ•ƒİ‚°(ƒ‘ƒĵƒ†‚£‚ŻƒĞ¨é€£ċ‹•) + /// + internal NativeArray intersectFlagArray; + + internal int IntersectCount { get; private set; } = 0; + + //========================================================================================= + public SelfCollisionConstraint() + { + intersectFlagArray = new NativeArray(0, Allocator.Persistent); + + primitiveArrayB = new ExNativeArray(0, true); + uniformGridStartCountBuffer = new ExNativeArray(0, true); + contactQueue = new NativeQueue(Allocator.Persistent); + contactList = new NativeList(Allocator.Persistent); + intersectQueue = new NativeQueue(Allocator.Persistent); + intersectList = new NativeList(Allocator.Persistent); + + //Develop.DebugLog($"UseQueueCount:{UseQueueCount}"); + } + + public void Dispose() + { + PointPrimitiveCount = 0; + EdgePrimitiveCount = 0; + TrianglePrimitiveCount = 0; + + intersectFlagArray.MC2DisposeSafe(); + + primitiveArrayB?.Dispose(); + primitiveArrayB = null; + uniformGridStartCountBuffer?.Dispose(); + uniformGridStartCountBuffer = null; + + if (contactQueue.IsCreated) + contactQueue.Dispose(); + if (contactList.IsCreated) + contactList.Dispose(); + if (intersectQueue.IsCreated) + intersectQueue.Dispose(); + if (intersectList.IsCreated) + intersectList.Dispose(); + + IntersectCount = 0; + } + + /// + /// ƒ‡ƒĵ‚żĉœ‰ç„Ħ‚’èż”™ + /// + /// + public bool HasPrimitive() + { + return (PointPrimitiveCount + EdgePrimitiveCount + TrianglePrimitiveCount) > 0; + } + + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.AppendLine($"[SelfCollisionConstraint]"); + sb.AppendLine($" -intersectFlagArray:{(intersectFlagArray.IsCreated ? intersectFlagArray.Length : 0)}"); + + return sb.ToString(); + } + + //========================================================================================= + /// + /// ċˆĥ約ƒ‡ƒĵ‚ż‚’ç™ğ録™‚‹ + /// + /// + internal void Register(ClothProcess cprocess) + { + UpdateTeam(cprocess.TeamId); + } + + /// + /// ċˆĥ約ƒ‡ƒĵ‚ż‚’解除™‚‹ + /// + /// + internal void Exit(ClothProcess cprocess) + { + if (cprocess != null && cprocess.TeamId > 0) + { + // Exitƒ•ƒİ‚°‚’èĤ‹Ĥè‡Şċ‹•çš„Ğ™ıĤè§£ĉ”•‚Œ‚‹ + // ŸċŒĉœŸç›¸ĉ‰‹ƒ•ƒİ‚°ĉ›´ĉ–°‚‚èĦŒ† + UpdateTeam(cprocess.TeamId); + } + } + + /// + /// ƒ•ƒİ‚°Š‚ˆ³ƒƒƒƒ•‚Ħĉ›´ĉ–° + /// + /// + /// + internal void UpdateTeam(int teamId) + { + var tm = MagicaManager.Team; + + if (tm.ContainsTeamData(teamId) == false) + return; + ref var tdata = ref tm.GetTeamDataRef(teamId); + var oldFlag = tdata.flag; + + // ƒƒĵƒ Œĉĥˆĉğ…中‹İ†‹ + bool exit = tdata.flag.IsSet(TeamManager.Flag_Exit); + + // sync解除 + if (exit && tdata.syncTeamId != 0 && tm.ContainsTeamData(tdata.syncTeamId)) + { + ref var stdata = ref tm.GetTeamDataRef(tdata.syncTeamId); + tm.RemoveSyncParent(ref stdata, teamId); + } + + // è‡ŞèşĞçŠĥĉ³‚’ċˆ¤ċš™‚‹ + ref var parameter = ref tm.GetParametersRef(teamId); + var selfMode = exit ? SelfCollisionMode.None : parameter.selfCollisionConstraint.selfMode; + var syncMode = exit ? SelfCollisionMode.None : parameter.selfCollisionConstraint.syncMode; + + bool usePointPrimitive = false; + bool useEdgePrimitive = false; + bool useTrianglePrimitive = false; + + bool selfEdgeEdge = false; + bool selfPointTriangle = false; + bool selfTrianglePoint = false; + bool selfEdgeTriangleIntersect = false; + bool selfTriangleEdgeIntersect = false; + + bool syncEdgeEdge = false; + bool syncPointTriangle = false; + bool syncTrianglePoint = false; + bool syncEdgeTriangleIntersect = false; + bool syncTriangleEdgeIntersect = false; + + bool PsyncEdgeEdge = false; + bool PsyncPointTriangle = false; + bool PsyncTrianglePoint = false; + bool PsyncEdgeTriangleIntersect = false; + bool PsyncTriangleEdgeIntersect = false; + + if (selfMode == SelfCollisionMode.FullMesh) + { + if (tdata.EdgeCount > 0) + { + useEdgePrimitive = true; + selfEdgeEdge = true; + } + if (tdata.TriangleCount > 0) + { + usePointPrimitive = true; + useTrianglePrimitive = true; + selfPointTriangle = true; + selfTrianglePoint = true; + } + if (tdata.EdgeCount > 0 && tdata.TriangleCount > 0) + { + selfEdgeTriangleIntersect = true; + selfTriangleEdgeIntersect = true; + } + } + + // sync + if (syncMode != SelfCollisionMode.None && tm.ContainsTeamData(tdata.syncTeamId)) + { + ref var stdata = ref tm.GetTeamDataRef(tdata.syncTeamId); + if (syncMode == SelfCollisionMode.FullMesh) + { + if (tdata.EdgeCount > 0 && stdata.EdgeCount > 0) + { + useEdgePrimitive = true; + syncEdgeEdge = true; + } + if (tdata.TriangleCount > 0) + { + useTrianglePrimitive = true; + syncTrianglePoint = true; + } + if (stdata.TriangleCount > 0) + { + usePointPrimitive = true; + syncPointTriangle = true; + } + if (tdata.EdgeCount > 0 && stdata.TriangleCount > 0) + { + syncEdgeTriangleIntersect = true; + } + if (tdata.TriangleCount > 0 && stdata.EdgeCount > 0) + { + syncTriangleEdgeIntersect = true; + } + } + } + + // sync parent + if (tdata.syncParentTeamId.Length > 0 && exit == false) + { + for (int i = 0; i < tdata.syncParentTeamId.Length; i++) + { + int parentTeamId = tdata.syncParentTeamId[i]; + ref var ptdata = ref tm.GetTeamDataRef(parentTeamId); + if (ptdata.IsValid) + { + ref var parentParameter = ref tm.GetParametersRef(parentTeamId); + var parentSyncMode = parentParameter.selfCollisionConstraint.syncMode; + if (parentSyncMode == SelfCollisionMode.FullMesh) + { + if (ptdata.EdgeCount > 0 && tdata.EdgeCount > 0) + { + useEdgePrimitive = true; + PsyncEdgeEdge = true; + } + if (ptdata.TriangleCount > 0) + { + usePointPrimitive = true; + PsyncPointTriangle = true; + } + if (tdata.TriangleCount > 0) + { + useTrianglePrimitive = true; + PsyncTrianglePoint = true; + } + if (tdata.EdgeCount > 0 && ptdata.TriangleCount > 0) + { + PsyncEdgeTriangleIntersect = true; + } + if (tdata.TriangleCount > 0 && ptdata.EdgeCount > 0) + { + PsyncTriangleEdgeIntersect = true; + } + } + } + } + } + + // ƒ•ƒİ‚° + tdata.flag.SetBits(TeamManager.Flag_Self_PointPrimitive, usePointPrimitive); + tdata.flag.SetBits(TeamManager.Flag_Self_EdgePrimitive, useEdgePrimitive); + tdata.flag.SetBits(TeamManager.Flag_Self_TrianglePrimitive, useTrianglePrimitive); + + tdata.flag.SetBits(TeamManager.Flag_Self_EdgeEdge, selfEdgeEdge); + tdata.flag.SetBits(TeamManager.Flag_Self_PointTriangle, selfPointTriangle); + tdata.flag.SetBits(TeamManager.Flag_Self_TrianglePoint, selfTrianglePoint); + tdata.flag.SetBits(TeamManager.Flag_Self_EdgeTriangleIntersect, selfEdgeTriangleIntersect); + tdata.flag.SetBits(TeamManager.Flag_Self_TriangleEdgeIntersect, selfTriangleEdgeIntersect); + + tdata.flag.SetBits(TeamManager.Flag_Sync_EdgeEdge, syncEdgeEdge); + tdata.flag.SetBits(TeamManager.Flag_Sync_PointTriangle, syncPointTriangle); + tdata.flag.SetBits(TeamManager.Flag_Sync_TrianglePoint, syncTrianglePoint); + tdata.flag.SetBits(TeamManager.Flag_Sync_EdgeTriangleIntersect, syncEdgeTriangleIntersect); + tdata.flag.SetBits(TeamManager.Flag_Sync_TriangleEdgeIntersect, syncTriangleEdgeIntersect); + + tdata.flag.SetBits(TeamManager.Flag_PSync_EdgeEdge, PsyncEdgeEdge); + tdata.flag.SetBits(TeamManager.Flag_PSync_PointTriangle, PsyncPointTriangle); + tdata.flag.SetBits(TeamManager.Flag_PSync_TrianglePoint, PsyncTrianglePoint); + tdata.flag.SetBits(TeamManager.Flag_PSync_EdgeTriangleIntersect, PsyncEdgeTriangleIntersect); + tdata.flag.SetBits(TeamManager.Flag_PSync_TriangleEdgeIntersect, PsyncTriangleEdgeIntersect); + + // point buffer + if (usePointPrimitive && tdata.selfPointChunk.IsValid == false) + { + // init + int pointCount = tdata.ParticleCount; + tdata.selfPointChunk = primitiveArrayB.AddRange(pointCount); + uniformGridStartCountBuffer.AddRange(pointCount); + int start = tdata.selfPointChunk.startIndex; + InitPrimitive(teamId, tdata, KindPoint, start, pointCount); + PointPrimitiveCount += pointCount; + } + else if (usePointPrimitive == false && tdata.selfPointChunk.IsValid) + { + // remove + primitiveArrayB.Remove(tdata.selfPointChunk); + uniformGridStartCountBuffer.Remove(tdata.selfPointChunk); + PointPrimitiveCount -= tdata.selfPointChunk.dataLength; + tdata.selfPointChunk.Clear(); + } + + // edge buffer + if (useEdgePrimitive && tdata.selfEdgeChunk.IsValid == false) + { + // init + int edgeCount = tdata.EdgeCount; + tdata.selfEdgeChunk = primitiveArrayB.AddRange(edgeCount); + uniformGridStartCountBuffer.AddRange(edgeCount); + int start = tdata.selfEdgeChunk.startIndex; + InitPrimitive(teamId, tdata, KindEdge, start, edgeCount); + EdgePrimitiveCount += edgeCount; + } + else if (useEdgePrimitive == false && tdata.selfEdgeChunk.IsValid) + { + // remove + primitiveArrayB.Remove(tdata.selfEdgeChunk); + uniformGridStartCountBuffer.Remove(tdata.selfEdgeChunk); + EdgePrimitiveCount -= tdata.selfEdgeChunk.dataLength; + tdata.selfEdgeChunk.Clear(); + } + + // triangle buffer + if (useTrianglePrimitive && tdata.selfTriangleChunk.IsValid == false) + { + // init + int triangleCount = tdata.TriangleCount; + tdata.selfTriangleChunk = primitiveArrayB.AddRange(triangleCount); + uniformGridStartCountBuffer.AddRange(triangleCount); + int start = tdata.selfTriangleChunk.startIndex; + InitPrimitive(teamId, tdata, KindTriangle, start, triangleCount); + TrianglePrimitiveCount += triangleCount; + } + else if (useTrianglePrimitive == false && tdata.selfTriangleChunk.IsValid) + { + // remove + primitiveArrayB.Remove(tdata.selfTriangleChunk); + uniformGridStartCountBuffer.Remove(tdata.selfTriangleChunk); + TrianglePrimitiveCount -= tdata.selfTriangleChunk.dataLength; + tdata.selfTriangleChunk.Clear(); + } + + // Intersect + bool useIntersect = tdata.flag.TestAny(TeamManager.Flag_Self_EdgeTriangleIntersect, 6); + bool oldIntersect = oldFlag.TestAny(TeamManager.Flag_Self_EdgeTriangleIntersect, 6); + if (useIntersect && oldIntersect == false) + { + // init + IntersectCount++; // ƒƒĵƒ ċˆİ用‚Ğ‚Ĥƒ³ƒˆ + } + else if (useIntersect == false && oldIntersect) + { + // remove + IntersectCount--; + } + + // ċŒĉœŸċŻèħĦĞċ݁—Ĥċ†ċ¸°™‚‹ + if (tdata.syncTeamId != 0 && tm.ContainsTeamData(tdata.syncTeamId)) + { + UpdateTeam(tdata.syncTeamId); + } + } + + /// + /// ƒ—ƒŞƒŸƒ†‚£ƒ–ċˆĉœŸċŒ– + /// + /// + /// + /// + /// + /// + void InitPrimitive(int teamId, TeamManager.TeamData tdata, uint kind, int startPrimitive, int length) + { + var vm = MagicaManager.VMesh; + + var job = new InitPrimitiveJob() + { + teamId = teamId, + tdata = tdata, + + kind = kind, + startPrimitive = startPrimitive, + + edges = vm.edges.GetNativeArray(), + triangles = vm.triangles.GetNativeArray(), + attributes = vm.attributes.GetNativeArray(), + vertexDepths = vm.vertexDepths.GetNativeArray(), + + primitiveArrayB = primitiveArrayB.GetNativeArray(), + }; + job.Run(length); // ““§ŻRun()§ċŸèĦŒ™‚‹ + } + + [BurstCompile] + struct InitPrimitiveJob : IJobParallelFor + { + public int teamId; + public TeamManager.TeamData tdata; + + public uint kind; + public int startPrimitive; + + // vmesh + [Unity.Collections.ReadOnly] + public NativeArray edges; + [Unity.Collections.ReadOnly] + public NativeArray triangles; + [Unity.Collections.ReadOnly] + public NativeArray attributes; + [Unity.Collections.ReadOnly] + public NativeArray vertexDepths; + + [NativeDisableParallelForRestriction] + public NativeArray primitiveArrayB; + + public void Execute(int index) + { + int pri_index = startPrimitive + index; + + var p = primitiveArrayB[pri_index]; + int pstart = tdata.particleChunk.startIndex; + + // ƒ—ƒŞƒŸƒ†‚£ƒ–‚’ĉ§‹ĉˆ™‚‹ƒ‘ƒĵƒ†‚£‚ŻƒĞ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı + int3 particleIndices = -1; + if (kind == KindPoint) + { + particleIndices[0] = pstart + index; + } + else if (kind == KindEdge) + { + int estart = tdata.proxyEdgeChunk.startIndex; + particleIndices.xy = edges[estart + index] + pstart; + } + else if (kind == KindTriangle) + { + int tstart = tdata.proxyTriangleChunk.startIndex; + particleIndices.xyz = triangles[tstart + index] + pstart; + } + + // ƒ•ƒİ‚°Şİ + uint flag = 0; + uint fix_flag = Flag_Fix0; + bool ignore = false; + int fixcnt = 0; + float depth = 0; + int ac = (int)kind + 1; // èğ¸ĉ•° + for (int i = 0; i < ac; i++) + { + int pindex = particleIndices[i]; + int vindex = tdata.proxyCommonChunk.startIndex + pindex - pstart; + var attr = attributes[vindex]; + if (attr.IsMove()) + flag &= ~fix_flag; + else + { + flag |= fix_flag; + fixcnt++; + } + fix_flag <<= 1; + if (attr.IsInvalid()) + ignore = true; + depth += vertexDepths[vindex]; + } + if (fixcnt == ac) + flag |= Flag_AllFix; + else + flag &= ~Flag_AllFix; + if (ignore) + flag |= Flag_Ignore; + depth /= ac; + + p.flag = (kind << 24) | flag; + p.particleIndices = particleIndices; + p.depth = depth; + p.grid = Define.System.SelfCollisionIgnoreGrid; // ç„ĦċŠı‚°ƒŞƒƒƒ‰ + + primitiveArrayB[pri_index] = p; + + //Debug.Log($"pri[{pri_index}] p:{p.particleIndices}, {p.GetKind()}"); + } + } + + /// + /// 作ĉ­ƒƒƒƒ•‚Ħĉ›´ĉ–° + /// + internal void WorkBufferUpdate() + { + // 交ċ·ƒ•ƒİ‚°ƒƒƒƒ•‚Ħ + if (IntersectCount > 0) + { + int pcnt = MagicaManager.Simulation.ParticleCount; + intersectFlagArray.MC2Resize(pcnt, options: NativeArrayOptions.ClearMemory); + } + } + + //========================================================================================= + // Primitive + //========================================================================================= + [BurstCompile] + unsafe internal struct SelfStep_UpdatePrimitiveJob : IJobParallelFor + { + public int workerCount; + public int updateIndex; + public float4 simulationPower; + + // team + [Unity.Collections.ReadOnly] + public NativeList batchSelfTeamList; + [Unity.Collections.ReadOnly] + public NativeArray teamDataArray; + [Unity.Collections.ReadOnly] + public NativeArray parameterArray; + + // particle + [Unity.Collections.ReadOnly] + public NativeArray nextPosArray; + [Unity.Collections.ReadOnly] + public NativeArray oldPosArray; + [Unity.Collections.ReadOnly] + public NativeArray frictionArray; + + // self collision + public bool useIntersect; + [NativeDisableParallelForRestriction] + public NativeArray primitiveArrayB; + [Unity.Collections.ReadOnly] + public NativeArray intersectFlagArray; + + // ƒƒƒƒċ†…ƒ­ƒĵ‚ЃЃƒĵƒ ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı”¨ + // ƒŻƒĵ‚Ѓĵċˆ†ċ‰²ïĵˆïĵ“ċ›şċšïĵ‰ + public void Execute(int index) + { + // ƒƒĵƒ ID¨ƒŻƒĵ‚ЃĵID + int localIndex = index / workerCount; + int workerIndex = index % workerCount; + + // ċ„ƒ™ƒĵ‚ıƒ‚¤ƒ³‚ż + TeamManager.TeamData* teamPt = (TeamManager.TeamData*)teamDataArray.GetUnsafeReadOnlyPtr(); + ClothParameters* paramPt = (ClothParameters*)parameterArray.GetUnsafeReadOnlyPtr(); + + int teamId = batchSelfTeamList[localIndex]; + ref var tdata = ref *(teamPt + teamId); + ref var param = ref *(paramPt + teamId); + + if (updateIndex >= tdata.updateCount) + return; + if (tdata.IsProcess == false) + return; + if (tdata.ParticleCount == 0) + return; + + // ‚ğƒĞƒ•‚³ƒŞ‚¸ƒ§ƒ³ + // ■ƒ—ƒŞƒŸƒ†‚£ƒ–¨‚°ƒŞƒƒƒ‰ĉ›´ĉ–° + // 範ċ›² + //var chunk = MathUtility.GetWorkerChunk(tdata.particleChunk.dataLength, workerCount, workerIndex); + //if (chunk.IsValid) + { + UpdatePrimitive( + workerIndex, + // team + teamId, + ref tdata, + ref param, + // particle + ref nextPosArray, + ref oldPosArray, + ref frictionArray, + // self collisiotn + useIntersect, + ref primitiveArrayB, + ref intersectFlagArray + ); + } + } + } + + /// + /// ƒ–ƒ­ƒĵƒ‰ƒ•‚§ƒĵ‚ş + /// ƒ—ƒŞƒŸƒ†‚£ƒ–ĉ›´ĉ–° + /// + unsafe static void UpdatePrimitive( + int k, + // team + int teamId, + ref TeamManager.TeamData tdata, + ref ClothParameters param, + // particle + ref NativeArray nextPosArray, + ref NativeArray oldPosArray, + ref NativeArray frictionArray, + // self collision + bool useIntersect, + ref NativeArray primitiveArrayB, + ref NativeArray intersectFlagArray + ) + { + // ƒƒĵƒ ç¨éĦž”¨(0:Point,1:Edge,2:Triangle) + + // ■ƒ—ƒŞƒŸƒ†‚£ƒ–ĉ›´ĉ–° =================================================================== + Primitive* pt = (Primitive*)primitiveArrayB.GetUnsafePtr(); + + int pstart = tdata.particleChunk.startIndex; + + // (0)Point/(1)Edge/(2)Triangle + float maxPrimitiveSize = 0; + //for (int k = 0; k < 3; k++) + { + DataChunk pc = k == KindPoint ? tdata.selfPointChunk : (k == KindEdge ? tdata.selfEdgeChunk : tdata.selfTriangleChunk); + //Debug.Log($"[{teamId}] kind:{k} pc:{pc.ToString()}"); + + if (pc.IsValid) + { + uint kind = (uint)k; + + float3x3 nextPos = 0; + float3x3 oldPos = 0; + + int priIndex = pc.startIndex; + for (int j = 0; j < pc.dataLength; j++, priIndex++) + { + ref var p = ref *(pt + priIndex); + + if (p.IsIgnore()) + continue; + + // ƒ—ƒŞƒŸƒ†‚£ƒ–ĉ›´ĉ–° + int ac = k + 1; // èğ¸ĉ•° + uint fix_flag = Flag_Fix0; + uint intersect_flag = 0; + for (int i = 0; i < ac; i++) + { + int pindex = p.particleIndices[i]; + nextPos[i] = nextPosArray[pindex]; + oldPos[i] = oldPosArray[pindex]; + bool fix = (p.flag & fix_flag) != 0; + p.invMass[i] = MathUtility.CalcSelfCollisionInverseMass(frictionArray[pindex], fix, param.selfCollisionConstraint.clothMass); + fix_flag <<= 1; + + if (useIntersect && intersectFlagArray[pindex] != 0) + intersect_flag |= (Flag_Intersect0 << i); + } + float thickness = param.selfCollisionConstraint.surfaceThicknessCurveData.MC2EvaluateCurve(p.depth); + thickness *= tdata.scaleRatio; // team scale + p.thickness = thickness; + + // ƒ—ƒŞƒŸƒ†‚£ƒ–AABB + var aabb = new AABB(math.min(nextPos[0], oldPos[0]), math.max(nextPos[0], oldPos[0])); + for (int i = 1; i < ac; i++) + { + aabb.Encapsulate(nextPos[i]); + aabb.Encapsulate(oldPos[i]); + } + float aabbSize = aabb.MaxSideLength; + maxPrimitiveSize = math.max(maxPrimitiveSize, aabbSize); + aabb.Expand(thickness); // ċŽšż + p.aabb = aabb; + + // ‚¤ƒ³‚żƒĵ‚ğ‚Żƒˆƒ•ƒİ‚°ĉ›´ĉ–° + p.flag = (p.flag & 0xfffffff8) | intersect_flag; + } + } + } + + // ■UniformGrid‚µ‚¤‚şĉħşċš ============================================================== + // ç¨éĦžŒEdgeċ ´ċˆżè¨­ċš + if (k == KindEdge) + { + const float uniformGridScale = 3.0f; // 一ĉ—Ĥ“‚Œ§ 3.0? + float gridSize = maxPrimitiveSize * uniformGridScale; + tdata.selfGridSize = gridSize; + tdata.selfMaxPrimitiveSize = maxPrimitiveSize; // ĉœ€ċ¤§ƒ—ƒŞƒŸƒ†‚£ƒ–‚µ‚¤‚ş + //Debug.Log($"[{teamId}] maxPrimitiveSize:{maxPrimitiveSize} gridSize:{gridSize}"); + } + //Debug.Log($"[{teamId}] kind:{k}, maxPrimitiveSize:{maxPrimitiveSize}"); + } + + [BurstCompile] + unsafe internal struct SelfStep_UpdateGridJob : IJobParallelFor + { + public int kindCount; + public int updateIndex; + public float4 simulationPower; + + // team + [Unity.Collections.ReadOnly] + public NativeList batchSelfTeamList; + [Unity.Collections.ReadOnly] + public NativeArray teamDataArray; + + // self collision + [Unity.Collections.ReadOnly] + public NativeArray primitiveArrayB; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray uniformGridStartCountBuffer; + + // ƒƒƒƒċ†…ƒ­ƒĵ‚ЃЃƒĵƒ ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı”¨ + // ƒŻƒĵ‚Ѓĵċˆ†ċ‰²ïĵˆïĵ“ċ›şċšïĵ‰ + public void Execute(int index) + { + // ƒƒĵƒ ID¨ƒŻƒĵ‚ЃĵID + int localIndex = index / kindCount; + int kindIndex = index % kindCount; + + // ċ„ƒ™ƒĵ‚ıƒ‚¤ƒ³‚ż + TeamManager.TeamData* teamPt = (TeamManager.TeamData*)teamDataArray.GetUnsafeReadOnlyPtr(); + + int teamId = batchSelfTeamList[localIndex]; + ref var tdata = ref *(teamPt + teamId); + + if (updateIndex >= tdata.updateCount) + return; + if (tdata.IsProcess == false) + return; + if (tdata.ParticleCount == 0) + return; + + // ‚ğƒĞƒ•‚³ƒŞ‚¸ƒ§ƒ³ + // ■ƒ—ƒŞƒŸƒ†‚£ƒ–¨‚°ƒŞƒƒƒ‰ĉ›´ĉ–°ïĵˆċˆċ›ž‚ıƒ†ƒƒƒ—żïĵ‰ + if (updateIndex == 0) + { + UpdateGrid( + kindIndex, + // team + teamId, + ref tdata, + // self collisiotn + ref primitiveArrayB, + ref uniformGridStartCountBuffer + ); + } + } + } + + unsafe static void UpdateGrid( + int k, + // team + int teamId, + ref TeamManager.TeamData tdata, + // self collision + ref NativeArray primitiveArrayB, + ref NativeArray uniformGridStartCountBuffer + ) + { + // ƒƒĵƒ ç¨éĦž”¨(0:Point,1:Edge,2:Triangle) + + // ■ƒ—ƒŞƒŸƒ†‚£ƒ–ĉ›´ĉ–° =================================================================== + Primitive* pt = (Primitive*)primitiveArrayB.GetUnsafeReadOnlyPtr(); + GridInfo* gt = (GridInfo*)uniformGridStartCountBuffer.GetUnsafePtr(); + + //int pstart = tdata.particleChunk.startIndex; + + // ■““‹‚‰Żè‡ŞèşĞ‚°ƒŞƒƒƒ‰Œċ‚ç…§•‚Œ‚‹ċ ´ċˆż§è‰Ż„ + // ¤‚Šè‡ŞèşĞ‚ğƒĞƒ•‚³ƒŞ‚¸ƒ§ƒ³‹èĤށ‹‚‰ç›¸äş’‚³ƒŞ‚¸ƒ§ƒ³ + if (tdata.flag.IsSet(TeamManager.Flag_Self_EdgeEdge) + || tdata.flag.IsSet(TeamManager.Flag_Self_PointTriangle) + || tdata.flag.IsSet(TeamManager.Flag_Self_TrianglePoint) + || tdata.flag.IsSet(TeamManager.Flag_PSync_EdgeEdge) + || tdata.flag.IsSet(TeamManager.Flag_PSync_PointTriangle) + || tdata.flag.IsSet(TeamManager.Flag_PSync_TrianglePoint) + ) + { + { + DataChunk pc = k == KindPoint ? tdata.selfPointChunk : (k == KindEdge ? tdata.selfEdgeChunk : tdata.selfTriangleChunk); + //Debug.Log($"[{teamId}] calc grid. kind:{k} pstart:{pc.startIndex}, pcount:{pc.dataLength}"); + if (pc.IsValid) + { + // ■ƒ—ƒŞƒŸƒ†‚£ƒ–‚°ƒŞƒƒƒ‰ċş§ĉ¨™ç—ċ‡ş ======================================================= + int priIndex = pc.startIndex; + for (int j = 0; j < pc.dataLength; j++, priIndex++) + { + ref var p = ref *(pt + priIndex); + if (p.IsIgnore()) + p.grid = Define.System.SelfCollisionIgnoreGrid; // ç„ĦċŠı‚°ƒŞƒƒƒ‰ + else + p.grid = GetGrid(p.aabb.Center, tdata.selfGridSize); + } + + // ■ƒ—ƒŞƒŸƒ†‚£ƒ–‚’‚°ƒŞƒƒƒ‰é †Ğ‚½ƒĵƒˆ™‚‹ ================================================= + NativeSortExtension.Sort(pt + pc.startIndex, pc.dataLength); + + // ■‚°ƒŞƒƒƒ‰é–‹ċ§‹ä½ç½¨ĉ•°‚’ĉ‘˜ċ‡ş™‚‹ ===================================================== + int3 nowGrid = 0; + int nowGridStart = 0; + int nowGridCount = 0; + int gridBufferStart = pc.startIndex; + int gridBufferIndex = gridBufferStart; + int gridBufferCount = 0; + priIndex = pc.startIndex; + for (int i = 0; i < pc.dataLength; i++, priIndex++) + { + ref var p = ref *(pt + priIndex); + + if (i == 0) + { + // ċˆċ›ž‚°ƒŞƒƒƒ‰ + nowGrid = p.grid; + nowGridStart = priIndex; + nowGridCount = 0; + } + else if (p.grid.Equals(nowGrid.xyz) == false) + { + // çċœ¨‚°ƒŞƒƒƒ‰‚’保ċ­˜ + uniformGridStartCountBuffer[gridBufferIndex] = new GridInfo() { hash = nowGrid.GetHashCode(), start = nowGridStart, count = nowGridCount }; + gridBufferIndex++; + gridBufferCount++; + //Debug.Log(nowGrid.GetHashCode()); + + // ĉĴĦ‚°ƒŞƒƒƒ‰é–‹ċ§‹ + nowGrid = p.grid; + nowGridStart = priIndex; + nowGridCount = 0; + } + nowGridCount++; + } + // ĉœ€ċŒ‚°ƒŞƒƒƒ‰‚’記録 + if (nowGridCount > 0) + { + uniformGridStartCountBuffer[gridBufferIndex] = new GridInfo() { hash = nowGrid.GetHashCode(), start = nowGridStart, count = nowGridCount }; + gridBufferIndex++; + gridBufferCount++; + //Debug.Log(nowGrid.GetHashCode()); + } + + // ‚°ƒŞƒƒƒ‰ĉ•°‚’記録 + switch (k) + { + case 0: + tdata.selfPointGridCount = gridBufferCount; + break; + case 1: + tdata.selfEdgeGridCount = gridBufferCount; + break; + case 2: + tdata.selfTriangleGridCount = gridBufferCount; + break; + } + + // ‚°ƒŞƒƒƒ‰ĉƒ…ċ ħ‚’ƒƒƒ‚·ƒ§‚½ƒĵƒˆ + // ïĵ’ċˆ†ĉŽ˘ç´˘Ÿ‚ + NativeSortExtension.Sort(gt + gridBufferStart, gridBufferCount); + + //Debug.Log($"[{teamId}] calc grid. kind:{k} pstart:{pc.startIndex}, pcount:{pc.dataLength}, grid count:{gridBufferCount}"); + } + } + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + static int3 GetGrid(float3 pos, float gridSize) + { + //Debug.Assert(gridSize > 0.0f); + return new int3(math.floor(pos / gridSize)); + } + + //========================================================================================= + // Contact + //========================================================================================= + [BurstCompile] + unsafe internal struct SelfStep_DetectionContactJob : IJobParallelFor + { + public int updateIndex; + public int workerCount; + public int teamCount; + + // team + [Unity.Collections.ReadOnly] + public NativeList batchSelfTeamList; + [Unity.Collections.ReadOnly] + public NativeArray teamDataArray; + + // particle + [Unity.Collections.ReadOnly] + public NativeArray nextPosArray; + [Unity.Collections.ReadOnly] + public NativeArray oldPosArray; + + // self collision + [Unity.Collections.ReadOnly] + public NativeArray primitiveArrayB; + [Unity.Collections.ReadOnly] + public NativeArray uniformGridStartCountBuffer; + + // buffer + [NativeDisableParallelForRestriction] + public NativeQueue.ParallelWriter contactQueue; + + // ïĵ‘ƒƒĵƒ ïĵ–‚¤ƒ³ƒ‡ƒƒ‚Ż‚ıċˆ†ċ‰² x ƒŻƒĵ‚Ѓĵĉ•° + public void Execute(int index) + { + // ċ„ƒ™ƒĵ‚ıƒ‚¤ƒ³‚ż + TeamManager.TeamData* teamPt = (TeamManager.TeamData*)teamDataArray.GetUnsafeReadOnlyPtr(); + + // ƒƒĵƒ ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı + int teamIndex = index / (6 * workerCount); + index = index % (6 * workerCount); + int teamId = batchSelfTeamList[teamIndex]; + ref var tdata = ref *(teamPt + teamId); + if (updateIndex >= tdata.updateCount) + return; + if (tdata.IsProcess == false) + return; + if (tdata.ParticleCount == 0) + return; + + // ƒŻƒĵ‚Ѓĵ番ċ· + int workerIndex = index / 6; + index = index % 6; + + // ‚ğƒĞƒ•‚³ƒŞ‚¸ƒ§ƒ³ or 相互‚³ƒŞ‚¸ƒ§ƒ³ + int collisionMode = index / 3; + index = index % 3; + + // ‚³ƒŞ‚¸ƒ§ƒ³ç¨éĦž + int contactKind = index; + + uint myKind = 0, tarKind = 0; + switch (contactKind) + { + case ContactType_EdgeEdge: + myKind = KindEdge; + tarKind = KindEdge; + break; + case ContactType_PointTriangle: + myKind = KindPoint; + tarKind = KindTriangle; + break; + case ContactType_TrianglePoint: + myKind = KindTriangle; + tarKind = KindPoint; + break; + } + + // ■‚³ƒ³‚ż‚Żƒˆƒƒƒƒ•‚Ħ作ĉˆïĵˆ‚ıƒ†ƒƒƒ—ċˆċ›žżïĵ‰ + + if (collisionMode == 0) + { + // ‚ğƒĞƒ•‚³ƒŞ‚¸ƒ§ƒ³ + // ‚ğƒĞƒ•‚³ƒŞ‚¸ƒ§ƒ³§ŻTrianglePointŻä¸èĤ + if (contactKind == ContactType_TrianglePoint) + return; + + int selfFlag = TeamManager.Flag_Self_EdgeEdge + (contactKind * 3); + if (tdata.flag.IsSet(selfFlag)) + { + //Debug.Log($"Self detection contact. myTeam:{teamId}, myKind:{myKind}, tarTeam:{teamId}, tarKind:{tarKind}"); + + DetectionContacts( + workerCount, + workerIndex, + teamId, + ref tdata, + myKind, + teamId, + ref tdata, + tarKind, + ref nextPosArray, + ref oldPosArray, + ref primitiveArrayB, + ref uniformGridStartCountBuffer, + ref contactQueue + ); + } + } + else if (collisionMode == 1 && tdata.syncTeamId > 0) + { + // 相互‚³ƒŞ‚¸ƒ§ƒ³ + ref var stdata = ref *(teamPt + tdata.syncTeamId); + int syncFlag = TeamManager.Flag_Sync_EdgeEdge + (contactKind * 3); + if (tdata.flag.IsSet(syncFlag) && stdata.IsProcess && stdata.ParticleCount > 0) + { + //Debug.Log($"Sync detection contact. myTeam:{teamId}, myKind:{myKind}, tarTeam:{teamId}, tarKind:{tarKind}"); + + DetectionContacts( + workerCount, + workerIndex, + teamId, + ref tdata, + myKind, + tdata.syncTeamId, + ref stdata, + tarKind, + ref nextPosArray, + ref oldPosArray, + ref primitiveArrayB, + ref uniformGridStartCountBuffer, + ref contactQueue + ); + } + } + + //Debug.Log($"Detection contact. team:{teamId}, collisionMode:{collisionMode}, contactKind:{contactKind}, writeCount:{writeCount}"); + } + } + + unsafe static void DetectionContacts( + int workerCount, + int workerIndex, + // my + int myTeamId, + ref TeamManager.TeamData myTeam, + uint myKind, + // target + int targetTeamId, + ref TeamManager.TeamData targetTeam, + uint targetKind, + // particle + ref NativeArray nextPosArray, + ref NativeArray oldPosArray, + // self collision + ref NativeArray primitiveArrayB, + ref NativeArray uniformGridStartCountBuffer, + // contact buffer + ref NativeQueue.ParallelWriter contactQueue + ) + { + Primitive* pt = (Primitive*)primitiveArrayB.GetUnsafeReadOnlyPtr(); + GridInfo* gt = (GridInfo*)uniformGridStartCountBuffer.GetUnsafeReadOnlyPtr(); + + // ċ‚ç…§ċ…ƒ + DataChunk myPriChunk = myKind == KindPoint ? myTeam.selfPointChunk : (myKind == KindEdge ? myTeam.selfEdgeChunk : myTeam.selfTriangleChunk); + if (myPriChunk.IsValid == false) + return; + + // ƒŻƒĵ‚Ѓĵċˆ†ĉ•£Ğ‚ˆ‚‹çŻ„ċ›² + int2 range = MathUtility.CalcSplitRange(myPriChunk.dataLength, workerCount, workerIndex); + myPriChunk.startIndex += range.x; + myPriChunk.dataLength = range.y - range.x; + + // ċŻèħĦ + DataChunk tarPriChunk = targetKind == KindPoint ? targetTeam.selfPointChunk : (targetKind == KindEdge ? targetTeam.selfEdgeChunk : targetTeam.selfTriangleChunk); + if (tarPriChunk.IsValid == false) + return; + int gridBufferStart = tarPriChunk.startIndex; + int gridBufferIndex = gridBufferStart; + int gridBufferCount = 0; + switch (targetKind) + { + case KindPoint: + gridBufferCount = targetTeam.selfPointGridCount; + break; + case KindEdge: + gridBufferCount = targetTeam.selfEdgeGridCount; + break; + case KindTriangle: + gridBufferCount = targetTeam.selfTriangleGridCount; + break; + } + float maxPrimitiveSize = targetTeam.selfMaxPrimitiveSize; + float gridSize = targetTeam.selfGridSize; + + // 重複ċˆ¤ċšĉœ‰ç„Ħ + bool duplicateDetection = (myTeamId == targetTeamId && myKind == targetKind); + + // ƒ—ƒŞƒŸƒ†‚£ƒ–ĉŽçĥšċˆ¤ċš + bool connectionCheck = myTeamId == targetTeamId; + + // ĉŽè§Ĥ‚ż‚¤ƒ— + bool primitiveFlip = false; + byte contactType = ContactType_EdgeEdge; + if (myKind == KindPoint && targetKind == KindTriangle) + contactType = ContactType_PointTriangle; + else if (myKind == KindTriangle && targetKind == KindPoint) + { + contactType = ContactType_PointTriangle; + primitiveFlip = true; + } + + // ƒ—ƒŞƒŸƒ†‚£ƒ–”¨ + GridInfo searchGridInfo = new GridInfo(); + int priIndex = myPriChunk.startIndex; + for (int i = 0; i < myPriChunk.dataLength; i++, priIndex++) + { + ref var p = ref *(pt + priIndex); + + // ç„ĦċŠıċˆ¤ċš + if (p.IsIgnore()) + continue; + + bool pFix = (p.flag & Flag_AllFix) != 0; + + // “ƒ—ƒŞƒŸƒ†‚£ƒ–ĉ¤œç´˘çŻ„ċ›² + float3 areaMin = p.aabb.Min - maxPrimitiveSize * 0.5f; + float3 areaMax = p.aabb.Max + maxPrimitiveSize * 0.5f; + + // ‚°ƒŞƒƒƒ‰çŻ„ċ›²Ğċ¤‰ĉ›™‚‹ + int3 startGrid = GetGrid(areaMin, gridSize); + int3 endGrid = GetGrid(areaMax, gridSize); + + // ‚°ƒŞƒƒƒ‰çŻ„ċ›²‚’èŞżı‚‹ + int3 currentGrid = startGrid; + bool finish = false; + while (finish == false) + { + // ‚°ƒŞƒƒƒ‰ĉƒ…ċ ħĉ¤œç´˘ïĵˆƒƒƒ‚·ƒċ€¤Ğ‚ˆ‚‹ïĵ’ċˆ†ĉŽ˘ç´˘ïĵ‰ + int currentHash = currentGrid.GetHashCode(); + searchGridInfo.hash = currentHash; + int infoIndex = NativeSortExtension.BinarySearch(gt + gridBufferStart, gridBufferCount, searchGridInfo); + if (infoIndex >= 0) + { + // “‚°ƒŞƒƒƒ‰ĞŻƒ—ƒŞƒŸƒ†‚£ƒ–Œċ­˜ċœ¨™‚‹ + ref var gridInfo = ref *(gt + gridBufferStart + infoIndex); + int startPriIndex2 = gridInfo.start; + int endPriIndex2 = startPriIndex2 + gridInfo.count; + + // 重複ċˆ¤ċšïĵš‚°ƒŞƒƒƒ‰ċ…¨ä½“Œçċœ¨priIndex‚ˆ‚Šä¸‹Ş‚‰°ĉ¤œç´˘ä¸èĤ + if (duplicateDetection == false || endPriIndex2 >= priIndex) + { + // 重複ċˆ¤ċšïĵšçċœ¨pindex‚ˆ‚Šä¸Š‚‚ ‘‚’èŞżı‚‹ + int priIndex2 = duplicateDetection ? math.max(startPriIndex2, priIndex) : startPriIndex2; + for (; priIndex2 < endPriIndex2; priIndex2++) + { + if (duplicateDetection && priIndex == priIndex2) + continue; + + ref var p2 = ref *(pt + priIndex2); + + // AABBċˆ¤ċš + if (p.aabb.Overlaps(p2.aabb) == false) + continue; + + // ç„ĦċŠıċˆ¤ċš + if (p2.IsIgnore()) + continue; + + // ä¸Ħĉ–ıƒ—ƒŞƒŸƒ†‚£ƒ–ŒċŒċ…¨ċ›şċšŞ‚‰°ç„ĦċŠı + if (pFix && ((p2.flag & Flag_AllFix) != 0)) + continue; + + // ƒ—ƒŞƒŸƒ†‚£ƒ–ċŒċ£ĞŒĉŽçĥš—Ĥ„‚‹ċ ´ċˆŻç„ĦċŠı + if (connectionCheck && p.AnyParticle(ref p2)) + continue; + + // !èĦçށĉ¤œċ‡şïĵ + // ‚³ƒ³‚ż‚Żƒˆƒƒƒƒ•‚Ħ生ĉˆ + var contact = new ContactInfo() + { + primitiveIndex0 = primitiveFlip == false ? priIndex : priIndex2, + primitiveIndex1 = primitiveFlip == false ? priIndex2 : priIndex, + contactType = contactType, + thickness = (half)(p.thickness + p2.thickness), + }; + + // ‚³ƒ³‚ż‚Żƒˆċ¤‰ä½ċˆ¤ċš + UpdateContactInfo( + ref contact, + pt, + ref nextPosArray, + ref oldPosArray, + Define.System.SelfCollisionSCR, + true + ); + if (contact.enable == 0) + continue; + + contactQueue.Enqueue(contact); + //Debug.Log($"Contact! myTeamId:{myTeamId}, myKind:{myKind}, targetTeamId:{targetTeamId}, targetKind:{targetKind}, ({priIndex}->{priIndex2})"); + } + } + } + + // next + currentGrid.x++; + if (currentGrid.x > endGrid.x) + { + currentGrid.x = startGrid.x; + currentGrid.y++; + if (currentGrid.y > endGrid.y) + { + currentGrid.y = startGrid.y; + currentGrid.z++; + if (currentGrid.z > endGrid.z) + { + finish = true; + } + } + } + } + } + } + + [BurstCompile] + unsafe internal struct SelfStep_ConvertContactListJob : IJob + { + [Unity.Collections.ReadOnly] + public NativeQueue contactQueue; + + [NativeDisableParallelForRestriction] + public NativeList contactList; + + public void Execute() + { + contactList.Clear(); + if (contactQueue.Count > 0) + contactList.AddRange(contactQueue.ToArray(Allocator.Temp)); + + //Debug.Log($"contact count:{contactList.Length}"); + } + } + + [BurstCompile] + unsafe internal struct SelfStep_UpdateContactJob : IJobParallelForDefer + { + public bool first; + [NativeDisableParallelForRestriction] + public NativeList contactList; + + // particle + [Unity.Collections.ReadOnly] + public NativeArray nextPosArray; + [Unity.Collections.ReadOnly] + public NativeArray oldPosArray; + // self collision + [Unity.Collections.ReadOnly] + public NativeArray primitiveArrayB; + + // ‚³ƒ³‚ż‚Żƒˆ”¨ + public void Execute(int index) + { + Primitive* pt = (Primitive*)primitiveArrayB.GetUnsafeReadOnlyPtr(); + ContactInfo* ct = (ContactInfo*)contactList.GetUnsafePtr(); + + ref ContactInfo contact = ref *(ct + index); + + // ċċİ計ç—用Ğ‚³ƒ³‚ż‚Żƒˆĉƒ…ċ ħ‚’ĉ›´ĉ–°™‚‹ + UpdateContactInfo( + ref contact, + pt, + ref nextPosArray, + ref oldPosArray, + Define.System.SelfCollisionSCR, + first + ); + } + } + + unsafe static void UpdateContactInfo( + ref ContactInfo contact, + Primitive* pt, + ref NativeArray nextPosArray, + ref NativeArray oldPosArray, + float scrScale, + bool first + ) + { + ref var p0 = ref *(pt + contact.primitiveIndex0); + ref var p1 = ref *(pt + contact.primitiveIndex1); + + float thickness = contact.thickness; + float scr = thickness * scrScale; + + contact.enable = 0; + + // AABB + + + // ‚³ƒ³‚ż‚Żƒˆè§£ĉħş + if (contact.contactType == ContactType_EdgeEdge) + { + var nextPosA0 = nextPosArray[p0.particleIndices.x]; + var nextPosA1 = nextPosArray[p0.particleIndices.y]; + var nextPosB0 = nextPosArray[p1.particleIndices.x]; + var nextPosB1 = nextPosArray[p1.particleIndices.y]; + var oldPosA0 = oldPosArray[p0.particleIndices.x]; + var oldPosA1 = oldPosArray[p0.particleIndices.y]; + var oldPosB0 = oldPosArray[p1.particleIndices.x]; + var oldPosB1 = oldPosArray[p1.particleIndices.y]; + + // ç§ğċ‹•ċ‰ïĵ’¤ç·šċˆ†ĉœ€èż‘ĉŽç‚ı + float csqlen = MathUtility.ClosestPtSegmentSegment(oldPosA0, oldPosA1, oldPosB0, oldPosB1, out var s, out var t, out var cA, out var cB); + float clen = math.sqrt(csqlen); // ĉœ€èż‘ĉŽç‚ıè·é›˘ + if (clen < 1e-09f) + return; + + // ĉŠĵċ‡şĉ³•ç·š + float3 n = (cA - cB) / clen; + + // ĉœ€èż‘ĉŽç‚ı§ċ¤‰ä½ + var dA0 = nextPosA0 - oldPosA0; + var dA1 = nextPosA1 - oldPosA1; + var dB0 = nextPosB0 - oldPosB0; + var dB1 = nextPosB1 - oldPosB1; + float3 da = math.lerp(dA0, dA1, s); + float3 db = math.lerp(dB0, dB1, t); + + // ċ¤‰ä½da,db‚’nĞĉŠ•ċ½ħ—Ĥè·é›˘ƒ‚§ƒƒ‚Ż + float l0 = math.dot(n, da); + float l1 = math.dot(n, db); + float l = clen + l0 - l1; + if (l > (thickness + scr)) + return; + + // ĉœ‰ċŠı + contact.enable = 1; + contact.s = (half)s; + contact.t = (half)t; + contact.n = (half3)n; + } + else if (contact.contactType == ContactType_PointTriangle) + { + var nextPosA0 = nextPosArray[p0.particleIndices.x]; + var oldPosA0 = oldPosArray[p0.particleIndices.x]; + + var nextPosB0 = nextPosArray[p1.particleIndices.x]; + var nextPosB1 = nextPosArray[p1.particleIndices.y]; + var nextPosB2 = nextPosArray[p1.particleIndices.z]; + var oldPosB0 = oldPosArray[p1.particleIndices.x]; + var oldPosB1 = oldPosArray[p1.particleIndices.y]; + var oldPosB2 = oldPosArray[p1.particleIndices.z]; + + // ċ¤‰ä½ + var dA = nextPosA0 - oldPosA0; + var dB0 = nextPosB0 - oldPosB0; + var dB1 = nextPosB1 - oldPosB1; + var dB2 = nextPosB2 - oldPosB2; + + // èĦçŞäşˆĉ¸Ĵ¨ĉ ĵ納 + float3 cp; + // ç§ğċ‹•ċ‰ƒ‚¤ƒ³ƒˆ¨ç§ğċ‹•ċ‰ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ¸ĉœ€èż‘ĉŽç‚ı + cp = MathUtility.ClosestPtPointTriangle(oldPosA0, oldPosB0, oldPosB1, oldPosB2, out var uvw); + + // ĉœ€èż‘ĉŽç‚ıċş§ĉ¨™ċ¤‰ä½‚’ĉħ‚‚‚‹ + float3 dt = dB0 * uvw.x + dB1 * uvw.y + dB2 * uvw.z; + + // ĉœ€èż‘ĉŽç‚ıƒ™‚ŻƒˆƒĞ + float3 cv = cp - oldPosA0; + float cvlen = math.length(cv); + if (cvlen <= Define.System.Epsilon) + return; + + var n = cv / cvlen; + + // ċ¤‰ä½dp,dt‚’nĞĉŠ•ċ½ħ—Ĥè·é›˘ƒ‚§ƒƒ‚Ż + float l0 = math.dot(n, dA); + float l1 = math.dot(n, dt); + float l = cvlen - l0 + l1; + + // ĉŽçĥšċˆ¤ċš + if (l >= (thickness + scr)) + return; + + // ĉ–ıċ‘ĉ€§ċˆ¤ċš + // !signç—ċ‡şŻ‚ރނ¸ƒŠƒĞ§Żç™ğ録ĉ™‚Ğïĵ‘ċ›ž—‹èĦŒ£Ĥ„Ş„€‚ + float sign = contact.s; + if (first) + { + // ç§ğċ‹•ċ‰ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĉ³•ç·š + float3 otn = MathUtility.TriangleNormal(oldPosB0, oldPosB1, oldPosB2); + + // ç§ğċ‹•ċ‰ƒ‘ƒĵƒ†‚£‚ŻƒĞĉ–ıċ‘ĉ€§ + n = math.normalize(oldPosA0 - cp); + float dot = math.dot(otn, n); + // ç§ğċ‹•ċ‰Ğƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ面Ğċ݁—Ĥğĵĉ°´ċı³Ş‚‰°ç„ĦèĤ–™‚‹ + if (math.abs(dot) >= Define.System.SelfCollisionPointTriangleAngleCos) + sign = math.sign(dot); + else + return; + } + contact.s = (half)sign; + + // ĉœ‰ċŠı + contact.enable = 1; + } + } + + [BurstCompile] + unsafe internal struct SelfStep_SolverContactJob : IJobParallelForDefer + { + // particle + [Unity.Collections.ReadOnly] + public NativeArray nextPosArray; + + // self collision + [Unity.Collections.ReadOnly] + public NativeArray primitiveArrayB; + [Unity.Collections.ReadOnly] + public NativeList contactList; + + // buffer2 + [NativeDisableParallelForRestriction] + public NativeArray tempVectorBufferA; + [NativeDisableParallelForRestriction] + public NativeArray tempCountBuffer; + + // ‚³ƒ³‚ż‚Żƒˆ”¨ + public void Execute(int index) + { + ContactInfo* ct = (ContactInfo*)contactList.GetUnsafeReadOnlyPtr(); + Primitive* pt = (Primitive*)primitiveArrayB.GetUnsafeReadOnlyPtr(); + int* cntPt = (int*)tempCountBuffer.GetUnsafePtr(); + int* sumPt = (int*)tempVectorBufferA.GetUnsafePtr(); + + ref var contact = ref *(ct + index); + + // è§£ĉħş + if (contact.enable == 0) + return; + + ref var p0 = ref *(pt + contact.primitiveIndex0); + ref var p1 = ref *(pt + contact.primitiveIndex1); + + float thickness = contact.thickness; + float scr = thickness * Define.System.SelfCollisionSCR; + + // ‚³ƒ³‚ż‚Żƒˆè§£ĉħş + if (contact.contactType == ContactType_EdgeEdge) + { + var nextPosA0 = nextPosArray[p0.particleIndices.x]; + var nextPosA1 = nextPosArray[p0.particleIndices.y]; + var nextPosB0 = nextPosArray[p1.particleIndices.x]; + var nextPosB1 = nextPosArray[p1.particleIndices.y]; + + float s = contact.s; + float t = contact.t; + float3 n = contact.n; + + // ç§ğċ‹•ċ‰ĞĉŽè§Ĥċˆ¤ċš‚’èĦŒ£Ÿä½ç½ç§ğċ‹•ċŒä½ç½a/b¨ĉ–ıċ‘ƒ™‚ŻƒˆƒĞ + float3 a = math.lerp(nextPosA0, nextPosA1, s); + float3 b = math.lerp(nextPosB0, nextPosB1, t); + float3 v = a - b; + + // ĉŽè§Ĥĉ³•ç·šĞçċœ¨è·é›˘‚’ĉŠ•ċ½ħ•›‚‹ + float l = math.dot(n, v); + //Debug.Log($"A({pA0}-{pA1}), B({pB0}-{pB1}) s:{s}, t:{t} l:{l}"); + if (l > thickness) + return; + + float invMassA0 = p0.invMass.x; + float invMassA1 = p0.invMass.y; + float invMassB0 = p1.invMass.x; + float invMassB1 = p1.invMass.y; + + // 離™è·é›˘ + float C = thickness - l; + + // Šäş’„‚’離™ + float b0 = 1.0f - s; + float b1 = s; + float b2 = 1.0f - t; + float b3 = t; + float3 grad0 = n * b0; + float3 grad1 = n * b1; + float3 grad2 = -n * b2; + float3 grad3 = -n * b3; + + float S = invMassA0 * b0 * b0 + invMassA1 * b1 * b1 + invMassB0 * b2 * b2 + invMassB1 * b3 * b3; + if (S == 0.0f) + return; + + S = C / S; + + float3 _A0 = S * invMassA0 * grad0; + float3 _A1 = S * invMassA1 * grad1; + float3 _B0 = S * invMassB0 * grad2; + float3 _B1 = S * invMassB1 * grad3; + +#if true + // ĉ›¸èĵż + if ((p0.flag & Flag_FixIntersect0) == 0) + { + InterlockUtility.AddFloat3(p0.particleIndices.x, _A0, cntPt, sumPt); + } + if ((p0.flag & Flag_FixIntersect1) == 0) + { + InterlockUtility.AddFloat3(p0.particleIndices.y, _A1, cntPt, sumPt); + } + if ((p1.flag & Flag_FixIntersect0) == 0) + { + InterlockUtility.AddFloat3(p1.particleIndices.x, _B0, cntPt, sumPt); + } + if ((p1.flag & Flag_FixIntersect1) == 0) + { + InterlockUtility.AddFloat3(p1.particleIndices.y, _B1, cntPt, sumPt); + } +#endif + } + else if (contact.contactType == ContactType_PointTriangle) + { + // ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĉƒ…ċ ħ + float3 nextPos0 = nextPosArray[p1.particleIndices.x]; + float3 nextPos1 = nextPosArray[p1.particleIndices.y]; + float3 nextPos2 = nextPosArray[p1.particleIndices.z]; + float invMass0 = p1.invMass.x; + float invMass1 = p1.invMass.y; + float invMass2 = p1.invMass.z; + + // ç§ğċ‹•ċŒƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĉ³•ç·š + float3 tn = MathUtility.TriangleNormal(nextPos0, nextPos1, nextPos2); + + // ċŻèħĦƒ‘ƒĵƒ†‚£‚ŻƒĞĉƒ…ċ ħ + float3 nextPos = nextPosArray[p0.particleIndices.x]; + float invMass = p0.invMass.x; + + // èĦçށè§£ĉħş + // ç§ğċ‹•ċŒƒ‚¤ƒ³ƒˆ¨ç§ğċ‹•ċŒƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ¸ĉœ€èż‘ĉŽç‚ı + float3 uvw; + MathUtility.ClosestPtPointTriangle(nextPos, nextPos0, nextPos1, nextPos2, out uvw); + + // ĉŠĵ—ċ‡ş—ĉ–ıċ‘ïĵˆç§ğċ‹•ċŒƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĉ³•ç·šïĵ‰ + // ç§ğċ‹•ċ‰Ğ裏ċ´Ş‚‰°ċèğ˘•›‚‹ + float sign = contact.s; + float3 n = tn * sign; + + // ĉŠĵ—ċ‡ş—ĉ³•ç·šĉ–ıċ‘ĞĉŠ•ċ½ħ—Ÿè·é›˘ + float dist = math.dot(n, nextPos - nextPos0); + //Debug.Log($"dist:{dist}"); + if (dist >= thickness) + return; + + // ċĵ•é›˘™è·é›˘ + float restDist = thickness; + + // ĉŠĵ—ċ‡ş— + float C = dist - restDist; + + float3 grad = n; + float3 grad0 = -n * uvw[0]; + float3 grad1 = -n * uvw[1]; + float3 grad2 = -n * uvw[2]; + + float s = invMass + invMass0 * uvw.x * uvw.x + invMass1 * uvw.y * uvw.y + invMass2 * uvw.z * uvw.z; + if (s == 0.0f) + return; + s = C / s; + + float3 corr = -s * invMass * grad; + float3 corr0 = -s * invMass0 * grad0; + float3 corr1 = -s * invMass1 * grad1; + float3 corr2 = -s * invMass2 * grad2; + +#if true + // ĉ›¸èĵż + if ((p0.flag & Flag_FixIntersect0) == 0) + { + InterlockUtility.AddFloat3(p0.particleIndices.x, corr, cntPt, sumPt); + } + if ((p1.flag & Flag_FixIntersect0) == 0) + { + InterlockUtility.AddFloat3(p1.particleIndices.x, corr0, cntPt, sumPt); + } + if ((p1.flag & Flag_FixIntersect1) == 0) + { + InterlockUtility.AddFloat3(p1.particleIndices.y, corr1, cntPt, sumPt); + } + if ((p1.flag & Flag_FixIntersect2) == 0) + { + InterlockUtility.AddFloat3(p1.particleIndices.z, corr2, cntPt, sumPt); + } +#endif + } + } + } + + [BurstCompile] + unsafe internal struct SelfStep_SumContactJob : IJobParallelFor + { + public int updateIndex; + + // team + [Unity.Collections.ReadOnly] + public NativeList batchSelfTeamList; + [Unity.Collections.ReadOnly] + public NativeArray teamDataArray; + + // particle + [NativeDisableParallelForRestriction] + public NativeArray nextPosArray; + + // buffer2 + [NativeDisableParallelForRestriction] + public NativeArray tempVectorBufferA; + [NativeDisableParallelForRestriction] + public NativeArray tempCountBuffer; + + // ƒ­ƒĵ‚ЃЃƒĵƒ ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı”¨ + public void Execute(int localIndex) + { + TeamManager.TeamData* teamPt = (TeamManager.TeamData*)teamDataArray.GetUnsafeReadOnlyPtr(); + int* cntPt = (int*)tempCountBuffer.GetUnsafePtr(); + int* sumPt = (int*)tempVectorBufferA.GetUnsafePtr(); + float3* nextPosT = (float3*)nextPosArray.GetUnsafePtr(); + + int teamId = batchSelfTeamList[localIndex]; + ref var tdata = ref *(teamPt + teamId); + if (tdata.IsProcess == false) + return; + if (tdata.ParticleCount == 0) + return; + + if (updateIndex < tdata.updateCount) + { + int pindex = tdata.particleChunk.startIndex; + int pindex2 = pindex * 3; + for (int i = 0; i < tdata.particleChunk.dataLength; i++, pindex++, pindex2 += 3) + { + int cnt = cntPt[pindex]; + if (cnt > 0) + { + float3 add = new float3(sumPt[pindex2], sumPt[pindex2 + 1], sumPt[pindex2 + 2]); + add /= cnt; + // ƒ‡ƒĵ‚żŻċ›şċšċ°ĉ•°ç‚ıŞ§ĉˆğ™ + add *= InterlockUtility.ToFloat; + + // ċĉ˜  + *(nextPosT + pindex) += add; + } + } + } + + // ƒƒƒƒ•‚Ħ‚ŻƒŞ‚˘ + int pindexB = tdata.particleChunk.startIndex; + for (int i = 0; i < tdata.particleChunk.dataLength; i++, pindexB++) + { + tempCountBuffer[pindexB] = 0; + tempVectorBufferA[pindexB] = 0; + } + } + } + + //========================================================================================= + // Intersect + //========================================================================================= + [BurstCompile] + unsafe internal struct SelfDetectionIntersectJob : IJobParallelFor + { + public int updateIndex; + public int workerCount; + public int frameIndex; // 0 ~ (Define.System.SelfCollisionIntersectDiv-1) + + // team + [Unity.Collections.ReadOnly] + public NativeList batchSelfTeamList; + [Unity.Collections.ReadOnly] + public NativeArray teamDataArray; + + // self collision + [Unity.Collections.ReadOnly] + public NativeArray primitiveArrayB; + [Unity.Collections.ReadOnly] + public NativeArray uniformGridStartCountBuffer; + + // buffer + [NativeDisableParallelForRestriction] + public NativeQueue.ParallelWriter intersectQueue; + + // ïĵ‘ƒƒĵƒ  + public void Execute(int index) + { + // ċ„ƒ™ƒĵ‚ıƒ‚¤ƒ³‚ż + TeamManager.TeamData* teamPt = (TeamManager.TeamData*)teamDataArray.GetUnsafeReadOnlyPtr(); + + // ƒƒĵƒ ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı + int localIndex = index / workerCount; + int teamId = batchSelfTeamList[localIndex]; + ref var tdata = ref *(teamPt + teamId); + if (updateIndex >= tdata.updateCount) + return; + if (tdata.updateCount == 0) + return; + if (tdata.IsProcess == false) + return; + if (tdata.ParticleCount == 0) + return; + + int workerIndex = index % workerCount; + + // ■Edge-TriangleĉŽè§Ĥƒƒƒƒ•‚Ħ作ĉˆ + // ‚ğƒĞƒ•‚³ƒŞ‚¸ƒ§ƒ³ + if (tdata.flag.IsSet(TeamManager.Flag_Self_EdgeTriangleIntersect)) + { + DetectionIntersect( + workerCount, + workerIndex, + frameIndex, + // edge + teamId, + ref tdata, + KindEdge, + // triangle + teamId, + ref tdata, + KindTriangle, + // self collision + ref primitiveArrayB, + ref uniformGridStartCountBuffer, + // intersect + ref intersectQueue + ); + } + + // 相互‚³ƒŞ‚¸ƒ§ƒ³ + if (tdata.syncTeamId > 0) + { + ref var stdata = ref *(teamPt + tdata.syncTeamId); + if (stdata.IsProcess && stdata.ParticleCount > 0) + { + if (tdata.flag.IsSet(TeamManager.Flag_Sync_EdgeTriangleIntersect)) + { + DetectionIntersect( + workerCount, + workerIndex, + frameIndex, + // edge + teamId, + ref tdata, + KindEdge, + // triangle + tdata.syncTeamId, + ref stdata, + KindTriangle, + // self collision + ref primitiveArrayB, + ref uniformGridStartCountBuffer, + // intersect + ref intersectQueue + ); + } + if (tdata.flag.IsSet(TeamManager.Flag_Sync_TriangleEdgeIntersect)) + { + DetectionIntersect( + workerCount, + workerIndex, + frameIndex, + // triangle + teamId, + ref tdata, + KindTriangle, + // edge + tdata.syncTeamId, + ref stdata, + KindEdge, + // self collision + ref primitiveArrayB, + ref uniformGridStartCountBuffer, + // intersect + ref intersectQueue + ); + } + } + } + //Debug.Log($"Detection intersect. team:{teamId}, Count:{writeCount}"); + } + } + + unsafe static void DetectionIntersect( + int workerCount, + int workerIndex, + // 0 ~ (Define.System.SelfCollisionIntersectDiv-1) + int frameIndex, + // my + int myTeamId, + ref TeamManager.TeamData myTeam, + uint myKind, + // target + int targetTeamId, + ref TeamManager.TeamData targetTeam, + uint targetKind, + // self collision + ref NativeArray primitiveArrayB, + ref NativeArray uniformGridStartCountBuffer, + // intersect buffer + ref NativeQueue.ParallelWriter intersectQueue + ) + { + Primitive* pt = (Primitive*)primitiveArrayB.GetUnsafeReadOnlyPtr(); + GridInfo* gt = (GridInfo*)uniformGridStartCountBuffer.GetUnsafeReadOnlyPtr(); + + // ċ‚ç…§ċ…ƒ + DataChunk myPriChunk = myKind == KindPoint ? myTeam.selfPointChunk : (myKind == KindEdge ? myTeam.selfEdgeChunk : myTeam.selfTriangleChunk); + if (myPriChunk.IsValid == false) + return; + + // ċŻèħĦ + DataChunk tarPriChunk = targetKind == KindPoint ? targetTeam.selfPointChunk : (targetKind == KindEdge ? targetTeam.selfEdgeChunk : targetTeam.selfTriangleChunk); + if (tarPriChunk.IsValid == false) + return; + int gridBufferStart = tarPriChunk.startIndex; + int gridBufferIndex = gridBufferStart; + int gridBufferCount = 0; + switch (targetKind) + { + case KindPoint: + gridBufferCount = targetTeam.selfPointGridCount; + break; + case KindEdge: + gridBufferCount = targetTeam.selfEdgeGridCount; + break; + case KindTriangle: + gridBufferCount = targetTeam.selfTriangleGridCount; + break; + } + float maxPrimitiveSize = targetTeam.selfMaxPrimitiveSize; + float gridSize = targetTeam.selfGridSize; + + // ċˆċ›žäş¤ċ·ċˆ¤ċšŻ‚°ƒŞƒƒƒ‰‚µ‚¤‚şĉ›´ĉ–°ċ‰Ğċˆ°é”™‚‹§é™¤ċ¤–™‚‹ + if (maxPrimitiveSize <= Define.System.Epsilon || gridSize <= Define.System.Epsilon) + return; + + //Debug.Log($"edgeTeamId:{edgeTeamId}, triangleTeamId:{triangleTeamId}, gridBufferStart:{gridBufferStart}, gridBufferIndex:{gridBufferIndex}, gridBufferCount:{gridBufferCount}"); + //Debug.Log($"edgeTeamId:{edgeTeamId}, maxPrimitiveSize:{maxPrimitiveSize}, gridSize:{gridSize}"); + + // ƒ—ƒŞƒŸƒ†‚£ƒ–ĉŽçĥšċˆ¤ċš + bool connectionCheck = myTeamId == targetTeamId; + + // ĉ ĵç´è‡Şċ…‚Œĉ›żˆ + bool primitiveFlip = myKind != KindEdge; + + // ĉ¤œç´˘çŻ„ċ›² + var chunk = MathUtility.GetWorkerChunk(myPriChunk.dataLength, workerCount, workerIndex); + if (chunk.IsValid == false) + return; + + // ƒ—ƒŞƒŸƒ†‚£ƒ–”¨ + GridInfo searchGridInfo = new GridInfo(); + int priIndex = myPriChunk.startIndex + chunk.startIndex; + for (int i = 0; i < chunk.dataLength; i++, priIndex++) + { + if ((priIndex % Define.System.SelfCollisionIntersectDiv) != frameIndex) + continue; + + ref var p = ref *(pt + priIndex); + + // ç„ĦċŠıċˆ¤ċš + if (p.IsIgnore()) + continue; + + bool pFix = (p.flag & Flag_AllFix) != 0; + + // “ƒ—ƒŞƒŸƒ†‚£ƒ–ĉ¤œç´˘çŻ„ċ›² + float3 areaMin = p.aabb.Min - maxPrimitiveSize * 0.5f; + float3 areaMax = p.aabb.Max + maxPrimitiveSize * 0.5f; + + // ‚°ƒŞƒƒƒ‰çŻ„ċ›²Ğċ¤‰ĉ›™‚‹ + int3 startGrid = GetGrid(areaMin, gridSize); + int3 endGrid = GetGrid(areaMax, gridSize); + + // ‚°ƒŞƒƒƒ‰çŻ„ċ›²‚’èŞżı‚‹ + int3 currentGrid = startGrid; + bool finish = false; + while (finish == false) + { + // ‚°ƒŞƒƒƒ‰ĉƒ…ċ ħĉ¤œç´˘ïĵˆƒƒƒ‚·ƒċ€¤Ğ‚ˆ‚‹ïĵ’ċˆ†ĉŽ˘ç´˘ïĵ‰ + int currentHash = currentGrid.GetHashCode(); + searchGridInfo.hash = currentHash; + int infoIndex = NativeSortExtension.BinarySearch(gt + gridBufferStart, gridBufferCount, searchGridInfo); + if (infoIndex >= 0) + { + // “‚°ƒŞƒƒƒ‰ĞŻƒ—ƒŞƒŸƒ†‚£ƒ–Œċ­˜ċœ¨™‚‹ + ref var gridInfo = ref *(gt + gridBufferStart + infoIndex); + int startPriIndex2 = gridInfo.start; + int endPriIndex2 = startPriIndex2 + gridInfo.count; + + for (int priIndex2 = startPriIndex2; priIndex2 < endPriIndex2; priIndex2++) + { + ref var p2 = ref *(pt + priIndex2); + + // AABBċˆ¤ċš + if (p.aabb.Overlaps(p2.aabb) == false) + continue; + + // ç„ĦċŠıċˆ¤ċš + if (p2.IsIgnore()) + continue; + + // ä¸Ħĉ–ıƒ—ƒŞƒŸƒ†‚£ƒ–ŒċŒċ…¨ċ›şċšŞ‚‰°ç„ĦċŠı + if (pFix && ((p2.flag & Flag_AllFix) != 0)) + continue; + + // ƒ—ƒŞƒŸƒ†‚£ƒ–ċŒċ£ĞŒĉŽçĥš—Ĥ„‚‹ċ ´ċˆŻç„ĦċŠı + if (connectionCheck && p.AnyParticle(ref p2)) + continue; + + // !èĦçށĉ¤œċ‡şïĵ + // ‚¤ƒ³‚żƒĵ‚ğ‚Żƒˆƒƒƒƒ•‚Ħ生ĉˆ + var intersect = new IntersectInfo() + { + edgeParticeIndices = primitiveFlip == false ? p.particleIndices.xy : p2.particleIndices.xy, + triangleParticleIndices = primitiveFlip == false ? p2.particleIndices : p.particleIndices, + }; + intersectQueue.Enqueue(intersect); + + //Debug.Log($"Intersect0! edge:{p.particleIndices.xyz}, tri:{p2.particleIndices.xyz}"); + } + } + + // next + currentGrid.x++; + if (currentGrid.x > endGrid.x) + { + currentGrid.x = startGrid.x; + currentGrid.y++; + if (currentGrid.y > endGrid.y) + { + currentGrid.y = startGrid.y; + currentGrid.z++; + if (currentGrid.z > endGrid.z) + { + finish = true; + } + } + } + } + } + } + + [BurstCompile] + unsafe internal struct SelfConvertIntersectListJob : IJob + { + [Unity.Collections.ReadOnly] + public NativeQueue intersectQueue; + + [NativeDisableParallelForRestriction] + public NativeList intersectList; + + public void Execute() + { + intersectList.Clear(); + if (intersectQueue.Count > 0) + intersectList.AddRange(intersectQueue.ToArray(Allocator.Temp)); + + //Debug.Log($"intersect count:{intersectList.Length}"); + } + } + + [BurstCompile] + unsafe internal struct SelfClearIntersectJob : IJobParallelFor + { + // team + [Unity.Collections.ReadOnly] + public NativeList batchSelfTeamList; + [Unity.Collections.ReadOnly] + public NativeArray teamDataArray; + // buffer + [Unity.Collections.WriteOnly] + [NativeDisableParallelForRestriction] + public NativeArray intersectFlagArray; + + public void Execute(int index) + { + // ċ„ƒ™ƒĵ‚ıƒ‚¤ƒ³‚ż + TeamManager.TeamData* teamPt = (TeamManager.TeamData*)teamDataArray.GetUnsafeReadOnlyPtr(); + + // ƒƒĵƒ ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı + int teamId = batchSelfTeamList[index]; + ref var tdata = ref *(teamPt + teamId); + if (tdata.IsProcess == false) + return; + if (tdata.ParticleCount == 0) + return; + + int pindex = tdata.particleChunk.startIndex; + for (int i = 0; i < tdata.particleChunk.dataLength; i++, pindex++) + { + intersectFlagArray[pindex] = 0; + } + } + } + + [BurstCompile] + unsafe internal struct SelfSolverIntersectJob : IJobParallelForDefer + { + // particle + [Unity.Collections.ReadOnly] + public NativeArray nextPosArray; + + // self collision + [Unity.Collections.ReadOnly] + public NativeList intersectList; + + // buffer + [Unity.Collections.WriteOnly] + [NativeDisableParallelForRestriction] + public NativeArray intersectFlagArray; + + + public void Execute(int index) + { + IntersectInfo* it = (IntersectInfo*)intersectList.GetUnsafeReadOnlyPtr(); + + ref var intersect = ref *(it + index); + + // edge + float3 p = nextPosArray[intersect.edgeParticeIndices.x]; + float3 q = nextPosArray[intersect.edgeParticeIndices.y]; + + // triangle + float3 a = nextPosArray[intersect.triangleParticleIndices.x]; + float3 b = nextPosArray[intersect.triangleParticleIndices.y]; + float3 c = nextPosArray[intersect.triangleParticleIndices.z]; + + // Intersect test + // 線ċˆ†¨ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞäş¤ċ·ċˆ¤ċš + var qp = p - q; + + var ac = c - a; + var ab = b - a; + float3 n = math.cross(ab, ac); + + float d = math.dot(qp, n); + + // ĉ°´ċı³Żç„ĦċŠı + if (math.abs(d) < Define.System.Epsilon) + return; + + // ĉ³•線裏ċ´‹‚‰äµċ…ĞċŻċżœ + if (d < 0.0f) + { + //p = epri.nextPos.c1; + p = q; + qp = -qp; + d = -d; + } + + var ap = p - a; + var t = math.dot(ap, n); + if (t < 0.0f) + return; + if (t > d) + return; + + float3 e = math.cross(qp, ap); + var v = math.dot(ac, e); + if (v < 0.0f || v > d) + return; + var w = -math.dot(ab, e); + if (w < 0.0f || (v + w) > d) + return; + + // !交ċ·! + // EdgeĞƒ•ƒİ‚°‚’çĞ‹Ĥ‚‹ + intersectFlagArray[intersect.edgeParticeIndices.x] = 1; + intersectFlagArray[intersect.edgeParticeIndices.y] = 1; + + // TriangleĞŻƒ•ƒİ‚°ŻçĞ‹ĤŞ„ + + //Debug.Log($"Intersect! edge:{p0.particleIndices.xyz}, tri:{p1.particleIndices.xyz}"); + } + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/SelfCollisionConstraint.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/SelfCollisionConstraint.cs.meta new file mode 100644 index 00000000..dc83f97a --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/SelfCollisionConstraint.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: b72668632a29f4f4687108fdf55561cc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/SelfCollisionConstraint.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/SpringConstraint.cs b/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/SpringConstraint.cs new file mode 100644 index 00000000..39968c8c --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/SpringConstraint.cs @@ -0,0 +1,130 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp + +using System; +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// ‚ıƒ—ƒŞƒ³‚°ċˆĥ約 + /// ċ›şċšƒ‘ƒĵƒ†‚£‚ŻƒĞĞ‚ıƒ—ƒŞƒ³‚°ĉݟ能‚’èż½ċŠ ™‚‹ + /// çċœ¨ŻBoneSpringż§ċˆİ用 + /// + public class SpringConstraint : IDisposable + { + [System.Serializable] + public class SerializeData : IDataValidate + { + /// + /// Use of springs + /// ‚ıƒ—ƒŞƒ³‚°ċˆİ用 + /// [OK] Runtime changes. + /// [OK] Export/Import with Presets + /// + public bool useSpring; + + /// + /// spring strength.(0.0 ~ 1.0) + /// ‚ıƒ—ƒŞƒ³‚°ċĵ·•(0.0 ~ 1.0) + /// [OK] Runtime changes. + /// [OK] Export/Import with Presets + /// + [Range(0.001f, 0.2f)] + public float springPower; + + /// + /// Distance that can be moved from the origin. + /// ċŽŸç‚ı‹‚‰ç§ğċ‹•ċŻèƒ½Şè·é›˘ + /// [OK] Runtime changes. + /// [OK] Export/Import with Presets + /// + [Range(0.0f, 0.5f)] + public float limitDistance; + + /// + /// Movement restriction in normal direction.(0.0 ~ 1.0) + /// ĉ³•ç·šĉ–ıċ‘Ğċ݁—Ĥç§ğċ‹•ċˆĥ限(0.0 ~ 1.0) + /// [OK] Runtime changes. + /// [OK] Export/Import with Presets + /// + [Range(0.0f, 1.0f)] + public float normalLimitRatio; + + /// + /// De-synchronize each spring.(0.0 ~ 1.0) + /// ċ„‚ıƒ—ƒŞƒ³‚°éžċŒĉœŸċŒ–(0.0 ~ 1.0) + /// [OK] Runtime changes. + /// [OK] Export/Import with Presets + /// + [Range(0.0f, 1.0f)] + public float springNoise; + + public SerializeData() + { + useSpring = true; + springPower = 0.04f; + limitDistance = 0.1f; + normalLimitRatio = 1.0f; + springNoise = 0.0f; + } + + public void DataValidate() + { + springPower = Math.Clamp(springPower, 0.001f, 1.0f); + limitDistance = Mathf.Max(limitDistance, 0); + normalLimitRatio = Mathf.Clamp01(normalLimitRatio); + springNoise = Mathf.Clamp01(springNoise); + } + + public SerializeData Clone() + { + return new SerializeData() + { + useSpring = useSpring, + springPower = springPower, + limitDistance = limitDistance, + normalLimitRatio = normalLimitRatio, + springNoise = springNoise, + }; + } + } + + public struct SpringConstraintParams + { + /// + /// ‚ıƒ—ƒŞƒ³‚°ċĵ·•(0.0 ~ 1.0) + /// ‚ıƒ—ƒŞƒ³‚°ĉœŞä½żç”¨ĉ™‚Ż0.0 + /// + public float springPower; + + /// + /// ċŽŸç‚ı‹‚‰ç§ğċ‹•ċˆĥé™è·é›˘ + /// + public float limitDistance; + + /// + /// ĉ³•ç·šĉ–ıċ‘Ğċ݁™‚‹ç§ğċ‹•ċˆĥ限 + /// + public float normalLimitRatio; + + /// + /// ċ„‚ıƒ—ƒŞƒ³‚°éžċŒĉœŸçއ(0.0 ~ 1.0) + /// + public float springNoise; + + public void Convert(SerializeData sdata, ClothProcess.ClothType clothType) + { + springPower = clothType == ClothProcess.ClothType.BoneSpring && sdata.useSpring ? sdata.springPower : 0.0f; + limitDistance = sdata.limitDistance; + normalLimitRatio = sdata.normalLimitRatio; + springNoise = sdata.springNoise; + } + } + + public void Dispose() + { + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/SpringConstraint.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/SpringConstraint.cs.meta new file mode 100644 index 00000000..0fdcf4e9 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/SpringConstraint.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 890580bb4f2b4c742a2c1b491e9a9e07 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/SpringConstraint.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/TetherConstraint.cs b/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/TetherConstraint.cs new file mode 100644 index 00000000..46840a4a --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/TetherConstraint.cs @@ -0,0 +1,203 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System; +using Unity.Collections; +using Unity.Mathematics; +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// ĉœ€ċ¤§è·é›˘ċˆĥ約 + /// ç§ğċ‹•ƒ‘ƒĵƒ†‚£‚ŻƒĞŒç§ğċ‹•§‚‹è·é›˘‚’è‡ŞèşĞƒĞƒĵƒˆƒ‘ƒĵƒ†‚£‚ŻƒĞ¨è·é›˘‹‚‰ċˆĥ限™‚‹ + /// + public class TetherConstraint : IDisposable + { + [System.Serializable] + public class SerializeData : IDataValidate + { + /// + /// Maximum shrink limit (0.0 ~ 1.0). + /// 0.0=do not shrink. + /// ĉœ€ċ¤§ç¸ċ°é™ç•Œ(0.0 ~ 1.0) + /// 0.0=ç¸ċ°—Ş„ + /// [OK] Runtime changes. + /// [OK] Export/Import with Presets + /// + [Range(0.0f, 1.0f)] + public float distanceCompression; + + public SerializeData() + { + distanceCompression = 0.4f; + } + + public void DataValidate() + { + distanceCompression = Mathf.Clamp(distanceCompression, 0.0f, 1.0f); + } + + public SerializeData Clone() + { + return new SerializeData() + { + distanceCompression = distanceCompression, + }; + } + } + + public struct TetherConstraintParams + { + /// + /// ĉœ€ċ¤§ç¸ċ°ċ‰²ċˆ(0.0 ~ 1.0) + /// 0.0=ç¸ċ°—Ş„ + /// + public float compressionLimit; + + /// + /// ĉœ€ċ¤§ĉ‹Ħċ¤§ċ‰²ċˆ(0.0 ~ 1.0) + /// 0.0=ĉ‹Ħċ¤§—Ş„ + /// + public float stretchLimit; + + public void Convert(SerializeData sdata, ClothProcess.ClothType clothType) + { + switch (clothType) + { + case ClothProcess.ClothType.BoneCloth: + case ClothProcess.ClothType.MeshCloth: + compressionLimit = sdata.distanceCompression; + break; + case ClothProcess.ClothType.BoneSpring: + // BoneSpringŻċšĉ•° + compressionLimit = Define.System.BoneSpringTetherCompressionLimit; + break; + } + stretchLimit = Define.System.TetherStretchLimit; + } + } + + public void Dispose() + { + } + + //========================================================================================= + // Solver + //========================================================================================= + internal static void SolverConstraint( + DataChunk chunk, + // team + ref TeamManager.TeamData tdata, + ref ClothParameters param, + ref InertiaConstraint.CenterData cdata, + // vmesh + ref NativeArray attributes, + ref NativeArray vertexDepths, + ref NativeArray vertexRootIndices, + // particle + ref NativeArray nextPosArray, + ref NativeArray velocityPosArray, + ref NativeArray frictionArray, + // buffer + ref NativeArray stepBasicPositionBuffer + ) + { + int p_start = tdata.particleChunk.startIndex; + //int pindex = p_start; + int pindex = p_start + chunk.startIndex; + //int vindex = tdata.proxyCommonChunk.startIndex; + int vindex = tdata.proxyCommonChunk.startIndex + chunk.startIndex; + //for (int k = 0; k < tdata.particleChunk.dataLength; k++, pindex++, vindex++) + for (int k = 0; k < chunk.dataLength; k++, pindex++, vindex++) + { + var attr = attributes[vindex]; + if (attr.IsMove() == false) + continue; + + int rootIndex = vertexRootIndices[vindex]; + if (rootIndex < 0) + continue; + + //Debug.Log($"Tether [{pindex}] root:{rootIndex + p_start}"); + + var nextPos = nextPosArray[pindex]; + var rootPos = nextPosArray[rootIndex + p_start]; + float depth = vertexDepths[vindex]; + float friction = frictionArray[pindex]; + //float invMass = MathUtility.CalcInverseMass(friction); + + // çċœ¨ƒ™‚ŻƒˆƒĞ + float3 v = rootPos - nextPos; + + // çċœ¨é•·• + float distance = math.length(v); + + // è·é›˘ŒğĵïĵŞ‚‰°ċ‡Ĥ理‚’‚ı‚­ƒƒƒ—™‚‹ïĵˆ‚¨ƒİƒĵċ›žéżïĵ‰ + if (distance < Define.System.Epsilon) + continue; + + // ċİċ…ƒè·é›˘ + // ƒ•ƒİ‚°Ğ‚ˆ‚ŠċˆĉœŸċ§żċ‹˘‹‚˘ƒ‹ƒĦƒĵ‚·ƒ§ƒ³ċŒċ§żċ‹˘‹‚’ċˆ‡‚Šĉ›żˆ‚‹ + float3 calcPos = stepBasicPositionBuffer[pindex]; + float3 calcRootPos = stepBasicPositionBuffer[rootIndex + p_start]; + float calcDistance = math.distance(calcPos, calcRootPos); + + //Debug.Log($"[{pindex}] calcPos:{calcPos}, calcRootPos:{calcRootPos}, calcDistance:{calcDistance}"); + + // ċˆĉœŸä½ç½Œ£ŸċŒ˜çŠĥĉ³‚’考ĉ… + if (calcDistance == 0.0f) + continue; + + // çċœ¨äĵ¸ç¸ċ‰²ċˆ + //Develop.Assert(calcDistance > 0.0f); + float ratio = distance / calcDistance; +#if true + // è·é›˘ŒçŻ„ċ›²ċ†…Ş‚‰äĵ¸ç¸—Ş„ + float dist = 0; + float stiffness; + float attn; + float compressionLimit = 1.0f - param.tetherConstraint.compressionLimit; + float stretchLimit = 1.0f + param.tetherConstraint.stretchLimit; + //float widthRatio = math.max(param.stiffnessWidth, 0.001f); // 0.2? + //float widthRatio = 0.1f; // 0.2? + if (ratio < compressionLimit) + { + // 縂“§„‚‹ċ ´ċˆŻĉˆğ‚Š‚’ĉŻ”èĵƒçš„ç·İ‚„‹Ğ™‚‹€‚“‚ŒŻĉŒŻċ‹•é˜²ĉ­˘Ğ¤ŞŒ‚‹€‚ + dist = distance - compressionLimit * calcDistance; + float t = math.saturate((compressionLimit - ratio) / Define.System.TetherStiffnessWidth); + stiffness = Define.System.TetherCompressionStiffness * t; + //stiffness = Define.System.TetherCompressionStiffness; + attn = Define.System.TetherCompressionVelocityAttenuation; + } + else if (ratio > stretchLimit) + { + // äĵ¸³Ĥ„‚‹ċ ´ċˆŻĉˆğ‚Š‚’ĉ€é€ŸĞèĦŒ†€‚ä𣂏‚Šé€ŸċşĤċ½ħ響Żċĵħ™‚‹€‚ + dist = distance - stretchLimit * calcDistance; + float t = math.saturate((ratio - stretchLimit) / Define.System.TetherStiffnessWidth); + stiffness = Define.System.TetherStretchStiffness * t; + //stiffness = Define.System.TetherStretchStiffness; + attn = Define.System.TetherStretchVelocityAttenuation; + } + else + continue; + + // ç§ğċ‹•量 + float3 add = (v / distance) * (dist * stiffness); +#endif + + // ĉ‘İĉ“ĤĞ‚ˆ‚‹ç§ğċ‹•ĉ¸›èĦ° + //add *= invMass; + + // ä½ç½ + var oldPos = nextPos; + nextPos += add; + nextPosArray[pindex] = nextPos; + + // 速ċşĤċ½ħ響 + //float attn = param.velocityAttenuation; + velocityPosArray[pindex] = velocityPosArray[pindex] + add * attn; + } + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/TetherConstraint.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/TetherConstraint.cs.meta new file mode 100644 index 00000000..eee9a2ba --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/TetherConstraint.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: c071eb1b529a69546be39d4575fffd86 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/TetherConstraint.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/TriangleBendingConstraint.cs b/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/TriangleBendingConstraint.cs new file mode 100644 index 00000000..4a498f1b --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/TriangleBendingConstraint.cs @@ -0,0 +1,738 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System; +using System.Collections.Generic; +using System.Text; +using Unity.Collections; +using Unity.Collections.LowLevel.Unsafe; +using Unity.Mathematics; +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĉ›²’ċˆĥ約 + /// + public class TriangleBendingConstraint : IDisposable + { + /// + /// ƒœƒŞƒƒĵƒ ¨—Ĥċ‡Ĥ理™‚‹ċˆ¤ċšƒ•ƒİ‚° + /// + const sbyte VOLUME_SIGN = 100; + + public enum Method + { + None = 0, + + /// + /// ïĵ’é˘è§’Ğ‚ˆ‚‹ĉ›²’ċˆĥċĦ + /// ïĵ’面ŻċˆĉœŸè§’ċşĤ‚’保¤‚ˆ†Ğç§ğċ‹•™‚‹€‚Ÿ —è§’ċşĤżŞ§Âħèż‘„ĉ–ıĞĉ›²‚‹€‚ + /// + DihedralAngle = 1, + + /// + /// ĉ–ıċ‘ĉ€§‚‚Ёïĵ’é˘è§’ĉ›²’ċˆĥ約 + /// ċˆĉœŸċ§żċ‹˘‚’保¤‚ˆ†Ğċİċ…ƒ™‚‹ + /// + DirectionDihedralAngle = 2, + } + + [System.Serializable] + public class SerializeData : IDataValidate + { + /// + /// Restoring force (0.0 ~ 1.0) + /// [OK] Runtime changes. + /// [OK] Export/Import with Presets + /// + [Range(0.0f, 1.0f)] + public float stiffness; + + public SerializeData() + { + //method = Method.DirectionDihedralAngle; + stiffness = 1.0f; + } + + public void DataValidate() + { + stiffness = Mathf.Clamp01(stiffness); + } + + public SerializeData Clone() + { + return new SerializeData() + { + //method = method, + stiffness = stiffness, + }; + } + } + + public struct TriangleBendingConstraintParams + { + public Method method; + public float stiffness; + + public void Convert(SerializeData sdata) + { + // ƒ˘ƒĵƒ‰ŻDirectionDihedralAngleĞċ›şċš™‚‹ + method = sdata.stiffness > Define.System.Epsilon ? Method.DirectionDihedralAngle : Method.None; + //method = sdata.stiffness > Define.System.Epsilon ? Method.DihedralAngle : Method.None; + + stiffness = sdata.stiffness; + } + } + + //========================================================================================= + [System.Serializable] + public class ConstraintData : IValid + { + public ResultCode result; + public ulong[] trianglePairArray; + public float[] restAngleOrVolumeArray; + public sbyte[] signOrVolumeArray; + + public int writeBufferCount; + public uint[] writeDataArray; + public uint[] writeIndexArray; + + public bool IsValid() + { + return trianglePairArray != null && trianglePairArray.Length > 0; + } + } + + /// + /// ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞƒš‚˘ïĵ”é ‚ç‚ı‚’ushort¨—ĤulongĞƒ‘ƒƒ‚­ƒ³‚°—Ÿ‚‚ + /// v2 + + /// /|\ + /// v0 + | + v1 + /// \|/ + /// v3 + + /// 上位ƒ“ƒƒƒˆ‹‚‰v0-v1-v2-v3é †§ä¸Ĥ‚“§„‚‹ + /// + public ExNativeArray trianglePairArray; + + /// + /// ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞƒš‚˘”¨ċİċ…ƒè§’ċşĤ‚‚—ŻƒœƒŞƒƒĵƒ ċ€¤ + /// + public ExNativeArray restAngleOrVolumeArray; + + /// + /// ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞƒš‚˘”¨ċİċ…ƒĉ–ıċ‘‚‚—ŻƒœƒŞƒƒĵƒ ċˆ¤ċšïĵˆVOLUME_SIGN(100)=“ƒš‚˘ŻƒœƒŞƒƒĵƒ §‚‚‹ïĵ‰ + /// + public ExNativeArray signOrVolumeArray; + + //public int DataCount => trianglePairArray?.Count ?? 0; + + /// + /// ƒœƒŞƒƒĵƒ è¨ˆç—ĉµċ‹•ċ°ĉ•°ç‚ıèŞ¤ċ·‚’ċ›žéż™‚‹Ÿ‚ċ€ĉ•° + /// + const float VolumeScale = 1000.0f; + + //========================================================================================= + public TriangleBendingConstraint() + { + trianglePairArray = new ExNativeArray(0, true); + restAngleOrVolumeArray = new ExNativeArray(0, true); + signOrVolumeArray = new ExNativeArray(0, true); + } + + public void Dispose() + { + trianglePairArray?.Dispose(); + restAngleOrVolumeArray?.Dispose(); + signOrVolumeArray?.Dispose(); + + trianglePairArray = null; + restAngleOrVolumeArray = null; + signOrVolumeArray = null; + } + + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.AppendLine($"[TriangleBendConstraint]"); + sb.AppendLine($" -trianglePairArray:{trianglePairArray.ToSummary()}"); + sb.AppendLine($" -restAngleOrVolumeArray:{restAngleOrVolumeArray.ToSummary()}"); + sb.AppendLine($" -signOrVolumeArray:{signOrVolumeArray.ToSummary()}"); + + return sb.ToString(); + } + + //========================================================================================= + /// + /// ċˆĥ約ƒ‡ƒĵ‚żä½œĉˆ + /// + /// + /// + /// + public static ConstraintData CreateData(VirtualMesh proxyMesh, in ClothParameters parameters) + { + var constraintData = new ConstraintData(); + + try + { + // ‚˘ƒĞ‚´ƒŞ‚şƒ ĉœ‰ç„ĦĞ‹‹‚‚‰šƒˆƒİ‚¤‚˘ƒ³‚°ƒĞŒ‚‚‹Ş‚‰ç”Ÿĉˆ™‚‹ + //var method = parameters.triangleBendingConstraint.method; + //if (method == Method.None) + // return null; + + if (proxyMesh.TriangleCount == 0) + return null; + + int ecnt = proxyMesh.EdgeCount; + if (ecnt == 0) + return null; + + var trianglePairList = new List(ecnt * 2); + var restAngleOrVolumeList = new List(ecnt * 2); + var signOrVolumeList = new List(ecnt * 2); + var writeDataList = new List(ecnt * 2); + var volumeSet = new HashSet(); + + int bendingCount = 0; + int volumeCount = 0; + + int vcnt = proxyMesh.VertexCount; + using var multiBuilder = new MultiDataBuilder(vcnt, vcnt * 2); + + // ‚¨ƒƒ‚¸”¨ĉŽçĥšƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ‚’ƒĞƒĵƒ— + for (int k = 0; k < ecnt; k++) + { + int2 edge = proxyMesh.edges[k]; + if (proxyMesh.edgeToTriangles.ContainsKey(edge) == false) + continue; + + var triangles = proxyMesh.edgeToTriangles.MC2ToFixedList128Bytes(edge); + int tcnt = triangles.Length; + + // ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞçµ„żċˆ‚› + for (int i = 0; i < tcnt - 1; i++) + { + // 0 + int tindex0 = triangles[i]; + int3 tri0 = proxyMesh.triangles[tindex0]; + + for (int j = i + 1; j < tcnt; j++) + { + // 1 + int tindex1 = triangles[j]; + int3 tri1 = proxyMesh.triangles[tindex1]; + + // ċŻè§’ç‚ı + int2 dp = MathUtility.GetRestTriangleVertex(tri0, tri1, edge); + + // 4ç‚ıĉ§‹ĉˆ + // 頂ç‚ı‚¤ƒ³ƒ‡ƒƒ‚Ż‚ıċ½˘ĉˆ + // v2 + + // /|\ + // v0 + | + v1 + // \|/ + // v3 + + // 2/3Œċ…ħ通èş, 0/1ŒċŻè§’ç‚ı + int4 vtx = new int4(dp.x, dp.y, edge.x, edge.y); + + // ïĵ”ç‚ıŒ™ıĤċ›şċšŞ‚‰°é™¤ċ¤–™‚‹ + var attr0 = proxyMesh.attributes[vtx.x]; + var attr1 = proxyMesh.attributes[vtx.y]; + var attr2 = proxyMesh.attributes[vtx.z]; + var attr3 = proxyMesh.attributes[vtx.w]; + if (attr0.IsDontMove() && attr1.IsDontMove() && attr2.IsDontMove() && attr3.IsDontMove()) + continue; + + // ïĵ‘ç‚ı§‚‚ç„ĦċŠıŞ‚‰é™¤ċ¤–™‚‹ + if (attr0.IsInvalid() || attr1.IsInvalid() || attr2.IsInvalid() || attr3.IsInvalid()) + continue; + + ulong pair = DataUtility.Pack64(vtx); + + // (1)TriangleBending¨—Ĥç™ğ録ċˆ¤ċš + float restData; + sbyte signFlag; + InitDihedralAngle(proxyMesh, vtx.x, vtx.y, vtx.z, vtx.w, out restData, out signFlag); + var degAngle = math.abs(math.degrees(restData)); + if (degAngle < Define.System.TriangleBendingMaxAngle) // 90ċşĤäğ上§ç™ğ録™‚‹¨ä¸ċ‰ċšĞŞ‚‹ + { + trianglePairList.Add(pair); + restAngleOrVolumeList.Add(restData); + signOrVolumeList.Add(signFlag); + //Debug.Log($"rest angle:{math.degrees(restData)}, signFlag:{signFlag}"); + + uint writeData = DataUtility.Pack32( + multiBuilder.CountValuesForKey(vtx.x), + multiBuilder.CountValuesForKey(vtx.y), + multiBuilder.CountValuesForKey(vtx.z), + multiBuilder.CountValuesForKey(vtx.w) + ); + writeDataList.Add(writeData); + + multiBuilder.Add(vtx.x, 0); + multiBuilder.Add(vtx.y, 0); + multiBuilder.Add(vtx.z, 0); + multiBuilder.Add(vtx.w, 0); + + bendingCount++; + } + // (2)Volume¨—Ĥç™ğ録ċˆ¤ċš + if (degAngle >= Define.System.VolumeMinAngle && degAngle <= 179.0f) + { + var sortPack = DataUtility.PackInt4(vtx); + if (volumeSet.Contains(sortPack) == false) + { + + InitVolume(proxyMesh, vtx.x, vtx.y, vtx.z, vtx.w, out restData, out signFlag); + trianglePairList.Add(pair); + restAngleOrVolumeList.Add(restData); + signOrVolumeList.Add(signFlag); + volumeSet.Add(sortPack); + + uint writeData = DataUtility.Pack32( + multiBuilder.CountValuesForKey(vtx.x), + multiBuilder.CountValuesForKey(vtx.y), + multiBuilder.CountValuesForKey(vtx.z), + multiBuilder.CountValuesForKey(vtx.w) + ); + writeDataList.Add(writeData); + + multiBuilder.Add(vtx.x, 0); + multiBuilder.Add(vtx.y, 0); + multiBuilder.Add(vtx.z, 0); + multiBuilder.Add(vtx.w, 0); + + volumeCount++; + + //Develop.DebugLog($"Volume Pair. edge:{edge}, tri:({tri0},{tri1}) restAngle:{degAngle}, restData:{restData}, signFlag:{signFlag}"); + } + } + //if (math.all(tri0 - 243) == false || math.all(tri1 - 243) == false) + // Debug.Log($"Bend Triangle Pair. edge:{edge}, tri:({tri0},{tri1})"); + } + } + } + + // ƒ‡ƒĵ‚żĉ ĵ納 + constraintData.trianglePairArray = trianglePairList.Count > 0 ? trianglePairList.ToArray() : null; + constraintData.restAngleOrVolumeArray = restAngleOrVolumeList.Count > 0 ? restAngleOrVolumeList.ToArray() : null; + constraintData.signOrVolumeArray = signOrVolumeList.Count > 0 ? signOrVolumeList.ToArray() : null; + constraintData.writeDataArray = writeDataList.Count > 0 ? writeDataList.ToArray() : null; + constraintData.writeBufferCount = multiBuilder.Count(); + constraintData.writeIndexArray = multiBuilder.ToIndexArray(); + + constraintData.result.SetSuccess(); + + //Develop.DebugLog($"TriangleBending:{bendingCount}, Volume:{volumeCount}"); + } + catch (Exception exception) + { + Debug.LogError(exception); + constraintData.result.SetError(Define.Result.Constraint_CreateTriangleBendingException); + throw; + } + finally + { + } + + return constraintData; + } + + static void InitVolume(VirtualMesh proxyMesh, int v0, int v1, int v2, int v3, out float volumeRest, out sbyte signFlag) + { + // 0/1ŒċŻè§’ç‚ı,2/3Œċ…ħé€šèş + // ““ŻċŸèĦŒĉ™‚¨ƒœƒŞƒƒĵƒ ċ€¤‚’ċˆ‚›‚‹Ÿ‚ƒŻƒĵƒĞƒ‰ċş§ĉ¨™§è¨ˆç—™‚‹ċż…èĤŒ‚‚‹€‚ + float3 pos0 = MathUtility.TransformPoint(proxyMesh.localPositions[v0], proxyMesh.initLocalToWorld); + float3 pos1 = MathUtility.TransformPoint(proxyMesh.localPositions[v1], proxyMesh.initLocalToWorld); + float3 pos2 = MathUtility.TransformPoint(proxyMesh.localPositions[v2], proxyMesh.initLocalToWorld); + float3 pos3 = MathUtility.TransformPoint(proxyMesh.localPositions[v3], proxyMesh.initLocalToWorld); + + volumeRest = (1.0f / 6.0f) * math.dot(math.cross(pos1 - pos0, pos2 - pos0), pos3 - pos0); + volumeRest *= VolumeScale; // ĉµċ‹•ċ°ĉ•°ç‚ıĉĵ”ç—èޤċ·ċ›žéż + signFlag = VOLUME_SIGN; // Volume + } + + static void InitDihedralAngle(VirtualMesh proxyMesh, int v0, int v1, int v2, int v3, out float restAngle, out sbyte signFlag) + { + // 0/1ŒċŻè§’ç‚ı,2/3Œċ…ħé€šèş + float3 pos0 = proxyMesh.localPositions[v0]; + float3 pos1 = proxyMesh.localPositions[v1]; + float3 pos2 = proxyMesh.localPositions[v2]; + float3 pos3 = proxyMesh.localPositions[v3]; + + float3 n1 = math.cross(pos2 - pos0, pos3 - pos0); + float3 n2 = math.cross(pos3 - pos1, pos2 - pos1); + n1 = math.normalize(n1); + n2 = math.normalize(n2); + float dot = math.dot(n1, n2); + dot = MathUtility.Clamp1(dot); + + restAngle = math.acos(dot); + + // ĉ–ıċ‘ĉ€§ç—ċ‡ş + // ċİċ…ƒĉ–ıċ‘‚’ĉ­£è² ƒ•ƒİ‚°¨—Ĥĉ ĵ納™‚‹ + float3 e = pos3 - pos2; + float dir = math.dot(math.cross(n1, n2), e); + float sign = math.sign(dir); + //Debug.Assert(sign != 0); + //dihedralRestAngle *= sign; + + signFlag = sign < 0 ? (sbyte)-1 : (sbyte)1; + } + + //========================================================================================= + /// + /// ċˆĥ約ƒ‡ƒĵ‚ż‚’ç™ğ録™‚‹ + /// + /// + internal void Register(ClothProcess cprocess) + { + if (cprocess?.bendingConstraintData?.IsValid() ?? false) + { + ref var tdata = ref MagicaManager.Team.GetTeamDataRef(cprocess.TeamId); + + var cdata = cprocess.bendingConstraintData; + tdata.bendingPairChunk = trianglePairArray.AddRange(cdata.trianglePairArray); + restAngleOrVolumeArray.AddRange(cdata.restAngleOrVolumeArray); + signOrVolumeArray.AddRange(cdata.signOrVolumeArray); + } + } + + /// + /// ċˆĥ約ƒ‡ƒĵ‚ż‚’解除™‚‹ + /// + /// + internal void Exit(ClothProcess cprocess) + { + if (cprocess != null && cprocess.TeamId > 0) + { + ref var tdata = ref MagicaManager.Team.GetTeamDataRef(cprocess.TeamId); + + trianglePairArray.Remove(tdata.bendingPairChunk); + restAngleOrVolumeArray.Remove(tdata.bendingPairChunk); + signOrVolumeArray.Remove(tdata.bendingPairChunk); + + tdata.bendingPairChunk.Clear(); + } + } + + //========================================================================================= + // Solver + //========================================================================================= + internal unsafe static void SolverConstraint( + DataChunk chunk, + in float4 simulationPower, + // team + ref TeamManager.TeamData tdata, + ref ClothParameters param, + // vmesh + ref NativeArray attributes, + ref NativeArray depthArray, + // particle + ref NativeArray nextPosArray, + ref NativeArray frictionArray, + // constraints + ref NativeArray trianglePairArray, + ref NativeArray restAngleOrVolumeArray, + ref NativeArray signOrVolumeArray, + // buffer2 + ref NativeArray tempVectorBufferA, + ref NativeArray tempCountBuffer + ) + { + if (param.triangleBendingConstraint.method == Method.None) + return; + + if (tdata.bendingPairChunk.IsValid == false) + return; + + // ċ‰›ĉ€§ + float stiffness = param.triangleBendingConstraint.stiffness; + if (stiffness < 1e-06f) + return; + stiffness = math.saturate(stiffness * simulationPower.y); + + int p_start = tdata.particleChunk.startIndex; + int v_start = tdata.proxyCommonChunk.startIndex; + int pindex; + int vindex; + + int* sumPt = (int*)tempVectorBufferA.GetUnsafePtr(); + int* cntPt = (int*)tempCountBuffer.GetUnsafePtr(); + + // â– è¨ˆç— + // ƒ™ƒ³ƒ‰ƒš‚˘”¨ + //int pairIndex = tdata.bendingPairChunk.startIndex; + int pairIndex = tdata.bendingPairChunk.startIndex + chunk.startIndex; + //for (int k = 0; k < tdata.bendingPairChunk.dataLength; k++, pairIndex++) + for (int k = 0; k < chunk.dataLength; k++, pairIndex++) + { + // ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞƒš‚˘ + var pairData = trianglePairArray[pairIndex]; + int4 vertices = DataUtility.Unpack64(pairData); + //Debug.Log(vertices); + + int4 pindex4 = vertices + p_start; + int4 vindex4 = vertices + v_start; + + // çŠĥĉ…‹ + float3x4 nextPosBuffer = 0; + float3x4 addPosBuffer = 0; + float4 invMassBuffer = 1; + for (int i = 0; i < 4; i++) + { + pindex = pindex4[i]; + vindex = vindex4[i]; + nextPosBuffer[i] = nextPosArray[pindex]; + float friction = frictionArray[pindex]; + float depth = depthArray[vindex]; + bool fix = attributes[vindex].IsDontMove(); + invMassBuffer[i] = fix ? 0.01f : MathUtility.CalcInverseMass(friction, depth); + } + + // ƒ‡ƒĵ‚ż + int l_index = pairIndex - tdata.bendingPairChunk.startIndex; + int dataIndex = tdata.bendingPairChunk.startIndex + l_index; + float restAngle = restAngleOrVolumeArray[dataIndex]; + sbyte signOrVolume = signOrVolumeArray[dataIndex]; + + // ƒĦ‚½ƒƒƒ‰”¨è§£ĉħş + bool result = false; + if (signOrVolume == VOLUME_SIGN) + { + // Volume + float volumeRest = restAngle * tdata.scaleRatio; // ‚ı‚ħƒĵƒĞċ€çއ + + // ƒž‚¤ƒŠ‚ı‚ı‚ħƒĵƒĞ + volumeRest *= tdata.negativeScaleSign; + + result = CalcVolume(nextPosBuffer, invMassBuffer, volumeRest, stiffness, ref addPosBuffer); + } + else + { + // Triangle Bending + if (param.triangleBendingConstraint.method == Method.DihedralAngle) + { + // ĉ–ıċ‘ĉ€§Ş—äşŒé˘è§’ + result = CalcDihedralAngle(0, nextPosBuffer, invMassBuffer, restAngle, stiffness, ref addPosBuffer); + } + else if (param.triangleBendingConstraint.method == Method.DirectionDihedralAngle) + { + // ĉ–ıċ‘ĉ€§‚‚ŠäşŒé˘è§’ + float sign = signOrVolume < 0 ? -1 : 1; + restAngle *= sign; + + // ƒž‚¤ƒŠ‚ı‚ı‚ħƒĵƒĞ + restAngle *= tdata.negativeScaleSign; + + result = CalcDihedralAngle(sign, nextPosBuffer, invMassBuffer, restAngle, stiffness, ref addPosBuffer); + } + } + + // 集計ƒƒƒƒ•‚Ħ¸ĉ ĵ納 + if (result) + { + for (int i = 0; i < 4; i++) + { + pindex = pindex4[i]; + InterlockUtility.AddFloat3(pindex, addPosBuffer[i], cntPt, sumPt); + } + } + } + } + + internal unsafe static void SumConstraint( + DataChunk chunk, + // team + ref TeamManager.TeamData tdata, + ref ClothParameters param, + // vmesh + ref NativeArray attributes, + // particle + ref NativeArray nextPosArray, + // buffer2 + ref NativeArray tempVectorBufferA, + ref NativeArray tempCountBuffer + ) + { + if (param.triangleBendingConstraint.method == Method.None) + return; + + if (tdata.bendingPairChunk.IsValid == false) + return; + + // ċ‰›ĉ€§ + float stiffness = param.triangleBendingConstraint.stiffness; + if (stiffness < 1e-06f) + return; + + int p_start = tdata.particleChunk.startIndex; + int v_start = tdata.proxyCommonChunk.startIndex; + + int* sumPt = (int*)tempVectorBufferA.GetUnsafePtr(); + int* cntPt = (int*)tempCountBuffer.GetUnsafePtr(); + + // ■集計 + // ƒ‘ƒĵƒ†‚£‚ŻƒĞ”¨ + int pindex = p_start + chunk.startIndex; + int vindex = v_start + chunk.startIndex; + //for (int k = 0; k < tdata.particleChunk.dataLength; k++, pindex++, vindex++) + for (int k = 0; k < chunk.dataLength; k++, pindex++, vindex++) + { + // ç§ğċ‹•ż + if (attributes[vindex].IsDontMove() == false) + { + int cnt = cntPt[pindex]; + if (cnt > 0) + { + int pindex2 = pindex * 3; + float3 add = new float3(sumPt[pindex2], sumPt[pindex2 + 1], sumPt[pindex2 + 2]); + add /= cnt; + // ƒ‡ƒĵ‚żŻċ›şċšċ°ĉ•°ç‚ıŞ§ĉˆğ™ + add *= InterlockUtility.ToFloat; + + nextPosArray[pindex] = nextPosArray[pindex] + add; + } + } + + // ƒƒƒƒ•‚Ħ‚ŻƒŞ‚˘ + tempCountBuffer[pindex] = 0; + tempVectorBufferA[pindex] = 0; + } + } + + static bool CalcVolume( + in float3x4 nextPosBuffer, + in float4 invMassBuffer, + float volumeRest, + float stiffness, + ref float3x4 addPosBuffer + ) + { + float3 nextPos0 = nextPosBuffer[0]; + float3 nextPos1 = nextPosBuffer[1]; + float3 nextPos2 = nextPosBuffer[2]; + float3 nextPos3 = nextPosBuffer[3]; + + float invMass0 = invMassBuffer[0]; + float invMass1 = invMassBuffer[1]; + float invMass2 = invMassBuffer[2]; + float invMass3 = invMassBuffer[3]; + + float volume = (1.0f / 6.0f) * math.dot(math.cross(nextPos1 - nextPos0, nextPos2 - nextPos0), nextPos3 - nextPos0); + volume *= VolumeScale; // ĉµċ‹•ċ°ĉ•°ç‚ıĉĵ”ç—èޤċ·ċ›žéż + + float3 grad0 = math.cross(nextPos1 - nextPos2, nextPos3 - nextPos2); + float3 grad1 = math.cross(nextPos2 - nextPos0, nextPos3 - nextPos0); + float3 grad2 = math.cross(nextPos0 - nextPos1, nextPos3 - nextPos1); + float3 grad3 = math.cross(nextPos1 - nextPos0, nextPos2 - nextPos0); + + float lambda = + invMass0 * math.lengthsq(grad0) + + invMass1 * math.lengthsq(grad1) + + invMass2 * math.lengthsq(grad2) + + invMass3 * math.lengthsq(grad3); + lambda *= VolumeScale; // ĉµċ‹•ċ°ĉ•°ç‚ıĉĵ”ç—èޤċ·ċ›žéż + + if (math.abs(lambda) < 1e-06f) + return false; + + lambda = stiffness * (volumeRest - volume) / lambda; + + addPosBuffer[0] = lambda * invMass0 * grad0; + addPosBuffer[1] = lambda * invMass1 * grad1; + addPosBuffer[2] = lambda * invMass2 * grad2; + addPosBuffer[3] = lambda * invMass3 * grad3; + + return true; + } + + static bool CalcDihedralAngle( + float sign, + in float3x4 nextPosBuffer, + in float4 invMassBuffer, + float restAngle, + float stiffness, + ref float3x4 addPosBuffer + ) + { + float3 nextPos0 = nextPosBuffer[0]; + float3 nextPos1 = nextPosBuffer[1]; + float3 nextPos2 = nextPosBuffer[2]; + float3 nextPos3 = nextPosBuffer[3]; + + float invMass0 = invMassBuffer[0]; + float invMass1 = invMassBuffer[1]; + float invMass2 = invMassBuffer[2]; + float invMass3 = invMassBuffer[3]; + + float3 e = nextPos3 - nextPos2; + float elen = math.length(e); + if (elen < 1e-08f) + return false; + + float invElen = 1.0f / elen; + + float3 n1 = math.cross(nextPos2 - nextPos0, nextPos3 - nextPos0); + float3 n2 = math.cross(nextPos3 - nextPos1, nextPos2 - nextPos1); + + float n1_lengsq = math.lengthsq(n1); + float n2_lengsq = math.lengthsq(n2); + + // 稀Ğ発生™‚‹é•·•ïĵĞċŻċ‡Ĥ + if (n1_lengsq == 0.0f || n2_lengsq == 0.0f) + return false; + //Develop.Assert(n1_lengsq > 0.0f); + //Develop.Assert(n2_lengsq > 0.0f); + n1 /= n1_lengsq; + n2 /= n2_lengsq; + + float3 d0 = elen * n1; + float3 d1 = elen * n2; + float3 d2 = math.dot(nextPos0 - nextPos3, e) * invElen * n1 + math.dot(nextPos1 - nextPos3, e) * invElen * n2; + float3 d3 = math.dot(nextPos2 - nextPos0, e) * invElen * n1 + math.dot(nextPos2 - nextPos1, e) * invElen * n2; + + n1 = math.normalize(n1); + n2 = math.normalize(n2); + float dot = math.dot(n1, n2); + dot = MathUtility.Clamp1(dot); + float phi = math.acos(dot); + + float lambda = + invMass0 * math.lengthsq(d0) + + invMass1 * math.lengthsq(d1) + + invMass2 * math.lengthsq(d2) + + invMass3 * math.lengthsq(d3); + + if (lambda == 0.0f) + return false; + + // ĉ–ıċ‘ĉ€§ + float dirSign = math.sign(math.dot(math.cross(n1, n2), e)); + if (sign != 0) + { + // ĉ–ıċ‘ĉ€§‚‚Š(DirectionDihedralAngle) + phi *= dirSign; + } + else + { + // ĉ–ıċ‘ĉ€§Ş—(DihedralAngle) + lambda *= dirSign; + } + + lambda = (restAngle - phi) / lambda * stiffness; + + float3 corr0 = -invMass0 * lambda * d0; + float3 corr1 = -invMass1 * lambda * d1; + float3 corr2 = -invMass2 * lambda * d2; + float3 corr3 = -invMass3 * lambda * d3; + + addPosBuffer[0] = corr0; + addPosBuffer[1] = corr1; + addPosBuffer[2] = corr2; + addPosBuffer[3] = corr3; + + return true; + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/TriangleBendingConstraint.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/TriangleBendingConstraint.cs.meta new file mode 100644 index 00000000..cf53b197 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/TriangleBendingConstraint.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 8932223289542744aa07b8c5b25852ad +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Cloth/Constraints/TriangleBendingConstraint.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/CullingSettings.cs b/Assets/MagicaCloth2/Scripts/Core/Cloth/CullingSettings.cs new file mode 100644 index 00000000..831413c1 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/CullingSettings.cs @@ -0,0 +1,162 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2025 MagicaSoft. +// https://magicasoft.jp +using System.Collections.Generic; +using UnityEngine; + +namespace MagicaCloth2 +{ + [System.Serializable] + public class CullingSettings : IDataValidate + { + /// + /// Camera culling mode. + /// ‚ЃĦƒİ‚Ѓރ³‚°ƒ˘ƒĵƒ‰ + /// + public enum CameraCullingMode + { + /// + /// No culling. + /// ‚Ѓރ³‚°ŻèĦŒ‚Ş„ + /// + Off = 0, + + /// + /// Simulation resets when hidden from camera. + /// ‚ЃĦƒİ‹‚‰éžèĦ¨ç¤şĞŞ‚‹¨‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ŻƒŞ‚ğƒƒƒˆ•‚Œ‚‹ + /// + Reset = 10, + + /// + /// Simulation pauses when hidden from camera. + /// ‚ЃĦƒİ‹‚‰éžèĦ¨ç¤şĞŞ‚‹¨‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³Żä¸€ĉ™‚ċœĉ­˘™‚‹ + /// + Keep = 20, + + /// + /// Automatically set from linked animator. + /// 連ċ‹•‚˘ƒ‹ƒĦƒĵ‚żƒĵ‹‚‰è‡Şċ‹•設ċš™‚‹ + /// - Animator.CullingMode.AlwaysAnimate -> Off + /// - Animator.CullingMode.CullUpdateTransforms -> Reset + /// - Animator.CullingMode.CullCompletely -> Keep + /// + AnimatorLinkage = 30, + } + + /// + /// Camera culling method. + /// ‚Ѓރ³‚°ĉ–ıċĵ + /// + public enum CameraCullingMethod + { + /// + /// Work with an animator. + /// ‚˘ƒ‹ƒĦƒĵ‚żƒĵ¨é€£ċ‹•™‚‹ + /// + AutomaticRenderer = 0, + + /// + /// Determine from user-specified renderer. + /// ƒĤƒĵ‚ĥƒĵĉŒ‡ċšƒĴƒ³ƒ€ƒİƒĵ‹‚‰ċˆ¤ċš™‚‹ + /// + ManualRenderer = 10, + } + + /// + /// Camera culling mode. + /// ‚ЃĦƒİ‚Ѓރ³‚°ƒ˘ƒĵƒ‰ + /// [OK] Runtime changes. + /// [NG] Export/Import with Presets + /// + public CameraCullingMode cameraCullingMode = CameraCullingMode.AnimatorLinkage; + + /// + /// Camera culling judgment method. + /// ‚ЃĦƒİ‚Ѓރ³‚°ċˆ¤ċšĉ–ıċĵ + /// [OK] Runtime changes. + /// [NG] Export/Import with Presets + /// + public CameraCullingMethod cameraCullingMethod = CameraCullingMethod.AutomaticRenderer; + + /// + /// User-specified camera culling judgment renderer. + /// ƒĤƒĵ‚ĥƒĵĉŒ‡ċš‚ЃĦƒİ‚Ѓރ³‚°ċˆ¤ċšç”¨ƒĴƒ³ƒ€ƒİƒĵ + /// [OK] Runtime changes. + /// [NG] Export/Import with Presets + /// + public List cameraCullingRenderers = new List(); + + /// + /// è·é›˘‚Ѓރ³‚°çŠĥĉ…‹¨è·é›˘ + /// Distance Culling State and Distance. + /// [OK] Runtime changes. + /// [NG] Export/Import with Presets + /// + public CheckSliderSerializeData distanceCullingLength; + + /// + /// è·é›˘‚Ѓރ³‚°ƒ•‚§ƒĵƒ‰ċ‰²ċˆ(0.0 ~ 1.0) + /// Distance culling fade rate (0.0 to 1.0). + /// [OK] Runtime changes. + /// [NG] Export/Import with Presets + /// + [Range(0.0f, 1.0f)] + public float distanceCullingFadeRatio; + + /// + /// è·é›˘‚Ѓރ³‚°ĉ¸ĴċšċŻèħĦ(None=ƒĦ‚¤ƒ³‚ЃĦƒİ) + /// Distance culling measurement target (None = main camera). + /// [OK] Runtime changes. + /// [NG] Export/Import with Presets + /// + public GameObject distanceCullingReferenceObject; + + //========================================================================================= + public struct CullingParams + { + public bool useDistanceCulling; + public float distanceCullingLength; + public float distanceCullingFadeRatio; + + public void Convert(CullingSettings cullingSettings) + { + useDistanceCulling = cullingSettings.distanceCullingLength.use; + distanceCullingLength = cullingSettings.distanceCullingLength.value; + distanceCullingFadeRatio = cullingSettings.distanceCullingFadeRatio; + } + } + + //========================================================================================= + public CullingSettings() + { + distanceCullingLength = new CheckSliderSerializeData(false, 30.0f); + distanceCullingFadeRatio = 0.2f; + } + + public void DataValidate() + { + distanceCullingLength.DataValidate(0.0f, Define.System.DistanceCullingMaxLength); + distanceCullingFadeRatio = Mathf.Clamp01(distanceCullingFadeRatio); + } + + public CullingSettings Clone() + { + return new CullingSettings() + { + cameraCullingMode = cameraCullingMode, + cameraCullingMethod = cameraCullingMethod, + cameraCullingRenderers = new List(cameraCullingRenderers), + distanceCullingLength = distanceCullingLength.Clone(), + distanceCullingFadeRatio = distanceCullingFadeRatio, + distanceCullingReferenceObject = distanceCullingReferenceObject, + }; + } + + /// + /// ‚¨ƒ‡‚£‚żƒĦƒƒ‚·ƒĉ›´ĉ–°‚’ċˆ¤ċš™‚‹Ÿ‚ƒƒƒ‚·ƒ‚³ƒĵƒ‰ + /// ïĵˆ“ƒƒƒ‚·ƒŻċŸèĦŒĉ™‚ĞŻċˆİ用•‚ŒŞ„編集用‚‚ïĵ‰ + /// + /// + public override int GetHashCode() => 0; + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/CullingSettings.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Cloth/CullingSettings.cs.meta new file mode 100644 index 00000000..4701a70a --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/CullingSettings.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 701eba9d7e8713a4da1b475eb5d89a76 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Cloth/CullingSettings.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/CurveSerializeData.cs b/Assets/MagicaCloth2/Scripts/Core/Cloth/CurveSerializeData.cs new file mode 100644 index 00000000..9d441069 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/CurveSerializeData.cs @@ -0,0 +1,122 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using Unity.Mathematics; +using UnityEngine; + +namespace MagicaCloth2 +{ + [System.Serializable] + public class CurveSerializeData + { + /// + /// Basic value. + /// + public float value; + + /// + /// Use of curves. + /// + public bool useCurve; + + /// + /// Animation curve. + /// + public AnimationCurve curve = AnimationCurve.Linear(0.0f, 1.0f, 1.0f, 1.0f); + + public CurveSerializeData() + { + } + + public CurveSerializeData(float value) + { + this.value = value; + useCurve = false; + curve = AnimationCurve.Linear(0.0f, 1.0f, 1.0f, 1.0f); + } + + public CurveSerializeData(float value, float curveStart, float curveEnd, bool useCurve = true) + { + this.value = value; + this.useCurve = useCurve; + curve = AnimationCurve.Linear(0.0f, Mathf.Clamp01(curveStart), 1.0f, Mathf.Clamp01(curveEnd)); + } + + public CurveSerializeData(float value, AnimationCurve curve) + { + this.value = value; + useCurve = true; + this.curve = curve; + } + + public void SetValue(float value) + { + this.value = value; + useCurve = false; + } + + public void SetValue(float value, float curveStart, float curveEnd, bool useCurve = true) + { + this.value = value; + this.useCurve = useCurve; + curve = AnimationCurve.Linear(0.0f, Mathf.Clamp01(curveStart), 1.0f, Mathf.Clamp01(curveEnd)); + } + + public void SetValue(float value, AnimationCurve curve) + { + this.value = value; + useCurve = true; + this.curve = curve; + } + + public void DataValidate(float min, float max) + { + value = Mathf.Clamp(value, min, max); + } + + /// + /// Get the current value of Time(0.0 ~ 1.0). + /// + /// + /// + public float Evaluate(float time) + { + if (useCurve) + return curve.Evaluate(time) * value; + else + return value; + } + + /// + /// ‚Ѓĵƒ–ĉƒ…ċ ħ‚’‚¸ƒ§ƒ–§ċˆİ用™‚‹Ÿ‚16ċ€‹float配ċˆ—(float4x4)Ğċ¤‰ĉ›—Ĥèż”™ + /// Convert the curve information into a 16 float array (float4x4) for use in the job and return it. + /// + /// + public float4x4 ConvertFloatArray() + { + if (useCurve) + { + return DataUtility.ConvertAnimationCurve(curve) * value; + } + else + { + return value; + } + } + + public CurveSerializeData Clone() + { + var cdata = new CurveSerializeData() + { + value = value, + useCurve = useCurve, + }; + var c = new AnimationCurve(curve.keys); + c.preWrapMode = curve.preWrapMode; + c.postWrapMode = curve.postWrapMode; + cdata.curve = c; + + return cdata; + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/CurveSerializeData.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Cloth/CurveSerializeData.cs.meta new file mode 100644 index 00000000..8a1cd969 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/CurveSerializeData.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 9f7735bfb35f7314db881831c265ae81 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Cloth/CurveSerializeData.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/CustomSkinningSettings.cs b/Assets/MagicaCloth2/Scripts/Core/Cloth/CustomSkinningSettings.cs new file mode 100644 index 00000000..3cec209c --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/CustomSkinningSettings.cs @@ -0,0 +1,100 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System.Collections.Generic; +using System.Linq; +using UnityEngine; + +namespace MagicaCloth2 +{ + [System.Serializable] + public class CustomSkinningSettings : IValid, IDataValidate, ITransform + { + /// + /// valid state. + /// ĉœ‰ċŠıçŠĥĉ…‹ + /// [NG] Runtime changes. + /// [NG] Export/Import with Presets + /// + public bool enable = false; + + /// + /// Bones for custom skinning. + /// ‚Ğ‚ı‚żƒ ‚ı‚­ƒ‹ƒ³‚°ç”¨ƒœƒĵƒ³ + /// [NG] Runtime changes. + /// [NG] Export/Import with Presets + /// + public List skinningBones = new List(); + + public void DataValidate() + { + //angularAttenuation = Mathf.Clamp01(angularAttenuation); + //distanceReduction = Mathf.Clamp01(distanceReduction); + //distancePow = Mathf.Clamp(distancePow, 0.1f, 5.0f); + } + + public bool IsValid() + { + if (enable == false) + return false; + if (skinningBones.Count == 0) + return false; + if (skinningBones.Any(n => n != null) == false) + return false; + + return true; + } + + public CustomSkinningSettings Clone() + { + return new CustomSkinningSettings() + { + enable = enable, + skinningBones = new List(skinningBones), + }; + } + + /// + /// ‚¨ƒ‡‚£‚żƒĦƒƒ‚·ƒĉ›´ĉ–°‚’ċˆ¤ċš™‚‹Ÿ‚ƒƒƒ‚·ƒ‚³ƒĵƒ‰ + /// ïĵˆ“ƒƒƒ‚·ƒŻċŸèĦŒĉ™‚ĞŻċˆİ用•‚ŒŞ„編集用‚‚ïĵ‰ + /// + /// + public override int GetHashCode() + { + int hash = 0; + + // Š‚‰‚Ğ‚ı‚żƒ ‚ı‚­ƒ‹ƒ³‚°Żä¸èĤ +#if false + hash += enable.GetHashCode() * 101; + hash += angularAttenuation.GetHashCode(); + hash += distanceReduction.GetHashCode(); + hash += distancePow.GetHashCode(); + foreach (var t in skinningBones) + hash += t?.GetInstanceID() ?? 0; +#endif + + return hash; + } + + public void GetUsedTransform(HashSet transformSet) + { + foreach (var t in skinningBones) + { + if (t) + transformSet.Add(t); + } + } + + public void ReplaceTransform(Dictionary replaceDict) + { + for (int i = 0; i < skinningBones.Count; i++) + { + var t = skinningBones[i]; + if (t && replaceDict.ContainsKey(t.GetMagicaId())) + { + skinningBones[i] = replaceDict[t.GetMagicaId()]; + } + } + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/CustomSkinningSettings.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Cloth/CustomSkinningSettings.cs.meta new file mode 100644 index 00000000..cebb733f --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/CustomSkinningSettings.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 93141a4088f5d094b95f02f4d362ea4f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Cloth/CustomSkinningSettings.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/GizmoSerializeData.cs b/Assets/MagicaCloth2/Scripts/Core/Cloth/GizmoSerializeData.cs new file mode 100644 index 00000000..433409b3 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/GizmoSerializeData.cs @@ -0,0 +1,36 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp + +namespace MagicaCloth2 +{ + /// + /// MagicaCloth‚³ƒ³ƒƒĵƒƒ³ƒˆ‚‚şƒ˘èĦ¨ç¤şç”¨‚·ƒŞ‚˘ƒİ‚¤‚şƒ‡ƒĵ‚ż + /// + [System.Serializable] + public class GizmoSerializeData + { + public bool always = false; + + // Cloth + public ClothDebugSettings clothDebugSettings = new ClothDebugSettings(); + + // Virtual Mesh. “‚ŒŻƒ‡ƒƒƒ‚°ç”¨ +#if MC2_DEBUG + public VirtualMeshDebugSettings proxyDebugSettings = new VirtualMeshDebugSettings(); + public VirtualMeshDebugSettings mappingDebugSettings = new VirtualMeshDebugSettings(); + public int debugMappingIndex = 0; +#endif // MC2_DEBUG + + public GizmoSerializeData() + { + clothDebugSettings.enable = true; + clothDebugSettings.shape = true; + } + + public bool IsAlways() + { + return always; + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/GizmoSerializeData.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Cloth/GizmoSerializeData.cs.meta new file mode 100644 index 00000000..1a673a2a --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/GizmoSerializeData.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 599ae32263dff354aa87f60fe8748dd8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Cloth/GizmoSerializeData.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/MagicaCloth.cs b/Assets/MagicaCloth2/Scripts/Core/Cloth/MagicaCloth.cs new file mode 100644 index 00000000..4ad84f26 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/MagicaCloth.cs @@ -0,0 +1,142 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// MagicaCloth main component. + /// + [AddComponentMenu("MagicaCloth2/MagicaCloth")] + [HelpURL("https://magicasoft.jp/en/mc2_magicaclothcomponent/")] + public partial class MagicaCloth : ClothBehaviour, IValid + { + /// + /// Serialize data (1). + /// Basic parameters. + /// Import/export target. + /// Can be rewritten at runtime. + /// + [SerializeField] + private ClothSerializeData serializeData = new ClothSerializeData(); + public ClothSerializeData SerializeData => serializeData; + + /// + /// Serialize data (2). + /// Hidden data that cannot be rewritten at runtime + /// + [SerializeField] + internal ClothSerializeData2 serializeData2 = new ClothSerializeData2(); + +#if UNITY_EDITOR + /// + /// Gizmo display specification when editing. + /// + [SerializeField] + private GizmoSerializeData gizmoSerializeData = new GizmoSerializeData(); + public GizmoSerializeData GizmoSerializeData => gizmoSerializeData; +#endif + + /// + /// General processing. + /// + private ClothProcess process = new ClothProcess(); + public ClothProcess Process + { + get + { + process.cloth = this; + return process; + } + } + + /// + /// Cloth component transform. + /// Proxy meshes and selection data are managed in this space. + /// + public Transform ClothTransform => transform; + + /// + /// Synchronization target. + /// + public MagicaCloth SyncPartnerCloth + { + get + { + var syncCloth = SerializeData.IsBoneSpring() ? null : SerializeData.selfCollisionConstraint.GetSyncPartner(); + return syncCloth == this ? null : syncCloth; + } + } + + /// + /// Check if the cloth component is in a valid state. + /// ‚Żƒ­‚ı‚³ƒ³ƒƒĵƒƒ³ƒˆŒĉœ‰ċŠıŞçŠĥĉ…‹‹ç˘şèލ—™€‚ + /// + /// + public bool IsValid() + { + return MagicaManager.IsPlaying() && Process.IsValid() && Process.TeamId > 0; + } + + //========================================================================================= + protected void Reset() + { +#if UNITY_EDITOR + // Automatically generate pre-build ID + serializeData2.preBuildData.buildId = PreBuildSerializeData.GenerateBuildID(); +#endif + } + + protected void OnValidate() + { + Process.DataUpdate(); + } + + protected void Awake() + { + if (MagicaManager.initializationLocation == MagicaManager.InitializationLocation.Awake) + { + Process.Init(); + MagicaManager.Team.RemoveMonitoringProcess(Process); + } + } + + protected void OnEnable() + { + Process.StartUse(); + } + + protected void OnDisable() + { + Process.EndUse(); + } + + protected void Start() + { + if (MagicaManager.initializationLocation == MagicaManager.InitializationLocation.Start) + { + Process.Init(); + MagicaManager.Team.RemoveMonitoringProcess(Process); + } + + Process.AutoBuild(); + } + + protected void OnDestroy() + { + Process.Dispose(); + } + + /// + /// Hash code for checking changes when editing. + /// + /// + public override int GetMagicaHashCode() + { + int hash = SerializeData.GetHashCode() + serializeData2.GetHashCode(); + hash += isActiveAndEnabled ? this.GetMagicaId().GetHashCode() : 0; // component active. + return hash; + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/MagicaCloth.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Cloth/MagicaCloth.cs.meta new file mode 100644 index 00000000..6ad388c1 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/MagicaCloth.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: bdbd3ce05f5b45942b56ede5c9b38364 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 5 + icon: {fileID: 2800000, guid: cf7e3400035e987478c3a19e57b4cf75, type: 3} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Cloth/MagicaCloth.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/MagicaClothAPI.cs b/Assets/MagicaCloth2/Scripts/Core/Cloth/MagicaClothAPI.cs new file mode 100644 index 00000000..1ccaebb7 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/MagicaClothAPI.cs @@ -0,0 +1,353 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace MagicaCloth2 +{ + public partial class MagicaCloth + { + /// + /// ‚·ƒŞ‚˘ƒİ‚¤‚şƒ‡ƒĵ‚żïĵ’ċ–ċ— + /// SerializeData2‚Żƒİ‚ıŻ‚·‚ıƒ†ƒ Œċˆİ用™‚‹ƒ‘ƒİƒĦƒĵ‚ż‚Żƒİ‚ı§™€‚ + /// Ÿ‚ƒĤƒĵ‚ĥƒĵĞ‚ˆ‚‹ċ¤‰ĉ›´Żĉލċ¨•‚ŒĤ„›‚“€‚ + /// + /// Acquisition of SerializedData2. + /// The SerializeData2 class is a parameter class used by the system. + /// Therefore, user modification is not recommended. + /// + /// + public ClothSerializeData2 GetSerializeData2() + { + return serializeData2; + } + + /// + /// ‚Żƒ­‚ıƒ‡ƒĵ‚żĉ§‹ç݉ċŒäş†ċŒ‚¤ƒ™ƒ³ƒˆ + /// Event after completion of cloth data construction. + /// (true = Success, false = Failure) + /// + public Action OnBuildComplete; + + /// + /// ƒĴƒ³ƒ€ƒİƒĵƒĦƒƒ‚·ƒċ¤‰ĉ›´ċŒ‚¤ƒ™ƒ³ƒˆ + /// Renderer mesh change event. + /// (true = Change to custom mesh, false = Change to original mesh) + /// + public Action OnRendererMeshChange; + + /// + /// ċˆĉœŸċŒ–‚’ċŸèĦŒ—™ + /// ™§ĞċˆĉœŸċŒ–ĉ¸ˆżċ ´ċˆŻä½•‚‚—›‚“€‚ + /// perform initialization. + /// If already initialized, do nothing. + /// + public void Initialize() + { + if (Application.isPlaying == false) + return; + + Process.Init(); + } + + /// + /// ‚³ƒ³ƒƒĵƒƒ³ƒˆStart()§ċŸèĦŒ•‚Œ‚‹è‡Şċ‹•ƒ“ƒĞƒ‰‚’ç„ĦċŠıĞ—™ + /// Disable automatic builds that run on the component's Start(). + /// + public void DisableAutoBuild() + { + if (Application.isPlaying == false) + return; + + Process.SetState(ClothProcess.State_DisableAutoBuild, true); + } + + /// + /// ‚³ƒ³ƒƒĵƒƒ³ƒˆ‚’ĉ§‹ç݉—ċŸèĦŒ—™ + /// ™ıĤƒ‡ƒĵ‚ż‚’‚ğƒƒƒˆ‚˘ƒƒƒ——Ÿ‚¨Ğċ‘ĵ³ċ‡ş™ċż…èĤŒ‚‚Ё™ + /// build and run the component. + /// Must be called after setting up all data. + /// + /// true=start build. false=build failed. + public bool BuildAndRun() + { + bool ret = false; + bool buildComplate = true; + + try + { + if (Application.isPlaying == false) + throw new MagicaClothProcessingException(); + + DisableAutoBuild(); + + if (Process.IsState(ClothProcess.State_Build)) + { + Develop.LogError($"Already built.:{this.name}"); + throw new MagicaClothProcessingException(); + } + + // initialize generated data. + if (Process.GenerateInitialization() == false) + throw new MagicaClothProcessingException(); + + // check Pre-Build + bool usePreBuildData = serializeData2.preBuildData.UsePreBuild(); + + if (usePreBuildData == false) + { + // Runtime Build. + // setting by type. + switch (serializeData.clothType) + { + case ClothProcess.ClothType.BoneCloth: + case ClothProcess.ClothType.BoneSpring: + // BoneCloth用‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚żä½œĉˆ + // Ÿ —‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚żŒċ­˜ċœ¨—€‹¤ƒĤƒĵ‚ĥƒĵċšç݁•‚ŒĤ„‚‹ċ ´ċˆŻä½œĉˆ—Ş„ + var nowSelection = serializeData2.selectionData; + if (nowSelection == null || nowSelection.IsValid() == false || nowSelection.IsUserEdit() == false) + { + if (Process.GenerateBoneClothSelection() == false) + throw new MagicaClothProcessingException(); + } + break; + } + + // build and run. + ret = Process.StartRuntimeBuild(); + if (ret) + buildComplate = false; // OnBuildCompleteŻƒİƒ³‚ż‚¤ƒ ĉ§‹ç݉ċŒĞċ‘ĵ°‚Œ‚‹ + } + else + { + // pre-build + ret = Process.PreBuildDataConstruction(); + } + } + catch (MagicaClothProcessingException) + { + } + catch (Exception exception) + { + Debug.LogException(exception); + } + finally + { + // ƒ“ƒĞƒ‰ċŒäş†‚¤ƒ™ƒ³ƒˆ + if (buildComplate) + OnBuildComplete?.Invoke(this, ret); + } + + return ret; + } + + /// + /// ‚³ƒ³ƒƒĵƒƒ³ƒˆŒäżĉŒ™‚‹ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ‚’ç½ĉ›—™€‚ + /// ç½ĉ›ċ…ˆƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ċ‚’‚­ƒĵ¨—Ÿèžĉ›¸‚’ĉ¸Ħ—™€‚ + /// Replaces a component's transform. + /// Passes a dictionary keyed by the name of the transform to be replaced. + /// + /// Dictionary keyed by the name of the transform to be replaced. + public void ReplaceTransform(Dictionary targetTransformDict) + { + // ‚³ƒ³ƒƒĵƒƒ³ƒˆŒċˆİ用—Ĥ„‚‹™ıĤTransform‚’ċ–ċ——™ + var useTransformSet = new HashSet(); + Process.GetUsedTransform(useTransformSet); + + // ç½ĉ›ċ‡Ĥ理用èžĉ›¸‚’作ĉˆ + // key:ç½ĉ›ċŻèħĦƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ‚¤ƒ³‚ı‚żƒ³‚ıID + // value:ċ…‚Œĉ›żˆ‚‹ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ  + var replaceDict = new Dictionary(); + foreach (var t in useTransformSet) + { + if (t && targetTransformDict.ContainsKey(t.name)) + { + replaceDict.Add(t.GetMagicaId(), targetTransformDict[t.name]); + } + } + + // ç½ĉ›™‚‹ + Process.ReplaceTransform(replaceDict); + } + + /// + /// ‚³ƒ³ƒƒĵƒƒ³ƒˆŒäżĉŒ™‚‹™ıĤƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ‚’ċ–ċ——™€‚ + /// Gets all the transforms held by the component. + /// + /// + public HashSet GetUsedTransform() + { + var useTransformSet = new HashSet(); + Process.GetUsedTransform(useTransformSet); + return useTransformSet; + } + + + /// + /// ƒ‘ƒİƒĦƒĵ‚żċ¤‰ĉ›´‚’é€šçŸ + /// ċŸèĦŒä¸­Ğƒ‘ƒİƒĦƒĵ‚ż‚’ċ¤‰ĉ›´—Ÿċ ´ċˆŻ“é–˘ĉ•°‚’ċ‘ĵĥċż…èĤŒ‚‚Ё™ + /// You should call this function if you changed parameters during execution. + /// + public void SetParameterChange() + { + if (IsValid()) + { + Process.DataUpdate(); + } + } + + /// + /// ‚ż‚¤ƒ ‚ı‚ħƒĵƒĞ‚’ċ¤‰ĉ›´—™ + /// Change the time scale. + /// + /// 0.0-1.0 + public void SetTimeScale(float timeScale) + { + if (IsValid()) + { + ref var tdata = ref MagicaManager.Team.GetTeamDataRef(Process.TeamId); + tdata.timeScale = Mathf.Clamp01(timeScale); + } + } + + /// + /// ‚ż‚¤ƒ ‚ı‚ħƒĵƒĞ‚’ċ–ċ——™ + /// Get the time scale. + /// + /// + public float GetTimeScale() + { + if (IsValid()) + { + ref var tdata = ref MagicaManager.Team.GetTeamDataRef(Process.TeamId); + return tdata.timeScale; + } + else + return 1.0f; + } + + /// + /// ‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³‚’ċˆĉœŸçŠĥĉ…‹ĞƒŞ‚ğƒƒƒˆ—™ + /// Reset the simulation to its initial state. + /// + /// If true, resume while maintaining posture. + public void ResetCloth(bool keepPose = false) + { + if (IsValid()) + { + ref var tdata = ref MagicaManager.Team.GetTeamDataRef(Process.TeamId); + if (keepPose) + { + // Keep + tdata.flag.SetBits(TeamManager.Flag_KeepTeleport, true); + } + else + { + // Reset + tdata.flag.SetBits(TeamManager.Flag_Reset, true); + tdata.flag.SetBits(TeamManager.Flag_TimeReset, true); + tdata.flag.SetBits(TeamManager.Flag_CameraCullingKeep, false); + Process.SetState(ClothProcess.State_CameraCullingKeep, false); + Process.UpdateRendererUse(); + } + } + } + + /// + /// ĉ…£ĉ€§ä¸­ċżƒċş§ĉ¨™‚’ċ–ċ——™ + /// Get the center of inertia position. + /// + /// + public Vector3 GetCenterPosition() + { + if (IsValid()) + { + ref var cdata = ref MagicaManager.Team.GetCenterDataRef(Process.TeamId); + return ClothTransform.TransformPoint(cdata.frameLocalPosition); + } + else + return Vector3.zero; + } + + /// + /// ċ¤–ċŠ›‚’ċŠ ˆ™ + /// Add external force. + /// + /// + /// (m/s) + /// + public void AddForce(Vector3 forceDirection, float forceVelocity, ClothForceMode fmode = ClothForceMode.VelocityAdd) + { + if (IsValid() && forceDirection.magnitude > 0.0f && forceVelocity > 0.0f && fmode != ClothForceMode.None) + { + ref var tdata = ref MagicaManager.Team.GetTeamDataRef(Process.TeamId); + tdata.forceMode = fmode; + tdata.impactForce = forceDirection.normalized * forceVelocity; + } + } + + /// + /// TransformŠ‚ˆ³Mesh¸ĉ›¸èĵż‚’çĤĉ­˘ŸŻè¨ħċŻ—™ + /// “ĉݟ能‚’ä½ż†“¨§‚ıƒˆƒƒƒ—ƒ˘ƒĵ‚·ƒ§ƒ³‚’ċŸè£…™‚‹“¨ŒċŻèƒ½§™ + /// Prevent or allow writing to Transform and Mesh. + /// By using this function, it is possible to implement stop motion. + /// + /// true=write disabled, false=write enabled + public void SetSkipWriting(bool sw) + { + if (IsValid()) + { + Process.SetSkipWriting(sw); + } + } + + private RenderData GetRenderData(Renderer ren) + { + if (IsValid() == false || ren == null) + return null; + MagicaObjectId handle = ren.GetMagicaId(); + return MagicaManager.Render.GetRendererData(handle); + } + + /// + /// MeshCloth‚ރނ¸ƒŠƒĞƒĦƒƒ‚·ƒ‚’ċ–ċ——™ + /// Get the original mesh of MeshCloth. + /// + /// + /// null if not found + public Mesh GetOriginalMesh(Renderer ren) + { + var rdata = GetRenderData(ren); + return rdata != null ? rdata.originalMesh : null; + } + + /// + /// MeshCloth‚Ğ‚ı‚żƒ ƒĦƒƒ‚·ƒ‚’ċ–ċ——™ + /// Get the custom mesh for MeshCloth. + /// + /// + /// null if not found + public Mesh GetCustomMesh(Renderer ren) + { + var rdata = GetRenderData(ren); + return rdata != null ? rdata.customMesh : null; + } + + /// + /// MeshClothSkinnedMeshRendererĞ設ċš•‚ŒĤ„‚‹‚Ğ‚ı‚żƒ ƒœƒĵƒ³ƒŞ‚ıƒˆ‚’ċ–ċ——™ + /// ‚Ğ‚ı‚żƒ ƒœƒĵƒ³ƒŞ‚ıƒˆŻ‚ރނ¸ƒŠƒĞBones‹‚‰‚ı‚­ƒ‹ƒ³‚°Ğ不èĤŞTransform‚’nullĞ設ċš—€ + /// Ÿĉœ€ċŒĞƒĴƒ³ƒ€ƒİƒĵTransformŒèż½ċŠ •‚Œ‚‹ŞİċŠ ċ·•‚ŒĤ„‚‹§ĉ³¨ĉ„—Ĥ •„€‚ + /// Gets the custom bone list set for the SkinnedMeshRenderer of MeshCloth. + /// Please note that the custom bone list has been processed by setting Transforms + /// that are not necessary for skinning to null from the original Bones, and adding the renderer Transform at the end. + /// + /// + /// null if not found + public List GetCustomBones(Renderer ren) + { + return GetRenderData(ren)?.transformList ?? null; + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/MagicaClothAPI.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Cloth/MagicaClothAPI.cs.meta new file mode 100644 index 00000000..095e8c77 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/MagicaClothAPI.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: ebbf2c9c05a3200438a0a1f7b352d81f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Cloth/MagicaClothAPI.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/MagicaClothAnimationProperty.cs b/Assets/MagicaCloth2/Scripts/Core/Cloth/MagicaClothAnimationProperty.cs new file mode 100644 index 00000000..88e3882d --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/MagicaClothAnimationProperty.cs @@ -0,0 +1,130 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2024 MagicaSoft. +// https://magicasoft.jp + +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// ƒ—ƒ­ƒ‘ƒ†‚£‚’‚˘ƒ‹ƒĦƒĵ‚·ƒ§ƒ³‹‚‰ċˆĥċĦ™‚‹Ÿ‚ƒİƒƒƒ‘ƒĵ. + /// Wrapper for controlling properties from animation. + /// + public partial class MagicaCloth + { + [HideInInspector] + public float animationPoseRatioProperty; + float _animationPoseRatioProperty; + + [HideInInspector] + public float gravityProperty; + float _gravityProperty; + + [HideInInspector] + public float dampingProperty; + float _dampingProperty; + + [HideInInspector] + public float worldInertiaProperty; + float _worldInertiaProperty; + + [HideInInspector] + public float localInertiaProperty; + float _localInertiaProperty; + + [HideInInspector] + public float windInfluenceProperty; + float _windInfluenceProperty; + + [HideInInspector] + public float blendWeightProperty; + float _blendWeightProperty; + + //========================================================================================= + internal void InitAnimationProperty() + { + animationPoseRatioProperty = serializeData.animationPoseRatio; + _animationPoseRatioProperty = animationPoseRatioProperty; + + gravityProperty = serializeData.gravity; + _gravityProperty = gravityProperty; + + dampingProperty = serializeData.damping.value; + _dampingProperty = dampingProperty; + + worldInertiaProperty = serializeData.inertiaConstraint.worldInertia; + _worldInertiaProperty = worldInertiaProperty; + + localInertiaProperty = serializeData.inertiaConstraint.localInertia; + _localInertiaProperty = localInertiaProperty; + + windInfluenceProperty = serializeData.wind.influence; + _windInfluenceProperty = windInfluenceProperty; + + blendWeightProperty = serializeData.blendWeight; + _blendWeightProperty = blendWeightProperty; + } + + /// + /// ‚˘ƒ‹ƒĦƒĵ‚·ƒ§ƒ³Ğ‚ˆ‚ŠMagicaClothƒ—ƒ­ƒ‘ƒ†‚£Œċ¤‰ĉ›´•‚ŒŸ¨Ğċ‘ĵ³ċ‡ş•‚Œ‚‹. + /// Called when a property of MagicaCloth changes due to animation. + /// + void OnDidApplyAnimationProperties() + { + if (Application.isPlaying) + { + //Debug.Log($"Animated property changes. F:{Time.frameCount}"); + + if (animationPoseRatioProperty != _animationPoseRatioProperty) + { + _animationPoseRatioProperty = animationPoseRatioProperty; + serializeData.animationPoseRatio = animationPoseRatioProperty; + SetParameterChange(); + } + + if (gravityProperty != _gravityProperty) + { + _gravityProperty = gravityProperty; + serializeData.gravity = gravityProperty; + SetParameterChange(); + } + + if (dampingProperty != _dampingProperty) + { + _dampingProperty = dampingProperty; + serializeData.damping.value = dampingProperty; + SetParameterChange(); + } + + if (worldInertiaProperty != _worldInertiaProperty) + { + _worldInertiaProperty = worldInertiaProperty; + serializeData.inertiaConstraint.worldInertia = worldInertiaProperty; + SetParameterChange(); + } + + if (localInertiaProperty != _localInertiaProperty) + { + _localInertiaProperty = localInertiaProperty; + serializeData.inertiaConstraint.localInertia = localInertiaProperty; + SetParameterChange(); + } + + if (windInfluenceProperty != _windInfluenceProperty) + { + _windInfluenceProperty = windInfluenceProperty; + serializeData.wind.influence = windInfluenceProperty; + SetParameterChange(); + } + + if (blendWeightProperty != _blendWeightProperty) + { + _blendWeightProperty = blendWeightProperty; + serializeData.blendWeight = blendWeightProperty; + SetParameterChange(); + } + } + } + } +} + diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/MagicaClothAnimationProperty.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Cloth/MagicaClothAnimationProperty.cs.meta new file mode 100644 index 00000000..67c35a94 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/MagicaClothAnimationProperty.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: fea7c53425d793a44b3d484072c68bde +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Cloth/MagicaClothAnimationProperty.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/NormalAlignmentSettings.cs b/Assets/MagicaCloth2/Scripts/Core/Cloth/NormalAlignmentSettings.cs new file mode 100644 index 00000000..bef9e8d6 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/NormalAlignmentSettings.cs @@ -0,0 +1,107 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System.Collections.Generic; +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// Normal adjustment settings. + /// ĉ³•ç·šèŞżĉ•´è¨­ċš + /// + [System.Serializable] + public class NormalAlignmentSettings : IValid, IDataValidate, ITransform + { + public enum AlignmentMode + { + None = 0, + + /// + /// Radiation from center of AABB. + /// 中ċżƒ‹‚‰ĉ”ċ°„ + /// + BoundingBoxCenter = 1, + + /// + /// Emit from the specified transform. + /// ĉŒ‡ċšƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ‹‚‰ĉ”ċ°„ + /// + Transform = 2, + } + + /// + /// adjustment mode. + /// [NG] Runtime changes. + /// [NG] Export/Import with Presets + /// + public AlignmentMode alignmentMode = AlignmentMode.None; + + /// + /// Transform at which the radiation is centered. + /// [NG] Runtime changes. + /// [NG] Export/Import with Presets + /// + public Transform adjustmentTransform; + + + public void DataValidate() + { + } + + public bool IsValid() + { + switch (alignmentMode) + { + case AlignmentMode.None: + case AlignmentMode.BoundingBoxCenter: + case AlignmentMode.Transform: + //case AlignmentMode.BoneWeight: + return true; + } + + return false; + } + + public NormalAlignmentSettings Clone() + { + return new NormalAlignmentSettings() + { + alignmentMode = alignmentMode, + adjustmentTransform = adjustmentTransform, + }; + } + + /// + /// ‚¨ƒ‡‚£‚żƒĦƒƒ‚·ƒĉ›´ĉ–°‚’ċˆ¤ċš™‚‹Ÿ‚ƒƒƒ‚·ƒ‚³ƒĵƒ‰ + /// ïĵˆ“ƒƒƒ‚·ƒŻċŸèĦŒĉ™‚ĞŻċˆİ用•‚ŒŞ„編集用‚‚ïĵ‰ + /// + /// + public override int GetHashCode() + { + int hash = 0; + hash += (int)alignmentMode * 105; + if (adjustmentTransform) + { + hash += adjustmentTransform.GetMagicaId().GetHashCode(); + hash += adjustmentTransform.position.GetHashCode(); + } + + return hash; + } + + public void GetUsedTransform(HashSet transformSet) + { + if (adjustmentTransform) + transformSet.Add(adjustmentTransform); + } + + public void ReplaceTransform(Dictionary replaceDict) + { + if (adjustmentTransform && replaceDict.ContainsKey(adjustmentTransform.GetMagicaId())) + { + adjustmentTransform = replaceDict[adjustmentTransform.GetMagicaId()]; + } + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/NormalAlignmentSettings.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Cloth/NormalAlignmentSettings.cs.meta new file mode 100644 index 00000000..c6b33371 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/NormalAlignmentSettings.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 558afbac4118e4c4da1657e02a653e3d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Cloth/NormalAlignmentSettings.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/SelectionData.cs b/Assets/MagicaCloth2/Scripts/Core/Cloth/SelectionData.cs new file mode 100644 index 00000000..1f4e1b65 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/SelectionData.cs @@ -0,0 +1,445 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System; +using System.Collections.Generic; +using Unity.Burst; +using Unity.Collections; +using Unity.Jobs; +using Unity.Mathematics; + +namespace MagicaCloth2 +{ + /// + /// 頂ç‚ıċħžĉ€§ĉƒ…ċ ħ(ç§ğċ‹•/ċ›şċš/ç„ĦċŠı)ƒ‡ƒĵ‚ż + /// “ƒ‡ƒĵ‚żŻ‚·ƒŞ‚˘ƒİ‚¤‚ş•‚Œ‚‹ + /// ċş§ĉ¨™Ż‚Żƒ­‚ı‚³ƒ³ƒƒĵƒƒ³ƒˆƒ­ƒĵ‚ЃĞçİşé–“§ĉ ĵ納•‚Œ‚‹ + /// Vertex attribute information (move/fix/disable) data. + /// This data is serialized. + /// Coordinates are stored in the cloth component's local space. + /// + [System.Serializable] + public class SelectionData : IValid + { + /// + /// ċħžĉ€§ƒ­ƒĵ‚ЃĞċş§ĉ¨™ + /// “‚ŒŻ‚Żƒ­‚ı‚³ƒ³ƒƒĵƒƒ³ƒˆçİşé–“ + /// Attribute local coordinates. + /// This is the cloth component space. + /// + public float3[] positions; + + /// + /// 上記ċħžĉ€§ċ€¤ + /// ‚µ‚¤‚şŻpositions¨ċŒ˜§ŞĤŻŞ‚‰Ş„ + /// Attribute value above. + /// size must be the same as positions. + /// + public VertexAttribute[] attributes; + + /// + /// ‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚żĉ§‹ç݉ĉ™‚VirtualMeshĉœ€ċ¤§é ‚ç‚ıĉŽçĥšè·é›˘ + /// Maximum vertex connection distance of VirtualMesh when constructing selection data. + /// + public float maxConnectionDistance; + + /// + /// ƒĤƒĵ‚ĥƒĵŒç·¨é›†—Ÿƒ‡ƒĵ‚ż‹İ†‹ + /// Is the data edited by the user? + /// + public bool userEdit = false; + + //========================================================================================= + public SelectionData() { } + + public SelectionData(int cnt) + { + positions = new float3[cnt]; + attributes = new VertexAttribute[cnt]; + } + + public SelectionData(VirtualMesh vmesh, float4x4 transformMatrix) + { + if (vmesh != null && vmesh.VertexCount > 0) + { + // vmeshċş§ĉ¨™‚’‚³ƒ³ƒƒĵƒƒ³ƒˆçİşé–“Ğċ¤‰ĉ›—Ĥĉ ĵ納™‚‹ + using var posArray = new NativeArray(vmesh.localPositions.GetNativeArray(), Allocator.TempJob); + var job = new TransformPositionJob() + { + transformMatrix = transformMatrix, + localPositions = posArray, + }; + job.Run(vmesh.VertexCount); + + positions = posArray.ToArray(); + attributes = vmesh.attributes.ToArray(); + maxConnectionDistance = vmesh.maxVertexDistance.Value; + } + } + + [BurstCompile] + struct TransformPositionJob : IJobParallelFor + { + public float4x4 transformMatrix; + public NativeArray localPositions; + + public void Execute(int index) + { + var pos = localPositions[index]; + pos = math.transform(transformMatrix, pos); + localPositions[index] = pos; + } + } + + public int Count + { + get + { + return positions?.Length ?? 0; + } + } + + public bool IsValid() + { + if (positions == null || positions.Length == 0) + return false; + if (attributes == null || attributes.Length == 0) + return false; + if (positions.Length != attributes.Length) + return false; + + return true; + } + + public bool IsUserEdit() => userEdit; + + public SelectionData Clone() + { + var sdata = new SelectionData(); + sdata.positions = positions?.Clone() as float3[]; + sdata.attributes = attributes?.Clone() as VertexAttribute[]; + sdata.maxConnectionDistance = maxConnectionDistance; + sdata.userEdit = userEdit; + + return sdata; + } + + /// + /// ƒƒƒ‚·ƒïĵˆ“‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚żè­˜ċˆĞċˆİ用•‚Œ‚‹ïĵ‰ + /// + /// + //public override int GetHashCode() + //{ + // if (IsValid() == false) + // return 0; + + // // 頂ç‚ıċş§ĉ¨™ƒƒƒ‚·ƒ‚’„¤‹‚µƒ³ƒ—ƒŞƒ³‚°™‚‹ + // uint hash = 0; + // int len = positions.Length; + // int step = math.max(len / 4, 1); + // for (int i = 0; i < len; i += step) + // { + // hash += math.hash(positions[i]); + // hash += (uint)attributes[i].Value; + // } + // hash += math.hash(positions[len - 1]); + // hash += (uint)attributes[len - 1].Value; + + // return (int)hash; + //} + + /// + /// ïĵ’¤‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚żŒç­‰—„‹ċˆ¤ċš™‚‹ + /// ïĵˆċş§ĉ¨™èݳ細ŻèĤ‹Ş„€‚ċħžĉ€§èݳ細ŻèĤ‹‚‹ïĵ‰ + /// + /// + /// + public bool Compare(SelectionData sdata) + { + //return GetHashCode() == sdata.GetHashCode(); + + if (positions?.Length != sdata.positions?.Length) + return false; + + if (attributes?.Length != sdata.attributes?.Length) + return false; + + if (userEdit != sdata.userEdit) + return false; + + // ċş§ĉ¨™¨ċħžĉ€§Żĉ­£ç˘şĞèĤ‹‚‹ + // todo:“ċ‡Ĥ理Œé‡„‚ˆ†Ş‚‰BurstĞċˆ‡‚Šĉ›żˆ‚‹ + int cnt = attributes.Length; + for (int i = 0; i < cnt; i++) + { + if (attributes[i] != sdata.attributes[i]) + return false; + if (positions[i].Equals(sdata.positions[i]) == false) + return false; + } + + return true; + } + + public void AddRange(float3[] addPositions, VertexAttribute[] addAttributes = null) + { + if (Count == 0) + { + positions = addPositions; + attributes = addAttributes != null ? addAttributes : new VertexAttribute[addPositions.Length]; + } + else + { + // ĉ‹Ħċĵµ + int cnt = Count; + int addCnt = addPositions.Length; + float3[] newPositions = new float3[cnt + addCnt]; + VertexAttribute[] newAttribues = new VertexAttribute[cnt + addCnt]; + + Array.Copy(positions, 0, newPositions, 0, cnt); + Array.Copy(addPositions, 0, newPositions, cnt, addCnt); + + Array.Copy(attributes, 0, newAttribues, 0, cnt); + if (addAttributes != null) + { + Array.Copy(addAttributes, 0, newAttribues, cnt, addCnt); + } + + positions = newPositions; + attributes = newAttribues; + } + } + + public void Fill(VertexAttribute attr) + { + Array.Fill(attributes, attr); + } + + //========================================================================================= + public NativeArray GetPositionNativeArray() + { + return new NativeArray(positions, Allocator.Persistent); + } + + public NativeArray GetPositionNativeArray(float4x4 transformMatrix) + { + var posArray = GetPositionNativeArray(); + var job = new TransformPositionJob() + { + transformMatrix = transformMatrix, + localPositions = posArray, + }; + job.Run(Count); + + return posArray; + } + + public NativeArray GetAttributeNativeArray() + { + return new NativeArray(attributes, Allocator.Persistent); + } + + //========================================================================================= + /// + /// ċħžĉ€§ċş§ĉ¨™‚’‚°ƒŞƒƒƒ‰ƒžƒƒƒ—Ğç™ğ録—Ĥèż”™ + /// + /// + /// + /// + /// ç§ğċ‹•ċħžĉ€§‚’ċĞ‚‚‹‹İ†‹ + /// ċ›şċšċħžĉ€§‚’ċĞ‚‚‹‹İ†‹ + /// ç„ĦċŠıċħžĉ€§‚’ċĞ‚‚‹‹İ†‹ + /// + public static GridMap CreateGridMapRun( + float gridSize, + in NativeArray positions, + in NativeArray attributes, + bool move = true, bool fix = true, bool ignore = true, bool invalid = true + ) + { + var gridMap = new GridMap(positions.Length); + + var job = new CreateGridMapJob() + { + move = move, + fix = fix, + ignore = ignore, + invalid = invalid, + gridMap = gridMap.GetMultiHashMap(), + gridSize = gridSize, + positions = positions, + attribute = attributes, + }; + job.Run(); + + return gridMap; + } + + [BurstCompile] + struct CreateGridMapJob : IJob + { + public bool move; + public bool fix; + public bool ignore; + public bool invalid; + + public NativeParallelMultiHashMap gridMap; + public float gridSize; + + [Unity.Collections.ReadOnly] + public NativeArray positions; + [Unity.Collections.ReadOnly] + public NativeArray attribute; + + public void Execute() + { + int cnt = positions.Length; + for (int i = 0; i < cnt; i++) + { + var attr = attribute[i]; + if (move == false && attr.IsMove()) + continue; + if (fix == false && attr.IsFixed()) + continue; + //if (ignore == false && attr.IsIgnore()) + // continue; + if (invalid == false && attr.IsInvalid()) + continue; + + var pos = positions[i]; + + GridMap.AddGrid(pos, i, gridMap, gridSize); + } + } + } + + //========================================================================================= + /// + /// ‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚ż‚’結ċˆ™‚‹ + /// + /// + public void Merge(SelectionData from) + { + if (from.Count == 0) + return; + + var cnt = Count + from.Count; + var newPositions = new List(cnt); + var newAttributes = new List(cnt); + if (positions != null) + newPositions.AddRange(positions); + if (attributes != null) + newAttributes.AddRange(attributes); + newPositions.AddRange(from.positions); + newAttributes.AddRange(from.attributes); + + positions = newPositions.ToArray(); + attributes = newAttributes.ToArray(); + maxConnectionDistance = math.max(maxConnectionDistance, from.maxConnectionDistance); + userEdit = userEdit || from.userEdit; + } + + /// + /// 頂ç‚ıĉ•°ç•°Ş‚‹‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚ż‚’ç§ğĉ¤™‚‹ + /// + /// ç§ğċ‹•ċ…ƒ‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚ż + public void ConvertFrom(SelectionData from) + { + if (from.Count == 0) + return; + if (Count == 0) + return; + + // ç§ğċ‹•ċ…ˆƒ‡ƒĵ‚ż + using var toPositions = GetPositionNativeArray(); + using var toAttributes = GetAttributeNativeArray(); + + // ç§ğċ‹•ċ…ƒƒ‡ƒĵ‚ż + using var fromPositions = from.GetPositionNativeArray(); + using var fromAttributes = from.GetAttributeNativeArray(); + + // ç§ğċ‹•ċ…ˆAABB + using var aabb = new NativeReference(Allocator.TempJob); + JobUtility.CalcAABBRun(toPositions, Count, aabb); + float serachRadius = aabb.Value.MaxSideLength * 0.2f; // 20% + serachRadius = math.max(serachRadius, Define.System.MinimumGridSize); + + // ç§ğċ‹•ċ…ƒƒ‡ƒĵ‚ż‚’‚°ƒŞƒƒƒ‰Ğç™ğ録™‚‹ + float gridSize = serachRadius * 0.5f; + using var gridMap = CreateGridMapRun(gridSize, fromPositions, fromAttributes); + + // ç§ğċ‹•ċ…ˆċş§ĉ¨™‚’範ċ›²ĉ¤œç´˘—èĤ‹¤‹£Ÿç§ğċ‹•ċ…ƒċħžĉ€§‚’äğ˜ä¸Ž™‚‹ + var job = new ConvertSelectionJob() + { + gridSize = gridSize, + radius = serachRadius, + toPositions = toPositions, + toAttributes = toAttributes, + gridMap = gridMap.GetMultiHashMap(), + fromPositions = fromPositions, + fromAttributes = fromAttributes, + }; + job.Run(Count); + + // 結ĉžœĉ›¸ĉˆğ— + positions = toPositions.ToArray(); + attributes = toAttributes.ToArray(); + } + + [BurstCompile] + struct ConvertSelectionJob : IJobParallelFor + { + public float gridSize; + public float radius; + + // to + [Unity.Collections.ReadOnly] + public NativeArray toPositions; + [Unity.Collections.WriteOnly] + public NativeArray toAttributes; + + // from + [Unity.Collections.ReadOnly] + public NativeParallelMultiHashMap gridMap; + [Unity.Collections.ReadOnly] + public NativeArray fromPositions; + [Unity.Collections.ReadOnly] + public NativeArray fromAttributes; + + public void Execute(int vindex) + { + float3 pos = toPositions[vindex]; + + // èĤ‹¤‹‚‰Ş„ċ ´ċˆŻInvalid + VertexAttribute attr = VertexAttribute.Invalid; + + // 範ċ›²‚°ƒŞƒƒƒ‰èµ°ĉŸğ + float minDist = float.MaxValue; + foreach (int3 grid in GridMap.GetArea(pos, radius, gridMap, gridSize)) + { + if (gridMap.ContainsKey(grid) == false) + continue; + + // “‚°ƒŞƒƒƒ‰‚’ĉ¤œç´˘™‚‹ + foreach (int tindex in gridMap.GetValuesForKey(grid)) + { + // è·é›˘ċˆ¤ċš + float3 tpos = fromPositions[tindex]; + float dist = math.distance(pos, tpos); + if (dist > radius) + continue; + if (dist > minDist) + continue; + + // èż‘ċ‚è¨­ċš + minDist = dist; + attr = fromAttributes[tindex]; + } + } + + // ċħžĉ€§ċĉ˜  + toAttributes[vindex] = attr; + } + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/SelectionData.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Cloth/SelectionData.cs.meta new file mode 100644 index 00000000..537a0ee9 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/SelectionData.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: c35ca9ed7221ef445843e9c21428c27d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Cloth/SelectionData.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/Wind.meta b/Assets/MagicaCloth2/Scripts/Core/Cloth/Wind.meta new file mode 100644 index 00000000..d2b84c12 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/Wind.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e487ff1775b55bb4897455a2b4a5123a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/Wind/MagicaWindZone.cs b/Assets/MagicaCloth2/Scripts/Core/Cloth/Wind/MagicaWindZone.cs new file mode 100644 index 00000000..9ac5a70b --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/Wind/MagicaWindZone.cs @@ -0,0 +1,204 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// Wind zone + /// + [AddComponentMenu("MagicaCloth2/MagicaWindZone")] + [HelpURL("https://magicasoft.jp/en/mc2_windzone_component/")] + public class MagicaWindZone : ClothBehaviour + { + public enum Mode + { + /// + /// 領ċŸŸ‚’ĉŒŸŞ„ċ…¨ä½“Ğċ½ħ響™‚‹é˘¨ + /// Wind that affects the whole without area. + /// + GlobalDirection = 0, + + /// + /// 球ċž‹é ˜ċŸŸ‚’ĉŒ¤ĉ–ıċ‘風 + /// Directional wind with spherical area. + /// + SphereDirection = 1, + + /// + /// ƒœƒƒ‚Ż‚ıċž‹é ˜ċŸŸ‚’ĉŒ¤ĉ–ıċ‘風 + /// + BoxDirection = 2, + + /// + /// 球ċž‹é ˜ċŸŸ‚’ĉŒ¤ĉ”ċ°„風 + /// Directional wind with box area. + /// + SphereRadial = 10, + } + + /// + /// Zone mode. + /// [OK] Runtime changes. + /// + public Mode mode = Mode.GlobalDirection; + + /// + /// Box size. + /// [OK] Runtime changes. + /// + public Vector3 size = new Vector3(10.0f, 10.0f, 10.0f); + + /// + /// Sphere size. + /// [OK] Runtime changes. + /// + public float radius = 10.0f; + + /// + /// ƒĦ‚¤ƒ³é˘¨ċŠ› + /// main wind (m/s). + /// [OK] Runtime changes. + /// + [Range(0, 30)] + public float main = 5.0f; + + /// + /// äıħĉµçއ + /// turbulence rate. + /// [OK] Runtime changes. + /// + [Range(0.0f, 1.0f)] + public float turbulence = 1.0f; + + /// + /// 風ĉ–ıċ‘X角ċşĤïĵˆƒ­ƒĵ‚ЃĞ角ċşĤïĵ‰ + /// wind direction x angle (local angle). + /// [OK] Runtime changes. + /// + [Range(-180, 180)] + public float directionAngleX = 0; + + /// + /// 風ĉ–ıċ‘Y角ċşĤïĵˆƒ­ƒĵ‚ЃĞ角ċşĤïĵ‰ + /// wind direction y angle (local angle). + /// [OK] Runtime changes. + /// + [Range(-180, 180)] + public float directionAngleY = 0; + + /// + /// ĉ”ċ°„風ĉ¸›èĦ° + /// Radiation wind attenuation. + /// [OK] Runtime changes. + /// + public AnimationCurve attenuation = AnimationCurve.EaseInOut(0.0f, 1.0f, 1.0f, 0.0f); + + /// + /// äğ–é˘¨ċ½ħ響‚’ç„ĦċŠıĞ›šĞèż½ċŠ ™‚‹ƒ•ƒİ‚° + /// Flags to add without disabling other wind effects. + /// [OK] Runtime changes. + /// + public bool isAddition = false; + + //========================================================================================= + /// + /// 風ƒžƒƒĵ‚¸ƒ£ƒ‡ƒĵ‚ż¸ċ‚ç…§‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı(-1=ç„ĦċŠı) + /// Reference index to wind manager data (-1=disabled). + /// + public int WindId { get; private set; } = -1; + + + //========================================================================================= + protected void Awake() + { + WindId = MagicaManager.Wind.AddWind(this); + } + + protected void OnEnable() + { + MagicaManager.Wind.SetEnable(WindId, true); + } + + protected void OnDisable() + { + MagicaManager.Wind?.SetEnable(WindId, false); + } + + protected void OnDestroy() + { + MagicaManager.Wind?.RemoveWind(WindId); + WindId = -1; + } + + //========================================================================================= + /// + /// ĉ–ıċ‘風‹ċˆ¤ċš™‚‹ + /// whether the zone has directional winds. + /// + /// + public bool IsDirection() + { + switch (mode) + { + case Mode.GlobalDirection: + case Mode.SphereDirection: + case Mode.BoxDirection: + return true; + default: + return false; + } + } + + /// + /// ĉ”ċ°„風‹ċˆ¤ċš™‚‹ + /// whether the zone has radiant winds. + /// + /// + public bool IsRadial() + { + switch (mode) + { + case Mode.SphereRadial: + return true; + default: + return false; + } + } + + /// + /// èż½ċŠ •‚Œ‚‹é˘¨‹ċˆ¤ċš™‚‹ + /// Whether it is a wind of additional system. + /// + /// + public bool IsAddition() => isAddition; + + /// + /// ĉ–ıċ‘ĉ€§é˘¨é˘¨ċ‘‚’ċ–ċ—™‚‹ + /// Get the direction of the directional wind. + /// + /// + /// + public Vector3 GetWindDirection(bool localSpace = false) + { + var lq = Quaternion.Euler(directionAngleX, directionAngleY, 0.0f); + var ldir = lq * Vector3.forward; + return localSpace ? ldir : transform.TransformDirection(ldir); + } + + /// + /// ĉ–ıċ‘ĉ€§é˘¨é˘¨ċ‘‚’設ċš™‚‹ + /// Set the wind direction for directional wind. + /// + /// + /// + public void SetWindDirection(Vector3 dir, bool localSpace = false) + { + Vector3 lv = localSpace ? dir : transform.InverseTransformDirection(dir); + var angles = Quaternion.FromToRotation(Vector3.forward, lv).eulerAngles; + directionAngleX = angles.x > 180 ? angles.x - 360 : angles.x; + directionAngleY = angles.y > 180 ? angles.y - 360 : angles.y; + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/Wind/MagicaWindZone.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Cloth/Wind/MagicaWindZone.cs.meta new file mode 100644 index 00000000..9a492d22 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/Wind/MagicaWindZone.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: c2e01f3f330fcf34eb7f2aa7b311cee5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {fileID: 2800000, guid: 28008cd7b4b7bb24482a4260fbe8c25e, type: 3} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Cloth/Wind/MagicaWindZone.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/Wind/WindParams.cs b/Assets/MagicaCloth2/Scripts/Core/Cloth/Wind/WindParams.cs new file mode 100644 index 00000000..5c0f483c --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/Wind/WindParams.cs @@ -0,0 +1,36 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp + +namespace MagicaCloth2 +{ + /// + /// 風èŞżĉ•´ç”¨ƒ‘ƒİƒĦƒĵ‚ż + /// + public struct WindParams : IValid + { + public float influence; + public float frequency; + public float turbulence; + public float blend; + public float synchronization; + public float depthWeight; + public float movingWind; + + public void Convert(WindSettings sdata, ClothProcess.ClothType clothType) + { + influence = sdata.influence; + frequency = sdata.frequency; + turbulence = sdata.turbulence; + blend = sdata.blend; + synchronization = sdata.synchronization; + depthWeight = sdata.depthWeight; + movingWind = sdata.movingWind; + } + + public bool IsValid() + { + return influence > Define.System.Epsilon; + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/Wind/WindParams.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Cloth/Wind/WindParams.cs.meta new file mode 100644 index 00000000..80de01ea --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/Wind/WindParams.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 7aeb50197bc0c754d953e215c45b7c34 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Cloth/Wind/WindParams.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/Wind/WindSettings.cs b/Assets/MagicaCloth2/Scripts/Core/Cloth/Wind/WindSettings.cs new file mode 100644 index 00000000..e2f10f91 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/Wind/WindSettings.cs @@ -0,0 +1,109 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// é˘¨èŞżĉ•´ç”¨‚·ƒŞ‚˘ƒİ‚¤‚şƒ‡ƒĵ‚ż + /// Serialized data for wind adjustment. + /// + [System.Serializable] + public class WindSettings : IValid, IDataValidate + { + /// + /// ċ…¨ä½“ċ½ħ響率(1.0=100%) + /// Overall impact rate (1.0=100%). + /// [OK] Runtime changes. + /// [OK] Export/Import with Presets + /// + [Range(0.0f, 2.0f)] + public float influence = 1.0f; + + /// + /// ĉş‚Œċ‘¨ĉœŸïĵˆċ€¤‚’ċ¤§™‚‹¨ċ‘¨ĉœŸŒé€ŸŞ‚‹ïĵ‰ + /// Period of shaking (the higher the value, the faster the period). + /// [OK] Runtime changes. + /// [OK] Export/Import with Presets + /// + [Range(0.0f, 2.0f)] + public float frequency = 1.0f; + + /// + /// äıħĉµçއ + /// turbulence rate. + /// [OK] Runtime changes. + /// [OK] Export/Import with Presets + /// + [Range(0.0f, 2.0f)] + public float turbulence = 1.0f; + + /// + /// Sinĉ³˘¨Noiseĉ³˘ƒ–ƒĴƒ³ƒ‰çއ(0.0:sin ~ 1.0:noise) + /// Blend ratio of sine wave and noise wave (0.0:sin ~ 1.0:noise). + /// [OK] Runtime changes. + /// [OK] Export/Import with Presets + /// + [Range(0.0f, 1.0f)] + public float blend = 0.7f; + + /// + /// ƒ™ƒĵ‚ıƒİ‚¤ƒ³”¨ċŒĉœŸçއ + /// Synchronization rate by baseline. + /// [OK] Runtime changes. + /// [OK] Export/Import with Presets + /// + [Range(0.0f, 1.0f)] + public float synchronization = 0.7f; + + /// + /// ĉ·ħ•ċ½ħ響率 + /// Depth influence factor. + /// [OK] Runtime changes. + /// [OK] Export/Import with Presets + /// + [Range(0.0f, 1.0f)] + public float depthWeight = 0.0f; + + /// + /// ç§ğċ‹•ĉ™‚é˘¨é€Ÿ + /// Wind speed when moving. + /// [OK] Runtime changes. + /// [OK] Export/Import with Presets + /// + [Range(0.0f, 10.0f)] + public float movingWind = 0.0f; + + //========================================================================================= + public bool IsValid() + { + return influence > Define.System.Epsilon; + } + + public void DataValidate() + { + influence = Mathf.Clamp(influence, 0.0f, 2.0f); + frequency = Mathf.Clamp(frequency, 0.0f, 2.0f); + turbulence = Mathf.Clamp(turbulence, 0.0f, 2.0f); + blend = Mathf.Clamp01(blend); + synchronization = Mathf.Clamp01(synchronization); + depthWeight = Mathf.Clamp01(depthWeight); + movingWind = Mathf.Clamp(movingWind, 0.0f, 10.0f); + } + + public WindSettings Clone() + { + return new WindSettings() + { + influence = influence, + frequency = frequency, + turbulence = turbulence, + blend = blend, + synchronization = synchronization, + depthWeight = depthWeight, + movingWind = movingWind, + }; + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Cloth/Wind/WindSettings.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Cloth/Wind/WindSettings.cs.meta new file mode 100644 index 00000000..7080af79 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Cloth/Wind/WindSettings.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: ebacab05b884faa4886e2d90ca2f7d48 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Cloth/Wind/WindSettings.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Define.meta b/Assets/MagicaCloth2/Scripts/Core/Define.meta new file mode 100644 index 00000000..91aeb7d2 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Define.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 719b7a2fc5935ff438c1e1e6528027b9 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Scripts/Core/Define/ResultDefine.cs b/Assets/MagicaCloth2/Scripts/Core/Define/ResultDefine.cs new file mode 100644 index 00000000..b81b1a95 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Define/ResultDefine.cs @@ -0,0 +1,182 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp + +namespace MagicaCloth2 +{ + public static partial class Define + { + public enum Result + { + None = 0, + + /// + /// It is not an error, but the data is empty. + /// + Empty = 1, + + Success = 2, + Cancel = 3, + Process = 4, + + /////////////////////////////////////////////////////////////////// + // State(1000 - 9999) + /////////////////////////////////////////////////////////////////// + //EmptyData = 1000, + //Init_Complete = 1000, + //Cloth_Running = 2000, + + /////////////////////////////////////////////////////////////////// + // Warning(10000 - 19999) + /////////////////////////////////////////////////////////////////// + Warning = 10000, + + RenderMesh_UnknownWarning = 10100, + RenderMesh_VertexWeightIs5BonesOrMore, + + Init_NonUniformScale = 10200, + + /////////////////////////////////////////////////////////////////// + // Error(20000 - ) + /////////////////////////////////////////////////////////////////// + Error = 20000, + + // Validating serialized data + SerializeData_InvalidData = 20050, + SerializeData_Over31Renderers, + SerializeData_DuplicateRootBone, + SerializeData_DuplicateRenderer, + + // init + Init_InvalidData = 20100, + Init_InvalidPaintMap, + Init_PaintMapNotReadable, + Init_ScaleIsZero, + Init_NegativeScale, + + // RenderSetup + RenderSetup_Exception = 20200, + RenderSetup_UnknownError, + RenderSetup_InvalidSource, + RenderSetup_NoMeshOnRenderer, + RenderSetup_InvalidType, + RenderSetup_Unreadable, + RenderSetup_Over65535vertices, + + // VirtualMesh + VirtualMesh_UnknownError = 20300, + VirtualMesh_InvalidSetup, + VirtualMesh_InvalidRenderData, + VirtualMesh_ImportError, + VirtualMesh_SelectionException, + VirtualMesh_SelectionUnknownError, + VirtualMesh_InvalidSelection, + + // Create Cloth + CreateCloth_Exception = 20400, + CreateCloth_UnknownError, + CreateCloth_InvalidCloth, + CreateCloth_InvalidSerializeData, + CreateCloth_InvalidSetupList, + CreateCloth_NoRenderer, + CreateCloth_InvalidPaintMap, + CreateCloth_PaintMapNotReadable, + CreateCloth_PaintMapCountMismatch, + CreateCloth_CanNotStart, + CreateCloth_VertexAttributeListCountMismatch, + CreateCloth_VertexAttributeListIsNull, + CreateCloth_VertexAttributeListDataMismatch, + CreateCloth_InvalidVertexAttributeData, + + // Reduction + Reduction_Exception = 20500, + Reduction_UnknownError, + Reduction_InitError, + Reduction_SameDistanceException, + Reduction_SimpleDistanceException, + Reduction_ShapeDistanceException, + Reduction_MaxSideLengthZero, + Reduction_OrganizationError, + Reduction_StoreVirtualMeshError, + Reduction_CalcAverageException, + + // Optimize + Optimize_Exception = 20600, + + // ProxyMesh + ProxyMesh_Exception = 20700, + ProxyMesh_UnknownError, + ProxyMesh_ApplySelectionError, + ProxyMesh_ConvertError, + ProxyMesh_Over32767Vertices, + ProxyMesh_Over32767Edges, + ProxyMesh_Over32767Triangles, + + // MappingMesh + MappingMesh_Exception = 20800, + MappingMesh_UnknownError, + MappingMesh_ProxyError, + + // ClothInit + ClothInit_Exception = 22000, + ClothInit_FailedAddRenderer, + + // ClothProcess + ClothProcess_Exception = 22100, + ClothProcess_UnknownError, + ClothProcess_Invalid, + ClothProcess_InvalidRenderHandleList, + ClothProcess_GenerateSelectionError, + ClothProcess_OverflowTeamCount4096, + + // Constraint + Constraint_Exception = 22200, + Constraint_UnknownError, + Constraint_CreateDistanceException, + Constraint_CreateTriangleBendingException, + Constraint_CreateInertiaException, + Constraint_CreateSelfCollisionException, + + // MagicaMesh + MagicaMesh_UnknownError = 22500, + MagicaMesh_Invalid, + MagicaMesh_InvalidRenderer, + MagicaMesh_InvalidMeshFilter, + + // PreBuildData + PreBuildData_UnknownError = 22600, + PreBuildData_MagicaClothException, + PreBuildData_VirtualMeshDeserializationException, + PreBuildData_VerificationResult, + PreBuildData_VersionMismatch, + PreBuildData_InvalidClothData, + PreBuildData_Empty, + PreBuildData_InvalidScale, + + // PreBuild + PreBuild_UnknownError = 22700, + PreBuild_Exception, + PreBuild_InvalidPreBuildData, + PreBuild_InvalidRenderSetupData, + PreBuild_SetupDeserializationError, + + // PreBuild Deserialization + Deserialization_UnknownError = 22800, + Deserialization_Exception, + + // Init SerializeData + InitSerializeData_UnknownError = 22900, + InitSerializeData_InvalidHash, + InitSerializeData_InvalidVersion, + InitSerializeData_InvalidSetupData, + InitSerializeData_ClothTypeMismatch, + InitSerializeData_SetupCountMismatch, + InitSerializeData_CustomSkinningBoneCountMismatch, + InitSerializeData_MeshClothSetupValidationError, + InitSerializeData_BoneClothSetupValidationError, + InitSerializeData_BoneSpringSetupValidationError, + InitSerializeData_DeserializationError, + InitSerializeData_InvalidCloneMesh, + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Define/ResultDefine.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Define/ResultDefine.cs.meta new file mode 100644 index 00000000..3d6bcf6c --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Define/ResultDefine.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 6565f8ffcbde83c40a754caa20db861a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Define/ResultDefine.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Define/SystemDefine.cs b/Assets/MagicaCloth2/Scripts/Core/Define/SystemDefine.cs new file mode 100644 index 00000000..36f45a2d --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Define/SystemDefine.cs @@ -0,0 +1,430 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using Unity.Mathematics; + +namespace MagicaCloth2 +{ + public static partial class Define + { + /// + /// ‚·‚ıƒ†ƒ é–˘é€£ƒ‡ƒ•‚Ħ‚¤ƒ³ + /// + public static class System + { + /// + /// ƒ—ƒ­‚¸‚§‚Żƒˆ‚ğƒƒƒ†‚£ƒ³‚°Ğç™ğ録™‚‹Define‚·ƒ³ƒœƒĞ + /// + public const string DefineSymbol = "MAGICACLOTH2"; + + /// + /// çċœ¨ĉœ‰ċŠıŞPreBuildĉœ€ĉ–°ƒƒĵ‚¸ƒ§ƒ³ + /// + public const int LatestPreBuildVersion = 2; + + /// + /// 計痂’省畁™‚‹ĉœ€ċ°ĉµċ‹•ċ°ĉ•°ç‚ıĉ•° + /// + public const float Epsilon = 1e-8f; + + /// + /// MeshCloth§è¨­ċšċŻèƒ½Şĉœ€ċ¤§ƒĴƒ³ƒ€ƒİƒĵĉ•° + /// + public const int MaxRendererCount = 31; + + /// + /// ĉœ€ċ°‚°ƒŞƒƒƒ‰‚µ‚¤‚şċšçİ(GridSize=0Żċ‹•作—Ş„Ÿ‚) + /// + public const float MinimumGridSize = 0.00001f; + + /// + /// 生ĉˆ§‚‹ƒƒĵƒ ĉ•° + /// + public const int MaximumTeamCount = 4096; + + /// + /// ‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ċ‘¨ĉ³˘ĉ•°ċˆĉœŸċ€¤ + /// + public const int DefaultSimulationFrequency = 90; + + /// + /// ‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ċ‘¨ĉ³˘ĉ•°ĉœ€ċ°ċ€¤ + /// + public const int SimulationFrequency_Low = 30; + + /// + /// ‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ċ‘¨ĉ³˘ĉ•°ĉœ€ċ¤§ċ€¤ + /// + public const int SimulationFrequency_Hi = 150; + + /// + /// 1ƒ•ƒĴƒĵƒ §ĉœ€ċ¤§ĉ›´ĉ–°ċ›žĉ•°ċˆĉœŸċ€¤ + /// + public const int DefaultMaxSimulationCountPerFrame = 3; + + /// + /// 1ƒ•ƒĴƒĵƒ §ĉœ€ċ¤§ĉ›´ĉ–°ċ›žĉ•°ĉœ€ċ° + /// + public const int MaxSimulationCountPerFrame_Low = 1; + + /// + /// 1ƒ•ƒĴƒĵƒ §ĉœ€ċ¤§ĉ›´ĉ–°ċ›žĉ•°ĉœ€ċ¤§ + /// + public const int MaxSimulationCountPerFrame_Hi = 5; + + /// + /// ĉ³•ç·šĉ•´ċˆ—ĉ™‚ĞċŒä¸€é˘ïĵˆƒĴ‚¤ƒ¤ƒĵïĵ‰¨—Ĥċˆ¤ċš™‚‹éš£ĉŽƒˆƒİ‚¤‚˘ƒ³‚°ƒĞŞ™è§’ïĵˆƒ‡‚°ƒŞƒĵïĵ‰ + /// + public const float SameSurfaceAngle = 80.0f; + + /// + /// ĉœŞĉäşˆĉ¸Ĵĉ™‚ƒĞƒĵƒˆ‹‚‰è·é›˘ċˆĥ限ċ€çއ + /// + public const float MaxDistanceRatioFutuerPrediction = 1.3f; + + /// + /// ċˆ†ċ‰²‚¸ƒ§ƒ–‚’éİ用™‚‹ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒƒĦƒƒ‚·ƒé ‚ç‚ıĉ•° + /// + public const int SplitProxyMeshVertexCount = 300; + + /// + /// [Reduction] + /// ĉœ‰ċŠıƒ•ƒİ‚°€‚ċ¸¸Ğtrue¨™‚‹€‚ + /// + public const bool ReductionEnable = true; + + /// + /// [Reduction] + /// ċŒä¸€é ‚ç‚ı¨—Ĥċˆ¤ċš™‚‹è·é›˘(AABBĉœ€ċ¤§è·é›˘%)(0.0 ~ 1.0) + /// + public const float ReductionSameDistance = 0.001f; + + /// + /// [Reduction] + /// ĉµċŠ›ƒİ‚¤ƒ³‚’作‚‰Ş„ĉŽçĥš‚’èĦŒ† + /// + public const bool ReductionDontMakeLine = true; + + /// + /// [Reduction] + /// 結ċˆé ‚ç‚ıä½ç½èŞżĉ•´ + /// (0.0=ĉŽçĥšé ‚ç‚ıĉ•°ċ¤š„ğİċ‹•‹Ş„, 1.0=ċŒċ…¨Ğċı³ċ‡ċŒ–) + /// + public const float ReductionJoinPositionAdjustment = 1.0f; + + /// + /// [Reduction] + /// ĉœ€ċ¤§‚ıƒ†ƒƒƒ—ċ›žĉ•° + /// + public const int ReductionMaxStep = 100; + + /// + /// [ProxyMesh] + /// ĉœ‰ċŠıŞĉœ€ċ¤§é ‚ç‚ıĉ•° + /// + public const int MaxProxyMeshVertexCount = 32767; + + /// + /// [ProxyMesh] + /// ĉœ‰ċŠıŞĉœ€ċ¤§‚¨ƒƒ‚¸ĉ•° + /// + public const int MaxProxyMeshEdgeCount = 32767; + + /// + /// [ProxyMesh] + /// ĉœ‰ċŠıŞĉœ€ċ¤§ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĉ•° + /// + public const int MaxProxyMeshTriangleCount = 32767; + + /// + /// [ProxyMesh] + /// ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞƒš‚˘¨ċˆ¤ċš™‚‹è§’ċşĤ(Deg) + /// + public const float ProxyMeshTrianglePairAngle = 20.0f; + + /// + /// [ProxyMesh] + /// BoneClothMeshĉŽçĥšĉ™‚Ğƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ¨—Ĥċˆ¤ĉ–­•‚Œ‚‹ċ†…è§’ + /// + public const float ProxyMeshBoneClothTriangleAngle = 120.0f; + + /// + /// [Simulation] + /// ĉ‘İĉ“Ĥ(0.0 ~ 1.0)Ğċ݁™‚‹ċ˘—ċŠ é‡é‡ + /// + public const float FrictionMass = 3.0f; + + /// + /// [Simulation] + /// ĉ·ħ•(0.0 ~ 1.0)Ğċ݁™‚‹ċ˘—ċŠ é‡é‡(ĉ·ħ•0.0¨Ğĉœ€ċ¤§ĞŞ‚‹ïĵ‰ + /// + public const float DepthMass = 5.0f; + + /// + /// [Simulation] + /// ‚ıƒ†ƒƒƒ—”¨ĉ‘İĉ“Ĥĉ¸›èĦ°çއ + /// + public const float FrictionDampingRate = 0.6f; + + /// + /// [Simulation] + /// ‚˘ƒˆƒŸƒƒ‚ŻċŠ ç—Ğ‚ˆ‚‹ç§ğċ‹•ƒ™‚ŻƒˆƒĞċı³ċ‡ċŒ–Ğä½żç”¨™‚‹ċŠ ç—ĉ•°Ğċ݁™‚‹ĉŒ‡ĉ•° + /// + public const float PositionAverageExponent = 0.5f; // 0.5? + + /// + /// [Simulation] + /// ĉœŞĉäşˆĉ¸ĴĞ用„‚‹ċŸé€ŸċşĤĉœ€ċ¤§é€ŸċşĤ‚Żƒİƒ³ƒ—(m/s) + /// “‚ŒŻ‚ğƒĞƒ•‚³‚¸ƒ§ƒ³Şİ§ĉ„ċ›³—Ş„èĦ¨ç¤şçށĉŠœ‘‚’防ĉ­˘™‚‹Ÿ‚Ğċż…èĤïĵ + /// + public const float MaxRealVelocity = 0.5f; + + /// + /// [Simulation] + /// ƒ‘ƒĵƒ†‚£‚ŻƒĞĉœ€ċ¤§é€ŸċşĤ(m/s) + /// + //public const float ParticleSpeedLimit = 3.0f; + + /// + /// [Tether] + /// 縁żċ‰›ĉ€§(0.0 ~ 1.0) + /// + public const float TetherCompressionStiffness = 1.0f; // 0.1? + + /// + /// [Tether] + /// äĵ¸³ċ‰›ĉ€§(0.0 ~ 1.0) + /// + public const float TetherStretchStiffness = 1.0f; // 1.0f? + + /// + /// [Tether] + /// ĉœ€ċ¤§ĉ‹Ħċ¤§ċ‰²ċˆ(0.0 ~ 1.0) + /// 0.0=ĉ‹Ħċ¤§—Ş„ + /// + public const float TetherStretchLimit = 0.03f; // 0.0? + + /// + /// [Tether] + /// stiffnessƒ•‚§ƒĵƒ‰çŻ„ċ›²(0.0 ~ 1.0) + /// + public const float TetherStiffnessWidth = 0.3f; // 0.2? + + /// + /// [Tether] + /// ĉ‹Ħċ¤§ĉ™‚é€ŸċşĤĉ¸›èĦ°(0.0 ~ 1.0) + /// + public const float TetherCompressionVelocityAttenuation = 0.7f; + + /// + /// [Tether] + /// ç¸ċ°ĉ™‚é€ŸċşĤĉ¸›èĦ°(0.0 ~ 1.0) + /// + public const float TetherStretchVelocityAttenuation = 0.7f; // 0.9f? + + /// + /// [Distance] + /// 速ċşĤĉ¸›èĦ°(0.0 ~ 1.0) + /// + public const float DistanceVelocityAttenuation = 0.3f; + + /// + /// [Distance] + /// ç¸ĤĉŽçĥšċ‰›ĉ€§(0.0 ~ 1.0) + /// + public const float DistanceVerticalStiffness = 1.0f; + + /// + /// [Distance] + /// ĉ¨ŞŠ‚ˆ³ShearĉŽçĥšċ‰›ĉ€§(0.0 ~ 1.0) + /// + public const float DistanceHorizontalStiffness = 0.5f; + + /// + /// [Triangle Bending] + /// TriangleBend‚’ċ½˘ĉˆ™‚‹ĉœ€ċ¤§è§’ċşĤ + /// + public const float TriangleBendingMaxAngle = 120.0f; // 145? + + /// + /// [Volume] + /// Volume‚’ċ½˘ĉˆ™‚‹ĉœ€ċ°Triangleƒš‚˘è§’ċşĤ + /// + public const float VolumeMinAngle = 90.0f; + + /// + /// [Angle Limit] + /// 角ċşĤċˆĥ限ĉœ€ċ¤§è§’ċşĤ(deg) + /// + public const float MaxAngleLimit = 179.0f; + + /// + /// [Angle Limit] + /// ċċİċ›žĉ•° + /// + public const int AngleLimitIteration = 3; + + /// + /// [Angle Limit] + /// 速ċşĤĉ¸›èĦ°(0.0 ~ 1.0) + /// + public const float AngleLimitAttenuation = 0.9f; + + /// + /// [Inertia] + /// 設ċš§‚‹ĉœ€ċ¤§ç§ğċ‹•速ċşĤ(m/s) + /// + public const float MaxMovementSpeedLimit = 10.0f; + + /// + /// [Inertia] + /// 設ċš§‚‹ĉœ€ċ¤§ċ›žèğ˘é€ŸċşĤ(deg/s) + /// + public const float MaxRotationSpeedLimit = 1440.0f; + + /// + /// [Inertia] + /// 設ċš§‚‹ĉœ€ċ¤§ƒ‘ƒĵƒ†‚£‚ŻƒĞç§ğċ‹•速ċşĤ(m/s) + /// + public const float MaxParticleSpeedLimit = 10.0f; + + /// + /// [Collider Collision] + /// 一ċşĤĞĉ‹Ħċĵµ™‚‹‚³ƒİ‚¤ƒ€ƒĵĉ•° + /// + public const int ExpandedColliderCount = 8; + + /// + /// [Collider Collision] + /// 設ċšfrictionĞċ݁™‚‹DynamicFrictionċ‰²ċˆ(0.0 ~ 1.0) + /// + public const float ColliderCollisionDynamicFrictionRatio = 1.0f; + + /// + /// [Collider Collision] + /// 設ċšfrictionĞċ݁™‚‹StaticFrictionċ‰²ċˆ(0.0 ~ 1.0) + /// + public const float ColliderCollisionStaticFrictionRatio = 1.0f; + + /// + /// [Collider Collision] + /// 速ċşĤĉ¸›èĦ°(0.0 ~ 1.0) + /// + //public const float ColliderCollisionVelocityAttenuation = 0.0f; + + /// + /// [Custom Skinning] + /// ƒœƒĵƒ³ƒİ‚¤ƒ³‹‚‰è§’ċşĤĞ‚ˆ‚‹ĉ¸›èĦ°çއ(0.0~1.0) + /// + public const float CustomSkinningAngularAttenuation = 1.0f; + + /// + /// [Custom Skinning] + /// ĉœ€èż‘ƒ‚¤ƒ³ƒˆ‚Ĥ‚¨‚¤ƒˆċĵ·ċşĤ(0.0~1.0) + /// + public const float CustomSkinningDistanceReduction = 0.6f; + + /// + /// [Custom Skinning] + /// è·é›˘Ğ‚ˆ‚Š‚Ĥ‚¨‚¤ƒˆĉ¸›èĦ°äı—ĉ•°( „Ÿ„0.1 ~ 5.0) + /// + public const float CustomSkinningDistancePow = 2.0f; + + /// + /// [Self Collision] + /// ċċİċ›žĉ•° + /// + public const int SelfCollisionSolverIteration = 4; // 4 + + /// + /// [Self Collision] + /// ç„ĦċŠı‚°ƒŞƒƒƒ‰ċş§ĉ¨™ + /// + public const int SelfCollisionIgnoreGrid = 1000000; + + /// + /// [Self Collision] + /// 交ċ·ċˆ¤ċšċˆ†ċ‰²ĉ•° + /// + public const int SelfCollisionIntersectDiv = 2; // 8 + + /// + /// [Self Collision] + /// ‚ğƒĞƒ•‚³ƒŞ‚¸ƒ§ƒ³è§£ĉħşĉ™‚ċ›şċšƒ‘ƒĵƒ†‚£‚ŻƒĞ重量 + /// + public const float SelfCollisionFixedMass = 100.0f; + + /// + /// [Self Collision] + /// ‚ğƒĞƒ•‚³ƒŞ‚¸ƒ§ƒ³è§£ĉħşĉ™‚ĉ‘İĉ“Ĥ1.0Ğċ݁™‚‹é‡é‡ + /// + public const float SelfCollisionFrictionMass = 10.0f; + + /// + /// [Self Collision] + /// ‚ğƒĞƒ•‚³ƒŞ‚¸ƒ§ƒ³ƒƒĵƒ é‡é‡äż‚ĉ•° + /// + public const float SelfCollisionClothMass = 50.0f; + + /// + /// [Self Collision] + /// ċŽšż(thickness)Ğċ݁™‚‹SCR‚ı‚ħƒĵƒĞ + /// + public const float SelfCollisionSCR = 2.0f; // 1.0 + + /// + /// [Self Collision] + /// PointTriangleĉœ‰ċŠıċˆ¤ċšè§’ċşĤ(deg) + /// + public static readonly float SelfCollisionPointTriangleAngleCos = math.cos(math.radians(60.0f)); + + /// + /// [Self Collision] + /// Thicknessĉœ€ċ°ċ€¤(m) + /// + public const float SelfCollisionThicknessMin = 0.001f; + + /// + /// [Self Collision] + /// Thicknessĉœ€ċ¤§ċ€¤(m) + /// + public const float SelfCollisionThicknessMax = 0.05f; + + /// + /// [Wind] + /// 風ĉ™‚é–“ĉœ€ċ¤§ċ€¤ + /// + public const float WindMaxTime = 10000.0f; + + /// + /// [Wind] + /// 風速係ĉ•°ċŸşĉş–¨Ş‚‹é˘¨é€Ÿ(m/s) + /// + public const float WindBaseSpeed = 7.5f; + + /// + /// [Spring] + /// BoneSpringċˆİ用ĉ™‚DistanceConstraintStiffnessċ€¤ + /// + public const float BoneSpringDistanceStiffness = 0.5f; + + /// + /// [Spring] + /// BoneSpringċˆİ用ĉ™‚TetherConstraintCompressionLimitċ€¤ + /// + public const float BoneSpringTetherCompressionLimit = 0.8f; + + /// + /// [Spring] + /// BoneSpringċˆİ用ĉ™‚frictionċ€¤ + /// + public const float BoneSpringCollisionFriction = 0.5f; + + /// + /// [Culling] + /// è·é›˘‚Ѓރ³‚°ĉœ€ċ¤§è·é›˘ + /// + public const float DistanceCullingMaxLength = 100.0f; + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Define/SystemDefine.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Define/SystemDefine.cs.meta new file mode 100644 index 00000000..4f119115 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Define/SystemDefine.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 3b695911c4ac0604d93d387125306f9c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Define/SystemDefine.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Interface.meta b/Assets/MagicaCloth2/Scripts/Core/Interface.meta new file mode 100644 index 00000000..cae01c76 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Interface.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d7576f015bd32cb42aae4c953bd8dcc0 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Scripts/Core/Interface/ICount.cs b/Assets/MagicaCloth2/Scripts/Core/Interface/ICount.cs new file mode 100644 index 00000000..121c7f4d --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Interface/ICount.cs @@ -0,0 +1,14 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp + +namespace MagicaCloth2 +{ + /// + /// ƒ‡ƒĵ‚ż‚Ğ‚Ĥƒ³ƒˆ‚’èż”™‚¤ƒ³‚żƒĵƒ•‚§ƒĵ‚ı + /// + interface ICount + { + int Count(); + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Interface/ICount.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Interface/ICount.cs.meta new file mode 100644 index 00000000..9eb00b88 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Interface/ICount.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 8ec05c78959350f489fd922165a79ad1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Interface/ICount.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Interface/IDataValidate.cs b/Assets/MagicaCloth2/Scripts/Core/Interface/IDataValidate.cs new file mode 100644 index 00000000..2c58f954 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Interface/IDataValidate.cs @@ -0,0 +1,14 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp + +namespace MagicaCloth2 +{ + /// + /// ċŻèħĦƒ‡ƒĵ‚żĉ¤œè¨ĵ‚’èĦŒ†‚¤ƒ³‚żƒĵƒ•‚§ƒĵ‚ı + /// + interface IDataValidate + { + void DataValidate(); + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Interface/IDataValidate.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Interface/IDataValidate.cs.meta new file mode 100644 index 00000000..c3b853d1 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Interface/IDataValidate.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 2aed426981579da48863288c708602e1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Interface/IDataValidate.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Interface/ITransform.cs b/Assets/MagicaCloth2/Scripts/Core/Interface/ITransform.cs new file mode 100644 index 00000000..44d55c95 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Interface/ITransform.cs @@ -0,0 +1,25 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System.Collections.Generic; +using UnityEngine; + +namespace MagicaCloth2 +{ + interface ITransform + { + /// + /// ċˆİ用—Ĥ„‚‹™ıĤƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ‚’transformSetĞèż½ċŠ ™‚‹ + /// + /// + void GetUsedTransform(HashSet transformSet); + + /// + /// ċˆİ用—Ĥ„‚‹ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ‚’ç½ĉ›™‚‹ + /// key:ç½ĉ›ċŻèħĦƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ‚¤ƒ³‚ı‚żƒ³‚ıID + /// value:ċ…‚Œĉ›żˆ‚‹ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ  + /// + /// + void ReplaceTransform(Dictionary replaceDict); + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Interface/ITransform.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Interface/ITransform.cs.meta new file mode 100644 index 00000000..c9f138ef --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Interface/ITransform.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 858cfe74dc6869c45a9b36ce74ac38fd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Interface/ITransform.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Interface/IValid.cs b/Assets/MagicaCloth2/Scripts/Core/Interface/IValid.cs new file mode 100644 index 00000000..1de6a5a7 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Interface/IValid.cs @@ -0,0 +1,14 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp + +namespace MagicaCloth2 +{ + /// + /// ċŻèħĦĉœ‰ċŠıĉ€§‚’èż”™‚¤ƒ³‚żƒĵƒ•‚§ƒĵ‚ı + /// + interface IValid + { + bool IsValid(); + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Interface/IValid.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Interface/IValid.cs.meta new file mode 100644 index 00000000..532b2cd7 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Interface/IValid.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: eb1ee379472ac3645b05adb8c510f7d5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Interface/IValid.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager.meta b/Assets/MagicaCloth2/Scripts/Core/Manager.meta new file mode 100644 index 00000000..b8cbb6c6 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 492826d943669524b9276f8ff4cd1229 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/Cloth.meta b/Assets/MagicaCloth2/Scripts/Core/Manager/Cloth.meta new file mode 100644 index 00000000..b2c99317 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/Cloth.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: db324c6d33cc19149bd3825ccfe7d94a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/Cloth/ClothManager.cs b/Assets/MagicaCloth2/Scripts/Core/Manager/Cloth/ClothManager.cs new file mode 100644 index 00000000..ae39b232 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/Cloth/ClothManager.cs @@ -0,0 +1,337 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System.Collections.Generic; +using System.Text; +using Unity.Jobs; +using Unity.Profiling; +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// ċ„‚Żƒ­‚ı‚³ƒ³ƒƒĵƒƒ³ƒˆĉ›´ĉ–°ċ‡Ĥ理 + /// + public class ClothManager : IManager, IValid + { + // ™ıĤ + internal HashSet clothSet = new HashSet(256); + + // BoneCloth,BoneSpring + internal HashSet boneClothSet = new HashSet(); + + // MeshCloth + internal HashSet meshClothSet = new HashSet(); + + //========================================================================================= + Dictionary animatorVisibleDict = new Dictionary(30); + Dictionary rendererVisibleDict = new Dictionary(100); + + //========================================================================================= + /// + /// ƒž‚ı‚żƒĵ‚¸ƒ§ƒ–ƒƒ³ƒ‰ƒĞ + /// + JobHandle masterJob = default; + + bool isValid = false; + + //========================================================================================= + public void Dispose() + { + isValid = false; + + clothSet.Clear(); + boneClothSet.Clear(); + meshClothSet.Clear(); + + // 作ĉ­ƒƒƒƒ•‚Ħ + animatorVisibleDict.Clear(); + rendererVisibleDict.Clear(); + + // ĉ›´ĉ–°ċ‡Ĥ理 + MagicaManager.afterEarlyUpdateDelegate -= OnEarlyClothUpdate; + MagicaManager.firstPreUpdateDelegate -= OnFirstPreUpdate; + MagicaManager.afterLateUpdateDelegate -= OnAfterLateUpdate; + MagicaManager.beforeLateUpdateDelegate -= OnBeforeLateUpdate; + } + + public void EnterdEditMode() + { + Dispose(); + } + + public void Initialize() + { + clothSet.Clear(); + boneClothSet.Clear(); + meshClothSet.Clear(); + + // 作ĉ­ƒƒƒƒ•‚Ħ + + // ĉ›´ĉ–°ċ‡Ĥ理 + MagicaManager.afterEarlyUpdateDelegate += OnEarlyClothUpdate; + MagicaManager.firstPreUpdateDelegate += OnFirstPreUpdate; + MagicaManager.afterLateUpdateDelegate += OnAfterLateUpdate; + MagicaManager.beforeLateUpdateDelegate += OnBeforeLateUpdate; + + isValid = true; + } + + public bool IsValid() + { + return isValid; + } + + //========================================================================================= + void ClearMasterJob() + { + masterJob = default; + } + + void CompleteMasterJob() + { + masterJob.Complete(); + } + + //========================================================================================= + internal int AddCloth(ClothProcess cprocess, in ClothParameters clothParams) + { + // “ĉµéšŽ§ProxyMeshŻċŒĉˆ—Ĥ„‚‹ + if (isValid == false) + return 0; + + // ƒƒĵƒ ç™ğ録 + var teamId = MagicaManager.Team.AddTeam(cprocess, clothParams); + if (teamId == 0) + return 0; + + clothSet.Add(cprocess); + switch (cprocess.clothType) + { + case ClothProcess.ClothType.BoneCloth: + case ClothProcess.ClothType.BoneSpring: + boneClothSet.Add(cprocess); + break; + case ClothProcess.ClothType.MeshCloth: + meshClothSet.Add(cprocess); + break; + default: + Develop.LogError($"Invalid cloth type! :{cprocess.clothType}"); + break; + } + + // ƒƒĵƒ ƒžƒƒĵ‚¸ƒ£ä½œĉ­ƒƒƒƒ•‚Ħ¸ç™ğ録 + MagicaManager.Team.comp2TeamIdMap.Add(cprocess.cloth.GetMagicaId(), teamId); + + return teamId; + } + + internal void RemoveCloth(ClothProcess cprocess) + { + if (isValid == false) + return; + + // ƒƒĵƒ è§£é™¤ + MagicaManager.Team.RemoveTeam(cprocess.TeamId); + + clothSet.Remove(cprocess); + boneClothSet.Remove(cprocess); + meshClothSet.Remove(cprocess); + } + + //========================================================================================= + /// + /// ƒ•ƒĴƒĵƒ é–‹ċ§‹ĉ™‚ĞċŸèĦŒ•‚Œ‚‹ĉ›´ĉ–°ċ‡Ĥ理 + /// + void OnEarlyClothUpdate() + { + //Debug.Log($"OnEarlyClothUpdate. F:{Time.frameCount}"); + if (MagicaManager.Team.TrueTeamCount > 0) // ‚Ѓރ³‚°ċˆ¤ċšŒ‚‚‹§Disableƒƒĵƒ ‚‚‚™ċż…èĤŒ‚‚‹ + { + // ‚ЃĦƒİ‚Ѓރ³‚°ĉ›´ĉ–° + if (MagicaManager.Team.ActiveTeamCount > 0) + { + // “ĉ›´ĉ–°ŻĉĴĦTransformċİċ…ƒċ‰ĞèĦŒ†ċż…èĤŒ‚‚‹ + MagicaManager.Team.CameraCullingPostProcess(); + } + + // BoneClothTransformċİċ…ƒĉ›´ĉ–° + ClearMasterJob(); + masterJob = MagicaManager.Bone.RestoreTransform(masterJob); + CompleteMasterJob(); + } + } + + /// + /// PreUpdate開ċ§‹ĉ™‚ĞċŸèĦŒ•‚Œ‚‹ĉ›´ĉ–°ċ‡Ĥ理 + /// + void OnFirstPreUpdate() + { + //Debug.Log($"OnFirstPreUpdate. F:{Time.frameCount}"); + if (MagicaManager.Team.TrueTeamCount > 0) // ‚Ѓރ³‚°ċˆ¤ċšŒ‚‚‹§Disableƒƒĵƒ ‚‚‚™ċż…èĤŒ‚‚‹ + { + //Debug.Log($"existFixedTeam:{MagicaManager.Bone.existFixedTeam.Value}"); + // FixedUpdateŒïĵċ›ž‹¤FixedTeamŒċ­˜ċœ¨™‚‹ċ ´ċˆż + if (MagicaManager.Time.FixedUpdateCount == 0 && MagicaManager.Bone.existFixedTeam.Value) + { + ClearMasterJob(); + masterJob = MagicaManager.Bone.RestoreBaseTransform(masterJob); + CompleteMasterJob(); + } + } + } + + void OnBeforeLateUpdate() + { + if (MagicaManager.Time.updateLocation == TimeManager.UpdateLocation.BeforeLateUpdate) + ClothUpdate(); + } + + void OnAfterLateUpdate() + { + if (MagicaManager.Time.updateLocation == TimeManager.UpdateLocation.AfterLateUpdate) + ClothUpdate(); + } + + //========================================================================================= + static readonly ProfilerMarker startClothUpdateTimeProfiler = new ProfilerMarker("StartClothUpdate.Time"); + static readonly ProfilerMarker startClothUpdateTeamProfiler = new ProfilerMarker("StartClothUpdate.Team"); + static readonly ProfilerMarker startClothUpdatePrePareProfiler = new ProfilerMarker("StartClothUpdate.Prepare"); + static readonly ProfilerMarker startClothUpdateScheduleProfiler = new ProfilerMarker("StartClothUpdate.Schedule"); + + /// + /// ‚Żƒ­‚ı‚³ƒ³ƒƒĵƒƒ³ƒˆĉ›´ĉ–° + /// + void ClothUpdate() + { + if (MagicaManager.IsPlaying() == false) + return; + + // ■‚³ƒ³ƒƒĵƒƒ³ƒˆïĵŞ‚‰çµ‚了 + var tm = MagicaManager.Team; + if (tm.TrueTeamCount == 0) + return; + + //----------------------------------------------------------------- + // ‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³é–‹ċ§‹‚¤ƒ™ƒ³ƒˆ + MagicaManager.OnPreSimulation?.Invoke(); + + //----------------------------------------------------------------- + var sm = MagicaManager.Simulation; + var bm = MagicaManager.Bone; + var wm = MagicaManager.Wind; + + //Debug.Log($"StartClothUpdate. F:{Time.frameCount}"); + //Develop.DebugLog($"StartClothUpdate. F:{Time.frameCount}, dtime:{Time.deltaTime}, stime:{Time.smoothDeltaTime}"); + + //----------------------------------------------------------------- + // ■ĉ™‚é–“ƒžƒƒĵ‚¸ƒ£ĉ›´ĉ–° + startClothUpdateTimeProfiler.Begin(); + MagicaManager.Time.FrameUpdate(); + startClothUpdateTimeProfiler.End(); + + // ■ċ¸¸ĞċŸèĦŒ™‚‹ƒƒĵƒ ĉ›´ĉ–° + startClothUpdateTeamProfiler.Begin(); + tm.AlwaysTeamUpdate(); + startClothUpdateTeamProfiler.End(); + + // ■““§ċŸèĦŒƒƒĵƒ ĉ•°ŒïĵŞ‚‰°çµ‚了 + if (tm.ActiveTeamCount == 0) + return; + + startClothUpdatePrePareProfiler.Begin(); + + // ■ċ¸¸ĞċŸèĦŒ™‚‹é˘¨‚ƒĵƒ³ĉ›´ĉ–° + wm.AlwaysWindUpdate(); + + // ■作ĉ­ƒƒƒƒ•‚Ħĉ›´ĉ–° + sm.WorkBufferUpdate(); + + startClothUpdatePrePareProfiler.End(); + + //----------------------------------------------------------------- + startClothUpdateScheduleProfiler.Begin(); + + // ƒž‚ı‚żƒĵ‚¸ƒ§ƒ–ċˆĉœŸċŒ– + ClearMasterJob(); + + // ■ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ĉƒ…ċ ħèŞ­żèĵż + masterJob = bm.ReadTransformSchedule(masterJob); + + // ■‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³‚¸ƒ§ƒ– + masterJob = sm.ClothSimulationSchedule(masterJob); + + startClothUpdateScheduleProfiler.End(); + //----------------------------------------------------------------- + //JobHandle.ScheduleBatchedJobs(); + + //----------------------------------------------------------------- + // ■‚¸ƒ§ƒ–ċŒäş†ċ…Ħé–“ĞèĦŒ†ċ‡Ĥ理 + // ‚ЃĦƒİ‚Ѓރ³‚°ĉş–ċ‚™ + tm.CameraCullingPreProcess(); + + //----------------------------------------------------------------- + // ■çċœ¨Żċ³ĉ™‚ċŸèĦŒŸ‚““§‚¸ƒ§ƒ–ċŒäş†ċ…Ħ‚’èĦŒ† + CompleteMasterJob(); + + //----------------------------------------------------------------- + // ‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³çµ‚了‚¤ƒ™ƒ³ƒˆ + MagicaManager.OnPostSimulation?.Invoke(); + } + + //========================================================================================= + internal void ClearVisibleDict() + { + animatorVisibleDict.Clear(); + rendererVisibleDict.Clear(); + } + + internal bool CheckVisible(Animator ani, List renderers) + { + if (ani) + { + MagicaObjectId id = ani.GetMagicaId(); + if (animatorVisibleDict.ContainsKey(id)) + return animatorVisibleDict[id]; + + bool visible = CheckRendererVisible(renderers); + animatorVisibleDict.Add(id, visible); + return visible; + } + else + { + return CheckRendererVisible(renderers); + } + } + + bool CheckRendererVisible(List renderers) + { + foreach (var ren in renderers) + { + if (ren) + { + bool visible; + MagicaObjectId id = ren.GetMagicaId(); + if (rendererVisibleDict.ContainsKey(id)) + { + visible = rendererVisibleDict[id]; + } + else + { + visible = ren.isVisible; + rendererVisibleDict.Add(id, visible); + } + if (visible) + return true; + } + } + + return false; + } + + //========================================================================================= + public void InformationLog(StringBuilder allsb) + { + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/Cloth/ClothManager.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Manager/Cloth/ClothManager.cs.meta new file mode 100644 index 00000000..d30bdc16 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/Cloth/ClothManager.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 8dec4d0537176214d8a66dccf5860cee +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Manager/Cloth/ClothManager.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/Cloth/PreBuildManager.cs b/Assets/MagicaCloth2/Scripts/Core/Manager/Cloth/PreBuildManager.cs new file mode 100644 index 00000000..a4436f7c --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/Cloth/PreBuildManager.cs @@ -0,0 +1,301 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2024 MagicaSoft. +// https://magicasoft.jp +using System; +using System.Collections.Generic; +using System.Text; +using Unity.Profiling; +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// PreBuildçĦ理ƒžƒƒĵ‚¸ƒ£ + /// + public class PreBuildManager : IManager, IValid + { + /// + /// ċ…ħĉœ‰ƒ“ƒĞƒ‰ƒ‡ƒĵ‚żċİċ…ƒƒ‡ƒĵ‚ż + /// + internal class ShareDeserializationData : IDisposable + { + internal string buildId; + internal ResultCode result; + internal int referenceCount; + + internal List renderSetupDataList = new List(); + internal VirtualMesh proxyMesh = null; + internal List renderMeshList = new List(); + + internal DistanceConstraint.ConstraintData distanceConstraintData; + internal TriangleBendingConstraint.ConstraintData bendingConstraintData; + internal InertiaConstraint.ConstraintData inertiaConstraintData; + + public void Dispose() + { + foreach (var data in renderSetupDataList) + { + if (data != null) + { + data.isManaged = false; + data.Dispose(); + } + } + renderSetupDataList.Clear(); + + if (proxyMesh != null) + { + proxyMesh.isManaged = false; + proxyMesh.Dispose(); + proxyMesh = null; + } + + foreach (var rmesh in renderMeshList) + { + if (rmesh != null) + { + rmesh.isManaged = false; + rmesh.Dispose(); + } + } + renderMeshList.Clear(); + + distanceConstraintData = null; + bendingConstraintData = null; + inertiaConstraintData = null; + + buildId = string.Empty; + result.Clear(); + referenceCount = 0; + } + + public void Deserialize(SharePreBuildData sharePreBuilddata) + { + result.SetProcess(); + + try + { + // ƒ‡ƒĵ‚żĉ¤œè¨ĵ + var validataResult = sharePreBuilddata.DataValidate(); + if (validataResult.IsFaild()) + { + result.Merge(validataResult); + throw new MagicaClothProcessingException(); + } + + // Deserialize + foreach (var sdata in sharePreBuilddata.renderSetupDataList) + { + renderSetupDataList.Add(RenderSetupData.ShareDeserialize(sdata)); + } + proxyMesh = VirtualMesh.ShareDeserialize(sharePreBuilddata.proxyMesh); + foreach (var sdata in sharePreBuilddata.renderMeshList) + { + renderMeshList.Add(VirtualMesh.ShareDeserialize(sdata)); + } + distanceConstraintData = sharePreBuilddata.distanceConstraintData; + bendingConstraintData = sharePreBuilddata.bendingConstraintData; + inertiaConstraintData = sharePreBuilddata.inertiaConstraintData; + + result.SetSuccess(); + } + catch (MagicaClothProcessingException) + { + } + catch (Exception exception) + { + Debug.LogException(exception); + result.SetError(Define.Result.Deserialization_Exception); + } + } + + public int RenderMeshCount => renderMeshList?.Count ?? 0; + + public VirtualMeshContainer GetProxyMeshContainer() + { + return new VirtualMeshContainer() + { + shareVirtualMesh = proxyMesh, + uniqueData = null, + }; + } + + public VirtualMeshContainer GetRenderMeshContainer(int index) + { + if (index >= RenderMeshCount) + return null; + + return new VirtualMeshContainer() + { + shareVirtualMesh = renderMeshList[index], + uniqueData = null, + }; + } + } + + Dictionary deserializationDict = new Dictionary(); + bool isValid = false; + + //========================================================================================= + public void Dispose() + { + foreach (var kv in deserializationDict) + { + kv.Value.Dispose(); + } + deserializationDict.Clear(); + + isValid = false; + } + + public void EnterdEditMode() + { + Dispose(); + } + + public void Initialize() + { + isValid = true; + } + + public bool IsValid() + { + return isValid; + } + + public void InformationLog(StringBuilder allsb) + { + StringBuilder sb = new StringBuilder(); + sb.AppendLine($"========== PreBuild Manager =========="); + if (IsValid() == false) + { + sb.AppendLine($"PreBuild Manager. Invalid."); + } + else + { + int cnt = deserializationDict.Count; + sb.AppendLine($"Count:{cnt}"); + + foreach (var kv in deserializationDict) + { + sb.AppendLine($"[{kv.Key.buildId}] refcnt:{kv.Value.referenceCount}, result:{kv.Value.result.GetResultString()}, proxyMesh:{kv.Value.proxyMesh != null}"); + } + } + + sb.AppendLine(); + Debug.Log(sb.ToString()); + allsb.Append(sb); + } + + //========================================================================================= + static readonly ProfilerMarker deserializationProfiler = new ProfilerMarker("PreBuild.Deserialization"); + + /// + /// PreBuildData‚’ƒ‡‚·ƒŞ‚˘ƒİ‚¤‚ş—ç™ğ録™‚‹ + /// ™§Ğç™ğ録•‚ŒĤ„Ÿċ ´ċˆŻċ‚ç…§‚Ğ‚Ĥƒ³‚ż‚’ċŠ ç—™‚‹ + /// + /// + /// + /// + internal ShareDeserializationData RegisterPreBuildData(SharePreBuildData sdata, bool referenceIncrement) + { + if (isValid == false) + return null; + if (sdata == null) + return null; + + if (deserializationDict.ContainsKey(sdata) == false) + { + deserializationProfiler.Begin(); + //var span = new TimeSpan($"Deserialization [{sdata.buildId}]"); + + // new + var data = new ShareDeserializationData(); + data.buildId = sdata.buildId; + + data.Deserialize(sdata); + + deserializationDict.Add(sdata, data); + + deserializationProfiler.End(); + //span.Log(); + + Develop.DebugLog($"RegisterPreBuildData.Deserialize [{sdata.buildId}] F:{Time.frameCount}"); + } + + var ddata = deserializationDict[sdata]; + + // reference counter + if (referenceIncrement) + ddata.referenceCount++; + + Develop.DebugLog($"RegisterPreBuildData [{sdata.buildId}] C:{ddata.referenceCount} F:{Time.frameCount}"); + + return ddata; + } + + internal ShareDeserializationData GetPreBuildData(SharePreBuildData sdata) + { + if (sdata == null) + return null; + + if (deserializationDict.ContainsKey(sdata)) + return deserializationDict[sdata]; + + return null; + } + + /// + /// PreBuildDataƒ‡‚·ƒŞ‚˘ƒİ‚¤‚şƒ‡ƒĵ‚ż‚’解除™‚‹ + /// ċ‚ç…§‚Ğ‚Ĥƒ³‚żŒïĵ§‚‚ç ´ĉ£„Ż—Ş„ + /// + /// + internal void UnregisterPreBuildData(SharePreBuildData sdata) + { + if (isValid == false) + return; + if (sdata == null) + return; + + if (deserializationDict.ContainsKey(sdata)) + { + var ddata = deserializationDict[sdata]; + + // reference counter + ddata.referenceCount--; + + Develop.DebugLog($"UnregisterPreBuildData [{sdata.buildId}] C:{ddata.referenceCount} F:{Time.frameCount}"); + } + else + { + Develop.DebugLogWarning($"UnregisterPreBuildData not found! [{sdata.buildId}]"); + } + } + + /// + /// ĉœŞä½żç”¨ƒ‡‚·ƒŞ‚˘ƒİ‚¤‚şƒ‡ƒĵ‚ż‚’™ıĤç ´ĉ£„™‚‹ + /// + internal void UnloadUnusedData() + { + var removeKeys = new List(); + + foreach (var kv in deserializationDict) + { + if (kv.Value.referenceCount <= 0) + removeKeys.Add(kv.Key); + } + + foreach (var key in removeKeys) + { + var ddata = deserializationDict[key]; + ddata.Dispose(); + deserializationDict.Remove(key); + + Develop.DebugLog($"Unload pre-build deserialization data [{key.buildId}] F:{Time.frameCount}"); + } + removeKeys.Clear(); + + Develop.DebugLog($"Unload pre-build deserialization data count:{deserializationDict.Count} F:{Time.frameCount}"); + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/Cloth/PreBuildManager.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Manager/Cloth/PreBuildManager.cs.meta new file mode 100644 index 00000000..1cd75d31 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/Cloth/PreBuildManager.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 800b8846d5572fe438974d4af951c076 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Manager/Cloth/PreBuildManager.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/IManager.cs b/Assets/MagicaCloth2/Scripts/Core/Manager/IManager.cs new file mode 100644 index 00000000..faa63d4e --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/IManager.cs @@ -0,0 +1,28 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System; +using System.Text; + +namespace MagicaCloth2 +{ + public interface IManager : IDisposable + { + /// + /// ċˆĉœŸċŒ– + /// ċŸèĦŒçŠĥĉ…‹Ğċ…£Ÿ¨Ğċ‘ĵ°‚Œ‚‹ + /// + void Initialize(); + + /// + /// ‚²ƒĵƒ ƒ—ƒĴ‚¤ċŸèĦŒŒċœĉ­˘—Ÿ¨Ğċ‘ĵ°‚Œ‚‹ïĵˆ‚¨ƒ‡‚£‚żç’°ċ˘ƒżïĵ‰ + /// + void EnterdEditMode(); + + /// + /// ĉƒ…ċ ħƒ­‚°ċŽé›† + /// + /// + void InformationLog(StringBuilder allsb); + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/IManager.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Manager/IManager.cs.meta new file mode 100644 index 00000000..e22a1885 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/IManager.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 3c48e53d99f78f84c894c528fea63af5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Manager/IManager.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/MagicaManager.cs b/Assets/MagicaCloth2/Scripts/Core/Manager/MagicaManager.cs new file mode 100644 index 00000000..a10685fc --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/MagicaManager.cs @@ -0,0 +1,484 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.LowLevel; +using System.Linq; +using UnityEngine.Scripting; +#if UNITY_EDITOR +using UnityEditor.Compilation; +using UnityEditor; +#if UNITY_2023_1_OR_NEWER +using UnityEditor.Build; +#endif +#endif + +// ‚³ƒĵƒ‰‚ıƒˆƒŞƒƒƒ”ƒ³‚°‚’ç„ĦċŠıċŒ–™‚‹ +[assembly: AlwaysLinkAssembly] + +namespace MagicaCloth2 +{ + /// + /// MagicaClothƒžƒƒĵ‚¸ƒ£ + /// + public static partial class MagicaManager + { + //========================================================================================= + /// + /// ç™ğ録ƒžƒƒĵ‚¸ƒ£ƒŞ‚ıƒˆ + /// + static List managers = null; + + public static TimeManager Time => managers?[0] as TimeManager; + public static TeamManager Team => managers?[1] as TeamManager; + public static ClothManager Cloth => managers?[2] as ClothManager; + public static RenderManager Render => managers?[3] as RenderManager; + public static TransformManager Bone => managers?[4] as TransformManager; + public static VirtualMeshManager VMesh => managers?[5] as VirtualMeshManager; + public static SimulationManager Simulation => managers?[6] as SimulationManager; + public static ColliderManager Collider => managers?[7] as ColliderManager; + public static WindManager Wind => managers?[8] as WindManager; + public static PreBuildManager PreBuild => managers?[9] as PreBuildManager; + + //========================================================================================= + // player loop delegate + public delegate void UpdateMethod(); + + /// + /// ƒ•ƒĴƒĵƒ é–‹ċ§‹ĉ™‚€™ıĤEarlyUpdateċŒ€FixedUpdate()ċ‰ + /// + public static UpdateMethod afterEarlyUpdateDelegate; + + /// + /// FixedUpdate()ċŒ + /// + public static UpdateMethod afterFixedUpdateDelegate; + + /// + /// PreUpdate()é–‹ċ§‹ç›´ċŒ + /// + public static UpdateMethod firstPreUpdateDelegate; + + /// + /// Update()ċŒ + /// + public static UpdateMethod afterUpdateDelegate; + + /// + /// LateUpdate()ċ‰ + /// + public static UpdateMethod beforeLateUpdateDelegate; + + /// + /// LateUpdate()ċŒ + /// + public static UpdateMethod afterLateUpdateDelegate; + + /// + /// LateUpdate()ċŒé…ċğĥċ‡Ĥ理ċŒ€yield nullċŒ + /// + public static UpdateMethod afterDelayedDelegate; + + /// + /// ƒĴƒ³ƒ€ƒŞƒ³‚°ċŒäş†ċŒ + /// + public static UpdateMethod afterRenderingDelegate; + + /// + /// ĉħŽç”¨çš„ŞċšĉœŸĉ›´ĉ–° + /// ‚²ƒĵƒ ċŸèĦŒä¸­ŻUpdate()ċŒĞċ‘ĵ³ċ‡ş•‚‹€‚ + /// ‚¨ƒ‡‚£‚ż§ŻEditorApplication.updateƒ‡ƒŞ‚²ƒĵƒˆĞ‚ˆ‚Šċ‘ĵ³ċ‡ş•‚Œ‚‹€‚ + /// + public static UpdateMethod defaultUpdateDelegate; + + + //========================================================================================= + static volatile bool isPlaying = false; + + //========================================================================================= + /// + /// Reload Domain ċŻç­– + /// + [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)] + static void Initialize() + { + Dispose(); + + // Reload Domain‚’設ċš—Ĥ„‚‹¨staticċ¤‰ĉ•°ŒċŸèĦŒĉ™‚ĞċˆĉœŸċŒ–•‚ŒŞ„ + // Ÿ‚““§staticċ¤‰ĉ•°ċ†ċˆĉœŸċŒ–‚’èĦŒ†ċż…èĤŒ‚‚‹ + Develop.DebugLog("SubsystemRegistration"); + +#if UNITY_EDITOR + // ‚ı‚ŻƒŞƒ—ƒˆ‚³ƒ³ƒ‘‚¤ƒĞ開ċ§‹‚³ƒĵƒĞƒƒƒ‚Ż + CompilationPipeline.compilationStarted += OnStarted; +#endif + + // ċ„ƒžƒƒĵ‚¸ƒ£ċˆĉœŸċŒ– + managers = new List(); + managers.Add(new TimeManager()); // [0] + managers.Add(new TeamManager()); // [1] + managers.Add(new ClothManager()); // [2] + managers.Add(new RenderManager()); // [3] + managers.Add(new TransformManager()); // [4] + managers.Add(new VirtualMeshManager()); // [5] + managers.Add(new SimulationManager()); // [6] + managers.Add(new ColliderManager()); // [7] + managers.Add(new WindManager()); // [8] + managers.Add(new PreBuildManager()); // [9] + foreach (var manager in managers) + manager.Initialize(); + + // ‚Ğ‚ı‚żƒ ĉ›´ĉ–°ƒĞƒĵƒ—ç™ğ録 + InitCustomGameLoop(); + + // ‚˘ƒ—ƒŞçµ‚了‚¤ƒ™ƒ³ƒˆ + Application.quitting += OnAppQuitting; + + isPlaying = true; + //isValid = true; + } + +#if UNITY_EDITOR + /// + /// ‚¨ƒ‡‚£‚żċŸèĦŒçŠĥĉ…‹Œċ¤‰ĉ›´•‚ŒŸċ ´ċˆĞċ‘ĵ³ċ‡ş•‚Œ‚‹ + /// + [InitializeOnLoadMethod] + static void PlayModeStateChange() + { + // ƒ—ƒ­‚¸‚§‚Żƒˆ‚ğƒƒƒ†‚£ƒ³‚°ĞMagicaCloth2用ƒ‡ƒ•‚Ħ‚¤ƒ³‚·ƒ³ƒœƒĞ‚’ç™ğ録™‚‹ + try + { +#if UNITY_2023_1_OR_NEWER + var namedBuildTarget = NamedBuildTarget.FromBuildTargetGroup(EditorUserBuildSettings.selectedBuildTargetGroup); + PlayerSettings.GetScriptingDefineSymbols(namedBuildTarget, out string[] newDefines); + if (newDefines.Contains(Define.System.DefineSymbol) == false) + { + PlayerSettings.SetScriptingDefineSymbols(namedBuildTarget, newDefines.Concat(new string[] { Define.System.DefineSymbol }).ToArray()); + } +#else + var newDefines = PlayerSettings.GetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup).Split(';'); + if (newDefines.Contains(Define.System.DefineSymbol) == false) + { + PlayerSettings.SetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup, newDefines.Concat(new string[] { Define.System.DefineSymbol }).ToArray()); + } +#endif + } + catch (Exception e) + { + Debug.LogException(e); + } + + // ‚¨ƒ‡‚£‚żçŠĥĉ…‹ċ¤‰ĉ›´ĉ™‚‚¤ƒ™ƒ³ƒˆċ‡Ĥ理 + EditorApplication.playModeStateChanged += (mode) => + { + Develop.DebugLog($"PlayModeStateChanged:{mode} F:{UnityEngine.Time.frameCount}"); + + if (mode == UnityEditor.PlayModeStateChange.EnteredEditMode) + { + // ★““§Żƒžƒƒĵ‚¸ƒ£‚’ç ´ĉ£„—Ş„ + // ★‚ı‚ħ‚¸ƒƒĵƒĞ•‚ŒŸ‚¸ƒ§ƒ–ŞİŻ‚¨ƒ‡‚£‚żċŸèĦŒċœĉ­˘ċŒ‚‚ċŒäş†§ç¨ĵċƒ—çĥš‘‚‹Ÿ‚€‚ + + // ċŸèĦŒçŠĥĉ…‹çµ‚了 + isPlaying = false; + //isValid = false; + EnterdEditMode(); + + // ‚¨ƒ‡‚£‚ż§ċšĉœŸĉ›´ĉ–°é–‹ċ§‹ + EditorApplication.update += EditoruUpdate; + } + + if (mode == UnityEditor.PlayModeStateChange.ExitingEditMode) + { + // ‚¨ƒ‡‚£‚ż§ċšĉœŸĉ›´ĉ–°çµ‚了 + EditorApplication.update -= EditoruUpdate; + } + + + //if (mode == UnityEditor.PlayModeStateChange.ExitingEditMode || mode == UnityEditor.PlayModeStateChange.ExitingPlayMode) + //{ + // // ċ„ƒžƒƒĵ‚¸ƒ£çµ‚了 + // // ★İ†‚‚“ċ‘ĵċ‡şċŒĞïĵ‘ƒ•ƒĴƒĵƒ ‚²ƒĵƒ Œĉ›´ĉ–°•‚ŒĤ—†‚ˆ†  + // // ★Ş§™Dispose()™‚‹¨è‰²€…面ċ€’Ş“¨ĞŞ‚‹ + // //rendererManager?.Dispose(); + // //rendererManager = null; + //} + }; + } + + /// + /// ‚ı‚ŻƒŞƒ—ƒˆ‚³ƒ³ƒ‘‚¤ƒĞ開ċ§‹ + /// + /// + static void OnStarted(object obj) + { + //Debug.Log($"‚ı‚ŻƒŞƒ—ƒˆ‚³ƒ³ƒ‘‚¤ƒĞ開ċ§‹"); + isPlaying = false; + EnterdEditMode(); + //Dispose(); + + } + + /// + /// ‚ı‚ŻƒŞƒ—ƒˆ‚³ƒ³ƒ‘‚¤ƒĞċŒ + /// + //[DidReloadScripts(0)] + //static void ReloadScripts() + //{ + // //Initialize(); + //} + + /// + /// ‚²ƒĵƒ ƒ—ƒĴ‚¤ċŸèĦŒŒċœĉ­˘—Ÿ¨ïĵˆ‚¨ƒ‡‚£‚żç’°ċ˘ƒżïĵ‰ + /// + static void EnterdEditMode() + { + //Debug.Log($"★Manager Enterd Edit Mode."); + if (managers != null) + { + //int index = 0; + foreach (var manager in managers) + { + //Debug.Log($"Dispose [{index}] start."); + manager.EnterdEditMode(); + //Debug.Log($"Dispose [{index}] end."); + //index++; + } + } + } + + /// + /// ‚¨ƒ‡‚£‚ż§ċšĉœŸĉ›´ĉ–° + /// + static void EditoruUpdate() + { + defaultUpdateDelegate?.Invoke(); + } +#endif + + /// + /// ‚˘ƒ—ƒŞçµ‚了‚¤ƒ™ƒ³ƒˆ + /// + static void OnAppQuitting() + { + Develop.DebugLog($"OnAppQuitting!"); + Dispose(); + } + + /// + /// ƒžƒƒĵ‚¸ƒ£ç ´ĉ£„ + /// + static void Dispose() + { + Develop.DebugLog("Manager Dispose!"); + + if (managers != null) + { + foreach (var manager in managers) + manager.Dispose(); + managers = null; + } + + // clear static member. + OnPreSimulation = null; + OnPostSimulation = null; + + Application.quitting -= OnAppQuitting; + + isPlaying = false; + } + + public static bool IsPlaying() + { + //return isPlaying; + return isPlaying && Application.isPlaying; + } + + //========================================================================================= + /// + /// ‚Ğ‚ı‚żƒ ĉ›´ĉ–°ƒĞƒĵƒ—ç™ğ録 + /// ™§Ğç™ğ録•‚ŒĤ„‚‹ċ ´ċˆŻä½•‚‚—Ş„ + /// Custom update loop registration. + /// Do nothing if already registered. + /// + public static void InitCustomGameLoop() + { + //Debug.Log("PhysicsManager.InitCustomGameLoop()"); + PlayerLoopSystem playerLoop = PlayerLoop.GetCurrentPlayerLoop(); + + // ™§Ğ設ċš•‚ŒĤ„‚‹Ş‚‰°‚ıƒĞƒĵ + if (CheckRegist(ref playerLoop)) + { + //Develop.DebugLog("SetCustomGameLoop Skip!!"); + return; + } + + // MagicaCloth用PlayerLoop‚’èż½ċŠ  + SetCustomGameLoop(ref playerLoop); + + PlayerLoop.SetPlayerLoop(playerLoop); + } + + static void SetCustomGameLoop(ref PlayerLoopSystem playerLoop) + { +#if false + // debug + foreach (var header in playerLoop.subSystemList) + { + Debug.LogFormat("------{0}------", header.type.Name); + foreach (var subSystem in header.subSystemList) + { + Debug.LogFormat("{0}.{1}", header.type.Name, subSystem.type.Name); + } + } +#endif + + // after early update + // ƒ•ƒĴƒĵƒ é–‹ċ§‹ĉ™‚€™ıĤEarlyUpdateċŒ€FixedUpdate()ċ‰ + PlayerLoopSystem afterEarlyUpdate = new PlayerLoopSystem() + { + type = typeof(MagicaManager), + updateDelegate = () => afterEarlyUpdateDelegate?.Invoke() + }; + AddPlayerLoop(afterEarlyUpdate, ref playerLoop, "EarlyUpdate", string.Empty, firstLast: 1); + + // after fixed update + // FixedUpdate()ċŒ + PlayerLoopSystem afterFixedUpdate = new PlayerLoopSystem() + { + type = typeof(MagicaManager), + updateDelegate = () => + { + afterFixedUpdateDelegate?.Invoke(); + } + }; + AddPlayerLoop(afterFixedUpdate, ref playerLoop, "FixedUpdate", "ScriptRunBehaviourFixedUpdate"); + + // first pre update + PlayerLoopSystem firstPreUpdate = new PlayerLoopSystem() + { + type = typeof(MagicaManager), + updateDelegate = () => + { + firstPreUpdateDelegate?.Invoke(); + } + }; + AddPlayerLoop(firstPreUpdate, ref playerLoop, "PreUpdate", string.Empty, firstLast: -1); + + // after update + // Update()ċŒ + PlayerLoopSystem afterUpdate = new PlayerLoopSystem() + { + type = typeof(MagicaManager), + updateDelegate = () => + { + afterUpdateDelegate?.Invoke(); + + // ċŸèĦŒĉ™‚ĉħŽç”¨ċšĉœŸĉ›´ĉ–°ċ‘ĵ³ċ‡ş— + if (Application.isPlaying) + { + defaultUpdateDelegate?.Invoke(); + } + } + }; + AddPlayerLoop(afterUpdate, ref playerLoop, "Update", "ScriptRunDelayedTasks"); + + // before late update + // LateUpdate()ċ‰ + PlayerLoopSystem beforeLateUpdate = new PlayerLoopSystem() + { + type = typeof(MagicaManager), + updateDelegate = () => beforeLateUpdateDelegate?.Invoke() + }; + AddPlayerLoop(beforeLateUpdate, ref playerLoop, "PreLateUpdate", "ScriptRunBehaviourLateUpdate", before: true); + + // after late update + // LateUpdate()ċŒ + PlayerLoopSystem afterLateUpdate = new PlayerLoopSystem() + { + type = typeof(MagicaManager), + updateDelegate = () => afterLateUpdateDelegate?.Invoke() + }; + AddPlayerLoop(afterLateUpdate, ref playerLoop, "PreLateUpdate", "ScriptRunBehaviourLateUpdate"); + + // after delayed update + // LateUpdate()ċŒé…ċğĥċ‡Ĥ理ċŒ€yield nullċŒ + // LateUpdate()‚„‚˘‚ğƒƒƒˆƒƒ³ƒ‰ƒĞƒ­ƒĵƒ‰ċŒäş†‚³ƒĵƒĞƒƒƒ‚݁§‚³ƒ³ƒƒĵƒƒ³ƒˆ‚’‚¤ƒ³‚ı‚żƒ³‚ıċŒ–™‚‹¨€ + // Start()Œċ°‘—遅‚ŒĤPostLateUpdateScriptRunDelayedDynamicFrameRate§ċ‘ĵ°‚Œ‚‹“¨ĞŞ‚‹€‚ + // 遅ċğĥċŸèĦŒĉ™‚Ğ“ċ‡Ĥ理Œċ…‚‹¨€™§Ğ‚Żƒ­‚ı‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³‚¸ƒ§ƒ–Œé–‹ċ§‹•‚ŒĤ„‚‹Ÿ‚€ + // Start()ċˆĉœŸċŒ–ċ‡Ĥ理Şİ§NativeƒŞ‚ıƒˆĞ‚˘‚Ż‚ğ‚ı™‚‹¨ä‹ċ¤–Œç™şç”Ÿ—Ĥ—†€‚ + // ċ“£Ĥ遅ċğĥċŸèĦŒĉ™‚Ż‚Żƒ­‚ı‚³ƒ³ƒƒĵƒƒ³ƒˆStart()ŒċŒäş†™‚‹ScriptRunDelayedDynamicFrameRate + // ċŒĞ‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³‚’é–‹ċ§‹™‚‹‚ˆ†Ğ™‚‹€‚ + PlayerLoopSystem afterDelayedUpdate = new PlayerLoopSystem() + { + type = typeof(MagicaManager), + updateDelegate = () => afterDelayedDelegate?.Invoke() + }; + AddPlayerLoop(afterDelayedUpdate, ref playerLoop, "PostLateUpdate", "ScriptRunDelayedDynamicFrameRate"); + + // after rendering + // ƒĴƒ³ƒ€ƒŞƒ³‚°ċŒäş†ċŒ + PlayerLoopSystem afterRendering = new PlayerLoopSystem() + { + type = typeof(MagicaManager), + updateDelegate = () => afterRenderingDelegate?.Invoke() + }; + AddPlayerLoop(afterRendering, ref playerLoop, "PostLateUpdate", "FinishFrameRendering"); + } + + /// + /// method‚’PlayerLoop(categoryName:systemName)ĉĴĦĞèż½ċŠ ™‚‹ + /// + /// + /// + /// + /// + static void AddPlayerLoop(PlayerLoopSystem method, ref PlayerLoopSystem playerLoop, string categoryName, string systemName, int firstLast = 0, bool before = false) + { + int sysIndex = Array.FindIndex(playerLoop.subSystemList, (s) => s.type.Name == categoryName); + PlayerLoopSystem category = playerLoop.subSystemList[sysIndex]; + var systemList = new List(category.subSystemList); + + if (firstLast < 0) + { + // ĉœ€ċˆĞèż½ċŠ  + systemList.Insert(0, method); + } + else if (firstLast > 0) + { + // ĉœ€ċŒĞèż½ċŠ  + systemList.Add(method); + } + else + { + int index = systemList.FindIndex(h => h.type.Name.Contains(systemName)); + if (before) + systemList.Insert(index, method); + else + systemList.Insert(index + 1, method); + } + + category.subSystemList = systemList.ToArray(); + playerLoop.subSystemList[sysIndex] = category; + } + + /// + /// MagicaCloth‚Ğ‚ı‚żƒ ƒĞƒĵƒ—Œç™ğ録•‚ŒĤ„‚‹‹ƒ‚§ƒƒ‚݁™‚‹ + /// + /// + /// + static bool CheckRegist(ref PlayerLoopSystem playerLoop) + { + var t = typeof(MagicaManager); + foreach (var subloop in playerLoop.subSystemList) + { + if (subloop.subSystemList != null && subloop.subSystemList.Any(x => x.type == t)) + { + return true; + } + } + return false; + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/MagicaManager.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Manager/MagicaManager.cs.meta new file mode 100644 index 00000000..4390ccaf --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/MagicaManager.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 8bdae5377302cd04ab0a69a465d06991 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Manager/MagicaManager.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/MagicaManagerAPI.cs b/Assets/MagicaCloth2/Scripts/Core/Manager/MagicaManagerAPI.cs new file mode 100644 index 00000000..514ace74 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/MagicaManagerAPI.cs @@ -0,0 +1,224 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System; +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// MagicaCloth manager API + /// + public static partial class MagicaManager + { + /// + /// ‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³é–‹ċ§‹ċ‰‚¤ƒ™ƒ³ƒˆ + /// Pre-simulation event. + /// + public static Action OnPreSimulation; + + /// + /// ‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ċŒäş†ċŒ‚¤ƒ™ƒ³ƒˆ + /// Post-simulation event. + /// + public static Action OnPostSimulation; + + + /// + /// ‚°ƒ­ƒĵƒƒĞ‚ż‚¤ƒ ‚ı‚ħƒĵƒĞ‚’ċ¤‰ĉ›´—™ + /// Change the global time scale. + /// + /// 0.0-1.0 + public static void SetGlobalTimeScale(float timeScale) + { + if (IsPlaying()) + { + Time.GlobalTimeScale = Mathf.Clamp01(timeScale); + } + } + + /// + /// ‚°ƒ­ƒĵƒƒĞ‚ż‚¤ƒ ‚ı‚ħƒĵƒĞ‚’ċ–ċ——™ + /// Get the global time scale. + /// + /// + public static float GetGlobalTimeScale() + { + if (IsPlaying()) + { + return Time.GlobalTimeScale; + } + else + { + Develop.LogError("MagicaManager is not starting!"); + return 1.0f; + } + } + + /// + /// ‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ċ‘¨ĉ³˘ĉ•°‚’設ċš—™(30~150, ċˆĉœŸċ€¤90) + /// ċ‘¨ĉ³˘ĉ•°‚’上’‚‹¨ç²ċşĤŒéИŞ‚Ё™Œè² è·Œä¸ŠŒ‚Ё™€ä¸‹’‚‹’‚‹¨ç²ċşĤŒä½ŽŞ‚Ё™Œè² è·Œä¸‹Œ‚Ё™ + /// Ÿ‚60äğ下Ğ下’‚‹ċ ´ċˆĞŻç²ċşĤċ•éĦŒĞċċˆ†ĉ³¨ĉ„—Ĥ •„ + /// + /// Sets the simulation frequency (30~150, default 90). + /// Increasing the frequency increases the accuracy but increases the load, and decreasing the frequency decreases the accuracy but reduces the load. + /// Therefore, if you lower it below 60, be very careful about accuracy issues. + /// + /// + public static void SetSimulationFrequency(int freq) + { + if (IsPlaying()) + Time.simulationFrequency = Mathf.Clamp(freq, Define.System.SimulationFrequency_Low, Define.System.SimulationFrequency_Hi); + } + + /// + /// çċœ¨‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ċ‘¨ĉ³˘ĉ•°‚’ċ–ċ——™ + /// Get current simulation frequency. + /// + /// + public static int GetSimulationFrequency() + { + if (IsPlaying()) + return Time.simulationFrequency; + else + { + Develop.LogError("MagicaManager is not starting!"); + return 0; + } + } + + /// + /// ïĵ‘ƒ•ƒĴƒĵƒ §ċŸèĦŒ•‚Œ‚‹ĉœ€ċ¤§‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ċ›žĉ•°‚’設ċš—™(1~5, ċˆĉœŸċ€¤3) + /// ‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³Żƒ•ƒĴƒĵƒ ƒĴƒĵƒˆ(fps)¨ŻéžċŒĉœŸĞċŸèĦŒ•‚Œ™ + /// Ÿ‚fpsŒä¸‹Œ‚‹¨ïĵ‘ƒ•ƒĴƒĵƒ ĞċŸèĦŒ•‚Œ‚‹‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ċ›žĉ•°Œċ˘—ˆĤ負荷ŒéИŞ‚Ё™ + /// “‚ŒŻƒ˘ƒ‚¤ƒĞçĞŻĉœĞŞİ§ċ•éĦŒĞŞ‚‹ċ ´ċˆŒ‚‚Ё™ + /// ïĵ‘ƒ•ƒĴƒĵƒ §ċŸèĦŒ•‚Œ‚‹‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ċ›žĉ•°‚’下’‚‹“¨§ĉœ€ċ¤§è² è·‚’èŞżĉ•´§™ + /// ċˆĥ限Ğ‚ˆ‚Š‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³Œ‚ı‚­ƒƒƒ—•‚ŒŸċ ´ċˆŻè£œé–“ĉݟ能Ğ‚ˆ‚Šċ‹•作Œè£œ‚‚Œ™ + /// + /// Set the maximum number of simulations to be executed in one frame (1 to 5, initial value 3) + /// The simulation runs asynchronously with the frame rate(fps). + /// Therefore, when the fps decreases, the number of simulations executed in one frame increases and the load increases. + /// This can be a problem on mobile devices, for example. + /// You can adjust the maximum load by lowering the number of simulations executed in one frame. + /// If the simulation is skipped due to restrictions, the interpolation function compensates for the motion. + /// + /// + public static void SetMaxSimulationCountPerFrame(int count) + { + if (IsPlaying()) + Time.maxSimulationCountPerFrame = Mathf.Clamp(count, Define.System.MaxSimulationCountPerFrame_Low, Define.System.MaxSimulationCountPerFrame_Hi); + } + + /// + /// çċœ¨ƒ•ƒĴƒĵƒ ”¨ĉœ€ċ¤§‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ċ›žĉ•°‚’ċ–ċ——™ + /// Gets the current maximum number of simulations per frame. + /// + /// + public static int GetMaxSimulationCountPerFrame() + { + if (IsPlaying()) + return Time.maxSimulationCountPerFrame; + else + { + Develop.LogError("MagicaManager is not starting!"); + return 0; + } + } + + /// + /// ‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ĉ›´ĉ–°ċ ´ĉ‰€‚’ċ¤‰ĉ›´—™ + /// Change the simulation update location. + /// + /// + public static void SetUpdateLocation(TimeManager.UpdateLocation updateLocation) + { + if (IsPlaying()) + Time.updateLocation = updateLocation; + } + + /// + /// çċœ¨‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ĉ›´ĉ–°ċ ´ĉ‰€‚’ċ–ċ——™ + /// Get the current simulation update location. + /// + /// + public static TimeManager.UpdateLocation GetUpdateLocation() + { + if (IsPlaying()) + return Time.updateLocation; + else + { + Develop.LogError("MagicaManager is not starting!"); + return TimeManager.UpdateLocation.AfterLateUpdate; + } + } + + /// + /// ĉœŞä½żç”¨ƒ‡ƒĵ‚ż‚’™ıĤè§£ĉ”—™ + /// Free all unused data. + /// - Unused PreBuild data + /// + public static void UnloadUnusedData() + { + if (IsPlaying()) + { + PreBuild.UnloadUnusedData(); + } + } + + /// + /// MonoBehaviour§MagicaClothċˆĉœŸċŒ–ċ ´ĉ‰€ + /// MagicaCloth initialization location in MonoBehaviour. + /// + public enum InitializationLocation + { + /// + /// Initialize with MonoBehaviour.Start(). + /// (Default) + /// + Start = 0, + + /// + /// Initialize with MonoBehaviour.Awake(). + /// + Awake = 1, + } + internal static InitializationLocation initializationLocation = InitializationLocation.Start; + + /// + /// MonoBehaviour§MagicaClothċˆĉœŸċŒ–ċ ´ĉ‰€‚’設ċš™‚‹ + /// Setting MagicaCloth initialization location in MonoBehaviour. + /// + /// + public static void SetInitializationLocation(InitializationLocation initLocation) + { + initializationLocation = initLocation; + } + + /// + /// ċˆ†ċ‰²‚¸ƒ§ƒ–‚’éİ用™‚‹ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒé ‚ç‚ıĉ•°‚’設ċš™‚‹ + /// Sets the number of vertices for the proxy mesh to which the split job will be applied. + /// + /// + public static void SetSplitProxyMeshVertexCount(int vertexCount) + { + if (IsPlaying()) + Simulation.splitProxyMeshVertexCount = vertexCount; + } + + /// + /// ċˆ†ċ‰²‚¸ƒ§ƒ–‚’éİ用™‚‹ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒé ‚ç‚ıĉ•°‚’ċ–ċ—™‚‹ + /// Gets the vertex count of the proxy mesh to which the split job is applied. + /// + /// + public static int GetSplitProxyMeshVertexCount() + { + if (IsPlaying()) + return Simulation.splitProxyMeshVertexCount; + else + { + Develop.LogError("MagicaManager is not starting!"); + return 0; + } + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/MagicaManagerAPI.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Manager/MagicaManagerAPI.cs.meta new file mode 100644 index 00000000..42686139 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/MagicaManagerAPI.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 5303b9f714439aa46a30b236862f8278 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Manager/MagicaManagerAPI.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/MagicaSettings.cs b/Assets/MagicaCloth2/Scripts/Core/Manager/MagicaSettings.cs new file mode 100644 index 00000000..4dd56055 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/MagicaSettings.cs @@ -0,0 +1,169 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// Magica manger settings component + /// + [AddComponentMenu("MagicaCloth2/MagicaSettings")] + [HelpURL("https://magicasoft.jp/en/mc2_settings_component/")] + public class MagicaSettings : ClothBehaviour + { + public enum RefreshMode + { + /// + /// ‚³ƒ³ƒƒĵƒƒ³ƒˆAwake()§ïĵ‘ċşĤ ‘送äżĦ™‚‹ + /// Send once at the component's Awake() + /// + OnAwake = 0, + + /// + /// ĉŻŽƒ•ƒĴƒĵƒ ċ†…ċı‚’送äżĦ™‚‹ + /// Send content every frame. + /// + EveryFrame = 1, + + /// + /// ‚³ƒ³ƒƒĵƒƒ³ƒˆStart()§ä¸€ċşĤ ‘送äżĦ™‚‹ + /// Send once at the component's Start(). + /// + OnStart = 2, + + /// + /// ‚³ƒ³ƒƒĵƒƒ³ƒˆŻä½•‚‚—›‚“€‚送äżĦĞŻĉ‰‹ċ‹•§Refresh()‚’ċ‘ĵĥċż…èĤŒ‚‚Ё™ + /// The component does nothing. You must manually call Refresh() to submit. + /// + Manual = 3, + } + + /// + /// ‚³ƒ³ƒƒĵƒƒ³ƒˆċ†…ċı‚’ƒžƒƒĵ‚¸ƒ£Ğ送äżĦ™‚‹ĉ–ıĉ³• + /// How to send the contents of a component to the manager. + /// Refresh mode + /// + public RefreshMode refreshMode = RefreshMode.OnAwake; + + /// + /// ‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ċ‘¨ĉ³˘ĉ•°(30~150, ċˆĉœŸċ€¤90) + /// ċ‘¨ĉ³˘ĉ•°‚’上’‚‹¨ç²ċşĤŒéИŞ‚Ё™Œè² è·Œä¸ŠŒ‚Ё™€ä¸‹’‚‹’‚‹¨ç²ċşĤŒä½ŽŞ‚Ё™Œè² è·Œä¸‹Œ‚Ё™ + /// Ÿ‚60äğ下Ğ下’‚‹ċ ´ċˆĞŻç²ċşĤċ•éĦŒĞċċˆ†ĉ³¨ĉ„—Ĥ •„ + /// + /// Simulation frequency (30~150, default 90). + /// Increasing the frequency increases the accuracy but increases the load, and decreasing the frequency decreases the accuracy but reduces the load. + /// Therefore, if you lower it below 60, be very careful about accuracy issues. + /// + [Range(Define.System.SimulationFrequency_Low, Define.System.SimulationFrequency_Hi)] + public int simulationFrequency = Define.System.DefaultSimulationFrequency; + + /// + /// ïĵ‘ƒ•ƒĴƒĵƒ ĉœ€ċ¤§‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ċ›žĉ•°(1~5, ċˆĉœŸċ€¤3) + /// ‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³Żƒ•ƒĴƒĵƒ ƒĴƒĵƒˆ(fps)¨ŻéžċŒĉœŸĞċŸèĦŒ•‚Œ™ + /// Ÿ‚fpsŒä¸‹Œ‚‹¨ïĵ‘ƒ•ƒĴƒĵƒ ĞċŸèĦŒ•‚Œ‚‹‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ċ›žĉ•°Œċ˘—ˆĤ負荷ŒéИŞ‚Ё™ + /// “‚ŒŻƒ˘ƒ‚¤ƒĞçĞŻĉœĞŞİ§ċ•éĦŒĞŞ‚‹ċ ´ċˆŒ‚‚Ё™ + /// ïĵ‘ƒ•ƒĴƒĵƒ §ċŸèĦŒ•‚Œ‚‹‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ċ›žĉ•°‚’下’‚‹“¨§ĉœ€ċ¤§è² è·‚’èŞżĉ•´§™ + /// ċˆĥ限Ğ‚ˆ‚Š‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³Œ‚ı‚­ƒƒƒ—•‚ŒŸċ ´ċˆŻè£œé–“ĉݟ能Ğ‚ˆ‚Šċ‹•作Œè£œ‚‚Œ™ + /// + /// Maximum number of simulations per frame (1 to 5, default value 3). + /// The simulation runs asynchronously with the frame rate(fps). + /// Therefore, when the fps decreases, the number of simulations executed in one frame increases and the load increases. + /// This can be a problem on mobile devices, for example. + /// You can adjust the maximum load by lowering the number of simulations executed in one frame. + /// If the simulation is skipped due to restrictions, the interpolation function compensates for the motion. + /// + [Range(Define.System.MaxSimulationCountPerFrame_Low, Define.System.MaxSimulationCountPerFrame_Hi)] + public int maxSimulationCountPerFrame = Define.System.DefaultMaxSimulationCountPerFrame; + + /// + /// MonoBehaviour§MagicaClothċˆĉœŸċŒ–ċ ´ĉ‰€€‚ + /// MagicaCloth initialization location in MonoBehaviour. + /// + public MagicaManager.InitializationLocation initializationLocation = MagicaManager.InitializationLocation.Start; + + /// + /// ‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ĉ›´ĉ–°ċ ´ĉ‰€ + /// BeforeLateUpdate : LateUpdate()ċ‰ĞċŸèĦŒ—™€‚“‚ŒŻUnity 2D Animation§ċˆİ用™‚‹ċ ´ċˆĞċż…èĤ§™€‚ + /// AfterLateUpdate : LateUpdate()ċŒĞċŸèĦŒ—™€‚ċˆĉœŸè¨­ċš€‚ + /// + /// Simulation update location. + /// BeforeLateUpdate : Executes before LateUpdate(). This is required when using Unity 2D Animation. + /// AfterLateUpdate : Executes after LateUpdate(). Initial setting. + /// + public TimeManager.UpdateLocation updateLocation = TimeManager.UpdateLocation.AfterLateUpdate; + + /// + /// PlayerLoopç›£èĤ– + /// MagicaCloth‚·‚ıƒ†ƒ ŻUnityPlayerLoopĞç™ğ録™‚‹“¨§ċ‹•作—™ + /// “ç™ğ録Œäğ–ċ¤–部‚˘‚ğƒƒƒˆĞ‚ˆ‚Šä¸Šĉ›¸•‚ŒĤ—†¨€MagicaCloth‚·‚ıƒ†ƒ Œċœĉ­˘—Ĥ—„™ + /// “ƒ•ƒİ‚°‚’ĉœ‰ċŠıĞ™‚‹¨€PlayerLoop‚’監èĤ–—Ĥ€ä¸Šĉ›¸•‚ŒĤ„Ÿċ ´ċˆŻċ†ċşĤ‚·‚ıƒ†ƒ ‚’ç™ğ録™‚‹‚ˆ†ĞŞ‚Ё™ + /// + /// PlayerLoop monitoring. + /// The MagicaCloth system works by registering it in Unity's PlayerLoop. + /// If this registration is overwritten by other external assets, the MagicaCloth system will stop working. + /// When this flag is enabled, the PlayerLoop will be monitored, and the system will be registered again if it has been overwritten. + /// + public bool monitorPlayerLoop = false; + + /// + /// ‚¸ƒ§ƒ–ċˆ†ċ‰²‚’éİ用™‚‹ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒé ‚ç‚ıĉ•° + /// + /// The number of proxy mesh vertices to apply job splitting to. + /// + [Min(0)] + public int splitProxyMeshVertexCount = Define.System.SplitProxyMeshVertexCount; + + //========================================================================================= + protected void Awake() + { + if (refreshMode == RefreshMode.OnAwake) + Refresh(); + } + + protected void Start() + { + if (refreshMode == RefreshMode.OnStart) + Refresh(); + } + + protected void Update() + { + if (refreshMode == RefreshMode.EveryFrame) + Refresh(); + } + + protected void OnValidate() + { + if (Application.isPlaying) + Refresh(); + } + + //========================================================================================= + /// + /// ‚³ƒ³ƒƒĵƒƒ³ƒˆċ†…ċı‚’ƒžƒƒĵ‚¸ƒ£Ğ送äżĦ—™ + /// Sends the contents of the component to the manager. + /// + public void Refresh() + { + if (MagicaManager.IsPlaying()) + { + simulationFrequency = Mathf.Clamp(simulationFrequency, Define.System.SimulationFrequency_Low, Define.System.SimulationFrequency_Hi); + maxSimulationCountPerFrame = Mathf.Clamp(maxSimulationCountPerFrame, Define.System.MaxSimulationCountPerFrame_Low, Define.System.MaxSimulationCountPerFrame_Hi); + + MagicaManager.SetSimulationFrequency(simulationFrequency); + MagicaManager.SetMaxSimulationCountPerFrame(maxSimulationCountPerFrame); + MagicaManager.SetInitializationLocation(initializationLocation); + MagicaManager.SetUpdateLocation(updateLocation); + MagicaManager.SetSplitProxyMeshVertexCount(splitProxyMeshVertexCount); + + if (monitorPlayerLoop) + MagicaManager.InitCustomGameLoop(); + } + else + { + Develop.LogError("MagicaManager is not starting!"); + } + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/MagicaSettings.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Manager/MagicaSettings.cs.meta new file mode 100644 index 00000000..9aed950f --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/MagicaSettings.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 9f2ecd6e147dc7c4f8f3c75ebc705f6b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: -50 + icon: {fileID: 2800000, guid: 4b0d1adb21ff82e4e8e9ea02f486a85f, type: 3} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Manager/MagicaSettings.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/Render.meta b/Assets/MagicaCloth2/Scripts/Core/Manager/Render.meta new file mode 100644 index 00000000..30278450 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/Render.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d727233c727c4354e940f901aea4a9f7 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/Render/RenderData.cs b/Assets/MagicaCloth2/Scripts/Core/Manager/Render/RenderData.cs new file mode 100644 index 00000000..14473bbe --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/Render/RenderData.cs @@ -0,0 +1,427 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Unity.Collections; +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// ĉç”ğċŻèħĦçĦ理ĉƒ…ċ ħ + /// ƒĴƒ³ƒ€ƒİƒĵŸŻƒœƒĵƒ³ĉç”ğċĉ˜ ‚’èĦŒ† + /// + public class RenderData : IDisposable, ITransform + { + /// + /// ċ‚ç…§‚Ğ‚Ĥƒ³ƒˆ€‚ïĵĞŞ‚‹¨ç ´ĉ£„•‚Œ‚‹ + /// + public int ReferenceCount { get; private set; } + + /// + /// ċˆİ用中ƒ—ƒ­‚ğ‚ıïĵˆïĵċˆİ用‚Ğ‚Ĥƒ³ƒˆïĵ‰ + /// + HashSet useProcessSet = new HashSet(); + + /// + /// Mesh¸ĉ›¸èĵżċœĉ­˘ƒ•ƒİ‚° + /// + bool isSkipWriting; + + //========================================================================================= + // ‚ğƒƒƒˆ‚˘ƒƒƒ—ƒ‡ƒĵ‚ż + internal RenderSetupData setupData; + internal RenderSetupData.UniqueSerializationData preBuildUniqueSerializeData; + + internal string Name => setupData?.name ?? "(empty)"; + + internal bool HasSkinnedMesh => setupData?.hasSkinnedMesh ?? false; + internal bool HasBoneWeight => setupData?.hasBoneWeight ?? false; + + //========================================================================================= + // ‚ރނ¸ƒŠƒĞĉƒ…ċ ħ + internal Mesh originalMesh { get; private set; } + private Renderer renderer; + private SkinnedMeshRenderer skinnedMeshRendere; + private MeshFilter meshFilter; + internal List transformList { get; private set; } + internal Mesh customMesh { get; private set; } + + // RenderDataWorkƒƒƒƒ•‚Ħ¸‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı(RenderManagerŒçĦ理) + internal int renderDataWorkIndex { get; private set; } = -1; + + //========================================================================================= + public void Dispose() + { + // ‚ރނ¸ƒŠƒĞƒĦƒƒ‚·ƒĞĉˆğ™ + SwapOriginalMesh(null); + + setupData?.Dispose(); + preBuildUniqueSerializeData = null; + + MagicaManager.Render.RemoveRenderDataWork(renderDataWorkIndex); + + if (customMesh) + GameObject.Destroy(customMesh); + } + + public void GetUsedTransform(HashSet transformSet) + { + setupData?.GetUsedTransform(transformSet); + } + + public void ReplaceTransform(Dictionary replaceDict) + { + setupData?.ReplaceTransform(replaceDict); + } + + /// + /// ċˆĉœŸċŒ–ïĵˆƒĦ‚¤ƒ³‚ıƒĴƒƒƒ‰żïĵ‰ + /// “ċ‡Ĥ理Ż‚ıƒĴƒƒƒ‰ċŒ–§Ş„§ċ°‘—負荷Œ‹‹‚‹Œċ³ĉ™‚ċŸèĦŒ™‚‹ + /// + /// + internal void Initialize( + Renderer ren, + RenderSetupData referenceSetupData, + RenderSetupData.UniqueSerializationData referencePreBuildUniqueSetupData, + RenderSetupSerializeData referenceInitSetupData + ) + { + Debug.Assert(ren); + + // ‚ğƒƒƒˆ‚˘ƒƒƒ—ƒ‡ƒĵ‚żä½œĉˆ + // PreBuild§Żċ¤–部‹‚‰ċ—‘ĉ¸Ħ•‚Œ‚‹ + if (referenceSetupData != null && referencePreBuildUniqueSetupData != null) + { + setupData = referenceSetupData; + preBuildUniqueSerializeData = referencePreBuildUniqueSetupData; + + originalMesh = preBuildUniqueSerializeData.originalMesh; + renderer = preBuildUniqueSerializeData.renderer; + skinnedMeshRendere = preBuildUniqueSerializeData.skinRenderer; + meshFilter = preBuildUniqueSerializeData.meshFilter; + transformList = preBuildUniqueSerializeData.transformList; + } + else + { + setupData = new RenderSetupData(referenceInitSetupData, ren); + preBuildUniqueSerializeData = null; + + originalMesh = setupData.originalMesh; + renderer = setupData.renderer; + skinnedMeshRendere = setupData.skinRenderer; + meshFilter = setupData.meshFilter; + transformList = setupData.transformList; + } + + // ƒĴƒ³ƒ€ƒĵƒ‡ƒĵ‚żƒŻƒĵ‚Ż‚’確保 + renderDataWorkIndex = MagicaManager.Render.AddRenderDataWork(this); + } + + internal ResultCode Result => setupData?.result ?? ResultCode.None; + + //========================================================================================= + internal int AddReferenceCount() + { + ReferenceCount++; + return ReferenceCount; + } + + internal int RemoveReferenceCount() + { + ReferenceCount--; + return ReferenceCount; + } + + //========================================================================================= + void SwapCustomMesh(ClothProcess process) + { + Debug.Assert(setupData != null); + + if (setupData.IsFaild()) + return; + if (originalMesh == null) + return; + if (MagicaManager.Render.IsSetRenderDataWorkFlag(renderDataWorkIndex, RenderManager.RenderDataFlag_UseCustomMesh)) + return; + + // ‚Ğ‚ı‚żƒ ƒĦƒƒ‚·ƒä½œĉˆ + if (customMesh == null) + { + //Debug.Assert(setupData.originalMesh); + // ‚Żƒ­ƒĵƒ³ä½œĉˆ + customMesh = GameObject.Instantiate(originalMesh); + customMesh.MarkDynamic(); + + // bind pose + if (HasBoneWeight) + { + int transformCount = preBuildUniqueSerializeData != null ? preBuildUniqueSerializeData.transformList.Count : setupData.TransformCount; + var bindPoseList = new List(transformCount); + bindPoseList.AddRange(setupData.bindPoseList); + // rootBone/skinning bones + while (bindPoseList.Count < transformCount) + bindPoseList.Add(Matrix4x4.identity); + customMesh.bindposes = bindPoseList.ToArray(); + + // ‚ı‚­ƒ‹ƒ³‚°ç”¨ƒœƒĵƒ³‚’ĉ›¸ĉ›ˆ‚‹ + // “ƒŞ‚ıƒˆĞŻ‚ރނ¸ƒŠƒĞ‚ı‚­ƒ‹ƒ³‚°ƒœƒĵƒ³ïĵ‹ƒĴƒ³ƒ€ƒİƒĵƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ŒċĞ‚ŒĤ„‚‹ + skinnedMeshRendere.bones = transformList.ToArray(); + } + } + + // 作ĉ­ƒƒƒƒ•‚ĦƒŞ‚ğƒƒƒˆ + ResetCustomMeshWorkData(); + + // ‚Ğ‚ı‚żƒ ƒĦƒƒ‚·ƒĞèĦ¨ç¤şċˆ‡‚Šĉ›żˆ + SetMesh(customMesh); + MagicaManager.Render.SetBitsRenderDataWorkFlag(renderDataWorkIndex, RenderManager.RenderDataFlag_UseCustomMesh, true); + + // Event + if (process != null && process.cloth) + process.cloth.OnRendererMeshChange?.Invoke(process.cloth, renderer, true); + } + + void ResetCustomMeshWorkData() + { + var rm = MagicaManager.Render; + ref var wdata = ref rm.GetRenderDataWorkRef(renderDataWorkIndex); + int vcnt = setupData.vertexCount; + + // ‚ރނ¸ƒŠƒĞƒ‡ƒĵ‚ż‚’‚³ƒ”ƒĵ™‚‹ + if (setupData.HasMeshDataArray) + { + var meshData = setupData.meshDataArray[0]; + using var localPositions = new NativeArray(vcnt, Allocator.TempJob); + using var localNormals = new NativeArray(vcnt, Allocator.TempJob); + meshData.GetVertices(localPositions); + meshData.GetNormals(localNormals); + rm.renderMeshPositions.CopyFrom(localPositions, wdata.renderMeshPositionAndNormalChunk.startIndex, vcnt); + rm.renderMeshNormals.CopyFrom(localNormals, wdata.renderMeshPositionAndNormalChunk.startIndex, vcnt); + if (wdata.HasMeshTangent) + { + using var localTangents = new NativeArray(vcnt, Allocator.TempJob); + meshData.GetTangents(localTangents); + rm.renderMeshTangents.CopyFrom(localTangents, wdata.renderMeshTangentChunk.startIndex, vcnt); + wdata.flag.SetBits(RenderManager.RenderDataFlag_HasTangent, true); // ĉœ€çµ‚çš„ŞĉŽç·š‚‚Š + } + } + else + { + rm.renderMeshPositions.CopyFrom(setupData.localPositions, wdata.renderMeshPositionAndNormalChunk.startIndex, vcnt); + rm.renderMeshNormals.CopyFrom(setupData.localNormals, wdata.renderMeshPositionAndNormalChunk.startIndex, vcnt); + if (wdata.HasMeshTangent && setupData.HasTangent) + { + rm.renderMeshTangents.CopyFrom(setupData.localTangents, wdata.renderMeshTangentChunk.startIndex, vcnt); + wdata.flag.SetBits(RenderManager.RenderDataFlag_HasTangent, true); // ĉœ€çµ‚çš„ŞĉŽç·š‚‚Š + } + } + if (HasBoneWeight && wdata.HasBoneWeight) + { + using var boneWeights = new NativeArray(vcnt, Allocator.TempJob); + setupData.GetBoneWeightsRun(boneWeights); + rm.renderMeshBoneWeights.CopyFrom(boneWeights, wdata.renderMeshBoneWeightChunk.startIndex, vcnt); + } + } + + /// + /// ‚ރނ¸ƒŠƒĞƒĦƒƒ‚·ƒĞĉˆğ™ + /// + void SwapOriginalMesh(ClothProcess process) + { + var rm = MagicaManager.Render; + + if (rm.IsSetRenderDataWorkFlag(renderDataWorkIndex, RenderManager.RenderDataFlag_UseCustomMesh) && setupData != null) + { + SetMesh(originalMesh); + + if (skinnedMeshRendere != null) + { + skinnedMeshRendere.bones = transformList.ToArray(); + } + } + rm.SetBitsRenderDataWorkFlag(renderDataWorkIndex, RenderManager.RenderDataFlag_UseCustomMesh, false); + + // Event + if (process != null && process.cloth) + process.cloth.OnRendererMeshChange?.Invoke(process.cloth, renderer, false); + } + + /// + /// ƒĴƒ³ƒ€ƒİƒĵĞƒĦƒƒ‚·ƒ‚’設ċš™‚‹ + /// + /// + void SetMesh(Mesh mesh) + { + if (mesh == null) + return; + + if (setupData != null) + { + if (meshFilter != null) + { + meshFilter.mesh = mesh; + } + else if (skinnedMeshRendere != null) + { + skinnedMeshRendere.sharedMesh = mesh; + } + } + } + + //========================================================================================= + /// + /// ċˆİ用é–‹ċ§‹ + /// ċˆİ用™‚‹¨„†“¨ŻƒĦƒƒ‚·ƒĞ頂ç‚ı‚’ĉ›¸èĵ‚€“¨‚’ĉ„ċ‘³™‚‹ + /// 通ċ¸¸‚³ƒ³ƒƒĵƒƒ³ƒˆŒEnableĞŞ£Ÿ¨ĞèĦŒ† + /// + public void StartUse(ClothProcess cprocess) + { + UpdateUse(cprocess, 1); + } + + /// + /// ċˆİ用ċœĉ­˘ + /// ċœĉ­˘™‚‹¨„†“¨ŻƒĦƒƒ‚·ƒĞ頂ç‚ı‚’ĉ›¸èĵŞ„“¨‚’ĉ„ċ‘³™‚‹ + /// 通ċ¸¸‚³ƒ³ƒƒĵƒƒ³ƒˆŒDisableĞŞ£Ÿ¨ĞèĦŒ† + /// + public void EndUse(ClothProcess cprocess) + { + //Debug.Assert(useProcessSet.Count > 0); + UpdateUse(cprocess, -1); + } + + internal void UpdateUse(ClothProcess cprocess, int add) + { + if (add > 0) + { + useProcessSet.Add(cprocess); + } + else if (add < 0) + { + //Debug.Assert(useProcessSet.Count > 0); + if (useProcessSet.Contains(cprocess)) + useProcessSet.Remove(cprocess); + else + return; + } + + // InvisibleçŠĥĉ…‹ + bool invisible = useProcessSet.Any(x => (x.IsCameraCullingInvisible() && x.IsCameraCullingKeep() == false) || x.IsDistanceCullingInvisible()); + + // çŠĥĉ…‹ċ¤‰ĉ›´ + bool modifyBoneWeight = false; + if (invisible || useProcessSet.Count == 0) + { + // ċˆİ用ċœĉ­˘ + // ‚ރނ¸ƒŠƒĞƒĦƒƒ‚·ƒĞċˆ‡‚Šĉ›żˆ + SwapOriginalMesh(cprocess); + } + else if (add == 0 && useProcessSet.Count > 0) + { + // ‚Ѓރ³‚°ċİċ¸° + // ‚Ğ‚ı‚żƒ ƒĦƒƒ‚·ƒĞċˆ‡‚Šĉ›żˆ€Š‚ˆ³ä½œĉ­ƒƒƒƒ•‚Ħ作ĉˆ + // ™§Ğ‚Ğ‚ı‚żƒ ƒĦƒƒ‚·ƒŒċ­˜ċœ¨™‚‹ċ ´ċˆŻä½œĉ­ƒƒƒƒ•‚Ħżċ†ċˆĉœŸċŒ–™‚‹ + SwapCustomMesh(cprocess); + modifyBoneWeight = true; + } + else if (add > 0 && useProcessSet.Count == 1) + { + // ċˆİ用開ċ§‹ + // ‚Ğ‚ı‚żƒ ƒĦƒƒ‚·ƒĞċˆ‡‚Šĉ›żˆ€Š‚ˆ³ä½œĉ­ƒƒƒƒ•‚Ħ作ĉˆ + // ™§Ğ‚Ğ‚ı‚żƒ ƒĦƒƒ‚·ƒŒċ­˜ċœ¨™‚‹ċ ´ċˆŻä½œĉ­ƒƒƒƒ•‚Ħżċ†ċˆĉœŸċŒ–™‚‹ + SwapCustomMesh(cprocess); + modifyBoneWeight = true; + } + else if (add != 0) + { + // 複ĉ•°‹‚‰ċˆİ用•‚ŒĤ„‚‹çŠĥĉ…‹§ïĵ‘¤Œċœĉ­˘—Ÿ€‚ + // ƒƒƒƒ•‚Ħ‚’ĉœ€ċˆĉœŸċŒ–™‚‹ + ResetCustomMeshWorkData(); + modifyBoneWeight = true; + } + + // BoneWeightċ¤‰ĉ›´‚’連ċ‹•™‚‹ƒžƒƒƒ”ƒ³‚°ĞĉŒ‡ç¤ş™‚‹ + if (modifyBoneWeight) + { + ref var wdata = ref MagicaManager.Render.GetRenderDataWorkRef(renderDataWorkIndex); + int mcnt = wdata.mappingDataIndexList.Length; + for (int i = 0; i < mcnt; i++) + { + int mindex = wdata.mappingDataIndexList[i]; + ref var mdata = ref MagicaManager.Team.GetMappingDataRef(mindex); + mdata.flag.SetBits(TeamManager.MappingDataFlag_ModifyBoneWeight, true); + } + } + + //Debug.Log($"add:{add}, invisible:{invisible}, useCount:{useProcessSet.Count}, ModifyBoneWeight = {flag.IsSet(Flag_ModifyBoneWeight)}"); + } + + //========================================================================================= + /// + /// Mesh¸ĉ›¸èĵżƒ•ƒİ‚°‚’ĉ›´ĉ–°™‚‹ + /// + internal void UpdateSkipWriting() + { + isSkipWriting = false; + foreach (var cprocess in useProcessSet) + { + if (cprocess.IsSkipWriting()) + isSkipWriting = true; + } + } + + //========================================================================================= + internal void WriteMesh() + { + var rm = MagicaManager.Render; + ref var wdata = ref rm.GetRenderDataWorkRef(renderDataWorkIndex); + + if (wdata.UseCustomMesh == false || useProcessSet.Count == 0) + return; + + // ĉ›¸èĵżċœĉ­˘ä¸­Ş‚‰‚ı‚­ƒƒƒ— + if (isSkipWriting) + return; + + //Debug.Log($"WriteMesh [{Name}] ChangePositionNormal:{flag.IsSet(Flag_ChangePositionNormal)}, ChangeBoneWeight:{flag.IsSet(Flag_ChangeBoneWeight)}"); + + // ƒĦƒƒ‚·ƒĞċĉ˜  + if (wdata.flag.IsSet(RenderManager.RenderDataFlag_WritePositionNormal)) + { + customMesh.SetVertices(rm.renderMeshPositions.GetNativeArray(), wdata.renderMeshPositionAndNormalChunk.startIndex, wdata.renderMeshPositionAndNormalChunk.dataLength); + customMesh.SetNormals(rm.renderMeshNormals.GetNativeArray(), wdata.renderMeshPositionAndNormalChunk.startIndex, wdata.renderMeshPositionAndNormalChunk.dataLength); + wdata.flag.SetBits(RenderManager.RenderDataFlag_WritePositionNormal, false); + //Debug.Log($"[{customMesh.name}] Write Position+Normal"); + } + if (wdata.flag.IsSet(RenderManager.RenderDataFlag_WriteTangent)) + { + customMesh.SetTangents(rm.renderMeshTangents.GetNativeArray(), wdata.renderMeshTangentChunk.startIndex, wdata.renderMeshTangentChunk.dataLength); + wdata.flag.SetBits(RenderManager.RenderDataFlag_WriteTangent, false); + //Debug.Log($"[{customMesh.name}] Write Tangent"); + } + if (wdata.flag.IsSet(RenderManager.RenderDataFlag_WriteBoneWeight)) + { + // BoneWeightŻNativeArrayċŒşé–“ĉŒ‡ċšŒ§Ş„ + var boneWeightsSlice = new NativeSlice(rm.renderMeshBoneWeights.GetNativeArray(), wdata.renderMeshBoneWeightChunk.startIndex, wdata.renderMeshBoneWeightChunk.dataLength); + customMesh.boneWeights = boneWeightsSlice.ToArray(); + wdata.flag.SetBits(RenderManager.RenderDataFlag_WriteBoneWeight, false); + //Debug.Log($"[{customMesh.name}] Write BoneWeight"); + } + } + + //========================================================================================= + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + + sb.Append($">>> [{Name}] ref:{ReferenceCount}, useProcess:{useProcessSet.Count}, HasSkinnedMesh:{HasSkinnedMesh}, HasBoneWeight:{HasBoneWeight}"); + sb.AppendLine(); + + return sb.ToString(); + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/Render/RenderData.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Manager/Render/RenderData.cs.meta new file mode 100644 index 00000000..efdab0df --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/Render/RenderData.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: e66794d18ed5f514ebae30c42e05a9f1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Manager/Render/RenderData.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/Render/RenderManager.cs b/Assets/MagicaCloth2/Scripts/Core/Manager/Render/RenderManager.cs new file mode 100644 index 00000000..7c305314 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/Render/RenderManager.cs @@ -0,0 +1,403 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System.Collections.Generic; +using System.Text; +using Unity.Collections; +using Unity.Mathematics; +using Unity.Profiling; +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// ĉç”ğçĦ理¨ƒĦƒƒ‚·ƒĉ›´ĉ–°ƒžƒƒĵ‚¸ƒ£ + /// + public class RenderManager : IManager, IValid + { + /// + /// ĉç”ğƒ‡ƒĵ‚ż‚’intċž‹ƒƒ³ƒ‰ƒĞ§çĦ理™‚‹ + /// + Dictionary renderDataDict = new Dictionary(); + + //========================================================================================= + // ■RenderData + //========================================================================================= + /// + /// RenderDataçŠĥĉ…‹ƒ•ƒİ‚°(32bit) + /// + public const int RenderDataFlag_UseCustomMesh = 0; // ‚Ğ‚ı‚żƒ ƒĦƒƒ‚·ƒċˆİ用 + public const int RenderDataFlag_WritePositionNormal = 1; // ċş§ĉ¨™Š‚ˆ³ĉ³•ç·šĉ›¸èĵż + public const int RenderDataFlag_WriteBoneWeight = 2; // ƒœƒĵƒ³‚Ĥ‚¨‚¤ƒˆĉ›¸èĵż + //public const int RenderDataFlag_ModifyBoneWeight = 3; // ƒœƒĵƒ³‚Ĥ‚¨‚¤ƒˆċ¤‰ĉ›´ + public const int RenderDataFlag_HasMeshTangent = 4; // ‚ރނ¸ƒŠƒĞƒĦƒƒ‚·ƒŒĉŽç·š‚’ĉŒ£Ĥ„‚‹‹İ†‹ + public const int RenderDataFlag_HasTangent = 5; // ĉœ€çµ‚çš„ĞĉŽç·šĉƒ…ċ ħ‚’ĉŒ£Ĥ„‚‹‹İ†‹ + public const int RenderDataFlag_WriteTangent = 6; // ĉŽç·šĉ›¸èĵż + public const int RenderDataFlag_HasSkinnedMesh = 7; + public const int RenderDataFlag_HasBoneWeight = 8; + + public struct RenderDataWork : IValid + { + /// + /// RenderDataçŠĥĉ…‹ƒ•ƒİ‚° + /// + public BitField32 flag; + + /// + /// ƒƒƒƒ•‚Ħ¸ĉ ĵ納ċ…ˆĉƒ…ċ ħ + /// + public DataChunk renderMeshPositionAndNormalChunk; + public DataChunk renderMeshTangentChunk; + public DataChunk renderMeshBoneWeightChunk; + + /// + /// ċˆĥċĦ頂ç‚ıĞ設ċš™‚‹ƒœƒĵƒ³‚Ĥ‚¨‚¤ƒˆ + /// + public BoneWeight centerBoneWeight; + + /// + /// 紐‘‚‰‚ŒĤ„‚‹ƒžƒƒƒ”ƒ³‚°ƒĦƒƒ‚·ƒƒ‡ƒĵ‚ż¸‚¤ƒ³ƒ‡ƒƒ‚Ż‚ıƒŞ‚ıƒˆ + /// + public FixedList32Bytes mappingDataIndexList; + + public bool IsValid() + { + return renderMeshPositionAndNormalChunk.IsValid; + } + + public bool UseCustomMesh => flag.IsSet(RenderDataFlag_UseCustomMesh); + public bool HasMeshTangent => flag.IsSet(RenderDataFlag_HasMeshTangent); + public bool HasTangent => flag.IsSet(RenderDataFlag_HasTangent); + public bool HasBoneWeight => flag.IsSet(RenderDataFlag_HasBoneWeight); + + public void AddMappingIndex(int mindex) + { + mappingDataIndexList.Add((short)mindex); + } + + public void RemoveMappingIndex(int mindex) + { + mappingDataIndexList.MC2RemoveItemAtSwapBack((short)mindex); + } + } + public ExNativeArray renderDataWorkArray; + + public int RenderDataWorkCount => renderDataWorkArray?.Count ?? 0; + + //========================================================================================= + // ■RenderMesh + //========================================================================================= + public ExNativeArray renderMeshPositions; + public ExNativeArray renderMeshNormals; + public ExNativeArray renderMeshTangents; + public ExNativeArray renderMeshBoneWeights; + + bool isValid = false; + + //========================================================================================= + public void Initialize() + { + Dispose(); + + // 作ĉ­ƒƒƒƒ•‚Ħ + const int capacity = 0; + const bool create = true; + renderDataWorkArray = new ExNativeArray(capacity, create); + renderMeshPositions = new ExNativeArray(capacity, create); + renderMeshNormals = new ExNativeArray(capacity, create); + renderMeshTangents = new ExNativeArray(capacity, create); + renderMeshBoneWeights = new ExNativeArray(capacity, create); + + // ĉ›´ĉ–°ċ‡Ĥ理 + MagicaManager.afterDelayedDelegate += PreRenderingUpdate; + + isValid = true; + } + + public void EnterdEditMode() + { + Dispose(); + } + + public void Dispose() + { + isValid = false; + + lock (renderDataDict) + { + foreach (var rinfo in renderDataDict.Values) + { + rinfo?.Dispose(); + } + } + renderDataDict.Clear(); + + // 作ĉ­ƒƒƒƒ•‚Ħ + renderDataWorkArray?.Dispose(); + renderMeshPositions?.Dispose(); + renderMeshNormals?.Dispose(); + renderMeshTangents?.Dispose(); + renderMeshBoneWeights?.Dispose(); + renderDataWorkArray = null; + renderMeshPositions = null; + renderMeshNormals = null; + renderMeshBoneWeights = null; + renderMeshTangents = null; + + // ĉ›´ĉ–°ċ‡Ĥ理 + MagicaManager.afterDelayedDelegate -= PreRenderingUpdate; + } + + public bool IsValid() + { + return isValid; + } + + //========================================================================================= + /// + /// çĦ理™‚‹ƒĴƒ³ƒ€ƒİƒĵèż½ċŠ ïĵˆƒĦ‚¤ƒ³‚ıƒĴƒƒƒ‰żïĵ‰ + /// + /// + /// + public MagicaObjectId AddRenderer( + Renderer ren, + RenderSetupData referenceSetupData, + RenderSetupData.UniqueSerializationData referenceUniqueSetupData, + RenderSetupSerializeData referenceInitSetupData + ) + { + if (isValid == false) + return MagicaObjectId.Invalid; + Debug.Assert(ren); + + // ċˆĥċĦƒƒ³ƒ‰ƒĞ + MagicaObjectId handle = ren.GetMagicaId(); + + lock (renderDataDict) + { + if (renderDataDict.ContainsKey(handle) == false) + { + // ĉ–°èĤ + var rdata = new RenderData(); + rdata.Initialize(ren, referenceSetupData, referenceUniqueSetupData, referenceInitSetupData); + renderDataDict.Add(handle, rdata); + } + + // ċ‚ç…§‚Ğ‚Ĥƒ³ƒˆ+ + renderDataDict[handle].AddReferenceCount(); + } + + return handle; + } + + public bool RemoveRenderer(MagicaObjectId handle) + { + if (isValid == false) + return false; + + bool delete = false; + + //Debug.Log($"RemoveRenderer:{handle}"); + //Debug.Assert(ren); + Debug.Assert(renderDataDict.ContainsKey(handle)); + + lock (renderDataDict) + { + if (renderDataDict.ContainsKey(handle)) + { + var rdata = renderDataDict[handle]; + if (rdata.RemoveReferenceCount() == 0) + { + // ç ´ĉ£„™‚‹ + rdata.Dispose(); + + renderDataDict.Remove(handle); + + delete = true; + } + } + } + + return delete; + } + + public RenderData GetRendererData(MagicaObjectId handle) + { + if (isValid == false) + return null; + + lock (renderDataDict) + { + if (renderDataDict.ContainsKey(handle)) + return renderDataDict[handle]; + else + return null; + + } + } + + //========================================================================================= + public int AddRenderDataWork(RenderData rdata) + { + if (isValid == false) + return -1; + + var wdata = new RenderDataWork(); + + // ‚ރނ¸ƒŠƒĞƒĦƒƒ‚·ƒĉŽç·šĉƒ…ċ ħ‚’確èލ + wdata.flag.SetBits(RenderDataFlag_HasMeshTangent, rdata.originalMesh.HasVertexAttribute(UnityEngine.Rendering.VertexAttribute.Tangent)); + //Debug.Log($"OriginalMesh[{originalMesh.name}] hasTangent:{originalMesh.HasVertexAttribute(UnityEngine.Rendering.VertexAttribute.Tangent)}"); + + // Flag + wdata.flag.SetBits(RenderDataFlag_HasSkinnedMesh, rdata.HasSkinnedMesh); + wdata.flag.SetBits(RenderDataFlag_HasBoneWeight, rdata.HasBoneWeight); + + // ‚ğƒ³‚żƒĵƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ç”¨ƒœƒĵƒ³‚Ĥ‚¨‚¤ƒˆ + var centerBoneWeight = new BoneWeight(); + centerBoneWeight.boneIndex0 = rdata.setupData.renderTransformIndex; + centerBoneWeight.weight0 = 1.0f; + wdata.centerBoneWeight = centerBoneWeight; + + // ƒĴƒ³ƒ€ƒĵƒĦƒƒ‚·ƒç”¨ƒƒƒƒ•‚Ħ確保 + int vcnt = rdata.originalMesh.vertexCount; + wdata.renderMeshPositionAndNormalChunk = renderMeshPositions.AddRange(vcnt); + renderMeshNormals.AddRange(vcnt); + if (wdata.HasMeshTangent) + wdata.renderMeshTangentChunk = renderMeshTangents.AddRange(vcnt); + if (wdata.HasBoneWeight) + { + wdata.renderMeshBoneWeightChunk = renderMeshBoneWeights.AddRange(vcnt); + } + + // ĉ ĵ納 + var c = renderDataWorkArray.Add(wdata); + return c.startIndex; + } + + public void RemoveRenderDataWork(int index) + { + if (isValid == false) + return; + if (index < 0) + return; + + // ƒƒƒƒ•‚Ħċ‰Šé™¤ + ref var wdata = ref GetRenderDataWorkRef(index); + if (wdata.renderMeshPositionAndNormalChunk.IsValid) + { + renderMeshPositions.Remove(wdata.renderMeshPositionAndNormalChunk); + renderMeshNormals.Remove(wdata.renderMeshPositionAndNormalChunk); + } + if (wdata.renderMeshTangentChunk.IsValid) + { + renderMeshTangents.Remove(wdata.renderMeshTangentChunk); + } + if (wdata.renderMeshBoneWeightChunk.IsValid) + { + renderMeshBoneWeights.Remove(wdata.renderMeshBoneWeightChunk); + } + wdata.renderMeshPositionAndNormalChunk.Clear(); + wdata.renderMeshTangentChunk.Clear(); + wdata.renderMeshBoneWeightChunk.Clear(); + wdata.flag.Clear(); + + // ċ‰Šé™¤ + renderDataWorkArray.RemoveAndFill(new DataChunk(index)); + } + + public ref RenderDataWork GetRenderDataWorkRef(int index) + { + return ref renderDataWorkArray.GetRef(index); + } + + public bool IsSetRenderDataWorkFlag(int index, int flag) + { + ref var wdata = ref GetRenderDataWorkRef(index); + return wdata.flag.IsSet(flag); + } + + public void SetBitsRenderDataWorkFlag(int index, int flag, bool sw) + { + ref var wdata = ref GetRenderDataWorkRef(index); + wdata.flag.SetBits(flag, sw); + } + + //========================================================================================= + /// + /// ĉœ‰ċŠıċŒ– + /// + /// + public void StartUse(ClothProcess cprocess, MagicaObjectId handle) + { + GetRendererData(handle)?.StartUse(cprocess); + } + + /// + /// ç„ĦċŠıċŒ– + /// + /// + public void EndUse(ClothProcess cprocess, MagicaObjectId handle) + { + GetRendererData(handle)?.EndUse(cprocess); + } + + //========================================================================================= + static readonly ProfilerMarker writeMeshTimeProfiler = new ProfilerMarker("WriteMesh"); + + /// + /// ƒĴƒ³ƒ€ƒŞƒ³‚°ċ‰ĉ›´ĉ–° + /// + void PreRenderingUpdate() + { + if (renderDataDict.Count == 0) + return; + + // ƒĦƒƒ‚·ƒ¸ċĉ˜  + writeMeshTimeProfiler.Begin(); + foreach (var rdata in renderDataDict.Values) + rdata?.WriteMesh(); + writeMeshTimeProfiler.End(); + } + + //========================================================================================= + public void InformationLog(StringBuilder allsb) + { + StringBuilder sb = new StringBuilder(); + sb.AppendLine($"========== Render Manager =========="); + if (IsValid() == false) + { + sb.AppendLine($"Render Manager. Invalid."); + } + else + { + sb.AppendLine($"Render Manager. Count({renderDataDict.Count})"); + sb.AppendLine($" [RenderMeshBuffer]"); + sb.AppendLine($" -renderMeshPositions:{renderMeshPositions.ToSummary()}"); + sb.AppendLine($" -renderMeshNormals:{renderMeshNormals.ToSummary()}"); + sb.AppendLine($" -renderMeshTangents:{renderMeshTangents.ToSummary()}"); + + sb.AppendLine($" [RenderDataWork]"); + sb.AppendLine($" -Count:{renderDataWorkArray.Count}"); + if (renderDataWorkArray.Count > 0) + { + for (int j = 0; j < renderDataWorkArray.Count; j++) + { + var wdata = renderDataWorkArray[j]; + if (wdata.IsValid() == false) + continue; + sb.AppendLine($" [{j}] MappingListCount:{wdata.mappingDataIndexList.Length}"); + } + } + + sb.AppendLine($" [RenderData]"); + foreach (var kv in renderDataDict) + { + sb.Append(kv.Value.ToString()); + } + } + sb.AppendLine(); + Debug.Log(sb.ToString()); + allsb.Append(sb); + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/Render/RenderManager.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Manager/Render/RenderManager.cs.meta new file mode 100644 index 00000000..73cabb52 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/Render/RenderManager.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 99868f3bace6c8d4fa0de07238d7b777 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Manager/Render/RenderManager.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/Render/RenderSetupData.cs b/Assets/MagicaCloth2/Scripts/Core/Manager/Render/RenderSetupData.cs new file mode 100644 index 00000000..893b4bfd --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/Render/RenderSetupData.cs @@ -0,0 +1,911 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System; +using System.Collections.Generic; +using Unity.Burst; +using Unity.Collections; +using Unity.Jobs; +using Unity.Mathematics; +using Unity.Profiling; +using UnityEngine; +using UnityEngine.Jobs; + +namespace MagicaCloth2 +{ + /// + /// ĉç”ğċŻèħĦċŸşĉœĴĉƒ…ċ ħ + /// ƒĴƒ³ƒ€ƒİƒĵŸŻƒœƒĵƒ³ĉ§‹ĉˆĉƒ…ċ ħ + /// “ĉƒ…ċ ħ‚’‚‚¨Ğäğĉƒ³ƒĦƒƒ‚·ƒŞİ‚’作ĉˆ™‚‹ + /// Ÿ“ĉƒ…ċ ħŻ‚­ƒ£ƒİ‚Ż‚żƒĵŒċ‹•ċ‡ş™ċ‰Ğċ–ċ——ĤŠċż…èĤŒ‚‚‹ + /// Ÿ‚Awake()Şİ§ċŸèĦŒ™‚‹ + /// + public partial class RenderSetupData : IDisposable, ITransform + { + public ResultCode result; + public string name = string.Empty; + public bool isManaged; // pre-build DeserializeManagerçĦ理 + + // ‚ż‚¤ƒ— + public enum SetupType + { + MeshCloth = 0, + BoneCloth = 1, + BoneSpring = 2, + } + public SetupType setupType; + + // Mesh --------------------------------------------------------------- + // ƒĴƒ³ƒ€ƒİƒĵ¨ƒĦƒƒ‚·ƒĉƒ…ċ ħ + public Renderer renderer; + public SkinnedMeshRenderer skinRenderer; + public MeshFilter meshFilter; + public Mesh originalMesh; + public int vertexCount; + public bool hasSkinnedMesh; // SkinnedMeshRenderer‚’ċˆİ用—Ĥ„‚‹‹İ†‹ + public bool hasBoneWeight; // SkinnedMeshRenderer§‚‚ƒœƒĵƒ³‚Ĥ‚¨‚¤ƒˆ‚’ĉŒ£Ĥ„Ş„‚ħƒĵ‚ı‚‚Šïĵ + public Mesh.MeshDataArray meshDataArray;€€// Job§ċˆİ用™‚‹Ÿ‚MeshData + public int skinRootBoneIndex; + public int skinBoneCount; + + // MeshData§Żċ–ċ—§Ş„ƒĦƒƒ‚·ƒĉƒ…ċ ħ + public List bindPoseList; + public NativeArray bonesPerVertexArray; + public NativeArray boneWeightArray; + + // PreBuildĉ™‚żäżĉŒ™‚‹ĉƒ…ċ ħ.逆ĞmeshDataArrayŻĉŒŸŞ„ + public NativeArray localPositions; + public NativeArray localNormals; + public NativeArray localTangents; + + // Bone --------------------------------------------------------------- + public List rootTransformIdList; + public enum BoneConnectionMode + { + // line only. + // ƒİ‚¤ƒ³ż + Line = 0, + + //Automatically mesh connection according to the interval of Transform. + // Transformé–“éš”Ğċ“„è‡Şċ‹•§ƒĦƒƒ‚·ƒĉŽçĥš + AutomaticMesh = 1, + + //Generate meshes in the order of Transforms registered in RootList and connect the beginning and end in a loop. + // RootListĞç™ğ録•‚ŒŸTransformé †ĞƒĦƒƒ‚·ƒ‚’生ĉˆ—€ĉœ€ċˆ¨ĉœ€ċŒ‚’ƒĞƒĵƒ—çŠĥĞçı‹’‚‹ + SequentialLoopMesh = 2, + + // Generate meshes in the order of Transforms registered in RootList, but do not connect the beginning and end. + // RootListĞç™ğ録•‚ŒŸTransformé †ĞƒĦƒƒ‚·ƒ‚’生ĉˆ™‚‹Œĉœ€ċˆ¨ĉœ€ċŒ‚’çı‹’Ş„ + SequentialNonLoopMesh = 3, + } + public BoneConnectionMode boneConnectionMode = BoneConnectionMode.Line; + public List collisionBoneIndexList; // BoneSpring‚³ƒŞ‚¸ƒ§ƒ³ĉœ‰ċŠıTransform‚¤ƒ³ƒ‡ƒƒ‚Ż‚ıƒŞ‚ıƒˆ + + // Common ------------------------------------------------------------- + // Transformĉƒ…ċ ħ + // 通ċ¸¸ƒĦƒƒ‚·ƒŻrenderTransorm100%‚ı‚­ƒ‹ƒ³‚°¨—Ĥĉ‰ħ‚‚Œ‚‹ + public List transformList; // skin bonesŻ[0]~skinBoneCount§ + public List transformIdList; + public List transformParentIdList; // èĤŞID(0=Ş—) + public List> transformChildIdList; // ċ­IDƒŞ‚ıƒˆ + public NativeArray transformPositions; + public NativeArray transformRotations; + public NativeArray transformLocalPositions; + public NativeArray transformLocalRotations; + public NativeArray transformScales; + public NativeArray transformInverseRotations; + public int renderTransformIndex; // ĉç”ğċŸşĉş–ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ  + public float4x4 initRenderLocalToWorld; // ċˆĉœŸċŒ–ĉ™‚ċŸşĉş–ƒžƒˆƒŞƒƒ‚Ż‚ı(LtoW) + public float4x4 initRenderWorldtoLocal; // ċˆĉœŸċŒ–ĉ™‚ċŸşĉş–ƒžƒˆƒŞƒƒ‚Ż‚ı(WtoL) + public quaternion initRenderRotation; // ċˆĉœŸċŒ–ĉ™‚ċŸşĉş–ċ›žèğ˘ + public float3 initRenderScale; // ċˆĉœŸċŒ–ĉ™‚ċŸşĉş–‚ı‚ħƒĵƒĞ + + public bool IsSuccess() => result.IsSuccess(); + public bool IsFaild() => result.IsFaild(); + public int TransformCount => transformList?.Count ?? 0; + public bool HasMeshDataArray => meshDataArray.Length > 0; + public bool HasLocalPositions => localPositions.IsCreated; + public bool HasTangent => localTangents.IsCreated && localTangents.Length > 0; + + static readonly ProfilerMarker readTransformProfiler = new ProfilerMarker("readTransform"); + + //========================================================================================= + public RenderSetupData() { } + + /// + /// ƒĴƒ³ƒ€ƒİƒĵ‹‚‰ċŸşĉœĴĉƒ…ċ ħ‚’作ĉˆ™‚‹ïĵˆƒĦ‚¤ƒ³‚ıƒĴƒƒƒ‰żïĵ‰ + /// ‚ż‚¤ƒ—ŻMeshĞŞ‚‹ + /// + /// + public RenderSetupData(RenderSetupSerializeData referenceInitSetupData, Renderer ren) + { + //using (initProfiler.Auto()) + { + result.Clear(); + // Mesh‚ż‚¤ƒ—Ğ設ċš + setupType = SetupType.MeshCloth; + + if (ren == null) + { + Develop.LogWarning("Renderer is null!"); + result.SetError(Define.Result.RenderSetup_InvalidSource); + return; + } + + // ċˆĉœŸċŒ–ƒ‡ƒĵ‚żĉœ‰ç„Ħ + bool useInitData = referenceInitSetupData != null; + + name = ren.name; + + var sren = ren as SkinnedMeshRenderer; + + hasSkinnedMesh = sren ? true : false; + hasBoneWeight = false; + skinRenderer = sren; + Mesh mesh; + + // ċż…èĤŞƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ĉƒ…ċ ħ + // ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ‚Żƒİ‚ı¨‚¤ƒ³‚ı‚żƒ³‚ıID‚’ċŽé›†™‚‹ + // ĉç”ğċŸşĉş–ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ  + var renderTransform = ren.transform; + + if (useInitData) + { + // ċˆĉœŸċŒ–ƒ‡ƒĵ‚żŒ‚‚‹ċ ´ċˆŻ‚³ƒ”ƒĵ—Ĥ終‚‚Š + skinBoneCount = referenceInitSetupData.skinBoneCount; + skinRootBoneIndex = referenceInitSetupData.skinRootBoneIndex; + renderTransformIndex = referenceInitSetupData.renderTransformIndex; + hasBoneWeight = referenceInitSetupData.hasBoneWeight; + + // transformListċİċ…ƒ + transformList = new List(new Transform[referenceInitSetupData.transformCount]); + int ucnt = referenceInitSetupData.useTransformCount; + for (int i = 0; i < ucnt; i++) + { + int tindex = referenceInitSetupData.useTransformIndexArray[i]; + transformList[tindex] = referenceInitSetupData.transformArray[i]; + } + + // SkinnedMeshRenderer‹¤‚ރނ¸ƒŠƒĞƒĦƒƒ‚·ƒŒċ­˜ċœ¨™‚‹ċ ´ċˆŻSkinnedMeshRenerer‚’ċİċ…ƒ™‚‹ + // ċŸèĦŒĉ™‚‚­ƒ£ƒİ‚Ż‚żƒĵ‚³ƒ”ƒĵ¸ċŻċżœ + if (sren && referenceInitSetupData.originalMesh && sren.sharedMesh != referenceInitSetupData.originalMesh && skinBoneCount > 0) + { + sren.sharedMesh = referenceInitSetupData.originalMesh; + var newBones = new Transform[skinBoneCount]; + transformList.CopyTo(0, newBones, 0, skinBoneCount); + sren.bones = newBones; + sren.rootBone = transformList[skinRootBoneIndex]; + //Debug.Log($"★SkinnedMeshRendererċ†ĉ§‹ĉˆ"); + } + } + else if (sren) + { + // bones + // “‚ı‚­ƒ‹ƒ³‚°ƒœƒĵƒ³ċ–ċ—Œç‰ıĞ重ƒĦƒ˘ƒŞ‚˘ƒ­‚ħƒĵ‚·ƒ§ƒ³‚‚é ğ発™‚‹ċ•éĦŒċ… + // —‹—ċ›žéżĉ–ıĉ³•ŒŞ„Ÿ‚ççŠĥ‚„‚€Ş— + var bones = sren.bones; + if (bones == null || bones.Length == 0) + { + // ƒ–ƒĴƒ³ƒ‰‚·‚§‚¤ƒ—§Żƒœƒĵƒ³‚„é ‚ç‚ı‚Ĥ‚¨‚¤ƒˆŒç„ĦĤ‚‚SkinnedMeshRendererŒċˆİ用•‚Œ‚‹ + // ƒ–ƒĴƒ³ƒ‰‚·‚§‚¤ƒ—ĉݟ能ŒSkinnedMeshRendererĞ—‹ç„Ħ„Ÿ‚ + // Ÿ‚€“‚ˆ†Ş‚ħƒĵ‚ı§ŻSkinnedMeshRenderer§‚‚‹Œé€šċ¸¸ƒĦƒƒ‚·ƒ¨—Ĥĉ‰ħ†“¨Ğ™‚‹ + // bones + skinBoneCount = 1; + transformList = new List(skinBoneCount); + transformList.Add(renderTransform); + + // rootBone + skinRootBoneIndex = 0; + + // render + renderTransformIndex = 0; + } + else + { + skinBoneCount = bones.Length; + transformList = new List(skinBoneCount + 2); + transformList.AddRange(bones); + + // rootBone + var rootBone = sren.rootBone ? sren.rootBone : renderTransform; + skinRootBoneIndex = transformList.Count; + transformList.Add(rootBone); + + // render + renderTransformIndex = transformList.Count; + transformList.Add(renderTransform); + + hasBoneWeight = true; + } + } + else + { + // bones + skinBoneCount = 1; + transformList = new List(skinBoneCount); + transformList.Add(renderTransform); + + // rootBone + skinRootBoneIndex = 0; + + // render + renderTransformIndex = 0; + } + + // ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ĉƒ…ċ ħèŞ­żċ–‚Š + ReadTransformInformation(includeChilds: false, referenceInitSetupData, ren.transform); + + // bindpose / weights + if (sren) + { + mesh = sren.sharedMesh; + if (mesh == null) + { + Develop.LogWarning("SkinnedMeshRenderer.sharedMesh is null!"); + result.SetError(Define.Result.RenderSetup_NoMeshOnRenderer); + return; + } + + if (hasBoneWeight) + { + bindPoseList = new List(mesh.bindposes); + + // İ†‚‚‚³ƒ”ƒĵ‚’作‚‰Ş„¨ƒ€ƒĦ‚‰—„.. + // â€ğċ…·ä½“çš„ĞŻƒĦƒƒ‚·ƒ‚Żƒ­ƒĵƒ³‚’作ĉˆ—Ÿ¨Ğċ£Š‚Œ‚‹ + using var weightArray = mesh.GetAllBoneWeights(); + using var perVertexArray = mesh.GetBonesPerVertex(); + boneWeightArray = new NativeArray(weightArray, Allocator.Persistent); + bonesPerVertexArray = new NativeArray(perVertexArray, Allocator.Persistent); + +#if UNITY_EDITOR + // ïĵ•ƒœƒĵƒ³äğ上‚’ċˆİ用™‚‹é ‚ç‚ı‚Ĥ‚¨‚¤ƒˆŻè­Ĥċ‘Ё¨™‚‹€‚一ċżœç„ĦċŠı¨Ş‚‹ ‘§ċ‹•§‚¨ƒİƒĵĞŻ—Ş„€‚ + // ŞŠ“ĉ¤œè¨ĵŻƒ“ƒĞƒ‰ç’°ċ˘ƒ§ŻèĦŒ‚Ş„ + int vcnt = mesh.vertexCount; + using var bonesPerVertexResult = new NativeReference(Allocator.TempJob); + var job = new VertexWeight5BoneCheckJob() + { + vcnt = vcnt, + bonesPerVertexArray = bonesPerVertexArray, + result = bonesPerVertexResult, + }; + job.Run(); + result.SetWarning(bonesPerVertexResult.Value); +#endif + } + else + { + bindPoseList = new List(1); + bindPoseList.Add(Matrix4x4.identity); + } + } + else + { + if (!ren.TryGetComponent(out var filter)) + { + result.SetError(Define.Result.RenderSetup_InvalidSource); + return; + } + mesh = filter.sharedMesh; + if (mesh == null) + { + Develop.LogWarning("MeshFilter.sharedMesh is null!"); + result.SetError(Define.Result.RenderSetup_NoMeshOnRenderer); + return; + } + + bindPoseList = new List(1); + bindPoseList.Add(Matrix4x4.identity); + meshFilter = filter; + } + + if (mesh.isReadable == false) + { + result.SetError(Define.Result.RenderSetup_Unreadable); + return; + } + if (mesh.vertexCount > 65535) + { + result.SetError(Define.Result.RenderSetup_Over65535vertices); + return; + } + + // ‚ıƒĴƒƒƒ‰§ƒĦƒƒ‚·ƒƒ‡ƒĵ‚ż‚’ĉ§‹ç݉™‚‹Ÿ‚Ğ‚ރނ¸ƒŠƒĞMeshData‚’ċ–ċ—™‚‹ + // mesh data array + meshDataArray = Mesh.AcquireReadOnlyMeshData(mesh); + + // renderer¨mesh‚’記録 + renderer = ren; + originalMesh = mesh; + vertexCount = mesh.vertexCount; + + // ċŒäş† + result.SetSuccess(); + } + } + +#if UNITY_EDITOR + /// + /// ïĵ•‚Ĥ‚¨‚¤ƒˆäğ上ĉ¤œċ‡ş + /// + [BurstCompile] + struct VertexWeight5BoneCheckJob : IJob + { + public int vcnt; + + [Unity.Collections.ReadOnly] + public NativeArray bonesPerVertexArray; + + [Unity.Collections.WriteOnly] + public NativeReference result; + + public void Execute() + { + result.Value = Define.Result.None; + + for (int i = 0; i < vcnt; i++) + { + if (bonesPerVertexArray[i] >= 5) + { + result.Value = Define.Result.RenderMesh_VertexWeightIs5BonesOrMore; + break; + } + } + } + } +#endif + + /// + /// ƒĞƒĵƒˆƒœƒĵƒ³ƒŞ‚ıƒˆ‹‚‰ċŸşĉœĴĉƒ…ċ ħ‚’作ĉˆ™‚‹ïĵˆƒĦ‚¤ƒ³‚ıƒĴƒƒƒ‰żïĵ‰ + /// ‚ż‚¤ƒ—ŻBoneĞŞ‚‹ + /// + /// + /// + public RenderSetupData( + RenderSetupSerializeData referenceInitSetupData, + SetupType setType, + Transform renderTransform, + List rootTransforms, + List collisionBones, + BoneConnectionMode connectionMode = BoneConnectionMode.Line, + string name = "(no name)" + ) + { + result.Clear(); + + //using (initProfiler.Auto()) + try + { + bool useInitData = referenceInitSetupData != null; + + // Bone‚ż‚¤ƒ—Ğ設ċš + setupType = setType; + + // ĉŽçĥšƒ˘ƒĵƒ‰ + boneConnectionMode = connectionMode; + + if (renderTransform == null) + { + //Debug.LogWarning("render transform is null!"); + result.SetError(Define.Result.RenderSetup_InvalidSource); + return; + } + if (rootTransforms == null || rootTransforms.Count == 0) + { + //Debug.LogWarning("rootBones is empty!"); + result.SetError(Define.Result.RenderSetup_InvalidSource); + return; + } + + this.name = name; + + // ċż…èĤŞƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ĉƒ…ċ ħ + if (useInitData) + { + // ċˆĉœŸċŒ–ƒ‡ƒĵ‚żŒ‚‚‹ċ ´ċˆŻ‚³ƒ”ƒĵ—Ĥ終‚‚Š + transformList = new List(referenceInitSetupData.transformArray); + skinBoneCount = referenceInitSetupData.skinBoneCount; + renderTransformIndex = referenceInitSetupData.renderTransformIndex; + } + else + { + var indexDict = new Dictionary(256); + transformList = new List(256); + + // rootäğ下‚’™ıĤç™ğ録™‚‹ + var stack = new Stack(256); + foreach (var t in rootTransforms) + stack.Push(t); + while (stack.Count > 0) + { + var t = stack.Pop(); + if (indexDict.ContainsKey(t)) + continue; + + // ç™ğ録 + int index = transformList.Count; + transformList.Add(t); + indexDict.Add(t, index); + + // child + int cnt = t.childCount; + for (int i = 0; i < cnt; i++) + { + stack.Push(t.GetChild(i)); + } + } + + // ‚ı‚­ƒ‹ƒ³‚°ƒœƒĵƒ³ĉ•° + skinBoneCount = transformList.Count; + + // ƒĴƒ³ƒ€ƒĵƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ‚’ĉœ€ċŒĞèż½ċŠ  + renderTransformIndex = transformList.Count; + transformList.Add(renderTransform); + } + + // root transform id + rootTransformIdList = new List(rootTransforms.Count); + foreach (var t in rootTransforms) + { + rootTransformIdList.Add(t.GetMagicaId()); + } + + // collision transform (use BoneSpring) + if (collisionBones != null) + { + collisionBoneIndexList = new List(collisionBones.Count); + foreach (var t in collisionBones) + { + if (t) + { + int index = transformList.IndexOf(t); + collisionBoneIndexList.Add(index); + //Debug.Log($"collision bones:{t.name}, index:{index}"); + } + } + } + + // ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ĉƒ…ċ ħèŞ­żċ–‚Š + ReadTransformInformation(includeChilds: true, referenceInitSetupData, renderTransform); + + // ċŒäş† + result.SetSuccess(); + } + catch (MagicaClothProcessingException) + { + if (result.IsError() == false) + result.SetError(Define.Result.RenderSetup_UnknownError); + result.DebugLog(); + } + catch (Exception exception) + { + Debug.LogException(exception); + result.SetError(Define.Result.RenderSetup_Exception); + } + } + + /// + /// ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ĉƒ…ċ ħèŞ­żċ–‚ŠïĵˆƒĦ‚¤ƒ³‚ıƒĴƒƒƒ‰żïĵ‰ + /// “ĉƒ…ċ ħ ‘Ż‚­ƒ£ƒİ‚Ż‚żƒĵŒċ‹•ċ‰Ğċ–ċ—™‚‹ċż…èĤŒ‚‚‹ + /// + void ReadTransformInformation(bool includeChilds, RenderSetupSerializeData referenceInitSetupData, Transform rendererTransform) + { + readTransformProfiler.Begin(); + + int tcnt = transformList.Count; + bool useInitData = referenceInitSetupData != null; + + // ƒƒƒƒ•‚Ħ作ĉˆ + transformPositions = new NativeArray(tcnt, Allocator.Persistent); + transformRotations = new NativeArray(tcnt, Allocator.Persistent); + transformLocalPositions = new NativeArray(tcnt, Allocator.Persistent); + transformLocalRotations = new NativeArray(tcnt, Allocator.Persistent); + transformScales = new NativeArray(tcnt, Allocator.Persistent); + transformInverseRotations = new NativeArray(tcnt, Allocator.Persistent); + + // èŞ­żċ–‚Š + if (useInitData) + { + Debug.Assert(tcnt == referenceInitSetupData.transformCount); + + // ċˆĉœŸċŒ–ƒ‡ƒĵ‚żŒ‚‚‹ċ ´ċˆŻ‚³ƒ”ƒĵ—Ĥ終‚‚Š + int ucnt = referenceInitSetupData.useTransformCount; + + if (ucnt == tcnt) + { + // ċ…¨ä½“‚³ƒ”ƒĵ + NativeArray.Copy(referenceInitSetupData.transformPositions, 0, transformPositions, 0, ucnt); + NativeArray.Copy(referenceInitSetupData.transformRotations, 0, transformRotations, 0, ucnt); + NativeArray.Copy(referenceInitSetupData.transformLocalPositions, 0, transformLocalPositions, 0, ucnt); + NativeArray.Copy(referenceInitSetupData.transformLocalRotations, 0, transformLocalRotations, 0, ucnt); + NativeArray.Copy(referenceInitSetupData.transformScales, 0, transformScales, 0, ucnt); + } + else + { + // ċ·ċˆ† + for (int i = 0; i < ucnt; i++) + { + int tindex = referenceInitSetupData.useTransformIndexArray[i]; + transformPositions[tindex] = referenceInitSetupData.transformPositions[i]; + transformRotations[tindex] = referenceInitSetupData.transformRotations[i]; + transformLocalPositions[tindex] = referenceInitSetupData.transformLocalPositions[i]; + transformLocalRotations[tindex] = referenceInitSetupData.transformLocalRotations[i]; + transformScales[tindex] = referenceInitSetupData.transformScales[i]; + } + } + + // 逆ċ›žèğ˘żè¨ˆç—§ĉħ‚‚‚‹ + var job = new CalcInverseRotationJob() + { + rotations = transformRotations, + inverseRotations = transformInverseRotations, + }; + job.Run(tcnt); + + // ċˆĉœŸ‚ğƒ³‚żƒĵƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ‚’ċˆé€”‚³ƒ”ƒĵ—ĤŠ + initRenderLocalToWorld = referenceInitSetupData.initRenderLocalToWorld; + initRenderWorldtoLocal = referenceInitSetupData.initRenderWorldtoLocal; + initRenderRotation = referenceInitSetupData.initRenderRotation; + initRenderScale = referenceInitSetupData.initRenderScale; + } + else + { + //using var transformArray = new TransformAccessArray(transformList.ToArray()); + // Unity6.1ċŻċżœ + using var transformArray = new TransformAccessArray(transformList.Count); + int cnt = transformList.Count; + for (int i = 0; i < cnt; i++) + { + var t = transformList[i]; + if (t == null) + t = rendererTransform; + //transformArray[i] = t; + transformArray.Add(t); + } + + + var job = new ReadTransformJob() + { + positions = transformPositions, + rotations = transformRotations, + scales = transformScales, + localPositions = transformLocalPositions, + localRotations = transformLocalRotations, + inverseRotations = transformInverseRotations + }; + // ‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³äğċ¤–§ƒŻƒĵ‚Ѓĵ‚’ĉĥˆè²ğ—ŸŞ„§Run()版Ğ—ĤŠ + job.RunReadOnly(transformArray); + + // ċˆĉœŸ‚ğƒ³‚żƒĵƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ‚’ċˆé€”‚³ƒ”ƒĵ—ĤŠ + initRenderLocalToWorld = GetRendeerLocalToWorldMatrix(); + initRenderWorldtoLocal = math.inverse(initRenderLocalToWorld); + initRenderRotation = transformRotations[renderTransformIndex]; + initRenderScale = transformScales[renderTransformIndex]; + } + + // id / parent id + transformIdList = new List(tcnt); + transformParentIdList = new List(tcnt); + for (int i = 0; i < tcnt; i++) + { + //int id = 0, pid = 0; + MagicaObjectId id = MagicaObjectId.Invalid; + MagicaObjectId pid = MagicaObjectId.Invalid; + + var t = transformList[i]; + if (t) + { + id = t.GetMagicaId(); + if (includeChilds && t.parent) + pid = t.parent.GetMagicaId(); + } + transformIdList.Add(id); + transformParentIdList.Add(pid); + } + + // child id + if (includeChilds) + { + transformChildIdList = new List>(tcnt); + for (int i = 0; i < tcnt; i++) + { + var t = transformList[i]; + var clist = new FixedList512Bytes(); + if (t && t.childCount > 0) + { + for (int j = 0; j < t.childCount; j++) + { + var ct = t.GetChild(j); + clist.Add(ct.GetMagicaId()); + } + } + transformChildIdList.Add(clist); + } + } + + readTransformProfiler.End(); + } + + /// + /// 逆ċ›žèğ˘‚’è¨ˆç—§ĉħ‚‚‚‹ + /// + [BurstCompile] + struct CalcInverseRotationJob : IJobParallelFor + { + [Unity.Collections.ReadOnly] + public NativeArray rotations; + [NativeDisableParallelForRestriction] + [Unity.Collections.WriteOnly] + public NativeArray inverseRotations; + + public void Execute(int index) + { + var rot = rotations[index]; + if (math.any(rot.value)) + { + // İ‚Œ‹ïĵ‘¤§‚‚ != 0 Ş‚‰ċŸèĦŒ™‚‹ + var irot = math.inverse(rot); + inverseRotations[index] = irot; + } + } + } + + /// + /// ĉœ€ä½Žé™Transformĉƒ…ċ ħ‚’ċŽé›†™‚‹ + /// + [BurstCompile] + struct ReadTransformJob : IJobParallelForTransform + { + [NativeDisableParallelForRestriction] + [Unity.Collections.WriteOnly] + public NativeArray positions; + [NativeDisableParallelForRestriction] + [Unity.Collections.WriteOnly] + public NativeArray rotations; + [NativeDisableParallelForRestriction] + [Unity.Collections.WriteOnly] + public NativeArray scales; + [NativeDisableParallelForRestriction] + [Unity.Collections.WriteOnly] + public NativeArray localPositions; + [NativeDisableParallelForRestriction] + [Unity.Collections.WriteOnly] + public NativeArray localRotations; + [NativeDisableParallelForRestriction] + [Unity.Collections.WriteOnly] + public NativeArray inverseRotations; + + public void Execute(int index, TransformAccess transform) + { + if (transform.isValid == false) + return; + + transform.GetPositionAndRotation(out var pos, out var rot); + float4x4 LtoW = transform.localToWorldMatrix; + + positions[index] = pos; + rotations[index] = rot; + localPositions[index] = transform.localPosition; + localRotations[index] = transform.localRotation; + + // ƒžƒˆƒŞƒƒ‚Ż‚ı‹‚‰ĉ­£ç˘şŞ‚ı‚ħƒĵƒĞċ€¤‚’ç—ċ‡ş™‚‹ïĵˆ“‚ŒŻTransform.lossyScale¨ç­‰äĦïĵ‰ + var irot = math.inverse(rot); + var m2 = math.mul(new float4x4(irot, float3.zero), LtoW); + var scl = new float3(m2.c0.x, m2.c1.y, m2.c2.z); + scales[index] = scl; + + // 逆ċ›žèğ˘ + inverseRotations[index] = irot; + } + } + + public void Dispose() + { + // Pre-Build DeserializeManagerçĦ理中Żç ´ĉ£„•›Ş„ + if (isManaged) + return; + + bonesPerVertexArray.MC2DisposeSafe(); + boneWeightArray.MC2DisposeSafe(); + localPositions.MC2DisposeSafe(); + localNormals.MC2DisposeSafe(); + localTangents.MC2DisposeSafe(); + + transformPositions.MC2DisposeSafe(); + transformRotations.MC2DisposeSafe(); + transformLocalPositions.MC2DisposeSafe(); + transformLocalRotations.MC2DisposeSafe(); + transformScales.MC2DisposeSafe(); + transformInverseRotations.MC2DisposeSafe(); + + // MeshDataArrayŻƒĦ‚¤ƒ³‚ıƒĴƒƒƒ‰żDispose()ċŻèƒ½ + if (setupType == SetupType.MeshCloth) + { + if (meshDataArray.Length > 0) + meshDataArray.Dispose(); + } + } + + public void GetUsedTransform(HashSet transformSet) + { + if (transformList != null) + { + foreach (var t in transformList) + if (t) + transformSet.Add(t); + } + } + + public void ReplaceTransform(Dictionary replaceDict) + { + if (rootTransformIdList != null) + { + for (int i = 0; i < rootTransformIdList.Count; i++) + { + MagicaObjectId id = rootTransformIdList[i]; + if (replaceDict.ContainsKey(id)) + { + rootTransformIdList[i] = replaceDict[id].GetMagicaId(); + } + } + } + for (int i = 0; i < TransformCount; i++) + { + MagicaObjectId id = transformIdList[i]; + if (replaceDict.ContainsKey(id)) + { + var t = replaceDict[id]; + transformIdList[i] = t.GetMagicaId(); + transformList[i] = t; + } + MagicaObjectId pid = transformParentIdList[i]; + if (replaceDict.ContainsKey(pid)) + { + var t = replaceDict[pid]; + transformParentIdList[i] = t.GetMagicaId(); + } + + if (transformChildIdList != null) + { + var cidlist = transformChildIdList[i]; + for (int j = 0; j < cidlist.Length; j++) + { + MagicaObjectId cid = cidlist[j]; + if (replaceDict.ContainsKey(cid)) + { + var t = replaceDict[cid]; + cidlist[j] = t.GetMagicaId(); + } + } + transformChildIdList[i] = cidlist; + } + } + } + + //========================================================================================= + /// + /// ĉç”ğċŸşĉş–ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ‚’ċ–ċ—™‚‹ + /// + /// + public Transform GetRendeerTransform() + { + return transformList[renderTransformIndex]; + } + + public MagicaObjectId GetRenderTransformId() + { + return transformIdList[renderTransformIndex]; + } + + public float4x4 GetRendeerLocalToWorldMatrix() + { + int index = renderTransformIndex; + var pos = transformPositions[index]; + var rot = transformRotations[index]; + var scl = transformScales[index]; + return float4x4.TRS(pos, rot, scl); + } + + /// + /// ‚ı‚­ƒ³ƒĴƒ³ƒ€ƒİƒĵƒĞƒĵƒˆƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ‚’ċ–ċ—™‚‹ + /// + /// + public Transform GetSkinRootTransform() + { + return transformList[skinRootBoneIndex]; + } + + public MagicaObjectId GetSkinRootTransformId() + { + return transformIdList[skinRootBoneIndex]; + } + + public int GetTransformIndexFromId(MagicaObjectId id) + { + return transformIdList.IndexOf(id); + } + + /// + /// ĉŒ‡ċšindexèĤރˆƒİƒ³‚ıƒ•‚݃ĵƒ ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı‚’èż”™(-1=Ş—) + /// + /// + /// true=‚ğƒ³‚żƒĵƒˆƒİƒ³‚ıƒ•‚݃ĵƒ Żé™¤ċ¤–™‚‹ + /// Ş—(-1) + public int GetParentTransformIndex(int index, bool centerExcluded) + { + MagicaObjectId pid = transformParentIdList[index]; + int i = transformIdList.IndexOf(pid); + if (centerExcluded && i == renderTransformIndex) + i = -1; + return i; + } + + //========================================================================================= + /// + /// ‚ރނ¸ƒŠƒĞƒĦƒƒ‚·ƒƒœƒĵƒ³‚Ĥ‚¨‚¤ƒˆ‚’BoneWeightĉ§‹é€ ä½“NativeArray§ċ–ċ—™‚‹ + /// + /// + public void GetBoneWeightsRun(NativeArray weights) + { + var job = new GetBoneWeightJos() + { + vcnt = vertexCount, + bonesPerVertexArray = bonesPerVertexArray, + boneWeightArray = boneWeightArray, + boneWeights = weights, + }; + job.Run(); + } + + [BurstCompile] + struct GetBoneWeightJos : IJob + { + public int vcnt; + + [Unity.Collections.ReadOnly] + public NativeArray bonesPerVertexArray; + [Unity.Collections.ReadOnly] + public NativeArray boneWeightArray; + + [Unity.Collections.WriteOnly] + public NativeArray boneWeights; + + public void Execute() + { + int index = 0; + for (int i = 0; i < vcnt; i++) + { + var bw = new BoneWeight(); + + var cnt = bonesPerVertexArray[i]; + for (int j = 0; j < cnt; j++) + { + var bw1 = boneWeightArray[index]; + index++; + + switch (j) + { + case 0: + bw.weight0 = bw1.weight; + bw.boneIndex0 = bw1.boneIndex; + break; + case 1: + bw.weight1 = bw1.weight; + bw.boneIndex1 = bw1.boneIndex; + break; + case 2: + bw.weight2 = bw1.weight; + bw.boneIndex2 = bw1.boneIndex; + break; + case 3: + bw.weight3 = bw1.weight; + bw.boneIndex3 = bw1.boneIndex; + break; + } + } + + boneWeights[i] = bw; + } + } + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/Render/RenderSetupData.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Manager/Render/RenderSetupData.cs.meta new file mode 100644 index 00000000..9302df84 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/Render/RenderSetupData.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 617681c5418abb546afd305310ef7cb9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Manager/Render/RenderSetupData.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/Render/RenderSetupDataSerialization.cs b/Assets/MagicaCloth2/Scripts/Core/Manager/Render/RenderSetupDataSerialization.cs new file mode 100644 index 00000000..8389defa --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/Render/RenderSetupDataSerialization.cs @@ -0,0 +1,202 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2024 MagicaSoft. +// https://magicasoft.jp +using System; +using System.Collections.Generic; +using Unity.Collections; +using UnityEngine; + +namespace MagicaCloth2 +{ + public partial class RenderSetupData + { + /// + /// PreBuildċ…ħĉœ‰éƒ¨ċˆ†äżċ­˜ƒ‡ƒĵ‚ż + /// + [System.Serializable] + public class ShareSerializationData + { + public ResultCode result; + public string name; + public SetupType setupType; + + // Mesh --------------------------------------------------------------- + public Mesh originalMesh; + public int vertexCount; + public bool hasSkinnedMesh; + public bool hasBoneWeight; + public int skinRootBoneIndex; + public int skinBoneCount; + // MeshData§Żċ–ċ—§Ş„ƒĦƒƒ‚·ƒĉƒ…ċ ħ + public List bindPoseList; + public byte[] bonesPerVertexArray; + public byte[] boneWeightArray; + public Vector3[] localPositions; + public Vector3[] localNormals; + public Vector4[] localTangents; // option + + // Bone --------------------------------------------------------------- + public BoneConnectionMode boneConnectionMode; + + // Common ------------------------------------------------------------- + public int renderTransformIndex; + + // -------------------------------------------------------------------- + public bool HasTangent => localTangents?.Length > 0; + } + + public ShareSerializationData ShareSerialize() + { + var sdata = new ShareSerializationData(); + try + { + sdata.result = result; + sdata.name = name; + sdata.setupType = setupType; + + // Mesh + sdata.originalMesh = originalMesh; + sdata.vertexCount = vertexCount; + sdata.hasSkinnedMesh = hasSkinnedMesh; + sdata.hasBoneWeight = hasBoneWeight; + sdata.skinRootBoneIndex = skinRootBoneIndex; + sdata.skinBoneCount = skinBoneCount; + sdata.bindPoseList = new List(bindPoseList); + sdata.bonesPerVertexArray = bonesPerVertexArray.MC2ToRawBytes(); + sdata.boneWeightArray = boneWeightArray.MC2ToRawBytes(); + sdata.localPositions = originalMesh.vertices; + sdata.localNormals = originalMesh.normals; + if (originalMesh.HasVertexAttribute(UnityEngine.Rendering.VertexAttribute.Tangent)) + sdata.localTangents = originalMesh.tangents; + + // Bone + sdata.boneConnectionMode = boneConnectionMode; + + // Common + sdata.renderTransformIndex = renderTransformIndex; + } + catch (Exception exception) + { + Debug.LogException(exception); + } + + return sdata; + } + + public static RenderSetupData ShareDeserialize(ShareSerializationData sdata) + { + var setup = new RenderSetupData(); + setup.isManaged = true; + + try + { + setup.name = sdata.name; + setup.setupType = sdata.setupType; + + // Mesh + setup.originalMesh = sdata.originalMesh; + setup.vertexCount = sdata.vertexCount; + setup.hasSkinnedMesh = sdata.hasSkinnedMesh; + setup.hasBoneWeight = sdata.hasBoneWeight; + setup.skinRootBoneIndex = sdata.skinRootBoneIndex; + setup.skinBoneCount = sdata.skinBoneCount; + setup.bindPoseList = new List(sdata.bindPoseList); + setup.bonesPerVertexArray = NativeArrayExtensions.MC2FromRawBytes(sdata.bonesPerVertexArray, Allocator.Persistent); + setup.boneWeightArray = NativeArrayExtensions.MC2FromRawBytes(sdata.boneWeightArray, Allocator.Persistent); + + // PreBuild§ŻmeshDataArray‚’生ĉˆ—Ş„ + // ä𣂏‚ЁĞ保ċ­˜—ŸlocalPositions/Normals‚’ċİċ…ƒ™‚‹ + setup.localPositions = new NativeArray(sdata.localPositions, Allocator.Persistent); + setup.localNormals = new NativeArray(sdata.localNormals, Allocator.Persistent); + if (sdata.HasTangent) + setup.localTangents = new NativeArray(sdata.localTangents, Allocator.Persistent); + + // Bone + setup.boneConnectionMode = sdata.boneConnectionMode; + + // Common + setup.renderTransformIndex = sdata.renderTransformIndex; + + setup.result.SetSuccess(); + } + catch (Exception exception) + { + Debug.LogException(exception); + setup.result.SetError(Define.Result.PreBuild_InvalidRenderSetupData); + } + + return setup; + } + + //========================================================================================= + /// + /// PreBuildċ›şĉœ‰éƒ¨ċˆ†äżċ­˜ƒ‡ƒĵ‚ż + /// + [System.Serializable] + public class UniqueSerializationData : ITransform + { + public ResultCode result; + + // Mesh --------------------------------------------------------------- + public Renderer renderer; + public SkinnedMeshRenderer skinRenderer; + public MeshFilter meshFilter; + public Mesh originalMesh; + + // Common ------------------------------------------------------------- + public List transformList; + + public void GetUsedTransform(HashSet transformSet) + { + transformList?.ForEach(x => + { + if (x) + transformSet.Add(x); + }); + } + + public void ReplaceTransform(Dictionary replaceDict) + { + if (transformList != null) + { + for (int i = 0; i < transformList.Count; i++) + { + var t = transformList[i]; + if (t) + { + MagicaObjectId id = t.GetMagicaId(); + if (id.IsValid() && replaceDict.ContainsKey(id)) + { + transformList[i] = replaceDict[id]; + } + } + } + } + } + } + + public UniqueSerializationData UniqueSerialize() + { + var sdata = new UniqueSerializationData(); + try + { + sdata.result = result; + + // Mesh + sdata.renderer = renderer; + sdata.skinRenderer = skinRenderer; + sdata.meshFilter = meshFilter; + sdata.originalMesh = originalMesh; + + // Common + sdata.transformList = new List(transformList); + } + catch (Exception exception) + { + Debug.LogException(exception); + } + + return sdata; + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/Render/RenderSetupDataSerialization.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Manager/Render/RenderSetupDataSerialization.cs.meta new file mode 100644 index 00000000..6c0fb338 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/Render/RenderSetupDataSerialization.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 15097613d7348214ca528d3986504ece +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Manager/Render/RenderSetupDataSerialization.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/Render/RenderSetupSerializeData.cs b/Assets/MagicaCloth2/Scripts/Core/Manager/Render/RenderSetupSerializeData.cs new file mode 100644 index 00000000..48687e6c --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/Render/RenderSetupSerializeData.cs @@ -0,0 +1,355 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2025 MagicaSoft. +// https://magicasoft.jp +using System; +using System.Collections.Generic; +using Unity.Burst; +using Unity.Collections; +using Unity.Jobs; +using Unity.Mathematics; +using UnityEngine; + +namespace MagicaCloth2 +{ + [System.Serializable] + public class RenderSetupSerializeData : ITransform + { + public RenderSetupData.SetupType setupType; + + public int vertexCount; + public bool hasSkinnedMesh; + public bool hasBoneWeight; + public int skinRootBoneIndex; + public int renderTransformIndex; + public int skinBoneCount; + public int transformCount; + public int useTransformCount; + + public int[] useTransformIndexArray; + + public Transform[] transformArray; + public float3[] transformPositions; + public quaternion[] transformRotations; + public float3[] transformLocalPositions; + public quaternion[] transformLocalRotations; + public float3[] transformScales; + + public float4x4 initRenderLocalToWorld; // ċˆĉœŸċŒ–ĉ™‚ċŸşĉş–ƒžƒˆƒŞƒƒ‚Ż‚ı(LtoW) + public float4x4 initRenderWorldtoLocal; // ċˆĉœŸċŒ–ĉ™‚ċŸşĉş–ƒžƒˆƒŞƒƒ‚Ż‚ı(WtoL) + public quaternion initRenderRotation; // ċˆĉœŸċŒ–ĉ™‚ċŸşĉş–ċ›žèğ˘ + public float3 initRenderScale; // ċˆĉœŸċŒ–ĉ™‚ċŸşĉş–‚ı‚ħƒĵƒĞ + + public Mesh originalMesh; // ċ¤‰ĉ›´ċ‰‚ރނ¸ƒŠƒĞċ…ħĉœ‰ƒĦƒƒ‚·ƒ(SkinnedMeshRenderċˆİ用ĉ™‚ż) + + public bool DataValidateMeshCloth(Renderer ren) + { + if (setupType != RenderSetupData.SetupType.MeshCloth) + return false; + if (ren == null) + return false; + + if (useTransformIndexArray == null || useTransformIndexArray.Length == 0) + return false; + + if (ren is SkinnedMeshRenderer) + { + if (hasSkinnedMesh == false) + return false; + + var sren = ren as SkinnedMeshRenderer; + var smesh = sren.sharedMesh; + if (smesh == null) + return false; + + // 重„‹ïĵŸ + //int bcnt = smesh.bindposes?.Length ?? 0; + //if (skinBoneCount != bcnt) + // return false; + } + else + { + if (hasSkinnedMesh) + return false; + + if (!ren.TryGetComponent(out var filter)) + return false; + + var smesh = filter.sharedMesh; + if (smesh == null) + return false; + } + + if (DataValidateTransform() == false) + return false; + + return true; + } + + public bool DataValidateBoneCloth(ClothSerializeData sdata, RenderSetupData.SetupType clothType) + { + if (setupType != clothType) + return false; + if (hasSkinnedMesh) + return false; + if (hasBoneWeight) + return false; + + if (DataValidateTransform() == false) + return false; + + // root bone + foreach (var rootBone in sdata.rootBones) + { + if (rootBone == null || Array.FindIndex(transformArray, x => x == rootBone) < 0) + return false; + } + + return true; + } + + public bool DataValidateTransform() + { + if (transformCount == 0) + return false; + if (useTransformCount == 0) + return false; + + int ucnt = useTransformCount; + + if (ucnt != (useTransformIndexArray?.Length ?? 0)) + return false; + if (ucnt != (transformArray?.Length ?? 0)) + return false; + if (Array.FindIndex(transformArray, x => x == null) >= 0) + return false; + + if (ucnt != (transformPositions?.Length ?? 0)) + return false; + if (ucnt != (transformRotations?.Length ?? 0)) + return false; + if (ucnt != (transformLocalPositions?.Length ?? 0)) + return false; + if (ucnt != (transformLocalRotations?.Length ?? 0)) + return false; + if (ucnt != (transformScales?.Length ?? 0)) + return false; + + return true; + } + + public bool Serialize(RenderSetupData sd) + { + Debug.Assert(sd != null); + Debug.Assert(sd.TransformCount > 0); + + setupType = sd.setupType; + vertexCount = sd.vertexCount; + hasSkinnedMesh = sd.hasSkinnedMesh; + hasBoneWeight = sd.hasBoneWeight; + skinRootBoneIndex = sd.skinRootBoneIndex; + renderTransformIndex = sd.renderTransformIndex; + skinBoneCount = sd.skinBoneCount; + transformCount = sd.TransformCount; + useTransformCount = 0; + originalMesh = null; + + if (sd.TransformCount > 0) + { + int tcnt = sd.TransformCount; + + using var useTransformIndexList = new NativeList(tcnt, Allocator.TempJob); + if (setupType == RenderSetupData.SetupType.MeshCloth) + { + // MeshCloth§Ż‚Ĥ‚¨‚¤ƒˆ¨—Ĥċˆİ用•‚ŒĤ„‚‹ƒœƒĵƒ³żƒ‘ƒƒ‚݁™‚‹ + if (hasBoneWeight) + { + var job = new CalcUseBoneArrayJob2() + { + boneCount = skinBoneCount, + boneWeightArray = sd.boneWeightArray, + useBoneIndexList = useTransformIndexList, + }; + job.Run(); + if (skinRootBoneIndex >= skinBoneCount) + useTransformIndexList.Add(skinRootBoneIndex); + useTransformIndexList.Add(renderTransformIndex); + } + else + { + // 通ċ¸¸ƒĦƒƒ‚·ƒŻ + for (int i = 0; i < tcnt; i++) + useTransformIndexList.Add(i); + } + + // ‚ރނ¸ƒŠƒĞƒĦƒƒ‚·ƒ‚’記録 + if (sd.originalMesh && sd.originalMesh.name.Contains("(Clone)") == false) + { + originalMesh = sd.originalMesh; + } + } + else + { + // BoneClothç³ğŻ + for (int i = 0; i < tcnt; i++) + useTransformIndexList.Add(i); + } + + using var tempArray = useTransformIndexList.ToArray(Allocator.TempJob); + useTransformIndexArray = tempArray.ToArray(); + + int ucnt = useTransformIndexArray.Length; + + useTransformCount = ucnt; + + transformArray = new Transform[ucnt]; + transformPositions = new float3[ucnt]; + transformRotations = new quaternion[ucnt]; + transformLocalPositions = new float3[ucnt]; + transformLocalRotations = new quaternion[ucnt]; + transformScales = new float3[ucnt]; + + for (int i = 0; i < ucnt; i++) + { + int tindex = useTransformIndexArray[i]; + + transformArray[i] = sd.transformList[tindex]; + transformPositions[i] = sd.transformPositions[tindex]; + transformRotations[i] = sd.transformRotations[tindex]; + transformLocalPositions[i] = sd.transformLocalPositions[tindex]; + transformLocalRotations[i] = sd.transformLocalRotations[tindex]; + transformScales[i] = sd.transformScales[tindex]; + } + } + + initRenderLocalToWorld = sd.initRenderLocalToWorld; + initRenderWorldtoLocal = sd.initRenderWorldtoLocal; + initRenderRotation = sd.initRenderRotation; + initRenderScale = sd.initRenderScale; + + return true; + } + + [BurstCompile] + struct CalcUseBoneArrayJob2 : IJob + { + public int boneCount; + + [Unity.Collections.ReadOnly] + public NativeArray boneWeightArray; + public NativeList useBoneIndexList; + + public void Execute() + { + var useBoneArray = new NativeArray(boneCount, Allocator.Temp); + int cnt = boneWeightArray.Length; + int packCnt = 0; + for (int i = 0; i < cnt; i++) + { + var bw1 = boneWeightArray[i]; + if (bw1.weight > 0.0f) + { + byte oldFlag = useBoneArray[bw1.boneIndex]; + if (oldFlag == 0) + packCnt++; + useBoneArray[bw1.boneIndex] = 1; + } + } + + // ċˆİ用Bone‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı‚’ƒ‘ƒƒ‚݁™‚‹ + for (int i = 0; i < boneCount; i++) + { + byte flag = useBoneArray[i]; + if (flag != 0) + { + useBoneIndexList.Add(i); + } + } + useBoneArray.Dispose(); + } + } + + public int GetLocalHash() + { + int hash = 0; + + hash += (int)setupType * 100; + hash += vertexCount; + hash += hasSkinnedMesh ? 1 : 0; + hash += hasBoneWeight ? 1 : 0; + hash += skinRootBoneIndex; + hash += renderTransformIndex; + hash += skinBoneCount; + hash += transformCount; + hash += useTransformCount; + + hash += useTransformIndexArray?.Length ?? 0; + hash += transformArray?.Length ?? 0; + hash += transformPositions?.Length ?? 0; + hash += transformRotations?.Length ?? 0; + hash += transformLocalPositions?.Length ?? 0; + hash += transformLocalRotations?.Length ?? 0; + hash += transformScales?.Length ?? 0; + + if (transformArray != null) + foreach (var t in transformArray) + hash += t != null ? (456 + t.childCount * 789) : 0; + + if (originalMesh != null) + hash += originalMesh.vertexCount; + + return hash; + } + + public int GetGlobalHash() + { + int hash = 0; + + if (transformArray != null) + { + foreach (var t in transformArray) + { + if (t) + { + hash += t.localPosition.GetHashCode(); + hash += t.localRotation.GetHashCode(); + hash += t.localScale.GetHashCode(); + } + } + } + + // ƒĴƒ³ƒ€ƒĵƒŻƒĵƒĞƒ‰‚ı‚ħƒĵƒĞżç›£èĤ–™‚‹ + // ƒŻƒĵƒĞƒ‰‚ı‚ħƒĵƒĞŻĦ‚‡£¨—Ÿç§ğċ‹•‚„ċ›žèğ˘Şİ§ĉµċ‹•ċ°ĉ•°ç‚ıèŞ¤ċ·Œċ‡ş‚‹§ċ°‘ĉ•°ïĵ“ĉĦ§§ƒƒƒ‚·ƒċŒ–™‚‹ + int3 intScale = (int3)math.round(initRenderScale * 1000); + //Debug.Log($"★initScale:{intScale}"); + hash += intScale.GetHashCode(); + + return hash; + } + + public void GetUsedTransform(HashSet transformSet) + { + if (transformArray != null) + { + foreach (var t in transformArray) + { + if (t) + transformSet.Add(t); + } + } + } + + public void ReplaceTransform(Dictionary replaceDict) + { + if (transformArray == null) + return; + for (int i = 0; i < transformArray.Length; i++) + { + var t = transformArray[i]; + if (t && replaceDict.ContainsKey(t.GetMagicaId())) + { + transformArray[i] = replaceDict[t.GetMagicaId()]; + } + } + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/Render/RenderSetupSerializeData.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Manager/Render/RenderSetupSerializeData.cs.meta new file mode 100644 index 00000000..9813e5d3 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/Render/RenderSetupSerializeData.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 98f83594b09a8c5469b78d1d22047ecd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Manager/Render/RenderSetupSerializeData.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/Simulation.meta b/Assets/MagicaCloth2/Scripts/Core/Manager/Simulation.meta new file mode 100644 index 00000000..217f1e4e --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/Simulation.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3103c5a568f55db44a99370d1e982fd5 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/Simulation/ColliderManager.cs b/Assets/MagicaCloth2/Scripts/Core/Manager/Simulation/ColliderManager.cs new file mode 100644 index 00000000..be2dc640 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/Simulation/ColliderManager.cs @@ -0,0 +1,1317 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Unity.Collections; +using Unity.Mathematics; +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// ‚³ƒİ‚¤ƒ€ƒĵçĦ理 + /// MC1¨é•„‚³ƒİ‚¤ƒ€ƒĵŻƒ‘ƒĵƒ†‚£‚ŻƒĞ¨ŻċˆĞçĦ理•‚Œ‚‹ + /// ‚³ƒİ‚¤ƒ€ƒĵŻƒƒĵƒ ”¨Ğċˆ†‘ĤçĦ理•‚Œ‚‹€‚ + /// ċŒ˜‚³ƒİ‚¤ƒ€ƒĵ‚’ƒƒĵƒ A¨ƒƒĵƒ BŒċ…ħĉœ‰—Ĥ„Ÿ¨—Ĥ‚‚‚Œž‚Œċˆ‚³ƒİ‚¤ƒ€ƒĵ¨—Ĥç™ğ録•‚Œ‚‹€‚ + /// + public class ColliderManager : IManager, IValid + { + /// + /// ƒƒĵƒ ID + /// + public ExNativeArray teamIdArray; + + /// + /// ‚³ƒİ‚¤ƒ€ƒĵç¨éĦž(ĉœ€ċ¤§15§) + /// + public enum ColliderType : byte + { + None = 0, + Sphere = 1, + CapsuleX_Center = 2, + CapsuleY_Center = 3, + CapsuleZ_Center = 4, + CapsuleX_Start = 5, + CapsuleY_Start = 6, + CapsuleZ_Start = 7, + Plane = 8, + Box = 9, + } + + /// + /// ‚·ƒ³ƒĦƒˆƒŞƒĵ‚ż‚¤ƒ—(ĉœ€ċ¤§15§) + /// + public enum SymmetryType : byte + { + None = 0, + X_Symmetry = 1, + Y_Symmetry = 2, + Z_Symmetry = 3, + XYZ_Symmetry = 4, + } + + /// + /// ƒ•ƒİ‚°(16bit) + /// (0~3:4bit)‚³ƒİ‚¤ƒ€ƒĵç¨éĦž + /// (4~7:4bit)‚·ƒ³ƒĦƒˆƒŞƒĵ‚ż‚¤ƒ— + /// (8~15:8bit)ƒ•ƒİ‚° + /// + public const ushort Flag_Valid = 0x0100; // ƒ‡ƒĵ‚żĉœ‰ç„Ħ + public const ushort Flag_Enable = 0x0200; // ĉœ‰ċŠıçŠĥĉ…‹ + public const ushort Flag_Reset = 0x0400; // ä½ç½ƒŞ‚ğƒƒƒˆ + public const ushort Flag_Reverse = 0x0800; // ĉ–ıċ‘逆èğ˘ + public const ushort Flag_Symmetry = 0x1000; // ‚·ƒ³ƒĦƒˆƒŞƒĵ + public const ushort Flag_SymmetryReverse = 0x2000; // ‚·ƒ³ƒĦƒˆƒŞƒĵĞ‚ˆ‚‹ĉ–ıċ‘ƒ•ƒŞƒƒƒ— + public const ushort Flag_ScaleSuspend = 0x4000; // ĉµċ°‚ı‚ħƒĵƒĞĞ‚ˆ‚‹ĉݟ能ċœĉ­˘ + public ExNativeArray flagArray; + + /// + /// ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ‹‚‰ä¸­ċżƒƒ­ƒĵ‚ЃЂރ•‚ğƒƒƒˆä½ç½ + /// + public ExNativeArray centerArray; + + /// + /// ‚³ƒİ‚¤ƒ€ƒĵ‚µ‚¤‚şĉƒ…ċ ħ + /// Sphere(x:ċŠċ„) + /// Capsule(x:ċ§‹ç‚ıċŠċ„, y:終ç‚ıċŠċ„, z:長•) + /// Box(x:‚µ‚¤‚şX, y:‚µ‚¤‚şY, z:‚µ‚¤‚şZ) + /// + public ExNativeArray sizeArray; + + /// + /// 珃•ƒĴƒĵƒ ċ§żċ‹˘ + /// ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ‹‚‰‚ıƒŠƒƒƒ—•‚ŒŸċ§żċ‹˘ïĵˆƒŻƒĵƒĞƒ‰ïĵ‰ + /// ‚ğƒ³‚żƒĵ‚ރ•‚ğƒƒƒˆ‚‚計痁•‚Œ‚‹ + /// + public ExNativeArray framePositions; + public ExNativeArray frameRotations; + public ExNativeArray frameScales; + + /// + /// ïĵ‘¤ċ‰ƒ•ƒĴƒĵƒ ċ§żċ‹˘ïĵˆƒŻƒĵƒĞƒ‰ïĵ‰ + /// + public ExNativeArray oldFramePositions; + public ExNativeArray oldFrameRotations; + + /// + /// 珂ıƒ†ƒƒƒ—§ċ§żċ‹˘ïĵˆƒŻƒĵƒĞƒ‰ïĵ‰ + /// + public ExNativeArray nowPositions; + public ExNativeArray nowRotations; + + /// + /// ċ‰‚ıƒ†ƒƒƒ—§ċ§żċ‹˘ïĵˆƒŻƒĵƒĞƒ‰ïĵ‰ + /// + public ExNativeArray oldPositions; + public ExNativeArray oldRotations; + + /// + /// ‚·ƒ³ƒĦƒˆƒŞƒĵ用ƒĦ‚¤ƒ³‚³ƒİ‚¤ƒ€ƒĵ¸ƒ­ƒĵ‚ЃЂ¤ƒ³ƒ‡ƒƒ‚Ż‚ı配ċˆ— + /// + public ExNativeArray mainColliderIndices; + + /// + /// ç™ğ録‚³ƒİ‚¤ƒ€ƒĵ‚³ƒ³ƒƒĵƒƒ³ƒˆ + /// çċœ¨Żƒ‡ƒƒƒ‚°ç”¨ + /// + HashSet colliderSet = new HashSet(); + + bool isValid = false; + + //========================================================================================= + /// + /// ‚ıƒ†ƒƒƒ—”¨ä½œĉ­ƒ‡ƒĵ‚ż + /// + internal struct WorkData + { + public AABB aabb; + public float2 radius; + public float3x2 oldPos; + public float3x2 nextPos; + public quaternion inverseOldRot; + public quaternion rot; + } + + internal ExNativeArray workDataArray; + + //========================================================================================= + public void Dispose() + { + isValid = false; + + teamIdArray?.Dispose(); + flagArray?.Dispose(); + centerArray?.Dispose(); + sizeArray?.Dispose(); + framePositions?.Dispose(); + frameRotations?.Dispose(); + frameScales?.Dispose(); + nowPositions?.Dispose(); + nowRotations?.Dispose(); + oldFramePositions?.Dispose(); + oldFrameRotations?.Dispose(); + oldPositions?.Dispose(); + oldRotations?.Dispose(); + workDataArray?.Dispose(); + mainColliderIndices?.Dispose(); + + teamIdArray = null; + flagArray = null; + sizeArray = null; + framePositions = null; + frameRotations = null; + frameScales = null; + nowPositions = null; + nowRotations = null; + oldFramePositions = null; + oldFrameRotations = null; + oldPositions = null; + oldRotations = null; + workDataArray = null; + mainColliderIndices = null; + + colliderSet.Clear(); + } + + public void EnterdEditMode() + { + Dispose(); + } + + public void Initialize() + { + Dispose(); + + const int capacity = 256; + teamIdArray = new ExNativeArray(capacity); + flagArray = new ExNativeArray(capacity); + centerArray = new ExNativeArray(capacity); + sizeArray = new ExNativeArray(capacity); + framePositions = new ExNativeArray(capacity); + frameRotations = new ExNativeArray(capacity); + frameScales = new ExNativeArray(capacity); + nowPositions = new ExNativeArray(capacity); + nowRotations = new ExNativeArray(capacity); + oldFramePositions = new ExNativeArray(capacity); + oldFrameRotations = new ExNativeArray(capacity); + oldPositions = new ExNativeArray(capacity); + oldRotations = new ExNativeArray(capacity); + workDataArray = new ExNativeArray(capacity); + mainColliderIndices = new ExNativeArray(capacity); + + isValid = true; + } + + public bool IsValid() + { + return isValid; + } + + //========================================================================================= + /// + /// ƒƒĵƒ Ğ‚³ƒİ‚¤ƒ€ƒĵ領ċŸŸ‚’ç™ğ録™‚‹ + /// ĉœ€ċˆ‹‚‰ĉœ€ċ¤§‚³ƒİ‚¤ƒ€ƒĵĉ•°§é ˜ċŸŸ‚’ċˆĉœŸċŒ–—ĤŠ + /// + /// + public void Register(ClothProcess cprocess) + { + if (isValid == false) + return; + + // ‚³ƒİ‚¤ƒ€ƒĵĉ•° + int cnt = cprocess.cloth.SerializeData.colliderCollisionConstraint.ColliderLength; + if (cnt > 0) + { + // ‚·ƒ³ƒĦƒˆƒŞƒĵ‚‚考ĉ…—ŸċˆĉœŸ‚³ƒİ‚¤ƒ€ƒĵĉ•°‚’ç—ċ‡ş™‚‹ + var clist = cprocess.cloth.SerializeData.colliderCollisionConstraint.colliderList; + int activeCount = 0; + clist.ForEach(x => + { + if (x) + activeCount += x.symmetryMode != ColliderSymmetryMode.None ? 2 : 1; + }); + //Debug.Log($"[{cprocess.cloth.name}] ActiveColliderCount:{activeCount}"); + + // ċˆĉœŸ‚³ƒİ‚¤ƒ€ƒĵé ˜ċŸŸç˘şäż + int teamId = cprocess.TeamId; + ref var tdata = ref MagicaManager.Team.GetTeamDataRef(teamId); + tdata.colliderChunk = teamIdArray.AddRange(activeCount, (short)teamId); + flagArray.AddRange(activeCount, default); + centerArray.AddRange(activeCount); + sizeArray.AddRange(activeCount); + framePositions.AddRange(activeCount); + frameRotations.AddRange(activeCount); + frameScales.AddRange(activeCount); + nowPositions.AddRange(activeCount); + nowRotations.AddRange(activeCount); + oldFramePositions.AddRange(activeCount); + oldFrameRotations.AddRange(activeCount); + oldPositions.AddRange(activeCount); + oldRotations.AddRange(activeCount); + workDataArray.AddRange(activeCount); + mainColliderIndices.AddRange(activeCount); + Transform t = cprocess.cloth.ClothTransform; + tdata.colliderTransformChunk = MagicaManager.Bone.AddTransform(activeCount, teamId, t); // 領ċŸŸż + tdata.colliderCount = 0; + + // ċˆĉœŸ‚³ƒİ‚¤ƒ€ƒĵç™ğ録 + for (int i = 0; i < clist.Count; i++) + { + var col = clist[i]; + if (col && cprocess.colliderDict.ContainsKey(col) == false) + AddCollider(cprocess, col); + } + } + } + + /// + /// ƒƒĵƒ ‹‚‰‚³ƒİ‚¤ƒ€ƒĵ領ċŸŸ‚’解除™‚‹ + /// + /// + public void Exit(ClothProcess cprocess) + { + if (isValid == false) + return; + + int teamId = cprocess.TeamId; + + // ‚³ƒİ‚¤ƒ€ƒĵ解除 + foreach (var col in cprocess.colliderDict.Keys) + { + if (col) + { + if (col.Exit(teamId)) + { + // ċˆİ用者ïĵ + colliderSet.Remove(col); + } + } + } + cprocess.colliderDict.Clear(); + + ref var tdata = ref MagicaManager.Team.GetTeamDataRef(teamId); + + var c = tdata.colliderChunk; + teamIdArray.RemoveAndFill(c); // 0‚ŻƒŞ‚˘ + flagArray.RemoveAndFill(c); // 0‚ŻƒŞ‚˘ + centerArray.Remove(c); + sizeArray.Remove(c); + framePositions.Remove(c); + frameRotations.Remove(c); + frameScales.Remove(c); + nowPositions.Remove(c); + nowRotations.Remove(c); + oldFramePositions.Remove(c); + oldFrameRotations.Remove(c); + oldPositions.Remove(c); + oldRotations.Remove(c); + workDataArray.Remove(c); + mainColliderIndices.Remove(c); + + tdata.colliderChunk.Clear(); + tdata.colliderCount = 0; + + // ‚³ƒİ‚¤ƒ€ƒĵƒˆƒİƒ³‚ıƒ•‚݃ĵƒ è§£é™¤ + MagicaManager.Bone.RemoveTransform(tdata.colliderTransformChunk); + tdata.colliderTransformChunk.Clear(); + } + + //========================================================================================= + /// + /// ‚³ƒİ‚¤ƒ€ƒĵƒŞ‚ıƒˆċ†…ċı‚’ĉ›´ĉ–°™‚‹ + /// “‚ŒŻMagicaCloth‚³ƒ³ƒƒĵƒƒ³ƒˆċ´‚³ƒİ‚¤ƒ€ƒĵƒŞ‚ıƒˆŒċ¤‰ĉ›´•‚ŒŸċ ´ċˆ + /// ¤‚Šƒ‘ƒİƒĦƒĵ‚żċ¤‰ĉ›´§ŻŞ„ + /// + /// + internal void UpdateColliders(ClothProcess cprocess) + { + if (isValid == false) + return; + + // ““§Ż‚³ƒİ‚¤ƒ€ƒĵƒŞ‚ıƒˆ¸‚³ƒ³ƒƒĵƒƒ³ƒˆèż½ċŠ ċ‰Šé™¤ ‘§€‚·ƒ³ƒĦƒˆƒŞƒĵŞİċˆ‡‚Šĉ›żˆŻè€ƒĉ…—ŞĤ„„ + var clist = cprocess.cloth.SerializeData.colliderCollisionConstraint.colliderList; + + // çċœ¨ç™ğ録‚³ƒİ‚¤ƒ€ƒĵ¨ĉŻ”èĵƒ—不èĤŞ‚³ƒİ‚¤ƒ€ƒĵ‚’ċ‰Šé™¤™‚‹ + var keys = cprocess.colliderDict.Keys.ToList(); + foreach (ColliderComponent col in keys) + { + if (col && clist.Contains(col) == false) + { + // ‚³ƒİ‚¤ƒ€ƒĵċ‰Šé™¤ + RemoveCollider(col, cprocess.TeamId); + } + } + + // çċœ¨ç™ğ録‚³ƒİ‚¤ƒ€ƒĵ¨ĉŻ”èĵƒ—ċż…èĤŞ‚³ƒİ‚¤ƒ€ƒĵ‚’èż½ċŠ ™‚‹ + foreach (var col in clist) + { + if (col && cprocess.colliderDict.ContainsKey(col) == false) + { + AddCollider(cprocess, col); + } + } + } + + /// + /// ‚³ƒİ‚¤ƒ€ƒĵċ€‹ċˆç™ğ録 + /// + /// + /// + void AddCollider(ClothProcess cprocess, ColliderComponent col) + { + if (isValid == false) + return; + if (col == null) + return; + if (cprocess.colliderDict.ContainsKey(col)) + return; // ™§Ğèż½ċŠ ĉ¸ˆż + + ref var tdata = ref MagicaManager.Team.GetTeamDataRef(cprocess.TeamId); + Debug.Assert(tdata.IsValid); + + // Main + AddColliderInternal(ref tdata, cprocess, col, false); + colliderSet.Add(col); + + // Symmetry + col.SetActiveSymmetryMode(firstOnly: true); // ‚·ƒ³ƒĦƒˆƒŞƒĵĉƒ…ċ ħĉ›´ĉ–° + AddColliderInternal(ref tdata, cprocess, col, true); + + // ‚³ƒİ‚¤ƒ€ƒĵ‚³ƒ³ƒƒĵƒƒ³ƒˆċ´Ğ‚‚ç™ğ録™‚‹ïĵˆç´‘ïĵ‰ + col.Register(cprocess.TeamId); + } + + void AddColliderInternal(ref TeamManager.TeamData tdata, ClothProcess cprocess, ColliderComponent col, bool isSymmetry) + { + // ‚·ƒ³ƒĦƒˆƒŞƒĵĉœ‰ċŠıĉ€§ + if (isSymmetry) + { + if (col.ActiveSymmetryMode == ColliderSymmetryMode.None) + return; + if (col.ActiveSymmetryTarget == null) + return; + } + + int teamId = cprocess.TeamId; + + // 領ċŸŸĉ‹Ħċĵµ + if (tdata.colliderChunk.IsValid == false) + { + // ĉ–°èĤç˘şäż + int newCount = Define.System.ExpandedColliderCount; + tdata.colliderChunk = teamIdArray.AddRange(newCount, (short)cprocess.TeamId); + flagArray.AddRange(newCount, default); + centerArray.AddRange(newCount); + sizeArray.AddRange(newCount); + framePositions.AddRange(newCount); + frameRotations.AddRange(newCount); + frameScales.AddRange(newCount); + nowPositions.AddRange(newCount); + nowRotations.AddRange(newCount); + oldFramePositions.AddRange(newCount); + oldFrameRotations.AddRange(newCount); + oldPositions.AddRange(newCount); + oldRotations.AddRange(newCount); + workDataArray.AddRange(newCount); + mainColliderIndices.AddRange(newCount); + Transform t = cprocess.cloth.ClothTransform; + tdata.colliderTransformChunk = MagicaManager.Bone.AddTransform(newCount, cprocess.TeamId, t); // 領ċŸŸż + tdata.colliderCount = 0; + } + else if (tdata.UseColliderCount == tdata.colliderChunk.dataLength) + { + // ‚³ƒİ‚¤ƒ€ƒĵ配ċˆ—‚­ƒ£ƒ‘‚·ƒ†‚£ä¸Šé™Ş‚‰ĉ‹Ħċĵµ™‚‹ + // ĉ‹Ħċĵµ + int newCount = tdata.colliderChunk.dataLength + Define.System.ExpandedColliderCount; + var oldColliderChunk = tdata.colliderChunk; + tdata.colliderChunk = teamIdArray.Expand(oldColliderChunk, newCount); + flagArray.ExpandAndFill(oldColliderChunk, newCount); // ĉ—§é ˜ċŸŸƒ•ƒİ‚°Ż‚ŻƒŞ‚˘™‚‹ċż…èĤ‚‚Š + centerArray.Expand(oldColliderChunk, newCount); + sizeArray.Expand(oldColliderChunk, newCount); + framePositions.Expand(oldColliderChunk, newCount); + frameRotations.Expand(oldColliderChunk, newCount); + frameScales.Expand(oldColliderChunk, newCount); + nowPositions.Expand(oldColliderChunk, newCount); + nowRotations.Expand(oldColliderChunk, newCount); + oldFramePositions.Expand(oldColliderChunk, newCount); + oldFrameRotations.Expand(oldColliderChunk, newCount); + oldPositions.Expand(oldColliderChunk, newCount); + oldRotations.Expand(oldColliderChunk, newCount); + workDataArray.Expand(oldColliderChunk, newCount); + mainColliderIndices.Expand(oldColliderChunk, newCount); + + // ‚³ƒİ‚¤ƒ€ƒĵƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ĉ‹Ħċĵµ + var oldColliderTransformChunk = tdata.colliderTransformChunk; + tdata.colliderTransformChunk = MagicaManager.Bone.Expand(oldColliderTransformChunk, newCount); + } + + // èż½ċŠ ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı + int localIndex = tdata.UseColliderCount; + int arrayIndex = tdata.colliderChunk.startIndex + localIndex; + int transformIndex = tdata.colliderTransformChunk.startIndex + localIndex; + + // ƒ•ƒİ‚° + var flag = new ExBitFlag16(); + flag = DataUtility.SetColliderType(flag, col.GetColliderType()); + flag.SetFlag(Flag_Valid, true); + flag.SetFlag(Flag_Enable, col.isActiveAndEnabled); + flag.SetFlag(Flag_Reset, true); + flag.SetFlag(Flag_Reverse, col.IsReverseDirection()); + // ƒŻƒĵƒĞƒ‰ċ§żċ‹˘ + var ct = col.transform; + float3 pos = float3.zero; + quaternion rot = quaternion.identity; + float3 scl = 1; + float3 center = col.center; + // ç™ğ録ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ  + Transform target = ct; + if (isSymmetry) + { + // ‚·ƒ³ƒĦƒˆƒŞƒĵ + // ““§Żċ§żċ‹˘è¨ˆç—Żä¸èĤ€‚ĉ–ıċ‘ĉ€§ż§‚ˆ„€‚ + SymmetryType symType; + switch (col.ActiveSymmetryMode) + { + case ColliderSymmetryMode.X_Symmetry: + symType = SymmetryType.X_Symmetry; + break; + case ColliderSymmetryMode.Y_Symmetry: + symType = SymmetryType.Y_Symmetry; + break; + case ColliderSymmetryMode.Z_Symmetry: + symType = SymmetryType.Z_Symmetry; + break; + case ColliderSymmetryMode.XYZ_Symmetry: + symType = SymmetryType.XYZ_Symmetry; + break; + default: + Develop.LogError("Unknown active symmetry mode."); + return; + } + flag = DataUtility.SetSymmetryType(flag, symType); + + // ĉ–ıċ‘ĉ€§ + float direction = 1.0f; + if (col is MagicaCapsuleCollider) + { + var ccol = col as MagicaCapsuleCollider; + if (col.ActiveSymmetryMode == ColliderSymmetryMode.X_Symmetry && ccol.direction == MagicaCapsuleCollider.Direction.X) + direction = -1.0f; + else if (col.ActiveSymmetryMode == ColliderSymmetryMode.Y_Symmetry && ccol.direction == MagicaCapsuleCollider.Direction.Y) + direction = -1.0f; + else if (col.ActiveSymmetryMode == ColliderSymmetryMode.Z_Symmetry && ccol.direction == MagicaCapsuleCollider.Direction.Z) + direction = -1.0f; + else if (col.ActiveSymmetryMode == ColliderSymmetryMode.XYZ_Symmetry) + direction = -1.0f; + } + else if (col is MagicaPlaneCollider) + { + switch (col.ActiveSymmetryMode) + { + case ColliderSymmetryMode.Y_Symmetry: + case ColliderSymmetryMode.XYZ_Symmetry: + direction = -1.0f; + break; + } + } + + // ƒ•ƒİ‚° + flag.SetFlag(Flag_Symmetry, true); + flag.SetFlag(Flag_SymmetryReverse, direction < 0.0f); + + // ç™ğ録ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ  + target = col.ActiveSymmetryTarget; + } + + // ƒžƒƒĵ‚¸ƒ£¸ç™ğ録 + teamIdArray[arrayIndex] = (short)teamId; + flagArray[arrayIndex] = flag; + centerArray[arrayIndex] = center; + sizeArray[arrayIndex] = math.max(col.GetSize(), 0.0001f); // ċżµŸ‚ + framePositions[arrayIndex] = pos; + frameRotations[arrayIndex] = rot; + frameScales[arrayIndex] = scl; + nowPositions[arrayIndex] = pos; + nowRotations[arrayIndex] = rot; + oldFramePositions[arrayIndex] = pos; + oldFrameRotations[arrayIndex] = rot; + oldPositions[arrayIndex] = pos; + oldRotations[arrayIndex] = rot; + mainColliderIndices[arrayIndex] = 0; + + // ClothProcessĞ‚³ƒİ‚¤ƒ€ƒĵ‚³ƒ³ƒƒĵƒƒ³ƒˆ‚’ç™ğ録 + if (cprocess.colliderDict.ContainsKey(col)) + { + int2 data = cprocess.colliderDict[col]; + if (isSymmetry) + { + data.y = localIndex; + // ƒĦ‚¤ƒ³‚³ƒİ‚¤ƒ€ƒĵƒ­ƒĵ‚ЃЂ¤ƒ³ƒ‡ƒƒ‚Ż‚ı‚’記録 + mainColliderIndices[arrayIndex] = data.x; + } + else + data.x = localIndex; + cprocess.colliderDict[col] = data; + } + else + { + Debug.Assert(isSymmetry == false); + cprocess.colliderDict.Add(col, new int2(localIndex, 0)); + } + + // ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ç™ğ録 + bool t_enable = cprocess.IsEnable && flag.IsSet(Flag_Enable); + var tflag = new ExBitFlag8(TransformManager.Flag_Read); + tflag.SetFlag(TransformManager.Flag_Enable, t_enable); + MagicaManager.Bone.SetTransform(target, tflag, transformIndex, teamId); + + tdata.colliderCount++; + } + + + /// + /// ‚³ƒİ‚¤ƒ€ƒĵ‚’ċ‰Šé™¤™‚‹ + /// ċ‰Šé™¤é ˜ċŸŸŻç”Ÿċ­˜™‚‹ĉœ€ċŒċ°ƒ‡ƒĵ‚ż¨ċ…‚Œĉ›żˆ‚‰‚Œ‚‹(SwapBack) + /// + /// + /// + internal void RemoveCollider(ColliderComponent col, int teamId) + { + if (isValid == false) + return; + if (col == null || teamId == 0) + return; + + // Symmetry + RemoveColliderInternal(col, teamId, true); + + // Main + RemoveColliderInternal(col, teamId, false); + + // ‚³ƒİ‚¤ƒ€ƒĵ‚³ƒ³ƒƒĵƒƒ³ƒˆċ´‹‚‰‚‚ċ‰Šé™¤ç™ğ録™‚‹ïĵˆç´‘解除ïĵ‰ + if (col.Exit(teamId)) + { + // ċˆİ用者ïĵ + colliderSet.Remove(col); + } + } + + void RemoveColliderInternal(ColliderComponent col, int teamId, bool isSymmetry) + { + if (isValid == false) + return; + if (col == null || teamId == 0) + return; + ref var tdata = ref MagicaManager.Team.GetTeamDataRef(teamId); + int ccnt = tdata.colliderCount; + if (ccnt == 0) + return; + var cprocess = MagicaManager.Team.GetClothProcess(teamId); + if (cprocess == null) + return; + if (cprocess.colliderDict.ContainsKey(col) == false) + return; + int2 data = cprocess.colliderDict[col]; + int localIndex = data.x; + if (isSymmetry) + { + if (data.y == 0) + return; // ‚·ƒ³ƒĦƒˆƒŞƒĵ‚³ƒİ‚¤ƒ€ƒĵŞ— + localIndex = data.y; + } + + int arrayIndex = tdata.colliderChunk.startIndex + localIndex; + int transformIndex = tdata.colliderTransformChunk.startIndex + localIndex; + + int swapLocalIndex = ccnt - 1; + int swapArrayIndex = tdata.colliderChunk.startIndex + swapLocalIndex; + int swapTransformIndex = tdata.colliderTransformChunk.startIndex + swapLocalIndex; + + if (arrayIndex < swapArrayIndex) + { + // remove swap back + flagArray[arrayIndex] = flagArray[swapArrayIndex]; + teamIdArray[arrayIndex] = teamIdArray[swapArrayIndex]; + centerArray[arrayIndex] = centerArray[swapArrayIndex]; + sizeArray[arrayIndex] = sizeArray[swapArrayIndex]; + framePositions[arrayIndex] = framePositions[swapArrayIndex]; + frameRotations[arrayIndex] = frameRotations[swapArrayIndex]; + frameScales[arrayIndex] = frameScales[swapArrayIndex]; + nowPositions[arrayIndex] = nowPositions[swapArrayIndex]; + nowRotations[arrayIndex] = nowRotations[swapArrayIndex]; + oldFramePositions[arrayIndex] = oldFramePositions[swapArrayIndex]; + oldFrameRotations[arrayIndex] = oldFrameRotations[swapArrayIndex]; + oldPositions[arrayIndex] = oldPositions[swapArrayIndex]; + oldRotations[arrayIndex] = oldRotations[swapArrayIndex]; + mainColliderIndices[arrayIndex] = mainColliderIndices[swapArrayIndex]; + + flagArray[swapArrayIndex] = default; + teamIdArray[swapArrayIndex] = 0; + + // transform + MagicaManager.Bone.CopyTransform(swapTransformIndex, transformIndex); + MagicaManager.Bone.SetTransform(null, default, swapTransformIndex, 0); + + // cprocess + var ckeys = cprocess.colliderDict.Keys.ToList(); + foreach (ColliderComponent kcol in ckeys) + { + Debug.Assert(cprocess.colliderDict.ContainsKey(kcol)); + int2 data2 = cprocess.colliderDict[kcol]; + if (data2.x == swapLocalIndex) + { + data2.x = localIndex; + cprocess.colliderDict[kcol] = data2; + break; + } + if (data2.y == swapLocalIndex) + { + data2.y = localIndex; + cprocess.colliderDict[kcol] = data2; + break; + } + } + } + else + { + // remove + flagArray[arrayIndex] = default; + teamIdArray[arrayIndex] = 0; + + // transform + MagicaManager.Bone.SetTransform(null, default, transformIndex, 0); + } + if (isSymmetry) + data.y = 0; + else + data.x = 0; + cprocess.colliderDict[col] = data; + if (data.x == 0 && data.y == 0 && isSymmetry == false) + cprocess.colliderDict.Remove(col); // ‚³ƒİ‚¤ƒ€ƒĵċ‰Šé™¤ + + tdata.colliderCount--; + } + + /// + /// ĉœ‰ċŠıçŠĥĉ…‹ċ¤‰ĉ›´ + /// + /// + /// + /// + internal void EnableCollider(ColliderComponent col, int teamId, bool sw) + { + if (IsValid() == false) + return; + ref var tdata = ref MagicaManager.Team.GetTeamDataRef(teamId); + if (tdata.IsValid == false) + return; + var cprocess = MagicaManager.Team.GetClothProcess(teamId); + + if (cprocess.colliderDict.ContainsKey(col) == false) + return; + + // ƒĦ‚¤ƒ³€‚·ƒ³ƒĦƒˆƒŞƒĵïĵ’¤‚’ƒ‚§ƒƒ‚Ż + int2 data = cprocess.colliderDict[col]; + for (int i = 0; i < 2; i++) + { + int localIndex = data[i]; + if (i == 1 && localIndex == 0) + continue; // ‚·ƒ³ƒĦƒˆƒŞƒĵindex0Żƒ‡ƒĵ‚żŞ— + + int arrayIndex = tdata.colliderChunk.startIndex + localIndex; + var flag = flagArray[arrayIndex]; + flag.SetFlag(Flag_Enable, sw); + flag.SetFlag(Flag_Reset, true); // Enable/DisableİĦ‚‰§‚‚ƒŞ‚ğƒƒƒˆ + flagArray[arrayIndex] = flag; + + // ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ĉœ‰ċŠıçŠĥĉ…‹ + int transformIndex = tdata.colliderTransformChunk.startIndex + localIndex; + bool t_enable = cprocess.IsEnable && flag.IsSet(Flag_Enable); + MagicaManager.Bone.EnableTransform(transformIndex, t_enable); + } + } + + /// + /// ƒƒĵƒ ĉœ‰ċŠıçŠĥĉ…‹ċ¤‰ĉ›´Ğäĵ´†‚³ƒİ‚¤ƒ€ƒĵçŠĥĉ…‹ċ¤‰ĉ›´ + /// + /// + /// + internal void EnableTeamCollider(int teamId) + { + if (IsValid() == false) + return; + ref var tdata = ref MagicaManager.Team.GetTeamDataRef(teamId); + if (tdata.IsValid == false) + return; + if (tdata.UseColliderCount == 0) + return; + + bool teamEnable = tdata.IsEnable; + var c = tdata.colliderTransformChunk; + for (int i = 0; i < c.dataLength; i++) + { + int arrayIndex = tdata.colliderChunk.startIndex + i; + int transformIndex = c.startIndex + i; + + // ƒ•ƒİ‚° + var flag = flagArray[arrayIndex]; + //flag.SetFlag(Flag_Enable, sw); // ‚³ƒİ‚¤ƒ€ƒĵEnableƒ•ƒİ‚°Ż‚³ƒİ‚¤ƒ€ƒĵċ›şĉœ‰‚‚Ş§ċ¤‰ĉ›´™‚‹ċż…èĤŻŞ„ + flag.SetFlag(Flag_Reset, true); // Enable/DisableİĦ‚‰§‚‚ƒŞ‚ğƒƒƒˆ + flagArray[arrayIndex] = flag; + + // ĉœ‰ċŠıçŠĥĉ…‹ + bool t_enable = teamEnable && flag.IsSet(Flag_Enable); + MagicaManager.Bone.EnableTransform(transformIndex, t_enable); + } + } + + /// + /// ‚³ƒİ‚¤ƒ€ƒĵ‚³ƒ³ƒƒĵƒƒ³ƒˆƒ‘ƒİƒĦƒĵ‚żċ¤‰ĉ›´‚’ċĉ˜ ™‚‹ + /// ‚·ƒ³ƒĦƒˆƒŞƒĵċ¤‰ĉ›´Şİ‚‚ċĉ˜ •›‚‹ + /// + /// + /// + internal void UpdateParameters(ColliderComponent col, int teamId, bool changeSymmetry) + { + if (IsValid() == false) + return; + + ref var tdata = ref MagicaManager.Team.GetTeamDataRef(teamId); + if (tdata.IsValid == false) + return; + var cprocess = MagicaManager.Team.GetClothProcess(teamId); + if (cprocess.colliderDict.ContainsKey(col) == false) + return; + int2 data = cprocess.colliderDict[col]; + + // Main + // ƒĦ‚¤ƒ³‚³ƒİ‚¤ƒ€ƒĵŻċ¤‰ĉ›´żè€ƒˆ‚‹ + // ƒĦ‚¤ƒ³Żċ‰Šé™¤•‚Œ‚‹“¨ŻŞ„€‚Transformċ¤‰ĉ›´‚‚Ş„€‚ + int localIndex = data.x; + int arrayIndex = tdata.colliderChunk.startIndex + localIndex; + var flag = flagArray[arrayIndex]; + flag = DataUtility.SetColliderType(flag, col.GetColliderType()); + flag.SetFlag(Flag_Reverse, col.IsReverseDirection()); + flagArray[arrayIndex] = flag; + centerArray[arrayIndex] = col.center; + sizeArray[arrayIndex] = math.max(col.GetSize(), 0.0001f); // ċżµŸ‚ + + // Symmetry + if (col.ActiveSymmetryMode != ColliderSymmetryMode.None && col.ActiveSymmetryTarget != null) + { + // ‚·ƒ³ƒĦƒˆƒŞƒĵ‚‚Š + if (changeSymmetry) + { + // ‚·ƒ³ƒĦƒˆƒŞƒĵƒ˘ƒĵƒ‰ŸŻ‚żƒĵ‚²ƒƒƒˆċ¤‰ĉ›´ + // 一ĉ—Ĥċ‰Šé™¤—Ĥċ†ċşĤèż½ċŠ ™‚‹ + RemoveColliderInternal(col, teamId, true); + AddColliderInternal(ref tdata, cprocess, col, true); + //Debug.Log($"remove and add symmetry."); + } + else if (data.y > 0) + { + // ‚·ƒ³ƒĦƒˆƒŞƒĵƒ˘ƒĵƒ‰Š‚ˆ³‚żƒĵ‚²ƒƒƒˆŻċ¤‰ĉ›´•‚ŒĤ„Ş„ + // ƒ‘ƒİƒĦƒĵ‚żċ¤‰ĉ›´ż + localIndex = data.y; + arrayIndex = tdata.colliderChunk.startIndex + localIndex; + flag = flagArray[arrayIndex]; + flag = DataUtility.SetColliderType(flag, col.GetColliderType()); + flag.SetFlag(Flag_Reverse, col.IsReverseDirection()); + flagArray[arrayIndex] = flag; + centerArray[arrayIndex] = col.center; + sizeArray[arrayIndex] = math.max(col.GetSize(), 0.0001f); // ċżµŸ‚ + //Debug.Log($"modify symmetry parameter only."); + } + } + else + { + // ‚·ƒ³ƒĦƒˆƒŞƒĵŞ— + // ĉ—˘ċ­˜‚·ƒ³ƒĦƒˆƒŞƒĵ‚³ƒİ‚¤ƒ€ƒĵŒċ­˜ċœ¨™‚‹ċ ´ċˆŻċ‰Šé™¤™‚‹ + RemoveColliderInternal(col, teamId, true); + //Debug.Log($"remove symmetry."); + } + } + + //========================================================================================= + // Simulation + //========================================================================================= + /// + /// ‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ĉ›´ĉ–°ċ‰ċ‡Ĥ理 + /// ‚³ƒİ‚¤ƒ€ƒĵċ§żċ‹˘èŞ­żċ–‚Š + /// + internal static void SimulationPreUpdate( + DataChunk chunk, + // team + ref TeamManager.TeamData tdata, + ref InertiaConstraint.CenterData cdata, + // collider + ref NativeArray flagArray, + ref NativeArray centerArray, + ref NativeArray framePositions, + ref NativeArray frameRotations, + ref NativeArray frameScales, + ref NativeArray oldFramePositions, + ref NativeArray oldFrameRotations, + ref NativeArray nowPositions, + ref NativeArray nowRotations, + ref NativeArray oldPositions, + ref NativeArray oldRotations, + ref NativeArray mainColliderIndices, + // transform + ref NativeArray transformPositionArray, + ref NativeArray transformRotationArray, + ref NativeArray transformScaleArray, + ref NativeArray transformLocalPositionArray, + ref NativeArray transformLocalRotationArray, + ref NativeArray transformLocalScaleArray + ) + { + // ‚³ƒİ‚¤ƒ€ƒĵ”¨ + //int index = tdata.colliderChunk.startIndex; + int index = tdata.colliderChunk.startIndex + chunk.startIndex; + //for (int i = 0; i < tdata.colliderChunk.dataLength; i++, index++) + for (int i = 0; i < chunk.dataLength; i++, index++) + { + var flag = flagArray[index]; + if (flag.IsSet(Flag_Valid) == false || flag.IsSet(Flag_Enable) == false) + continue; + + var center = centerArray[index]; + int l_index = index - tdata.colliderChunk.startIndex; + int t_index = tdata.colliderTransformChunk.startIndex + l_index; + + // ğĵïĵ‚ı‚ħƒĵƒĞŻĉµċ°‚ı‚ħƒĵƒĞĞċ¤‰ĉ›—ç„ĦċŠıċŒ–•›‚‹ + bool isZeroScale = false; + float3 pscl = transformScaleArray[t_index]; + for (int j = 0; j < 3; j++) + { + float s = pscl[j]; + if (s < 1e-06f && s > -1e-06f) + { + pscl[j] = 1e-06f; + isZeroScale = true; + } + } + flag.SetFlag(Flag_ScaleSuspend, isZeroScale); + + // ‚³ƒİ‚¤ƒ€ƒĵċ§żċ‹˘ïĵˆƒŻƒĵƒĞƒ‰ïĵ‰ + float3 wpos; + quaternion wrot; + float3 wscl; + if (flag.IsSet(Flag_Symmetry)) + { + // Symmetry + int mainLocalIndex = mainColliderIndices[index]; + int mainTransformIndex = tdata.colliderTransformChunk.startIndex + mainLocalIndex; + float3 lpos = transformLocalPositionArray[mainTransformIndex]; + float3 lerot = MathUtility.ToEuler(transformLocalRotationArray[mainTransformIndex]); + float3 lscl = transformLocalScaleArray[mainTransformIndex]; + + var symmetryType = DataUtility.GetSymmetryType(flag); + switch (symmetryType) + { + case SymmetryType.X_Symmetry: + lpos.x = -lpos.x; + center.x = -center.x; + lerot.y = -lerot.y; + lerot.z = -lerot.z; + break; + case SymmetryType.Y_Symmetry: + lpos.y = -lpos.y; + center.y = -center.y; + lerot.x = -lerot.x; + lerot.z = -lerot.z; + break; + case SymmetryType.Z_Symmetry: + lpos.z = -lpos.z; + center.z = -center.z; + lerot.x = -lerot.x; + lerot.y = -lerot.y; + break; + case SymmetryType.XYZ_Symmetry: + lpos = -lpos; + center = -center; + break; + } + + // ‚·ƒ³ƒĦƒˆƒŞƒĵċ…ˆèĤŞ + float3 ppos = transformPositionArray[t_index]; + quaternion prot = transformRotationArray[t_index]; + //float3 pscl = transformScaleArray[t_index]; + + // ƒž‚¤ƒŠ‚ı‚ı‚ħƒĵƒĞ + float3 sclSign = math.sign(pscl); + float3 sclEulerSign = 1; + if (pscl.x < 0 || pscl.y < 0 || pscl.z < 0) + sclEulerSign = sclSign * -1; + + // ‚·ƒ³ƒĦƒˆƒŞƒĵ‚³ƒİ‚¤ƒ€ƒĵċ§żċ‹˘ + wpos = MathUtility.TransformPoint(lpos, ppos, prot, pscl); + wrot = math.mul(prot, quaternion.Euler(math.radians(lerot * sclEulerSign))); + wscl = pscl * lscl; + + // ‚ރ•‚ğƒƒƒˆ + wpos += math.mul(wrot, center * sclSign) * wscl * sclSign; + } + else + { + // Main + wpos = transformPositionArray[t_index]; + wrot = transformRotationArray[t_index]; + //wscl = transformScaleArray[t_index]; + wscl = pscl; + + // ƒž‚¤ƒŠ‚ı‚ı‚ħƒĵƒĞ + float3 sclSign = math.sign(wscl); + + // ‚ރ•‚ğƒƒƒˆ + wpos += math.mul(wrot, center * sclSign) * wscl * sclSign; + } + + // ĉ ĵ納 + framePositions[index] = wpos; + frameRotations[index] = wrot; + frameScales[index] = wscl; + + // ƒŞ‚ğƒƒƒˆċ‡Ĥ理 + if (tdata.IsReset || flag.IsSet(Flag_Reset) || isZeroScale) + { + oldFramePositions[index] = wpos; + oldFrameRotations[index] = wrot; + nowPositions[index] = wpos; + nowRotations[index] = wrot; + oldPositions[index] = wpos; + oldRotations[index] = wrot; + + flag.SetFlag(Flag_Reset, false); + } + else if (tdata.IsInertiaShift || tdata.IsNegativeScaleTeleport) + { + // ĉ…£ĉ€§ċ…¨ä½“‚·ƒ•ƒˆ + var oldFramePosition = oldFramePositions[index]; + var oldFrameRotation = oldFrameRotations[index]; + var nowPosition = nowPositions[index]; + var nowRotation = nowRotations[index]; + var oldPosition = oldPositions[index]; + var oldRotation = oldRotations[index]; + + // ƒž‚¤ƒŠ‚ı‚ı‚ħƒĵƒĞ + if (tdata.IsNegativeScaleTeleport) + { + // ĉœĴ体‚ı‚ħƒĵƒĞċèğ˘Ğċˆ‚›Ĥ‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³Ğċ½ħ響Œċ‡şŞ„‚ˆ†Ğċż…èĤŞċş§ĉ¨™ç³ğ‚’ċŒĉ§˜Ğèğ¸ċèğ˘•›‚‹ + // ‚³ƒİ‚¤ƒ€ƒĵŻ‚ğƒ³‚żƒĵçİşé–“§ċèğ˘•›‚‹ + // ċ›žèğ˘Ğ関—ĤŻƒ‘ƒĵƒ†‚£‚ŻƒĞ¨Żç•°Ş‚Šĉ³•ç·šĉŽç·š‚’‚ı‚ħƒĵƒĞĉ–ıċ‘Ğ‚ˆ‚Šċèğ˘•›Ĥ組żç›´™ + + // ‚ğƒ³‚żƒĵçİşé–“èğ¸ċèğ˘ç”¨ƒžƒˆƒŞƒƒ‚Ż‚ı + float4x4 negativeM = cdata.negativeScaleMatrix; + + oldFramePosition = MathUtility.TransformPoint(oldFramePosition, negativeM); + oldFrameRotation = MathUtility.TransformRotation(oldFrameRotation, negativeM, tdata.negativeScaleChange); + + nowPosition = MathUtility.TransformPoint(nowPosition, negativeM); + nowRotation = MathUtility.TransformRotation(nowRotation, negativeM, tdata.negativeScaleChange); + + oldPosition = MathUtility.TransformPoint(oldPosition, negativeM); + oldRotation = MathUtility.TransformRotation(oldRotation, negativeM, tdata.negativeScaleChange); + } + + if (tdata.IsInertiaShift) + { + // cdata.frameComponentShiftVector : ċ…¨ä½“‚·ƒ•ƒˆƒ™‚ŻƒˆƒĞ + // cdata.frameComponentShiftRotation : ċ…¨ä½“‚·ƒ•ƒˆċ›žèğ˘ + // cdata.oldComponentWorldPosition : ƒ•ƒĴƒĵƒ ç§ğċ‹•ċ‰‚³ƒ³ƒƒĵƒƒ³ƒˆä¸­ċżƒä½ç½ + + float3 prevFrameWorldPosition = cdata.oldComponentWorldPosition; + + oldFramePosition = MathUtility.ShiftPosition(oldFramePosition, prevFrameWorldPosition, cdata.frameComponentShiftVector, cdata.frameComponentShiftRotation); + oldFrameRotation = math.mul(cdata.frameComponentShiftRotation, oldFrameRotation); + + nowPosition = MathUtility.ShiftPosition(nowPosition, prevFrameWorldPosition, cdata.frameComponentShiftVector, cdata.frameComponentShiftRotation); + nowRotation = math.mul(cdata.frameComponentShiftRotation, nowRotation); + + oldPosition = MathUtility.ShiftPosition(oldPosition, prevFrameWorldPosition, cdata.frameComponentShiftVector, cdata.frameComponentShiftRotation); + oldRotation = math.mul(cdata.frameComponentShiftRotation, oldRotation); + } + + oldFramePositions[index] = oldFramePosition; + oldFrameRotations[index] = oldFrameRotation; + nowPositions[index] = nowPosition; + nowRotations[index] = nowRotation; + oldPositions[index] = oldPosition; + oldRotations[index] = oldRotation; + } + + // ƒ•ƒİ‚°ĉ›¸ĉˆğ— + flagArray[index] = flag; + } + } + + internal static void SimulationStartStep( + // team + ref TeamManager.TeamData tdata, + ref InertiaConstraint.CenterData cdata, + // collider + ref NativeArray flagArray, + ref NativeArray sizeArray, + ref NativeArray framePositions, + ref NativeArray frameRotations, + ref NativeArray frameScales, + ref NativeArray oldFramePositions, + ref NativeArray oldFrameRotations, + ref NativeArray nowPositions, + ref NativeArray nowRotations, + ref NativeArray oldPositions, + ref NativeArray oldRotations, + ref NativeArray workDataArray + ) + { + // ‚³ƒİ‚¤ƒ€ƒĵ”¨ + int cindex = tdata.colliderChunk.startIndex; + for (int i = 0; i < tdata.colliderChunk.dataLength; i++, cindex++) + { + var flag = flagArray[cindex]; + if (flag.IsSet(Flag_Valid) == false || flag.IsSet(Flag_Enable) == false || flag.IsSet(Flag_ScaleSuspend)) + continue; + + // äğŠċ›ž‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³‚ıƒ†ƒƒƒ—§ċ§żċ‹˘‚’ĉħ‚‚‚‹ + float3 pos = math.lerp(oldFramePositions[cindex], framePositions[cindex], tdata.frameInterpolation); + quaternion rot = math.slerp(oldFrameRotations[cindex], frameRotations[cindex], tdata.frameInterpolation); + rot = math.normalize(rot); // ċż…èĤ + nowPositions[cindex] = pos; + nowRotations[cindex] = rot; + //Debug.Log($"cpos:{pos}, coldpos:{oldPos}"); + + // ‚³ƒİ‚¤ƒ€ƒĵĉ…£ĉ€§‚·ƒ•ƒˆ + // oldċ§żċ‹˘‚’‚·ƒ•ƒˆ•›‚‹ + var oldpos = oldPositions[cindex]; + var oldrot = oldRotations[cindex]; + + // ƒ­ƒĵ‚ЃĞĉ…£ĉ€§‚·ƒ•ƒˆ + oldpos = math.lerp(oldpos, pos, cdata.stepMoveInertiaRatio); + oldrot = math.slerp(oldrot, rot, cdata.stepRotationInertiaRatio); + oldPositions[cindex] = oldpos; + oldRotations[cindex] = math.normalize(oldrot); + + // ‚ıƒ†ƒƒƒ—作ĉ­ƒ‡ƒĵ‚żĉ§‹ç݉ + var type = DataUtility.GetColliderType(flag); + var work = new WorkData(); + var csize = sizeArray[cindex]; + var cscl = frameScales[cindex]; + work.inverseOldRot = math.inverse(oldrot); + work.rot = rot; + if (type == ColliderType.Sphere) + { + // radius + float radius = csize.x * math.abs(cscl.x); // Xè𸁁ż‚’èĤ‹‚‹ + work.radius = radius; + + // aabb + var aabb = new AABB(math.min(oldpos, pos), math.max(oldpos, pos)); + aabb.Expand(radius); + work.aabb = aabb; + + // oldpos + work.oldPos.c0 = oldpos; + + // nextpos + work.nextPos.c0 = pos; + } + else if (type >= ColliderType.CapsuleX_Center && type <= ColliderType.CapsuleZ_Start) + { + // 中ċ¤ĉƒˆ + bool alignedCenter = type >= ColliderType.CapsuleX_Center && type <= ColliderType.CapsuleZ_Center; + + // ĉ–ıċ‘ĉ€§ + float3 dir = (type == ColliderType.CapsuleX_Center || type == ColliderType.CapsuleX_Start) ? math.right() + : (type == ColliderType.CapsuleY_Center || type == ColliderType.CapsuleY_Start) ? math.up() + : math.forward(); + + // ‚ı‚ħƒĵƒĞ + //float scl = math.dot(math.abs(cscl), dir); // dirè𸁂ı‚ħƒĵƒĞ‚’ä½żç”¨™‚‹ + + // ƒž‚¤ƒŠ‚ı‚ı‚ħƒĵƒĞ + float scl0 = math.dot(cscl, dir); // dirè𸁂ı‚ħƒĵƒĞ‚’ä½żç”¨™‚‹ + dir *= math.sign(scl0); // ĉ–ıċ‘ċèğ˘ + float scl = math.abs(scl0); + + // 逆ĉ–ıċ‘ + if (flag.IsSet(Flag_Reverse)) + dir = -dir; + + // ‚·ƒ³ƒĦƒˆƒŞƒĵĞ‚ˆ‚‹ĉ–ıċ‘ĉ€§ + if (flag.IsSet(Flag_Symmetry) && flag.IsSet(Flag_SymmetryReverse)) + dir = -dir; + + // x = ċ§‹ç‚ıċŠċ„ + // y = 終ç‚ıċŠċ„ + // z = 長• + csize *= scl; + + float sr = csize.x; + float er = csize.y; + float length = csize.z; + + // 長• + float slen = alignedCenter ? length * 0.5f : 0.0f; + float elen = alignedCenter ? length * 0.5f : (length - sr); + slen = math.max(slen - sr, 0.0f); + elen = math.max(elen - er, 0.0f); + + // ç§ğċ‹•ċ‰‚Ѓ—‚ğƒĞċ§‹ç‚ı¨çµ‚ç‚ı + float3 soldpos = oldpos + math.mul(oldrot, dir * slen); + float3 eoldpos = oldpos - math.mul(oldrot, dir * elen); + + // ç§ğċ‹•ċŒ‚Ѓ—‚ğƒĞċ§‹ç‚ı¨çµ‚ç‚ı + float3 spos = pos + math.mul(rot, dir * slen); + float3 epos = pos - math.mul(rot, dir * elen); + + // AABB + var aabbC = new AABB(math.min(soldpos, spos) - sr, math.max(soldpos, spos) + sr); + var aabbC1 = new AABB(math.min(eoldpos, epos) - er, math.max(eoldpos, epos) + er); + aabbC.Encapsulate(aabbC1); + + // ĉ ĵ納 + work.aabb = aabbC; + work.radius = new float2(sr, er); + work.oldPos = new float3x2(soldpos, eoldpos); + work.nextPos = new float3x2(spos, epos); + } + else if (type == ColliderType.Plane) + { + // ĉŠĵ—ċ‡ş—ĉ³•ç·šĉ–ıċ‘‚’oldposĞĉ ĵ納™‚‹ + // ƒž‚¤ƒŠ‚ı‚ı‚ħƒĵƒĞ + float3 dir = math.up(); + dir *= math.sign(cscl.y); // Yċèğ˘ĉ™‚Żé€†Ğ™‚‹ + + // ‚·ƒ³ƒĦƒˆƒŞƒĵĞ‚ˆ‚‹ĉ–ıċ‘ĉ€§ + if (flag.IsSet(Flag_Symmetry) && flag.IsSet(Flag_SymmetryReverse)) + dir = -dir; + + float3 n = math.mul(rot, dir); + work.oldPos.c0 = n; + work.nextPos.c0 = pos; + } + + workDataArray[cindex] = work; + } + } + + /// + /// ‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³‚ıƒ†ƒƒƒ—ċŒċ‡Ĥ理 + /// oldċ§żċ‹˘ĉ ĵ納 + /// + internal static void SimulationEndStep( + DataChunk chunk, + // team + ref TeamManager.TeamData tdata, + // collider + ref NativeArray nowPositions, + ref NativeArray nowRotations, + ref NativeArray oldPositions, + ref NativeArray oldRotations + ) + { + //int cindex = tdata.colliderChunk.startIndex; + int cindex = tdata.colliderChunk.startIndex + chunk.startIndex; + //for (int i = 0; i < tdata.colliderChunk.dataLength; i++, cindex++) + for (int i = 0; i < chunk.dataLength; i++, cindex++) + { + oldPositions[cindex] = nowPositions[cindex]; + oldRotations[cindex] = nowRotations[cindex]; + } + } + + /// + /// ‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ĉ›´ĉ–°ċŒċ‡Ĥ理 + /// + internal static void SimulationPostUpdate( + // team + ref TeamManager.TeamData tdata, + // collider + ref NativeArray framePositions, + ref NativeArray frameRotations, + ref NativeArray oldFramePositions, + ref NativeArray oldFrameRotations + ) + { + if (tdata.colliderCount == 0) + return; + if (tdata.IsRunning == false) + return; + + int cindex = tdata.colliderChunk.startIndex; + for (int k = 0; k < tdata.colliderChunk.dataLength; k++, cindex++) + { + // ‚³ƒİ‚¤ƒ€ƒĵċħĉ­´ĉ›´ĉ–° + oldFramePositions[cindex] = framePositions[cindex]; + oldFrameRotations[cindex] = frameRotations[cindex]; + + } + } + + //========================================================================================= + public void InformationLog(StringBuilder allsb) + { + StringBuilder sb = new StringBuilder(); + sb.AppendLine($"========== Collider Manager =========="); + if (IsValid() == false) + { + sb.AppendLine($"Collider Manager. Invalid."); + } + else + { + int cnt = teamIdArray?.Count ?? 0; + + sb.AppendLine($"Use:{cnt}"); + sb.AppendLine($" -flagArray:{flagArray.ToSummary()}"); + sb.AppendLine($" -centerArray:{centerArray.ToSummary()}"); + sb.AppendLine($" -sizeArray:{sizeArray.ToSummary()}"); + sb.AppendLine($" -framePositions:{framePositions.ToSummary()}"); + sb.AppendLine($" -frameRotations:{frameRotations.ToSummary()}"); + sb.AppendLine($" -frameScales:{frameScales.ToSummary()}"); + sb.AppendLine($" -oldFramePositions:{oldFramePositions.ToSummary()}"); + sb.AppendLine($" -oldFrameRotations:{oldFrameRotations.ToSummary()}"); + sb.AppendLine($" -nowPositions:{nowPositions.ToSummary()}"); + sb.AppendLine($" -nowRotations:{nowRotations.ToSummary()}"); + sb.AppendLine($" -oldPositions:{oldPositions.ToSummary()}"); + sb.AppendLine($" -oldRotations:{oldRotations.ToSummary()}"); + sb.AppendLine($" -mainColliderIndices:{mainColliderIndices.ToSummary()}"); + + sb.AppendLine($"[Colliders]"); + int useCnt = 0; + for (int i = 0; i < cnt; i++) + { + var flag = flagArray[i]; + if (flag.IsSet(Flag_Valid) == false) + continue; + useCnt++; + var ctype = DataUtility.GetColliderType(flag); + string sym = flag.IsSet(Flag_Symmetry) ? "Symmetry" : ""; + sb.AppendLine($" [{i}] tid:{teamIdArray[i]}, flag:0x{flag.Value:X}, type:{ctype}, size:{sizeArray[i]}, cen:{centerArray[i]}, {sym}"); + } + sb.AppendLine($" ActiveCount:{useCnt}"); + + sb.AppendLine($"[Collider Components:{colliderSet.Count}]"); + foreach (var col in colliderSet) + { + if (col) + { + sb.Append($"({col.UseTeamCount}) {col.name}"); + if (col.ActiveSymmetryMode != ColliderSymmetryMode.None) + { + sb.Append($" Symmetry:{col.ActiveSymmetryMode}"); + } + sb.AppendLine(); + } + else + sb.AppendLine($" (null!)"); + } + } + sb.AppendLine(); + Debug.Log(sb.ToString()); + allsb.Append(sb); + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/Simulation/ColliderManager.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Manager/Simulation/ColliderManager.cs.meta new file mode 100644 index 00000000..a4a6a952 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/Simulation/ColliderManager.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 423ad2b7aa4749f4b88eac13b3b21d54 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Manager/Simulation/ColliderManager.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/Simulation/SimulationManager.cs b/Assets/MagicaCloth2/Scripts/Core/Manager/Simulation/SimulationManager.cs new file mode 100644 index 00000000..e8fee479 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/Simulation/SimulationManager.cs @@ -0,0 +1,1476 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System.Text; +using Unity.Collections; +using Unity.Jobs; +using Unity.Mathematics; +using UnityEngine; + +namespace MagicaCloth2 +{ + public partial class SimulationManager : IManager, IValid + { + /// + /// ƒƒĵƒ ID + /// + public ExNativeArray teamIdArray; + + /// + /// çċœ¨‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ċş§ĉ¨™ + /// + public ExNativeArray nextPosArray; + + /// + /// ïĵ‘¤ċ‰‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ċş§ĉ¨™ + /// + public ExNativeArray oldPosArray; + + /// + /// ïĵ‘¤ċ‰‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ċ›žèğ˘(todo:çċœ¨ĉœŞä½żç”¨ïĵ‰ + /// + public ExNativeArray oldRotArray; + + /// + /// çċœ¨‚˘ƒ‹ƒĦƒĵ‚·ƒ§ƒ³ċ§żċ‹˘ċş§ĉ¨™ + /// ‚Ğ‚ı‚żƒ ‚ı‚­ƒ‹ƒ³‚°çµĉžœ‚‚ċĉ˜ •‚ŒĤ„‚‹ + /// + public ExNativeArray basePosArray; + + /// + /// çċœ¨‚˘ƒ‹ƒĦƒĵ‚·ƒ§ƒ³ċ§żċ‹˘ċ›žèğ˘ + /// ‚Ğ‚ı‚żƒ ‚ı‚­ƒ‹ƒ³‚°çµĉžœ‚‚ċĉ˜ •‚ŒĤ„‚‹ + /// + public ExNativeArray baseRotArray; + + /// + /// ïĵ‘¤ċ‰ċŽŸç‚ıċş§ĉ¨™ + /// + public ExNativeArray oldPositionArray; + + /// + /// ïĵ‘¤ċ‰ċŽŸç‚ıċ›žèğ˘ + /// + public ExNativeArray oldRotationArray; + + /// + /// 速ċşĤ計ç—用ċş§ĉ¨™ + /// + public ExNativeArray velocityPosArray; + + /// + /// èĦ¨ç¤şċş§ĉ¨™ + /// + public ExNativeArray dispPosArray; + + /// + /// 速ċşĤ + /// + public ExNativeArray velocityArray; + + /// + /// ċŸé€ŸċşĤ + /// + public ExNativeArray realVelocityArray; + + /// + /// ĉ‘İĉ“Ĥ(0.0 ~ 1.0) + /// + public ExNativeArray frictionArray; + + /// + /// 静ĉ­˘ĉ‘İĉ“Ĥ係ĉ•° + /// + public ExNativeArray staticFrictionArray; + + /// + /// ĉŽè§Ĥ‚³ƒİ‚¤ƒ€ƒĵèĦçށĉ³•ç·š + /// + public ExNativeArray collisionNormalArray; + + public int ParticleCount => nextPosArray?.Count ?? 0; + + //========================================================================================= + /// + /// ċˆĥ約 + /// + public DistanceConstraint distanceConstraint; + public TriangleBendingConstraint bendingConstraint; + public TetherConstraint tetherConstraint; + public AngleConstraint angleConstraint; + public InertiaConstraint inertiaConstraint; + public ColliderCollisionConstraint colliderCollisionConstraint; + public MotionConstraint motionConstraint; + public SelfCollisionConstraint selfCollisionConstraint; + + //========================================================================================= + /// + /// ‚ıƒ†ƒƒƒ—”¨‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ċŸşĉş–¨Ş‚‹ċ§żċ‹˘ċş§ĉ¨™ + /// ċˆĉœŸċ§żċ‹˘¨‚˘ƒ‹ƒĦƒĵ‚·ƒ§ƒ³ċ§żċ‹˘‚’AnimatinBlendRatio§è£œé–“—Ÿ‚‚ + /// + public NativeArray stepBasicPositionBuffer; + + /// + /// ‚ıƒ†ƒƒƒ—”¨‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ċŸşĉş–¨Ş‚‹ċ§żċ‹˘ċ›žèğ˘ + /// ċˆĉœŸċ§żċ‹˘¨‚˘ƒ‹ƒĦƒĵ‚·ƒ§ƒ³ċ§żċ‹˘‚’AnimatinBlendRatio§è£œé–“—Ÿ‚‚ + /// + public NativeArray stepBasicRotationBuffer; + + /// + /// 作ĉ­ç”¨ƒƒƒƒ•‚Ħ + /// + internal NativeArray tempVectorBufferA; + internal NativeArray tempVectorBufferB; + internal NativeArray tempCountBuffer; + internal NativeArray tempFloatBufferA; + internal NativeArray tempRotationBufferA; + internal NativeArray tempRotationBufferB; + + /// + /// ‚ıƒ†ƒƒƒ—ċŸèĦŒ‚Ğ‚Ĥƒ³‚żƒĵ + /// + internal int SimulationStepCount { get; private set; } + + /// + /// ċŸèĦŒç’°ċ˘ƒ§ċˆİ用§‚‹ƒŻƒĵ‚Ѓĵ‚ıƒĴƒƒƒ‰ĉ•° + /// + internal int WorkerCount => Unity.Jobs.LowLevel.Unsafe.JobsUtility.JobWorkerCount; + + /// + /// ċˆ†ċ‰²‚¸ƒ§ƒ–‚’éİ用™‚‹ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒé ‚ç‚ıĉ•° + /// + internal int splitProxyMeshVertexCount = Define.System.SplitProxyMeshVertexCount; + + bool isValid = false; + + //========================================================================================= + public void Dispose() + { + isValid = false; + + teamIdArray?.Dispose(); + nextPosArray?.Dispose(); + oldPosArray?.Dispose(); + oldRotArray?.Dispose(); + basePosArray?.Dispose(); + baseRotArray?.Dispose(); + oldPositionArray?.Dispose(); + oldRotationArray?.Dispose(); + velocityPosArray?.Dispose(); + dispPosArray?.Dispose(); + velocityArray?.Dispose(); + realVelocityArray?.Dispose(); + frictionArray?.Dispose(); + staticFrictionArray?.Dispose(); + collisionNormalArray?.Dispose(); + + teamIdArray = null; + nextPosArray = null; + oldPosArray = null; + oldRotArray = null; + basePosArray = null; + baseRotArray = null; + oldPositionArray = null; + oldRotationArray = null; + velocityPosArray = null; + dispPosArray = null; + velocityArray = null; + realVelocityArray = null; + frictionArray = null; + staticFrictionArray = null; + collisionNormalArray = null; + + if (stepBasicPositionBuffer.IsCreated) + stepBasicPositionBuffer.Dispose(); + if (stepBasicRotationBuffer.IsCreated) + stepBasicRotationBuffer.Dispose(); + if (tempVectorBufferA.IsCreated) + tempVectorBufferA.Dispose(); + if (tempVectorBufferB.IsCreated) + tempVectorBufferB.Dispose(); + if (tempCountBuffer.IsCreated) + tempCountBuffer.Dispose(); + if (tempFloatBufferA.IsCreated) + tempFloatBufferA.Dispose(); + if (tempRotationBufferA.IsCreated) + tempRotationBufferA.Dispose(); + if (tempRotationBufferB.IsCreated) + tempRotationBufferB.Dispose(); + + distanceConstraint?.Dispose(); + bendingConstraint?.Dispose(); + tetherConstraint?.Dispose(); + angleConstraint?.Dispose(); + inertiaConstraint?.Dispose(); + colliderCollisionConstraint?.Dispose(); + motionConstraint?.Dispose(); + selfCollisionConstraint?.Dispose(); + distanceConstraint = null; + bendingConstraint = null; + tetherConstraint = null; + angleConstraint = null; + inertiaConstraint = null; + colliderCollisionConstraint = null; + motionConstraint = null; + selfCollisionConstraint = null; + } + + public void EnterdEditMode() + { + Dispose(); + } + + public void Initialize() + { + Dispose(); + + const int capacity = 0; // 1024? + teamIdArray = new ExNativeArray(capacity); + nextPosArray = new ExNativeArray(capacity); + oldPosArray = new ExNativeArray(capacity); + oldRotArray = new ExNativeArray(capacity); + basePosArray = new ExNativeArray(capacity); + baseRotArray = new ExNativeArray(capacity); + oldPositionArray = new ExNativeArray(capacity); + oldRotationArray = new ExNativeArray(capacity); + velocityPosArray = new ExNativeArray(capacity); + dispPosArray = new ExNativeArray(capacity); + velocityArray = new ExNativeArray(capacity); + realVelocityArray = new ExNativeArray(capacity); + frictionArray = new ExNativeArray(capacity); + staticFrictionArray = new ExNativeArray(capacity); + collisionNormalArray = new ExNativeArray(capacity); + + // ċˆĥ約 + distanceConstraint = new DistanceConstraint(); + bendingConstraint = new TriangleBendingConstraint(); + tetherConstraint = new TetherConstraint(); + angleConstraint = new AngleConstraint(); + inertiaConstraint = new InertiaConstraint(); + colliderCollisionConstraint = new ColliderCollisionConstraint(); + motionConstraint = new MotionConstraint(); + selfCollisionConstraint = new SelfCollisionConstraint(); + + SimulationStepCount = 0; + + isValid = true; + + Develop.DebugLog($"JobWorkerCount:{Unity.Jobs.LowLevel.Unsafe.JobsUtility.JobWorkerCount}"); + //Develop.DebugLog($"MaxJobThreadCount:{Unity.Jobs.LowLevel.Unsafe.JobsUtility.MaxJobThreadCount}"); + } + + public bool IsValid() + { + return isValid; + } + + //========================================================================================= + /// + /// ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒ‚’ƒžƒƒĵ‚¸ƒ£Ğç™ğ録™‚‹ + /// + internal void RegisterProxyMesh(ClothProcess cprocess) + { + if (isValid == false) + return; + + int teamId = cprocess.TeamId; + var proxyMesh = cprocess.ProxyMeshContainer.shareVirtualMesh; + ref var tdata = ref MagicaManager.Team.GetTeamDataRef(teamId); + + int pcnt = proxyMesh.VertexCount; + tdata.particleChunk = teamIdArray.AddRange(pcnt, (short)teamId); + nextPosArray.AddRange(pcnt); + oldPosArray.AddRange(pcnt); + oldRotArray.AddRange(pcnt); + basePosArray.AddRange(pcnt); + baseRotArray.AddRange(pcnt); + oldPositionArray.AddRange(pcnt); + oldRotationArray.AddRange(pcnt); + velocityPosArray.AddRange(pcnt); + dispPosArray.AddRange(pcnt); + velocityArray.AddRange(pcnt); + realVelocityArray.AddRange(pcnt); + frictionArray.AddRange(pcnt); + staticFrictionArray.AddRange(pcnt); + collisionNormalArray.AddRange(pcnt); + } + + /// + /// ċˆĥ約ƒ‡ƒĵ‚ż‚’ç™ğ録™‚‹ + /// + /// + internal void RegisterConstraint(ClothProcess cprocess) + { + if (isValid == false) + return; + + int teamId = cprocess.TeamId; + + // ĉ…£ĉ€§ċˆĥ約ƒ‡ƒĵ‚ż‚’‚³ƒ”ƒĵïĵˆ™§Ğ領ċŸŸŻç˘şäżĉ¸ˆżŞ§‚³ƒ”ƒĵ™‚‹ïĵ‰ + MagicaManager.Team.centerDataArray[teamId] = cprocess.inertiaConstraintData.centerData; + + // ċˆĥ約ƒ‡ƒĵ‚ż‚’ç™ğ録™‚‹ + distanceConstraint.Register(cprocess); + bendingConstraint.Register(cprocess); + inertiaConstraint.Register(cprocess); + selfCollisionConstraint.Register(cprocess); + } + + + /// + /// ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒ‚’ƒžƒƒĵ‚¸ƒ£‹‚‰è§£é™¤™‚‹ + /// + internal void ExitProxyMesh(ClothProcess cprocess) + { + if (isValid == false) + return; + + int teamId = cprocess.TeamId; + ref var tdata = ref MagicaManager.Team.GetTeamDataRef(teamId); + tdata.flag.SetBits(TeamManager.Flag_Exit, true); // ĉĥˆĉğ…ƒ•ƒİ‚° + + var c = tdata.particleChunk; + teamIdArray.RemoveAndFill(c); + nextPosArray.Remove(c); + oldPosArray.Remove(c); + oldRotArray.Remove(c); + basePosArray.Remove(c); + baseRotArray.Remove(c); + oldPositionArray.Remove(c); + oldRotationArray.Remove(c); + velocityPosArray.Remove(c); + dispPosArray.Remove(c); + velocityArray.Remove(c); + realVelocityArray.Remove(c); + frictionArray.Remove(c); + staticFrictionArray.Remove(c); + collisionNormalArray.Remove(c); + + tdata.particleChunk.Clear(); + + // ċˆĥ約ƒ‡ƒĵ‚ż‚’解除™‚‹ + distanceConstraint.Exit(cprocess); + bendingConstraint.Exit(cprocess); + inertiaConstraint.Exit(cprocess); + selfCollisionConstraint.Exit(cprocess); + } + + //========================================================================================= + /// + /// 作ĉ­ƒƒƒƒ•‚Ħĉ›´ĉ–° + /// + internal void WorkBufferUpdate() + { + int pcnt = ParticleCount; + + // ĉħŽç”¨ä½œĉ­ƒƒƒƒ•‚Ħ + // ĉ‹Ħċĵµĉ™‚ĞŻïĵ‚ŻƒŞ‚˘•‚Œ‚‹ + stepBasicPositionBuffer.MC2Resize(pcnt); + stepBasicRotationBuffer.MC2Resize(pcnt); + + // ĉħŽç”¨ƒƒƒƒ•‚Ħ + // ĉ‹Ħċĵµĉ™‚ĞŻïĵ‚ŻƒŞ‚˘•‚Œ‚‹ + tempVectorBufferA.MC2Resize(pcnt); + tempVectorBufferB.MC2Resize(pcnt); + tempCountBuffer.MC2Resize(pcnt); + tempFloatBufferA.MC2Resize(pcnt); + tempRotationBufferA.MC2Resize(pcnt); + tempRotationBufferB.MC2Resize(pcnt); + + // ċˆĥ約 + selfCollisionConstraint.WorkBufferUpdate(); + } + + //========================================================================================= + // Simulation + //========================================================================================= + /// + /// ‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ƒĦ‚¤ƒ³‚ı‚ħ‚¸ƒƒĵƒĞ + /// + /// + /// + internal JobHandle ClothSimulationSchedule(JobHandle jobHandle) + { + var tm = MagicaManager.Team; + var bm = MagicaManager.Bone; + var vm = MagicaManager.VMesh; + var wm = MagicaManager.Wind; + var cm = MagicaManager.Collider; + var tim = MagicaManager.Time; + + int normalClothTeamCount = tm.batchNormalClothTeamList.Length; + int splitClothTeamCount = tm.batchSplitClothTeamList.Length; + bool useNormalClothJob = normalClothTeamCount > 0; + bool useSplitClothJob = splitClothTeamCount > 0; + + if (useNormalClothJob == false && useSplitClothJob == false) + return jobHandle; + + // ĉœ€ċ¤§ĉ›´ĉ–°ċ›žĉ•° + int maxUpdateCount = tm.TeamMaxUpdateCount; + //Debug.Log($"TeamMaxUpdateCount:{tm.TeamMaxUpdateCount}, UseSelfPointCollision:{tm.UseSelfPointCollision}, UseSelfEdgeCollision:{tm.UseSelfEdgeCollision}"); + + // ċˆİ用§‚‹ƒŻƒĵ‚Ѓĵ‚ıƒĴƒƒƒ‰ĉ•° + int workerCount = math.max(WorkerCount, 1); + workerCount *= 5; // ĉ›´Ğċˆ†ċ‰²ïĵšƒ†‚ıƒˆçµĉžœ‚ˆ‚Š + //Debug.Log($"workerCount:{workerCount}"); + + // ‚¸ƒ§ƒ–連結用 + JobHandle normalClothJobHandle = new JobHandle(); + JobHandle splitClothJobHandle = new JobHandle(); + JobHandle selfIntersectJobHandle = new JobHandle(); + JobHandle solverIntersectJobHandle = new JobHandle(); + + // ■ċˆ†ċ‰²‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³‚¸ƒ§ƒ– + // ‚ğƒĞƒ•‚³ƒŞ‚¸ƒ§ƒ³‚‚Š€‚‚—Żƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒé ‚ç‚ıĉ•°Œä¸€ċšċ€¤äğ上‚¸ƒ§ƒ– + // ‚ރނ¸ƒŠƒĞ¨ċŒĉ§˜Ğ‚¸ƒ§ƒ–‚’ċˆ†ċ‰²—ċŒĉœŸ—ŞŒ‚‰ċŸèĦŒ™‚‹ + // Ÿ —ĉœ€éİċŒ–‚’èĦŒ„‚ރނ¸ƒŠƒĞ‚ˆ‚Šèğ½é‡ċŒ–—Ĥ„‚‹ + if (useSplitClothJob) + { + // ‚³ƒ³‚ż‚Żƒˆ‚­ƒƒĵ¨ƒŞ‚ıƒˆ + selfCollisionConstraint.contactQueue.Clear(); + selfCollisionConstraint.contactList.Clear(); + selfCollisionConstraint.intersectQueue.Clear(); + selfCollisionConstraint.intersectList.Clear(); + + // ċˆ†ċ‰²‚¸ƒ§ƒ–ċ†…§ċ„稂³ƒŞ‚¸ƒ§ƒ³ĉœ‰ç„Ħ + bool useEdgeCollision = tm.teamStatus.Value.z > 0; + bool useSelfCollision = tm.teamStatus.Value.w > 0; + + // ‚ğƒĞƒ•‚³ƒŞ‚¸ƒ§ƒ³‚¤ƒ³‚żƒĵ‚ğ‚Żƒˆè§£ĉħş + bool useIntersect = selfCollisionConstraint.IntersectCount > 0; + + // ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒ‚’‚ı‚­ƒ‹ƒ³‚°—ċŸşĉœĴċ§żċ‹˘‚’ĉħ‚‚‚‹ + var splitPre_A_Job = new SplitPre_A_Job() + { + workerCount = workerCount, + + // team + batchSelfTeamList = tm.batchSplitClothTeamList, + teamDataArray = tm.teamDataArray.GetNativeArray(), + + // transform + transformLocalToWorldMatrixArray = bm.localToWorldMatrixArray.GetNativeArray(), + + // vmesh + attributes = vm.attributes.GetNativeArray(), + localPositions = vm.localPositions.GetNativeArray(), + localNormals = vm.localNormals.GetNativeArray(), + localTangents = vm.localTangents.GetNativeArray(), + boneWeights = vm.boneWeights.GetNativeArray(), + skinBoneTransformIndices = vm.skinBoneTransformIndices.GetNativeArray(), + skinBoneBindPoses = vm.skinBoneBindPoses.GetNativeArray(), + positions = vm.positions.GetNativeArray(), + rotations = vm.rotations.GetNativeArray(), + }; + splitClothJobHandle = splitPre_A_Job.Schedule(splitClothTeamCount * workerCount, 1, jobHandle); + + // ƒƒĵƒ ‚ğƒ³‚żƒĵċ§żċ‹˘ĉħşċš¨ĉ…£ĉ€§ç”¨ç§ğċ‹•é‡è¨ˆç— + var splitPre_B_Job = new SplitPre_B_Job() + { + simulationDeltaTime = MagicaManager.Time.SimulationDeltaTime, + + // team + batchSelfTeamList = tm.batchSplitClothTeamList, + teamDataArray = tm.teamDataArray.GetNativeArray(), + centerDataArray = tm.centerDataArray.GetNativeArray(), + teamWindArray = tm.teamWindArray.GetNativeArray(), + parameterArray = tm.parameterArray.GetNativeArray(), + + // wind + windZoneCount = wm.WindCount, + windDataArray = wm.windDataArray.GetNativeArray(), + + // transform + transformPositionArray = bm.positionArray.GetNativeArray(), + transformRotationArray = bm.rotationArray.GetNativeArray(), + transformScaleArray = bm.scaleArray.GetNativeArray(), + + // vmesh + positions = vm.positions.GetNativeArray(), + rotations = vm.rotations.GetNativeArray(), + vertexBindPoseRotations = vm.vertexBindPoseRotations.GetNativeArray(), + + // inertia + fixedArray = inertiaConstraint.fixedArray.GetNativeArray(), + }; + splitClothJobHandle = splitPre_B_Job.Schedule(splitClothTeamCount, 1, splitClothJobHandle); + + // ƒ‘ƒĵƒ†‚£‚ŻƒĞċ…¨ä½“ĉ…£ĉ€§Š‚ˆ³ƒŞ‚ğƒƒƒˆéİ用 + // ‚³ƒİ‚¤ƒ€ƒĵƒ­ƒĵ‚ЃĞċ§żċ‹˘‚’ĉħ‚‚‚‹€Š‚ˆ³ċ…¨ä½“ĉ…£ĉ€§¨ƒŞ‚ğƒƒƒˆéİ用 + var splitPre_C_Job = new SplitPre_C_Job() + { + workerCount = workerCount, + + // team + batchSelfTeamList = tm.batchSplitClothTeamList, + teamDataArray = tm.teamDataArray.GetNativeArray(), + centerDataArray = tm.centerDataArray.GetNativeArray(), + parameterArray = tm.parameterArray.GetNativeArray(), + + // transform + transformPositionArray = bm.positionArray.GetNativeArray(), + transformRotationArray = bm.rotationArray.GetNativeArray(), + transformScaleArray = bm.scaleArray.GetNativeArray(), + transformLocalPositionArray = bm.localPositionArray.GetNativeArray(), + transformLocalRotationArray = bm.localRotationArray.GetNativeArray(), + transformLocalScaleArray = bm.localScaleArray.GetNativeArray(), + + // vmesh + positions = vm.positions.GetNativeArray(), + rotations = vm.rotations.GetNativeArray(), + vertexDepths = vm.vertexDepths.GetNativeArray(), + + // particle + nextPosArray = nextPosArray.GetNativeArray(), + oldPosArray = oldPosArray.GetNativeArray(), + oldRotArray = oldRotArray.GetNativeArray(), + basePosArray = basePosArray.GetNativeArray(), + baseRotArray = baseRotArray.GetNativeArray(), + oldPositionArray = oldPositionArray.GetNativeArray(), + oldRotationArray = oldRotationArray.GetNativeArray(), + velocityPosArray = velocityPosArray.GetNativeArray(), + dispPosArray = dispPosArray.GetNativeArray(), + velocityArray = velocityArray.GetNativeArray(), + realVelocityArray = realVelocityArray.GetNativeArray(), + frictionArray = frictionArray.GetNativeArray(), + staticFrictionArray = staticFrictionArray.GetNativeArray(), + collisionNormalArray = collisionNormalArray.GetNativeArray(), + + // collider + colliderFlagArray = cm.flagArray.GetNativeArray(), + colliderCenterArray = cm.centerArray.GetNativeArray(), + colliderFramePositions = cm.framePositions.GetNativeArray(), + colliderFrameRotations = cm.frameRotations.GetNativeArray(), + colliderFrameScales = cm.frameScales.GetNativeArray(), + colliderOldFramePositions = cm.oldFramePositions.GetNativeArray(), + colliderOldFrameRotations = cm.oldFrameRotations.GetNativeArray(), + colliderNowPositions = cm.nowPositions.GetNativeArray(), + colliderNowRotations = cm.nowRotations.GetNativeArray(), + colliderOldPositions = cm.oldPositions.GetNativeArray(), + colliderOldRotations = cm.oldRotations.GetNativeArray(), + colliderMainColliderIndices = cm.mainColliderIndices.GetNativeArray(), + }; + splitClothJobHandle = splitPre_C_Job.Schedule(splitClothTeamCount * workerCount, 1, splitClothJobHandle); + + // ‚ğƒĞƒ•‚³ƒŞ‚¸ƒ§ƒ³‚¤ƒ³‚żƒĵ‚ğ‚Żƒˆƒƒƒƒ•‚Ħç”Ÿĉˆïĵˆé–‹ċ§‹) + bool useIntersectJob = false; + if (useSelfCollision && maxUpdateCount > 0 && useIntersect) + { + // ‚¤ƒ³‚żƒĵ‚ğ‚Żƒˆƒƒƒƒ•‚Ħç”Ÿĉˆ + // ‚¤ƒ³‚żƒĵ‚ğ‚Żƒˆƒ‘ƒĵƒ†‚£‚ŻƒĞƒ•ƒİ‚°‚ŻƒŞ‚˘ + var selfDetectionIntersect_job = new SelfCollisionConstraint.SelfDetectionIntersectJob() + { + workerCount = workerCount, + // div + frameIndex = Time.frameCount % Define.System.SelfCollisionIntersectDiv, + // team + batchSelfTeamList = tm.batchSplitClothTeamList, + teamDataArray = tm.teamDataArray.GetNativeArray(), + // self collision + primitiveArrayB = selfCollisionConstraint.primitiveArrayB.GetNativeArray(), + uniformGridStartCountBuffer = selfCollisionConstraint.uniformGridStartCountBuffer.GetNativeArray(), + // buffer + intersectQueue = selfCollisionConstraint.intersectQueue.AsParallelWriter(), + }; + selfIntersectJobHandle = selfDetectionIntersect_job.Schedule(splitClothTeamCount * workerCount, 1, jobHandle); + + // ‚¤ƒ³‚żƒĵ‚ğ‚Żƒˆƒƒƒƒ•‚Ħ‚’ƒŞ‚ıƒˆĞċ¤‰ĉ› + var selfConvertIntersectList_job = new SelfCollisionConstraint.SelfConvertIntersectListJob() + { + intersectQueue = selfCollisionConstraint.intersectQueue, + intersectList = selfCollisionConstraint.intersectList, + }; + selfIntersectJobHandle = selfConvertIntersectList_job.Schedule(selfIntersectJobHandle); + useIntersectJob = true; + } + + // ■‚ıƒ†ƒƒƒ—ƒĞƒĵƒ— + for (int updateIndex = 0; updateIndex < maxUpdateCount; updateIndex++) + { + bool isFirstStep = updateIndex == 0; + + // ƒƒĵƒ ĉ›´ĉ–° + // ‚³ƒİ‚¤ƒ€ƒĵĉ›´ĉ–° + var splitStep_A_job = new SplitStep_A_Job() + { + updateIndex = updateIndex, + simulationPower = tim.SimulationPower, + simulationDeltaTime = tim.SimulationDeltaTime, + // team + batchSelfTeamList = tm.batchSplitClothTeamList, + teamDataArray = tm.teamDataArray.GetNativeArray(), + centerDataArray = tm.centerDataArray.GetNativeArray(), + teamWindArray = tm.teamWindArray.GetNativeArray(), + parameterArray = tm.parameterArray.GetNativeArray(), + // collider + colliderFlagArray = cm.flagArray.GetNativeArray(), + colliderSizeArray = cm.sizeArray.GetNativeArray(), + colliderFramePositions = cm.framePositions.GetNativeArray(), + colliderFrameRotations = cm.frameRotations.GetNativeArray(), + colliderFrameScales = cm.frameScales.GetNativeArray(), + colliderOldFramePositions = cm.oldFramePositions.GetNativeArray(), + colliderOldFrameRotations = cm.oldFrameRotations.GetNativeArray(), + colliderNowPositions = cm.nowPositions.GetNativeArray(), + colliderNowRotations = cm.nowRotations.GetNativeArray(), + colliderOldPositions = cm.oldPositions.GetNativeArray(), + colliderOldRotations = cm.oldRotations.GetNativeArray(), + colliderWorkDataArray = cm.workDataArray.GetNativeArray(), + }; + splitClothJobHandle = splitStep_A_job.Schedule(splitClothTeamCount, 1, splitClothJobHandle); + + // 速ċşĤĉ›´ĉ–°€ċ¤–ċŠ›ċ½ħ響€ĉ…£ĉ€§‚·ƒ•ƒˆ + var splitStep_B_job = new SplitStep_B_Job() + { + workerCount = workerCount, + updateIndex = updateIndex, + simulationPower = tim.SimulationPower, + simulationDeltaTime = tim.SimulationDeltaTime, + // team + batchSelfTeamList = tm.batchSplitClothTeamList, + teamDataArray = tm.teamDataArray.GetNativeArray(), + centerDataArray = tm.centerDataArray.GetNativeArray(), + teamWindArray = tm.teamWindArray.GetNativeArray(), + parameterArray = tm.parameterArray.GetNativeArray(), + // wind + windZoneCount = wm.WindCount, + windDataArray = wm.windDataArray.GetNativeArray(), + // vmesh + attributes = vm.attributes.GetNativeArray(), + depthArray = vm.vertexDepths.GetNativeArray(), + positions = vm.positions.GetNativeArray(), + rotations = vm.rotations.GetNativeArray(), + vertexRootIndices = vm.vertexRootIndices.GetNativeArray(), + // particle + nextPosArray = nextPosArray.GetNativeArray(), + oldPosArray = oldPosArray.GetNativeArray(), + basePosArray = basePosArray.GetNativeArray(), + baseRotArray = baseRotArray.GetNativeArray(), + oldPositionArray = oldPositionArray.GetNativeArray(), + oldRotationArray = oldRotationArray.GetNativeArray(), + velocityPosArray = velocityPosArray.GetNativeArray(), + velocityArray = velocityArray.GetNativeArray(), + frictionArray = frictionArray.GetNativeArray(), + // buffer + stepBasicPositionBuffer = stepBasicPositionBuffer, + stepBasicRotationBuffer = stepBasicRotationBuffer, + // temp + tempVectorBufferA = tempVectorBufferA, + tempVectorBufferB = tempVectorBufferB, + tempCountBuffer = tempCountBuffer, + tempFloatBufferA = tempFloatBufferA, + }; + splitClothJobHandle = splitStep_B_job.Schedule(splitClothTeamCount * workerCount, 1, splitClothJobHandle); + + // ƒ™ƒĵ‚ıƒİ‚¤ƒ³ċŸşĉş–ċ§żċ‹˘‚’è¨ˆç— + var splitStep_C_job = new SplitStep_C_Job() + { + workerCount = workerCount, + updateIndex = updateIndex, + // team + batchSelfTeamList = tm.batchSplitClothTeamList, + teamDataArray = tm.teamDataArray.GetNativeArray(), + // vmesh + attributes = vm.attributes.GetNativeArray(), + vertexRootIndices = vm.vertexRootIndices.GetNativeArray(), + vertexParentIndices = vm.vertexParentIndices.GetNativeArray(), + baseLineStartDataIndices = vm.baseLineStartDataIndices.GetNativeArray(), + baseLineDataCounts = vm.baseLineDataCounts.GetNativeArray(), + baseLineData = vm.baseLineData.GetNativeArray(), + vertexLocalPositions = vm.vertexLocalPositions.GetNativeArray(), + vertexLocalRotations = vm.vertexLocalRotations.GetNativeArray(), + // particle + basePosArray = basePosArray.GetNativeArray(), + baseRotArray = baseRotArray.GetNativeArray(), + // buffer + stepBasicPositionBuffer = stepBasicPositionBuffer, + stepBasicRotationBuffer = stepBasicRotationBuffer, + }; + splitClothJobHandle = splitStep_C_job.Schedule(splitClothTeamCount * workerCount, 1, splitClothJobHandle); + + // ƒ†‚ĥƒĵ + // è·é›˘ + var splitStep_D_job = new SplitStep_D_Job() + { + workerCount = workerCount, + updateIndex = updateIndex, + simulationPower = tim.SimulationPower, + // team + batchSelfTeamList = tm.batchSplitClothTeamList, + teamDataArray = tm.teamDataArray.GetNativeArray(), + centerDataArray = tm.centerDataArray.GetNativeArray(), + parameterArray = tm.parameterArray.GetNativeArray(), + // vmesh + attributes = vm.attributes.GetNativeArray(), + depthArray = vm.vertexDepths.GetNativeArray(), + vertexRootIndices = vm.vertexRootIndices.GetNativeArray(), + // particle + nextPosArray = nextPosArray.GetNativeArray(), + basePosArray = basePosArray.GetNativeArray(), + velocityPosArray = velocityPosArray.GetNativeArray(), + frictionArray = frictionArray.GetNativeArray(), + // distance + distanceIndexArray = distanceConstraint.indexArray.GetNativeArray(), + distanceDataArray = distanceConstraint.dataArray.GetNativeArray(), + distanceDistanceArray = distanceConstraint.distanceArray.GetNativeArray(), + // buffer + stepBasicPositionBuffer = stepBasicPositionBuffer, + }; + splitClothJobHandle = splitStep_D_job.Schedule(splitClothTeamCount * workerCount, 1, splitClothJobHandle); + + // ‚˘ƒ³‚°ƒĞ + var splitStep_Angle_job = new SplitStep_Angle_Job() + { + workerCount = workerCount, + updateIndex = updateIndex, + simulationPower = tim.SimulationPower, + // team + batchSelfTeamList = tm.batchSplitClothTeamList, + teamDataArray = tm.teamDataArray.GetNativeArray(), + parameterArray = tm.parameterArray.GetNativeArray(), + // vmesh + attributes = vm.attributes.GetNativeArray(), + depthArray = vm.vertexDepths.GetNativeArray(), + vertexRootIndices = vm.vertexRootIndices.GetNativeArray(), + vertexParentIndices = vm.vertexParentIndices.GetNativeArray(), + baseLineStartDataIndices = vm.baseLineStartDataIndices.GetNativeArray(), + baseLineDataCounts = vm.baseLineDataCounts.GetNativeArray(), + baseLineData = vm.baseLineData.GetNativeArray(), + // particle + nextPosArray = nextPosArray.GetNativeArray(), + //basePosArray = basePosArray.GetNativeArray(), + velocityPosArray = velocityPosArray.GetNativeArray(), + frictionArray = frictionArray.GetNativeArray(), + // distance + distanceIndexArray = distanceConstraint.indexArray.GetNativeArray(), + distanceDataArray = distanceConstraint.dataArray.GetNativeArray(), + distanceDistanceArray = distanceConstraint.distanceArray.GetNativeArray(), + // buffer + stepBasicPositionBuffer = stepBasicPositionBuffer, + stepBasicRotationBuffer = stepBasicRotationBuffer, + // buffer2 + tempVectorBufferA = tempVectorBufferA, + tempVectorBufferB = tempVectorBufferB, + tempFloatBufferA = tempFloatBufferA, + tempRotationBufferA = tempRotationBufferA, + tempRotationBufferB = tempRotationBufferB, + }; + splitClothJobHandle = splitStep_Angle_job.Schedule(splitClothTeamCount * workerCount, 1, splitClothJobHandle); + + // ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞƒ™ƒ³ƒ‰ + var splitStep_Triangle_job = new SplitStep_Triangle_Job() + { + workerCount = workerCount, + updateIndex = updateIndex, + simulationPower = tim.SimulationPower, + // team + batchSelfTeamList = tm.batchSplitClothTeamList, + teamDataArray = tm.teamDataArray.GetNativeArray(), + parameterArray = tm.parameterArray.GetNativeArray(), + // vmesh + attributes = vm.attributes.GetNativeArray(), + depthArray = vm.vertexDepths.GetNativeArray(), + // particle + nextPosArray = nextPosArray.GetNativeArray(), + frictionArray = frictionArray.GetNativeArray(), + // triangle bending + bendingTrianglePairArray = bendingConstraint.trianglePairArray.GetNativeArray(), + bendingRestAngleOrVolumeArray = bendingConstraint.restAngleOrVolumeArray.GetNativeArray(), + bendingSignOrVolumeArray = bendingConstraint.signOrVolumeArray.GetNativeArray(), + // buffer2 + tempVectorBufferA = tempVectorBufferA, + tempCountBuffer = tempCountBuffer, + }; + splitClothJobHandle = splitStep_Triangle_job.Schedule(splitClothTeamCount * workerCount, 1, splitClothJobHandle); + + // ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞƒ™ƒ³ƒ‰é›†è¨ˆ + // ‚³ƒİ‚¤ƒ€ƒĵ‚³ƒŞ‚¸ƒ§ƒ³Point + var splitStep_E_job = new SplitStep_E_Job() + { + workerCount = workerCount, + updateIndex = updateIndex, + simulationPower = tim.SimulationPower, + // team + batchSelfTeamList = tm.batchSplitClothTeamList, + teamDataArray = tm.teamDataArray.GetNativeArray(), + parameterArray = tm.parameterArray.GetNativeArray(), + // vmesh + attributes = vm.attributes.GetNativeArray(), + depthArray = vm.vertexDepths.GetNativeArray(), + // particle + nextPosArray = nextPosArray.GetNativeArray(), + basePosArray = basePosArray.GetNativeArray(), + velocityPosArray = velocityPosArray.GetNativeArray(), + frictionArray = frictionArray.GetNativeArray(), + collisionNormalArray = collisionNormalArray.GetNativeArray(), + // collider + colliderFlagArray = cm.flagArray.GetNativeArray(), + colliderWorkDataArray = cm.workDataArray.GetNativeArray(), + // buffer2 + tempVectorBufferA = tempVectorBufferA, + tempCountBuffer = tempCountBuffer, + }; + splitClothJobHandle = splitStep_E_job.Schedule(splitClothTeamCount * workerCount, 1, splitClothJobHandle); + + // ‚³ƒİ‚¤ƒ€ƒĵ‚³ƒŞ‚¸ƒ§ƒ³Edge + if (useEdgeCollision) + { + var splitStep_Edge_job = new SplitStep_Edge_Job() + { + workerCount = workerCount, + updateIndex = updateIndex, + simulationPower = tim.SimulationPower, + // team + batchSelfTeamList = tm.batchSplitClothTeamList, + teamDataArray = tm.teamDataArray.GetNativeArray(), + parameterArray = tm.parameterArray.GetNativeArray(), + // vmesh + attributes = vm.attributes.GetNativeArray(), + depthArray = vm.vertexDepths.GetNativeArray(), + edges = vm.edges.GetNativeArray(), + // particle + nextPosArray = nextPosArray.GetNativeArray(), + // collider + colliderFlagArray = cm.flagArray.GetNativeArray(), + colliderWorkDataArray = cm.workDataArray.GetNativeArray(), + // buffer2 + tempVectorBufferA = tempVectorBufferA, + tempVectorBufferB = tempVectorBufferB, + tempCountBuffer = tempCountBuffer, + tempFloatBufferA = tempFloatBufferA, + }; + splitClothJobHandle = splitStep_Edge_job.Schedule(splitClothTeamCount * workerCount, 1, splitClothJobHandle); + } + + if (useSelfCollision) + { + // ■‚ğƒĞƒ•‚³ƒŞ‚¸ƒ§ƒ³‚‚Š + // ‚³ƒİ‚¤ƒ€ƒĵ‚³ƒŞ‚¸ƒ§ƒ³Edge集計 + // è·é›˘ + // ƒ˘ƒĵ‚·ƒ§ƒ³ + var splitStep_F_Self_job = new SplitStep_F_Self_Job() + { + workerCount = workerCount, + updateIndex = updateIndex, + simulationPower = tim.SimulationPower, + // team + batchSelfTeamList = tm.batchSplitClothTeamList, + teamDataArray = tm.teamDataArray.GetNativeArray(), + parameterArray = tm.parameterArray.GetNativeArray(), + // vmesh + attributes = vm.attributes.GetNativeArray(), + depthArray = vm.vertexDepths.GetNativeArray(), + // particle + nextPosArray = nextPosArray.GetNativeArray(), + basePosArray = basePosArray.GetNativeArray(), + baseRotArray = baseRotArray.GetNativeArray(), + velocityPosArray = velocityPosArray.GetNativeArray(), + frictionArray = frictionArray.GetNativeArray(), + collisionNormalArray = collisionNormalArray.GetNativeArray(), + // distance + distanceIndexArray = distanceConstraint.indexArray.GetNativeArray(), + distanceDataArray = distanceConstraint.dataArray.GetNativeArray(), + distanceDistanceArray = distanceConstraint.distanceArray.GetNativeArray(), + // buffer2 + tempVectorBufferA = tempVectorBufferA, + tempVectorBufferB = tempVectorBufferB, + tempCountBuffer = tempCountBuffer, + tempFloatBufferA = tempFloatBufferA, + }; + splitClothJobHandle = splitStep_F_Self_job.Schedule(splitClothTeamCount * workerCount, 1, splitClothJobHandle); + + // ‚ğƒĞƒ•‚³ƒŞ‚¸ƒ§ƒ³‚¤ƒ³‚żƒĵ‚ğ‚Żƒˆƒƒƒƒ•‚Ħĉ›´ĉ–°‚¸ƒ§ƒ–‚’ċˆĉµ•›‚‹ + if (isFirstStep && useIntersectJob) + { + splitClothJobHandle = JobHandle.CombineDependencies(selfIntersectJobHandle, splitClothJobHandle); + } + + // ‚ğƒĞƒ•‚³ƒŞ‚¸ƒ§ƒ³ + if (isFirstStep) + { + // ■ċˆċ›ž‚ıƒ†ƒƒƒ— + // ïĵˆƒƒĵƒ ”¨Point/Edge/Triangleïĵ“ċˆ†ċ‰²ïĵ‰ + // ƒ—ƒŞƒŸƒ†‚£ƒ–ĉƒ…ċ ħĉ›´ĉ–°(nextPos/oldPos,invMass,thickness,aabb) + // ĉœ€ċ¤§ƒ—ƒŞƒŸƒ†‚£ƒ–‚µ‚¤‚şç—ċ‡ş€‚°ƒŞƒƒƒ‰‚µ‚¤‚şç—ċ‡ş + // ƒ—ƒŞƒŸƒ†‚£ƒ–用‚¤ƒ³‚żƒĵ‚ğ‚Żƒˆƒ•ƒİ‚°ĉ›´ĉ–° + var selfStep_UpdatePrimitive_job = new SelfCollisionConstraint.SelfStep_UpdatePrimitiveJob() + { + workerCount = 3, + updateIndex = updateIndex, + simulationPower = tim.SimulationPower, + // team + batchSelfTeamList = tm.batchSplitClothTeamList, + teamDataArray = tm.teamDataArray.GetNativeArray(), + parameterArray = tm.parameterArray.GetNativeArray(), + // particle + nextPosArray = nextPosArray.GetNativeArray(), + oldPosArray = oldPosArray.GetNativeArray(), + frictionArray = frictionArray.GetNativeArray(), + // self collision + useIntersect = useIntersect, + primitiveArrayB = selfCollisionConstraint.primitiveArrayB.GetNativeArray(), + intersectFlagArray = selfCollisionConstraint.intersectFlagArray, + }; + splitClothJobHandle = selfStep_UpdatePrimitive_job.Schedule(splitClothTeamCount * 3, 1, splitClothJobHandle); + + // ïĵˆƒƒĵƒ ”¨Point/Edge/Triangleïĵ“ċˆ†ċ‰²ïĵ‰ + // ƒ—ƒŞƒŸƒ†‚£ƒ–‚°ƒŞƒƒƒ‰ċş§ĉ¨™ç—ċ‡ş + // ƒ—ƒŞƒŸƒ†‚£ƒ–‚’‚°ƒŞƒƒƒ‰ċş§ĉ¨™§‚½ƒĵƒˆ + // ‚°ƒŞƒƒƒ‰ĉƒ…ċ ħä½œĉˆ + var selfStep_UpdateGrid_job = new SelfCollisionConstraint.SelfStep_UpdateGridJob() + { + kindCount = 3, + updateIndex = updateIndex, + simulationPower = tim.SimulationPower, + // team + batchSelfTeamList = tm.batchSplitClothTeamList, + teamDataArray = tm.teamDataArray.GetNativeArray(), + // self collision + primitiveArrayB = selfCollisionConstraint.primitiveArrayB.GetNativeArray(), + uniformGridStartCountBuffer = selfCollisionConstraint.uniformGridStartCountBuffer.GetNativeArray(), + }; + splitClothJobHandle = selfStep_UpdateGrid_job.Schedule(splitClothTeamCount * 3, 1, splitClothJobHandle); + + // ‚³ƒ³‚ż‚Żƒˆƒƒƒƒ•‚Ħç”Ÿĉˆ(EdgeEdge/PointTriangle) + // ƒƒĵƒ ”¨ïĵ‹ç‰ıĉŠċˆ†ĉ•£ + var selfStep_DetectionContact_job = new SelfCollisionConstraint.SelfStep_DetectionContactJob() + { + updateIndex = updateIndex, + workerCount = workerCount, + teamCount = splitClothTeamCount, + // team + batchSelfTeamList = tm.batchSplitClothTeamList, + teamDataArray = tm.teamDataArray.GetNativeArray(), + // particle + nextPosArray = nextPosArray.GetNativeArray(), + oldPosArray = oldPosArray.GetNativeArray(), + // self collision + primitiveArrayB = selfCollisionConstraint.primitiveArrayB.GetNativeArray(), + uniformGridStartCountBuffer = selfCollisionConstraint.uniformGridStartCountBuffer.GetNativeArray(), + // buffer + contactQueue = selfCollisionConstraint.contactQueue.AsParallelWriter(), + }; + // Self:(EdgeEdge/PointTriangle/TrianglePoint), Sync:(EdgeEdge/PointTriangle/TrianglePoint) = 6 + splitClothJobHandle = selfStep_DetectionContact_job.Schedule(splitClothTeamCount * 6 * workerCount, 1, splitClothJobHandle); + + // ‚³ƒ³‚ż‚Żƒˆƒƒƒƒ•‚Ħ‚’ƒŞ‚ıƒˆĞċ¤‰ĉ› + // ““Żä¸Ĥċˆ—ċŒ–§Ş„ + var selfStep_ConvertContactList_job = new SelfCollisionConstraint.SelfStep_ConvertContactListJob() + { + contactQueue = selfCollisionConstraint.contactQueue, + contactList = selfCollisionConstraint.contactList, + }; + splitClothJobHandle = selfStep_ConvertContactList_job.Schedule(splitClothJobHandle); + } + else + { + // ■ïĵ’‚ıƒ†ƒƒƒ—äğ降 + // ‚³ƒ³‚ż‚Żƒˆƒƒƒƒ•‚Ħ”¨ + // çċœ¨nextPos/oldPos‹‚‰ċ¤‰ä½‚’ĉħ‚‚èĦçށĉœ‰ç„Ħ¨s/t/nŞİ‚’ĉħ‚‚‚‹ + // aabbŻĉ›´ĉ–°Ş— + var selfStep_UpdateContact_job = new SelfCollisionConstraint.SelfStep_UpdateContactJob() + { + first = updateIndex == 0, + //first = true, + contactList = selfCollisionConstraint.contactList, + // particle + nextPosArray = nextPosArray.GetNativeArray(), + oldPosArray = oldPosArray.GetNativeArray(), + // self collision + primitiveArrayB = selfCollisionConstraint.primitiveArrayB.GetNativeArray(), + }; + splitClothJobHandle = selfStep_UpdateContact_job.Schedule(selfCollisionConstraint.contactList, 256, splitClothJobHandle); + } + + // ‚ğƒĞƒ•‚³ƒŞ‚¸ƒ§ƒ³ + // ‚³ƒ³‚ż‚Żƒˆƒƒƒƒ•‚Ħè§£ĉħşïĵˆċċİïĵ‰ + for (int i = 0; i < Define.System.SelfCollisionSolverIteration; i++) + { + // ‚³ƒ³‚ż‚Żƒˆƒƒƒƒ•‚Ħè§£ĉħş + // ‚³ƒ³‚ż‚Żƒˆƒƒƒƒ•‚Ħ”¨ + var selfStep_SolverContact_job = new SelfCollisionConstraint.SelfStep_SolverContactJob() + { + // particle + nextPosArray = nextPosArray.GetNativeArray(), + // self collision + primitiveArrayB = selfCollisionConstraint.primitiveArrayB.GetNativeArray(), + contactList = selfCollisionConstraint.contactList, + // buffer2 + tempVectorBufferA = tempVectorBufferA, + tempCountBuffer = tempCountBuffer, + }; + splitClothJobHandle = selfStep_SolverContact_job.Schedule(selfCollisionConstraint.contactList, 128, splitClothJobHandle); + + // 集計 + // ƒƒĵƒ ”¨ + var selfStep_SumContact_job = new SelfCollisionConstraint.SelfStep_SumContactJob() + { + updateIndex = updateIndex, + // team + batchSelfTeamList = tm.batchSplitClothTeamList, + teamDataArray = tm.teamDataArray.GetNativeArray(), + // particle + nextPosArray = nextPosArray.GetNativeArray(), + // buffer2 + tempVectorBufferA = tempVectorBufferA, + tempCountBuffer = tempCountBuffer, + }; + splitClothJobHandle = selfStep_SumContact_job.Schedule(splitClothTeamCount, 1, splitClothJobHandle); + } + + // ċş§ĉ¨™ç˘şċš + // ‚³ƒİ‚¤ƒ€ƒĵċŒĉ›´ĉ–° + var splitStep_G_Self_job = new SplitStep_G_Self_Job() + { + workerCount = workerCount, + updateIndex = updateIndex, + simulationDeltaTime = tim.SimulationDeltaTime, + // team + batchSelfTeamList = tm.batchSplitClothTeamList, + teamDataArray = tm.teamDataArray.GetNativeArray(), + centerDataArray = tm.centerDataArray.GetNativeArray(), + parameterArray = tm.parameterArray.GetNativeArray(), + // vmesh + attributes = vm.attributes.GetNativeArray(), + depthArray = vm.vertexDepths.GetNativeArray(), + // particle + nextPosArray = nextPosArray.GetNativeArray(), + oldPosArray = oldPosArray.GetNativeArray(), + velocityPosArray = velocityPosArray.GetNativeArray(), + velocityArray = velocityArray.GetNativeArray(), + realVelocityArray = realVelocityArray.GetNativeArray(), + frictionArray = frictionArray.GetNativeArray(), + staticFrictionArray = staticFrictionArray.GetNativeArray(), + collisionNormalArray = collisionNormalArray.GetNativeArray(), + // collider + colliderNowPositions = cm.nowPositions.GetNativeArray(), + colliderNowRotations = cm.nowRotations.GetNativeArray(), + colliderOldPositions = cm.oldPositions.GetNativeArray(), + colliderOldRotations = cm.oldRotations.GetNativeArray(), + }; + splitClothJobHandle = splitStep_G_Self_job.Schedule(splitClothTeamCount * workerCount, 1, splitClothJobHandle); + } + else + { + // ■‚ğƒĞƒ•‚³ƒŞ‚¸ƒ§ƒ³Ş— + // ‚³ƒİ‚¤ƒ€ƒĵ‚³ƒŞ‚¸ƒ§ƒ³Edge集計 + // è·é›˘ + // ƒ˘ƒĵ‚·ƒ§ƒ³ + // ċş§ĉ¨™ç˘şċš + // ‚³ƒİ‚¤ƒ€ƒĵċŒĉ›´ĉ–° + var splitStep_FG_NoSelf_job = new SplitStep_FG_NoSelf_Job() + { + workerCount = workerCount, + updateIndex = updateIndex, + simulationPower = tim.SimulationPower, + simulationDeltaTime = tim.SimulationDeltaTime, + // team + batchSelfTeamList = tm.batchSplitClothTeamList, + teamDataArray = tm.teamDataArray.GetNativeArray(), + centerDataArray = tm.centerDataArray.GetNativeArray(), + parameterArray = tm.parameterArray.GetNativeArray(), + // vmesh + attributes = vm.attributes.GetNativeArray(), + depthArray = vm.vertexDepths.GetNativeArray(), + // particle + nextPosArray = nextPosArray.GetNativeArray(), + oldPosArray = oldPosArray.GetNativeArray(), + basePosArray = basePosArray.GetNativeArray(), + baseRotArray = baseRotArray.GetNativeArray(), + velocityPosArray = velocityPosArray.GetNativeArray(), + velocityArray = velocityArray.GetNativeArray(), + realVelocityArray = realVelocityArray.GetNativeArray(), + frictionArray = frictionArray.GetNativeArray(), + staticFrictionArray = staticFrictionArray.GetNativeArray(), + collisionNormalArray = collisionNormalArray.GetNativeArray(), + // collider + colliderNowPositions = cm.nowPositions.GetNativeArray(), + colliderNowRotations = cm.nowRotations.GetNativeArray(), + colliderOldPositions = cm.oldPositions.GetNativeArray(), + colliderOldRotations = cm.oldRotations.GetNativeArray(), + // distance + distanceIndexArray = distanceConstraint.indexArray.GetNativeArray(), + distanceDataArray = distanceConstraint.dataArray.GetNativeArray(), + distanceDistanceArray = distanceConstraint.distanceArray.GetNativeArray(), + // buffer2 + tempVectorBufferA = tempVectorBufferA, + tempVectorBufferB = tempVectorBufferB, + tempCountBuffer = tempCountBuffer, + tempFloatBufferA = tempFloatBufferA, + }; + splitClothJobHandle = splitStep_FG_NoSelf_job.Schedule(splitClothTeamCount * workerCount, 1, splitClothJobHandle); + } + } + + // ‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ċŒċ‡Ĥ理 + // èĦ¨ç¤şä½ç½è¨ˆç— + var splitPost_DisplayPos_job = new SplitPost_DisplayPos_Job() + { + workerCount = workerCount, + simulationDeltaTime = MagicaManager.Time.SimulationDeltaTime, + + // team + batchSelfTeamList = tm.batchSplitClothTeamList, + teamDataArray = tm.teamDataArray.GetNativeArray(), + + // vmesh + attributes = vm.attributes.GetNativeArray(), + positions = vm.positions.GetNativeArray(), + rotations = vm.rotations.GetNativeArray(), + vertexRootIndices = vm.vertexRootIndices.GetNativeArray(), + + // particle + oldPosArray = oldPosArray.GetNativeArray(), + oldPositionArray = oldPositionArray.GetNativeArray(), + oldRotationArray = oldRotationArray.GetNativeArray(), + dispPosArray = dispPosArray.GetNativeArray(), + realVelocityArray = realVelocityArray.GetNativeArray(), + + // temp + tempVectorBufferA = tempVectorBufferA, + tempRotationBufferA = tempRotationBufferA, + }; + splitClothJobHandle = splitPost_DisplayPos_job.Schedule(splitClothTeamCount * workerCount, 1, splitClothJobHandle); + + // ä¸ĤèĦŒ§‚¤ƒ³‚żƒĵ‚ğ‚Żƒˆè§£ĉħş‚’èĦŒ† + // ‚¤ƒ³‚żƒĵ‚ğ‚ŻƒˆçµĉžœŻĉĴĦƒ•ƒĴƒĵƒ §ċˆİ用•‚Œ‚‹ + if (useIntersectJob) + { + // ‚¤ƒ³‚żƒĵ‚ğ‚Żƒˆƒƒƒƒ•‚Ħ‚ŻƒŞ‚˘ + var self_ClearIntersect_job = new SelfCollisionConstraint.SelfClearIntersectJob() + { + // team + batchSelfTeamList = tm.batchSplitClothTeamList, + teamDataArray = tm.teamDataArray.GetNativeArray(), + // self collision + intersectFlagArray = selfCollisionConstraint.intersectFlagArray, + }; + solverIntersectJobHandle = self_ClearIntersect_job.Schedule(splitClothTeamCount, 1, splitClothJobHandle); + + // ‚¤ƒ³‚żƒĵ‚ğ‚Żƒˆƒƒƒƒ•‚Ħè§£ĉħş + var self_SolverIntersect_job = new SelfCollisionConstraint.SelfSolverIntersectJob() + { + // particle + nextPosArray = nextPosArray.GetNativeArray(), + // self collision + intersectList = selfCollisionConstraint.intersectList, + // buffer + intersectFlagArray = selfCollisionConstraint.intersectFlagArray, + }; + solverIntersectJobHandle = self_SolverIntersect_job.Schedule(selfCollisionConstraint.intersectList, 128, solverIntersectJobHandle); + } + + // ‚Żƒ­‚ı‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³çµĉžœ‚’ProxyMesh¸ċĉ˜ •›‚‹ + // ƒİ‚¤ƒ³Œ‚‚‹ċ ´ċˆŻƒ™ƒĵ‚ıƒİ‚¤ƒ³”¨Ğċ§żċ‹˘‚’ĉ•´ˆ‚‹ + var splitPost_CalcProxy_job = new SplitPost_CalcProxy_Job() + { + workerCount = workerCount, + + // team + batchSelfTeamList = tm.batchSplitClothTeamList, + teamDataArray = tm.teamDataArray.GetNativeArray(), + parameterArray = tm.parameterArray.GetNativeArray(), + + // vmesh + attributes = vm.attributes.GetNativeArray(), + positions = vm.positions.GetNativeArray(), + rotations = vm.rotations.GetNativeArray(), + baseLineStartDataIndices = vm.baseLineStartDataIndices.GetNativeArray(), + baseLineDataCounts = vm.baseLineDataCounts.GetNativeArray(), + baseLineData = vm.baseLineData.GetNativeArray(), + vertexLocalPositions = vm.vertexLocalPositions.GetNativeArray(), + vertexLocalRotations = vm.vertexLocalRotations.GetNativeArray(), + vertexChildIndexArray = vm.vertexChildIndexArray.GetNativeArray(), + vertexChildDataArray = vm.vertexChildDataArray.GetNativeArray(), + baseLineFlags = vm.baseLineFlags.GetNativeArray(), + + // temp + tempVectorBufferA = tempVectorBufferA, + tempRotationBufferB = tempRotationBufferB, + }; + splitClothJobHandle = splitPost_CalcProxy_job.Schedule(splitClothTeamCount * workerCount, 1, splitClothJobHandle); + + // ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĉ³•ç·šĉŽç·š‚’ĉħ‚‚‚‹ + var splitPost_CalcProxyTriangle_job = new SplitPost_CalcProxyTriangle_Job() + { + workerCount = workerCount, + + // team + batchSelfTeamList = tm.batchSplitClothTeamList, + teamDataArray = tm.teamDataArray.GetNativeArray(), + + // vmesh + positions = vm.positions.GetNativeArray(), + triangles = vm.triangles.GetNativeArray(), + triangleNormals = vm.triangleNormals.GetNativeArray(), + triangleTangents = vm.triangleTangents.GetNativeArray(), + uvs = vm.uv.GetNativeArray(), + }; + splitClothJobHandle = splitPost_CalcProxyTriangle_job.Schedule(splitClothTeamCount * workerCount, 1, splitClothJobHandle); + + // ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĉ³•ç·šĉŽç·š‹‚‰é ‚ç‚ıċ§żċ‹˘‚’ĉħ‚‚‚‹ + // BoneClothċ ´ċˆŻé ‚ç‚ıċ§żċ‹˘‹‚‰é€£ċ‹•™‚‹ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ƒŻƒĵƒĞƒ‰ċ§żċ‹˘‚’計痁™‚‹ + var splitPost_SumProxyTriangleAndTransform_job = new SplitPost_SumProxyTriangleAndTransform_Job() + { + workerCount = workerCount, + + // team + batchSelfTeamList = tm.batchSplitClothTeamList, + teamDataArray = tm.teamDataArray.GetNativeArray(), + + // transform + transformPositionArray = bm.positionArray.GetNativeArray(), + transformRotationArray = bm.rotationArray.GetNativeArray(), + + // vmesh + positions = vm.positions.GetNativeArray(), + rotations = vm.rotations.GetNativeArray(), + triangleNormals = vm.triangleNormals.GetNativeArray(), + triangleTangents = vm.triangleTangents.GetNativeArray(), + vertexToTriangles = vm.vertexToTriangles.GetNativeArray(), + normalAdjustmentRotations = vm.normalAdjustmentRotations.GetNativeArray(), + vertexToTransformRotations = vm.vertexToTransformRotations.GetNativeArray(), + }; + splitClothJobHandle = splitPost_SumProxyTriangleAndTransform_job.Schedule(splitClothTeamCount * workerCount, 1, splitClothJobHandle); + + // ƒƒĵƒ ĉ›´ĉ–°ċŒċ‡Ĥ理 + // BoneClothċ ´ċˆŻTransformƒ­ƒĵ‚ЃĞċ§żċ‹˘‚’計痁™‚‹ + // ‚³ƒİ‚¤ƒ€ƒĵĉ›´ĉ–°ċŒċ‡Ĥ理 + var splitPost_TeamCollider_job = new SplitPost_TeamCollider_Job() + { + simulationDeltaTime = MagicaManager.Time.SimulationDeltaTime, + + // team + batchSelfTeamList = tm.batchSplitClothTeamList, + teamDataArray = tm.teamDataArray.GetNativeArray(), + centerDataArray = tm.centerDataArray.GetNativeArray(), + + // collider + colliderFramePositions = cm.framePositions.GetNativeArray(), + colliderFrameRotations = cm.frameRotations.GetNativeArray(), + colliderOldFramePositions = cm.oldFramePositions.GetNativeArray(), + colliderOldFrameRotations = cm.oldFrameRotations.GetNativeArray(), + + // transform + transformPositionArray = bm.positionArray.GetNativeArray(), + transformRotationArray = bm.rotationArray.GetNativeArray(), + transformScaleArray = bm.scaleArray.GetNativeArray(), + transformLocalPositionArray = bm.localPositionArray.GetNativeArray(), + transformLocalRotationArray = bm.localRotationArray.GetNativeArray(), + + // vmesh + attributes = vm.attributes.GetNativeArray(), + vertexParentIndices = vm.vertexParentIndices.GetNativeArray(), + }; + splitClothJobHandle = splitPost_TeamCollider_job.Schedule(splitClothTeamCount, 1, splitClothJobHandle); + + // ĉœ€ċŒĞ‚¤ƒ³‚żƒĵ‚ğ‚Żƒˆè§£ĉħş‚¸ƒ§ƒ–‚’ċˆĉµ + if (useIntersectJob) + { + splitClothJobHandle = JobHandle.CombineDependencies(splitClothJobHandle, solverIntersectJobHandle); + } + } + + // ■一ĉ‹Ĵ‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³‚¸ƒ§ƒ– + // ‚ğƒĞƒ•‚³ƒŞ‚¸ƒ§ƒ³Ş—€‹¤ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒé ‚ç‚ıĉ•°Œä¸€ċšċ€¤ĉœŞĉş€‚¸ƒ§ƒ– + // ïĵ‘¤ċ·¨ċ¤§Ş‚¸ƒ§ƒ–ċ†…§™ıĤ‚’ċŒçµ•›‚‹ + if (useNormalClothJob) + { + var normalJob = new SimulationNormalJob() + { + batchNormalTeamList = tm.batchNormalClothTeamList, + simulationPower = tim.SimulationPower, + simulationDeltaTime = tim.SimulationDeltaTime, + mappingCount = tm.MappingCount, + + // team + teamDataArray = tm.teamDataArray.GetNativeArray(), + centerDataArray = tm.centerDataArray.GetNativeArray(), + teamWindArray = tm.teamWindArray.GetNativeArray(), + parameterArray = tm.parameterArray.GetNativeArray(), + + // wind + windZoneCount = wm.WindCount, + windDataArray = wm.windDataArray.GetNativeArray(), + + // transform + transformPositionArray = bm.positionArray.GetNativeArray(), + transformRotationArray = bm.rotationArray.GetNativeArray(), + transformScaleArray = bm.scaleArray.GetNativeArray(), + transformLocalToWorldMatrixArray = bm.localToWorldMatrixArray.GetNativeArray(), + transformLocalPositionArray = bm.localPositionArray.GetNativeArray(), + transformLocalRotationArray = bm.localRotationArray.GetNativeArray(), + transformLocalScaleArray = bm.localScaleArray.GetNativeArray(), + + // vmesh + attributes = vm.attributes.GetNativeArray(), + depthArray = vm.vertexDepths.GetNativeArray(), + localPositions = vm.localPositions.GetNativeArray(), + localNormals = vm.localNormals.GetNativeArray(), + localTangents = vm.localTangents.GetNativeArray(), + boneWeights = vm.boneWeights.GetNativeArray(), + skinBoneTransformIndices = vm.skinBoneTransformIndices.GetNativeArray(), + skinBoneBindPoses = vm.skinBoneBindPoses.GetNativeArray(), + positions = vm.positions.GetNativeArray(), + rotations = vm.rotations.GetNativeArray(), + vertexBindPoseRotations = vm.vertexBindPoseRotations.GetNativeArray(), + vertexDepths = vm.vertexDepths.GetNativeArray(), + vertexRootIndices = vm.vertexRootIndices.GetNativeArray(), + vertexParentIndices = vm.vertexParentIndices.GetNativeArray(), + baseLineStartDataIndices = vm.baseLineStartDataIndices.GetNativeArray(), + baseLineDataCounts = vm.baseLineDataCounts.GetNativeArray(), + baseLineData = vm.baseLineData.GetNativeArray(), + vertexLocalPositions = vm.vertexLocalPositions.GetNativeArray(), + vertexLocalRotations = vm.vertexLocalRotations.GetNativeArray(), + vertexChildIndexArray = vm.vertexChildIndexArray.GetNativeArray(), + vertexChildDataArray = vm.vertexChildDataArray.GetNativeArray(), + baseLineFlags = vm.baseLineFlags.GetNativeArray(), + triangles = vm.triangles.GetNativeArray(), + triangleNormals = vm.triangleNormals.GetNativeArray(), + triangleTangents = vm.triangleTangents.GetNativeArray(), + uvs = vm.uv.GetNativeArray(), + vertexToTriangles = vm.vertexToTriangles.GetNativeArray(), + normalAdjustmentRotations = vm.normalAdjustmentRotations.GetNativeArray(), + vertexToTransformRotations = vm.vertexToTransformRotations.GetNativeArray(), + edges = vm.edges.GetNativeArray(), + + // particle + nextPosArray = nextPosArray.GetNativeArray(), + oldPosArray = oldPosArray.GetNativeArray(), + oldRotArray = oldRotArray.GetNativeArray(), + basePosArray = basePosArray.GetNativeArray(), + baseRotArray = baseRotArray.GetNativeArray(), + oldPositionArray = oldPositionArray.GetNativeArray(), + oldRotationArray = oldRotationArray.GetNativeArray(), + velocityPosArray = velocityPosArray.GetNativeArray(), + dispPosArray = dispPosArray.GetNativeArray(), + velocityArray = velocityArray.GetNativeArray(), + realVelocityArray = realVelocityArray.GetNativeArray(), + frictionArray = frictionArray.GetNativeArray(), + staticFrictionArray = staticFrictionArray.GetNativeArray(), + collisionNormalArray = collisionNormalArray.GetNativeArray(), + + // collider + colliderFlagArray = cm.flagArray.GetNativeArray(), + colliderCenterArray = cm.centerArray.GetNativeArray(), + colliderSizeArray = cm.sizeArray.GetNativeArray(), + colliderFramePositions = cm.framePositions.GetNativeArray(), + colliderFrameRotations = cm.frameRotations.GetNativeArray(), + colliderFrameScales = cm.frameScales.GetNativeArray(), + colliderOldFramePositions = cm.oldFramePositions.GetNativeArray(), + colliderOldFrameRotations = cm.oldFrameRotations.GetNativeArray(), + colliderNowPositions = cm.nowPositions.GetNativeArray(), + colliderNowRotations = cm.nowRotations.GetNativeArray(), + colliderOldPositions = cm.oldPositions.GetNativeArray(), + colliderOldRotations = cm.oldRotations.GetNativeArray(), + colliderWorkDataArray = cm.workDataArray.GetNativeArray(), + colliderMainColliderIndices = cm.mainColliderIndices.GetNativeArray(), + + // inertia + fixedArray = inertiaConstraint.fixedArray.GetNativeArray(), + + // distance + distanceIndexArray = distanceConstraint.indexArray.GetNativeArray(), + distanceDataArray = distanceConstraint.dataArray.GetNativeArray(), + distanceDistanceArray = distanceConstraint.distanceArray.GetNativeArray(), + + // triangleBending + bendingTrianglePairArray = bendingConstraint.trianglePairArray.GetNativeArray(), + bendingRestAngleOrVolumeArray = bendingConstraint.restAngleOrVolumeArray.GetNativeArray(), + bendingSignOrVolumeArray = bendingConstraint.signOrVolumeArray.GetNativeArray(), + + // buffer + stepBasicPositionBuffer = stepBasicPositionBuffer, + stepBasicRotationBuffer = stepBasicRotationBuffer, + + // buffer2 + tempVectorBufferA = tempVectorBufferA, + tempVectorBufferB = tempVectorBufferB, + tempCountBuffer = tempCountBuffer, + tempFloatBufferA = tempFloatBufferA, + tempRotationBufferA = tempRotationBufferA, + tempRotationBufferB = tempRotationBufferB, + }; + normalClothJobHandle = normalJob.Schedule(normalClothTeamCount, 1, jobHandle); + } + + // ■‚¸ƒ§ƒ–連結 + // !一ĉ‹Ĵ‚¸ƒ§ƒ–¨ċˆ†ċ‰²‚¸ƒ§ƒ–‚’ä¸ĤèĦŒċ‹•作•›‚‹ + jobHandle = JobHandle.CombineDependencies(splitClothJobHandle, normalClothJobHandle); + + // ƒžƒƒƒ”ƒ³‚°ƒĦƒƒ‚·ƒĉœ‰ç„Ħ§ċˆ†ċ² + if (MagicaManager.Team.MappingCount > 0) + { + // “ïĵ’¤‚¸ƒ§ƒ–Żä¸Ĥċˆ—ċ‹•作ċŻèƒ½ + // ■ƒžƒƒƒ”ƒ³‚°ƒĦƒƒ‚·ƒé ‚ç‚ıċ§żċ‹˘‚’連ċ‹•™‚‹ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒ‹‚‰‚ı‚­ƒ‹ƒ³‚°—Ĥĉħ‚‚‚‹ + var job1 = vm.PostMappingMeshUpdateBatchSchedule(jobHandle, workerCount); + + // ■BoneClothTransform¸ĉ›¸èĵż + var job2 = bm.WriteTransformSchedule(jobHandle); + + jobHandle = JobHandle.CombineDependencies(job1, job2); + } + else + { + // ■BoneClothTransform¸ĉ›¸èĵż + jobHandle = bm.WriteTransformSchedule(jobHandle); + } + + return jobHandle; + } + + //========================================================================================= + public void InformationLog(StringBuilder allsb) + { + StringBuilder sb = new StringBuilder(); + sb.AppendLine($"========== Simulation Manager =========="); + if (IsValid() == false) + { + sb.AppendLine($"Simulation Manager. Invalid"); + } + else + { + sb.AppendLine($"Simulation Manager. Particle:{ParticleCount}"); + sb.AppendLine($" -teamIdArray:{teamIdArray.ToSummary()}"); + sb.AppendLine($" -nextPosArray:{nextPosArray.ToSummary()}"); + sb.AppendLine($" -oldPosArray:{oldPosArray.ToSummary()}"); + sb.AppendLine($" -oldRotArray:{oldRotArray.ToSummary()}"); + sb.AppendLine($" -basePosArray:{basePosArray.ToSummary()}"); + sb.AppendLine($" -baseRotArray:{baseRotArray.ToSummary()}"); + sb.AppendLine($" -oldPositionArray:{oldPositionArray.ToSummary()}"); + sb.AppendLine($" -oldRotationArray:{oldRotationArray.ToSummary()}"); + sb.AppendLine($" -velocityPosArray:{velocityPosArray.ToSummary()}"); + sb.AppendLine($" -dispPosArray:{dispPosArray.ToSummary()}"); + sb.AppendLine($" -velocityArray:{velocityArray.ToSummary()}"); + sb.AppendLine($" -realVelocityArray:{realVelocityArray.ToSummary()}"); + sb.AppendLine($" -frictionArray:{frictionArray.ToSummary()}"); + sb.AppendLine($" -staticFrictionArray:{staticFrictionArray.ToSummary()}"); + sb.AppendLine($" -collisionNormalArray:{collisionNormalArray.ToSummary()}"); + + // ċˆĥ約 + sb.Append(distanceConstraint.ToString()); + sb.Append(bendingConstraint.ToString()); + sb.Append(angleConstraint.ToString()); + sb.Append(inertiaConstraint.ToString()); + sb.Append(colliderCollisionConstraint.ToString()); + sb.Append(selfCollisionConstraint.ToString()); + + // ĉħŽç”¨ƒƒƒƒ•‚Ħ + sb.AppendLine($"[Buffer]"); + sb.AppendLine($" -stepBasicPositionBuffer:{(stepBasicPositionBuffer.IsCreated ? stepBasicPositionBuffer.Length : 0)}"); + sb.AppendLine($" -stepBasicRotationBuffer:{(stepBasicRotationBuffer.IsCreated ? stepBasicRotationBuffer.Length : 0)}"); + sb.AppendLine($" -tempVectorBufferA:{(tempVectorBufferA.IsCreated ? tempVectorBufferA.Length : 0)}"); + sb.AppendLine($" -tempVectorBufferB:{(tempVectorBufferB.IsCreated ? tempVectorBufferB.Length : 0)}"); + sb.AppendLine($" -tempCountBuffer:{(tempCountBuffer.IsCreated ? tempCountBuffer.Length : 0)}"); + sb.AppendLine($" -tempFloatBufferA:{(tempFloatBufferA.IsCreated ? tempFloatBufferA.Length : 0)}"); + sb.AppendLine($" -tempRotationBufferA:{(tempRotationBufferA.IsCreated ? tempRotationBufferA.Length : 0)}"); + sb.AppendLine($" -tempRotationBufferB:{(tempRotationBufferB.IsCreated ? tempRotationBufferB.Length : 0)}"); + + sb.AppendLine(); + } + sb.AppendLine(); + Debug.Log(sb.ToString()); + allsb.Append(sb); + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/Simulation/SimulationManager.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Manager/Simulation/SimulationManager.cs.meta new file mode 100644 index 00000000..155c7467 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/Simulation/SimulationManager.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 5b7ca58a6015eba4e83341a9e6f3473e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Manager/Simulation/SimulationManager.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/Simulation/SimulationManagerNormal.cs b/Assets/MagicaCloth2/Scripts/Core/Manager/Simulation/SimulationManagerNormal.cs new file mode 100644 index 00000000..e5a3dd53 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/Simulation/SimulationManagerNormal.cs @@ -0,0 +1,1797 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2025 MagicaSoft. +// https://magicasoft.jp +using Unity.Burst; +using Unity.Collections; +using Unity.Collections.LowLevel.Unsafe; +using Unity.Jobs; +using Unity.Mathematics; + +namespace MagicaCloth2 +{ + /// + /// Normal + /// ‚ğƒĞƒ•‚³ƒŞ‚¸ƒ§ƒ³Ş—€‹¤ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒé ‚ç‚ıĉ•°Œä¸€ċšċ€¤ĉœŞĉş€‚¸ƒ§ƒ– + /// ïĵ‘¤ċ·¨ċ¤§Ş‚¸ƒ§ƒ–ċ†…§™ıĤ‚’ċŒçµ•›‚‹ + /// + public partial class SimulationManager + { + [BurstCompile] + unsafe struct SimulationNormalJob : IJobParallelFor + { + [Unity.Collections.ReadOnly] + public NativeList batchNormalTeamList; + public float4 simulationPower; + public float simulationDeltaTime; + public int mappingCount; + + // team + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray teamDataArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray centerDataArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray teamWindArray; + [Unity.Collections.ReadOnly] + public NativeArray parameterArray; + + // wind + public int windZoneCount; + [Unity.Collections.ReadOnly] + public NativeArray windDataArray; + + // transform + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray transformPositionArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray transformRotationArray; + [Unity.Collections.ReadOnly] + public NativeArray transformScaleArray; + [Unity.Collections.ReadOnly] + public NativeArray transformLocalToWorldMatrixArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray transformLocalPositionArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray transformLocalRotationArray; + [Unity.Collections.ReadOnly] + public NativeArray transformLocalScaleArray; + + // vmesh + [Unity.Collections.ReadOnly] + public NativeArray attributes; + [Unity.Collections.ReadOnly] + public NativeArray depthArray; + [Unity.Collections.ReadOnly] + public NativeArray localPositions; + [Unity.Collections.ReadOnly] + public NativeArray localNormals; + [Unity.Collections.ReadOnly] + public NativeArray localTangents; + [Unity.Collections.ReadOnly] + public NativeArray boneWeights; + [Unity.Collections.ReadOnly] + public NativeArray skinBoneTransformIndices; + [Unity.Collections.ReadOnly] + public NativeArray skinBoneBindPoses; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray positions; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray rotations; + [Unity.Collections.ReadOnly] + public NativeArray vertexBindPoseRotations; + [Unity.Collections.ReadOnly] + public NativeArray vertexDepths; + [Unity.Collections.ReadOnly] + public NativeArray vertexRootIndices; + [Unity.Collections.ReadOnly] + public NativeArray vertexParentIndices; + [Unity.Collections.ReadOnly] + public NativeArray baseLineStartDataIndices; + [Unity.Collections.ReadOnly] + public NativeArray baseLineDataCounts; + [Unity.Collections.ReadOnly] + public NativeArray baseLineData; + [Unity.Collections.ReadOnly] + public NativeArray vertexLocalPositions; + [Unity.Collections.ReadOnly] + public NativeArray vertexLocalRotations; + [Unity.Collections.ReadOnly] + public NativeArray vertexChildIndexArray; + [Unity.Collections.ReadOnly] + public NativeArray vertexChildDataArray; + [Unity.Collections.ReadOnly] + public NativeArray baseLineFlags; + [Unity.Collections.ReadOnly] + public NativeArray triangles; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray triangleNormals; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray triangleTangents; + [Unity.Collections.ReadOnly] + public NativeArray uvs; + [Unity.Collections.ReadOnly] + public NativeArray> vertexToTriangles; + [Unity.Collections.ReadOnly] + public NativeArray normalAdjustmentRotations; + [Unity.Collections.ReadOnly] + public NativeArray vertexToTransformRotations; + [Unity.Collections.ReadOnly] + public NativeArray edges; + + // particle + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray nextPosArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray oldPosArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray oldRotArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray basePosArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray baseRotArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray oldPositionArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray oldRotationArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray velocityPosArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray dispPosArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray velocityArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray realVelocityArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray frictionArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray staticFrictionArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray collisionNormalArray; + + // collider + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray colliderFlagArray; + [Unity.Collections.ReadOnly] + public NativeArray colliderCenterArray; + [Unity.Collections.ReadOnly] + public NativeArray colliderSizeArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray colliderFramePositions; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray colliderFrameRotations; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray colliderFrameScales; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray colliderOldFramePositions; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray colliderOldFrameRotations; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray colliderNowPositions; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray colliderNowRotations; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray colliderOldPositions; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray colliderOldRotations; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray colliderWorkDataArray; + [Unity.Collections.ReadOnly] + public NativeArray colliderMainColliderIndices; + + // inertia + [Unity.Collections.ReadOnly] + public NativeArray fixedArray; + + // distance + [Unity.Collections.ReadOnly] + public NativeArray distanceIndexArray; + [Unity.Collections.ReadOnly] + public NativeArray distanceDataArray; + [Unity.Collections.ReadOnly] + public NativeArray distanceDistanceArray; + + // triangleBending + [Unity.Collections.ReadOnly] + public NativeArray bendingTrianglePairArray; + [Unity.Collections.ReadOnly] + public NativeArray bendingRestAngleOrVolumeArray; + [Unity.Collections.ReadOnly] + public NativeArray bendingSignOrVolumeArray; + + // buffer + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray stepBasicPositionBuffer; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray stepBasicRotationBuffer; + + // buffer2 + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray tempVectorBufferA; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray tempVectorBufferB; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray tempCountBuffer; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray tempFloatBufferA; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray tempRotationBufferA; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray tempRotationBufferB; + + // ƒƒƒƒƒƒĵƒ ƒ­ƒĵ‚ЃЂ¤ƒ³ƒ‡ƒƒ‚Ż‚ı”¨ + public void Execute(int localIndex) + { + //Debug.Log(localIndex); + // ƒƒĵƒ ID + int teamId = batchNormalTeamList[localIndex]; + + // !通ċ¸¸‚ż‚¤ƒ—§Ż‚ğƒĞƒ•‚³ƒŞ‚¸ƒ§ƒ³Œç„Ħ„Ÿ‚€ç›¸äş’ċ‚ç…§‚’考ˆšĞèݲċ½“ƒƒĵƒ ‚’ċ‡Ĥ理™‚Œ°è‰Ż„ + + // ċ„ƒ™ƒĵ‚ıƒ‚¤ƒ³‚ż + TeamManager.TeamData* teamPt = (TeamManager.TeamData*)teamDataArray.GetUnsafePtr(); + ClothParameters* paramPt = (ClothParameters*)parameterArray.GetUnsafeReadOnlyPtr(); + InertiaConstraint.CenterData* centerPt = (InertiaConstraint.CenterData*)centerDataArray.GetUnsafePtr(); + TeamWindData* windPt = (TeamWindData*)teamWindArray.GetUnsafePtr(); + + ref var tdata = ref *(teamPt + teamId); + ref var cdata = ref *(centerPt + teamId); + ref var param = ref *(paramPt + teamId); + ref var wdata = ref *(windPt + teamId); + + if (tdata.IsProcess == false) + return; + if (tdata.ParticleCount == 0) + return; + + // ■ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒ‚’‚ı‚­ƒ‹ƒ³‚°—ċŸşĉœĴċ§żċ‹˘‚’ĉħ‚‚‚‹ + VirtualMeshManager.SimulationPreProxyMeshUpdate( + new DataChunk(0, tdata.proxyCommonChunk.dataLength), + // team + teamId, + ref tdata, + // vmesh + attributes, + localPositions, + localNormals, + localTangents, + boneWeights, + skinBoneTransformIndices, + skinBoneBindPoses, + ref positions, + ref rotations, + // transform + transformLocalToWorldMatrixArray + ); + + // ƒƒĵƒ ‚ğƒ³‚żƒĵċ§żċ‹˘ĉħşċš¨ƒ†ƒĴƒƒĵƒˆċˆ¤ċšŠ‚ˆ³ĉ…£ĉ€§ç”¨ç§ğċ‹•é‡è¨ˆç— + TeamManager.SimulationCalcCenterAndInertiaAndWind( + simulationDeltaTime, + // team + teamId, + ref tdata, + ref cdata, + ref wdata, + ref param, + // vmesh + positions, + rotations, + vertexBindPoseRotations, + // inertia + fixedArray, + // transform + transformPositionArray, + transformRotationArray, + transformScaleArray, + // wind + windZoneCount, + windDataArray + ); + + // ƒ‘ƒĵƒ†‚£‚ŻƒĞċ…¨ä½“ĉ…£ĉ€§Š‚ˆ³ƒŞ‚ğƒƒƒˆéİ用 + SimulationPreTeamUpdate( + new DataChunk(0, tdata.particleChunk.dataLength), + // team + ref tdata, + param, + cdata, + // vmesh + positions, + rotations, + vertexDepths, + // particle + ref nextPosArray, + ref oldPosArray, + ref oldRotArray, + ref basePosArray, + ref baseRotArray, + ref oldPositionArray, + ref oldRotationArray, + ref velocityPosArray, + ref dispPosArray, + ref velocityArray, + ref realVelocityArray, + ref frictionArray, + ref staticFrictionArray, + ref collisionNormalArray + ); + + // ■‚³ƒİ‚¤ƒ€ƒĵƒ­ƒĵ‚ЃĞċ§żċ‹˘‚’ĉħ‚‚‚‹€Š‚ˆ³ċ…¨ä½“ĉ…£ĉ€§¨ƒŞ‚ğƒƒƒˆéİ用 + if (tdata.colliderCount > 0) + { + ColliderManager.SimulationPreUpdate( + new DataChunk(0, tdata.colliderChunk.dataLength), + // team + ref tdata, + ref cdata, + // collider + ref colliderFlagArray, + ref colliderCenterArray, + ref colliderFramePositions, + ref colliderFrameRotations, + ref colliderFrameScales, + ref colliderOldFramePositions, + ref colliderOldFrameRotations, + ref colliderNowPositions, + ref colliderNowRotations, + ref colliderOldPositions, + ref colliderOldRotations, + ref colliderMainColliderIndices, + // transform + ref transformPositionArray, + ref transformRotationArray, + ref transformScaleArray, + ref transformLocalPositionArray, + ref transformLocalRotationArray, + ref transformLocalScaleArray + ); + } + + // ‚ıƒ†ƒƒƒ—ċŸèĦŒ + for (int updateIndex = 0; updateIndex < tdata.updateCount; updateIndex++) + { + // ‚ıƒ†ƒƒƒ—”¨ƒƒĵƒ ĉ›´ĉ–° + TeamManager.SimulationStepTeamUpdate( + updateIndex, + simulationDeltaTime, + // team + teamId, + ref tdata, + ref param, + ref cdata, + ref wdata + ); + + // ‚³ƒİ‚¤ƒ€ƒĵĉ›´ĉ–° + if (tdata.colliderCount > 0) + { + ColliderManager.SimulationStartStep( + // team + ref tdata, + ref cdata, + // collider + ref colliderFlagArray, + ref colliderSizeArray, + ref colliderFramePositions, + ref colliderFrameRotations, + ref colliderFrameScales, + ref colliderOldFramePositions, + ref colliderOldFrameRotations, + ref colliderNowPositions, + ref colliderNowRotations, + ref colliderOldPositions, + ref colliderOldRotations, + ref colliderWorkDataArray + ); + } + + // 速ċşĤĉ›´ĉ–°€ċ¤–ċŠ›ċ½ħ響€ĉ…£ĉ€§‚·ƒ•ƒˆ + SimulationStepUpdateParticles( + new DataChunk(0, tdata.particleChunk.dataLength), + simulationPower, + simulationDeltaTime, + // team + teamId, + ref tdata, + ref cdata, + ref param, + ref wdata, + // wind + ref windDataArray, + // vmesh + ref attributes, + ref depthArray, + ref positions, + ref rotations, + ref vertexRootIndices, + // particle + ref nextPosArray, + ref oldPosArray, + ref basePosArray, + ref baseRotArray, + ref oldPositionArray, + ref oldRotationArray, + ref velocityPosArray, + ref velocityArray, + ref frictionArray, + // buffer + ref stepBasicPositionBuffer, + ref stepBasicRotationBuffer, + // temp + ref tempVectorBufferA, + ref tempVectorBufferB, + ref tempCountBuffer, + ref tempFloatBufferA + ); + + // ċˆĥ約解ĉħşŸ‚‚ıƒ†ƒƒƒ—”¨ċŸşĉş–ċ§żċ‹˘‚’è¨ˆç— + // ƒ™ƒĵ‚ıƒİ‚¤ƒ³”¨ + // ‚˘ƒ‹ƒĦƒĵ‚·ƒ§ƒ³ƒƒĵ‚şä½żç”¨ĉœ‰ç„Ħ + // ċˆĉœŸċ§żċ‹˘è¨ˆç—Œä¸èĤŞ‚‰ĉŠœ‘‚‹ + SimulationStepUpdateBaseLinePose( + new DataChunk(0, tdata.baseLineChunk.dataLength), + // team + ref tdata, + // vmesh + ref attributes, + ref vertexParentIndices, + ref baseLineStartDataIndices, + ref baseLineDataCounts, + ref baseLineData, + ref vertexLocalPositions, + ref vertexLocalRotations, + // particle + ref basePosArray, + ref baseRotArray, + // buffer + ref stepBasicPositionBuffer, + ref stepBasicRotationBuffer + ); + + // ċˆĥ約è§£ĉħş ================================================================ + TetherConstraint.SolverConstraint( + new DataChunk(0, tdata.particleChunk.dataLength), + // team + ref tdata, + ref param, + ref cdata, + // vmesh + ref attributes, + ref depthArray, + ref vertexRootIndices, + // particle + ref nextPosArray, + ref velocityPosArray, + ref frictionArray, + // buffer + ref stepBasicPositionBuffer + ); + + DistanceConstraint.SolverConstraint( + new DataChunk(0, tdata.particleChunk.dataLength), + simulationPower, + // team + ref tdata, + ref param, + // vmesh + ref attributes, + ref depthArray, + // particle + ref nextPosArray, + ref basePosArray, + ref velocityPosArray, + ref frictionArray, + // constraint + ref distanceIndexArray, + ref distanceDataArray, + ref distanceDistanceArray + ); + + AngleConstraint.SolverConstraint( + new DataChunk(0, tdata.baseLineChunk.dataLength), + simulationPower, + // team + ref tdata, + ref param, + // vmesh + ref attributes, + ref depthArray, + ref vertexParentIndices, + ref baseLineStartDataIndices, + ref baseLineDataCounts, + ref baseLineData, + // particle + ref nextPosArray, + ref velocityPosArray, + ref frictionArray, + // buffer + ref stepBasicPositionBuffer, + ref stepBasicRotationBuffer, + // buffer2 + ref tempFloatBufferA, + ref tempVectorBufferA, + ref tempRotationBufferA, + ref tempRotationBufferB, + ref tempVectorBufferB + ); + + // ƒƒƒƒ•‚Ħ‚ŻƒŞ‚˘ + SimulationClearTempBuffer( + new DataChunk(0, tdata.particleChunk.dataLength), + // team + ref tdata, + // buffer2 + ref tempVectorBufferA, + ref tempVectorBufferB, + ref tempCountBuffer, + ref tempFloatBufferA + ); + + TriangleBendingConstraint.SolverConstraint( + new DataChunk(0, tdata.bendingPairChunk.dataLength), + simulationPower, + // team + ref tdata, + ref param, + // vmesh + ref attributes, + ref depthArray, + // particle + ref nextPosArray, + ref frictionArray, + // constraints + ref bendingTrianglePairArray, + ref bendingRestAngleOrVolumeArray, + ref bendingSignOrVolumeArray, + // buffer2 + ref tempVectorBufferA, + ref tempCountBuffer + ); + + TriangleBendingConstraint.SumConstraint( + new DataChunk(0, tdata.particleChunk.dataLength), + // team + ref tdata, + ref param, + // vmesh + ref attributes, + // particle + ref nextPosArray, + // buffer2 + ref tempVectorBufferA, + ref tempCountBuffer + ); + + // ‚³ƒİ‚¤ƒ€ƒĵ‚³ƒŞ‚¸ƒ§ƒ³ + if (param.colliderCollisionConstraint.mode == ColliderCollisionConstraint.Mode.Point) + { + ColliderCollisionConstraint.SolverPointConstraint( + new DataChunk(0, tdata.particleChunk.dataLength), + // team + ref tdata, + ref param, + // vmesh + ref attributes, + ref depthArray, + // particle + ref nextPosArray, + ref frictionArray, + ref collisionNormalArray, + ref velocityPosArray, + ref basePosArray, + // collider + ref colliderFlagArray, + ref colliderWorkDataArray + ); + } + else if (param.colliderCollisionConstraint.mode == ColliderCollisionConstraint.Mode.Edge) + { + ColliderCollisionConstraint.SolverEdgeConstraint( + new DataChunk(0, tdata.proxyEdgeChunk.dataLength), + // team + ref tdata, + ref param, + // vmesh + ref attributes, + ref depthArray, + ref edges, + // particle + ref nextPosArray, + // collider + ref colliderFlagArray, + ref colliderWorkDataArray, + // buffer2 + ref tempVectorBufferA, + ref tempVectorBufferB, + ref tempCountBuffer, + ref tempFloatBufferA + ); + ColliderCollisionConstraint.SumEdgeConstraint( + new DataChunk(0, tdata.particleChunk.dataLength), + // team + ref tdata, + ref param, + // particle + ref nextPosArray, + ref frictionArray, + ref collisionNormalArray, + // buffer2 + ref tempVectorBufferA, + ref tempVectorBufferB, + ref tempCountBuffer, + ref tempFloatBufferA + ); + } + + // ‚³ƒİ‚¤ƒ€ƒĵèĦçށċŒŻƒ‘ƒĵƒ†‚£‚ŻƒĞŒäıħ‚Œ‚‹ċŻèƒ½ĉ€§Œ‚‚‹Ÿ‚‚‚†ä¸€ċşĤè·é›˘ċˆĥ約§ĉ•´ˆ‚‹€‚ + // “‚ŒŻè£èż”‚Šé˜²ĉ­˘ŞİĞċŠıĉžœċ¤§€‚ + DistanceConstraint.SolverConstraint( + new DataChunk(0, tdata.particleChunk.dataLength), + simulationPower, + // team + ref tdata, + ref param, + // vmesh + ref attributes, + ref depthArray, + // particle + ref nextPosArray, + ref basePosArray, + ref velocityPosArray, + ref frictionArray, + // constraint + ref distanceIndexArray, + ref distanceDataArray, + ref distanceDistanceArray + ); + + // ƒ˘ƒĵ‚·ƒ§ƒ³ċˆĥ約Ż‚³ƒİ‚¤ƒ€ƒĵ‚ˆ‚Šċ„Şċ…ˆ + MotionConstraint.SolverConstraint( + new DataChunk(0, tdata.particleChunk.dataLength), + // team + ref tdata, + ref param, + // vmesh + ref attributes, + ref depthArray, + // particle + ref basePosArray, + ref baseRotArray, + ref nextPosArray, + ref velocityPosArray, + ref frictionArray, + ref collisionNormalArray + ); + + // ċş§ĉ¨™ç˘şċš + SimulationStepPostTeam( + new DataChunk(0, tdata.particleChunk.dataLength), + simulationDeltaTime, + // team + teamId, + ref tdata, + ref cdata, + ref param, + // vmesh + ref attributes, + ref depthArray, + // particle + ref oldPosArray, + ref velocityArray, + ref nextPosArray, + ref velocityPosArray, + ref frictionArray, + ref staticFrictionArray, + ref collisionNormalArray, + ref realVelocityArray + ); + + // ‚³ƒİ‚¤ƒ€ƒĵċŒĉ›´ĉ–° + ColliderManager.SimulationEndStep( + new DataChunk(0, tdata.colliderChunk.dataLength), + // team + ref tdata, + // collider + ref colliderNowPositions, + ref colliderNowRotations, + ref colliderOldPositions, + ref colliderOldRotations + ); + } + + // ■èĦ¨ç¤şä½ç½ĉħşċš + SimulationCalcDisplayPosition( + new DataChunk(0, tdata.particleChunk.dataLength), + simulationDeltaTime, + // team + ref tdata, + // particle + ref oldPosArray, + ref realVelocityArray, + ref oldPositionArray, + ref oldRotationArray, + ref dispPosArray, + // vmesh + ref attributes, + ref positions, + ref rotations, + ref vertexRootIndices, + // temp + ref tempVectorBufferA, + ref tempRotationBufferA + ); + + // ■‚Żƒ­‚ı‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ċŒé ‚ç‚ıċ§żċ‹˘è¨ˆç— + // ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒé ‚ç‚ı‹‚‰ĉ³•ç·šĉŽç·š‚’ĉħ‚‚ċ§żċ‹˘‚’確ċš•›‚‹ + // ƒİ‚¤ƒ³Œ‚‚‹ċ ´ċˆŻƒ™ƒĵ‚ıƒİ‚¤ƒ³”¨Ğċ§żċ‹˘‚’ĉ•´ˆ‚‹ + // BoneClothċ ´ċˆŻé ‚ç‚ıċ§żċ‹˘‚’連ċ‹•™‚‹ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ƒ‡ƒĵ‚żĞ‚³ƒ”ƒĵ™‚‹ + VirtualMeshManager.SimulationPostProxyMeshUpdateLine( + new DataChunk(0, tdata.baseLineChunk.dataLength), + // team + ref tdata, + ref param, + // vmesh + ref attributes, + ref positions, + ref rotations, + ref vertexLocalPositions, + ref vertexLocalRotations, + ref vertexChildIndexArray, + ref vertexChildDataArray, + ref baseLineFlags, + ref baseLineStartDataIndices, + ref baseLineDataCounts, + ref baseLineData, + // temp + ref tempVectorBufferA, + ref tempRotationBufferA + ); + VirtualMeshManager.SimulationPostProxyMeshUpdateTriangle( + new DataChunk(0, tdata.proxyTriangleChunk.dataLength), + // team + ref tdata, + // vmesh + ref positions, + ref triangles, + ref triangleNormals, + ref triangleTangents, + ref uvs + ); + VirtualMeshManager.SimulationPostProxyMeshUpdateTriangleSum( + new DataChunk(0, tdata.proxyCommonChunk.dataLength), + // team + ref tdata, + // vmesh + ref rotations, + ref triangleNormals, + ref triangleTangents, + ref vertexToTriangles, + ref normalAdjustmentRotations + ); + VirtualMeshManager.SimulationPostProxyMeshUpdateWorldTransform( + new DataChunk(0, tdata.proxyCommonChunk.dataLength), + // team + ref tdata, + // vmesh + ref positions, + ref rotations, + ref vertexToTransformRotations, + // transform + ref transformPositionArray, + ref transformRotationArray + ); + VirtualMeshManager.SimulationPostProxyMeshUpdateLocalTransform( + // team + ref tdata, + // vmesh + ref attributes, + ref vertexParentIndices, + // transform + ref transformPositionArray, + ref transformRotationArray, + ref transformScaleArray, + ref transformLocalPositionArray, + ref transformLocalRotationArray + ); + + // ■‚³ƒİ‚¤ƒ€ƒĵĉ›´ĉ–°ċŒċ‡Ĥ理 + ColliderManager.SimulationPostUpdate( + // team + ref tdata, + // collider + ref colliderFramePositions, + ref colliderFrameRotations, + ref colliderOldFramePositions, + ref colliderOldFrameRotations + ); + + // ■ƒƒĵƒ ĉ›´ĉ–°ċŒċ‡Ĥ理 + TeamManager.SimulationPostTeamUpdate( + // team + ref tdata, + ref cdata + ); + } + } + + //========================================================================================= + /// + /// ‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ċŸèĦŒċ‰ċ‡Ĥ理 + /// -ƒŞ‚ğƒƒƒˆ + /// -ç§ğċ‹•ċ½ħ響 + /// + static void SimulationPreTeamUpdate( + DataChunk chunk, + // team + ref TeamManager.TeamData tdata, + in ClothParameters param, + in InertiaConstraint.CenterData cdata, + // vmesh + in NativeArray positions, + in NativeArray rotations, + in NativeArray vertexDepths, + // particle + ref NativeArray nextPosArray, + ref NativeArray oldPosArray, + ref NativeArray oldRotArray, + ref NativeArray basePosArray, + ref NativeArray baseRotArray, + ref NativeArray oldPositionArray, + ref NativeArray oldRotationArray, + ref NativeArray velocityPosArray, + ref NativeArray dispPosArray, + ref NativeArray velocityArray, + ref NativeArray realVelocityArray, + ref NativeArray frictionArray, + ref NativeArray staticFrictionArray, + ref NativeArray collisionNormalArray + ) + { + // ƒ‘ƒĵƒ†‚£‚ŻƒĞ”¨ + var pc = tdata.particleChunk; + //int pindex = pc.startIndex; + int pindex = pc.startIndex + chunk.startIndex; + //int vindex = tdata.proxyCommonChunk.startIndex; + int vindex = tdata.proxyCommonChunk.startIndex + chunk.startIndex; + if (tdata.IsReset) + { + // ƒŞ‚ğƒƒƒˆ + //for (int i = 0; i < pc.dataLength; i++, pindex++, vindex++) + for (int i = 0; i < chunk.dataLength; i++, pindex++, vindex++) + { + var pos = positions[vindex]; + var rot = rotations[vindex]; + + nextPosArray[pindex] = pos; + oldPosArray[pindex] = pos; + oldRotArray[pindex] = rot; + basePosArray[pindex] = pos; + baseRotArray[pindex] = rot; + oldPositionArray[pindex] = pos; + oldRotationArray[pindex] = rot; + velocityPosArray[pindex] = pos; + dispPosArray[pindex] = pos; + velocityArray[pindex] = 0; + realVelocityArray[pindex] = 0; + frictionArray[pindex] = 0; + staticFrictionArray[pindex] = 0; + collisionNormalArray[pindex] = 0; + } + } + else if (tdata.IsInertiaShift || tdata.IsNegativeScaleTeleport) + { + // ‚·ƒ•ƒˆ€ƒ†ƒĴƒƒĵƒˆ + //for (int i = 0; i < pc.dataLength; i++, pindex++, vindex++) + for (int i = 0; i < chunk.dataLength; i++, pindex++, vindex++) + { + var oldPos = oldPosArray[pindex]; + var oldRot = oldRotArray[pindex]; + var oldPosition = oldPositionArray[pindex]; + var oldRotation = oldRotationArray[pindex]; + var dispPos = dispPosArray[pindex]; + var velocity = velocityArray[pindex]; + var realVelocity = realVelocityArray[pindex]; + + // ■ƒž‚¤ƒŠ‚ı‚ı‚ħƒĵƒĞ + if (tdata.IsNegativeScaleTeleport) + { + // ĉœĴ体‚ı‚ħƒĵƒĞċèğ˘Ğċˆ‚›Ĥ‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³Ğċ½ħ響Œċ‡şŞ„‚ˆ†Ğċż…èĤŞċş§ĉ¨™ç³ğ‚’ċŒĉ§˜Ğèğ¸ċèğ˘•›‚‹ + // ƒ‘ƒĵƒ†‚£‚ŻƒĞŻ‚ğƒ³‚żƒĵçİşé–“§èğ¸ċèğ˘•›‚‹ + // èğ¸ċèğ˘ç”¨ƒžƒˆƒŞƒƒ‚Ż‚ı + float4x4 negativeM = cdata.negativeScaleMatrix; + + oldPos = MathUtility.TransformPoint(oldPos, negativeM); + oldRot = MathUtility.TransformRotation(oldRot, negativeM, 1); + + oldPosition = MathUtility.TransformPoint(oldPosition, negativeM); + oldRotation = MathUtility.TransformRotation(oldRotation, negativeM, 1); + + dispPos = MathUtility.TransformPoint(dispPos, negativeM); + + velocity = MathUtility.TransformVector(velocity, negativeM); + realVelocity = MathUtility.TransformVector(realVelocity, negativeM); + } + + // ■ĉ…£ĉ€§ċ…¨ä½“‚·ƒ•ƒˆ + if (tdata.IsInertiaShift) + { + // cdata.frameComponentShiftVector : ċ…¨ä½“‚·ƒ•ƒˆƒ™‚ŻƒˆƒĞ + // cdata.frameComponentShiftRotation : ċ…¨ä½“‚·ƒ•ƒˆċ›žèğ˘ + // cdata.oldComponentWorldPosition : ƒ•ƒĴƒĵƒ ç§ğċ‹•ċ‰‚³ƒ³ƒƒĵƒƒ³ƒˆä¸­ċżƒä½ç½ + + oldPos = MathUtility.ShiftPosition(oldPos, cdata.oldComponentWorldPosition, cdata.frameComponentShiftVector, cdata.frameComponentShiftRotation); + oldRot = math.mul(cdata.frameComponentShiftRotation, oldRot); + + oldPosition = MathUtility.ShiftPosition(oldPosition, cdata.oldComponentWorldPosition, cdata.frameComponentShiftVector, cdata.frameComponentShiftRotation); + oldRotation = math.mul(cdata.frameComponentShiftRotation, oldRotation); + + dispPos = MathUtility.ShiftPosition(dispPos, cdata.oldComponentWorldPosition, cdata.frameComponentShiftVector, cdata.frameComponentShiftRotation); + + velocity = math.mul(cdata.frameComponentShiftRotation, velocity); + realVelocity = math.mul(cdata.frameComponentShiftRotation, realVelocity); + } + + oldPosArray[pindex] = oldPos; + oldRotArray[pindex] = oldRot; + oldPositionArray[pindex] = oldPosition; + oldRotationArray[pindex] = oldRotation; + dispPosArray[pindex] = dispPos; + velocityArray[pindex] = velocity; + realVelocityArray[pindex] = realVelocity; + } + } + } + + static float3 WindBatchJob( + int teamId, + in WindParams windParams, + int vindex, + int pindex, + float depth, + ref NativeArray vertexRootIndices, + ref TeamWindData teamWindData, + ref NativeArray windDataArray, + ref NativeArray frictionArray + ) + { + float3 windForce = 0; + + // ċŸşĉş–ƒĞƒĵƒˆċş§ĉ¨™ + // (1)ƒƒĵƒ ”¨Ğš‚‰™ + // (2)ċŒĉœŸçއĞ‚ˆ‚ŠƒĞƒĵƒˆƒİ‚¤ƒ³”¨Ğš‚‰™ + // (3)ƒƒĵƒ ċş§ĉ¨™‚„ƒ‘ƒĵƒ†‚£‚ŻƒĞċş§ĉ¨™Żè¨ˆç—Ğċ…‚ŒŞ„ + int rootIndex = vertexRootIndices[vindex]; + float3 windPos = (teamId + 1) * 4.19230645f + (rootIndex * 0.0023963f * (1.0f - windParams.synchronization) * 100); + + // ‚ƒĵƒ³”¨é˘¨ċ½ħéŸżè¨ˆç— + int cnt = teamWindData.ZoneCount; + for (int i = 0; i < cnt; i++) + { + var windInfo = teamWindData.windZoneList[i]; + var windData = windDataArray[windInfo.windId]; + windForce += WindForceBlendBatchJob(windInfo, windParams, windPos, windData.turbulence); + } + +#if true + // ç§ğċ‹•風ċ½ħéŸżè¨ˆç— + if (windParams.movingWind > 0.01f) + { + windForce += WindForceBlendBatchJob(teamWindData.movingWind, windParams, windPos, 1.0f); + } +#endif + + //Debug.Log($"windForce:{windForce}"); + + // äğ–ċ½ħ響 + // ƒƒĵƒ é˘¨ċ½ħ響 + float influence = windParams.influence; // 0.0 ~ 2.0 + + // ĉ‘İĉ“ĤĞ‚ˆ‚‹ċ½ħ響 + float friction = frictionArray[pindex]; + influence *= (1.0f - friction); + + // ĉ·ħ•ċ½ħ響 + float depthScale = depth * depth; + influence *= math.lerp(1.0f, depthScale, windParams.depthWeight); + + // ĉœ€çµ‚ċ½ħ響 + windForce *= influence; + + //Debug.Log($"windForce:{windForce}"); + + return windForce; + } + + static void SimulationStepUpdateParticles( + DataChunk chunk, + float4 simulationPower, + float simulationDeltaTime, + // team + int teamId, + ref TeamManager.TeamData tdata, + ref InertiaConstraint.CenterData cdata, + ref ClothParameters param, + ref TeamWindData wdata, + // wind + ref NativeArray windDataArray, + // vmesh + ref NativeArray attributes, + ref NativeArray depthArray, + ref NativeArray positions, + ref NativeArray rotations, + ref NativeArray vertexRootIndices, + // particle + ref NativeArray nextPosArray, + ref NativeArray oldPosArray, + ref NativeArray basePosArray, + ref NativeArray baseRotArray, + ref NativeArray oldPositionArray, + ref NativeArray oldRotationArray, + ref NativeArray velocityPosArray, + ref NativeArray velocityArray, + ref NativeArray frictionArray, + // buffer + ref NativeArray stepBasicPositionBuffer, + ref NativeArray stepBasicRotationBuffer, + // temp buffer + ref NativeArray tempVectorBufferA, + ref NativeArray tempVectorBufferB, + ref NativeArray tempCountBuffer, + ref NativeArray tempFloatBufferA + ) + { + // 速ċşĤĉ›´ĉ–°€ċ¤–ċŠ›ċ½ħ響€ĉ…£ĉ€§‚·ƒ•ƒˆ + //int pindex = tdata.particleChunk.startIndex; + //int vindex = tdata.proxyCommonChunk.startIndex; + int pindex = tdata.particleChunk.startIndex + chunk.startIndex; + int vindex = tdata.proxyCommonChunk.startIndex + chunk.startIndex; + //for (int i = 0; i < tdata.particleChunk.dataLength; i++, pindex++, vindex++) + for (int i = 0; i < chunk.dataLength; i++, pindex++, vindex++) + { + // nextPosSwap + var attr = attributes[vindex]; + float depth = depthArray[vindex]; + var oldPos = oldPosArray[pindex]; + + var nextPos = oldPos; + var velocityPos = oldPos; + + // ċŸşĉş–ċ§żċ‹˘‚ıƒ†ƒƒƒ—補間 + var oldPosition = oldPositionArray[pindex]; + var oldRotation = oldRotationArray[pindex]; + var position = positions[vindex]; + var rotation = rotations[vindex]; + + // ƒ™ƒĵ‚ı位ç½è£œé–“ + float3 basePos = math.lerp(oldPosition, position, tdata.frameInterpolation); + quaternion baseRot = math.slerp(oldRotation, rotation, tdata.frameInterpolation); + baseRot = math.normalize(baseRot); // ċż…èĤ + basePosArray[pindex] = basePos; + baseRotArray[pindex] = baseRot; + + // ‚ıƒ†ƒƒƒ—ċŸşĉœĴä½ç½ + stepBasicPositionBuffer[pindex] = basePos; + stepBasicRotationBuffer[pindex] = baseRot; + + // ç§ğċ‹•ƒ‘ƒĵƒ†‚£‚ŻƒĞ + if (attr.IsMove() || tdata.IsSpring) + { + // 重量 + //float mass = MathUtility.CalcMass(depth); + + // 速ċşĤ + var velocity = velocityArray[pindex]; + +#if true + // ■ƒ­ƒĵ‚ЃĞĉ…£ĉ€§‚·ƒ•ƒˆ + // ‚·ƒ•ƒˆé‡ + float3 inertiaVector = cdata.inertiaVector; + quaternion inertiaRotation = cdata.inertiaRotation; + + // ĉ…£ĉ€§ĉ·ħ•ċ½ħ響 + float inertiaDepth = param.inertiaConstraint.depthInertia * (1.0f - depth * depth); // 二ĉĴĦĉ›²ç·š + //Debug.Log($"[{pindex}] inertiaDepth:{inertiaDepth}"); + inertiaVector = math.lerp(inertiaVector, cdata.stepVector, inertiaDepth); + inertiaRotation = math.slerp(inertiaRotation, cdata.stepRotation, inertiaDepth); + + // Ÿĥ‚““£ĦŒĉ­£—„ + float3 lpos = oldPos - cdata.oldWorldPosition; + lpos = math.mul(inertiaRotation, lpos); + lpos += inertiaVector; + float3 wpos = cdata.oldWorldPosition + lpos; + var inertiaOffset = wpos - nextPos; + + // nextPos + nextPos = wpos; + + // 速ċşĤ位罂‚èŞżĉ•´ + velocityPos += inertiaOffset; + + // 速ċşĤĞĉ…£ĉ€§ċ›žèğ˘‚’ċŠ ˆ‚‹ + velocity = math.mul(inertiaRotation, velocity); +#endif + + // ċ‰ċšċŒ–用é€ŸċşĤċ‰²ċˆ + velocity *= tdata.velocityWeight; + + // ĉеĉŠ— + // 重ċŠ›Ğċ½ħ響•›ŸŞ„§ċ…ˆĞ計痁™‚‹ïĵˆâ€ğ通ċ¸¸Żforceéİ用ċŒĞèĦŒ†Œä¸€èˆĴ的ïĵ‰ + float damping = param.dampingCurveData.MC2EvaluateCurveClamp01(depth); + velocity *= math.saturate(1.0f - damping * simulationPower.z); + + // ċ¤–ċŠ› + float3 force = 0; + + // 重ċŠ› + float3 gforce = param.worldGravityDirection * (param.gravity * tdata.gravityRatio); + force += gforce; + + // ċ¤–ċŠ› + float3 exForce = 0; + float mass = MathUtility.CalcMass(depth); + switch (tdata.forceMode) + { + case ClothForceMode.VelocityAdd: + exForce = tdata.impactForce / mass; + break; + case ClothForceMode.VelocityAddWithoutDepth: + exForce = tdata.impactForce; + break; + case ClothForceMode.VelocityChange: + exForce = tdata.impactForce / mass; + velocity = 0; + break; + case ClothForceMode.VelocityChangeWithoutDepth: + exForce = tdata.impactForce; + velocity = 0; + break; + } + force += exForce; + + // 風ċŠ› + force += WindBatchJob( + teamId, + //tdata, + param.wind, + //cdata, + vindex, + pindex, + depth, + ref vertexRootIndices, + ref wdata, + ref windDataArray, + ref frictionArray + ); + + // ċ¤–ċŠ›ƒƒĵƒ ‚ı‚ħƒĵƒĞċ€çއ + force *= tdata.scaleRatio; + + // 速ċşĤĉ›´ĉ–° + velocity += force * simulationDeltaTime; + + // 予ĉ¸Ĵ位ç½ĉ›´ĉ–° + nextPos += velocity * simulationDeltaTime; + } + else + { + // ċ›şċšƒ‘ƒĵƒ†‚£‚ŻƒĞ + nextPos = basePos; + velocityPos = basePos; + } + + // ‚ıƒ—ƒŞƒ³‚°ïĵˆċ›şċšƒ‘ƒĵƒ†‚£‚ŻƒĞżïĵ‰ + if (tdata.IsSpring && attr.IsFixed()) + { + // ƒŽ‚¤‚şç”¨Ğĉ™‚é–“‚’不èĤċ‰‡Ğš‚‰™ + //Spring(param.springConstraint, param.normalAxis, ref nextPos, basePos, baseRot, (tdata.time + index * 49.6198f) * 2.4512f + math.csum(nextPos), tdata.scaleRatio); + SpringBatchJob(param.springConstraint, param.normalAxis, ref nextPos, basePos, baseRot, (tdata.time + pindex * 49.6198f) * 2.4512f + math.csum(nextPos), tdata.scaleRatio); + } + + // 速ċşĤ計ç—用ç§ğċ‹•ċ‰ä½ç½ + velocityPosArray[pindex] = velocityPos; + + // 予ĉ¸Ĵ位ç½ĉ ĵ納 + nextPosArray[pindex] = nextPos; + + // 作ĉ­ƒƒƒƒ•‚Ħ‚ŻƒŞ‚˘ + tempVectorBufferA[pindex] = 0; + tempVectorBufferB[pindex] = 0; + tempCountBuffer[pindex] = 0; + tempFloatBufferA[pindex] = 0; + } + } + + static void SpringBatchJob( + in SpringConstraint.SpringConstraintParams springParams, + ClothNormalAxis normalAxis, + ref float3 nextPos, + in float3 basePos, + in quaternion baseRot, + float noiseTime, + float scaleRatio + ) + { + // clamp distance + var v = nextPos - basePos; + float3 dir = math.up(); + switch (normalAxis) + { + case ClothNormalAxis.Right: + dir = math.right(); + break; + case ClothNormalAxis.Up: + dir = math.up(); + break; + case ClothNormalAxis.Forward: + dir = math.forward(); + break; + case ClothNormalAxis.InverseRight: + dir = -math.right(); + break; + case ClothNormalAxis.InverseUp: + dir = -math.up(); + break; + case ClothNormalAxis.InverseForward: + dir = -math.forward(); + break; + } + dir = math.mul(baseRot, dir); + float limitDistance = springParams.limitDistance * scaleRatio; // ‚ı‚ħƒĵƒĞċ€çއ + + if (limitDistance > 1e-08f) + { + // 球‚Żƒİƒ³ƒ— + var len = math.length(v); + if (len > limitDistance) + { + v *= (limitDistance / len); + } + + // ĉ•ċ††‚Żƒİƒ³ƒ— + if (springParams.normalLimitRatio < 1.0f) + { + // ‚‚£¨‚ıƒžƒĵƒˆĞŞ‚‰Ş„‹.. + float ylen = math.dot(dir, v); + float3 vx = v - dir * ylen; + float xlen = math.length(vx); + float t = xlen / limitDistance; + float y = math.cos(math.asin(t)); + y *= limitDistance * springParams.normalLimitRatio; + + if (math.abs(ylen) > y) + { + v -= (math.abs(ylen) - y) * math.sign(ylen) * dir; + } + } + } + else + { + v = float3.zero; + } + + // ‚ıƒ—ƒŞƒ³‚°ċŠ› + float power = springParams.springPower; + + // ƒŽ‚¤‚ş + if (springParams.springNoise > 0.0f) + { + float noise = math.sin(noiseTime); // -1.0~+1.0 + //Debug.Log(noise); + noise *= springParams.springNoise * 0.6f; // ‚ı‚ħƒĵƒŞƒ³‚° + power = math.max(power + power * noise, 0.0f); + } + + // ‚ıƒ—ƒŞƒ³‚°éİ用 + v -= v * power; + nextPos = basePos + v; + } + + static void SimulationStepUpdateBaseLinePose( + DataChunk chunk, + // team + ref TeamManager.TeamData tdata, + // vmesh + ref NativeArray attributes, + ref NativeArray vertexParentIndices, + ref NativeArray baseLineStartDataIndices, + ref NativeArray baseLineDataCounts, + ref NativeArray baseLineData, + ref NativeArray vertexLocalPositions, + ref NativeArray vertexLocalRotations, + // particle + ref NativeArray basePosArray, + ref NativeArray baseRotArray, + // buffer + ref NativeArray stepBasicPositionBuffer, + ref NativeArray stepBasicRotationBuffer + ) + { + // ċˆĥ約解ĉħşŸ‚‚ıƒ†ƒƒƒ—”¨ċŸşĉş–ċ§żċ‹˘‚’è¨ˆç— + // ƒ™ƒĵ‚ıƒİ‚¤ƒ³”¨ + // ‚˘ƒ‹ƒĦƒĵ‚·ƒ§ƒ³ƒƒĵ‚şä½żç”¨ĉœ‰ç„Ħ + // ċˆĉœŸċ§żċ‹˘è¨ˆç—Œä¸èĤŞ‚‰ĉŠœ‘‚‹ + float blendRatio = tdata.animationPoseRatio; + if (blendRatio <= 0.99f) + { + int b_datastart = tdata.baseLineDataChunk.startIndex; + int p_start = tdata.particleChunk.startIndex; + int v_start = tdata.proxyCommonChunk.startIndex; + + // ƒƒĵƒ ‚ı‚ħƒĵƒĞ + float3 scl = tdata.initScale * tdata.scaleRatio; + + //int bindex = tdata.baseLineChunk.startIndex; + int bindex = tdata.baseLineChunk.startIndex + chunk.startIndex; + //for (int k = 0; k < tdata.baseLineChunk.dataLength; k++, bindex++) + for (int k = 0; k < chunk.dataLength; k++, bindex++) + { + int b_start = baseLineStartDataIndices[bindex]; + int b_cnt = baseLineDataCounts[bindex]; + int b_dataindex = b_start + b_datastart; + { + for (int i = 0; i < b_cnt; i++, b_dataindex++) + { + int l_index = baseLineData[b_dataindex]; + int pindex = p_start + l_index; + int vindex = v_start + l_index; + + // èĤŞ + int p_index = vertexParentIndices[vindex]; + int p_pindex = p_index + p_start; + + var attr = attributes[vindex]; + if (attr.IsMove() && p_index >= 0) + { + // ç§ğċ‹• + // èĤށ‹‚‰ċ§żċ‹˘‚’ç—ċ‡ş™‚‹ + var lpos = vertexLocalPositions[vindex]; + var lrot = vertexLocalRotations[vindex]; + var ppos = stepBasicPositionBuffer[p_pindex]; + var prot = stepBasicRotationBuffer[p_pindex]; + + // ƒž‚¤ƒŠ‚ı‚ı‚ħƒĵƒĞ + lpos *= tdata.negativeScaleDirection; + lrot = lrot.value * tdata.negativeScaleQuaternionValue; + + stepBasicPositionBuffer[pindex] = math.mul(prot, lpos * scl) + ppos; + stepBasicRotationBuffer[pindex] = math.mul(prot, lrot); + } + else + { + // ƒž‚¤ƒŠ‚ı‚ı‚ħƒĵƒĞ + var prot = stepBasicRotationBuffer[pindex]; + var lw = float4x4.TRS(0, prot, tdata.negativeScaleDirection); + quaternion rot = MathUtility.ToRotation(lw.c1.xyz, lw.c2.xyz); + stepBasicRotationBuffer[pindex] = rot; + } + } + } + + // ‚˘ƒ‹ƒĦƒĵ‚·ƒ§ƒ³ċ§żċ‹˘¨ƒ–ƒĴƒ³ƒ‰ + if (blendRatio > Define.System.Epsilon) + { + b_dataindex = b_start + b_datastart; + for (int i = 0; i < b_cnt; i++, b_dataindex++) + { + int l_index = baseLineData[b_dataindex]; + int pindex = p_start + l_index; + + var bpos = basePosArray[pindex]; + var brot = baseRotArray[pindex]; + + stepBasicPositionBuffer[pindex] = math.lerp(stepBasicPositionBuffer[pindex], bpos, blendRatio); + stepBasicRotationBuffer[pindex] = math.slerp(stepBasicRotationBuffer[pindex], brot, blendRatio); + } + } + } + } + } + + static float3 WindForceBlendBatchJob( + in TeamWindInfo windInfo, + in WindParams windParams, + in float3 windPos, + float windTurbulence + ) + { + float windMain = windInfo.main; + if (windMain < 0.01f) + return 0; + + //Debug.Log($"windMain:{windMain}"); + + // 風速係ĉ•° + float mainRatio = windMain / Define.System.WindBaseSpeed; // 0.0 ~ + + // Sinĉ³˘ċ½˘ + var sinPos = windPos + windInfo.time * 10.0f; + float2 sinXY = math.sin(sinPos.xy); + + // Noiseĉ³˘ċ½˘ + var noisePos = windPos + windInfo.time * 2.3132f; // Sinĉ³˘ċ½˘¨èŞżĉ•´ç”¨ + float2 noiseXY = new float2(noise.cnoise(noisePos.xy), noise.cnoise(noisePos.yx)); + noiseXY *= 2.3f; // cnoiseŻċĵħ„§è£œċĵ· 2.0? + + // ĉ³˘ċ½˘ƒ–ƒĴƒ³ƒ‰ + float2 waveXY = math.lerp(sinXY, noiseXY, windParams.blend); + + // ċŸşĉœĴäıħĉµçއ + windTurbulence *= windParams.turbulence; // 0.0 ~ 2.0 + + // 風ċ‘ + const float rangAng = 45.0f; // äıħĉµè§’ċşĤ + var ang = math.radians(waveXY * rangAng); + ang.y *= math.lerp(0.1f, 0.5f, windParams.blend); // ĉ¨Şĉ–ıċ‘ŻĉŠ‘ˆ‚‹€‚†—Ş„¨ċ††é‹ċ‹•ĞŞ£Ĥ—†Ÿ‚€‚0.3 - 0.5? + ang *= windTurbulence; // äıħĉµçއ + var rq = quaternion.Euler(ang.x, ang.y, 0.0f); // XY + var dirq = MathUtility.AxisQuaternion(windInfo.direction); + float3 wdir = math.forward(math.mul(dirq, rq)); + + // 風速 + // 風速Œä½Ž„¨ċ¤§Ş‚Š€é˘¨é€ŸŒéИ„¨0.0ĞŞ‚‹ + float mainScale = math.saturate(1.0f - mainRatio * 1.0f); + float mainWave = math.unlerp(-1.0f, 1.0f, waveXY.x); // 0.0 ~ 1.0 + mainWave *= mainScale * windTurbulence; + windMain -= windMain * mainWave; + + // ċˆĉˆ + float3 windForce = wdir * windMain; + + return windForce; + } + + /// + /// ċş§ĉ¨™ç˘şċš + /// + static void SimulationStepPostTeam( + DataChunk chunk, + float simulationDeltaTime, + // team + int teamId, + ref TeamManager.TeamData tdata, + ref InertiaConstraint.CenterData cdata, + ref ClothParameters param, + // vmesh + ref NativeArray attributes, + ref NativeArray depthArray, + // particle + ref NativeArray oldPosArray, + ref NativeArray velocityArray, + ref NativeArray nextPosArray, + ref NativeArray velocityPosArray, + ref NativeArray frictionArray, + ref NativeArray staticFrictionArray, + ref NativeArray collisionNormalArray, + ref NativeArray realVelocityArray + ) + { + // ċş§ĉ¨™ç˘şċš + //int pindex = tdata.particleChunk.startIndex; + //int vindex = tdata.proxyCommonChunk.startIndex; + int pindex = tdata.particleChunk.startIndex + chunk.startIndex; + int vindex = tdata.proxyCommonChunk.startIndex + chunk.startIndex; + //for (int k = 0; k < tdata.particleChunk.dataLength; k++, pindex++, vindex++) + for (int k = 0; k < chunk.dataLength; k++, pindex++, vindex++) + { + var attr = attributes[vindex]; + var depth = depthArray[vindex]; + var nextPos = nextPosArray[pindex]; + var oldPos = oldPosArray[pindex]; + + if (attr.IsMove() || tdata.IsSpring) + { + // ç§ğċ‹•ƒ‘ƒĵƒ†‚£‚ŻƒĞ + var velocityOldPos = velocityPosArray[pindex]; + +#if true + // ■ĉ‘İĉ“Ĥ + float friction = frictionArray[pindex]; + float3 cn = collisionNormalArray[pindex]; + bool isCollision = math.lengthsq(cn) > Define.System.Epsilon && friction > Define.System.Epsilon; // ĉŽè§Ĥĉœ‰ç„Ħ + float staticFrictionParam = param.colliderCollisionConstraint.staticFriction * tdata.scaleRatio; + float dynamicFrictionParam = param.colliderCollisionConstraint.dynamicFriction; +#endif + +#if true + // ■静ĉ­˘ĉ‘İĉ“Ĥ + float staticFriction = staticFrictionArray[pindex]; + if (isCollision && staticFrictionParam > 0.0f) + { + // ĉŽç·šĉ–ıċ‘ç§ğċ‹•速ċşĤ‹‚‰è¨ˆç—™‚‹ + var v = nextPos - oldPos; + var tanv = v - MathUtility.Project(v, cn); // ĉŽç·šĉ–ıċ‘ç§ğċ‹•ƒ™‚ŻƒˆƒĞ + float tangentVelocity = math.length(tanv) / simulationDeltaTime; // ĉŽç·šĉ–ıċ‘ç§ğċ‹•速ċşĤ + + // 静ĉ­˘é€ŸċşĤäğ下Ş‚‰°äż‚ĉ•°‚’上’‚‹ + if (tangentVelocity < staticFrictionParam) + { + staticFriction = math.saturate(staticFriction + 0.04f); // 係ĉ•°ċ˘—ċŠ (0.02?) + } + else + { + // ĉŽç·šé€ŸċşĤĞċżœ˜Ĥ係ĉ•°‚’ĉ¸›ċ°‘ + var vel = tangentVelocity - staticFrictionParam; + var value = math.max(vel / 0.2f, 0.05f); + staticFriction = math.saturate(staticFriction - value); + } + + // ĉŽç·šĉ–ıċ‘Ğ位罂’ċ·ğĉˆğ™ + tanv *= staticFriction; + nextPos -= tanv; + velocityOldPos -= tanv; + } + else + { + // ĉ¸›èĦ° + staticFriction = math.saturate(staticFriction - 0.05f); + } + staticFrictionArray[pindex] = staticFriction; +#endif + + // ■速ċşĤĉ›´ĉ–°(m/s) ------------------------------------------ + // 速ċşĤ計ç—用ä½ç½‹‚‰ċ‰²‚Šċ‡ş™ïĵˆċˆĥ約”¨é€ŸċşĤèŞżĉ•´ç”¨ïĵ‰ + float3 velocity = (nextPos - velocityOldPos) / simulationDeltaTime; + float sqVel = math.lengthsq(velocity); + float3 normalVelocity = sqVel > Define.System.Epsilon ? math.normalize(velocity) : 0; + +#if true + // ■ċ‹•ĉ‘İĉ“Ĥ + // èĦçŞé˘¨è§’ċşĤŒċ¤§„ğİĉ¸›èĦ°Œċĵ·Ş‚‹(MC1) + if (isCollision && dynamicFrictionParam > 0.0f && sqVel >= Define.System.Epsilon) + { + //float dot = math.dot(cn, math.normalize(velocity)); + float dot = math.dot(cn, normalVelocity); + dot = 0.5f + 0.5f * dot; // 1.0(front) - 0.5(side) - 0.0(back) + dot *= dot; // ‚µ‚¤ƒ‰‚’ċĵ·‚Ğ + dot = 1.0f - dot; // 0.0(front) - 0.75(side) - 1.0(back) + velocity -= velocity * (dot * math.saturate(friction * dynamicFrictionParam)); + } + + // ĉ‘İĉ“Ĥĉ¸›èĦ° + friction *= Define.System.FrictionDampingRate; + frictionArray[pindex] = friction; +#endif + +#if true + // ĉœ€ċ¤§é€ŸċşĤ + // ĉœ€ċ¤§é€ŸċşĤŻ‚‚‹ç¨‹ċşĤċˆĥ限—Ÿğ†Œċ‹•Œè‰ŻŞ‚‹§ċ…‚Œ‚‹ı€‚ + // ç‰ıĞċ›žèğ˘ĉ™‚éĞŞŞİċ‹•ŒĉŸ”‚‰‹Ş‚‹€‚ + // —‹—ċˆĥ限—™Ž‚‹¨‚³ƒİ‚¤ƒ€ƒĵĉŠĵ—ċ‡ş—ċˆĥċşĤŒ•Œ‚‹§ĉ³¨ĉ„€‚ + if (param.inertiaConstraint.particleSpeedLimit >= 0.0f) + { + velocity = MathUtility.ClampVector(velocity, param.inertiaConstraint.particleSpeedLimit * tdata.scaleRatio); + } +#endif +#if true + // ■遠ċżƒċŠ›ċŠ é€Ÿ --------------------------------------------- + if (cdata.angularVelocity > Define.System.Epsilon && param.inertiaConstraint.centrifualAcceleration > Define.System.Epsilon && sqVel >= Define.System.Epsilon) + { + // ċ›žèğ˘ä¸­ċżƒƒ­ƒĵ‚ЃĞċş§ĉ¨™ + var lpos = nextPos - cdata.nowWorldPosition; + + // ċ›žèğ˘èğ¸ċı³é˘ĞĉŠ•ċ½ħ + var v = MathUtility.ProjectOnPlane(lpos, cdata.rotationAxis); + var r = math.length(v); + if (r > Define.System.Epsilon) + { + float3 n = v / r; + + // 角速ċşĤ(rad/s) + float w = cdata.angularVelocity; + + // 重量ïĵˆé‡„ğİ遠ċżƒċŠ›Żċĵ·Ş‚‹ïĵ‰ + // ““§ŻĉœĞçĞŻĞèĦŒğİè𽁏™‚‹ + //float m = (1.0f - depth) * 3.0f; + //float m = 1.0f + (1.0f - depth) * 2.0f; + float m = 1.0f + (1.0f - depth); // fix + //float m = 1.0f + depth * 3.0f; + //const float m = 1; + + // 遠ċżƒċŠ› + var f = m * w * w * r; + + // ċ›žèğ˘ĉ–ıċ‘u¨é€ŸċşĤĉ–ıċ‘ŒċŒ˜ċ ´ċˆżċŠ›‚’ċŠ ˆ‚‹ïĵˆċ†…çݍĞ‚ˆ‚‹äı—ç—ïĵ‰ + // ċŸéš›ç‰İ理§Żé ċżƒċŠ›Żç´Œċĵµ£ŸçŠĥĉ…‹§Ş‘‚Œ°ç™şç”Ÿ—Ş„Œ“çŠĥĉ…‹‚’ċˆ¤ċˆ™‚‹ĉ–ıĉ³•Żç°Ħċ˜§ŻŞ„ + // Ÿ‚“‚ˆ†Şèż‘äĵĵ§äğ£ç”¨™‚‹ + // ċ›žèğ˘¨é€ŸċşĤŒé€†ĉ–ıċ‘ċ ´ċˆŻç´Œç·İ‚“§„‚‹¨ċˆ¤ĉ–­—遠ċżƒċŠ›ċ˘—ċĵ·‚’éİ用—Ş„ + float3 u = math.normalize(math.cross(cdata.rotationAxis, n)); + f *= math.saturate(math.dot(normalVelocity, u)); + + // 遠ċżƒċŠ›‚’速ċşĤĞċŠ ç—™‚‹ + velocity += n * (f * param.inertiaConstraint.centrifualAcceleration * 0.02f); + } + } +#endif + // ċ‰ċšċŒ–用é€ŸċşĤċ‰²ċˆ + velocity *= tdata.velocityWeight; + + // ĉ›¸ĉˆğ— + velocityArray[pindex] = velocity; + } + + // ċŸé€ŸċşĤ + float3 realVelocity = (nextPos - oldPos) / simulationDeltaTime; + realVelocityArray[pindex] = realVelocity; + + // äğŠċ›žäşˆĉ¸Ĵ位罂’記録 + oldPosArray[pindex] = nextPos; + } + } + + /// + /// ‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ċŒäş†ċŒèĦ¨ç¤şä½ç½è¨ˆç— + /// - ĉœŞĉäşˆĉ¸Ĵ + /// + static void SimulationCalcDisplayPosition( + DataChunk chunk, + float simulationDeltaTime, + // team + ref TeamManager.TeamData tdata, + // particle + ref NativeArray oldPosArray, + ref NativeArray realVelocityArray, + ref NativeArray oldPositionArray, + ref NativeArray oldRotationArray, + ref NativeArray dispPosArray, + // vmesh + ref NativeArray attributes, + ref NativeArray positions, + ref NativeArray rotations, + ref NativeArray vertexRootIndices, + // temp + ref NativeArray tempVectorBufferA, + ref NativeArray tempRotationBufferA + ) + { + //int pindex = tdata.particleChunk.startIndex; + int pindex = tdata.particleChunk.startIndex + chunk.startIndex; + int v_start = tdata.proxyCommonChunk.startIndex; + //int vindex = v_start; + int vindex = v_start + chunk.startIndex; + //for (int k = 0; k < tdata.particleChunk.dataLength; k++, pindex++, vindex++) + for (int k = 0; k < chunk.dataLength; k++, pindex++, vindex++) + { + var attr = attributes[vindex]; + + var pos = positions[vindex]; + var rot = rotations[vindex]; + //Debug.Log($"DispRot [{vindex}] nor:{MathUtility.ToNormal(rot)}, tan:{MathUtility.ToTangent(rot)}"); + + if (attr.IsMove() || tdata.IsSpring) + { + // ç§ğċ‹•ƒ‘ƒĵƒ†‚£‚ŻƒĞ + var dpos = oldPosArray[pindex]; + +#if !MC2_DISABLE_FUTURE + // ĉœŞĉäşˆĉ¸Ĵ + // ĉœ€çµ‚計ç—位罁¨ċŸé€ŸċşĤ‹‚‰ĉĴĦ‚ıƒ†ƒƒƒ—位罂’äşˆĉ¸Ĵ—€é–“ƒ•ƒĴƒĵƒ ĉ™‚間位罂’èĦ¨ç¤şä½ç½¨™‚‹ + float3 velocity = realVelocityArray[pindex] * simulationDeltaTime; + float3 fpos = dpos + velocity; + float interval = (tdata.nowUpdateTime + simulationDeltaTime) - tdata.oldTime; + float t = interval > 0.0f ? (tdata.time - tdata.oldTime) / interval : 0.0f; + fpos = math.lerp(dispPosArray[pindex], fpos, t); + // ƒĞƒĵƒˆ‹‚‰è·é›˘‚Żƒİƒ³ƒ—ïĵˆċ‰ċ…¨ċŻç­–ïĵ‰ + int rootIndex = vertexRootIndices[vindex]; + if (rootIndex >= 0) + { + var rootPos = positions[v_start + rootIndex]; + float originalDist = math.distance(rootPos, pos); + float clampDist = originalDist * Define.System.MaxDistanceRatioFutuerPrediction; // è¨ħċıé™ç•Œè·é›˘ + var v = fpos - rootPos; + v = MathUtility.ClampVector(v, clampDist); + fpos = rootPos + v; + } + + dpos = fpos; +#endif + + // èĦ¨ç¤şä½ç½ + var dispPos = dpos; + + // èĦ¨ç¤şä½ç½‚’記録 + dispPosArray[pindex] = dispPos; + + // ƒ–ƒĴƒ³ƒ‰‚Ĥ‚¨‚¤ƒˆ + var vpos = math.lerp(positions[vindex], dispPos, tdata.blendWeight); + + // vmeshĞċĉ˜  + positions[vindex] = vpos; + } + else + { + // ċ›şċšƒ‘ƒĵƒ†‚£‚ŻƒĞ + // èĦ¨ç¤şä½ç½Żċ¸¸Ğ‚ރނ¸ƒŠƒĞä½ç½ + var dispPos = positions[vindex]; + dispPosArray[pindex] = dispPos; + } + + // ïĵ‘¤ċ‰ċŽŸç‚ı位罂’記録 + if (tdata.IsRunning) + { + oldPositionArray[pindex] = pos; + oldRotationArray[pindex] = rot; + } + + // ƒž‚¤ƒŠ‚ı‚ı‚ħƒĵƒĞ + // ċ›žèğ˘‚’ƒž‚¤ƒŠ‚ı‚ı‚ħƒĵƒĞ‚’éİ用—ŸèĦ¨ç¤şè¨ˆç—用ċ›žèğ˘Ğċ¤‰ĉ›™‚‹ + if (tdata.IsNegativeScale) + { + var lw = float4x4.TRS(0, rot, tdata.negativeScaleDirection); + rot = MathUtility.ToRotation(lw.c1.xyz, lw.c2.xyz); + rotations[vindex] = rot; + } + + // BoneClothƒ™ƒĵ‚ıƒİ‚¤ƒ³ċ§żċ‹˘ċˆĥċĦŸ‚ĞċŸşĉœĴċ§żċ‹˘‚’tempĞ保ċ­˜ + tempVectorBufferA[pindex] = pos; + tempRotationBufferA[pindex] = rot; + } + } + + unsafe static void SimulationClearTempBuffer( + DataChunk chunk, + // team + ref TeamManager.TeamData tdata, + // buffer2 + ref NativeArray tempVectorBufferA, + ref NativeArray tempVectorBufferB, + ref NativeArray tempCountBuffer, + ref NativeArray tempFloatBufferA + //ref NativeArray tempRotationBufferA, + //ref NativeArray tempRotationBufferB, + ) + { + int pindex = tdata.particleChunk.startIndex + chunk.startIndex; + for (int i = 0; i < chunk.dataLength; i++, pindex++) + { + tempVectorBufferA[pindex] = 0; + tempVectorBufferB[pindex] = 0; + tempCountBuffer[pindex] = 0; + tempFloatBufferA[pindex] = 0; + } + } + } +} + diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/Simulation/SimulationManagerNormal.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Manager/Simulation/SimulationManagerNormal.cs.meta new file mode 100644 index 00000000..169a9cbc --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/Simulation/SimulationManagerNormal.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 1678d975c7bf0f343bf9eb89afc158fe +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Manager/Simulation/SimulationManagerNormal.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/Simulation/SimulationManagerSplit.cs b/Assets/MagicaCloth2/Scripts/Core/Manager/Simulation/SimulationManagerSplit.cs new file mode 100644 index 00000000..d85f72d4 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/Simulation/SimulationManagerSplit.cs @@ -0,0 +1,2373 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2025 MagicaSoft. +// https://magicasoft.jp +using Unity.Burst; +using Unity.Collections; +using Unity.Collections.LowLevel.Unsafe; +using Unity.Jobs; +using Unity.Mathematics; + +namespace MagicaCloth2 +{ + /// + /// Split + /// ‚ğƒĞƒ•‚³ƒŞ‚¸ƒ§ƒ³‚‚Š€‚‚—Żƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒé ‚ç‚ıĉ•°Œä¸€ċšċ€¤äğ上‚¸ƒ§ƒ– + /// ‚ރނ¸ƒŠƒĞ¨ċŒĉ§˜Ğ‚¸ƒ§ƒ–‚’ċˆ†ċ‰²—ċŒĉœŸ—ŞŒ‚‰ċŸèĦŒ™‚‹ + /// Ÿ —ĉœ€éİċŒ–‚’èĦŒ„‚ރނ¸ƒŠƒĞ‚ˆ‚Šèğ½é‡ċŒ–—Ĥ„‚‹ + /// + public partial class SimulationManager + { + /// + /// ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒ‚’‚ı‚­ƒ‹ƒ³‚°—ċŸşĉœĴċ§żċ‹˘‚’ĉħ‚‚‚‹ + /// + [BurstCompile] + unsafe struct SplitPre_A_Job : IJobParallelFor + { + public int workerCount; + + // team + [Unity.Collections.ReadOnly] + public NativeList batchSelfTeamList; + [Unity.Collections.ReadOnly] + public NativeArray teamDataArray; + + // transform + [Unity.Collections.ReadOnly] + public NativeArray transformLocalToWorldMatrixArray; + + // vmesh + [Unity.Collections.ReadOnly] + public NativeArray attributes; + [Unity.Collections.ReadOnly] + public NativeArray localPositions; + [Unity.Collections.ReadOnly] + public NativeArray localNormals; + [Unity.Collections.ReadOnly] + public NativeArray localTangents; + [Unity.Collections.ReadOnly] + public NativeArray boneWeights; + [Unity.Collections.ReadOnly] + public NativeArray skinBoneTransformIndices; + [Unity.Collections.ReadOnly] + public NativeArray skinBoneBindPoses; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray positions; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray rotations; + + // ƒƒƒƒċ†…ƒ­ƒĵ‚ЃЃƒĵƒ ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı”¨ + public void Execute(int index) + { + // ƒƒĵƒ ID¨ƒŻƒĵ‚ЃĵID + int localIndex = index / workerCount; + int workerIndex = index % workerCount; + + //Debug.Log(localIndex); + + // ċ„ƒ™ƒĵ‚ıƒ‚¤ƒ³‚ż + TeamManager.TeamData* teamPt = (TeamManager.TeamData*)teamDataArray.GetUnsafeReadOnlyPtr(); + + int teamId = batchSelfTeamList[localIndex]; + + //Debug.Log($"{localIndex}, {teamId}"); + + ref var tdata = ref *(teamPt + teamId); + + if (tdata.IsProcess == false) + return; + if (tdata.ParticleCount == 0) + return; + + // 範ċ›² + var chunk = MathUtility.GetWorkerChunk(tdata.proxyCommonChunk.dataLength, workerCount, workerIndex); + if (chunk.IsValid == false) + return; + + // ■ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒ‚’‚ı‚­ƒ‹ƒ³‚°—ċŸşĉœĴċ§żċ‹˘‚’ĉħ‚‚‚‹ + VirtualMeshManager.SimulationPreProxyMeshUpdate( + //new DataChunk(0, tdata.proxyCommonChunk.dataLength), + chunk, + // team + teamId, + ref tdata, + // vmesh + attributes, + localPositions, + localNormals, + localTangents, + boneWeights, + skinBoneTransformIndices, + skinBoneBindPoses, + ref positions, + ref rotations, + // transform + transformLocalToWorldMatrixArray + ); + } + } + + /// + /// ƒƒĵƒ ‚ğƒ³‚żƒĵċ§żċ‹˘ĉħşċš¨ĉ…£ĉ€§ç”¨ç§ğċ‹•é‡è¨ˆç— + /// + [BurstCompile] + unsafe struct SplitPre_B_Job : IJobParallelFor + { + public float simulationDeltaTime; + + // team + [Unity.Collections.ReadOnly] + public NativeList batchSelfTeamList; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray teamDataArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray centerDataArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray teamWindArray; + [Unity.Collections.ReadOnly] + public NativeArray parameterArray; + + // wind + public int windZoneCount; + [Unity.Collections.ReadOnly] + public NativeArray windDataArray; + + // transform + [Unity.Collections.ReadOnly] + public NativeArray transformPositionArray; + [Unity.Collections.ReadOnly] + public NativeArray transformRotationArray; + [Unity.Collections.ReadOnly] + public NativeArray transformScaleArray; + + // vmesh + [Unity.Collections.ReadOnly] + public NativeArray positions; + [Unity.Collections.ReadOnly] + public NativeArray rotations; + [Unity.Collections.ReadOnly] + public NativeArray vertexBindPoseRotations; + + + // inertia + [Unity.Collections.ReadOnly] + public NativeArray fixedArray; + + // ƒƒƒƒċ†…ƒ­ƒĵ‚ЃЃƒĵƒ ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı”¨ + public void Execute(int localIndex) + { + //Debug.Log(localIndex); + + // ċ„ƒ™ƒĵ‚ıƒ‚¤ƒ³‚ż + TeamManager.TeamData* teamPt = (TeamManager.TeamData*)teamDataArray.GetUnsafePtr(); + ClothParameters* paramPt = (ClothParameters*)parameterArray.GetUnsafeReadOnlyPtr(); + InertiaConstraint.CenterData* centerPt = (InertiaConstraint.CenterData*)centerDataArray.GetUnsafePtr(); + TeamWindData* windPt = (TeamWindData*)teamWindArray.GetUnsafePtr(); + + int teamId = batchSelfTeamList[localIndex]; + ref var tdata = ref *(teamPt + teamId); + ref var cdata = ref *(centerPt + teamId); + ref var param = ref *(paramPt + teamId); + ref var wdata = ref *(windPt + teamId); + + if (tdata.IsProcess == false) + return; + if (tdata.ParticleCount == 0) + return; + + // ƒƒĵƒ ‚ğƒ³‚żƒĵċ§żċ‹˘ĉħşċš¨ĉ…£ĉ€§ç”¨ç§ğċ‹•é‡è¨ˆç— + TeamManager.SimulationCalcCenterAndInertiaAndWind( + simulationDeltaTime, + // team + teamId, + ref tdata, + ref cdata, + ref wdata, + ref param, + // vmesh + positions, + rotations, + vertexBindPoseRotations, + // inertia + fixedArray, + // transform + transformPositionArray, + transformRotationArray, + transformScaleArray, + // wind + windZoneCount, + windDataArray + ); + } + } + + /// + /// ƒ‘ƒĵƒ†‚£‚ŻƒĞċ…¨ä½“ĉ…£ĉ€§Š‚ˆ³ƒŞ‚ğƒƒƒˆéİ用 + /// ‚³ƒİ‚¤ƒ€ƒĵƒ­ƒĵ‚ЃĞċ§żċ‹˘‚’ĉħ‚‚‚‹€Š‚ˆ³ċ…¨ä½“ĉ…£ĉ€§¨ƒŞ‚ğƒƒƒˆéİ用 + /// + [BurstCompile] + unsafe struct SplitPre_C_Job : IJobParallelFor + { + public int workerCount; + + // team + [Unity.Collections.ReadOnly] + public NativeList batchSelfTeamList; + [Unity.Collections.ReadOnly] + public NativeArray teamDataArray; + [Unity.Collections.ReadOnly] + public NativeArray centerDataArray; + [Unity.Collections.ReadOnly] + public NativeArray parameterArray; + + // transform + [Unity.Collections.ReadOnly] + public NativeArray transformPositionArray; + [Unity.Collections.ReadOnly] + public NativeArray transformRotationArray; + [Unity.Collections.ReadOnly] + public NativeArray transformScaleArray; + [Unity.Collections.ReadOnly] + public NativeArray transformLocalPositionArray; + [Unity.Collections.ReadOnly] + public NativeArray transformLocalRotationArray; + [Unity.Collections.ReadOnly] + public NativeArray transformLocalScaleArray; + + // vmesh + [Unity.Collections.ReadOnly] + public NativeArray positions; + [Unity.Collections.ReadOnly] + public NativeArray rotations; + [Unity.Collections.ReadOnly] + public NativeArray vertexDepths; + + // particle + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray nextPosArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray oldPosArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray oldRotArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray basePosArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray baseRotArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray oldPositionArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray oldRotationArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray velocityPosArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray dispPosArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray velocityArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray realVelocityArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray frictionArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray staticFrictionArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray collisionNormalArray; + + // collider + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray colliderFlagArray; + [Unity.Collections.ReadOnly] + public NativeArray colliderCenterArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray colliderFramePositions; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray colliderFrameRotations; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray colliderFrameScales; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray colliderOldFramePositions; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray colliderOldFrameRotations; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray colliderNowPositions; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray colliderNowRotations; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray colliderOldPositions; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray colliderOldRotations; + [Unity.Collections.ReadOnly] + public NativeArray colliderMainColliderIndices; + + // ƒƒƒƒċ†…ƒ­ƒĵ‚ЃЃƒĵƒ ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı”¨ + public void Execute(int index) + { + // ƒƒĵƒ ID¨ƒŻƒĵ‚ЃĵID + int localIndex = index / workerCount; + int workerIndex = index % workerCount; + //Debug.Log(localIndex); + + // ċ„ƒ™ƒĵ‚ıƒ‚¤ƒ³‚ż + TeamManager.TeamData* teamPt = (TeamManager.TeamData*)teamDataArray.GetUnsafeReadOnlyPtr(); + ClothParameters* paramPt = (ClothParameters*)parameterArray.GetUnsafeReadOnlyPtr(); + InertiaConstraint.CenterData* centerPt = (InertiaConstraint.CenterData*)centerDataArray.GetUnsafeReadOnlyPtr(); + + int teamId = batchSelfTeamList[localIndex]; + ref var tdata = ref *(teamPt + teamId); + ref var cdata = ref *(centerPt + teamId); + ref var param = ref *(paramPt + teamId); + + if (tdata.IsProcess == false) + return; + if (tdata.ParticleCount == 0) + return; + + // ƒ‘ƒĵƒ†‚£‚ŻƒĞċ…¨ä½“ĉ…£ĉ€§Š‚ˆ³ƒŞ‚ğƒƒƒˆéİ用 + var p_chunk = MathUtility.GetWorkerChunk(tdata.particleChunk.dataLength, workerCount, workerIndex); + if (p_chunk.IsValid) + { + SimulationPreTeamUpdate( + p_chunk, + // team + ref tdata, + param, + cdata, + // vmesh + positions, + rotations, + vertexDepths, + // particle + ref nextPosArray, + ref oldPosArray, + ref oldRotArray, + ref basePosArray, + ref baseRotArray, + ref oldPositionArray, + ref oldRotationArray, + ref velocityPosArray, + ref dispPosArray, + ref velocityArray, + ref realVelocityArray, + ref frictionArray, + ref staticFrictionArray, + ref collisionNormalArray + ); + } + + // ■‚³ƒİ‚¤ƒ€ƒĵƒ­ƒĵ‚ЃĞċ§żċ‹˘‚’ĉħ‚‚‚‹€Š‚ˆ³ċ…¨ä½“ĉ…£ĉ€§¨ƒŞ‚ğƒƒƒˆéİ用 + if (tdata.colliderCount > 0) + { + var c_chunk = MathUtility.GetWorkerChunk(tdata.colliderChunk.dataLength, workerCount, workerIndex); + if (c_chunk.IsValid) + { + ColliderManager.SimulationPreUpdate( + c_chunk, + // team + ref tdata, + ref cdata, + // collider + ref colliderFlagArray, + ref colliderCenterArray, + ref colliderFramePositions, + ref colliderFrameRotations, + ref colliderFrameScales, + ref colliderOldFramePositions, + ref colliderOldFrameRotations, + ref colliderNowPositions, + ref colliderNowRotations, + ref colliderOldPositions, + ref colliderOldRotations, + ref colliderMainColliderIndices, + // transform + ref transformPositionArray, + ref transformRotationArray, + ref transformScaleArray, + ref transformLocalPositionArray, + ref transformLocalRotationArray, + ref transformLocalScaleArray + ); + } + } + } + } + + /// + /// ƒƒĵƒ ĉ›´ĉ–° + /// ‚³ƒİ‚¤ƒ€ƒĵĉ›´ĉ–° + /// + [BurstCompile] + unsafe struct SplitStep_A_Job : IJobParallelFor + { + public int updateIndex; + public float4 simulationPower; + public float simulationDeltaTime; + + // team + [Unity.Collections.ReadOnly] + public NativeList batchSelfTeamList; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray teamDataArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray centerDataArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray teamWindArray; + [Unity.Collections.ReadOnly] + public NativeArray parameterArray; + + // collider + [Unity.Collections.ReadOnly] + public NativeArray colliderFlagArray; + [Unity.Collections.ReadOnly] + public NativeArray colliderSizeArray; + [Unity.Collections.ReadOnly] + public NativeArray colliderFramePositions; + [Unity.Collections.ReadOnly] + public NativeArray colliderFrameRotations; + [Unity.Collections.ReadOnly] + public NativeArray colliderFrameScales; + [Unity.Collections.ReadOnly] + public NativeArray colliderOldFramePositions; + [Unity.Collections.ReadOnly] + public NativeArray colliderOldFrameRotations; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray colliderNowPositions; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray colliderNowRotations; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray colliderOldPositions; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray colliderOldRotations; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray colliderWorkDataArray; + + // ƒƒƒƒċ†…ƒ­ƒĵ‚ЃЃƒĵƒ ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı”¨ + public void Execute(int localIndex) + { + // ċ„ƒ™ƒĵ‚ıƒ‚¤ƒ³‚ż + TeamManager.TeamData* teamPt = (TeamManager.TeamData*)teamDataArray.GetUnsafePtr(); + ClothParameters* paramPt = (ClothParameters*)parameterArray.GetUnsafeReadOnlyPtr(); + InertiaConstraint.CenterData* centerPt = (InertiaConstraint.CenterData*)centerDataArray.GetUnsafePtr(); + TeamWindData* windPt = (TeamWindData*)teamWindArray.GetUnsafePtr(); + + int teamId = batchSelfTeamList[localIndex]; + ref var tdata = ref *(teamPt + teamId); + ref var cdata = ref *(centerPt + teamId); + ref var param = ref *(paramPt + teamId); + ref var wdata = ref *(windPt + teamId); + + if (updateIndex >= tdata.updateCount) + return; + if (tdata.IsProcess == false) + return; + if (tdata.ParticleCount == 0) + return; + + // ‚ıƒ†ƒƒƒ—ċŸèĦŒ + // ‚ıƒ†ƒƒƒ—”¨ƒƒĵƒ ĉ›´ĉ–° + TeamManager.SimulationStepTeamUpdate( + updateIndex, + simulationDeltaTime, + // team + teamId, + ref tdata, + ref param, + ref cdata, + ref wdata + ); + + // ‚³ƒİ‚¤ƒ€ƒĵĉ›´ĉ–° + if (tdata.colliderCount > 0) + { + ColliderManager.SimulationStartStep( + // team + ref tdata, + ref cdata, + // collider + ref colliderFlagArray, + ref colliderSizeArray, + ref colliderFramePositions, + ref colliderFrameRotations, + ref colliderFrameScales, + ref colliderOldFramePositions, + ref colliderOldFrameRotations, + ref colliderNowPositions, + ref colliderNowRotations, + ref colliderOldPositions, + ref colliderOldRotations, + ref colliderWorkDataArray + ); + } + } + } + + /// + /// 速ċşĤĉ›´ĉ–°€ċ¤–ċŠ›ċ½ħ響€ĉ…£ĉ€§‚·ƒ•ƒˆ + /// + [BurstCompile] + unsafe struct SplitStep_B_Job : IJobParallelFor + { + public int workerCount; + public int updateIndex; + public float4 simulationPower; + public float simulationDeltaTime; + + // team + [Unity.Collections.ReadOnly] + public NativeList batchSelfTeamList; + [Unity.Collections.ReadOnly] + public NativeArray teamDataArray; + [Unity.Collections.ReadOnly] + public NativeArray centerDataArray; + [Unity.Collections.ReadOnly] + public NativeArray teamWindArray; + [Unity.Collections.ReadOnly] + public NativeArray parameterArray; + + // wind + public int windZoneCount; + [Unity.Collections.ReadOnly] + public NativeArray windDataArray; + + // vmesh + [Unity.Collections.ReadOnly] + public NativeArray attributes; + [Unity.Collections.ReadOnly] + public NativeArray depthArray; + [Unity.Collections.ReadOnly] + public NativeArray positions; + [Unity.Collections.ReadOnly] + public NativeArray rotations; + [Unity.Collections.ReadOnly] + public NativeArray vertexRootIndices; + + // particle + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray nextPosArray; + [Unity.Collections.ReadOnly] + public NativeArray oldPosArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray basePosArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray baseRotArray; + [Unity.Collections.ReadOnly] + public NativeArray oldPositionArray; + [Unity.Collections.ReadOnly] + public NativeArray oldRotationArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray velocityPosArray; + [Unity.Collections.ReadOnly] + public NativeArray velocityArray; + [Unity.Collections.ReadOnly] + public NativeArray frictionArray; + + // buffer + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray stepBasicPositionBuffer; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray stepBasicRotationBuffer; + + // temp + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray tempVectorBufferA; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray tempVectorBufferB; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray tempCountBuffer; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray tempFloatBufferA; + + // ƒƒƒƒċ†…ƒ­ƒĵ‚ЃЃƒĵƒ ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı”¨ + public void Execute(int index) + { + // ƒƒĵƒ ID¨ƒŻƒĵ‚ЃĵID + int localIndex = index / workerCount; + int workerIndex = index % workerCount; + + // ċ„ƒ™ƒĵ‚ıƒ‚¤ƒ³‚ż + TeamManager.TeamData* teamPt = (TeamManager.TeamData*)teamDataArray.GetUnsafeReadOnlyPtr(); + ClothParameters* paramPt = (ClothParameters*)parameterArray.GetUnsafeReadOnlyPtr(); + InertiaConstraint.CenterData* centerPt = (InertiaConstraint.CenterData*)centerDataArray.GetUnsafeReadOnlyPtr(); + TeamWindData* windPt = (TeamWindData*)teamWindArray.GetUnsafeReadOnlyPtr(); + + int teamId = batchSelfTeamList[localIndex]; + ref var tdata = ref *(teamPt + teamId); + ref var cdata = ref *(centerPt + teamId); + ref var param = ref *(paramPt + teamId); + ref var wdata = ref *(windPt + teamId); + + if (updateIndex >= tdata.updateCount) + return; + if (tdata.IsProcess == false) + return; + if (tdata.ParticleCount == 0) + return; + + // 範ċ›² + var chunk = MathUtility.GetWorkerChunk(tdata.particleChunk.dataLength, workerCount, workerIndex); + if (chunk.IsValid == false) + return; + + // 速ċşĤĉ›´ĉ–°€ċ¤–ċŠ›ċ½ħ響€ĉ…£ĉ€§‚·ƒ•ƒˆ + SimulationStepUpdateParticles( + //new DataChunk(0, tdata.particleChunk.dataLength), + chunk, + simulationPower, + simulationDeltaTime, + // team + teamId, + ref tdata, + ref cdata, + ref param, + ref wdata, + // wind + ref windDataArray, + // vmesh + ref attributes, + ref depthArray, + ref positions, + ref rotations, + ref vertexRootIndices, + // particle + ref nextPosArray, + ref oldPosArray, + ref basePosArray, + ref baseRotArray, + ref oldPositionArray, + ref oldRotationArray, + ref velocityPosArray, + ref velocityArray, + ref frictionArray, + // buffer + ref stepBasicPositionBuffer, + ref stepBasicRotationBuffer, + // temp + ref tempVectorBufferA, + ref tempVectorBufferB, + ref tempCountBuffer, + ref tempFloatBufferA + ); + } + } + + /// + /// ƒ™ƒĵ‚ıƒİ‚¤ƒ³ċŸşĉş–ċ§żċ‹˘‚’è¨ˆç— + /// + [BurstCompile] + unsafe struct SplitStep_C_Job : IJobParallelFor + { + public int workerCount; + public int updateIndex; + + // team + [Unity.Collections.ReadOnly] + public NativeList batchSelfTeamList; + [Unity.Collections.ReadOnly] + public NativeArray teamDataArray; + + // vmesh + [Unity.Collections.ReadOnly] + public NativeArray attributes; + [Unity.Collections.ReadOnly] + public NativeArray vertexRootIndices; + [Unity.Collections.ReadOnly] + public NativeArray vertexParentIndices; + [Unity.Collections.ReadOnly] + public NativeArray baseLineStartDataIndices; + [Unity.Collections.ReadOnly] + public NativeArray baseLineDataCounts; + [Unity.Collections.ReadOnly] + public NativeArray baseLineData; + [Unity.Collections.ReadOnly] + public NativeArray vertexLocalPositions; + [Unity.Collections.ReadOnly] + public NativeArray vertexLocalRotations; + + // particle + [Unity.Collections.ReadOnly] + public NativeArray basePosArray; + [Unity.Collections.ReadOnly] + public NativeArray baseRotArray; + + // buffer + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray stepBasicPositionBuffer; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray stepBasicRotationBuffer; + + // ƒƒƒƒċ†…ƒ­ƒĵ‚ЃЃƒĵƒ ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı”¨ + public void Execute(int index) + { + // ƒƒĵƒ ID¨ƒŻƒĵ‚ЃĵID + int localIndex = index / workerCount; + int workerIndex = index % workerCount; + + // ċ„ƒ™ƒĵ‚ıƒ‚¤ƒ³‚ż + TeamManager.TeamData* teamPt = (TeamManager.TeamData*)teamDataArray.GetUnsafeReadOnlyPtr(); + + int teamId = batchSelfTeamList[localIndex]; + ref var tdata = ref *(teamPt + teamId); + + if (updateIndex >= tdata.updateCount) + return; + if (tdata.IsProcess == false) + return; + if (tdata.ParticleCount == 0) + return; + + // 範ċ›² + var chunk = MathUtility.GetWorkerChunk(tdata.baseLineChunk.dataLength, workerCount, workerIndex); + if (chunk.IsValid == false) + return; + + // ċˆĥ約解ĉħşŸ‚‚ıƒ†ƒƒƒ—”¨ċŸşĉş–ċ§żċ‹˘‚’è¨ˆç— + // ƒ™ƒĵ‚ıƒİ‚¤ƒ³”¨ + // ‚˘ƒ‹ƒĦƒĵ‚·ƒ§ƒ³ƒƒĵ‚şä½żç”¨ĉœ‰ç„Ħ + SimulationStepUpdateBaseLinePose( + //new DataChunk(0, tdata.baseLineChunk.dataLength), + chunk, + // team + ref tdata, + // vmesh + ref attributes, + ref vertexParentIndices, + ref baseLineStartDataIndices, + ref baseLineDataCounts, + ref baseLineData, + ref vertexLocalPositions, + ref vertexLocalRotations, + // particle + ref basePosArray, + ref baseRotArray, + // buffer + ref stepBasicPositionBuffer, + ref stepBasicRotationBuffer + ); + } + } + + /// + /// ƒ†‚ĥƒĵ + /// è·é›˘ + /// + [BurstCompile] + unsafe struct SplitStep_D_Job : IJobParallelFor + { + public int workerCount; + public int updateIndex; + public float4 simulationPower; + + // team + [Unity.Collections.ReadOnly] + public NativeList batchSelfTeamList; + [Unity.Collections.ReadOnly] + public NativeArray teamDataArray; + [Unity.Collections.ReadOnly] + public NativeArray centerDataArray; + [Unity.Collections.ReadOnly] + public NativeArray parameterArray; + + // vmesh + [Unity.Collections.ReadOnly] + public NativeArray attributes; + [Unity.Collections.ReadOnly] + public NativeArray depthArray; + [Unity.Collections.ReadOnly] + public NativeArray vertexRootIndices; + + // particle + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray nextPosArray; + [Unity.Collections.ReadOnly] + public NativeArray basePosArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray velocityPosArray; + [Unity.Collections.ReadOnly] + public NativeArray frictionArray; + + // distance + [Unity.Collections.ReadOnly] + public NativeArray distanceIndexArray; + [Unity.Collections.ReadOnly] + public NativeArray distanceDataArray; + [Unity.Collections.ReadOnly] + public NativeArray distanceDistanceArray; + + // buffer + [Unity.Collections.ReadOnly] + public NativeArray stepBasicPositionBuffer; + + // ƒƒƒƒċ†…ƒ­ƒĵ‚ЃЃƒĵƒ ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı”¨ + public void Execute(int index) + { + // ƒƒĵƒ ID¨ƒŻƒĵ‚ЃĵID + int localIndex = index / workerCount; + int workerIndex = index % workerCount; + + // ċ„ƒ™ƒĵ‚ıƒ‚¤ƒ³‚ż + TeamManager.TeamData* teamPt = (TeamManager.TeamData*)teamDataArray.GetUnsafeReadOnlyPtr(); + ClothParameters* paramPt = (ClothParameters*)parameterArray.GetUnsafeReadOnlyPtr(); + InertiaConstraint.CenterData* centerPt = (InertiaConstraint.CenterData*)centerDataArray.GetUnsafeReadOnlyPtr(); + + int teamId = batchSelfTeamList[localIndex]; + ref var tdata = ref *(teamPt + teamId); + ref var cdata = ref *(centerPt + teamId); + ref var param = ref *(paramPt + teamId); + + if (updateIndex >= tdata.updateCount) + return; + if (tdata.IsProcess == false) + return; + if (tdata.ParticleCount == 0) + return; + + // 範ċ›² + var chunk = MathUtility.GetWorkerChunk(tdata.particleChunk.dataLength, workerCount, workerIndex); + if (chunk.IsValid == false) + return; + + TetherConstraint.SolverConstraint( + //new DataChunk(0, tdata.particleChunk.dataLength), + chunk, + // team + ref tdata, + ref param, + ref cdata, + // vmesh + ref attributes, + ref depthArray, + ref vertexRootIndices, + // particle + ref nextPosArray, + ref velocityPosArray, + ref frictionArray, + // buffer + ref stepBasicPositionBuffer + ); + + DistanceConstraint.SolverConstraint( + //new DataChunk(0, tdata.particleChunk.dataLength), + chunk, + simulationPower, + // team + ref tdata, + ref param, + // vmesh + ref attributes, + ref depthArray, + // particle + ref nextPosArray, + ref basePosArray, + ref velocityPosArray, + ref frictionArray, + // constraint + ref distanceIndexArray, + ref distanceDataArray, + ref distanceDistanceArray + ); + } + } + + /// + /// ‚˘ƒ³‚°ƒĞ + /// + [BurstCompile] + unsafe struct SplitStep_Angle_Job : IJobParallelFor + { + public int workerCount; + public int updateIndex; + public float4 simulationPower; + + // team + [Unity.Collections.ReadOnly] + public NativeList batchSelfTeamList; + [Unity.Collections.ReadOnly] + public NativeArray teamDataArray; + [Unity.Collections.ReadOnly] + public NativeArray parameterArray; + + // vmesh + [Unity.Collections.ReadOnly] + public NativeArray attributes; + [Unity.Collections.ReadOnly] + public NativeArray depthArray; + [Unity.Collections.ReadOnly] + public NativeArray vertexRootIndices; + [Unity.Collections.ReadOnly] + public NativeArray vertexParentIndices; + [Unity.Collections.ReadOnly] + public NativeArray baseLineStartDataIndices; + [Unity.Collections.ReadOnly] + public NativeArray baseLineDataCounts; + [Unity.Collections.ReadOnly] + public NativeArray baseLineData; + + // particle + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray nextPosArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray velocityPosArray; + [Unity.Collections.ReadOnly] + public NativeArray frictionArray; + + // distance + [Unity.Collections.ReadOnly] + public NativeArray distanceIndexArray; + [Unity.Collections.ReadOnly] + public NativeArray distanceDataArray; + [Unity.Collections.ReadOnly] + public NativeArray distanceDistanceArray; + + // buffer + [Unity.Collections.ReadOnly] + public NativeArray stepBasicPositionBuffer; + [Unity.Collections.ReadOnly] + public NativeArray stepBasicRotationBuffer; + + // buffer2 + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray tempVectorBufferA; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray tempVectorBufferB; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray tempFloatBufferA; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray tempRotationBufferA; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray tempRotationBufferB; + + // ƒƒƒƒċ†…ƒ­ƒĵ‚ЃЃƒĵƒ ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı”¨ + // ƒŻƒĵ‚Ѓĵċˆ†ċ‰² + public void Execute(int index) + { + // ƒƒĵƒ ID¨ƒŻƒĵ‚ЃĵID + int localIndex = index / workerCount; + int workerIndex = index % workerCount; + + // ċ„ƒ™ƒĵ‚ıƒ‚¤ƒ³‚ż + TeamManager.TeamData* teamPt = (TeamManager.TeamData*)teamDataArray.GetUnsafeReadOnlyPtr(); + ClothParameters* paramPt = (ClothParameters*)parameterArray.GetUnsafeReadOnlyPtr(); + + int teamId = batchSelfTeamList[localIndex]; + ref var tdata = ref *(teamPt + teamId); + ref var param = ref *(paramPt + teamId); + + if (updateIndex >= tdata.updateCount) + return; + if (tdata.IsProcess == false) + return; + if (tdata.ParticleCount == 0) + return; + + // 範ċ›² + var chunk = MathUtility.GetWorkerChunk(tdata.baseLineChunk.dataLength, workerCount, workerIndex); + if (chunk.IsValid == false) + return; + + AngleConstraint.SolverConstraint( + chunk, + simulationPower, + // team + ref tdata, + ref param, + // vmesh + ref attributes, + ref depthArray, + ref vertexParentIndices, + ref baseLineStartDataIndices, + ref baseLineDataCounts, + ref baseLineData, + // particle + ref nextPosArray, + ref velocityPosArray, + ref frictionArray, + // buffer + ref stepBasicPositionBuffer, + ref stepBasicRotationBuffer, + // buffer2 + ref tempFloatBufferA, + ref tempVectorBufferA, + ref tempRotationBufferA, + ref tempRotationBufferB, + ref tempVectorBufferB + ); + } + } + + /// + /// ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞƒ™ƒ³ƒ‰ + /// + [BurstCompile] + unsafe struct SplitStep_Triangle_Job : IJobParallelFor + { + public int workerCount; + public int updateIndex; + public float4 simulationPower; + + // team + [Unity.Collections.ReadOnly] + public NativeList batchSelfTeamList; + [Unity.Collections.ReadOnly] + public NativeArray teamDataArray; + [Unity.Collections.ReadOnly] + public NativeArray parameterArray; + + // vmesh + [Unity.Collections.ReadOnly] + public NativeArray attributes; + [Unity.Collections.ReadOnly] + public NativeArray depthArray; + + // particle + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray nextPosArray; + [Unity.Collections.ReadOnly] + public NativeArray frictionArray; + + // triangle bending + [Unity.Collections.ReadOnly] + public NativeArray bendingTrianglePairArray; + [Unity.Collections.ReadOnly] + public NativeArray bendingRestAngleOrVolumeArray; + [Unity.Collections.ReadOnly] + public NativeArray bendingSignOrVolumeArray; + + // buffer2 + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray tempVectorBufferA; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray tempCountBuffer; + + // ƒƒƒƒċ†…ƒ­ƒĵ‚ЃЃƒĵƒ ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı”¨ + // ƒŻƒĵ‚Ѓĵċˆ†ċ‰² + public void Execute(int index) + { + // ƒƒĵƒ ID¨ƒŻƒĵ‚ЃĵID + int localIndex = index / workerCount; + int workerIndex = index % workerCount; + + // ċ„ƒ™ƒĵ‚ıƒ‚¤ƒ³‚ż + TeamManager.TeamData* teamPt = (TeamManager.TeamData*)teamDataArray.GetUnsafeReadOnlyPtr(); + ClothParameters* paramPt = (ClothParameters*)parameterArray.GetUnsafeReadOnlyPtr(); + + int teamId = batchSelfTeamList[localIndex]; + ref var tdata = ref *(teamPt + teamId); + ref var param = ref *(paramPt + teamId); + + if (updateIndex >= tdata.updateCount) + return; + if (tdata.IsProcess == false) + return; + if (tdata.ParticleCount == 0) + return; + + // 範ċ›² + var chunk = MathUtility.GetWorkerChunk(tdata.bendingPairChunk.dataLength, workerCount, workerIndex); + if (chunk.IsValid == false) + return; + + TriangleBendingConstraint.SolverConstraint( + chunk, + simulationPower, + // team + ref tdata, + ref param, + // vmesh + ref attributes, + ref depthArray, + // particle + ref nextPosArray, + ref frictionArray, + // constraints + ref bendingTrianglePairArray, + ref bendingRestAngleOrVolumeArray, + ref bendingSignOrVolumeArray, + // buffer2 + ref tempVectorBufferA, + ref tempCountBuffer + ); + } + } + + /// + /// ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞƒ™ƒ³ƒ‰é›†è¨ˆ + /// ‚³ƒİ‚¤ƒ€ƒĵ‚³ƒŞ‚¸ƒ§ƒ³Point + /// + [BurstCompile] + unsafe struct SplitStep_E_Job : IJobParallelFor + { + public int workerCount; + public int updateIndex; + public float4 simulationPower; + + // team + [Unity.Collections.ReadOnly] + public NativeList batchSelfTeamList; + [Unity.Collections.ReadOnly] + public NativeArray teamDataArray; + [Unity.Collections.ReadOnly] + public NativeArray parameterArray; + + // vmesh + [Unity.Collections.ReadOnly] + public NativeArray attributes; + [Unity.Collections.ReadOnly] + public NativeArray depthArray; + + // particle + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray nextPosArray; + [Unity.Collections.ReadOnly] + public NativeArray basePosArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray velocityPosArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray frictionArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray collisionNormalArray; + + // collider + [Unity.Collections.ReadOnly] + public NativeArray colliderFlagArray; + [Unity.Collections.ReadOnly] + public NativeArray colliderWorkDataArray; + + // buffer2 + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray tempVectorBufferA; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray tempCountBuffer; + + // ƒƒƒƒċ†…ƒ­ƒĵ‚ЃЃƒĵƒ ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı”¨ + // ƒŻƒĵ‚Ѓĵċˆ†ċ‰² + public void Execute(int index) + { + // ƒƒĵƒ ID¨ƒŻƒĵ‚ЃĵID + int localIndex = index / workerCount; + int workerIndex = index % workerCount; + + // ċ„ƒ™ƒĵ‚ıƒ‚¤ƒ³‚ż + TeamManager.TeamData* teamPt = (TeamManager.TeamData*)teamDataArray.GetUnsafeReadOnlyPtr(); + ClothParameters* paramPt = (ClothParameters*)parameterArray.GetUnsafeReadOnlyPtr(); + + int teamId = batchSelfTeamList[localIndex]; + ref var tdata = ref *(teamPt + teamId); + ref var param = ref *(paramPt + teamId); + + if (updateIndex >= tdata.updateCount) + return; + if (tdata.IsProcess == false) + return; + if (tdata.ParticleCount == 0) + return; + + // 範ċ›² + var chunk = MathUtility.GetWorkerChunk(tdata.particleChunk.dataLength, workerCount, workerIndex); + if (chunk.IsValid == false) + return; + + TriangleBendingConstraint.SumConstraint( + //new DataChunk(0, tdata.particleChunk.dataLength), + chunk, + // team + ref tdata, + ref param, + // vmesh + ref attributes, + // particle + ref nextPosArray, + // buffer2 + ref tempVectorBufferA, + ref tempCountBuffer + ); + + // ‚³ƒİ‚¤ƒ€ƒĵ‚³ƒŞ‚¸ƒ§ƒ³ + if (tdata.UseColliderCount > 0 && param.colliderCollisionConstraint.mode == ColliderCollisionConstraint.Mode.Point) + { + // Point‚³ƒŞ‚¸ƒ§ƒ³ + ColliderCollisionConstraint.SolverPointConstraint( + //new DataChunk(0, tdata.particleChunk.dataLength), + chunk, + // team + ref tdata, + ref param, + // vmesh + ref attributes, + ref depthArray, + // particle + ref nextPosArray, + ref frictionArray, + ref collisionNormalArray, + ref velocityPosArray, + ref basePosArray, + // collider + ref colliderFlagArray, + ref colliderWorkDataArray + ); + } + } + } + + /// + /// ‚³ƒİ‚¤ƒ€ƒĵ‚³ƒŞ‚¸ƒ§ƒ³Edge + /// + [BurstCompile] + unsafe struct SplitStep_Edge_Job : IJobParallelFor + { + public int workerCount; + public int updateIndex; + public float4 simulationPower; + + // team + [Unity.Collections.ReadOnly] + public NativeList batchSelfTeamList; + [Unity.Collections.ReadOnly] + public NativeArray teamDataArray; + [Unity.Collections.ReadOnly] + public NativeArray parameterArray; + + // vmesh + [Unity.Collections.ReadOnly] + public NativeArray attributes; + [Unity.Collections.ReadOnly] + public NativeArray depthArray; + [Unity.Collections.ReadOnly] + public NativeArray edges; + + // particle + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray nextPosArray; + + // collider + [Unity.Collections.ReadOnly] + public NativeArray colliderFlagArray; + [Unity.Collections.ReadOnly] + public NativeArray colliderWorkDataArray; + + // buffer2 + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray tempVectorBufferA; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray tempVectorBufferB; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray tempCountBuffer; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray tempFloatBufferA; + + // ƒƒƒƒċ†…ƒ­ƒĵ‚ЃЃƒĵƒ ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı”¨ + // ƒŻƒĵ‚Ѓĵċˆ†ċ‰² + public void Execute(int index) + { + // ƒƒĵƒ ID¨ƒŻƒĵ‚ЃĵID + int localIndex = index / workerCount; + int workerIndex = index % workerCount; + + // ċ„ƒ™ƒĵ‚ıƒ‚¤ƒ³‚ż + TeamManager.TeamData* teamPt = (TeamManager.TeamData*)teamDataArray.GetUnsafeReadOnlyPtr(); + ClothParameters* paramPt = (ClothParameters*)parameterArray.GetUnsafeReadOnlyPtr(); + + int teamId = batchSelfTeamList[localIndex]; + ref var tdata = ref *(teamPt + teamId); + ref var param = ref *(paramPt + teamId); + + if (updateIndex >= tdata.updateCount) + return; + if (tdata.IsProcess == false) + return; + if (tdata.ParticleCount == 0) + return; + + // ‚³ƒİ‚¤ƒ€ƒĵ‚³ƒŞ‚¸ƒ§ƒ³ + if (tdata.UseColliderCount > 0 && param.colliderCollisionConstraint.mode == ColliderCollisionConstraint.Mode.Edge) + { + // 範ċ›² + var chunk = MathUtility.GetWorkerChunk(tdata.proxyEdgeChunk.dataLength, workerCount, workerIndex); + if (chunk.IsValid == false) + return; + + // Edge‚³ƒŞ‚¸ƒ§ƒ³ + ColliderCollisionConstraint.SolverEdgeConstraint( + //new DataChunk(0, tdata.proxyEdgeChunk.dataLength), + chunk, + // team + ref tdata, + ref param, + // vmesh + ref attributes, + ref depthArray, + ref edges, + // particle + ref nextPosArray, + // collider + ref colliderFlagArray, + ref colliderWorkDataArray, + // buffer2 + ref tempVectorBufferA, + ref tempVectorBufferB, + ref tempCountBuffer, + ref tempFloatBufferA + ); + } + } + } + + /// + /// ■‚ğƒĞƒ•‚³ƒŞ‚¸ƒ§ƒ³‚‚Š + /// ‚³ƒİ‚¤ƒ€ƒĵ‚³ƒŞ‚¸ƒ§ƒ³Edge集計 + /// è·é›˘ + /// ƒ˘ƒĵ‚·ƒ§ƒ³ + /// + [BurstCompile] + unsafe struct SplitStep_F_Self_Job : IJobParallelFor + { + public int workerCount; + public int updateIndex; + public float4 simulationPower; + + // team + [Unity.Collections.ReadOnly] + public NativeList batchSelfTeamList; + [Unity.Collections.ReadOnly] + public NativeArray teamDataArray; + [Unity.Collections.ReadOnly] + public NativeArray parameterArray; + + // vmesh + [Unity.Collections.ReadOnly] + public NativeArray attributes; + [Unity.Collections.ReadOnly] + public NativeArray depthArray; + + // particle + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray nextPosArray; + [Unity.Collections.ReadOnly] + public NativeArray basePosArray; + [Unity.Collections.ReadOnly] + public NativeArray baseRotArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray velocityPosArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray frictionArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray collisionNormalArray; + + // distance + [Unity.Collections.ReadOnly] + public NativeArray distanceIndexArray; + [Unity.Collections.ReadOnly] + public NativeArray distanceDataArray; + [Unity.Collections.ReadOnly] + public NativeArray distanceDistanceArray; + + // buffer2 + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray tempVectorBufferA; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray tempVectorBufferB; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray tempCountBuffer; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray tempFloatBufferA; + + // ƒƒƒƒċ†…ƒ­ƒĵ‚ЃЃƒĵƒ ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı”¨ + // ƒŻƒĵ‚Ѓĵċˆ†ċ‰² + public void Execute(int index) + { + // ƒƒĵƒ ID¨ƒŻƒĵ‚ЃĵID + int localIndex = index / workerCount; + int workerIndex = index % workerCount; + + // ċ„ƒ™ƒĵ‚ıƒ‚¤ƒ³‚ż + TeamManager.TeamData* teamPt = (TeamManager.TeamData*)teamDataArray.GetUnsafeReadOnlyPtr(); + ClothParameters* paramPt = (ClothParameters*)parameterArray.GetUnsafeReadOnlyPtr(); + + int teamId = batchSelfTeamList[localIndex]; + ref var tdata = ref *(teamPt + teamId); + ref var param = ref *(paramPt + teamId); + + if (updateIndex >= tdata.updateCount) + return; + if (tdata.IsProcess == false) + return; + if (tdata.ParticleCount == 0) + return; + + // 範ċ›² + var chunk = MathUtility.GetWorkerChunk(tdata.particleChunk.dataLength, workerCount, workerIndex); + if (chunk.IsValid == false) + return; + + // ‚³ƒİ‚¤ƒ€ƒĵ‚³ƒŞ‚¸ƒ§ƒ³ + if (tdata.UseColliderCount > 0 && param.colliderCollisionConstraint.mode == ColliderCollisionConstraint.Mode.Edge) + { + // Edge‚³ƒŞ‚¸ƒ§ƒ³é›†è¨ˆ + ColliderCollisionConstraint.SumEdgeConstraint( + //new DataChunk(0, tdata.particleChunk.dataLength), + chunk, + // team + ref tdata, + ref param, + // particle + ref nextPosArray, + ref frictionArray, + ref collisionNormalArray, + // buffer2 + ref tempVectorBufferA, + ref tempVectorBufferB, + ref tempCountBuffer, + ref tempFloatBufferA + ); + } + + // ‚³ƒİ‚¤ƒ€ƒĵèĦçށċŒŻƒ‘ƒĵƒ†‚£‚ŻƒĞŒäıħ‚Œ‚‹ċŻèƒ½ĉ€§Œ‚‚‹Ÿ‚‚‚†ä¸€ċşĤè·é›˘ċˆĥ約§ĉ•´ˆ‚‹€‚ + // “‚ŒŻè£èż”‚Šé˜²ĉ­˘ŞİĞċŠıĉžœċ¤§€‚ + DistanceConstraint.SolverConstraint( + //new DataChunk(0, tdata.particleChunk.dataLength), + chunk, + simulationPower, + // team + ref tdata, + ref param, + // vmesh + ref attributes, + ref depthArray, + // particle + ref nextPosArray, + ref basePosArray, + ref velocityPosArray, + ref frictionArray, + // constraint + ref distanceIndexArray, + ref distanceDataArray, + ref distanceDistanceArray + ); + + // ƒ˘ƒĵ‚·ƒ§ƒ³ċˆĥ約Ż‚³ƒİ‚¤ƒ€ƒĵ‚ˆ‚Šċ„Şċ…ˆ + MotionConstraint.SolverConstraint( + //new DataChunk(0, tdata.particleChunk.dataLength), + chunk, + // team + ref tdata, + ref param, + // vmesh + ref attributes, + ref depthArray, + // particle + ref basePosArray, + ref baseRotArray, + ref nextPosArray, + ref velocityPosArray, + ref frictionArray, + ref collisionNormalArray + ); + } + } + + /// + /// ■‚ğƒĞƒ•‚³ƒŞ‚¸ƒ§ƒ³‚‚Š + /// ċş§ĉ¨™ç˘şċš + /// ‚³ƒİ‚¤ƒ€ƒĵċŒĉ›´ĉ–° + /// + [BurstCompile] + unsafe struct SplitStep_G_Self_Job : IJobParallelFor + { + public int workerCount; + public int updateIndex; + public float simulationDeltaTime; + + // team + [Unity.Collections.ReadOnly] + public NativeList batchSelfTeamList; + [Unity.Collections.ReadOnly] + public NativeArray teamDataArray; + [Unity.Collections.ReadOnly] + public NativeArray centerDataArray; + [Unity.Collections.ReadOnly] + public NativeArray parameterArray; + + // vmesh + [Unity.Collections.ReadOnly] + public NativeArray attributes; + [Unity.Collections.ReadOnly] + public NativeArray depthArray; + + // particle + [Unity.Collections.ReadOnly] + public NativeArray nextPosArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray oldPosArray; + [Unity.Collections.ReadOnly] + public NativeArray velocityPosArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray velocityArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray realVelocityArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray frictionArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray staticFrictionArray; + [Unity.Collections.ReadOnly] + public NativeArray collisionNormalArray; + + // collider + [Unity.Collections.ReadOnly] + public NativeArray colliderNowPositions; + [Unity.Collections.ReadOnly] + public NativeArray colliderNowRotations; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray colliderOldPositions; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray colliderOldRotations; + + // ƒƒƒƒċ†…ƒ­ƒĵ‚ЃЃƒĵƒ ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı”¨ + // ƒŻƒĵ‚Ѓĵċˆ†ċ‰² + public void Execute(int index) + { + // ƒƒĵƒ ID¨ƒŻƒĵ‚ЃĵID + int localIndex = index / workerCount; + int workerIndex = index % workerCount; + + // ċ„ƒ™ƒĵ‚ıƒ‚¤ƒ³‚ż + TeamManager.TeamData* teamPt = (TeamManager.TeamData*)teamDataArray.GetUnsafeReadOnlyPtr(); + ClothParameters* paramPt = (ClothParameters*)parameterArray.GetUnsafeReadOnlyPtr(); + InertiaConstraint.CenterData* centerPt = (InertiaConstraint.CenterData*)centerDataArray.GetUnsafeReadOnlyPtr(); + + int teamId = batchSelfTeamList[localIndex]; + ref var tdata = ref *(teamPt + teamId); + ref var cdata = ref *(centerPt + teamId); + ref var param = ref *(paramPt + teamId); + + if (updateIndex >= tdata.updateCount) + return; + if (tdata.IsProcess == false) + return; + if (tdata.ParticleCount == 0) + return; + + // 範ċ›² + var chunk = MathUtility.GetWorkerChunk(tdata.particleChunk.dataLength, workerCount, workerIndex); + if (chunk.IsValid) + { + // ċş§ĉ¨™ç˘şċš + SimulationStepPostTeam( + chunk, + simulationDeltaTime, + // team + teamId, + ref tdata, + ref cdata, + ref param, + // vmesh + ref attributes, + ref depthArray, + // particle + ref oldPosArray, + ref velocityArray, + ref nextPosArray, + ref velocityPosArray, + ref frictionArray, + ref staticFrictionArray, + ref collisionNormalArray, + ref realVelocityArray + ); + } + + // ‚³ƒİ‚¤ƒ€ƒĵċŒĉ›´ĉ–° + var colChunk = MathUtility.GetWorkerChunk(tdata.colliderChunk.dataLength, workerCount, workerIndex); + if (colChunk.IsValid) + { + ColliderManager.SimulationEndStep( + colChunk, + // team + ref tdata, + // collider + ref colliderNowPositions, + ref colliderNowRotations, + ref colliderOldPositions, + ref colliderOldRotations + ); + } + } + } + + /// + /// ■‚ğƒĞƒ•‚³ƒŞ‚¸ƒ§ƒ³Ş— + /// ‚³ƒİ‚¤ƒ€ƒĵ‚³ƒŞ‚¸ƒ§ƒ³Edge集計 + /// è·é›˘ + /// ƒ˘ƒĵ‚·ƒ§ƒ³ + /// ċş§ĉ¨™ç˘şċš + /// ‚³ƒİ‚¤ƒ€ƒĵċŒĉ›´ĉ–° + /// + [BurstCompile] + unsafe struct SplitStep_FG_NoSelf_Job : IJobParallelFor + { + public int workerCount; + public int updateIndex; + public float4 simulationPower; + public float simulationDeltaTime; + + // team + [Unity.Collections.ReadOnly] + public NativeList batchSelfTeamList; + [Unity.Collections.ReadOnly] + public NativeArray teamDataArray; + [Unity.Collections.ReadOnly] + public NativeArray centerDataArray; + [Unity.Collections.ReadOnly] + public NativeArray parameterArray; + + // vmesh + [Unity.Collections.ReadOnly] + public NativeArray attributes; + [Unity.Collections.ReadOnly] + public NativeArray depthArray; + + // particle + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray nextPosArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray oldPosArray; + [Unity.Collections.ReadOnly] + public NativeArray basePosArray; + [Unity.Collections.ReadOnly] + public NativeArray baseRotArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray velocityPosArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray velocityArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray realVelocityArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray frictionArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray staticFrictionArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray collisionNormalArray; + + // collider + [Unity.Collections.ReadOnly] + public NativeArray colliderNowPositions; + [Unity.Collections.ReadOnly] + public NativeArray colliderNowRotations; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray colliderOldPositions; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray colliderOldRotations; + + // distance + [Unity.Collections.ReadOnly] + public NativeArray distanceIndexArray; + [Unity.Collections.ReadOnly] + public NativeArray distanceDataArray; + [Unity.Collections.ReadOnly] + public NativeArray distanceDistanceArray; + + // buffer2 + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray tempVectorBufferA; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray tempVectorBufferB; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray tempCountBuffer; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray tempFloatBufferA; + + // ƒƒƒƒċ†…ƒ­ƒĵ‚ЃЃƒĵƒ ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı”¨ + // ƒŻƒĵ‚Ѓĵċˆ†ċ‰² + public void Execute(int index) + { + // ƒƒĵƒ ID¨ƒŻƒĵ‚ЃĵID + int localIndex = index / workerCount; + int workerIndex = index % workerCount; + + // ċ„ƒ™ƒĵ‚ıƒ‚¤ƒ³‚ż + TeamManager.TeamData* teamPt = (TeamManager.TeamData*)teamDataArray.GetUnsafeReadOnlyPtr(); + ClothParameters* paramPt = (ClothParameters*)parameterArray.GetUnsafeReadOnlyPtr(); + InertiaConstraint.CenterData* centerPt = (InertiaConstraint.CenterData*)centerDataArray.GetUnsafeReadOnlyPtr(); + + int teamId = batchSelfTeamList[localIndex]; + ref var tdata = ref *(teamPt + teamId); + ref var cdata = ref *(centerPt + teamId); + ref var param = ref *(paramPt + teamId); + + if (updateIndex >= tdata.updateCount) + return; + if (tdata.IsProcess == false) + return; + if (tdata.ParticleCount == 0) + return; + + // 範ċ›² + var chunk = MathUtility.GetWorkerChunk(tdata.particleChunk.dataLength, workerCount, workerIndex); + if (chunk.IsValid) + { + // ‚³ƒİ‚¤ƒ€ƒĵ‚³ƒŞ‚¸ƒ§ƒ³ + if (tdata.UseColliderCount > 0 && param.colliderCollisionConstraint.mode == ColliderCollisionConstraint.Mode.Edge) + { + // Edge‚³ƒŞ‚¸ƒ§ƒ³é›†è¨ˆ + ColliderCollisionConstraint.SumEdgeConstraint( + //new DataChunk(0, tdata.particleChunk.dataLength), + chunk, + // team + ref tdata, + ref param, + // particle + ref nextPosArray, + ref frictionArray, + ref collisionNormalArray, + // buffer2 + ref tempVectorBufferA, + ref tempVectorBufferB, + ref tempCountBuffer, + ref tempFloatBufferA + ); + } + + // ‚³ƒİ‚¤ƒ€ƒĵèĦçށċŒŻƒ‘ƒĵƒ†‚£‚ŻƒĞŒäıħ‚Œ‚‹ċŻèƒ½ĉ€§Œ‚‚‹Ÿ‚‚‚†ä¸€ċşĤè·é›˘ċˆĥ約§ĉ•´ˆ‚‹€‚ + // “‚ŒŻè£èż”‚Šé˜²ĉ­˘ŞİĞċŠıĉžœċ¤§€‚ + DistanceConstraint.SolverConstraint( + //new DataChunk(0, tdata.particleChunk.dataLength), + chunk, + simulationPower, + // team + ref tdata, + ref param, + // vmesh + ref attributes, + ref depthArray, + // particle + ref nextPosArray, + ref basePosArray, + ref velocityPosArray, + ref frictionArray, + // constraint + ref distanceIndexArray, + ref distanceDataArray, + ref distanceDistanceArray + ); + + // ƒ˘ƒĵ‚·ƒ§ƒ³ċˆĥ約Ż‚³ƒİ‚¤ƒ€ƒĵ‚ˆ‚Šċ„Şċ…ˆ + MotionConstraint.SolverConstraint( + //new DataChunk(0, tdata.particleChunk.dataLength), + chunk, + // team + ref tdata, + ref param, + // vmesh + ref attributes, + ref depthArray, + // particle + ref basePosArray, + ref baseRotArray, + ref nextPosArray, + ref velocityPosArray, + ref frictionArray, + ref collisionNormalArray + ); + + // ċş§ĉ¨™ç˘şċš + SimulationStepPostTeam( + chunk, + simulationDeltaTime, + // team + teamId, + ref tdata, + ref cdata, + ref param, + // vmesh + ref attributes, + ref depthArray, + // particle + ref oldPosArray, + ref velocityArray, + ref nextPosArray, + ref velocityPosArray, + ref frictionArray, + ref staticFrictionArray, + ref collisionNormalArray, + ref realVelocityArray + ); + } + + // ‚³ƒİ‚¤ƒ€ƒĵċŒĉ›´ĉ–° + var colChunk = MathUtility.GetWorkerChunk(tdata.colliderChunk.dataLength, workerCount, workerIndex); + if (colChunk.IsValid) + { + ColliderManager.SimulationEndStep( + colChunk, + // team + ref tdata, + // collider + ref colliderNowPositions, + ref colliderNowRotations, + ref colliderOldPositions, + ref colliderOldRotations + ); + } + } + } + + /// + /// èĦ¨ç¤şä½ç½è¨ˆç— + /// + [BurstCompile] + unsafe struct SplitPost_DisplayPos_Job : IJobParallelFor + { + public int workerCount; + public float simulationDeltaTime; + + // team + [Unity.Collections.ReadOnly] + public NativeList batchSelfTeamList; + [Unity.Collections.ReadOnly] + public NativeArray teamDataArray; + + // vmesh + [Unity.Collections.ReadOnly] + public NativeArray attributes; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray positions; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray rotations; + [Unity.Collections.ReadOnly] + public NativeArray vertexRootIndices; + + // particle + [Unity.Collections.ReadOnly] + public NativeArray oldPosArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray oldPositionArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray oldRotationArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray dispPosArray; + [Unity.Collections.ReadOnly] + public NativeArray realVelocityArray; + + // temp + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray tempVectorBufferA; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray tempRotationBufferA; + + // ƒƒƒƒċ†…ƒ­ƒĵ‚ЃЃƒĵƒ ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı”¨ + // ƒŻƒĵ‚Ѓĵċˆ†ċ‰² + public void Execute(int index) + { + // ƒƒĵƒ ID¨ƒŻƒĵ‚ЃĵID + int localIndex = index / workerCount; + int workerIndex = index % workerCount; + + // ċ„ƒ™ƒĵ‚ıƒ‚¤ƒ³‚ż + TeamManager.TeamData* teamPt = (TeamManager.TeamData*)teamDataArray.GetUnsafeReadOnlyPtr(); + + int teamId = batchSelfTeamList[localIndex]; + ref var tdata = ref *(teamPt + teamId); + + if (tdata.IsProcess == false) + return; + if (tdata.ParticleCount == 0) + return; + + // ■èĦ¨ç¤şä½ç½ĉħşċš + // 範ċ›² + var chunk = MathUtility.GetWorkerChunk(tdata.particleChunk.dataLength, workerCount, workerIndex); + //Debug.Log($"localIndex:{localIndex}, workerIndex:{workerIndex}, workerCount:{workerCount}, chun.s:{chunk.startIndex}, chun.l:{chunk.dataLength}"); + if (chunk.IsValid) + { + SimulationCalcDisplayPosition( + chunk, + simulationDeltaTime, + // team + ref tdata, + // particle + ref oldPosArray, + ref realVelocityArray, + ref oldPositionArray, + ref oldRotationArray, + ref dispPosArray, + // vmesh + ref attributes, + ref positions, + ref rotations, + ref vertexRootIndices, + // temp + ref tempVectorBufferA, + ref tempRotationBufferA + ); + } + } + } + + /// + /// ‚Żƒ­‚ı‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³çµĉžœ‚’ProxyMesh¸ċĉ˜ •›‚‹ + /// ƒİ‚¤ƒ³Œ‚‚‹ċ ´ċˆŻƒ™ƒĵ‚ıƒİ‚¤ƒ³”¨Ğċ§żċ‹˘‚’ĉ•´ˆ‚‹ + /// + [BurstCompile] + unsafe struct SplitPost_CalcProxy_Job : IJobParallelFor + { + public int workerCount; + + // team + [Unity.Collections.ReadOnly] + public NativeList batchSelfTeamList; + [Unity.Collections.ReadOnly] + public NativeArray teamDataArray; + [Unity.Collections.ReadOnly] + public NativeArray parameterArray; + + // vmesh + [Unity.Collections.ReadOnly] + public NativeArray attributes; + [Unity.Collections.ReadOnly] + public NativeArray positions; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray rotations; + [Unity.Collections.ReadOnly] + public NativeArray baseLineStartDataIndices; + [Unity.Collections.ReadOnly] + public NativeArray baseLineDataCounts; + [Unity.Collections.ReadOnly] + public NativeArray baseLineData; + [Unity.Collections.ReadOnly] + public NativeArray vertexLocalPositions; + [Unity.Collections.ReadOnly] + public NativeArray vertexLocalRotations; + [Unity.Collections.ReadOnly] + public NativeArray vertexChildIndexArray; + [Unity.Collections.ReadOnly] + public NativeArray vertexChildDataArray; + [Unity.Collections.ReadOnly] + public NativeArray baseLineFlags; + + // temp + [Unity.Collections.ReadOnly] + public NativeArray tempVectorBufferA; + [Unity.Collections.ReadOnly] + public NativeArray tempRotationBufferB; + + // ƒƒƒƒċ†…ƒ­ƒĵ‚ЃЃƒĵƒ ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı”¨ + // ƒŻƒĵ‚Ѓĵċˆ†ċ‰² + public void Execute(int index) + { + // ƒƒĵƒ ID¨ƒŻƒĵ‚ЃĵID + int localIndex = index / workerCount; + int workerIndex = index % workerCount; + + // ċ„ƒ™ƒĵ‚ıƒ‚¤ƒ³‚ż + TeamManager.TeamData* teamPt = (TeamManager.TeamData*)teamDataArray.GetUnsafeReadOnlyPtr(); + ClothParameters* paramPt = (ClothParameters*)parameterArray.GetUnsafeReadOnlyPtr(); + + int teamId = batchSelfTeamList[localIndex]; + ref var tdata = ref *(teamPt + teamId); + ref var param = ref *(paramPt + teamId); + + if (tdata.IsProcess == false) + return; + if (tdata.ParticleCount == 0) + return; + + // ■‚Żƒ­‚ı‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ċŒé ‚ç‚ıċ§żċ‹˘è¨ˆç— + // ƒİ‚¤ƒ³Œ‚‚‹ċ ´ċˆŻƒ™ƒĵ‚ıƒİ‚¤ƒ³”¨Ğċ§żċ‹˘‚’ĉ•´ˆ‚‹ + // 範ċ›² + var chunk = MathUtility.GetWorkerChunk(tdata.baseLineChunk.dataLength, workerCount, workerIndex); + if (chunk.IsValid) + { + VirtualMeshManager.SimulationPostProxyMeshUpdateLine( + chunk, + // team + ref tdata, + ref param, + // vmesh + ref attributes, + ref positions, + ref rotations, + ref vertexLocalPositions, + ref vertexLocalRotations, + ref vertexChildIndexArray, + ref vertexChildDataArray, + ref baseLineFlags, + ref baseLineStartDataIndices, + ref baseLineDataCounts, + ref baseLineData, + // temp + ref tempVectorBufferA, + ref tempRotationBufferB + ); + } + } + } + + /// + /// ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĉ³•ç·šĉŽç·š‚’ĉħ‚‚‚‹ + /// + [BurstCompile] + unsafe struct SplitPost_CalcProxyTriangle_Job : IJobParallelFor + { + public int workerCount; + + // team + [Unity.Collections.ReadOnly] + public NativeList batchSelfTeamList; + [Unity.Collections.ReadOnly] + public NativeArray teamDataArray; + + // vmesh + [Unity.Collections.ReadOnly] + public NativeArray positions; + [Unity.Collections.ReadOnly] + public NativeArray triangles; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray triangleNormals; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray triangleTangents; + [Unity.Collections.ReadOnly] + public NativeArray uvs; + + // ƒƒƒƒċ†…ƒ­ƒĵ‚ЃЃƒĵƒ ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı”¨ + // ƒŻƒĵ‚Ѓĵċˆ†ċ‰² + public void Execute(int index) + { + // ƒƒĵƒ ID¨ƒŻƒĵ‚ЃĵID + int localIndex = index / workerCount; + int workerIndex = index % workerCount; + + // ċ„ƒ™ƒĵ‚ıƒ‚¤ƒ³‚ż + TeamManager.TeamData* teamPt = (TeamManager.TeamData*)teamDataArray.GetUnsafeReadOnlyPtr(); + + int teamId = batchSelfTeamList[localIndex]; + ref var tdata = ref *(teamPt + teamId); + + if (tdata.IsProcess == false) + return; + if (tdata.ParticleCount == 0) + return; + + // ■‚Żƒ­‚ı‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ċŒé ‚ç‚ıċ§żċ‹˘è¨ˆç— + // ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĉ³•ç·šĉŽç·š‚’ĉħ‚‚‚‹ + // 範ċ›² + var chunk = MathUtility.GetWorkerChunk(tdata.proxyTriangleChunk.dataLength, workerCount, workerIndex); + if (chunk.IsValid) + { + VirtualMeshManager.SimulationPostProxyMeshUpdateTriangle( + chunk, + // team + ref tdata, + // vmesh + ref positions, + ref triangles, + ref triangleNormals, + ref triangleTangents, + ref uvs + ); + } + } + } + + /// + /// ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĉ³•ç·šĉŽç·š‹‚‰é ‚ç‚ıċ§żċ‹˘‚’ĉħ‚‚‚‹ + /// BoneClothċ ´ċˆŻé ‚ç‚ıċ§żċ‹˘‹‚‰é€£ċ‹•™‚‹ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ƒŻƒĵƒĞƒ‰ċ§żċ‹˘‚’計痁™‚‹ + /// + [BurstCompile] + unsafe struct SplitPost_SumProxyTriangleAndTransform_Job : IJobParallelFor + { + public int workerCount; + + // team + [Unity.Collections.ReadOnly] + public NativeList batchSelfTeamList; + [Unity.Collections.ReadOnly] + public NativeArray teamDataArray; + + // transform + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray transformPositionArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray transformRotationArray; + + // vmesh + [Unity.Collections.ReadOnly] + public NativeArray positions; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray rotations; + [Unity.Collections.ReadOnly] + public NativeArray triangleNormals; + [Unity.Collections.ReadOnly] + public NativeArray triangleTangents; + [Unity.Collections.ReadOnly] + public NativeArray> vertexToTriangles; + [Unity.Collections.ReadOnly] + public NativeArray normalAdjustmentRotations; + [Unity.Collections.ReadOnly] + public NativeArray vertexToTransformRotations; + + // ƒƒƒƒċ†…ƒ­ƒĵ‚ЃЃƒĵƒ ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı”¨ + // ƒŻƒĵ‚Ѓĵċˆ†ċ‰² + public void Execute(int index) + { + // ƒƒĵƒ ID¨ƒŻƒĵ‚ЃĵID + int localIndex = index / workerCount; + int workerIndex = index % workerCount; + + // ċ„ƒ™ƒĵ‚ıƒ‚¤ƒ³‚ż + TeamManager.TeamData* teamPt = (TeamManager.TeamData*)teamDataArray.GetUnsafeReadOnlyPtr(); + + int teamId = batchSelfTeamList[localIndex]; + ref var tdata = ref *(teamPt + teamId); + + if (tdata.IsProcess == false) + return; + if (tdata.ParticleCount == 0) + return; + + // 範ċ›² + var chunk = MathUtility.GetWorkerChunk(tdata.proxyCommonChunk.dataLength, workerCount, workerIndex); + if (chunk.IsValid) + { + // ■‚Żƒ­‚ı‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ċŒé ‚ç‚ıċ§żċ‹˘è¨ˆç— + // ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĉ³•ç·šĉŽç·š‹‚‰é ‚ç‚ıċ§żċ‹˘‚’ĉħ‚‚‚‹ + VirtualMeshManager.SimulationPostProxyMeshUpdateTriangleSum( + chunk, + // team + ref tdata, + // vmesh + ref rotations, + ref triangleNormals, + ref triangleTangents, + ref vertexToTriangles, + ref normalAdjustmentRotations + ); + // BoneClothċ ´ċˆŻé ‚ç‚ıċ§żċ‹˘‹‚‰é€£ċ‹•™‚‹ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ƒŻƒĵƒĞƒ‰ċ§żċ‹˘‚’計痁™‚‹ + VirtualMeshManager.SimulationPostProxyMeshUpdateWorldTransform( + chunk, + // team + ref tdata, + // vmesh + ref positions, + ref rotations, + ref vertexToTransformRotations, + // transform + ref transformPositionArray, + ref transformRotationArray + ); + } + } + } + + /// + /// ƒƒĵƒ ĉ›´ĉ–°ċŒċ‡Ĥ理 + /// BoneClothċ ´ċˆŻTransformƒ­ƒĵ‚ЃĞċ§żċ‹˘‚’計痁™‚‹ + /// ‚³ƒİ‚¤ƒ€ƒĵĉ›´ĉ–°ċŒċ‡Ĥ理 + /// + [BurstCompile] + unsafe struct SplitPost_TeamCollider_Job : IJobParallelFor + { + public float simulationDeltaTime; + + // team + [Unity.Collections.ReadOnly] + public NativeList batchSelfTeamList; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray teamDataArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray centerDataArray; + + // collider + [Unity.Collections.ReadOnly] + public NativeArray colliderFramePositions; + [Unity.Collections.ReadOnly] + public NativeArray colliderFrameRotations; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray colliderOldFramePositions; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray colliderOldFrameRotations; + + // transform + [Unity.Collections.ReadOnly] + public NativeArray transformPositionArray; + [Unity.Collections.ReadOnly] + public NativeArray transformRotationArray; + [Unity.Collections.ReadOnly] + public NativeArray transformScaleArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray transformLocalPositionArray; + [NativeDisableParallelForRestriction] + [NativeDisableContainerSafetyRestriction] + public NativeArray transformLocalRotationArray; + + // vmesh + [Unity.Collections.ReadOnly] + public NativeArray attributes; + [Unity.Collections.ReadOnly] + public NativeArray vertexParentIndices; + + // ƒƒƒƒċ†…ƒ­ƒĵ‚ЃЃƒĵƒ ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı”¨ + public void Execute(int localIndex) + { + // ċ„ƒ™ƒĵ‚ıƒ‚¤ƒ³‚ż + TeamManager.TeamData* teamPt = (TeamManager.TeamData*)teamDataArray.GetUnsafePtr(); + InertiaConstraint.CenterData* centerPt = (InertiaConstraint.CenterData*)centerDataArray.GetUnsafePtr(); + + int teamId = batchSelfTeamList[localIndex]; + ref var tdata = ref *(teamPt + teamId); + ref var cdata = ref *(centerPt + teamId); + + if (tdata.IsProcess == false) + return; + if (tdata.ParticleCount == 0) + return; + + // BoneClothċ ´ċˆŻTransformƒ­ƒĵ‚ЃĞċ§żċ‹˘‚’計痁™‚‹ + VirtualMeshManager.SimulationPostProxyMeshUpdateLocalTransform( + // team + ref tdata, + // vmesh + ref attributes, + ref vertexParentIndices, + // transform + ref transformPositionArray, + ref transformRotationArray, + ref transformScaleArray, + ref transformLocalPositionArray, + ref transformLocalRotationArray + ); + + // ■‚³ƒİ‚¤ƒ€ƒĵĉ›´ĉ–°ċŒċ‡Ĥ理 + ColliderManager.SimulationPostUpdate( + // team + ref tdata, + // collider + ref colliderFramePositions, + ref colliderFrameRotations, + ref colliderOldFramePositions, + ref colliderOldFrameRotations + ); + + // ■ƒƒĵƒ ĉ›´ĉ–°ċŒċ‡Ĥ理 + TeamManager.SimulationPostTeamUpdate( + // team + ref tdata, + ref cdata + ); + } + } + } +} + diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/Simulation/SimulationManagerSplit.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Manager/Simulation/SimulationManagerSplit.cs.meta new file mode 100644 index 00000000..be6953bd --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/Simulation/SimulationManagerSplit.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 2dd0faec9645ac1499b7eceb32ba4f10 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Manager/Simulation/SimulationManagerSplit.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/Simulation/TimeManager.cs b/Assets/MagicaCloth2/Scripts/Core/Manager/Simulation/TimeManager.cs new file mode 100644 index 00000000..bcd979e0 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/Simulation/TimeManager.cs @@ -0,0 +1,159 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System.Text; +using Unity.Mathematics; +using UnityEngine; + +namespace MagicaCloth2 +{ + public class TimeManager : IManager, IValid + { + /// + /// ‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ĉ›´ĉ–°ċ‘¨ĉœŸ + /// ïĵ‘‚ıƒ†ƒƒƒ—§(1.0 / simulationFrequency)ĉ™‚間進ż™ + /// + internal int simulationFrequency = Define.System.DefaultSimulationFrequency; + + /// + /// 1ƒ•ƒĴƒĵƒ ĞċŸèĦŒ•‚Œ‚‹ĉœ€ċ¤§‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ċ›žĉ•° + /// + internal int maxSimulationCountPerFrame = Define.System.DefaultMaxSimulationCountPerFrame; + + /// + /// ƒžƒƒĵ‚¸ƒ£ĉ›´ĉ–°ċ ´ĉ‰€ + /// + public enum UpdateLocation + { + AfterLateUpdate = 0, + BeforeLateUpdate = 1, + } + internal UpdateLocation updateLocation = UpdateLocation.AfterLateUpdate; + + //========================================================================================= + bool isValid = false; + + /// + /// ƒ•ƒĴƒĵƒ FixedUpdateċ›žĉ•° + /// + internal int FixedUpdateCount { get; private set; } + + /// + /// ‚°ƒ­ƒĵƒƒĞ‚ż‚¤ƒ ‚ı‚ħƒĵƒĞ(0.0 ~ 1.0) + /// + internal float GlobalTimeScale = 1.0f; + + /// + /// ‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³1ċ›žĉ™‚é–“ + /// + internal float SimulationDeltaTime { get; private set; } + + /// + /// 1ƒ•ƒĴƒĵƒ ĉœ€ċ¤§ĉ›´ĉ–°ĉ™‚é–“ + /// + internal float MaxDeltaTime { get; private set; } + + /// + /// ċˆĥ約解ĉħşäż‚ĉ•°ïĵˆċ‘¨ĉ³˘ĉ•°Ğ‚ˆ‚Šċ¤‰ċ‹•ïĵ‰ + /// + internal float4 SimulationPower { get; private set; } + + //========================================================================================= + public void Dispose() + { + isValid = true; + + GlobalTimeScale = 1.0f; + FixedUpdateCount = 0; + SimulationPower = 1.0f; + + MagicaManager.afterFixedUpdateDelegate -= AfterFixedUpdate; + MagicaManager.afterRenderingDelegate -= AfterRenderring; + } + + public void EnterdEditMode() + { + Dispose(); + } + + public void Initialize() + { + GlobalTimeScale = 1.0f; + FixedUpdateCount = 0; + SimulationPower = 1.0f; + + MagicaManager.afterFixedUpdateDelegate += AfterFixedUpdate; + MagicaManager.afterRenderingDelegate += AfterRenderring; + + isValid = true; + } + + public bool IsValid() + { + return isValid; + } + + //========================================================================================= + void AfterFixedUpdate() + { + //Debug.Log($"AfterFixedUpdate. F:{Time.frameCount}"); + FixedUpdateCount++; + } + + void AfterRenderring() + { + //Debug.Log($"AfterRenderring. F:{Time.frameCount}"); + FixedUpdateCount = 0; + } + + //========================================================================================= + internal void FrameUpdate() + { + simulationFrequency = Mathf.Clamp(simulationFrequency, Define.System.SimulationFrequency_Low, Define.System.SimulationFrequency_Hi); + maxSimulationCountPerFrame = Mathf.Clamp(maxSimulationCountPerFrame, Define.System.MaxSimulationCountPerFrame_Low, Define.System.MaxSimulationCountPerFrame_Hi); + GlobalTimeScale = Mathf.Clamp01(GlobalTimeScale); + + // 1‚ıƒ†ƒƒƒ—‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ĉ›´ĉ–°ĉ™‚é–“ + SimulationDeltaTime = 1.0f / simulationFrequency; + + // 1ƒ•ƒĴƒĵƒ ĉœ€ċ¤§ĉ›´ĉ–°ĉ™‚é–“ + MaxDeltaTime = SimulationDeltaTime * maxSimulationCountPerFrame; + + // ċˆĥ約解ĉħşäż‚ĉ•° + float t = Define.System.DefaultSimulationFrequency / (float)simulationFrequency; + SimulationPower = new float4( + t, // (3.0 ~ 1.0 ~ 0.6) + t > 1.0f ? Mathf.Pow(t, 0.5f) : t, // (1.73 ~ 1.0 ~ 0.6) + t > 1.0f ? Mathf.Pow(t, 0.3f) : t, // (1.39 ~ 1.0 ~ 0.6) + //Mathf.Pow(t, 1.5f) // (5.19 ~ 1.0 ~ 0.46) + Mathf.Pow(t, 1.8f) // (7.22 ~ 1.0 ~ 0.39) + ); + //Debug.Log($"SimulationPower:{SimulationPower}"); + } + + //========================================================================================= + public void InformationLog(StringBuilder allsb) + { + StringBuilder sb = new StringBuilder(); + + sb.AppendLine($"========== Time Manager =========="); + if (IsValid() == false) + { + sb.AppendLine($"Time Manager. Invalid"); + } + else + { + sb.AppendLine($"SimulationFrequency:{simulationFrequency}"); + sb.AppendLine($"MaxSimulationCountPerFrame:{maxSimulationCountPerFrame}"); + sb.AppendLine($"GlobalTimeScale:{GlobalTimeScale}"); + sb.AppendLine($"SimulationDeltaTime:{SimulationDeltaTime}"); + //sb.AppendLine($"MaxDeltaTime:{MaxDeltaTime}"); + sb.AppendLine($"SimulationPower:{SimulationPower}"); + } + sb.AppendLine(); + + Debug.Log(sb.ToString()); + allsb.Append(sb); + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/Simulation/TimeManager.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Manager/Simulation/TimeManager.cs.meta new file mode 100644 index 00000000..661f85de --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/Simulation/TimeManager.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: e34158b4ab7aaea4b804388730e4f309 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Manager/Simulation/TimeManager.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/Simulation/WindManager.cs b/Assets/MagicaCloth2/Scripts/Core/Manager/Simulation/WindManager.cs new file mode 100644 index 00000000..b7c175e0 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/Simulation/WindManager.cs @@ -0,0 +1,229 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System.Collections.Generic; +using System.Text; +using Unity.Collections; +using Unity.Mathematics; +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// 風‚ƒĵƒ³çĦ理ƒžƒƒĵ‚¸ƒ£ + /// + public class WindManager : IManager, IValid + { + public const int Flag_Valid = 0; // ƒ‡ƒĵ‚żĉœ‰ċŠıĉ€§ + public const int Flag_Enable = 1; // ċ‹•作çŠĥĉ…‹ + public const int Flag_Addition = 2; // ċŠ ç—風 + + /// + /// 風‚ƒĵƒ³çĦ理ƒ‡ƒĵ‚ż + /// + public struct WindData + { + public BitField32 flag; + + public MagicaWindZone.Mode mode; + + /// + /// Global:(none) + /// Box :(x, y, z) + /// Sphere:(radius, radius, radius) + /// + public float3 size; + + public float main; + public float turbulence; + public float zoneVolume; + + public float3 worldWindDirection; + + public float3 worldPositin; + public quaternion worldRotation; + public float3 worldScale; + public float4x4 worldToLocalMatrix; + public float4x4 attenuation; + + public bool IsValid() => flag.IsSet(Flag_Valid); + public bool IsEnable() => flag.IsSet(Flag_Enable); + public bool IsAddition() => flag.IsSet(Flag_Addition); + } + public ExNativeArray windDataArray; + + public int WindCount => windDataArray?.Count ?? 0; + + bool isValid; + + /// + /// WindID¨‚ƒĵƒ³‚³ƒ³ƒƒĵƒƒ³ƒˆé–˘é€£èžĉ›¸ + /// + Dictionary windZoneDict = new Dictionary(); + + //========================================================================================= + public void Dispose() + { + isValid = false; + + windDataArray?.Dispose(); + } + + public void EnterdEditMode() + { + Dispose(); + } + + public void Initialize() + { + Dispose(); + + const int capacity = 64; + windDataArray = new ExNativeArray(capacity); + + isValid = true; + } + + public bool IsValid() + { + return isValid; + } + + //========================================================================================= + public int AddWind(MagicaWindZone windZone) + { + if (isValid == false || windZone == null) + return -1; + + var wind = new WindData(); + // ★Enableƒ•ƒİ‚°ŻçĞ‹ĤŞ„ + wind.flag.SetBits(Flag_Valid, true); + var c = windDataArray.Add(wind); + + windZoneDict.Add(c.startIndex, windZone); + + return c.startIndex; + } + + public void RemoveWind(int windId) + { + if (isValid == false || windId < 0) + return; + + var c = new DataChunk(windId); + windDataArray.RemoveAndFill(c); + + windZoneDict.Remove(c.startIndex); + } + + public void SetEnable(int windId, bool sw) + { + if (isValid == false || windId < 0) + return; + + var wind = windDataArray[windId]; + wind.flag.SetBits(Flag_Enable, sw); + windDataArray[windId] = wind; + } + + //========================================================================================= + /// + /// ĉŻŽƒ•ƒĴƒĵƒ ċ¸¸ĞċŸèĦŒ™‚‹ĉ›´ĉ–° + /// + internal void AlwaysWindUpdate() + { + // ‚¸ƒ§ƒ–§ŻċŸèĦŒ§Ş„風‚ƒĵƒ³ĉ›´ĉ–° + foreach (var kv in windZoneDict) + { + int windId = kv.Key; + var windZone = kv.Value; + + if (windId < 0 || windZone == null) + continue; + + var t = windZone.transform; + + // ‚³ƒ³ƒƒĵƒƒ³ƒˆƒ‡ƒĵ‚ż‚³ƒ”ƒĵ + ref var wind = ref windDataArray.GetRef(windId); + wind.mode = windZone.mode; + switch (windZone.mode) + { + case MagicaWindZone.Mode.BoxDirection: + wind.size = windZone.size; + break; + case MagicaWindZone.Mode.SphereDirection: + case MagicaWindZone.Mode.SphereRadial: + wind.size = windZone.radius; + break; + } + wind.main = windZone.main; + wind.turbulence = windZone.turbulence; + + wind.flag.SetBits(Flag_Addition, windZone.IsAddition()); + + wind.worldPositin = t.position; + wind.worldRotation = t.rotation; + wind.worldScale = t.lossyScale; + wind.worldToLocalMatrix = t.worldToLocalMatrix; + + // volume + float volume = 0; + switch (wind.mode) + { + case MagicaWindZone.Mode.GlobalDirection: + volume = float.MaxValue; + break; + case MagicaWindZone.Mode.BoxDirection: + float3 gsize = wind.size * wind.worldScale; + volume = gsize.x * gsize.y * gsize.z; + break; + case MagicaWindZone.Mode.SphereDirection: + case MagicaWindZone.Mode.SphereRadial: + float r = wind.size.x * wind.worldScale.x; + volume = (4.0f / 3.0f) * r * r * r * math.PI; + break; + } + wind.zoneVolume = volume; + + if (windZone.IsDirection()) + { + wind.worldWindDirection = windZone.GetWindDirection(); + //Debug.Log($"wdir:{wind.worldWindDirection}"); + } + else + { + // ĉ¸›èĦ°‚Ѓĵƒ– + wind.attenuation = DataUtility.ConvertAnimationCurve(windZone.attenuation); + } + } + } + + //========================================================================================= + public void InformationLog(StringBuilder allsb) + { + StringBuilder sb = new StringBuilder(); + sb.AppendLine($"========== Wind Manager =========="); + if (IsValid() == false) + { + sb.AppendLine($"Wind Manager. Invalid."); + } + else + { + sb.AppendLine($"Wind Manager. Count:{WindCount}"); + + int cnt = WindCount; + for (int i = 0; i < cnt; i++) + { + var wind = windDataArray[i]; + if (wind.flag.IsSet(Flag_Valid) == false) + continue; + + sb.AppendLine($" [{i}] flag:0x{wind.flag.Value:X}, mode:{wind.mode}"); + } + } + sb.AppendLine(); + Debug.Log(sb.ToString()); + allsb.Append(sb); + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/Simulation/WindManager.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Manager/Simulation/WindManager.cs.meta new file mode 100644 index 00000000..6ebc7b0f --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/Simulation/WindManager.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 410a565210adcf54b96e6427d86b73c1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Manager/Simulation/WindManager.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/Team.meta b/Assets/MagicaCloth2/Scripts/Core/Manager/Team.meta new file mode 100644 index 00000000..3bce14b7 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/Team.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 324a054fc120e7940ab9c3d891b57338 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/Team/TeamManager.cs b/Assets/MagicaCloth2/Scripts/Core/Manager/Team/TeamManager.cs new file mode 100644 index 00000000..b2afc2e3 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/Team/TeamManager.cs @@ -0,0 +1,2926 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System.Collections.Generic; +using System.Text; +using Unity.Burst; +using Unity.Collections; +using Unity.Collections.LowLevel.Unsafe; +using Unity.Jobs; +using Unity.Mathematics; +using Unity.Profiling; +using UnityEngine; + +namespace MagicaCloth2 +{ + public class TeamManager : IManager, IValid + { + /// + /// ƒƒĵƒ ƒ•ƒİ‚°(64bit) + /// + public const int Flag_Valid = 0; // ƒ‡ƒĵ‚żĉœ‰ċŠıĉ€§ + public const int Flag_Enable = 1; // ċ‹•作çŠĥĉ…‹ + public const int Flag_Reset = 2; // ċ§żċ‹˘ƒŞ‚ğƒƒƒˆ + public const int Flag_TimeReset = 3; // ĉ™‚é–“ƒŞ‚ğƒƒƒˆ + public const int Flag_SyncSuspend = 4; // ċŒĉœŸċ…Ħ一ĉ™‚ċœĉ­˘ + public const int Flag_Running = 5; // äğŠċ›žƒ•ƒĴƒĵƒ §‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ŒċŸèĦŒ•‚ŒŸ‹İ†‹ + public const int Flag_Synchronization = 6; // ċŒĉœŸä¸­ + public const int Flag_StepRunning = 7; // ‚ıƒ†ƒƒƒ—ċŸèĦŒä¸­ + public const int Flag_Exit = 8; // ċ­˜ċœ¨ĉĥˆĉğ…ĉ™‚ + public const int Flag_KeepTeleport = 9; // ċ§żċ‹˘äżĉŒƒ†ƒĴƒƒĵƒˆ + public const int Flag_InertiaShift = 10; // ĉ…£ĉ€§ċ…¨ä½“‚·ƒ•ƒˆ + public const int Flag_CameraCullingInvisible = 11; // ‚ЃĦƒİ‚Ѓރ³‚°Ğ‚ˆ‚‹éžèĦ¨ç¤şçŠĥĉ…‹ + public const int Flag_CameraCullingKeep = 12; // ‚ЃĦƒİ‚Ѓރ³‚°ĉ™‚Ğċ§żċ‹˘‚’保¤ + public const int Flag_Spring = 13; // Springċˆİ用 + public const int Flag_SkipWriting = 14; // ĉ›¸èĵżċœĉ­˘ïĵˆ‚ıƒˆƒƒƒ—ƒ˘ƒĵ‚·ƒ§ƒ³ç”¨ïĵ‰ + public const int Flag_Anchor = 15; // Inertia anchor‚’ċˆİ用中 + public const int Flag_AnchorReset = 16; // Inertia anchorċş§ĉ¨™ƒŞ‚ğƒƒƒˆ + public const int Flag_NegativeScale = 17; // ƒž‚¤ƒŠ‚ı‚ı‚ħƒĵƒĞĉœ‰ç„Ħ + public const int Flag_NegativeScaleTeleport = 18; // ƒž‚¤ƒŠ‚ı‚ı‚ħƒĵƒĞĞ‚ˆ‚‹ƒ†ƒĴƒƒĵƒˆ + public const int Flag_DistanceCullingInvisible = 19; // è·é›˘‚Ѓރ³‚°Ğ‚ˆ‚‹éžèĦ¨ç¤şçŠĥĉ…‹ + public const int Flag_RestoreTransformOnlyOnec = 20; // Transformċİċ…ƒ‚’一ċşĤżċŸèĦŒ™‚‹(BoneClothDisableĉ™‚) + public const int Flag_Tangent = 21; // ĉŽç·š‚’計痁™‚‹ + public const int Flag_ScaleSuspent = 22; // ĉµċ°‚ı‚ħƒĵƒĞĞ‚ˆ‚‹ĉݟ能ċœĉ­˘ + public const int Flag_ProxyMeshLine = 23; // ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒĞLineƒ‡ƒĵ‚żŒċ­˜ċœ¨™‚‹ + + // äğ下‚ğƒĞƒ•‚³ƒŞ‚¸ƒ§ƒ³ + // !“‚Œäğ降é †ç•Ş‚’ċ¤‰ˆŞ„“¨ + public const int Flag_Self_PointPrimitive = 32; // PointPrimitive+Sort‚’保ĉŒ—ĉ›´ĉ–°™‚‹ + public const int Flag_Self_EdgePrimitive = 33; // EdgePrimitive+Sort‚’保ĉŒ—ĉ›´ĉ–°™‚‹ + public const int Flag_Self_TrianglePrimitive = 34; // TrianglePrimitive+Sort‚’保ĉŒ—ĉ›´ĉ–°™‚‹ + + public const int Flag_Self_EdgeEdge = 35; + public const int Flag_Sync_EdgeEdge = 36; + public const int Flag_PSync_EdgeEdge = 37; + + public const int Flag_Self_PointTriangle = 38; + public const int Flag_Sync_PointTriangle = 39; + public const int Flag_PSync_PointTriangle = 40; + + public const int Flag_Self_TrianglePoint = 41; + public const int Flag_Sync_TrianglePoint = 42; + public const int Flag_PSync_TrianglePoint = 43; + + public const int Flag_Self_EdgeTriangleIntersect = 44; + public const int Flag_Sync_EdgeTriangleIntersect = 45; + public const int Flag_PSync_EdgeTriangleIntersect = 46; + public const int Flag_Self_TriangleEdgeIntersect = 47; + public const int Flag_Sync_TriangleEdgeIntersect = 48; + public const int Flag_PSync_TriangleEdgeIntersect = 49; + + /// + /// ƒƒĵƒ ċŸşĉœĴƒ‡ƒĵ‚ż + /// + public struct TeamData + { + /// + /// ƒ•ƒİ‚° + /// + public BitField64 flag; + + /// + /// ĉ›´ĉ–°ƒ˘ƒĵƒ‰(‚ރނ¸ƒŠƒĞ) + /// + public ClothUpdateMode originalUpdateMode; + + /// + /// ĉ›´ĉ–°ƒ˘ƒĵƒ‰(ĉœ€çµ‚結ĉžœ) + /// + public ClothUpdateMode updateMode; + + /// + /// ïĵ‘ç§’é–“ĉ›´ĉ–°é ğċşĤ + /// + //public int frequency; + + /// + /// çċœ¨ƒ•ƒĴƒĵƒ ĉ›´ĉ–°ĉ™‚é–“ + /// + public float frameDeltaTime; + + /// + /// ĉ›´ĉ–°è¨ˆç—用ĉ™‚é–“ + /// + public float time; + + /// + /// ċ‰ƒ•ƒĴƒĵƒ ĉ›´ĉ–°è¨ˆç—用ĉ™‚é–“ + /// + public float oldTime; + + /// + /// çċœ¨‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ĉ›´ĉ–°ĉ™‚é–“ + /// + public float nowUpdateTime; + + /// + /// ïĵ‘¤ċ‰ĉœ€ċŒ‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ĉ›´ĉ–°ĉ™‚é–“ + /// + public float oldUpdateTime; + + /// + /// ĉ›´ĉ–°Œ‚‚‹ċ ´ċˆƒ•ƒĴƒĵƒ ĉ™‚é–“ + /// + public float frameUpdateTime; + + /// + /// ċ‰ċ›žĉ›´ĉ–°ƒ•ƒĴƒĵƒ ĉ™‚é–“ + /// + public float frameOldTime; + + /// + /// ƒƒĵƒ ċ›şĉœ‰‚ż‚¤ƒ ‚ı‚ħƒĵƒĞ(0.0-1.0) + /// + public float timeScale; + + /// + /// ƒƒĵƒ ĉœ€çµ‚計ç—用‚ż‚¤ƒ ‚ı‚ħƒĵƒĞ(0.0~1.0) + /// ‚°ƒ­ƒĵƒƒĞ‚ż‚¤ƒ ‚ı‚ħƒĵƒĞŞİ‚’考ĉ…—Ÿċ€¤ + /// + public float nowTimeScale; + + /// + /// äğŠċ›žƒƒĵƒ ĉ›´ĉ–°ċ›žĉ•°ïĵˆïĵŞ‚‰°“ƒ•ƒĴƒĵƒ Żĉ›´ĉ–°Ş—ïĵ‰ + /// + public int updateCount; + + /// + /// äğŠċ›žƒƒĵƒ ĉ›´ĉ–°‚ı‚­ƒƒƒ—ċ›žĉ•°ïĵˆïĵ‘äğ上Ş‚‰°‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³‚ı‚­ƒƒƒ—Œç™şç”Ÿïĵ‰ + /// + public int skipCount; + + /// + /// ‚ıƒ†ƒƒƒ—”¨ƒ•ƒĴƒĵƒ Ğċ݁™‚‹nowUpdateTimeċ‰²ċˆ + /// “‚ŒŻ(frameStartTime ~ time)間§nowUpdateTimeċ‰²ċˆ + /// + public float frameInterpolation; + + /// + /// 重ċŠ›ċ½ħ響ċŠ›(0.0 ~ 1.0) + /// 1.0Żé‡ċŠ›Œ100%ċ½ħ響™‚‹ + /// + public float gravityRatio; + + public float gravityDot; + + /// + /// ‚ğƒ³‚żƒĵƒˆƒİƒ³‚ıƒ•‚݃ĵƒ (ƒ€‚¤ƒĴ‚Żƒˆċ€¤) + /// + public int centerTransformIndex; + + /// + /// çċœ¨ä¸­ċżƒƒŻƒĵƒĞƒ‰ċş§ĉ¨™ïĵˆ“ċ€¤ŻCenterData.nowWorldPosition‚³ƒ”ƒĵïĵ‰ + /// + //public float3 centerWorldPosition; + + /// + /// ‚˘ƒ³‚Ѓĵ¨—Ĥ設ċš•‚ŒĤ„‚‹Transform‚¤ƒ³‚ı‚żƒ³‚ıID(0=Ş—) + /// + //public int anchorTransformId; + + /// + /// è·é›˘‚Ѓރ³‚°ĉ¸Ĵċš‚Şƒ–‚¸‚§‚ŻƒˆID(0=ƒĦ‚¤ƒ³‚ЃĦƒİ) + /// + public int distanceReferenceObjectId; + + /// + /// ‚³ƒ³ƒƒĵƒƒ³ƒˆç”¨Transform‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı + /// + public int componentTransformIndex; + + /// + /// ƒƒĵƒ ‚ı‚ħƒĵƒĞ + /// + public float3 initScale; // ƒ‡ƒĵ‚żç”Ÿĉˆĉ™‚‚ğƒ³‚żƒĵƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ‚ı‚ħƒĵƒĞ + public float scaleRatio; // çċœ¨‚ı‚ħƒĵƒĞċ€çއ + + /// + /// ƒž‚¤ƒŠ‚ı‚ı‚ħƒĵƒĞ + /// + public float negativeScaleSign; // ƒž‚¤ƒŠ‚ı‚ı‚ħƒĵƒĞĉœ‰ç„Ħ(1:ĉ­£‚ı‚ħƒĵƒĞ, -1:ƒž‚¤ƒŠ‚ı‚ı‚ħƒĵƒĞ) + public float3 negativeScaleDirection; // ‚ı‚ħƒĵƒĞĉ–ıċ‘(xyz)ïĵš(1:ĉ­£‚ı‚ħƒĵƒĞ, -1:ƒž‚¤ƒŠ‚ı‚ı‚ħƒĵƒĞ) + public float3 negativeScaleChange; // äğŠċ›žƒ•ƒĴƒĵƒ §ċ¤‰ċŒ–—Ÿ‚ı‚ħƒĵƒĞ(xyz)ïĵš(1:ċ¤‰ċŒ–Ş—, -1:ċèğ˘—Ÿ) + public float2 negativeScaleTriangleSign; // ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĉ³•ç·šĉŽç·šƒ•ƒŞƒƒƒ—ƒ•ƒİ‚° + public float4 negativeScaleQuaternionValue; // ‚Ż‚İƒĵ‚żƒ‹‚ރ³ċèğ˘ç”¨ + + /// + /// MagicaCloth‚³ƒ³ƒƒĵƒƒ³ƒˆ‚¤ƒ³‚ı‚żƒ³‚ıID + /// + //public int componentId; + public MagicaObjectId componentId; + + /// + /// ċŒĉœŸƒƒĵƒ ID(0=Ş—) + /// + public int syncTeamId; + + /// + /// è‡ŞèşĞ‚’ċŒĉœŸ—Ĥ„‚‹èĤރƒĵƒ ID(0=Ş—)ïĵšĉœ€ċ¤§ïĵ—¤ + /// + public FixedList32Bytes syncParentTeamId; + + /// + /// ċŒĉœŸċ…ˆƒƒĵƒ ‚ğƒ³‚żƒĵƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ıïĵˆƒ€‚¤ƒĴ‚Żƒˆċ€¤ïĵ‰ + /// + public int syncCenterTransformIndex; + + /// + /// 連ċ‹•™‚‹Animator‚¤ƒ³‚ı‚żƒ³‚ıID(0=Ş—) + /// + //public int interlockingAnimatorId; + public MagicaObjectId interlockingAnimatorId; + + /// + /// ċˆĉœŸċ§żċ‹˘¨‚˘ƒ‹ƒĦƒĵ‚·ƒ§ƒ³ċ§żċ‹˘ƒ–ƒĴƒ³ƒ‰çއïĵˆċˆĥ約§ċˆİ用ïĵ‰ + /// + public float animationPoseRatio; + + /// + /// 速ċşĤċ‰ċšĉ™‚é–“(StablizationTime)Ğ‚ˆ‚‹é€ŸċşĤéİ用ċ‰²ċˆ(0.0 ~ 1.0) + /// + public float velocityWeight; + + /// + /// è·é›˘‚Ѓރ³‚°Ğ‚ˆ‚‹ƒ–ƒĴƒ³ƒ‰ċ‰²ċˆ(0.0 ~ 1.0) + /// + public float distanceWeight; + + /// + /// ĉœ€çµ‚‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³çµĉžœƒ–ƒĴƒ³ƒ‰ċ‰²ċˆ(0.0 ~ 1.0) + /// + public float blendWeight; + + /// + /// ċ¤–ċŠ›ƒ˘ƒĵƒ‰ + /// + public ClothForceMode forceMode; + + /// + /// ċ¤–ċŠ› + /// + public float3 impactForce; + + //----------------------------------------------------------------- + /// + /// ProxyMesh‚ż‚¤ƒ— + /// + public VirtualMesh.MeshType proxyMeshType; + + /// + /// ProxyMeshTransformƒ‡ƒĵ‚ż + /// + public DataChunk proxyTransformChunk; + + /// + /// ProxyMeshċ…ħ通部ċˆ† + /// -attributes + /// -vertexToTriangles + /// -vertexToVertexIndexArray + /// -vertexDepths + /// -vertexLocalPositions + /// -vertexLocalRotations + /// -vertexRootIndices + /// -vertexParentIndices + /// -vertexChildIndexArray + /// -vertexAngleCalcLocalRotations + /// -uv + /// -positions + /// -rotations + /// -vertexBindPosePositions + /// -vertexBindPoseRotations + /// -normalAdjustmentRotations + /// + public DataChunk proxyCommonChunk; + + /// + /// ProxyMeshé ‚ç‚ıĉŽçĥšé ‚ç‚ıƒ‡ƒĵ‚ż + /// -vertexToVertexDataArray (-vertexToVertexIndexArray¨ċŻ) + /// + //public DataChunk proxyVertexToVertexDataChunk; + + /// + /// ProxyMeshċ­é ‚ç‚ıƒ‡ƒĵ‚ż + /// -vertexChildDataArray (-vertexChildIndexArray¨ċŻ) + /// + public DataChunk proxyVertexChildDataChunk; + + /// + /// ProxyMeshTriangle部ċˆ† + /// -triangles + /// -triangleTeamIdArray + /// -triangleNormals + /// -triangleTangents + /// + public DataChunk proxyTriangleChunk; + + /// + /// ProxyMeshEdge部ċˆ† + /// -edges + /// -edgeTeamIdArray + /// + public DataChunk proxyEdgeChunk; + + /// + /// ProxyMeshBoneCloth/MeshClothċ…ħ通部ċˆ† + /// -localPositions + /// -localNormals + /// -localTangents + /// -boneWeights + /// + public DataChunk proxyMeshChunk; + + /// + /// ProxyMeshBoneClothċ›şĉœ‰éƒ¨ċˆ† + /// -vertexToTransformRotations + /// + public DataChunk proxyBoneChunk; + + /// + /// ProxyMeshMeshCloth‚ı‚­ƒ‹ƒ³‚°ƒœƒĵƒ³éƒ¨ċˆ† + /// -skinBoneTransformIndices + /// -skinBoneBindPoses + /// + public DataChunk proxySkinBoneChunk; + + /// + /// ProxyMeshƒ™ƒĵ‚ıƒİ‚¤ƒ³éƒ¨ċˆ† + /// -baseLineFlags + /// -baseLineStartDataIndices + /// -baseLineDataCounts + /// + public DataChunk baseLineChunk; + + /// + /// ProxyMeshƒ™ƒĵ‚ıƒİ‚¤ƒ³ƒ‡ƒĵ‚żé…ċˆ— + /// -baseLineData + /// + public DataChunk baseLineDataChunk; + + /// + /// ċ›şċšç‚ıƒŞ‚ıƒˆ + /// + public DataChunk fixedDataChunk; + + //----------------------------------------------------------------- + /// + /// ĉŽçĥš—Ĥ„‚‹ƒžƒƒƒ”ƒ³‚°ƒĦƒƒ‚·ƒ¸ƒ‡ƒĵ‚ż¸‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı‚ğƒƒƒˆ(ĉœ€ċ¤§15§) + /// + //public FixedList32Bytes mappingDataIndexSet; + + //----------------------------------------------------------------- + /// + /// ƒ‘ƒĵƒ†‚£‚ŻƒĞƒ‡ƒĵ‚ż + /// + public DataChunk particleChunk; + + /// + /// ‚³ƒİ‚¤ƒ€ƒĵƒ‡ƒĵ‚ż + /// ‚³ƒİ‚¤ƒ€ƒĵŒĉœ‰ċŠıċ ´ċˆŻĉœŞä½żç”¨§‚£Ĥ‚‚ĉœ€ċ¤§ĉ•°§ç˘şäż•‚Œ‚‹ + /// + public DataChunk colliderChunk; + + /// + /// ‚³ƒİ‚¤ƒ€ƒĵƒˆƒİƒ³‚ıƒ•‚݃ĵƒ  + /// ‚³ƒİ‚¤ƒ€ƒĵŒĉœ‰ċŠıċ ´ċˆŻĉœŞä½żç”¨§‚£Ĥ‚‚ĉœ€ċ¤§ĉ•°§ç˘şäż•‚Œ‚‹ + /// + public DataChunk colliderTransformChunk; + + /// + /// çċœ¨ĉœ‰ċŠıŞ‚³ƒİ‚¤ƒ€ƒĵĉ•° + /// + public int colliderCount; + + //----------------------------------------------------------------- + /// + /// è·é›˘ċˆĥ約 + /// + public DataChunk distanceStartChunk; + public DataChunk distanceDataChunk; + + /// + /// ĉ›²’ċˆĥ約 + /// + public DataChunk bendingPairChunk; + + /// + /// ‚ğƒĞƒ•‚³ƒŞ‚¸ƒ§ƒ³ċˆĥ約 + /// + public DataChunk selfPointChunk; + public DataChunk selfEdgeChunk; + public DataChunk selfTriangleChunk; + public float selfGridSize; + public int selfPointGridCount; + public int selfEdgeGridCount; + public int selfTriangleGridCount; + public float selfMaxPrimitiveSize; + + //----------------------------------------------------------------- + /// + /// UnityPhysics§ĉ›´ĉ–°ċż…èĤĉ€§ + /// + public bool IsFixedUpdate => updateMode == ClothUpdateMode.UnityPhysics; + + /// + /// ‚ż‚¤ƒ ‚ı‚ħƒĵƒĞ‚’ç„ĦèĤ– + /// + public bool IsUnscaled => updateMode == ClothUpdateMode.Unscaled; + + /// + /// ïĵ‘ċ›žĉ›´ĉ–°é–“éš” + /// + //public float SimulationDeltaTime => 1.0f / frequency; + + /// + /// ƒ‡ƒĵ‚żĉœ‰ċŠıĉ€§ + /// + public bool IsValid => flag.IsSet(Flag_Valid); + + /// + /// ĉœ‰ċŠıçŠĥĉ…‹ + /// + public bool IsEnable => flag.IsSet(Flag_Enable); + + /// + /// ċ‡Ĥ理çŠĥĉ…‹ + /// + public bool IsProcess => IsEnable && flag.IsSet(Flag_SyncSuspend) == false && IsCullingInvisible == false && IsScaleSuspend == false; + + /// + /// ċ§żċ‹˘ƒŞ‚ğƒƒƒˆĉœ‰ç„Ħ + /// + public bool IsReset => flag.IsSet(Flag_Reset); + + /// + /// ċ§żċ‹˘çĥ­ĉŒƒ†ƒĴƒƒĵƒˆĉœ‰ç„Ħ + /// + public bool IsKeepReset => flag.IsSet(Flag_KeepTeleport); + + /// + /// ĉ…£ĉ€§ċ…¨ä½“‚·ƒ•ƒˆĉœ‰ç„Ħ + /// + public bool IsInertiaShift => flag.IsSet(Flag_InertiaShift); + + /// + /// äğŠċ›žƒ•ƒĴƒĵƒ §‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ŒċŸèĦŒ•‚ŒŸ‹İ†‹ïĵˆïĵ‘ċ›žäğ上ċŸèĦŒ•‚ŒŸċ ´ċˆïĵ‰ + /// + public bool IsRunning => flag.IsSet(Flag_Running); + + /// + /// ‚ıƒ†ƒƒƒ—ċŸèĦŒä¸­‹İ†‹ + /// + public bool IsStepRunning => flag.IsSet(Flag_StepRunning); + + public bool IsCameraCullingInvisible => flag.IsSet(Flag_CameraCullingInvisible); + public bool IsCameraCullingKeep => flag.IsSet(Flag_CameraCullingKeep); + public bool IsDistanceCullingInvisible => flag.IsSet(Flag_DistanceCullingInvisible); + public bool IsCullingInvisible => IsCameraCullingInvisible || IsDistanceCullingInvisible; + public bool IsSpring => flag.IsSet(Flag_Spring); + public bool IsNegativeScale => flag.IsSet(Flag_NegativeScale); + public bool IsNegativeScaleTeleport => flag.IsSet(Flag_NegativeScaleTeleport); + public bool IsTangent => flag.IsSet(Flag_Tangent); + public bool IsScaleSuspend => flag.IsSet(Flag_ScaleSuspent); + public int ParticleCount => particleChunk.dataLength; + + /// + /// çċœ¨ĉœ‰ċŠıŞ‚³ƒİ‚¤ƒ€ƒĵĉ•° + /// + public int UseColliderCount => colliderCount; + public int BaseLineCount => baseLineChunk.dataLength; + public int TriangleCount => proxyTriangleChunk.dataLength; + public int EdgeCount => proxyEdgeChunk.dataLength; + + //public int MappingCount => mappingDataIndexSet.Length; + + /// + /// ċˆĉœŸ‚ı‚ħƒĵƒĞïĵˆï½˜è𸁁ż§ċˆ¤ċš€ä¸€ĉ§˜‚ı‚ħƒĵƒĞ—‹èލ‚Ĥ„Ş„ïĵ‰ + /// + public float InitScale => initScale.x; + } + public ExNativeArray teamDataArray; + + /// + /// ƒƒĵƒ ”¨é˘¨ċ½ħ響ĉƒ…ċ ħ + /// + public ExNativeArray teamWindArray; + + /// + /// ƒžƒƒƒ”ƒ³‚°ƒĦƒƒ‚·ƒƒ‡ƒĵ‚żƒ•ƒİ‚° + /// + public const int MappingDataFlag_ChangePositionNormal = 0; + public const int MappingDataFlag_ChangeTangent = 1; + public const int MappingDataFlag_ChangeBoneWeight = 2; + public const int MappingDataFlag_ModifyBoneWeight = 3; + + /// + /// ƒžƒƒƒ”ƒ³‚°ƒĦƒƒ‚·ƒƒ‡ƒĵ‚ż + /// + public struct MappingData : IValid + { + public int teamId; + + /// + /// çŠĥĉ…‹ƒ•ƒİ‚° + /// + public BitField32 flag; + + /// + /// MappingƒĦƒƒ‚·ƒ‚ğƒ³‚żƒĵƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ïĵˆƒ€‚¤ƒĴ‚Żƒˆċ€¤ïĵ‰ + /// + public int centerTransformIndex; + + /// + /// MappingƒĦƒƒ‚·ƒċŸşĉœĴ + /// -attributes + /// -localPositions + /// -localNormlas + /// -localTangents + /// -boneWeights + /// -positions + /// -rotations + /// + public DataChunk mappingCommonChunk; + + /// + /// ċˆĉœŸçŠĥĉ…‹§ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒ¸ċ¤‰ĉ›ƒžƒˆƒŞƒƒ‚Ż‚ı¨ċ¤‰ĉ›ċ›žèğ˘ + /// “ċ§żċ‹˘ŻċˆĉœŸċŒ–ĉ™‚Ğċ›şċš•‚Œ‚‹ + /// + public float4x4 toProxyMatrix; + public quaternion toProxyRotation; + + /// + /// ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒ¨ƒžƒƒƒ”ƒ³‚°ƒĦƒƒ‚·ƒċş§ĉ¨™çİşé–“ŒċŒ˜‹İ†‹ + /// + public bool sameSpace; + + /// + /// ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒ‹‚‰ƒžƒƒƒ”ƒ³‚°ƒĦƒƒ‚·ƒ¸ċş§ĉ¨™çİşé–“ċ¤‰ĉ›ç”¨ + /// ▲ƒŻƒĵƒĞƒ‰ċŻċżœïĵš““ŻƒŻƒĵƒĞƒ‰çİşé–“‹‚‰ƒžƒƒƒ”ƒ³‚°ƒĦƒƒ‚·ƒ¸ċş§ĉ¨™ċ¤‰ĉ›¨Ş‚‹ + /// + public float4x4 toMappingMatrix; + public quaternion toMappingRotation; + + /// + /// MappingƒĦƒƒ‚·ƒç”¨‚ı‚ħƒĵƒŞƒ³‚°ĉŻ”çŽ‡ + /// + public float scaleRatio; + + /// + /// 紐‘‚‰‚ŒĤ„‚‹RenderDataWorkƒƒƒƒ•‚Ħ¸‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı + /// + public int renderDataWorkIndex; + + public bool IsValid() + { + return teamId > 0; + } + + public int VertexCount => mappingCommonChunk.dataLength; + } + public ExNativeArray mappingDataArray; + + /// + /// ƒƒĵƒ ”¨ƒžƒƒƒ”ƒ³‚°ƒĦƒƒ‚·ƒIDƒŞ‚ıƒˆïĵˆƒƒĵƒ ”¨Ğĉœ€ċ¤§31§) + /// + public ExNativeArray> teamMappingIndexArray; + + /// + /// ƒƒĵƒ ċ…¨ä½“é›†è¨ˆƒ‡ƒĵ‚ż + /// x:ĉœ€ċ¤§ĉ›´ĉ–°ċ›žĉ•° + /// y:ċˆ†ċ‰²‚¸ƒ§ƒ–ƒƒĵƒ Point‚³ƒŞ‚¸ƒ§ƒ³ĉ•° + /// z:ċˆ†ċ‰²‚¸ƒ§ƒ–ƒƒĵƒ Edge‚³ƒŞ‚¸ƒ§ƒ³ĉ•° + /// w:ċˆ†ċ‰²‚¸ƒ§ƒ–ƒƒĵƒ Self‚³ƒŞ‚¸ƒ§ƒ³ĉ•° + /// + public NativeReference teamStatus; + + /// + /// ƒ‘ƒİƒĦƒĵ‚żïĵˆteamDataArray¨‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı連ċ‹•ïĵ‰ + /// + public ExNativeArray parameterArray; + + /// + /// ‚ğƒ³‚żƒĵƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ƒ‡ƒĵ‚ż + /// + public ExNativeArray centerDataArray; + + /// + /// ç™ğ録•‚ŒĤ„‚‹ƒžƒƒƒ”ƒ³‚°ƒĦƒƒ‚·ƒĉ•° + /// + public int MappingCount => mappingDataArray?.Count ?? 0; + + /// + /// ƒƒĵƒ ĉœ‰ċŠıçŠĥĉ…‹‚’ċˆé€”記録 + /// NativeArrayŻ‚¸ƒ§ƒ–ċŸèĦŒä¸­Ğ‚˘‚Ż‚ğ‚ı§Ş„Ÿ‚€‚ + /// + HashSet enableTeamSet = new HashSet(); + + /// + /// ƒƒĵƒ ID¨ClothProcess‚Żƒİ‚ıé–˘é€£èžĉ›¸ + /// + Dictionary clothProcessDict = new Dictionary(); + + //========================================================================================= + /// + /// ç™ğ録•‚ŒĤ„‚‹ƒƒĵƒ ĉ•°ïĵˆ‚°ƒ­ƒĵƒƒĞƒƒĵƒ ‚’ċĞ‚€€‚Ÿ‚ïĵĞŻŞ‚‰Ş„ïĵ‰ + /// + public int TeamCount => teamDataArray?.Count ?? 0; + + /// + /// ç™ğ録•‚ŒĤ„‚‹ĉœ‰ċŠıŞƒƒĵƒ ĉ•°ïĵˆ‚°ƒ­ƒĵƒƒĞƒƒĵƒ ‚’ċĞŞ„ïĵ‰ + /// + public int TrueTeamCount => clothProcessDict.Count; + + /// + /// ċŸèĦŒçŠĥĉ…‹Ğ‚‚‹ƒƒĵƒ ĉ•° + /// + public int ActiveTeamCount => enableTeamSet.Count; + + /// + /// äğŠċ›žƒ•ƒĴƒĵƒ §ƒƒĵƒ ċ…¨ä½“ĉœ€ċ¤§ĉ›´ĉ–°ċ›žĉ•° + /// + public int TeamMaxUpdateCount => teamStatus.Value.x; + + //========================================================================================= + // ■作ĉ­ƒ‡ƒĵ‚ż + bool isValid; + + /// + /// ‚¨ƒƒ‚¸‚³ƒİ‚¤ƒ€ƒĵ‚³ƒŞ‚¸ƒ§ƒ³‚¨ƒƒ‚¸ĉ•°ċˆè¨ˆ + /// + internal int edgeColliderCollisionCount; + + internal NativeReference edgeColliderCollisionCountBuff; + internal NativeParallelHashMap comp2SuspendCounterMap; + internal NativeParallelHashMap comp2TeamIdMap; + internal NativeParallelHashMap comp2SyncPartnerCompMap; + internal NativeParallelHashMap comp2SyncTopCompMap; + + internal NativeList batchNormalClothTeamList; + internal NativeList batchSplitClothTeamList; + + internal List parameterDirtyList; + internal List skipWritingDirtyList; + internal NativeList cullingDirtyList; + internal NativeParallelHashSet selfCollisionUpdateSet; + internal NativeParallelHashMap animatorUpdateModeMap; + + internal ExSimpleNativeArray teamAnchorTransformIndexArray; + internal ExSimpleNativeArray teamDistanceTransformIndexArray; + internal NativeParallelHashMap transformPositionMap; + internal NativeParallelHashMap transformRotationMap; + + internal HashSet cameraCullingClothSet = new HashSet(256); + + //========================================================================================= + public void Dispose() + { + // ç ´ĉ£„監èĤ–ƒŞ‚ıƒˆċĵ·ċˆĥċ‡Ĥ理 + MonitoringProcess(true); + + isValid = false; + + teamDataArray?.Dispose(); + teamWindArray?.Dispose(); + mappingDataArray?.Dispose(); + teamMappingIndexArray?.Dispose(); + parameterArray?.Dispose(); + centerDataArray?.Dispose(); + + teamDataArray = null; + teamWindArray = null; + mappingDataArray = null; + teamMappingIndexArray = null; + parameterArray = null; + centerDataArray = null; + + if (teamStatus.IsCreated) + teamStatus.Dispose(); + + enableTeamSet.Clear(); + clothProcessDict.Clear(); + + if (edgeColliderCollisionCountBuff.IsCreated) + edgeColliderCollisionCountBuff.Dispose(); + comp2SuspendCounterMap.MC2DisposeSafe(); + comp2TeamIdMap.MC2DisposeSafe(); + comp2SyncPartnerCompMap.MC2DisposeSafe(); + comp2SyncTopCompMap.MC2DisposeSafe(); + + if (batchNormalClothTeamList.IsCreated) + batchNormalClothTeamList.Dispose(); + if (batchSplitClothTeamList.IsCreated) + batchSplitClothTeamList.Dispose(); + + parameterDirtyList?.Clear(); + skipWritingDirtyList?.Clear(); + if (cullingDirtyList.IsCreated) + cullingDirtyList.Dispose(); + if (selfCollisionUpdateSet.IsCreated) + selfCollisionUpdateSet.Dispose(); + animatorUpdateModeMap.MC2DisposeSafe(); + + teamAnchorTransformIndexArray?.Dispose(); + teamDistanceTransformIndexArray?.Dispose(); + transformPositionMap.MC2DisposeSafe(); + transformRotationMap.MC2DisposeSafe(); + + cameraCullingClothSet.Clear(); + + //globalTimeScale = 1.0f; + //fixedUpdateCount = 0; + + // ç ´ĉ£„監èĤ–ĉ›´ĉ–°ċ‡Ĥ理 + MagicaManager.afterUpdateDelegate -= MonitoringProcessUpdate; + } + + public void EnterdEditMode() + { + Dispose(); + } + + public void Initialize() + { + Dispose(); + + const int capacity = 32; + teamDataArray = new ExNativeArray(capacity); + teamWindArray = new ExNativeArray(capacity); + mappingDataArray = new ExNativeArray(capacity); + teamMappingIndexArray = new ExNativeArray>(capacity); + parameterArray = new ExNativeArray(capacity); + centerDataArray = new ExNativeArray(capacity); + + // ‚°ƒ­ƒĵƒƒĞƒƒĵƒ [0]‚’èż½ċŠ ™‚‹ + var gteam = new TeamData(); + teamDataArray.Add(gteam); + teamWindArray.Add(new TeamWindData()); + teamMappingIndexArray.Add(new FixedList64Bytes()); + parameterArray.Add(new ClothParameters()); + centerDataArray.Add(new InertiaConstraint.CenterData()); + + teamStatus = new NativeReference(Allocator.Persistent); + + //globalTimeScale = 1.0f; + //fixedUpdateCount = 0; + + // 作ĉ­ç”¨ + edgeColliderCollisionCountBuff = new NativeReference(Allocator.Persistent); + comp2SuspendCounterMap = new NativeParallelHashMap(256, Allocator.Persistent); + comp2TeamIdMap = new NativeParallelHashMap(256, Allocator.Persistent); + comp2SyncPartnerCompMap = new NativeParallelHashMap(256, Allocator.Persistent); + comp2SyncTopCompMap = new NativeParallelHashMap(256, Allocator.Persistent); + + batchNormalClothTeamList = new NativeList(Allocator.Persistent); + batchSplitClothTeamList = new NativeList(Allocator.Persistent); + + parameterDirtyList = new List(128); + skipWritingDirtyList = new List(128); + cullingDirtyList = new NativeList(128, Allocator.Persistent); + selfCollisionUpdateSet = new NativeParallelHashSet(256, Allocator.Persistent); + animatorUpdateModeMap = new NativeParallelHashMap(128, Allocator.Persistent); + + teamAnchorTransformIndexArray = new ExSimpleNativeArray(256, true); + teamDistanceTransformIndexArray = new ExSimpleNativeArray(256, true); + transformPositionMap = new NativeParallelHashMap(32, Allocator.Persistent); + transformRotationMap = new NativeParallelHashMap(32, Allocator.Persistent); + + // ç ´ĉ£„監èĤ–ĉ›´ĉ–°ċ‡Ĥ理 + MagicaManager.afterUpdateDelegate += MonitoringProcessUpdate; + + isValid = true; + } + + public bool IsValid() + { + return isValid; + } + + //========================================================================================= + /// + /// ƒƒĵƒ ‚’ç™ğ録™‚‹ + /// + /// + /// + /// + internal int AddTeam(ClothProcess cprocess, ClothParameters clothParams) + { + if (isValid == false) + return 0; + + // “ĉµéšŽ§ProxyMeshŻċŒĉˆ—Ĥ„‚‹ + + var team = new TeamData(); + team.componentId = cprocess.cloth.GetMagicaId(); + // ★Enableƒ•ƒİ‚°ŻçĞ‹ĤŞ„ + team.flag.SetBits(Flag_Valid, true); + team.flag.SetBits(Flag_Reset, true); + team.flag.SetBits(Flag_TimeReset, true); + team.originalUpdateMode = cprocess.cloth.SerializeData.updateMode; + team.updateMode = cprocess.cloth.SerializeData.updateMode; + //team.frequency = clothParams.solverFrequency; + team.timeScale = 1.0f; + team.initScale = cprocess.clothTransformRecord.scale; // ċˆĉœŸ‚ı‚ħƒĵƒĞ + team.scaleRatio = 1.0f; + team.negativeScaleSign = 1; + team.negativeScaleDirection = 1; + team.negativeScaleChange = 1; + team.negativeScaleQuaternionValue = 1; + team.negativeScaleTriangleSign = 1; + //team.centerWorldPosition = cprocess.clothTransformRecord.position; + team.animationPoseRatio = cprocess.cloth.SerializeData.animationPoseRatio; + team.distanceWeight = 1; + team.componentTransformIndex = MagicaManager.Bone.AddComponentTransform(cprocess.cloth.transform); // ‚³ƒ³ƒƒĵƒƒ³ƒˆTransform + //cprocess.componentTransformIndex = team.componentTransformIndex; // cprocessĞ‚‚‚³ƒ”ƒĵ + var c = teamDataArray.Add(team); + int teamId = c.startIndex; + + // ĉœ€ċ¤§ƒƒĵƒ ĉ•°ƒ‚§ƒƒ‚Ż + if (teamId >= Define.System.MaximumTeamCount) + { + Develop.LogError($"Cannot create more than {Define.System.MaximumTeamCount} teams."); + teamDataArray.Remove(c); + return 0; + } + + var wind = new TeamWindData(); + wind.movingWind.time = -Define.System.WindMaxTime; + teamWindArray.Add(wind); + + // ƒžƒƒƒ”ƒ³‚°ƒĦƒƒ‚·ƒ + teamMappingIndexArray.Add(new FixedList64Bytes()); + + // ƒ‘ƒİƒĦƒĵ‚ż + parameterArray.Add(clothParams); + + // ĉ…£ĉ€§ċˆĥ約 + // ċˆĉœŸċŒ–ĉ™‚‚ğƒ³‚żƒĵƒ­ƒĵ‚ЃĞ位罂’ċˆĉœŸċŒ– + var cdata = new InertiaConstraint.CenterData(); + cdata.frameLocalPosition = cprocess.ProxyMeshContainer.shareVirtualMesh.localCenterPosition.Value; + centerDataArray.Add(cdata); + + clothProcessDict.Add(teamId, cprocess); + + return teamId; + } + + /// + /// ƒƒĵƒ ‚’解除™‚‹ + /// + /// + internal void RemoveTeam(int teamId) + { + if (isValid == false || teamId == 0) + return; + + // ‚ğƒĞƒ•‚³ƒŞ‚¸ƒ§ƒ³ċŒĉœŸè§£é™¤ + ref var tdata = ref GetTeamDataRef(teamId); + if (tdata.syncTeamId > 0 && ContainsTeamData(tdata.syncTeamId)) + { + ref var stdata = ref GetTeamDataRef(tdata.syncTeamId); + RemoveSyncParent(ref stdata, teamId); + } + + // ċˆĥ約ƒ‡ƒĵ‚żŞİ解除 + MagicaManager.Bone.RemoveComponentTransform(tdata.componentTransformIndex); + + // ƒƒĵƒ ƒ‡ƒĵ‚ż‚’ç ´ĉ£„™‚‹ + var c = new DataChunk(teamId); + teamDataArray.RemoveAndFill(c); + teamWindArray.RemoveAndFill(c); + teamMappingIndexArray.RemoveAndFill(c, new FixedList64Bytes()); + parameterArray.Remove(c); + centerDataArray.Remove(c); + + // ƒƒĵƒ ä½œĉ­ƒƒƒƒ•‚Ħ‚’‚ŻƒŞ‚˘ + teamAnchorTransformIndexArray[teamId] = MagicaObjectId.Invalid; + teamDistanceTransformIndexArray[teamId] = MagicaObjectId.Invalid; + + clothProcessDict.Remove(teamId); + } + + /// + /// ƒƒĵƒ ĉœ‰ċŠıċŒ–設ċš + /// + /// + /// + public void SetEnable(ClothProcess cprocess, int teamId, bool sw) + { + //Debug.Log($"Set Enable:{sw} F:{Time.frameCount}"); + if (isValid == false || teamId == 0) + return; + ref var team = ref teamDataArray.GetRef(teamId); + + // ‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ƒŞ‚ğƒƒƒˆĉœ‰ç„Ħ + // ïĵˆċŒĉœŸċ…ˆ‚’ċ‚ç…§ïĵ‰ + ClothProcess syncProcess = cprocess.SyncTopCloth ? cprocess.SyncTopCloth.Process : cprocess; + bool isReset = syncProcess.cloth.SerializeData.disableMode == ClothDisableMode.Reset; + + team.flag.SetBits(Flag_Enable, sw); + if (isReset) + team.flag.SetBits(Flag_Reset, sw); + + //Debug.Log($"Set Enable:{sw}, isReset:{isReset} F:{Time.frameCount}"); + + if (sw) + enableTeamSet.Add(teamId); + else + enableTeamSet.Remove(teamId); + + // 非èĦ¨ç¤şïĵˆƒŞ‚ğƒƒƒˆïĵ‰ĉŒ™ċ‹• + if (sw == false && isReset) + { + // ç„ĦċŠıĉ™‚ĞŻä¸€ċşĤżTransformċİċ…ƒƒ•ƒİ‚°‚’çĞ‹Ĥ‚‹ + team.flag.SetBits(Flag_RestoreTransformOnlyOnec, true); + // Disableĉ™‚ŻéžèĦ¨ç¤şè¨­ċšĞ™‚‹ + team.flag.SetBits(Flag_CameraCullingInvisible, true); + cprocess.SetState(ClothProcess.State_CameraCullingInvisible, true); + cprocess.cameraCullingOldInvisible = true; + } + + // ‚³ƒİ‚¤ƒ€ƒĵĉœ‰ċŠıçŠĥĉ…‹ïĵˆċ†…部§‚³ƒİ‚¤ƒ€ƒĵƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ĉœ‰ċŠıçŠĥĉ…‹‚‚設ċšïĵ‰ + MagicaManager.Collider.EnableTeamCollider(teamId); + + // ‚ğƒ³‚żƒĵƒˆƒİƒ³‚ıƒ•‚݃ĵƒ  + MagicaManager.Bone.EnableTransform(team.centerTransformIndex, sw); + + // ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒ + MagicaManager.Bone.EnableTransform(team.proxyTransformChunk, sw); + } + + public bool IsEnable(int teamId) + { + return enableTeamSet.Contains(teamId); + } + + internal void SetSkipWriting(int teamId, bool sw) + { + if (isValid == false || teamId == 0) + return; + ref var team = ref teamDataArray.GetRef(teamId); + team.flag.SetBits(Flag_SkipWriting, sw); + } + + public bool ContainsTeamData(int teamId) + { + return teamId >= 0 && clothProcessDict.ContainsKey(teamId); + } + + public ref TeamData GetTeamDataRef(int teamId) + { + return ref teamDataArray.GetRef(teamId); + } + + public ref FixedList64Bytes GetTeamMappingRef(int teamId) + { + return ref teamMappingIndexArray.GetRef(teamId); + } + + public ref ClothParameters GetParametersRef(int teamId) + { + return ref parameterArray.GetRef(teamId); + } + + internal ref InertiaConstraint.CenterData GetCenterDataRef(int teamId) + { + return ref centerDataArray.GetRef(teamId); + } + + internal ref MappingData GetMappingDataRef(int mindex) + { + return ref mappingDataArray.GetRef(mindex); + } + + public ClothProcess GetClothProcess(int teamId) + { + if (clothProcessDict.ContainsKey(teamId)) + return clothProcessDict[teamId]; + else + return null; + } + + //========================================================================================= + static readonly ProfilerMarker teamCameraCullingPreProfiler = new ProfilerMarker("CameraCullingPre"); + static readonly ProfilerMarker teamCameraCullingProfiler = new ProfilerMarker("CameraCullingPost"); + + /// + /// ‚ЃĦƒİ‚Ѓރ³‚°çŠĥĉ…‹ĉ›´ĉ–°ïĵˆċ‰ċ‡Ĥ理ïĵ‰ + /// ĉĴĦƒ•ƒĴƒĵƒ é–‹ċ§‹ĉ™‚ĞèĦŒ†ƒĴƒ³ƒ€ƒİƒĵċˆ¤ċšç”¨ƒ‡ƒĵ‚ż‚’ċŽé›†™‚‹ + /// + internal void CameraCullingPreProcess() + { + teamCameraCullingPreProfiler.Begin(); + + var cm = MagicaManager.Cloth; + + // ““Ż‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ċ‡Ĥ理中Ş§tdataŞİĞ‚˘‚Ż‚ğ‚ı§Ş„§ĉ³¨ĉ„ïĵ + cameraCullingClothSet.Clear(); + foreach (var cprocess in cm.clothSet) + { + if (cprocess.IsEnable == false) + continue; + if (cprocess.IsRunning() == false) + continue; + + + // ċˆ¤ċš‚Żƒ­‚ı€‚ċŒĉœŸĉ™‚ŻċŒĉœŸċ…ˆ‚’èĤ‹‚‹ + MagicaCloth jugeCloth = cprocess.SyncTopCloth != null ? cprocess.SyncTopCloth : cprocess.cloth; + CullingSettings jugeSettings = jugeCloth.SerializeData.cullingSettings; + ClothProcess jugeProcess = jugeCloth.Process; + + // ĉœ€çµ‚çš„Ş‚Ѓރ³‚°ƒ˘ƒĵƒ‰ + var cullingMode = jugeSettings.cameraCullingMode; + if (cullingMode == CullingSettings.CameraCullingMode.AnimatorLinkage) + { + if (jugeProcess.interlockingAnimator) + { + switch (jugeProcess.interlockingAnimator.cullingMode) + { + case AnimatorCullingMode.AlwaysAnimate: + cullingMode = CullingSettings.CameraCullingMode.Off; + break; + case AnimatorCullingMode.CullCompletely: + cullingMode = CullingSettings.CameraCullingMode.Keep; + break; + case AnimatorCullingMode.CullUpdateTransforms: + cullingMode = CullingSettings.CameraCullingMode.Reset; + break; + } + } + else + cullingMode = CullingSettings.CameraCullingMode.Off; + } + + // ‚Ѓރ³‚°ċˆ¤ċš + if (jugeCloth == null || cullingMode == CullingSettings.CameraCullingMode.Off) + { + // ‚Ѓރ³‚°ŻèĦŒ‚Ş„ + cprocess.cameraCullingAnimator = null; + cprocess.cameraCullingRenderers = null; + } + else + { + // ċ‚ç…§™ıƒĴƒ³ƒ€ƒİƒĵ確ċš + Animator jugeAnimator = null; + List jugeRenderers = jugeSettings.cameraCullingRenderers; + if (jugeSettings.cameraCullingMethod == CullingSettings.CameraCullingMethod.AutomaticRenderer) + { + jugeAnimator = jugeCloth.Process.interlockingAnimator; + jugeRenderers = jugeCloth.Process.interlockingAnimatorRenderers; + } + cprocess.cameraCullingAnimator = jugeAnimator; + cprocess.cameraCullingRenderers = jugeRenderers; + } + cprocess.cameraCullingMode = cullingMode; + + cameraCullingClothSet.Add(cprocess.cloth); + } + + teamCameraCullingPreProfiler.End(); + } + + /// + /// ‚ЃĦƒİ‚Ѓރ³‚°çŠĥĉ…‹ĉ›´ĉ–°ïĵˆċŒċ‡Ĥ理ïĵ‰ + /// ‚ЃĦƒİ‚Ѓރ³‚°Żèݲċ½“™‚‹RendereisVisibleƒ•ƒİ‚°‹‚‰ċˆ¤ċš•‚Œ‚‹ + /// “ƒ•ƒİ‚°Żċ‰ƒ•ƒĴƒĵƒ ƒĴƒ³ƒ€ƒŞƒ³‚°ĉ™‚Ğ設ċš•‚Œ‚‹ + /// Ÿ‚çċœ¨ƒ•ƒĴƒĵƒ ä½ç½Żċĉ˜ •‚ŒŞ„§ĉ³¨ĉ„™‚‹ïĵˆïĵ‘ƒ•ƒĴƒĵƒ é…‚Œ‚‹ïĵ‰ + /// + internal void CameraCullingPostProcess() + { + teamCameraCullingProfiler.Begin(); + + var cm = MagicaManager.Cloth; + cm.ClearVisibleDict(); + + foreach (var cloth in cameraCullingClothSet) + { + if (cloth == null) + continue; + + var cprocess = cloth.Process; + + // çċœ¨çŠĥĉ…‹ + bool oldInvisible = cprocess.cameraCullingOldInvisible; + bool invisible; + + if (cprocess.cameraCullingAnimator == null && cprocess.cameraCullingRenderers == null) + { + // ‚Ѓރ³‚°Ş— + invisible = false; + } + else + { + // ƒĴƒ³ƒ€ƒİƒĵċˆ¤ċš + invisible = !cm.CheckVisible(cprocess.cameraCullingAnimator, cprocess.cameraCullingRenderers); + } + + // çŠĥĉ…‹ċ¤‰ĉ›´ + if (oldInvisible != invisible) + { + //Debug.Log($"Camera culling change. oldInvisible:{oldInvisible} -> invisible:{invisible} F:{Time.frameCount}"); + int teamId = cprocess.TeamId; + ref var tdata = ref GetTeamDataRef(teamId); + + tdata.flag.SetBits(Flag_CameraCullingInvisible, invisible); + tdata.flag.SetBits(Flag_CameraCullingKeep, false); + + // cprocess‚Żƒİ‚ıĞ‚‚‚³ƒ”ƒĵ™‚‹ + cprocess.SetState(ClothProcess.State_CameraCullingInvisible, invisible); + cprocess.SetState(ClothProcess.State_CameraCullingKeep, false); + cprocess.cameraCullingOldInvisible = invisible; + + if (invisible) + { + // (èĦ¨ç¤ş->非èĦ¨ç¤ş)ĉ™‚ĉŒŻ‚‹èˆž„ + switch (cprocess.cameraCullingMode) + { + case CullingSettings.CameraCullingMode.Reset: + case CullingSettings.CameraCullingMode.Off: + tdata.flag.SetBits(Flag_Reset, true); + //Debug.Log($"Camera culling invisible. Reset On"); + break; + case CullingSettings.CameraCullingMode.Keep: + tdata.flag.SetBits(Flag_CameraCullingKeep, true); + cprocess.SetState(ClothProcess.State_CameraCullingKeep, true); + //Debug.Log($"Camera culling invisible. Keep On"); + break; + } + } + + // ċŻċżœ™‚‹ƒĴƒ³ƒ€ƒĵƒ‡ƒĵ‚żĞĉ›´ĉ–°‚’ĉŒ‡ç¤ş™‚‹ + cprocess.UpdateRendererUse(); + } + } + cameraCullingClothSet.Clear(); + + teamCameraCullingProfiler.End(); + } + + //========================================================================================= + static readonly ProfilerMarker startClothUpdateComponentProfiler = new ProfilerMarker("StartClothUpdate.Component"); + + /// + /// ĉŻŽƒ•ƒĴƒĵƒ ċ¸¸ĞċŸèĦŒ™‚‹ƒƒĵƒ ĉ›´ĉ–° + /// - ƒ‘ƒİƒĦƒĵ‚żċĉ˜  + /// - ĉ›´ĉ–°ƒ˘ƒĵƒ‰ċĉ˜  + /// - ‚˘ƒ³‚Ѓĵïĵè·é›˘‚Ѓރ³‚°ċ‚ç…§‚ރ–‚¸‚§‚Żƒˆċĉ˜  + /// - ĉ™‚é–“ĉ›´ĉ–°¨ċŸèĦŒċ›žĉ•°ç—ċ‡ş + /// + internal void AlwaysTeamUpdate() + { + var cm = MagicaManager.Cloth; + var tm = MagicaManager.Time; + var rm = MagicaManager.Render; + var bm = MagicaManager.Bone; + var sm = MagicaManager.Simulation; + + // 作ĉ­ƒƒƒƒ•‚Ħ‚ŻƒŞ‚˘ + edgeColliderCollisionCount = 0; + edgeColliderCollisionCountBuff.Value = 0; + cm.ClearVisibleDict(); // ƒĴƒ³ƒ€ƒİƒĵèĦ¨ç¤şċˆ¤ċšèžĉ›¸‚’‚ŻƒŞ‚˘ + selfCollisionUpdateSet.Clear(); + teamAnchorTransformIndexArray.SetLength(TeamCount); + teamDistanceTransformIndexArray.SetLength(TeamCount); + transformPositionMap.Clear(); + transformRotationMap.Clear(); + cullingDirtyList.Clear(); + batchNormalClothTeamList.Clear(); + batchSplitClothTeamList.Clear(); + + // (1)ƒ‘ƒİƒĦƒĵ‚żċĉ˜  + for (int i = 0; i < parameterDirtyList.Count;) + { + var cprocess = parameterDirtyList[i]; + if (cprocess == null) + { + parameterDirtyList.RemoveAt(i); + continue; + } + if (cprocess.IsEnable == false) + { + i++; + continue; + } + + //Develop.DebugLog($"Update Parameters {teamId}"); + // ‚³ƒİ‚¤ƒ€ƒĵĉ›´ĉ–°(ċ†…部§teamDataĉ›´ĉ–°) + MagicaManager.Collider.UpdateColliders(cprocess); + + // ‚Ѓރ³‚°ç”¨‚˘ƒ‹ƒĦƒĵ‚żƒĵ¨ƒĴƒ³ƒ€ƒİƒĵĉ›´ĉ–° + cprocess.UpdateCullingAnimatorAndRenderers(); + + int teamId = cprocess.TeamId; + ref var tdata = ref GetTeamDataRef(teamId); + var cloth = cprocess.cloth; + + // 連ċ‹•‚˘ƒ‹ƒĦƒĵ‚żƒĵ‚¤ƒ³‚ı‚żƒ³‚ıID + tdata.interlockingAnimatorId = cprocess.interlockingAnimator != null ? cprocess.interlockingAnimator.GetMagicaId() : MagicaObjectId.Invalid; + + // ƒ‘ƒİƒĦƒĵ‚żċ¤‰ĉ›´ + cprocess.SyncParameters(); + parameterArray[teamId] = cprocess.parameters; + tdata.originalUpdateMode = cloth.SerializeData.updateMode; + tdata.updateMode = cloth.SerializeData.updateMode; + tdata.animationPoseRatio = cloth.SerializeData.animationPoseRatio; + tdata.flag.SetBits(Flag_Spring, cprocess.clothType == ClothProcess.ClothType.BoneSpring && cprocess.parameters.springConstraint.springPower > 0.0f); // Springċˆİ用ƒ•ƒİ‚° + + // ‚ğƒĞƒ•‚³ƒŞ‚¸ƒ§ƒ³ĉ›´ĉ–° + selfCollisionUpdateSet.Add(teamId); + + // ĉŽç·šƒ˘ƒĵƒ‰ + tdata.flag.SetBits(Flag_Tangent, cloth.SerializeData.meshWriteMode == ClothMeshWriteMode.PositionAndNormalTangent); + cprocess.SetState(ClothProcess.State_UpdateTangent, tdata.flag.IsSet(Flag_Tangent)); + + parameterDirtyList.RemoveAt(i); + } + + // (2)ĉ›¸èĵżċœĉ­˘ċĉ˜  + for (int i = 0; i < skipWritingDirtyList.Count;) + { + var cprocess = skipWritingDirtyList[i]; + if (cprocess == null) + { + skipWritingDirtyList.RemoveAt(i); + continue; + } + if (cprocess.IsEnable == false) + { + i++; + continue; + } + + bool skipWriting = cprocess.IsState(ClothProcess.State_SkipWriting); + + int teamId = cprocess.TeamId; + ref var tdata = ref GetTeamDataRef(teamId); + + // ƒƒĵƒ ¸ċĉ˜  + tdata.flag.SetBits(Flag_SkipWriting, skipWriting); + + // RenderData¸ċĉ˜  + foreach (var rinfo in cprocess.renderMeshInfoList) + { + var renderData = rm.GetRendererData(rinfo.renderHandle); + renderData.UpdateSkipWriting(); + } + + skipWritingDirtyList.RemoveAt(i); + } + +#if true + // (3A)ƒƒĵƒ ċ‰ċ‡Ĥ理‚¸ƒ§ƒ– + // “‚¸ƒ§ƒ–Żç›¸äş’ċ‚ç…§Œ‚‚‹§ä¸Ĥċˆ—ċŒ–§Ş„ + var job1 = new AlwaysTeamUpdatePreJob() + { + teamDataArray = teamDataArray.GetNativeArray(), + parameterArray = parameterArray.GetNativeArray(), + + comp2SuspendCounterMap = comp2SuspendCounterMap, + comp2TeamIdMap = comp2TeamIdMap, + comp2SyncPartnerCompMap = comp2SyncPartnerCompMap, + comp2SyncTopCompMap = comp2SyncTopCompMap, + selfCollisionUpdateSet = selfCollisionUpdateSet, + edgeColliderCollisionCountBuff = edgeColliderCollisionCountBuff, + }; + var jobHandle1 = job1.Schedule(); + + // (3B)‚³ƒ³ƒƒĵƒƒ³ƒˆċş§ĉ¨™èŞ­żèĵż‚¸ƒ§ƒ– + // 3A¨ä¸Ĥċˆ—ċŸèĦŒ + var jobHandle2 = bm.ReadComponentTransform(default); + + JobHandle.ScheduleBatchedJobs(); // ċ³ĉ™‚é–‹ċ§‹ +#endif + + // (4)ä𖁂³ƒ³ƒƒĵƒƒ³ƒˆ‚’ċ‚ç…§™‚‹ċż…èĤŒ‚‚‹ċ‡Ĥ理 + startClothUpdateComponentProfiler.Begin(); + animatorUpdateModeMap.Clear(); + foreach (var cprocess in cm.clothSet) + { + if (cprocess.TeamId == 0) + continue; + + // 連ċ‹•‚˘ƒ‹ƒĦƒĵ‚żƒĵĉ›´ĉ–°ƒ˘ƒĵƒ‰ċ–ċ— + if (cprocess.interlockingAnimator) + { + MagicaObjectId animatorId = cprocess.interlockingAnimator.GetMagicaId(); + if (animatorUpdateModeMap.ContainsKey(animatorId) == false) + { + animatorUpdateModeMap.Add(animatorId, (int)cprocess.interlockingAnimator.updateMode); + } + } + + // ċŒĉœŸĉ™‚ŻċŒĉœŸċ…ˆ‚’èĤ‹‚‹ + var refCloth = cprocess.SyncTopCloth != null ? cprocess.SyncTopCloth : cprocess.cloth; + var sdata = refCloth.SerializeData; + +#if true + // ‚˘ƒ³‚Ѓĵċ‚ç…§‚ރ–‚¸‚§‚Żƒˆ + var anchorTransform = sdata.inertiaConstraint.anchor; + MagicaObjectId anchorTransformId = anchorTransform != null ? anchorTransform.GetMagicaId() : MagicaObjectId.Invalid; + if (anchorTransformId.IsValid() && transformPositionMap.ContainsKey(anchorTransformId) == false) + { + // ċ‚ç…§‚ރ–‚¸‚§‚Żƒˆċş§ĉ¨™ċ–ċ— + transformPositionMap.Add(anchorTransformId, anchorTransform.position); + transformRotationMap.Add(anchorTransformId, anchorTransform.rotation); + } + if (cprocess.anchorTransformId != anchorTransformId) + { + // ċ¤‰ĉ›´‚‚Š + cprocess.anchorTransformId = anchorTransformId; + teamAnchorTransformIndexArray[cprocess.TeamId] = anchorTransformId; + } + + // è·é›˘‚Ѓރ³‚°ċ‚ç…§‚ރ–‚¸‚§‚Żƒˆ + MagicaObjectId distanceObjectId = sdata.cullingSettings.distanceCullingReferenceObject != null ? sdata.cullingSettings.distanceCullingReferenceObject.GetMagicaId() : MagicaObjectId.Invalid; + if (distanceObjectId.IsValid() && transformPositionMap.ContainsKey(distanceObjectId) == false) + { + // ċ‚ç…§‚ރ–‚¸‚§‚Żƒˆċş§ĉ¨™ċ–ċ— + transformPositionMap.Add(distanceObjectId, sdata.cullingSettings.distanceCullingReferenceObject.transform.position); + } + if (cprocess.distanceReferenceObjectId != distanceObjectId) + { + // ċ¤‰ĉ›´‚‚Š + cprocess.distanceReferenceObjectId = distanceObjectId; + teamDistanceTransformIndexArray[cprocess.TeamId] = distanceObjectId; + } +#endif + } + + // ƒĦ‚¤ƒ³‚ЃĦƒİċş§ĉ¨™ + bool hasMainCamera = Camera.main != null; + float3 mainCameraPosition = Camera.main ? Camera.main.transform.position : 0; + //transformPositionMap.Add(0, mainCameraPosition); + transformPositionMap.Add(MagicaObjectId.Invalid, mainCameraPosition); + startClothUpdateComponentProfiler.End(); + + // ƒƒĵƒ ċ‰ċ‡Ĥ理‚¸ƒ§ƒ–ċ…Ħ + jobHandle1.Complete(); + jobHandle2.Complete(); + edgeColliderCollisionCount = edgeColliderCollisionCountBuff.Value; + + // (5)‚ğƒĞƒ•‚³ƒŞ‚¸ƒ§ƒ³ƒ•ƒİ‚°‚„ƒƒƒƒ•‚Ħĉ›´ĉ–° + if (selfCollisionUpdateSet.Count() > 0) + { + foreach (var teamId in selfCollisionUpdateSet) + { + sm.selfCollisionConstraint.UpdateTeam(teamId); + } + selfCollisionUpdateSet.Clear(); + } + + // (6)ƒƒĵƒ ċŒċ‡Ĥ理‚¸ƒ§ƒ– +#if true + if (ActiveTeamCount > 0) + { + // ƒ•ƒĴƒĵƒ ĉ›´ĉ–°ĉ™‚é–“ + float deltaTime = Time.deltaTime; + float fixedDeltaTime = tm.FixedUpdateCount * Time.fixedDeltaTime; + float unscaledDeltaTime = Time.unscaledDeltaTime; + + //Debug.Log($"DeltaTime:{deltaTime}, FixedDeltaTime:{fixedDeltaTime}, simulationDeltaTime:{MagicaManager.Time.SimulationDeltaTime}, maxDeltaTime:{MagicaManager.Time.MaxDeltaTime}"); + //Debug.Log($"DeltaTime:{deltaTime}, FixedDeltaTime:{fixedDeltaTime}, simulationDeltaTime:{MagicaManager.Time.SimulationDeltaTime}"); + + // “JobŻċ³ĉ™‚ċŸèĦŒ•›‚‹ + var postJob = new AlwaysTeamUpdatePostJob() + { + teamCount = TeamCount, + unityFrameDeltaTime = deltaTime, + unityFrameFixedDeltaTime = fixedDeltaTime, + unityFrameUnscaledDeltaTime = unscaledDeltaTime, + globalTimeScale = tm.GlobalTimeScale, + simulationDeltaTime = tm.SimulationDeltaTime, + //maxDeltaTime = MagicaManager.Time.MaxDeltaTime, + maxSimmulationCountPerFrame = tm.maxSimulationCountPerFrame, + splitProxyMeshVertexCount = sm.splitProxyMeshVertexCount, + + //maxUpdateCount = maxUpdateCount, + teamStatus = teamStatus, + teamDataArray = teamDataArray.GetNativeArray(), + parameterArray = parameterArray.GetNativeArray(), + centerDataArray = centerDataArray.GetNativeArray(), + + componentPositionArray = bm.componentPositionArray.GetNativeArray(), + componentMinScaleArray = bm.componentMinScaleArray.GetNativeArray(), + hasMainCamera = hasMainCamera, + + comp2TeamIdMap = comp2TeamIdMap, + comp2SyncTopCompMap = comp2SyncTopCompMap, + animatorUpdateModeMap = animatorUpdateModeMap, + teamAnchorTransformIndexArray = teamAnchorTransformIndexArray.GetNativeArray(), + teamDistanceTransformIndexArray = teamDistanceTransformIndexArray.GetNativeArray(), + transformPositionMap = transformPositionMap, + transformRotationMap = transformRotationMap, + cullingDirtyList = cullingDirtyList, + + batchNormalClothTeamList = batchNormalClothTeamList, + batchSplitClothTeamList = batchSplitClothTeamList, + }; + postJob.Run(); + + // è·é›˘‚Ѓރ³‚°ċĉ˜  + if (cullingDirtyList.Length > 0) + { + foreach (int teamId in cullingDirtyList) + { + ref var tdata = ref GetTeamDataRef(teamId); + var cprocess = GetClothProcess(teamId); + + bool invisible = tdata.IsDistanceCullingInvisible; + + // cprocess‚Żƒİ‚ıĞ‚‚‚³ƒ”ƒĵ™‚‹ + // è·é›˘‚Ѓރ³‚°§ŻèĦ¨ç¤ş/非èĦ¨ç¤şċˆ‡ĉ›żĉ™‚Ğċ¸¸ĞƒŞ‚ğƒƒƒˆ™‚‹ + // Ÿ‚ЃĦƒİ‚Ѓރ³‚°KeepŻċĵ·ċˆĥ解除™‚‹ + cprocess.SetState(ClothProcess.State_DistanceCullingInvisible, invisible); + cprocess.SetState(ClothProcess.State_CameraCullingKeep, false); + + // ċŻċżœ™‚‹ƒĴƒ³ƒ€ƒĵƒ‡ƒĵ‚żĞĉ›´ĉ–°‚’ĉŒ‡ç¤ş™‚‹ + cprocess.UpdateRendererUse(); + } + } + } +#endif + } + + [BurstCompile] + unsafe struct AlwaysTeamUpdatePreJob : IJob + { + public NativeArray teamDataArray; + public NativeArray parameterArray; + + // work + public NativeParallelHashMap comp2SuspendCounterMap; + public NativeParallelHashMap comp2TeamIdMap; + public NativeParallelHashMap comp2SyncPartnerCompMap; + public NativeParallelHashMap comp2SyncTopCompMap; + public NativeParallelHashSet selfCollisionUpdateSet; + public NativeReference edgeColliderCollisionCountBuff; + + public void Execute() + { + int edgeColliderCollisionCount = 0; + TeamData* tt = (TeamData*)teamDataArray.GetUnsafePtr(); + + foreach (var kv in comp2TeamIdMap) + { + int teamId = kv.Value; + if (teamId == 0) + continue; + + MagicaObjectId compId = kv.Key; + ref var tdata = ref *(tt + teamId); + + // 作ĉ­ƒ•ƒİ‚°‚’‚ŻƒŞ‚˘ ------------------------------------- + tdata.flag.SetBits(Flag_RestoreTransformOnlyOnec, false); + + // ċ‹•作ċˆ¤ċš ---------------------------------------------------- + if (tdata.flag.IsSet(Flag_Enable) == false) + continue; + + // ċŒĉœŸĦċˆ¤ċš ------------------------------------------------- + bool syncSuspend = true; + if (comp2SuspendCounterMap.ContainsKey(compId) == false || comp2SuspendCounterMap[compId] == 0) + syncSuspend = false; + + // ċŒĉœŸç›¸ĉ‰‹ĉœ‰ċŠıçŠĥĉ…‹ + if (comp2SyncPartnerCompMap.ContainsKey(compId)) + { + MagicaObjectId syncCompId = comp2SyncPartnerCompMap[compId]; + if (comp2TeamIdMap.ContainsKey(syncCompId)) + { + int syncTeamId = comp2TeamIdMap[syncCompId]; + if (syncTeamId > 0) + { + ref var syncTeamData = ref *(tt + syncTeamId); + int syncSuspendCounter = comp2SuspendCounterMap.ContainsKey(syncCompId) ? comp2SuspendCounterMap[syncCompId] : 0; + if (syncTeamData.IsEnable && syncSuspendCounter == 0) + syncSuspend = false; // 相ĉ‰‹‚‚ċ‡Ĥ理ċŻèƒ½çŠĥĉ…‹ + } + } + } + tdata.flag.SetBits(Flag_SyncSuspend, syncSuspend); + + // ċŒĉœŸċ…ĦŞ‚‰ċŸèĦŒ§Ş„ + if (tdata.flag.IsSet(Flag_SyncSuspend)) + continue; + + // ƒƒĵƒ ċŒĉœŸ -------------------------------------------------- + int oldSyncTeamId = tdata.syncTeamId; + tdata.syncTeamId = 0; + if (comp2SyncPartnerCompMap.ContainsKey(compId)) + { + MagicaObjectId syncCompId = comp2SyncPartnerCompMap[compId]; + if (comp2TeamIdMap.ContainsKey(syncCompId)) + { + int syncTeamId = comp2TeamIdMap[syncCompId]; + tdata.syncTeamId = syncTeamId; + } + } + tdata.flag.SetBits(Flag_Synchronization, tdata.syncTeamId != 0); + tdata.syncCenterTransformIndex = 0; + if (oldSyncTeamId != tdata.syncTeamId) + { + // ċ¤‰ĉ›´‚‚Šïĵ + // ċŒĉœŸè§£é™¤ + if (oldSyncTeamId > 0) + { + //Debug.Log($"Desynchronization! (1) {teamId}"); + ref var syncTeamData = ref *(tt + oldSyncTeamId); + syncTeamData.syncParentTeamId.MC2RemoveItemAtSwapBack(teamId); + } + + // ċŒĉœŸċ¤‰ĉ›´ + if (tdata.syncTeamId != 0) + { + ref var syncTeamData = ref *(tt + tdata.syncTeamId); + + // 相ĉ‰‹Ğè‡ŞèşĞ‚’ç™ğ録 + // ĉœ€ċ¤§ïĵ—§ + if (syncTeamData.syncParentTeamId.Length == syncTeamData.syncParentTeamId.Capacity) + { + //Debug.LogWarning($"Synchronous team number limit!"); + } + else + syncTeamData.syncParentTeamId.Add(teamId); + + // ĉ™‚é–“ƒŞ‚ğƒƒƒˆƒ•ƒİ‚°‚ŻƒŞ‚˘ + tdata.flag.SetBits(Flag_TimeReset, false); + + //Debug.Log($"Synchronization! {teamId}->{tdata.syncTeamId}"); + } + else + { + // ċŒĉœŸè§£é™¤ + //cloth.SerializeData.selfCollisionConstraint.syncPartner = null; + //Debug.Log($"Desynchronization! (2) {teamId}"); + } + + // ‚ğƒĞƒ•‚³ƒŞ‚¸ƒ§ƒ³ĉ›´ĉ–°‚ğƒƒƒˆĞèż½ċŠ  + selfCollisionUpdateSet.Add(teamId); + } + + // ĉ™‚é–“¨ƒ‘ƒİƒĦƒĵ‚żċŒĉœŸ + var clothParam = parameterArray[teamId]; + + // ƒˆƒƒƒ—階ċħ¤ċŒĉœŸ‚Żƒ­‚ı‚’èĤ‹‚‹ + int syncTopTeamId = 0; + if (comp2SyncTopCompMap.ContainsKey(compId)) + { + MagicaObjectId syncTopCompId = comp2SyncTopCompMap[compId]; + if (comp2TeamIdMap.ContainsKey(syncTopCompId)) + { + syncTopTeamId = comp2TeamIdMap[syncTopCompId]; + ref var syncTeamData = ref *(tt + syncTopTeamId); + + // ĉ™‚é–“ċŒĉœŸ + if (syncTeamData.IsValid) + { + tdata.originalUpdateMode = syncTeamData.originalUpdateMode; + tdata.updateMode = syncTeamData.updateMode; + //tdata.frequency = syncTeamData.frequency; + tdata.time = syncTeamData.time; + tdata.oldTime = syncTeamData.oldTime; + tdata.nowUpdateTime = syncTeamData.nowUpdateTime; + tdata.oldUpdateTime = syncTeamData.oldUpdateTime; + tdata.frameUpdateTime = syncTeamData.frameUpdateTime; + tdata.frameOldTime = syncTeamData.frameOldTime; + tdata.timeScale = syncTeamData.timeScale; + tdata.updateCount = syncTeamData.updateCount; + tdata.frameInterpolation = syncTeamData.frameInterpolation; + tdata.skipCount = syncTeamData.skipCount; + //Develop.DebugLog($"Team time sync:{teamId}->{syncCloth.Process.TeamId}"); + } + + // ƒ‘ƒİƒĦƒĵ‚żċŒĉœŸ + // ċŒĉœŸä¸­Żä¸€éƒ¨ƒ‘ƒİƒĦƒĵ‚ż‚’連ċ‹••›‚‹ + var syncClothParam = parameterArray[syncTopTeamId]; + clothParam.inertiaConstraint.anchorInertia = syncClothParam.inertiaConstraint.anchorInertia; + clothParam.inertiaConstraint.worldInertia = syncClothParam.inertiaConstraint.worldInertia; + clothParam.inertiaConstraint.movementInertiaSmoothing = syncClothParam.inertiaConstraint.movementInertiaSmoothing; + clothParam.inertiaConstraint.movementSpeedLimit = syncClothParam.inertiaConstraint.movementSpeedLimit; + clothParam.inertiaConstraint.rotationSpeedLimit = syncClothParam.inertiaConstraint.rotationSpeedLimit; + clothParam.inertiaConstraint.teleportMode = syncClothParam.inertiaConstraint.teleportMode; + clothParam.inertiaConstraint.teleportDistance = syncClothParam.inertiaConstraint.teleportDistance; + clothParam.inertiaConstraint.teleportRotation = syncClothParam.inertiaConstraint.teleportRotation; + parameterArray[teamId] = clothParam; + + // ċŒĉœŸċ…ˆ‚ğƒ³‚żƒĵƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı‚’記録 + tdata.syncCenterTransformIndex = syncTeamData.centerTransformIndex; + } + } + + // 集計‚‚Š + if (clothParam.colliderCollisionConstraint.mode == ColliderCollisionConstraint.Mode.Edge) + edgeColliderCollisionCount += tdata.EdgeCount; + } + + edgeColliderCollisionCountBuff.Value = edgeColliderCollisionCount; + } + } + + [BurstCompile] + struct AlwaysTeamUpdatePostJob : IJob + { + public int teamCount; + public float unityFrameDeltaTime; + public float unityFrameFixedDeltaTime; + public float unityFrameUnscaledDeltaTime; + public float globalTimeScale; + public float simulationDeltaTime; + public int maxSimmulationCountPerFrame; + public int splitProxyMeshVertexCount; + + public NativeReference teamStatus; + public NativeArray teamDataArray; + [Unity.Collections.ReadOnly] + public NativeArray parameterArray; + public NativeArray centerDataArray; + + public NativeArray componentPositionArray; + public NativeArray componentMinScaleArray; + public bool hasMainCamera; + + // work + public NativeParallelHashMap comp2TeamIdMap; + public NativeParallelHashMap comp2SyncTopCompMap; + public NativeParallelHashMap animatorUpdateModeMap; + public NativeArray teamAnchorTransformIndexArray; + public NativeArray teamDistanceTransformIndexArray; + public NativeParallelHashMap transformPositionMap; + public NativeParallelHashMap transformRotationMap; + public NativeList cullingDirtyList; + + public NativeList batchNormalClothTeamList; + public NativeList batchSplitClothTeamList; + + public void Execute() + { + int maxCount = 0; + int splitPointCollisionCount = 0; + int splitEdgeCollisionCount = 0; + int splitSelfCollisionCount = 0; + + for (int teamId = 1; teamId < teamCount; teamId++) + { + var tdata = teamDataArray[teamId]; + MagicaObjectId compId = tdata.componentId; + if (tdata.IsEnable == false) + continue; + if (tdata.flag.IsSet(Flag_SyncSuspend)) + continue; + + var param = parameterArray[teamId]; + + // ċ‹•作ĉ¤œè¨ĵ + // ĉµċ°‚ı‚ħƒĵƒĞĞ‚ˆ‚‹ĉݟ能ċœĉ­˘ + tdata.flag.SetBits(Flag_ScaleSuspent, componentMinScaleArray[tdata.componentTransformIndex] < 1e-06f); + if (tdata.flag.IsSet(Flag_ScaleSuspent)) + { + teamDataArray[teamId] = tdata; + continue; + } + + // ‚˘ƒ³‚Ѓĵ + MagicaObjectId anchorTransformIndex = teamAnchorTransformIndexArray[teamId]; + bool oldAnchor = tdata.flag.IsSet(Flag_Anchor); + bool newAnchor = anchorTransformIndex.IsValid(); + tdata.flag.SetBits(Flag_Anchor, newAnchor); + tdata.flag.SetBits(Flag_AnchorReset, oldAnchor != newAnchor); + var cdata = centerDataArray[teamId]; + cdata.anchorPosition = anchorTransformIndex.IsValid() ? transformPositionMap[anchorTransformIndex] : float3.zero; + cdata.anchorRotation = anchorTransformIndex.IsValid() ? transformRotationMap[anchorTransformIndex] : quaternion.identity; + centerDataArray[teamId] = cdata; + + // è·é›˘‚Ѓރ³‚°ċˆ¤ċš + DistanceCullingUpdate(teamId, ref tdata, ref param); + + if (tdata.IsCullingInvisible) + { + teamDataArray[teamId] = tdata; + continue; + } + + // ĉ›´ĉ–°ƒ˘ƒĵƒ‰ + int syncTopTeamId = 0; + if (comp2SyncTopCompMap.ContainsKey(compId)) + { + MagicaObjectId syncTopCompId = comp2SyncTopCompMap[compId]; + if (comp2TeamIdMap.ContainsKey(syncTopCompId)) + { + syncTopTeamId = comp2TeamIdMap[syncTopCompId]; + } + } + if (tdata.originalUpdateMode == ClothUpdateMode.AnimatorLinkage || syncTopTeamId > 0) + { + var originalUpdateMode = tdata.originalUpdateMode; + MagicaObjectId animatorId = tdata.interlockingAnimatorId; + if (syncTopTeamId > 0) + { + var syncTeamData = teamDataArray[syncTopTeamId]; + originalUpdateMode = syncTeamData.originalUpdateMode; + animatorId = syncTeamData.interlockingAnimatorId; + } + + switch (originalUpdateMode) + { + case ClothUpdateMode.Normal: + case ClothUpdateMode.UnityPhysics: + case ClothUpdateMode.Unscaled: + tdata.updateMode = originalUpdateMode; + break; + case ClothUpdateMode.AnimatorLinkage: + if (animatorUpdateModeMap.ContainsKey(animatorId)) + { + AnimatorUpdateMode aniUpdateMode = (AnimatorUpdateMode)animatorUpdateModeMap[animatorId]; + switch (aniUpdateMode) + { + case AnimatorUpdateMode.Normal: + tdata.updateMode = ClothUpdateMode.Normal; + break; +#if UNITY_2023_1_OR_NEWER + case AnimatorUpdateMode.Fixed: + tdata.updateMode = ClothUpdateMode.UnityPhysics; + break; +#else + case AnimatorUpdateMode.AnimatePhysics: + tdata.updateMode = ClothUpdateMode.UnityPhysics; + break; +#endif + case AnimatorUpdateMode.UnscaledTime: + tdata.updateMode = ClothUpdateMode.Unscaled; + break; + default: + //Develop.DebugLogWarning($"[{cloth.name}] Unknown Animator UpdateMode:{interlockingAnimator.updateMode}"); + tdata.updateMode = ClothUpdateMode.Normal; + break; + } + } + else + tdata.updateMode = ClothUpdateMode.Normal; + break; + default: + //Develop.LogError($"[{cloth.name}] Unknown Cloth Update Mode:{cloth.SerializeData.updateMode}"); + tdata.updateMode = ClothUpdateMode.Normal; + break; + } + } + + // ĉ™‚é–“ƒŞ‚ğƒƒƒˆ + if (tdata.flag.IsSet(Flag_TimeReset)) + { + tdata.time = 0; + tdata.oldTime = 0; + tdata.nowUpdateTime = 0; + tdata.oldUpdateTime = 0; + tdata.frameUpdateTime = 0; + tdata.frameOldTime = 0; + } + + // ĉ›´ĉ–°ĉ™‚é–“ + //Debug.Log($"Team [{teamId}] updateMode:{(int)tdata.updateMode}"); + float frameDeltaTime = tdata.IsFixedUpdate ? unityFrameFixedDeltaTime : (tdata.IsUnscaled ? unityFrameUnscaledDeltaTime : unityFrameDeltaTime); + tdata.frameDeltaTime = frameDeltaTime; + float deltaTime = frameDeltaTime; + + // ‚ż‚¤ƒ ‚ı‚ħƒĵƒĞ + float timeScale = tdata.timeScale * (tdata.IsUnscaled ? 1.0f : globalTimeScale); + timeScale = tdata.flag.IsSet(Flag_SyncSuspend) ? 0.0f : timeScale; + tdata.nowTimeScale = timeScale; // ĉœ€çµ‚計ç—用‚ż‚¤ƒ ‚ı‚ħƒĵƒĞ + + // ċŠ ç—ĉ™‚é–“ + float addTime = deltaTime * timeScale; // äğŠċ›žċŠ ç—ĉ™‚é–“ + + // ĉ™‚é–“‚’ċŠ ç— + float time = tdata.time + addTime; + //Debug.Log($"[{i}] time:{time}, addTime:{addTime}, timeScale:{timeScale}, suspend:{tdata.flag.IsSet(Flag_Suspend)}"); + float interval = time - tdata.nowUpdateTime; + + // äğŠċ›žäşˆċšĉ›´ĉ–°ċ›žĉ•° + int updateCount = (int)(interval / simulationDeltaTime); + + // äğŠċ›žĉ›´ĉ–°ċ›žĉ•°ïĵˆĉœ€ċ¤§ĉ›´ĉ–°ċ›žĉ•°§ïĵ‰ + tdata.updateCount = math.min(updateCount, maxSimmulationCountPerFrame); + + // äğŠċ›ž‚ı‚­ƒƒƒ—ċ›žĉ•°ïĵˆĉœ€ċ¤§ĉ›´ĉ–°ċ›žĉ•°èĥ…過ċˆ†ïĵ‰ + tdata.skipCount = updateCount - tdata.updateCount; + if (tdata.skipCount > 0) + { + // ‚ı‚­ƒƒƒ—ç™şç”Ÿĉ™‚Ż‚ı‚­ƒƒƒ—ĉ™‚é–“‚’ç„Ħ‹£Ÿ‚‚¨™‚‹ + time = time - simulationDeltaTime * tdata.skipCount; + } + + if (tdata.updateCount > 0 && addTime == 0.0f) + { + // SimulationDeltaTimeċŠ ç—èޤċ·Œç™şç”Ÿïĵ + // ‚ıƒ†ƒƒƒ—ĉŻŽnowUpdateTime += tdata.SimulationDeltaTimeŒèޤċ·‚’è“„çݍ + // çµĉžœaddTime=0§‚‚intervalŒä¸€ċ›žċˆ†¨Ş‚Šċ‡Ĥ理Œ‚£Ĥ—† + // “†Ş‚‹¨ĉ™‚é–“è£œé–“é–˘é€£§0除痁Œç™şç”Ÿ—Ĥĉ•°ċ€¤Œċ£Š‚Œ‚‹ + // èŞ¤ċ·‚’äżĉ­£™‚‹ + tdata.updateCount = 0; + tdata.skipCount = 0; + tdata.nowUpdateTime = time - simulationDeltaTime + 0.0001f; + } + + // ĉ™‚é–“‚‚Šĉ›´ĉ–° + if (tdata.updateCount > 0) + { + // ĉ›´ĉ–°ĉ™‚ƒ•ƒĴƒĵƒ é–‹ċ§‹ĉ™‚é–“ + tdata.frameOldTime = tdata.frameUpdateTime; + tdata.frameUpdateTime = time; + + // ċ‰ċ›žĉ›´ĉ–°ĉ™‚é–“ + tdata.oldUpdateTime = tdata.nowUpdateTime; + + //Debug.Log($"TeamUpdate!:{i}"); + } + tdata.oldTime = tdata.time; + tdata.time = time; + + // ‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ċŸèĦŒƒ•ƒİ‚° + tdata.flag.SetBits(Flag_Running, tdata.updateCount > 0); + + teamDataArray[teamId] = tdata; + + // ċ…¨ä½“ĉœ€ċ¤§ċŸèĦŒċ›žĉ•° + maxCount = math.max(maxCount, tdata.updateCount); + + //Debug.Log($"[{teamId}] updateCount:{tdata.updateCount}, skipCount:{tdata.skipCount}, addtime:{addTime}, t.time:{tdata.time}, t.oldtime:{tdata.oldTime}, timeScale:{tdata.timeScale}"); + + // ‚¸ƒ§ƒ–ĉƒ…ċ ħä½œĉˆ + bool isSplitTeam = false; + bool isSelfCollisionJob = tdata.flag.IsSet(Flag_Self_PointPrimitive) + || tdata.flag.IsSet(Flag_Self_EdgePrimitive) + || tdata.flag.IsSet(Flag_Self_TrianglePrimitive); + if (isSelfCollisionJob) + { + // ‚ğƒĞƒ•‚³ƒŞ‚¸ƒ§ƒ³ + // Split‚¸ƒ§ƒ– + batchSplitClothTeamList.Add(teamId); + isSplitTeam = true; + splitSelfCollisionCount++; + } + else + { + // ‚ğƒĞƒ•‚³ƒŞ‚¸ƒ§ƒ³Ş—§Żƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒé ‚ç‚ıĉ•°Œä¸€ċšäğ上Ş‚‰ċˆ†ċ‰²™‚‹ + if (tdata.ParticleCount >= splitProxyMeshVertexCount) + { + // Split‚¸ƒ§ƒ– + batchSplitClothTeamList.Add(teamId); + isSplitTeam = true; + } + else + { + // Normal‚¸ƒ§ƒ– + batchNormalClothTeamList.Add(teamId); + } + } + + // Splitƒƒĵƒ Point/Edge‚³ƒŞ‚¸ƒ§ƒ³ĉœ‰ç„Ħ + if (isSplitTeam && tdata.UseColliderCount > 0) + { + if (param.colliderCollisionConstraint.mode == ColliderCollisionConstraint.Mode.Point) + splitPointCollisionCount++; + if (param.colliderCollisionConstraint.mode == ColliderCollisionConstraint.Mode.Edge) + splitEdgeCollisionCount++; + } + } + + teamStatus.Value = new int4(maxCount, splitPointCollisionCount, splitEdgeCollisionCount, splitSelfCollisionCount); + } + + void DistanceCullingUpdate(int teamId, ref TeamData tdata, ref ClothParameters param) + { + // çċœ¨çŠĥĉ…‹ + bool oldInvisible = tdata.IsDistanceCullingInvisible; + bool invisible; + + // è·é›˘‚Ѓރ³‚°ĉœ‰ç„Ħ + if (param.culling.useDistanceCulling) + { + // è·é›˘‚Ѓރ³‚°ĉœ‰ċŠı + // è·é›˘ċˆ¤ċš + MagicaObjectId transformId = teamDistanceTransformIndexArray[teamId]; + if (transformPositionMap.ContainsKey(transformId)) + { + // çċœ¨‚³ƒ³ƒƒĵƒƒ³ƒˆä½ç½(pos)ŻċŒĉœŸ‚’ċ–£Ĥ„Ş„ + // “‚ŒŻïĵ’¤‚³ƒ³ƒƒĵƒƒ³ƒˆŒċŒ˜éšŽċħ¤¨ċŒ˜ä½ç½§‚‚‹“¨‚’ĉƒ³ċš—Ĥ„‚‹Ÿ‚§‚‚‹ + // Ÿ‚ïĵ’¤‚³ƒ³ƒƒĵƒƒ³ƒˆä½ç½Œš‚ŒĤ„‚‹¨äşˆĉœŸ›Ĵċ‹•ä½œä¸è‰Ż‚’èµ·“™ċħ険ĉ€§Œ‚‚‹ + float3 pos = componentPositionArray[tdata.componentTransformIndex]; + + // ċ‚ç…§‚ރ–‚¸‚§‚Żƒˆä½ç½(spos)ŻċŒĉœŸ•‚ŒĤ„‚‹ + float3 spos = transformPositionMap[transformId]; + + //Debug.Log($"[{teamId}] pos:{pos}, spos:{spos}"); + //Debug.Log($"[{teamId}] componentTransformIndex:{tdata.componentTransformIndex}, objTransformId:{transformId}"); + + float dist = math.distance(pos, spos); + float cullingDist = param.culling.distanceCullingLength; + if (hasMainCamera == false && tdata.componentTransformIndex == 0) + cullingDist = 1000000.0f; // ƒĦ‚¤ƒ³‚ЃĦƒİnullĉ™‚ċ‰ċ…¨ċŻç­– + invisible = dist >= cullingDist; + + // ƒ•‚§ƒĵƒ‰‚Ĥ‚¨‚¤ƒˆ + float fadeDist = math.saturate(param.culling.distanceCullingFadeRatio) * cullingDist; + tdata.distanceWeight = 1.0f - math.saturate(math.unlerp(cullingDist - fadeDist, cullingDist, dist)); + } + else + { + // è·é›˘‚Ѓރ³‚°ç„ĦċŠı + invisible = false; + tdata.distanceWeight = 1.0f; + } + } + else + { + // è·é›˘‚Ѓރ³‚°ç„ĦċŠı + invisible = false; + tdata.distanceWeight = 1.0f; + } + + // çŠĥĉ…‹ċ¤‰ĉ›´ + if (oldInvisible != invisible) + { + tdata.flag.SetBits(Flag_DistanceCullingInvisible, invisible); + //Debug.Log($"Change distance culling invisible:({oldInvisible}) -> ({invisible})"); + + // è·é›˘‚Ѓރ³‚°§ŻèĦ¨ç¤ş/非èĦ¨ç¤şċˆ‡ĉ›żĉ™‚Ğċ¸¸ĞƒŞ‚ğƒƒƒˆ™‚‹ + // Ÿ‚ЃĦƒİ‚Ѓރ³‚°KeepŻċĵ·ċˆĥ解除™‚‹ + tdata.flag.SetBits(Flag_Reset, true); + tdata.flag.SetBits(Flag_CameraCullingKeep, false); + + // ƒĦ‚¤ƒ³‚ıƒĴƒƒƒ‰ċ‡Ĥ理用ƒŞ‚ıƒˆĞèż½ċŠ ™‚‹ + cullingDirtyList.Add(teamId); + } + } + } + + internal void RemoveSyncParent(ref TeamData tdata, int parentTeamId) + { + tdata.syncParentTeamId.MC2RemoveItemAtSwapBack(parentTeamId); + } + + //========================================================================================= + /// + /// ““Ğç™ğ録•‚Œ‚‹ŻCloth‚³ƒ³ƒƒĵƒƒ³ƒˆŒDisableĉ™‚ĞċˆĉœŸċŒ–•‚ŒŸƒ—ƒ­‚ğ‚ı + /// “‚Œ‚‰ƒ—ƒ­‚ğ‚ıŻƒžƒƒĵ‚¸ƒ£ċ´§ĉĥˆĉğ…Œç›£èĤ–•‚Œ‚‹ + /// + HashSet monitoringProcessSet = new HashSet(); + List disposeProcessList = new List(); + + internal void AddMonitoringProcess(ClothProcess cprocess) + { + Develop.Assert(cprocess != null); + monitoringProcessSet.Add(cprocess); + } + + internal void RemoveMonitoringProcess(ClothProcess cprocess) + { + Develop.Assert(cprocess != null); + if (monitoringProcessSet.Contains(cprocess)) + monitoringProcessSet.Remove(cprocess); + } + + /// + /// ‚³ƒ³ƒƒĵƒƒ³ƒˆDisableĉ™‚ĞċˆĉœŸċŒ–•‚ŒŸClothProcess‚’監èĤ–—ĉĥˆĉğ…—Ĥ„Ÿ‚‰ƒžƒƒĵ‚¸ƒ£ċ´‹‚‰ƒĦƒ˘ƒŞ‚’é–‹ĉ”™‚‹ + /// + /// + void MonitoringProcess(bool force) + { + disposeProcessList.Clear(); + foreach (var cprocess in monitoringProcessSet) + { + if (cprocess.cloth == null || force) + { + // ĉĥˆĉğ…‚’ĉ¤œċ‡ş + Develop.DebugLog($"Detection MagicaCloth destroy!"); + disposeProcessList.Add(cprocess); + } + } + + // ĉĥˆĉğ…—ŸCloth‚’ç ´ĉ£„™‚‹ + if (disposeProcessList.Count > 0) + { + disposeProcessList.ForEach(cprocess => cprocess.Dispose()); + disposeProcessList.Clear(); + } + if (force) + { + monitoringProcessSet.Clear(); + } + } + + void MonitoringProcessUpdate() => MonitoringProcess(false); + + //========================================================================================= + // Simulation + //========================================================================================= + /// + /// ƒƒĵƒ ”¨‚ğƒ³‚żƒĵċ§żċ‹˘ĉħşċš¨ĉ…£ĉ€§ç”¨ç§ğċ‹•é‡è¨ˆç— + /// Š‚ˆ³é˘¨ċ½ħ響‚’è¨ˆç— + /// + internal static void SimulationCalcCenterAndInertiaAndWind( + float simulationDeltaTime, + + // team + int teamId, + ref TeamData tdata, + ref InertiaConstraint.CenterData cdata, + ref TeamWindData windData, + ref ClothParameters param, + + // vmesh + in NativeArray positions, + in NativeArray rotations, + in NativeArray vertexBindPoseRotations, + + // inertia + in NativeArray fixedArray, + + // transform + in NativeArray transformPositionArray, + in NativeArray transformRotationArray, + in NativeArray transformScaleArray, + + // wind + int windZoneCount, + in NativeArray windDataArray + ) + { + // ■‚³ƒ³ƒƒĵƒƒ³ƒˆƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ċŒĉœŸ + // ċŒĉœŸä¸­ŻċŒĉœŸċ…ˆ‚³ƒ³ƒƒĵƒƒ³ƒˆƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ‹‚‰ƒŻƒĵƒĞƒ‰ĉ…£ĉ€§‚’計痁™‚‹ + int centerTransformIndex = (tdata.syncTeamId != 0 && tdata.flag.IsSet(Flag_Synchronization)) ? tdata.syncCenterTransformIndex : cdata.centerTransformIndex; + + // ■‚³ƒ³ƒƒĵƒƒ³ƒˆċ§żċ‹˘ + float3 componentWorldPos = transformPositionArray[centerTransformIndex]; + quaternion componentWorldRot = transformRotationArray[centerTransformIndex]; + float3 componentWorldScl = transformScaleArray[cdata.centerTransformIndex]; // Ÿ —‚ı‚ħƒĵƒĞŻċŒĉœŸ•›Ş„ïĵ(v2.11.1) + cdata.componentWorldPosition = componentWorldPos; + cdata.componentWorldRotation = componentWorldRot; + cdata.componentWorldScale = componentWorldScl; + //Debug.Log($"componentWorldPos:{componentWorldPos}, componentWorldRot:{componentWorldRot.value}"); + + // ‚³ƒ³ƒƒĵƒƒ³ƒˆ‚ı‚ħƒĵƒĞċ€çއ + float componentScaleRatio = math.length(componentWorldScl) / math.length(tdata.initScale); + + // ■ƒž‚¤ƒŠ‚ı‚ı‚ħƒĵƒĞ + // ƒž‚¤ƒŠ‚ı‚ı‚ħƒĵƒĞċ ´ċˆŻè¨ˆç—Ğċż…èĤŞƒ‡ƒĵ‚ż‚’äşˆ‚ä½œĉˆ—ĤŠ + float3 oldInverseScaleDirection = tdata.negativeScaleDirection; + tdata.negativeScaleDirection = math.sign(componentWorldScl); // ċ„‚ı‚ħƒĵƒĞĉ–ıċ‘(1/-1) + tdata.negativeScaleChange = oldInverseScaleDirection * tdata.negativeScaleDirection; // äğŠċ›ž‚ı‚ħƒĵƒĞċèğ˘•‚ŒŸĉ–ıċ‘(1:ċ¤‰ċŒ–Ş—, -1:ċèğ˘‚‚Š) + //Debug.Log($"inverseScaleChange:{tdata.inverseScaleChange}"); + if (componentWorldScl.x < 0 || componentWorldScl.y < 0 || componentWorldScl.z < 0) + { + tdata.negativeScaleSign = -1; // ƒž‚¤ƒŠ‚ı‚ı‚ħƒĵƒĞĉ™‚Ż(-1) + tdata.negativeScaleQuaternionValue = new float4(-math.sign(componentWorldScl), 1); // ċ›žèğ˘ċèğ˘ç”¨ + tdata.negativeScaleTriangleSign.x = (componentWorldScl.x < 0 || componentWorldScl.z < 0) ? -1 : 1; // TriangleBendingĉ³•ç·šƒ•ƒŞƒƒƒ—ƒ•ƒİ‚° + tdata.negativeScaleTriangleSign.y = componentWorldScl.x < 0 ? -1 : 1; // TriangleBendingĉŽç·šƒ•ƒŞƒƒƒ—ƒ•ƒİ‚° + tdata.flag.SetBits(Flag_NegativeScale, true); + } + else + { + tdata.negativeScaleSign = 1; + tdata.negativeScaleQuaternionValue = 1; + tdata.negativeScaleTriangleSign = 1; + tdata.flag.SetBits(Flag_NegativeScale, false); + } + // äğċ‰¨‚ı‚ħƒĵƒĞĉ–ıċ‘Œċ¤‰‚£Ĥ„Ÿ„Ÿ‚‰èğ¸ċèğ˘ƒ†ƒĴƒƒĵƒˆ‚’èĦŒ† + if (oldInverseScaleDirection.Equals(tdata.negativeScaleDirection) == false) + { + // èğ¸ċèğ˘ƒ†ƒĴƒƒĵƒˆ + // ĉœĴ体Œ‚ı‚ħƒĵƒĞċèğ˘™‚‹Ÿ‚‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³Ğċ½ħ響Œċ‡şŞ„‚ˆ†Ğċż…èĤŞċş§ĉ¨™ç³ğ‚’ċŒĉ§˜Ğċèğ˘•›‚‹ + // 一ĉ—Ĥ‚Żƒ­‚ıƒ­ƒĵ‚ЃĞçİşé–“Ğĉˆğ—èğ¸ċèğ˘—Ĥ‹‚‰ƒŻƒĵƒĞƒ‰Ğĉ›¸ĉˆğ™ + tdata.flag.SetBits(Flag_NegativeScaleTeleport, true); + //Debug.LogWarning($"Negative Scale detection!"); + + // ‚³ƒ³ƒƒĵƒƒ³ƒˆċèğ˘ç”¨ƒžƒˆƒŞƒƒ‚Ż‚ı + float4x4 nowComponentLW = float4x4.TRS(componentWorldPos, componentWorldRot, componentWorldScl); + float4x4 oldComponentLW = float4x4.TRS(cdata.oldComponentWorldPosition, cdata.oldComponentWorldRotation, cdata.oldComponentWorldScale); + float4x4 componentNegativeM = math.mul(nowComponentLW, math.inverse(oldComponentLW)); + + // ‚³ƒ³ƒƒĵƒƒ³ƒˆçİşé–“‚‚‚’ċèğ˘•›‚‹ + // TransformĞ関™‚‹‚‚Żċ›žèğ˘‚’ċèğ˘•›‚‹ċż…èĤŻŞ„ + cdata.oldComponentWorldPosition = MathUtility.TransformPoint(cdata.oldComponentWorldPosition, componentNegativeM); + cdata.oldComponentWorldScale = componentWorldScl; // ‚ı‚ħƒĵƒĞŻƒŞ‚ğƒƒƒˆ + cdata.oldAnchorPosition = MathUtility.TransformPoint(cdata.oldAnchorPosition, componentNegativeM); + cdata.smoothingVelocity = MathUtility.TransformVector(cdata.smoothingVelocity, componentNegativeM); + } + + float3 oldComponentWorldPosition = cdata.oldComponentWorldPosition; + quaternion oldComponentWorldRotation = cdata.oldComponentWorldRotation; + float3 oldComponentWorldScale = cdata.oldComponentWorldScale; + + // ■‚Żƒ­‚ı‚ğƒ³‚żƒĵä½ç½ + var centerWorldPos = componentWorldPos; + var centerWorldRot = componentWorldRot; + + // ċ›şċšç‚ıƒŞ‚ıƒˆŒ‚‚‹ċ ´ċˆŻċ›şċšç‚ıċ§żċ‹˘‹‚‰ç—ċ‡ş™‚‹€Ş„ċ ´ċˆŻ‚Żƒ­‚ıƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ‚’ä½żç”¨™‚‹ + if (tdata.fixedDataChunk.IsValid) + { + float3 cen = 0; + float3 nor = 0; + float3 tan = 0; + + int v_start = tdata.proxyCommonChunk.startIndex; + + int fcnt = tdata.fixedDataChunk.dataLength; + int fstart = tdata.fixedDataChunk.startIndex; + for (int i = 0; i < fcnt; i++) + { + var l_findex = fixedArray[fstart + i]; + int vindex = l_findex + v_start; + + cen += positions[vindex]; + + var rot = rotations[vindex]; + + // ƒž‚¤ƒŠ‚ı‚ı‚ħƒĵƒĞ + if (tdata.negativeScaleSign < 0) + { + MathUtility.ToNormalTangent(rot, out float3 n, out float3 t); + rot = MathUtility.ToRotation(-n, -t); + } + + // 頂ç‚ıƒ‚¤ƒ³ƒ‰ƒƒĵ‚ş‚’äı—痁—ĤċˆĉœŸċ§żċ‹˘ä¸€ċšĉ–ıċ‘Ğċˆ‚›‚‹ + rot = math.mul(rot, vertexBindPoseRotations[vindex]); + + nor += MathUtility.ToNormal(rot); + tan += MathUtility.ToTangent(rot); + } + + // ƒž‚¤ƒŠ‚ı‚ı‚ħƒĵƒĞ + nor *= (tdata.negativeScaleDirection.x < 0 || tdata.negativeScaleDirection.z < 0) ? -1 : 1; + tan *= (tdata.negativeScaleDirection.x < 0 || tdata.negativeScaleDirection.y < 0) ? -1 : 1; + +#if MC2_DEBUG + Develop.Assert(math.length(nor) > 0.0f); + Develop.Assert(math.length(tan) > 0.0f); +#endif + centerWorldPos = cen / fcnt; + centerWorldRot = MathUtility.ToRotation(math.normalize(nor), math.normalize(tan)); // ċ˜ä½ċŒ–ċż…é ˆ + } + var wtol = MathUtility.WorldToLocalMatrix(centerWorldPos, centerWorldRot, componentWorldScl); + //Debug.Log($"centerWorldPos:{centerWorldPos}, centerWorldRot:{centerWorldRot.value}"); + //Debug.Log($"centerWorldRot nor:{math.mul(centerWorldRot, math.up())}, tan:{math.mul(centerWorldRot, math.forward())}, bin:{math.mul(centerWorldRot, math.right())}"); + + // ■ƒž‚¤ƒŠ‚ı‚ı‚ħƒĵƒĞ + if (tdata.IsNegativeScaleTeleport) + { + // ‚ğƒ³‚żƒĵċèğ˘ç”¨ċ¤‰ĉ›ƒžƒˆƒŞƒƒ‚Ż‚ı‚’計ç—(2) + float4x4 nowLW = float4x4.TRS(centerWorldPos, centerWorldRot, componentWorldScl); + float4x4 oldLW = float4x4.TRS(cdata.oldFrameWorldPosition, cdata.oldFrameWorldRotation, cdata.oldFrameWorldScale); + float4x4 negativeM = math.mul(nowLW, math.inverse(oldLW)); + cdata.negativeScaleMatrix = negativeM; + } + + // ■‚˘ƒ³‚Ѓĵ + float3 anchorDeltaVector = 0; + quaternion anchorDeltaRotation = quaternion.identity; + if (tdata.flag.IsSet(Flag_AnchorReset) || tdata.IsReset) + { + cdata.oldAnchorPosition = cdata.anchorPosition; + cdata.oldAnchorRotation = cdata.anchorRotation; + cdata.anchorComponentLocalPosition = MathUtility.InverseTransformPoint(componentWorldPos, cdata.anchorPosition, cdata.anchorRotation, 1); + } + if (tdata.flag.IsSet(Flag_Anchor)) + { + // ‚˘ƒ³‚Ѓĵç§ğċ‹•ċ›žèğ˘ċ½ħ響 + float3 anchorCenterPosition = MathUtility.TransformPoint(cdata.anchorComponentLocalPosition, cdata.anchorPosition, cdata.anchorRotation, 1); + anchorDeltaVector = anchorCenterPosition - oldComponentWorldPosition; + anchorDeltaRotation = MathUtility.FromToRotation(cdata.oldAnchorRotation, cdata.anchorRotation); + + // ‚˘ƒ³‚Ѓĵċ½ħ響ċ‰²ċˆ + float anchorRatio = 1.0f - param.inertiaConstraint.anchorInertia; + anchorDeltaVector = math.lerp(float3.zero, anchorDeltaVector, anchorRatio); + anchorDeltaRotation = math.slerp(quaternion.identity, anchorDeltaRotation, anchorRatio); + + // ĉ‰“Ħĉĥˆ™ + oldComponentWorldPosition += anchorDeltaVector; + oldComponentWorldRotation = math.mul(anchorDeltaRotation, oldComponentWorldRotation); + + tdata.flag.SetBits(Flag_InertiaShift, true); + } + + // ƒ•ƒĴƒĵƒ ç§ğċ‹•量¨é€ŸċşĤ + float3 frameDeltaVector = componentWorldPos - oldComponentWorldPosition; + float frameDeltaAngle = MathUtility.Angle(oldComponentWorldRotation, componentWorldRot); + //Debug.Log($"frameDeltaVector:{frameDeltaVector}, frameDeltaAngle:{frameDeltaAngle}"); + + // ■ƒ†ƒĴƒƒĵƒˆċˆ¤ċšïĵˆ‚³ƒ³ƒƒĵƒƒ³ƒˆċ§żċ‹˘‹‚‰ċˆ¤ċš™‚‹ïĵ‰ + // ċŒĉœŸĉ™‚ŻċŒĉœŸċ…ˆƒ†ƒĴƒƒĵƒˆƒ˘ƒĵƒ‰¨ƒ‘ƒİƒĦƒĵ‚żŒċ…£Ĥ„‚‹ + if (param.inertiaConstraint.teleportMode != InertiaConstraint.TeleportMode.None && tdata.IsReset == false) + { + // ç§ğċ‹•¨ċ›žèğ˘İĦ‚‰‹ä¸€ĉ–ıŒ—„ċ€¤‚’èĥ…ˆŸ‚‰ƒ†ƒĴƒƒĵƒˆ¨ċˆ¤ċš + bool isTeleport = false; + isTeleport = math.length(frameDeltaVector) >= param.inertiaConstraint.teleportDistance * componentScaleRatio ? true : isTeleport; + isTeleport = math.degrees(frameDeltaAngle) >= param.inertiaConstraint.teleportRotation ? true : isTeleport; + + if (isTeleport) + { + //Debug.Log($"[{teamId}] Auto Teleport!"); + switch (param.inertiaConstraint.teleportMode) + { + case InertiaConstraint.TeleportMode.Reset: + tdata.flag.SetBits(Flag_Reset, true); + break; + case InertiaConstraint.TeleportMode.Keep: + tdata.flag.SetBits(Flag_KeepTeleport, true); + break; + } + } + } + + // ■‚ıƒ ƒĵ‚¸ƒ³‚° + // ƒŻƒĵƒĞƒ‰ĉ…£ĉ€§ĉ€ĉż€Şċ¤‰ċŒ–Š‚ˆ³ċ°ċˆğżŞċ¤‰ċŒ–Ğ‚ˆ‚Š‚Żƒ­‚ıŒäıħ‚Œ‚‹ċ•éĦŒ‚’è§£ĉĥˆ™‚‹Ÿ‚Ğĉ…£ĉ€§‚’‚ıƒ ƒĵ‚¸ƒ³‚°™‚‹ + // ƒğĉ…£ĉ€§ĉ€ĉż€Şċ¤‰ċŒ–ïĵˆĉ€ç™şé€²ƒğĉ€ċœĉ­˘ïĵ‰Ğ‚ˆ‚‹‚Żƒ­‚ıäıħ‚Œç·İċ’Œ + // ƒğĉ…£ĉ€§ċ°ċˆğżŞċ¤‰ċŒ–Ğ‚ˆ‚‹‚Żƒ­‚ıĉŒŻċ‹•ç·İċ’Œ + float3 smoothDeltaVector = 0; +#if true + if (param.inertiaConstraint.movementInertiaSmoothing >= 1e-06f && !(tdata.IsKeepReset || tdata.IsReset)) + { + // ĉ…£ĉ€§é€ŸċşĤ‚’‚ıƒ ƒĵ‚¸ƒ³‚°™‚‹ + // ĉ¸ĴċšŻ‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ŒċŸèĦŒ•‚Œ‚‹ċ ´ċˆżèĦŒ†ïĵˆ†—Ş„¨ĉŒŻċ‹•Œç™şç”Ÿ™‚‹ïĵ‰ + if (tdata.IsRunning) + { + float3 frameDeltaVelocity = tdata.frameDeltaTime > 0.0f ? frameDeltaVector / tdata.frameDeltaTime : 0; // 速ċşĤƒ™‚ŻƒˆƒĞ(m/s) + float movementSpeedLimit = param.inertiaConstraint.movementSpeedLimit * componentScaleRatio; // ċŒĉœŸĉ™‚ŻċŒĉœŸċ…ˆċ€¤Œċ…£Ĥ„‚‹ + if (movementSpeedLimit >= 0.0f) + { + // ĉœ€ċ¤§é€ŸċşĤċˆĥ限 + frameDeltaVelocity = MathUtility.ClampVector(frameDeltaVelocity, movementSpeedLimit); + } + float averageRatio = math.saturate(math.pow(1.0f - param.inertiaConstraint.movementInertiaSmoothing, 3.0f) * 0.99f + 0.01f); + cdata.smoothingVelocity = math.lerp(cdata.smoothingVelocity, frameDeltaVelocity, averageRatio); // ĉŻ”é‡Ğ‚ˆ‚Šċı³ĉğ‘ċŒ– + } + //Debug.Log($"smoothingVelocity:{cdata.smoothingVelocity}"); + + // ‚ıƒ ƒĵ‚¸ƒ³‚°—Ÿĉ…£ĉ€§é€ŸċşĤĞċŸş„Ĥïĵ‘¤ċ‰‚³ƒ³ƒƒĵƒƒ³ƒˆä½ç½‚’補ĉ­£™‚‹ + // ċ‡Ĥ理的ĞŻ‚˘ƒ³‚Ѓĵ¨ċŒ˜è€ƒˆ + float3 smoothPos = componentWorldPos - cdata.smoothingVelocity * tdata.frameDeltaTime; + smoothDeltaVector = smoothPos - oldComponentWorldPosition; + oldComponentWorldPosition = smoothPos; + tdata.flag.SetBits(Flag_InertiaShift, true); + } +#endif + + // ƒŞ‚ğƒƒƒˆŠ‚ˆ³ĉœ€ĉ–°‚ğƒ³‚żƒĵċş§ĉ¨™¨—Ĥĉ ĵ納 + cdata.frameWorldPosition = centerWorldPos; + cdata.frameWorldRotation = centerWorldRot; + cdata.frameWorldScale = componentWorldScl; + if (tdata.IsReset) + { + //Debug.LogWarning($"Team Reset!"); + cdata.oldComponentWorldPosition = componentWorldPos; + cdata.oldComponentWorldRotation = componentWorldRot; + cdata.oldComponentWorldScale = componentWorldScl; + oldComponentWorldPosition = componentWorldPos; + oldComponentWorldRotation = componentWorldRot; + oldComponentWorldScale = componentWorldScl; + + cdata.oldFrameWorldPosition = centerWorldPos; + cdata.oldFrameWorldRotation = centerWorldRot; + cdata.oldFrameWorldScale = componentWorldScl; + cdata.nowWorldPosition = centerWorldPos; + cdata.nowWorldRotation = centerWorldRot; + //cdata.nowWorldScale = centerWorldScl; + cdata.oldWorldPosition = centerWorldPos; + cdata.oldWorldRotation = centerWorldRot; + //tdata.centerWorldPosition = centerWorldPos; + } + else if (tdata.IsNegativeScaleTeleport) + { + // ƒž‚¤ƒŠ‚ı‚ı‚ħƒĵƒĞ + // ‚ğƒ³‚żƒĵçİşé–“Ğ関™‚‹‚‚ŻƒŞ‚ğƒƒƒˆ™‚‹ + //Debug.LogWarning($"Team NegativeScale Reset!"); + cdata.oldFrameWorldPosition = centerWorldPos; + cdata.oldFrameWorldRotation = centerWorldRot; + cdata.oldFrameWorldScale = componentWorldScl; + cdata.nowWorldPosition = centerWorldPos; + cdata.nowWorldRotation = centerWorldRot; + //cdata.nowWorldScale = centerWorldScl; + cdata.oldWorldPosition = centerWorldPos; + cdata.oldWorldRotation = centerWorldRot; + //tdata.centerWorldPosition = centerWorldPos; + } + + // ■ƒŻƒĵƒĞƒ‰ĉ…£ĉ€§‚·ƒ•ƒˆ + float3 workOldComponentPosition = oldComponentWorldPosition; + quaternion workOldComponentRotation = oldComponentWorldRotation; + if (tdata.IsReset) + { + // ƒŞ‚ğƒƒƒˆïĵˆŞ—ïĵ‰ + cdata.frameComponentShiftVector = 0; + cdata.frameComponentShiftRotation = quaternion.identity; + + // ‚ıƒ ƒĵ‚¸ƒ³‚°ƒŞ‚ğƒƒƒˆ + cdata.smoothingVelocity = 0; + smoothDeltaVector = 0; + } + else + { + cdata.frameComponentShiftVector = componentWorldPos - oldComponentWorldPosition; + cdata.frameComponentShiftRotation = MathUtility.FromToRotation(oldComponentWorldRotation, componentWorldRot); + //Debug.Log($"frameComponentShiftVector:{cdata.frameComponentShiftVector}, frameComponentShiftRotation:{cdata.frameComponentShiftRotation.value}"); + float moveShiftRatio = 0.0f; + float rotationShiftRatio = 0.0f; + + // ■ċ…¨ä½“ĉ…£ĉ€§‚·ƒ•ƒˆ + float movementShift = 1.0f - param.inertiaConstraint.worldInertia; // ċŒĉœŸĉ™‚ŻċŒĉœŸċ…ˆċ€¤Œċ…£Ĥ„‚‹ + float rotationShift = 1.0f - param.inertiaConstraint.worldInertia; // ċŒĉœŸĉ™‚ŻċŒĉœŸċ…ˆċ€¤Œċ…£Ĥ„‚‹ + + // Keepƒ†ƒĴƒƒĵƒˆ‚‚—ŻCullingĉ™‚Ż‚·ƒ•ƒˆé‡100%§ċŸè£… + //bool keep = tdata.IsKeepReset || tdata.IsCameraCullingInvisible; + bool keep = tdata.IsKeepReset || tdata.IsCullingInvisible; + movementShift = keep ? 1.0f : movementShift; + rotationShift = keep ? 1.0f : rotationShift; + + if (movementShift > Define.System.Epsilon || rotationShift > Define.System.Epsilon) + { + // ċ…¨ä½“‚·ƒ•ƒˆ‚‚Š + tdata.flag.SetBits(Flag_InertiaShift, true); + moveShiftRatio = movementShift; + rotationShiftRatio = rotationShift; + + workOldComponentPosition = math.lerp(workOldComponentPosition, componentWorldPos, movementShift); + workOldComponentRotation = math.slerp(workOldComponentRotation, componentWorldRot, rotationShift); + } + + // ■ĉœ€ċ¤§ç§ğċ‹•速ċşĤċˆĥ限ïĵˆċ…¨ä½“‚·ƒ•ƒˆçµĉžœ‹‚‰è¨ˆç—™‚‹ïĵ‰ + float movementSpeedLimit = param.inertiaConstraint.movementSpeedLimit * componentScaleRatio; // ċŒĉœŸĉ™‚ŻċŒĉœŸċ…ˆċ€¤Œċ…£Ĥ„‚‹ + float rotationSpeedLimit = param.inertiaConstraint.rotationSpeedLimit; // ċŒĉœŸĉ™‚ŻċŒĉœŸċ…ˆċ€¤Œċ…£Ĥ„‚‹ + float3 deltaVector = componentWorldPos - workOldComponentPosition; + float deltaAngle = MathUtility.Angle(workOldComponentRotation, componentWorldRot); + float frameSpeed = tdata.frameDeltaTime > 0.0f ? math.length(deltaVector) / tdata.frameDeltaTime : 0.0f; + float frameRotationSpeed = tdata.frameDeltaTime > 0.0f ? math.degrees(deltaAngle) / tdata.frameDeltaTime : 0.0f; + if (frameSpeed > movementSpeedLimit && movementSpeedLimit >= 0.0f) + { + tdata.flag.SetBits(Flag_InertiaShift, true); + float moveLimitRatio = math.saturate(math.max(frameSpeed - movementSpeedLimit, 0.0f) / frameSpeed); + moveShiftRatio = math.lerp(moveShiftRatio, 1.0f, moveLimitRatio); + workOldComponentPosition = math.lerp(workOldComponentPosition, componentWorldPos, moveLimitRatio); + } + if (frameRotationSpeed > rotationSpeedLimit && rotationSpeedLimit >= 0.0f) + { + tdata.flag.SetBits(Flag_InertiaShift, true); + float rotationLimitRatio = math.saturate(math.max(frameRotationSpeed - rotationSpeedLimit, 0.0f) / frameRotationSpeed); + rotationShiftRatio = math.lerp(rotationShiftRatio, 1.0f, rotationLimitRatio); + workOldComponentRotation = math.slerp(workOldComponentRotation, componentWorldRot, rotationLimitRatio); + } + + // äğ–ċ½ħ響 + float otherShiftRatio = 0.0f; + + // ĉ›´ĉ–°‚ı‚­ƒƒƒ—Ğ‚ˆ‚‹‚·ƒ•ƒˆ + // ĉ›´ĉ–°‚ı‚­ƒƒƒ—ĉ™‚Ż‚ı‚­ƒƒƒ—ĉ™‚é–“ċˆ†ƒŻƒĵƒĞƒ‰ĉ…£ĉ€§‚·ƒ•ƒˆ‚’èĦŒ† + if (tdata.skipCount > 0) + { + otherShiftRatio = math.lerp(otherShiftRatio, 1.0f, math.saturate((tdata.skipCount * simulationDeltaTime) / (tdata.frameDeltaTime * tdata.nowTimeScale))); + } + + // ċ‰ċšċŒ–ĉ™‚間中Żĉ…£ĉ€§‚’ĉŠ‘ˆ‚‹ + if (tdata.velocityWeight < 1.0f) + { + otherShiftRatio = math.lerp(otherShiftRatio, 1.0f, 1.0f - tdata.velocityWeight); + } + + // ‚ż‚¤ƒ ‚ı‚ħƒĵƒĞ + // ‚ż‚¤ƒ ‚ı‚ħƒĵƒĞċ½ħ響ċˆ†ƒŻƒĵƒĞƒ‰ĉ…£ĉ€§‚·ƒ•ƒˆ‚’èĦŒ† + if (tdata.nowTimeScale < 1.0f) + { + otherShiftRatio = math.lerp(otherShiftRatio, 1.0f, 1.0f - tdata.nowTimeScale); + } + + if (otherShiftRatio > 0.0f) + { + tdata.flag.SetBits(Flag_InertiaShift, true); + moveShiftRatio = math.lerp(moveShiftRatio, 1.0f, otherShiftRatio); + workOldComponentPosition = math.lerp(workOldComponentPosition, componentWorldPos, otherShiftRatio); + rotationShiftRatio = math.lerp(rotationShiftRatio, 1.0f, otherShiftRatio); + workOldComponentRotation = math.slerp(workOldComponentRotation, componentWorldRot, otherShiftRatio); + } + + // ■ĉ…£ĉ€§‚·ƒ•ƒˆĉœ€çµ‚設ċš + if (tdata.IsInertiaShift) + { + //Debug.Log($"moveShiftRatio:{moveShiftRatio}, rotationShiftRatio:{rotationShiftRatio}"); + + cdata.frameComponentShiftVector *= moveShiftRatio; + cdata.frameComponentShiftRotation = math.slerp(quaternion.identity, cdata.frameComponentShiftRotation, rotationShiftRatio); + + // ‚˘ƒ³‚ЃĵĞ‚ˆ‚‹ĉ‰“Ħĉĥˆ— + cdata.frameComponentShiftVector += anchorDeltaVector; + cdata.frameComponentShiftRotation = math.mul(anchorDeltaRotation, cdata.frameComponentShiftRotation); + + // ‚ıƒ ƒĵ‚¸ƒ³‚°ċ½ħ響ĉ‰“Ħĉĥˆ— + cdata.frameComponentShiftVector += smoothDeltaVector; + + cdata.oldFrameWorldPosition = MathUtility.ShiftPosition(cdata.oldFrameWorldPosition, cdata.oldComponentWorldPosition, cdata.frameComponentShiftVector, cdata.frameComponentShiftRotation); + cdata.oldFrameWorldRotation = math.mul(cdata.frameComponentShiftRotation, cdata.oldFrameWorldRotation); + + cdata.nowWorldPosition = MathUtility.ShiftPosition(cdata.nowWorldPosition, cdata.oldComponentWorldPosition, cdata.frameComponentShiftVector, cdata.frameComponentShiftRotation); + cdata.nowWorldRotation = math.mul(cdata.frameComponentShiftRotation, cdata.nowWorldRotation); + } + } + //Debug.Log($"team:[{teamId}] frameComponentShiftVector:{cdata.frameComponentShiftVector}, frameComponentShiftRotation:{cdata.frameComponentShiftRotation}"); + //Debug.Log($"team:[{teamId}] centerTransformIndex:{centerTransformIndex}"); + //Debug.Log($"team:[{teamId}] worldInertia:{param.inertiaConstraint.worldInertia}"); + //Debug.Log($"team:[{teamId}] movementSpeedLimit:{param.inertiaConstraint.movementSpeedLimit}"); + //Debug.Log($"team:[{teamId}] rotationSpeedLimit:{param.inertiaConstraint.rotationSpeedLimit}"); + + // ■ƒŻƒĵƒĞƒ‰ç§ğċ‹•ĉ–ıċ‘¨é€ŸċşĤċ‰²‚Šċ‡ş—ïĵˆĉ…£ĉ€§‚·ƒ•ƒˆċŒç§ğċ‹•量§è¨ˆç—ïĵ‰ + float3 movingVector = componentWorldPos - workOldComponentPosition; + float movingLength = math.length(movingVector); + cdata.frameMovingSpeed = tdata.frameDeltaTime > 0.0f ? movingLength / tdata.frameDeltaTime : 0.0f; + cdata.frameMovingSpeed *= tdata.nowTimeScale > 1e-06f ? 1.0f / tdata.nowTimeScale : 0.0f; // ‚ż‚¤ƒ ‚ı‚ħƒĵƒĞ考ĉ… + cdata.frameMovingDirection = movingLength > 1e-06f ? movingVector / movingLength : 0; + + //Debug.Log($"frameWorldPosition:{cdata.frameWorldPosition}, framwWorldRotation:{cdata.frameWorldRotation.value}"); + //Debug.Log($"oldFrameWorldPosition:{cdata.oldFrameWorldPosition}, oldFrameWorldRotation:{cdata.oldFrameWorldRotation.value}"); + //Debug.Log($"nowWorldPosition:{cdata.nowWorldPosition}, nowWorldRotation:{cdata.nowWorldRotation.value}"); + //Debug.Log($"oldWorldPosition:{cdata.oldWorldPosition}, oldWorldRotation:{cdata.oldWorldRotation.value}"); + + // ‚ğƒ³‚żƒĵƒ­ƒĵ‚ЃĞċş§ĉ¨™ + float3 localCenterPos = MathUtility.InverseTransformPoint(centerWorldPos, wtol); + cdata.frameLocalPosition = localCenterPos; + + // 速ċşĤċ‰ċšċŒ–ċ‡Ĥ理 + if (tdata.flag.IsSet(Flag_Reset) || tdata.flag.IsSet(Flag_TimeReset)) + { + tdata.velocityWeight = param.stablizationTimeAfterReset > 1e-06f ? 0.0f : 1.0f; + tdata.blendWeight = tdata.velocityWeight; + } + + // 風ċ½ħ響‚’è¨ˆç— ======================================================== + //var oldTeamWindData = teamWindArray[teamId]; + var newTeamWindData = new TeamWindData(); + if (windZoneCount > 0 && param.wind.IsValid()) + { + float minVolume = float.MaxValue; + int addWindCount = 0; + int latestWindId = -1; + + for (int windId = 0; windId < windZoneCount; windId++) + { + var wdata = windDataArray[windId]; + if (wdata.IsValid() == false || wdata.IsEnable() == false) + continue; + + // ƒƒĵƒ Œé˘¨‚¨ƒŞ‚˘Ğċ…£Ĥ„‚‹‹ċˆ¤ċš™‚‹ + // ċŠ ç—風Żĉœ€ċ¤§ïĵ“¤§ + bool isAdditin = wdata.IsAddition(); + if (isAdditin && addWindCount >= 3) + continue; + + // 風‚ƒĵƒ³ƒ­ƒĵ‚ЃĞä½ç½ + float3 lpos = math.transform(wdata.worldToLocalMatrix, centerWorldPos); + float llen = math.length(lpos); + + // ‚¨ƒŞ‚˘ċˆ¤ċš + switch (wdata.mode) + { + case MagicaWindZone.Mode.BoxDirection: + var lv = math.abs(lpos) * 2; + if (lv.x > wdata.size.x || lv.y > wdata.size.y || lv.z > wdata.size.z) + continue; + break; + case MagicaWindZone.Mode.SphereDirection: + case MagicaWindZone.Mode.SphereRadial: + if (llen > wdata.size.x) + continue; + break; + } + + // ‚¨ƒŞ‚˘é˘¨ċ ´ċˆŻƒœƒŞƒƒĵƒ ċˆ¤ċšïĵˆä½“çݍŒċ°•„‚‚Œċ„Şċ…ˆïĵ‰ + if (isAdditin == false && wdata.zoneVolume > minVolume) + continue; + + // 風ĉ–ıċ‘(world) + float3 mainDirection = wdata.worldWindDirection; + switch (wdata.mode) + { + case MagicaWindZone.Mode.SphereRadial: + if (llen <= 1e-06f) + continue; + var v = centerWorldPos - wdata.worldPositin; + mainDirection = math.normalize(v); + break; + } + //Debug.Log($"wdir:{mainDirection}"); + + // 風ċŠ› + float windMain = wdata.main; + switch (wdata.mode) + { + case MagicaWindZone.Mode.SphereRadial: + // ĉ¸›èĦ° + if (llen <= 1e-06f) + continue; + float depth = math.saturate(llen / wdata.size.x); + float attenuation = wdata.attenuation.MC2EvaluateCurveClamp01(depth); + windMain *= attenuation; + break; + } + + // 計痁™‚‹é˘¨¨—Ĥç™ğ録™‚‹ + var windInfo = new TeamWindInfo() + { + windId = windId, + time = -Define.System.WindMaxTime, // ƒž‚¤ƒŠ‚ıċ€¤‹‚‰‚ı‚żƒĵƒˆ + main = windMain, + direction = mainDirection + }; + if (isAdditin) + { + newTeamWindData.AddOrReplaceWindZone(windInfo, windData); + addWindCount++; + } + else + { + newTeamWindData.RemoveWindZone(latestWindId); + newTeamWindData.AddOrReplaceWindZone(windInfo, windData); + minVolume = wdata.zoneVolume; + latestWindId = windId; + } + } + } + + // ç§ğċ‹•風ç§ğĉ¤ + newTeamWindData.movingWind = windData.movingWind; + windData.CopyFrom(newTeamWindData); + } + + /// + /// ‚ıƒ†ƒƒƒ—”¨ċ‰ċ‡Ĥ理ïĵˆ‚ıƒ†ƒƒƒ—é–‹ċ§‹ĞċŸèĦŒ•‚Œ‚‹ïĵ‰ + /// + internal static void SimulationStepTeamUpdate( + int updateIndex, + float simulationDeltaTime, + // team + int teamId, + ref TeamData tdata, + ref ClothParameters param, + ref InertiaConstraint.CenterData cdata, + ref TeamWindData wdata + ) + { + // ■‚ıƒ†ƒƒƒ—ċŸèĦŒĉ™‚żċ‡Ĥ理™‚‹ + bool runStep = updateIndex < tdata.updateCount; + tdata.flag.SetBits(Flag_StepRunning, runStep); + + //Debug.Log($"team[{teamId}] ({updateIndex}/{tdata.updateCount})"); + + // ■ĉ™‚é–“ĉ›´ĉ–° --------------------------------------------------- + // nowUpdateTimeĉ›´ĉ–° + tdata.nowUpdateTime += simulationDeltaTime; + + // äğŠċ›žƒ•ƒĴƒĵƒ ċ‰²ċˆ‚’計痁™‚‹ + // frameStartTime‹‚‰timeċŒşé–“§nowUpdateTimeċ‰²ċˆ + //tdata.frameInterpolation = (tdata.nowUpdateTime - tdata.frameOldTime) / (tdata.time - tdata.frameOldTime); + // ċżµç‚ş€0除痃‚§ƒƒ‚݁¨0-1‚Żƒİƒ³ƒ—‚’ċ…‚Œ‚‹ + float b = tdata.time - tdata.frameOldTime; + tdata.frameInterpolation = b > 0 ? math.saturate((tdata.nowUpdateTime - tdata.frameOldTime) / b) : 1.0f; + + //Debug.Log($"Team[{teamId}] time.{tdata.time}, oldTime:{tdata.oldTime}, frameTime:{tdata.frameUpdateTime}, frameOldTime:{tdata.frameOldTime}, nowUpdateTime:{tdata.nowUpdateTime}, frameInterp:{tdata.frameInterpolation}"); + + // ■‚ğƒ³‚żƒĵ --------------------------------------------------- + // çċœ¨‚ıƒ†ƒƒƒ—§‚ğƒ³‚żƒĵƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ċ§żċ‹˘‚’ĉħ‚‚‚‹ + cdata.oldWorldPosition = cdata.nowWorldPosition; + cdata.oldWorldRotation = cdata.nowWorldRotation; + cdata.nowWorldPosition = math.lerp(cdata.oldFrameWorldPosition, cdata.frameWorldPosition, tdata.frameInterpolation); + cdata.nowWorldRotation = math.slerp(cdata.oldFrameWorldRotation, cdata.frameWorldRotation, tdata.frameInterpolation); + cdata.nowWorldRotation = math.normalize(cdata.nowWorldRotation); // ċż…èĤ + float3 wscl = math.lerp(cdata.oldFrameWorldScale, cdata.frameWorldScale, tdata.frameInterpolation); + //cdata.nowWorldScale = wscl; + + // ‚ıƒ†ƒƒƒ—”¨ç§ğċ‹•量 + cdata.stepVector = cdata.nowWorldPosition - cdata.oldWorldPosition; + cdata.stepRotation = MathUtility.FromToRotation(cdata.oldWorldRotation, cdata.nowWorldRotation); + float stepAngle = MathUtility.Angle(cdata.oldWorldRotation, cdata.nowWorldRotation); + //Debug.Log($"Team[{teamId}] stepVector:{cdata.stepVector}, stepRotation:{cdata.stepRotation}, stepAngle:{stepAngle}"); + //Debug.Log($"Team[{teamId}] stepVector:{math.length(cdata.stepVector)}, frameInterpolation:{tdata.frameInterpolation}"); + + // ƒ­ƒĵ‚ЃĞĉ…£ĉ€§ + float localMovementInertia = 1.0f - param.inertiaConstraint.localInertia; + float localRotationInertia = 1.0f - param.inertiaConstraint.localInertia; +#if true + float3 localVector = cdata.stepVector * (1.0f - localMovementInertia); + float localMovementSpeed = math.length(localVector) / simulationDeltaTime; // ƒ­ƒĵ‚ЃĞç§ğċ‹•速ċşĤ(m/s) + if (localMovementSpeed > param.inertiaConstraint.localMovementSpeedLimit && param.inertiaConstraint.localMovementSpeedLimit >= 0.0f) + { + float t = param.inertiaConstraint.localMovementSpeedLimit / localMovementSpeed; + localMovementInertia = math.lerp(1.0f, localMovementInertia, t); + } + float localAngle = stepAngle * (1.0f - localRotationInertia); + float localAngleSpeed = math.degrees(localAngle / simulationDeltaTime); // ƒ­ƒĵ‚ЃĞċ›žèğ˘é€ŸċşĤ(deg/s) + if (localAngleSpeed > param.inertiaConstraint.localRotationSpeedLimit && param.inertiaConstraint.localRotationSpeedLimit >= 0.0f) + { + float t = param.inertiaConstraint.localRotationSpeedLimit / localAngleSpeed; + localRotationInertia = math.lerp(1.0f, localRotationInertia, t); + } +#endif + cdata.stepMoveInertiaRatio = localMovementInertia; + cdata.stepRotationInertiaRatio = localRotationInertia; + + // ĉœ€çµ‚ĉ…£ĉ€§ + cdata.inertiaVector = math.lerp(float3.zero, cdata.stepVector, localMovementInertia); + cdata.inertiaRotation = math.slerp(quaternion.identity, cdata.stepRotation, localRotationInertia); + //Debug.Log($"Team[{teamId}] localMovementInertia:{localMovementInertia}, localRotationInertia:{localRotationInertia}, inertiaVector:{cdata.inertiaVector}, inertiaRotation:{cdata.inertiaRotation}"); + + // ■遠ċżƒċŠ›ç”¨ƒ‘ƒİƒĦƒĵ‚żç—ċ‡ş + // äğŠċ›ž‚ıƒ†ƒƒƒ—§ċ›žèğ˘é€ŸċşĤ¨ċ›žèğ˘èğ¸ + cdata.angularVelocity = stepAngle / simulationDeltaTime; // ċ›žèğ˘é€ŸċşĤ(rad/s) + if (cdata.angularVelocity > Define.System.Epsilon) + MathUtility.ToAngleAxis(cdata.stepRotation, out _, out cdata.rotationAxis); + else + cdata.rotationAxis = 0; + //Debug.Log($"Team[{teamId}] angularVelocity:{math.degrees(cdata.angularVelocity)}, axis:{cdata.rotationAxis}, q:{cdata.stepRotation.value}"); + //Debug.Log($"Team[{teamId}] angularVelocity:{math.degrees(cdata.angularVelocity)}, now:{cdata.nowWorldRotation.value}, old:{cdata.oldWorldRotation.value}"); + + // ƒƒĵƒ ‚ı‚ħƒĵƒĞċ€çއ + tdata.scaleRatio = math.max(math.length(wscl) / math.length(tdata.initScale), 1e-06f); + //Debug.Log($"[{teamId}] scaleRatio:{tdata.scaleRatio}"); + + // ■重ċŠ›ĉ–ıċ‘ċ‰²ċˆ --------------------------------------------------- + float gravityDot = 1.0f; + if (math.lengthsq(param.worldGravityDirection) > Define.System.Epsilon) + { + // ƒž‚¤ƒŠ‚ı‚ı‚ħƒĵƒĞ + float3 initLocalGravityDirection = cdata.initLocalGravityDirection; + initLocalGravityDirection.y *= tdata.negativeScaleDirection.y; // Yƒž‚¤ƒŠ‚ı‚ı‚ħƒĵƒĞĉ™‚żYè𸂒ċèğ˘ + + var worldFalloffDir = math.mul(cdata.nowWorldRotation, initLocalGravityDirection); + gravityDot = math.dot(worldFalloffDir, param.worldGravityDirection); + gravityDot = math.saturate(gravityDot * 0.5f + 0.5f); + } + tdata.gravityDot = gravityDot; + //Develop.DebugLog($"gdot:{gravityDot}"); + + // ■重ċŠ›ĉ¸›èĦ° --------------------------------------------------- + float gravityRatio = 1.0f; + if (param.gravity > 1e-06f && param.gravityFalloff > 1e-06f) + { + gravityRatio = math.lerp(math.saturate(1.0f - param.gravityFalloff), 1.0f, math.saturate(1.0f - gravityDot)); + } + tdata.gravityRatio = gravityRatio; + + // 速ċşĤċ‰ċšċŒ–ĉ™‚é–“é€ŸċşĤċ‰²ċˆ‚’ĉ›´ĉ–° + if (tdata.velocityWeight < 1.0f) + { + float addw = param.stablizationTimeAfterReset > 1e-06f ? simulationDeltaTime / param.stablizationTimeAfterReset : 1.0f; + tdata.velocityWeight = math.saturate(tdata.velocityWeight + addw); + } + //Debug.Log($"{tdata.velocityWeight}"); + + // ‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³çµĉžœƒ–ƒĴƒ³ƒ‰ċ‰²ċˆ + tdata.blendWeight = math.saturate(tdata.velocityWeight * param.blendWeight * tdata.distanceWeight); + //Debug.Log($"{tdata.blendWeight}"); + + // 風ĉ™‚é–“ĉ›´ĉ–° + UpdateWind(simulationDeltaTime, teamId, tdata, param.wind, cdata, ref wdata); + + //Debug.Log($"[{updateIndex}/{updateCount}] frameRatio:{data.frameInterpolation}, inertiaPosition:{idata.inertiaPosition}"); + } + + // ċ„風‚ƒĵƒ³ĉ™‚é–“ĉ›´ĉ–° + static void UpdateWind( + float simulationDeltaTime, + int teamId, + in TeamData tdata, + in WindParams windParams, + in InertiaConstraint.CenterData cdata, + ref TeamWindData teamWindData + ) + { + if (windParams.IsValid() == false) + return; + + // ‚ƒĵƒ³é˘¨ + int cnt = teamWindData.ZoneCount; + for (int i = 0; i < cnt; i++) + { + var windInfo = teamWindData.windZoneList[i]; + UpdateWindTime(ref windInfo, windParams.frequency, simulationDeltaTime); + teamWindData.windZoneList[i] = windInfo; + } + + // ç§ğċ‹•風 + var movingWindInfo = teamWindData.movingWind; + movingWindInfo.main = 0; + if (windParams.movingWind > 0.01f) + { + movingWindInfo.main = (cdata.frameMovingSpeed * windParams.movingWind) / tdata.scaleRatio; + movingWindInfo.direction = -cdata.frameMovingDirection; + UpdateWindTime(ref movingWindInfo, windParams.frequency, simulationDeltaTime); + } + teamWindData.movingWind = movingWindInfo; + } + + static void UpdateWindTime(ref TeamWindInfo windInfo, float frequency, float simulationDeltaTime) + { + // 風速係ĉ•° + float mainRatio = windInfo.main / Define.System.WindBaseSpeed; // 0.0 ~ + + // ċŸşĉœĴċ‘¨ĉœŸ + float freq = 0.2f + mainRatio * 0.5f; + freq *= frequency; // 0.0 ~ 2.0f; + freq = math.min(freq, 1.5f); // max 1.5 + freq *= simulationDeltaTime; + + // ĉ™‚é–“ċŠ ç— + windInfo.time = windInfo.time + freq; + + // time‚ރĵƒƒĵƒ•ƒ­ƒĵċŻç­– + if (windInfo.time > Define.System.WindMaxTime) // 約6ĉ™‚é–“ + windInfo.time -= Define.System.WindMaxTime * 2; // ƒž‚¤ƒŠ‚ıċ´‹‚‰ċ†‚ı‚żƒĵƒˆ + } + + /// + /// ‚Żƒ­‚ı‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ĉ›´ĉ–°ċŒċ‡Ĥ理 + /// + internal static void SimulationPostTeamUpdate( + // team + ref TeamData tdata, + ref InertiaConstraint.CenterData cdata + ) + { + // ‚³ƒ³ƒƒĵƒƒ³ƒˆä½ç½ + cdata.oldComponentWorldPosition = cdata.componentWorldPosition; + cdata.oldComponentWorldRotation = cdata.componentWorldRotation; + cdata.oldComponentWorldScale = cdata.componentWorldScale; + + if (tdata.IsRunning) + { + // ‚ğƒ³‚żƒĵ‚’ĉ›´ĉ–° + cdata.oldFrameWorldPosition = cdata.frameWorldPosition; + cdata.oldFrameWorldRotation = cdata.frameWorldRotation; + cdata.oldFrameWorldScale = cdata.frameWorldScale; + + // ċ¤–ċŠ›‚ŻƒŞ‚˘ + tdata.forceMode = ClothForceMode.None; + tdata.impactForce = 0; + + // ‚ı‚­ƒƒƒ— + tdata.skipCount = 0; + } + + // ‚˘ƒ³‚Ѓĵ + cdata.oldAnchorPosition = cdata.anchorPosition; + cdata.oldAnchorRotation = cdata.anchorRotation; + cdata.anchorComponentLocalPosition = MathUtility.InverseTransformPoint(cdata.componentWorldPosition, cdata.anchorPosition, cdata.anchorRotation, 1); + + // ƒ•ƒİ‚°ƒŞ‚ğƒƒƒˆ + tdata.flag.SetBits(Flag_Reset, false); + tdata.flag.SetBits(Flag_TimeReset, false); + tdata.flag.SetBits(Flag_Running, false); + tdata.flag.SetBits(Flag_StepRunning, false); + tdata.flag.SetBits(Flag_KeepTeleport, false); + tdata.flag.SetBits(Flag_InertiaShift, false); + tdata.flag.SetBits(Flag_NegativeScaleTeleport, false); + + // ĉ™‚é–“èŞżĉ•´ïĵˆfloatç²ċşĤċ•éĦŒ¸ċŻċ‡Ĥïĵ‰ + const float limitTime = 3600.0f; // 60min + if (tdata.time > limitTime * 2) + { + tdata.time -= limitTime; + tdata.oldTime -= limitTime; + tdata.nowUpdateTime -= limitTime; + tdata.oldUpdateTime -= limitTime; + tdata.frameUpdateTime -= limitTime; + tdata.frameOldTime -= limitTime; + } + } + + //========================================================================================= + public void InformationLog(StringBuilder allsb) + { + StringBuilder sb = new StringBuilder(); + + sb.AppendLine($"========== Team Manager =========="); + if (IsValid() == false) + { + sb.AppendLine($"Team Manager. Invalid."); + sb.AppendLine(); + Debug.Log(sb.ToString()); + allsb.Append(sb); + } + else + { + sb.AppendLine($"Team Manager. Team:{TeamCount}, Mapping:{MappingCount}, Monitoring:{monitoringProcessSet.Count}"); + sb.AppendLine($" -teamDataArray:{teamDataArray.ToSummary()}"); + sb.AppendLine($" -teamWindArray:{teamWindArray.ToSummary()}"); + sb.AppendLine($" -mappingDataArray:{mappingDataArray.ToSummary()}"); + sb.AppendLine($" -parameterArray:{parameterArray.ToSummary()}"); + sb.AppendLine($" -centerDataArray:{centerDataArray.ToSummary()}"); + Debug.Log(sb.ToString()); + allsb.Append(sb); + + for (int i = 1; i < TeamCount; i++) + { + var tdata = teamDataArray[i]; + if (tdata.IsValid == false) + continue; + + sb.Clear(); + + var mappingList = teamMappingIndexArray[i]; + + var cprocess = GetClothProcess(i); + if (cprocess == null) + { + sb.AppendLine($"ID:{i} cprocess is null!"); + Debug.LogWarning(sb.ToString()); + allsb.Append(sb); + continue; + } + var cloth = cprocess.cloth; + if (cloth == null) + { + sb.AppendLine($"ID:{i} cloth is null!"); + Debug.LogWarning(sb.ToString()); + allsb.Append(sb); + continue; + } + + sb.AppendLine($"ID:{i} [{cprocess.Name}] state:0x{cprocess.GetStateFlag().Value:X}, Flag:0x{tdata.flag.Value:X}, Particle:{tdata.ParticleCount}, Collider:{cprocess.colliderDict.Count} Proxy:{tdata.proxyMeshType}, Mapping:{mappingList.Length}"); + sb.AppendLine($" -centerTransformIndex {tdata.centerTransformIndex}"); + sb.AppendLine($" -initScale {tdata.initScale}"); + sb.AppendLine($" -scaleRatio {tdata.scaleRatio}"); + sb.AppendLine($" -animationPoseRatio {tdata.animationPoseRatio}"); + sb.AppendLine($" -blendWeight {tdata.blendWeight}"); + + // ċŒĉœŸ + sb.AppendLine($" Sync:{cloth.SyncPartnerCloth}, SyncParentCount:{tdata.syncParentTeamId.Length}"); + + // chunkĉƒ…ċ ħ + sb.AppendLine($" -ProxyTransformChunk {tdata.proxyTransformChunk}"); + sb.AppendLine($" -ProxyCommonChunk {tdata.proxyCommonChunk}"); + sb.AppendLine($" -ProxyMeshChunk {tdata.proxyMeshChunk}"); + sb.AppendLine($" -ProxyBoneChunk {tdata.proxyBoneChunk}"); + sb.AppendLine($" -ProxySkinBoneChunk {tdata.proxySkinBoneChunk}"); + sb.AppendLine($" -ProxyTriangleChunk {tdata.proxyTriangleChunk}"); + sb.AppendLine($" -ProxyEdgeChunk {tdata.proxyEdgeChunk}"); + sb.AppendLine($" -BaseLineChunk {tdata.baseLineChunk}"); + sb.AppendLine($" -BaseLineDataChunk {tdata.baseLineDataChunk}"); + sb.AppendLine($" -ParticleChunk {tdata.particleChunk}"); + sb.AppendLine($" -ColliderChunk {tdata.colliderChunk}"); + sb.AppendLine($" -ColliderTrnasformChunk {tdata.colliderTransformChunk}"); + sb.AppendLine($" -colliderCount {tdata.colliderCount}"); + + // mappingĉƒ…ċ ħ + sb.AppendLine($" *Mapping Count {mappingList.Length}"); + if (mappingList.Length > 0) + { + for (int j = 0; j < mappingList.Length; j++) + { + int mid = mappingList[j]; + var mdata = mappingDataArray[mid]; + sb.AppendLine($" *Mapping Mid:{mid}, Vertex:{mdata.VertexCount}"); + sb.AppendLine($" -teamId:{mdata.teamId}"); + sb.AppendLine($" -centerTransformIndex:{mdata.centerTransformIndex}"); + sb.AppendLine($" -mappingCommonChunk:{mdata.mappingCommonChunk}"); + sb.AppendLine($" -toProxyMatrix:{mdata.toProxyMatrix}"); + sb.AppendLine($" -toProxyRotation:{mdata.toProxyRotation}"); + sb.AppendLine($" -sameSpace:{mdata.sameSpace}"); + sb.AppendLine($" -toMappingMatrix:{mdata.toMappingMatrix}"); + sb.AppendLine($" -scaleRatio:{mdata.scaleRatio}"); + sb.AppendLine($" -renderDataWorkIndex:{mdata.renderDataWorkIndex}"); + } + } + + // constraint + sb.AppendLine($" +DistanceStartChunk {tdata.distanceStartChunk}"); + sb.AppendLine($" +DistanceDataChunk {tdata.distanceDataChunk}"); + sb.AppendLine($" +BendingPairChunk {tdata.bendingPairChunk}"); + sb.AppendLine($" +selfPointChunk {tdata.selfPointChunk}"); + sb.AppendLine($" +selfEdgeChunk {tdata.selfEdgeChunk}"); + sb.AppendLine($" +selfTriangleChunk {tdata.selfTriangleChunk}"); + + // wind + var wdata = teamWindArray[i]; + sb.AppendLine($" #Wind ZoneCount:{wdata.ZoneCount}"); + for (int j = 0; j < wdata.ZoneCount; j++) + { + sb.AppendLine($" [{j}] {wdata.windZoneList[j].ToString()}"); + } + sb.AppendLine($" [Move] {wdata.movingWind.ToString()}"); + + + Debug.Log(sb.ToString()); + allsb.Append(sb); + } + allsb.AppendLine(); + + // MappingData + sb.Clear(); + int mappingCount = mappingDataArray.Count; + sb.AppendLine($"#MappingData Count:{mappingCount}"); + for (int i = 0; i < mappingCount; i++) + { + var mdata = mappingDataArray[i]; + if (mdata.IsValid() == false) + continue; + + sb.AppendLine($"[{i}] teamId:{mdata.teamId}, renderDataWorkIndex:{mdata.renderDataWorkIndex}"); + } + Debug.Log(sb.ToString()); + allsb.Append(sb); + } + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/Team/TeamManager.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Manager/Team/TeamManager.cs.meta new file mode 100644 index 00000000..9f8ff85a --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/Team/TeamManager.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 3a759ca7f68f34f49b63e9bb8551c699 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Manager/Team/TeamManager.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/Team/TeamWindData.cs b/Assets/MagicaCloth2/Scripts/Core/Manager/Team/TeamWindData.cs new file mode 100644 index 00000000..48697c0f --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/Team/TeamWindData.cs @@ -0,0 +1,110 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp + +using Unity.Collections; +using Unity.Mathematics; +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// 風‚ƒĵƒ³ïĵ‘¤ĉƒ…ċ ħ + /// + public struct TeamWindInfo : IValid + { + public int windId; + public float time; + public float main; + public float3 direction; + + public bool IsValid() + { + return main > 1e-06f; + } + + public override string ToString() + { + return $"windId:{windId}, time:{time}, main:{main}, direction:{direction}"; + } + + public void DebugLog() + { + Debug.Log(ToString()); + } + } + + /// + /// ƒƒĵƒ Ğċ½ħ響™‚‹é˘¨‚ƒĵƒ³¨ç§ğċ‹•風ĉƒ…ċ ħ + /// + public struct TeamWindData + { + public FixedList128Bytes windZoneList; + public TeamWindInfo movingWind; + + + public int ZoneCount => windZoneList.Length; + + public int IndexOf(int windId) + { + int cnt = windZoneList.Length; + for (int i = 0; i < cnt; i++) + { + if (windZoneList[i].windId == windId) + return i; + } + return -1; + } + + public void ClearZoneList() + { + windZoneList.Clear(); + } + + public void AddOrReplaceWindZone(TeamWindInfo windInfo, in TeamWindData oldWindData) + { + if (windInfo.IsValid() == false) + return; + + int i = oldWindData.IndexOf(windInfo.windId); + if (i >= 0) + { + // ĉ—§ƒ‡ƒĵ‚żĞċ­˜ċœ¨™‚‹ċ ´ċˆŻtime‚’ċĵ•çĥ™ + var oldWindInfo = oldWindData.windZoneList[i]; + windInfo.time = oldWindInfo.time; + } + + windZoneList.AddNoResize(windInfo); + } + + public void RemoveWindZone(int windId) + { + int i = IndexOf(windId); + if (i >= 0) + { + windZoneList.RemoveAtSwapBack(i); + } + } + + public void CopyFrom(in TeamWindData wdata) + { + windZoneList = wdata.windZoneList; + movingWind = wdata.movingWind; + } + + //public void DebugLog(int teamId) + //{ + // Debug.Log($"TeamWindData:{teamId}, zoneCnt:{ZoneCount}"); + // for (int i = 0; i < ZoneCount; i++) + // { + // windZoneList[i].DebugLog(); + // } + + // if (movingWind.IsValid()) + // { + // Debug.Log("Moving"); + // movingWind.DebugLog(); + // } + //} + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/Team/TeamWindData.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Manager/Team/TeamWindData.cs.meta new file mode 100644 index 00000000..30095ea4 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/Team/TeamWindData.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: a3aa95cb25a154343ba918a4fa7f4e26 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Manager/Team/TeamWindData.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/TransformManager.meta b/Assets/MagicaCloth2/Scripts/Core/Manager/TransformManager.meta new file mode 100644 index 00000000..70b15536 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/TransformManager.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f7a265c09484f0d4d88e3798b515b83f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/TransformManager/TransformData.cs b/Assets/MagicaCloth2/Scripts/Core/Manager/TransformManager/TransformData.cs new file mode 100644 index 00000000..75bd6ed4 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/TransformManager/TransformData.cs @@ -0,0 +1,967 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System; +using System.Collections.Generic; +using System.Text; +using Unity.Burst; +using Unity.Collections; +using Unity.Jobs; +using Unity.Mathematics; +using UnityEngine; +using UnityEngine.Jobs; + +namespace MagicaCloth2 +{ + /// + /// TransformAccessArray‚’中ċżƒ¨—Ÿä¸€é€£TransformçĦ理‚Żƒİ‚ı + /// ‚ıƒĴƒƒƒ‰§ċˆİ用§‚‹‚ˆ†Ğĉ§˜€…Şċ·ċ¤Ğ‚’èĦŒ£Ĥ„‚‹ + /// + public partial class TransformData : IDisposable + { + internal List transformList; + + /// + /// ƒ•ƒİ‚°ïĵˆƒ•ƒİ‚°ŻTransformManager‚Żƒİ‚ı§ċšçİïĵ‰ + /// + internal ExSimpleNativeArray flagArray; + + /// + /// ċˆĉœŸlocalPosition + /// + internal ExSimpleNativeArray initLocalPositionArray; + + /// + /// ċˆĉœŸlocalRotation + /// + internal ExSimpleNativeArray initLocalRotationArray; + + /// + /// ƒŻƒĵƒĞƒ‰ċş§ĉ¨™ + /// + internal ExSimpleNativeArray positionArray; + + /// + /// ƒŻƒĵƒĞƒ‰ċ›žèğ˘ + /// + internal ExSimpleNativeArray rotationArray; + + /// + /// ƒŻƒĵƒĞƒ‰é€†ċ›žèğ˘ + /// + internal ExSimpleNativeArray inverseRotationArray; + + /// + /// ƒŻƒĵƒĞƒ‰‚ı‚ħƒĵƒĞ + /// Transform.lossyScale¨ç­‰äĦ + /// + internal ExSimpleNativeArray scaleArray; + + /// + /// ƒ­ƒĵ‚ЃĞċş§ĉ¨™ + /// + internal ExSimpleNativeArray localPositionArray; + + /// + /// ƒ­ƒĵ‚ЃĞċ›žèğ˘ + /// + internal ExSimpleNativeArray localRotationArray; + + /// + /// ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ‚¤ƒ³‚ı‚żƒ³‚ıID + /// + internal ExSimpleNativeArray idArray; + + /// + /// èĤރˆƒİƒ³‚ıƒ•‚݃ĵƒ ‚¤ƒ³‚ı‚żƒ³‚ıID(0=Ş—) + /// + internal ExSimpleNativeArray parentIdArray; + + /// + /// BoneClothƒĞƒĵƒˆƒˆƒİƒ³‚ıƒ•‚݃ĵƒ IDƒŞ‚ıƒˆ + /// + internal List rootIdList; + + /// + /// TransformƒŞ‚ıƒˆĞċ¤‰ĉ›´Œ‚£Ÿ‹İ†‹ + /// + bool isDirty = false; + + //========================================================================================= + /// + /// Job作ĉ­ç”¨ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ‚˘‚Ż‚ğ‚ı配ċˆ— + /// ƒ‡ƒĵ‚żĉ§‹ç݉ĉ™‚ĞŻċˆİ用—Ş„ + /// + internal TransformAccessArray transformAccessArray; + + + //========================================================================================= + /// + /// ċˆİ用ċŻèƒ½Şçİş‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı + /// + Queue emptyStack; + + //========================================================================================= + public TransformData() { } + + public TransformData(int capacity) + { + // 領ċŸŸżç˘şäż™‚‹ + Init(capacity); + } + + public void Init(int capacity) + { + // 領ċŸŸżç˘şäż™‚‹ + transformList = new List(capacity); + idArray = new ExSimpleNativeArray(capacity, true); + parentIdArray = new ExSimpleNativeArray(capacity, true); + flagArray = new ExSimpleNativeArray(capacity, true); + initLocalPositionArray = new ExSimpleNativeArray(capacity, true); + initLocalRotationArray = new ExSimpleNativeArray(capacity, true); + positionArray = new ExSimpleNativeArray(capacity, true); + rotationArray = new ExSimpleNativeArray(capacity, true); + scaleArray = new ExSimpleNativeArray(capacity, true); + localPositionArray = new ExSimpleNativeArray(capacity, true); + localRotationArray = new ExSimpleNativeArray(capacity, true); + inverseRotationArray = new ExSimpleNativeArray(capacity, true); + emptyStack = new Queue(capacity); + isDirty = true; + } + + public void Dispose() + { + transformList?.Clear(); + idArray?.Dispose(); + parentIdArray?.Dispose(); + flagArray?.Dispose(); + initLocalPositionArray?.Dispose(); + initLocalRotationArray?.Dispose(); + positionArray?.Dispose(); + rotationArray?.Dispose(); + scaleArray?.Dispose(); + localPositionArray?.Dispose(); + localRotationArray?.Dispose(); + inverseRotationArray?.Dispose(); + emptyStack?.Clear(); + + // transformAccessArrayŻƒĦ‚¤ƒ³‚ıƒĴƒƒƒ‰ż + if (transformAccessArray.isCreated) + { + transformAccessArray.Dispose(); + } + } + + public int Count => transformList.Count; + public int RootCount => rootIdList?.Count ?? 0; + public bool IsDirty => isDirty; + public bool IsEmpty => transformList == null; + + //========================================================================================= + /// + /// Transformċ˜ä½“‚’èż½ċŠ ™‚‹(tid‚’ĉŒ‡ċš™‚‹Ş‚‰‚ıƒĴƒƒƒ‰ċŻïĵ‰ + /// ™§Ğç™ğ録ĉ¸ˆżċŒ˜ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ Œ‚‚‹ċ ´ċˆŻ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı‚’èż”™ + /// + /// + /// Invalidċ ´ċˆŻTransform‹‚‰GetInstanceId()‚’ċ³ĉ™‚設ċš™‚‹ + /// 不èĤŞ‚‰Invalid + /// + /// + //public int AddTransform(Transform t, int tid = 0, int pid = 0, byte flag = TransformManager.Flag_Read, bool checkDuplicate = true) + public int AddTransform(Transform t, MagicaObjectId tid, MagicaObjectId pid, byte flag = TransformManager.Flag_Read, bool checkDuplicate = true) + { + int index; + + // 重複ƒ‚§ƒƒ‚Ż + if (checkDuplicate) + { + index = ReferenceIndexOf(transformList, t); + if (index >= 0) + return index; // 発èĤ‹ + } + + // ĉ–°èĤèż½ċŠ  + if (emptyStack.Count > 0) + { + index = emptyStack.Dequeue(); + transformList[index] = t; + if (tid.IsValid() == false) + { + // Transform‹‚‰ƒ‡ƒĵ‚ż‚’ċ–ċ—ïĵˆƒĦ‚¤ƒ³‚ıƒĴƒƒƒ‰żïĵ‰ + idArray[index] = t.GetMagicaId(); + parentIdArray[index] = t.parent ? t.parent.GetMagicaId() : MagicaObjectId.Invalid; + initLocalPositionArray[index] = t.localPosition; + initLocalRotationArray[index] = t.localRotation; + positionArray[index] = t.position; + rotationArray[index] = t.rotation; + scaleArray[index] = t.lossyScale; + localPositionArray[index] = t.localPosition; + localRotationArray[index] = t.localRotation; + inverseRotationArray[index] = Quaternion.Inverse(t.rotation); + flagArray[index] = new ExBitFlag8(flag); + } + else + { + // ĉœ€ä½Žé™ĉƒ…ċ ħ上ĉ›¸ + idArray[index] = tid; + parentIdArray[index] = pid; + initLocalPositionArray[index] = 0; + initLocalRotationArray[index] = quaternion.identity; + positionArray[index] = 0; + rotationArray[index] = quaternion.identity; + scaleArray[index] = 1; + localPositionArray[index] = 0; + localRotationArray[index] = quaternion.identity; + inverseRotationArray[index] = quaternion.identity; + flagArray[index] = new ExBitFlag8(flag); + } + } + else + { + index = Count; + transformList.Add(t); + if (tid.IsValid() == false) + { + // Transform‹‚‰ƒ‡ƒĵ‚ż‚’ċ–ċ—ïĵˆƒĦ‚¤ƒ³‚ıƒĴƒƒƒ‰żïĵ‰ + idArray.Add(t.GetMagicaId()); + parentIdArray.Add(t.parent ? t.parent.GetMagicaId() : MagicaObjectId.Invalid); + initLocalPositionArray.Add(t.localPosition); + initLocalRotationArray.Add(t.localRotation); + positionArray.Add(t.position); + rotationArray.Add(t.rotation); + scaleArray.Add(t.lossyScale); + localPositionArray.Add(t.localPosition); + localRotationArray.Add(t.localRotation); + inverseRotationArray.Add(Quaternion.Inverse(t.rotation)); + flagArray.Add(new ExBitFlag8(flag)); + } + else + { + // 領ċŸŸżç˘şäż + idArray.Add(tid); + parentIdArray.Add(pid); + initLocalPositionArray.Add(0); + initLocalRotationArray.Add(quaternion.identity); + positionArray.Add(0); + rotationArray.Add(quaternion.identity); + scaleArray.Add(1); + localPositionArray.Add(0); + localRotationArray.Add(quaternion.identity); + inverseRotationArray.Add(quaternion.identity); + flagArray.Add(new ExBitFlag8(flag)); + } + } + + isDirty = true; + + return index; + } + + /// + /// ƒĴ‚³ƒĵƒ‰ĉƒ…ċ ħ‹‚‰Transform‚’ç™ğ録™‚‹ïĵˆ‚ıƒĴƒƒƒ‰ċŻïĵ‰ + /// ™§Ğç™ğ録ĉ¸ˆżċŒ˜ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ Œ‚‚‹ċ ´ċˆŻ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı‚’èż”™ + /// + /// ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ è¨˜éŒ²‚Żƒİ‚ı + /// èĤށ‚¤ƒ³‚ı‚żƒ³‚ıID€‚Ş‘‚Œ°Invalid + /// + /// 重複ƒ‚§ƒƒ‚݁ĉœ‰ç„Ħ + /// + //public int AddTransform(TransformRecord record, int pid = 0, byte flag = TransformManager.Flag_Read, bool checkDuplicate = true) + public int AddTransform(TransformRecord record, MagicaObjectId pid, byte flag = TransformManager.Flag_Read, bool checkDuplicate = true) + { + int index; + + // 重複ƒ‚§ƒƒ‚Ż + if (checkDuplicate) + { + index = ReferenceIndexOf(transformList, record.transform); + if (index >= 0) + return index; // 発èĤ‹ + } + + // ĉ–°èĤèż½ċŠ  + if (emptyStack.Count > 0) + { + index = emptyStack.Dequeue(); + transformList[index] = record.transform; + idArray[index] = record.id; + parentIdArray[index] = pid; + initLocalPositionArray[index] = record.localPosition; + initLocalRotationArray[index] = record.localRotation; + positionArray[index] = record.position; + rotationArray[index] = record.rotation; + scaleArray[index] = record.scale; + localPositionArray[index] = record.localPosition; + localRotationArray[index] = record.localRotation; + inverseRotationArray[index] = Quaternion.Inverse(record.rotation); + flagArray[index] = new ExBitFlag8(flag); + } + else + { + index = Count; + transformList.Add(record.transform); + idArray.Add(record.id); + parentIdArray.Add(pid); + initLocalPositionArray.Add(record.localPosition); + initLocalRotationArray.Add(record.localRotation); + positionArray.Add(record.position); + rotationArray.Add(record.rotation); + scaleArray.Add(record.scale); + localPositionArray.Add(record.localPosition); + localRotationArray.Add(record.localRotation); + inverseRotationArray.Add(Quaternion.Inverse(record.rotation)); + flagArray.Add(new ExBitFlag8(flag)); + } + + isDirty = true; + return index; + } + + /// + /// äğ–TransformData‹‚‰èż½ċŠ ™‚‹ + /// + /// + /// + /// 重複ƒ‚§ƒƒ‚݁ĉœ‰ç„Ħ + /// + public int AddTransform(TransformData srcData, int srcIndex, bool checkDuplicate = true) + { + int index; + + // 重複ƒ‚§ƒƒ‚Ż + Transform t = srcData.transformList[srcIndex]; + if (checkDuplicate) + { + index = ReferenceIndexOf(transformList, t); + if (index >= 0) + return index; // 発èĤ‹ + } + + // ĉ–°èĤèż½ċŠ  + MagicaObjectId id = srcData.idArray[srcIndex]; + MagicaObjectId pid = srcData.parentIdArray[srcIndex]; + var initPos = srcData.initLocalPositionArray[srcIndex]; + var initRot = srcData.initLocalRotationArray[srcIndex]; + var pos = srcData.positionArray[srcIndex]; + var rot = srcData.rotationArray[srcIndex]; + var scl = srcData.scaleArray[srcIndex]; + var lpos = srcData.localPositionArray[srcIndex]; + var lrot = srcData.localRotationArray[srcIndex]; + var irot = srcData.inverseRotationArray[srcIndex]; + var flag = srcData.flagArray[srcIndex]; + if (emptyStack.Count > 0) + { + index = emptyStack.Dequeue(); + transformList[index] = t; + idArray[index] = id; + parentIdArray[index] = pid; + initLocalPositionArray[index] = initPos; + initLocalRotationArray[index] = initRot; + positionArray[index] = pos; + rotationArray[index] = rot; + scaleArray[index] = scl; + localPositionArray[index] = lpos; + localRotationArray[index] = lrot; + inverseRotationArray[index] = irot; + flagArray[index] = flag; + } + else + { + index = Count; + transformList.Add(t); + idArray.Add(id); + parentIdArray.Add(pid); + initLocalPositionArray.Add(initPos); + initLocalRotationArray.Add(initRot); + positionArray.Add(pos); + rotationArray.Add(rot); + scaleArray.Add(scl); + localPositionArray.Add(lpos); + localRotationArray.Add(lrot); + inverseRotationArray.Add(irot); + flagArray.Add(flag); + } + + isDirty = true; + return index; + } + + /// + /// ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ é…ċˆ—‚’èż½ċŠ —èż½ċŠ •‚ŒŸ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı‚’èż”™ïĵˆ‚ıƒĴƒƒƒ‰ċŻïĵ‰ + /// transform.GetInstanceID()ƒŞ‚ıƒˆŒċż…èĤ + /// + /// + /// + public int[] AddTransformRange(List tlist, List idList, List pidList, int copyCount = 0) + { + //int tcnt = tlist.Count; + int tcnt = copyCount > 0 ? copyCount : tlist.Count; + Debug.Assert(tcnt > 0 && tcnt < tlist.Count); + + int startIndex = Count; + int[] indices = new int[tcnt]; + + for (int i = 0; i < tcnt; i++) + { + transformList.Add(tlist[i]); + idArray.Add(idList[i]); + parentIdArray.Add(pidList[i]); + indices[i] = startIndex + i; + } + + // ƒ‡ƒĵ‚żŻé ˜ċŸŸżèż½ċŠ  + flagArray.AddRange(tcnt, new ExBitFlag8(TransformManager.Flag_Read)); // ƒ•ƒİ‚°ŻèŞ­żèĵż¨—ĤċˆĉœŸċŒ– + initLocalPositionArray.AddRange(tcnt); + initLocalRotationArray.AddRange(tcnt); + positionArray.AddRange(tcnt); + rotationArray.AddRange(tcnt); + scaleArray.AddRange(tcnt); + localPositionArray.AddRange(tcnt); + localRotationArray.AddRange(tcnt); + inverseRotationArray.AddRange(tcnt); + + // ċ¤‰ĉ›´ƒ•ƒİ‚° + isDirty = true; + + return indices; + } + + /// + /// ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ƒ‡ƒĵ‚ż‹‚‰ĉŒ‡ċš—Ÿ‚Ğ‚Ĥƒ³ƒˆƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ‚’‚³ƒ”ƒĵ™‚‹ïĵˆ‚ıƒĴƒƒƒ‰ċŻïĵ‰ + /// + /// + /// + /// + public int[] AddTransformRange(TransformData stdata, int copyCount = 0) + { + Debug.Assert(stdata != null); + return AddTransformRange( + stdata.transformList, + new List(stdata.idArray.ToArray()), + new List(stdata.parentIdArray.ToArray()), + copyCount + ); + } + + /// + /// ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ é…ċˆ—¨ä¸€éƒ¨ƒ‡ƒĵ‚ż‚’èż½ċŠ —‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı‚’èż”™ïĵˆ‚ıƒĴƒƒƒ‰ċŻïĵ‰ + /// ĉ‹‚Ёƒ‡ƒĵ‚żŻċ³ĉ™‚計痁•‚Œ‚‹ + /// â€ğImportWork‹‚‰ä½œĉˆç”¨ + /// + /// + /// + /// + /// + /// + /// + public int[] AddTransformRange( + List tlist, + List idList, + List pidList, + List rootIds, + NativeArray localPositions, + NativeArray localRotations, + NativeArray positions, + NativeArray rotations, + NativeArray scales, + NativeArray inverseRotations + ) + { + int tcnt = tlist.Count; + Debug.Assert(tcnt > 0); + + int startIndex = Count; + int[] indices = new int[tcnt]; + + transformList.AddRange(tlist); + for (int i = 0; i < tcnt; i++) + { + idArray.Add(idList[i]); + parentIdArray.Add(pidList[i]); + indices[i] = startIndex + i; + } + + // root id + if (rootIds != null && rootIds.Count > 0) + { + if (rootIdList == null) + rootIdList = new List(rootIds); + else + rootIdList.AddRange(rootIds); + } + + // ƒ‡ƒĵ‚ż‚³ƒ”ƒĵ + flagArray.AddRange(tcnt, new ExBitFlag8(TransformManager.Flag_Read)); // ƒ•ƒİ‚°ŻèŞ­żèĵż¨—ĤċˆĉœŸċŒ– + initLocalPositionArray.AddRange(localPositions); + initLocalRotationArray.AddRange(localRotations); + positionArray.AddRange(positions); + rotationArray.AddRange(rotations); + scaleArray.AddRange(scales); + localPositionArray.AddRange(localPositions); + localRotationArray.AddRange(localRotations); + inverseRotationArray.AddRange(inverseRotations); + + // ċ¤‰ĉ›´ƒ•ƒİ‚° + isDirty = true; + + return indices; + } + + /// + /// ċ˜ä½“ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ‚’ċ‰Šé™¤™‚‹ïĵˆ‚ıƒĴƒƒƒ‰ċŻïĵ‰ + /// ċ‰Šé™¤Żé…ċˆ—‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı§ĉŒ‡ċš™‚‹ + /// ċ‰Šé™¤•‚ŒŸ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ıŻ‚­ƒƒĵĞèż½ċŠ •‚Œċ†ċˆİ用•‚Œ‚‹ + /// + /// + public void RemoveTransformIndex(int index) + { + // ċ‰Šé™¤ + transformList[index] = null; + flagArray[index] = new ExBitFlag8(); // ƒ•ƒİ‚°ż‚ŻƒŞ‚˘ + emptyStack.Enqueue(index); + } + + /// + /// Transformċ˜ä½“‚’èż½ċŠ ™‚‹(tid‚’ĉŒ‡ċš™‚‹Ş‚‰‚ıƒĴƒƒƒ‰ċŻïĵ‰ + /// + /// + /// Invalidċ ´ċˆŻTransform‹‚‰GetInstanceId()‚’ċ³ĉ™‚設ċš™‚‹ + /// 不èĤŞ‚‰Invalid + /// + /// + //public int ReplaceTransform(int index, Transform t, int tid = 0, int pid = 0, byte flag = TransformManager.Flag_Read) + public int ReplaceTransform(int index, Transform t, MagicaObjectId tid, MagicaObjectId pid, byte flag = TransformManager.Flag_Read) + { + Debug.Assert(index < Count); + + transformList[index] = t; + flagArray[index] = new ExBitFlag8(flag); + if (tid.IsValid() == false) + { + // Transform‹‚‰ƒ‡ƒĵ‚ż‚’ċ–ċ—ïĵˆƒĦ‚¤ƒ³‚ıƒĴƒƒƒ‰żïĵ‰ + idArray[index] = t.GetMagicaId(); + parentIdArray[index] = t.parent ? t.parent.GetMagicaId() : MagicaObjectId.Invalid; + initLocalPositionArray[index] = t.localPosition; + initLocalRotationArray[index] = t.localRotation; + positionArray[index] = t.position; + rotationArray[index] = t.rotation; + scaleArray[index] = t.lossyScale; + localPositionArray[index] = t.localPosition; + localRotationArray[index] = t.localRotation; + } + else + { + // 領ċŸŸżċˆĉœŸċŒ– + idArray[index] = tid; + parentIdArray[index] = pid; + initLocalPositionArray[index] = 0; + initLocalRotationArray[index] = quaternion.identity; + positionArray[index] = 0; + rotationArray[index] = quaternion.identity; + scaleArray[index] = 1; + localPositionArray[index] = 0; + localRotationArray[index] = quaternion.identity; + } + + isDirty = true; + + return index; + } + + /// + /// 純粋Ş‚Żƒİ‚ıƒ‚¤ƒ³‚żżIndexOf()ċŸè£… + /// List.IndexOf()Ż‚ıƒĴƒƒƒ‰§Żċˆİ用§Ş„€‚ + /// Unity.object(==)ĉŻ”èĵƒŻĉ§˜€…Şċ‡Ĥ理Œċ…‚ŠGetInstanceId()‚’ċˆİ用—Ĥ—†Ÿ‚€‚ + /// + /// + /// + /// + /// + int ReferenceIndexOf(List list, T item) where T : class + { + if (list == null) + return -1; + for (int i = 0; i < list.Count; i++) + { + if (ReferenceEquals(list[i], item)) + return i; + } + return -1; + } + + //========================================================================================= + /// + /// 作ĉ­ç”¨ƒƒƒƒ•‚Ħĉ›´ĉ–°ïĵˆƒĦ‚¤ƒ³‚ıƒĴƒƒƒ‰żïĵ‰ + /// + public void UpdateWorkData() + { + // ċ¤‰ĉ›´Œ‚‚‹ċ ´ċˆĞŻtransformAccessArray‚’作‚Šç›´™ + if (isDirty) + { + if (transformAccessArray.isCreated) + transformAccessArray.Dispose(); + + transformAccessArray = new TransformAccessArray(transformList.ToArray()); + + isDirty = false; + } + } + + //========================================================================================= + /// + /// Transform‚’ċˆĉœŸċ§żċ‹˘§ċİċ…ƒ•›‚‹‚¸ƒ§ƒ–‚’発èĦŒ™‚‹ïĵˆƒĦ‚¤ƒ³‚ıƒĴƒƒƒ‰żïĵ‰ + /// + /// + /// + /// + public JobHandle RestoreTransform(int count, JobHandle jobHandle = default(JobHandle)) + { + UpdateWorkData(); + + var job = new RestoreTransformJob() + { + count = count, + flagList = flagArray.GetNativeArray(), + localPositionArray = initLocalPositionArray.GetNativeArray(), + localRotationArray = initLocalRotationArray.GetNativeArray(), + }; + jobHandle = job.Schedule(transformAccessArray, jobHandle); + + return jobHandle; + } + + [BurstCompile] + struct RestoreTransformJob : IJobParallelForTransform + { + public int count; + [Unity.Collections.ReadOnly] + public NativeArray flagList; + + [Unity.Collections.ReadOnly] + public NativeArray localPositionArray; + [Unity.Collections.ReadOnly] + public NativeArray localRotationArray; + + public void Execute(int index, TransformAccess transform) + { + if (index >= count) + return; + if (transform.isValid == false) + return; + + //byte flag = flagList[index]; + //if ((flag & Flag_Write) != 0) + { + transform.SetLocalPositionAndRotation(localPositionArray[index], localRotationArray[index]); + } + } + } + + + //========================================================================================= + /// + /// ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ‚’èŞ­żèĵ‚€‚¸ƒ§ƒ–‚’発èĦŒ™‚‹ïĵˆƒĦ‚¤ƒ³‚ıƒĴƒƒƒ‰żïĵ‰ + /// + /// + /// + public JobHandle ReadTransform(JobHandle jobHandle = default(JobHandle)) + { + UpdateWorkData(); + + // todo:ĉœŞĉäşˆĉ¸ĴŞİŒ‚‚‹¨è‰²€…複雑ċŒ–™‚‹¨“‚ + + var job = new ReadTransformJob() + { + flagList = flagArray.GetNativeArray(), + positionArray = positionArray.GetNativeArray(), + rotationArray = rotationArray.GetNativeArray(), + scaleList = scaleArray.GetNativeArray(), + localPositionArray = localPositionArray.GetNativeArray(), + localRotationArray = localRotationArray.GetNativeArray(), + inverseRotationArray = inverseRotationArray.GetNativeArray(), + }; + jobHandle = job.ScheduleReadOnly(transformAccessArray, 16, jobHandle); + + return jobHandle; + } + + public void ReadTransformRun() + { + UpdateWorkData(); + var job = new ReadTransformJob() + { + flagList = flagArray.GetNativeArray(), + positionArray = positionArray.GetNativeArray(), + rotationArray = rotationArray.GetNativeArray(), + scaleList = scaleArray.GetNativeArray(), + localPositionArray = localPositionArray.GetNativeArray(), + localRotationArray = localRotationArray.GetNativeArray(), + inverseRotationArray = inverseRotationArray.GetNativeArray(), + }; + job.RunReadOnly(transformAccessArray); + } + + [BurstCompile] + struct ReadTransformJob : IJobParallelForTransform + { + [Unity.Collections.ReadOnly] + public NativeArray flagList; + + [Unity.Collections.WriteOnly] + public NativeArray positionArray; + [Unity.Collections.WriteOnly] + public NativeArray rotationArray; + [Unity.Collections.WriteOnly] + public NativeArray scaleList; + [Unity.Collections.WriteOnly] + public NativeArray localPositionArray; + [Unity.Collections.WriteOnly] + public NativeArray localRotationArray; + [Unity.Collections.WriteOnly] + public NativeArray inverseRotationArray; + + public void Execute(int index, TransformAccess transform) + { + if (transform.isValid == false) + return; + + //byte flag = flagList[index]; + //if ((flag & Flag_Read) != 0) + { + transform.GetPositionAndRotation(out var pos, out var rot); + float4x4 LtoW = transform.localToWorldMatrix; + + positionArray[index] = pos; + rotationArray[index] = rot; + localPositionArray[index] = transform.localPosition; + localRotationArray[index] = transform.localRotation; + + // lossyScaleċ–ċ—(çċœ¨ŻUnity2019.2.14äğ上ż) + // ƒžƒˆƒŞƒƒ‚Ż‚ı‹‚‰ĉ­£ç˘şŞ‚ı‚ħƒĵƒĞċ€¤‚’ç—ċ‡ş™‚‹ïĵˆ“‚ŒŻTransform.lossyScale¨ç­‰äĦïĵ‰ + var irot = math.inverse(rot); + var m2 = math.mul(new float4x4(irot, float3.zero), LtoW); + var scl = new float3(m2.c0.x, m2.c1.y, m2.c2.z); + scaleList[index] = scl; + + // ƒŻƒĵƒĞƒ‰->ƒ­ƒĵ‚ЃĞċ¤‰ĉ›ç”¨é€†‚Ż‚İƒĵ‚żƒ‹‚ރ³ + inverseRotationArray[index] = math.inverse(rot); + } + } + } + + //========================================================================================= +#if false + /// + /// Transform‚’ĉ›¸èĵ‚€‚¸ƒ§ƒ–‚’発èĦŒ™‚‹ïĵˆƒĦ‚¤ƒ³‚ıƒĴƒƒƒ‰żïĵ‰ + /// + /// + /// + /// + public JobHandle WriteTransform(int count, JobHandle jobHandle = default(JobHandle)) + { + var job = new WriteTransformJob() + { + count = count, + flagList = flagArray.GetNativeArray(), + worldPositions = positionArray.GetNativeArray(), + worldRotations = rotationArray.GetNativeArray(), + localPositions = localPositionArray.GetNativeArray(), + localRotations = localRotationArray.GetNativeArray(), + }; + jobHandle = job.Schedule(transformAccessArray, jobHandle); + + return jobHandle; + } + + [BurstCompile] + struct WriteTransformJob : IJobParallelForTransform + { + public int count; + [Unity.Collections.ReadOnly] + public NativeArray flagList; + + [Unity.Collections.ReadOnly] + public NativeArray worldPositions; + [Unity.Collections.ReadOnly] + public NativeArray worldRotations; + [Unity.Collections.ReadOnly] + public NativeArray localPositions; + [Unity.Collections.ReadOnly] + public NativeArray localRotations; + + public void Execute(int index, TransformAccess transform) + { + if (index >= count) + return; + if (transform.isValid == false) + return; + + var flag = flagList[index]; + if (flag.IsSet(TransformManager.Flag_WorldRotWrite)) + { + // ƒŻƒĵƒĞƒ‰ċ›žèğ˘żĉ›¸èĵ‚€ + //transform.position = worldPositions[index]; + transform.rotation = worldRotations[index]; + } + else if (flag.IsSet(TransformManager.Flag_LocalPosRotWrite)) + { + // ƒ­ƒĵ‚ЃĞċş§ĉ¨™ƒğċ›žèğ˘‚’ĉ›¸èĵ‚€ + transform.localPosition = localPositions[index]; + transform.localRotation = localRotations[index]; + } + } + } +#endif + + //========================================================================================= + /// + /// ƒŞƒ€‚Ż‚·ƒ§ƒ³çµĉžœĞċŸş„ĤTransformĉƒ…ċ ħ‚’ċ†ç·¨ĉˆ™‚‹ïĵˆ‚ıƒĴƒƒƒ‰ċŻïĵ‰ + /// + /// + /// + public void OrganizeReductionTransform(VirtualMesh vmesh, ReductionWorkData workData) + { + // ĉ–°—„TransformĞċ݁—Ĥċ‚ç…§™‚‹ċ¤„‚¤ƒ³ƒ‡ƒƒ‚Ż‚ıƒŞ‚ıƒˆ‚’作ĉˆ™‚‹ + int newSkinBoneCount = workData.newSkinBoneCount.Value; + var oldToNewIndexList = new List(newSkinBoneCount + 2); + + // ĉœ€ċˆĞ‚ı‚­ƒ‹ƒ³‚°ç”¨ƒœƒĵƒ³‚’èż½ċŠ ™‚‹ + foreach (var kv in workData.useSkinBoneMap) + { + // ‚ı‚­ƒ³ƒœƒĵƒ³ċŸéš›ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ıŻskinBoneTransformIndicesĞĉ ĵ納•‚ŒĤ„‚‹ + oldToNewIndexList.Add(vmesh.skinBoneTransformIndices[kv.Key]); + } + + // skin root‚’èż½ċŠ ™‚‹ + int newSkinRootIndex = oldToNewIndexList.Count; + oldToNewIndexList.Add(vmesh.skinRootIndex); + + // center transform‚’èż½ċŠ ™‚‹ + int newCenterTransformIndex = oldToNewIndexList.Count; + oldToNewIndexList.Add(vmesh.centerTransformIndex); + + // ĉ–°—„ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ĉ•° + int newTransformCount = oldToNewIndexList.Count; + + // ĉ–°—„é ˜ċŸŸ + var newTransformList = new List(newTransformCount); + var newTransformIdArray = new ExSimpleNativeArray(newTransformCount); + var newParentIdArray = new ExSimpleNativeArray(newTransformCount); + var newFlagArray = new ExSimpleNativeArray(newTransformCount); + var newInitLocalPositionArray = new ExSimpleNativeArray(newTransformCount); + var newInitLocalRotationArray = new ExSimpleNativeArray(newTransformCount); + var newPositionArray = new ExSimpleNativeArray(newTransformCount); + var newRotationArray = new ExSimpleNativeArray(newTransformCount); + var newScaleArray = new ExSimpleNativeArray(newTransformCount); + + // ƒ‡ƒĵ‚ż‚³ƒ”ƒĵ + for (int i = 0; i < newTransformCount; i++) + { + int oldIndex = oldToNewIndexList[i]; + newTransformList.Add(transformList[oldIndex]); + + newTransformIdArray[i] = idArray[oldIndex]; + newParentIdArray[i] = parentIdArray[oldIndex]; + newFlagArray[i] = flagArray[oldIndex]; + newInitLocalPositionArray[i] = initLocalPositionArray[oldIndex]; + newInitLocalRotationArray[i] = initLocalRotationArray[oldIndex]; + newPositionArray[i] = positionArray[oldIndex]; + newRotationArray[i] = rotationArray[oldIndex]; + newScaleArray[i] = scaleArray[oldIndex]; + } + + // äğċ‰èĤç´ ‚’ç ´ĉ£„™‚‹ + transformList.Clear(); + idArray.Dispose(); + parentIdArray.Dispose(); + flagArray.Dispose(); + initLocalPositionArray.Dispose(); + initLocalRotationArray.Dispose(); + positionArray.Dispose(); + rotationArray.Dispose(); + scaleArray.Dispose(); + + // ĉ–°—„èĤç´ Ğ組żĉ›ˆ + transformList = newTransformList; + idArray = newTransformIdArray; + parentIdArray = newParentIdArray; + flagArray = newFlagArray; + initLocalPositionArray = newInitLocalPositionArray; + initLocalRotationArray = newInitLocalRotationArray; + positionArray = newPositionArray; + rotationArray = newRotationArray; + scaleArray = newScaleArray; + + // çĦ理ĉƒ…ċ ħĉ›´ĉ–° + emptyStack.Clear(); + + // Virtual Meshäżĉ­£ + vmesh.centerTransformIndex = newCenterTransformIndex; + vmesh.skinRootIndex = newSkinRootIndex; + + // Dirty + isDirty = true; + } + + //========================================================================================= + public Transform GetTransformFromIndex(int index) + { + return transformList[index]; + } + + /// + /// IDƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı‚’èż”™ + /// 順ĉĴĦĉ¤œç´˘Ş§‚³‚ıƒˆĞĉ³¨ĉ„ïĵ + /// + /// + /// -1=èĤ‹¤‹‚‰Ş„ + public int GetTransformIndexFormId(MagicaObjectId id) + { + var array = idArray.GetNativeArray(); + int cnt = Count; + for (int i = 0; i < cnt; i++) + { + if (array[i] == id) + return i; + } + return -1; + } + + public MagicaObjectId GetTransformIdFromIndex(int index) + { + return idArray[index]; + } + + public MagicaObjectId GetParentIdFromIndex(int index) + { + return parentIdArray[index]; + } + + public float4x4 GetLocalToWorldMatrix(int index) + { + var pos = positionArray[index]; + var rot = rotationArray[index]; + var scl = scaleArray[index]; + return Matrix4x4.TRS(pos, rot, scl); + } + + public float4x4 GetWorldToLocalMatrix(int index) + { + return math.inverse(GetLocalToWorldMatrix(index)); + } + + //========================================================================================= + public override string ToString() + { + int transformListCount = transformList?.Count ?? 0; + + StringBuilder sb = new StringBuilder(); + sb.AppendLine("==== TransformData ===="); + sb.AppendLine($"isDirty:{isDirty}"); + sb.AppendLine($"transformList:{transformListCount}"); + sb.AppendLine($"flagArray:{flagArray.Length}"); + + return sb.ToString(); + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/TransformManager/TransformData.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Manager/TransformManager/TransformData.cs.meta new file mode 100644 index 00000000..3d87f51e --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/TransformManager/TransformData.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 4b71aff9fe4f3ef4bb756f57709e11a0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Manager/TransformManager/TransformData.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/TransformManager/TransformDataSerialization.cs b/Assets/MagicaCloth2/Scripts/Core/Manager/TransformManager/TransformDataSerialization.cs new file mode 100644 index 00000000..8b5b47eb --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/TransformManager/TransformDataSerialization.cs @@ -0,0 +1,117 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2024 MagicaSoft. +// https://magicasoft.jp +using System; +using System.Collections.Generic; +using Unity.Mathematics; +using UnityEngine; + +namespace MagicaCloth2 +{ + public partial class TransformData + { + /// + /// PreBuildċ…ħĉœ‰éƒ¨ċˆ†äżċ­˜ƒ‡ƒĵ‚ż + /// + [System.Serializable] + public class ShareSerializationData + { + public ExSimpleNativeArray.SerializationData flagArray; + public ExSimpleNativeArray.SerializationData initLocalPositionArray; + public ExSimpleNativeArray.SerializationData initLocalRotationArray; + } + + public ShareSerializationData ShareSerialize() + { + var sdata = new ShareSerializationData(); + try + { + sdata.flagArray = flagArray.Serialize(); + sdata.initLocalPositionArray = initLocalPositionArray.Serialize(); + sdata.initLocalRotationArray = initLocalRotationArray.Serialize(); + } + catch (Exception exception) + { + Debug.LogException(exception); + } + + return sdata; + } + + public static TransformData ShareDeserialize(ShareSerializationData sdata) + { + if (sdata == null) + return null; + + var tdata = new TransformData(); + try + { + tdata.flagArray = new ExSimpleNativeArray(sdata.flagArray); + tdata.initLocalPositionArray = new ExSimpleNativeArray(sdata.initLocalPositionArray); + tdata.initLocalRotationArray = new ExSimpleNativeArray(sdata.initLocalRotationArray); + } + catch (Exception exception) + { + Debug.LogException(exception); + } + + return tdata; + } + + //========================================================================================= + /// + /// PreBuildċ›şĉœ‰éƒ¨ċˆ†äżċ­˜ƒ‡ƒĵ‚ż + /// + [System.Serializable] + public class UniqueSerializationData : ITransform + { + public Transform[] transformArray; + + public void GetUsedTransform(HashSet transformSet) + { + if (transformArray != null) + { + foreach (var t in transformArray) + { + if (t) + transformSet.Add(t); + } + } + } + + public void ReplaceTransform(Dictionary replaceDict) + { + if (transformArray != null) + { + for (int i = 0; i < transformArray.Length; i++) + { + var t = transformArray[i]; + if (t) + { + MagicaObjectId id = t.GetMagicaId(); + if (id.IsValid() && replaceDict.ContainsKey(id)) + { + transformArray[i] = replaceDict[id]; + } + } + } + } + } + } + + public UniqueSerializationData UniqueSerialize() + { + var sdata = new UniqueSerializationData(); + try + { + sdata.transformArray = transformList.ToArray(); + } + catch (Exception exception) + { + Debug.LogException(exception); + } + + return sdata; + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/TransformManager/TransformDataSerialization.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Manager/TransformManager/TransformDataSerialization.cs.meta new file mode 100644 index 00000000..50fc856c --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/TransformManager/TransformDataSerialization.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 7ae8000d77bdbae4b86315fcc83b2518 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Manager/TransformManager/TransformDataSerialization.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/TransformManager/TransformManager.cs b/Assets/MagicaCloth2/Scripts/Core/Manager/TransformManager/TransformManager.cs new file mode 100644 index 00000000..d04164a3 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/TransformManager/TransformManager.cs @@ -0,0 +1,1105 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System.Text; +using Unity.Burst; +using Unity.Collections; +using Unity.Jobs; +using Unity.Mathematics; +using UnityEngine; +using UnityEngine.Jobs; + +namespace MagicaCloth2 +{ + public class TransformManager : IManager, IValid + { + // ƒ•ƒİ‚° + internal const byte Flag_Read = 0x01; + internal const byte Flag_WorldRotWrite = 0x02; // ƒŻƒĵƒĞƒ‰ċ›žèğ˘żĉ›¸èĵż + internal const byte Flag_LocalPosRotWrite = 0x04; // ƒ­ƒĵ‚ЃĞċş§ĉ¨™ƒğċ›žèğ˘ĉ›¸èĵż + internal const byte Flag_Restore = 0x08; // ċİċ…ƒ™‚‹ + internal const byte Flag_Enable = 0x10; // ĉœ‰ċŠıçŠĥĉ…‹ + internal ExNativeArray flagArray; + + /// + /// ċˆĉœŸlocalPosition + /// + internal ExNativeArray initLocalPositionArray; + + /// + /// ċˆĉœŸlocalRotation + /// + internal ExNativeArray initLocalRotationArray; + + /// + /// ‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ċŸşĉş–¨Ş‚‹localPosition + /// + internal ExNativeArray baseLocalPositionArray; + + /// + /// ‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ċŸşĉş–¨Ş‚‹localRotation + /// + internal ExNativeArray baseLocalRotationArray; + + /// + /// ƒŻƒĵƒĞƒ‰ċş§ĉ¨™ + /// + internal ExNativeArray positionArray; + + /// + /// ƒŻƒĵƒĞƒ‰ċ›žèğ˘ + /// + internal ExNativeArray rotationArray; + + /// + /// ƒŻƒĵƒĞƒ‰é€†ċ›žèğ˘ + /// + //internal ExNativeArray inverseRotationArray; + + /// + /// ƒŻƒĵƒĞƒ‰‚ı‚ħƒĵƒĞ + /// Transform.lossyScale¨ç­‰äĦ + /// + internal ExNativeArray scaleArray; + + /// + /// ƒ­ƒĵ‚ЃĞċş§ĉ¨™ + /// + internal ExNativeArray localPositionArray; + + /// + /// ƒ­ƒĵ‚ЃĞċ›žèğ˘ + /// + internal ExNativeArray localRotationArray; + + /// + /// ƒ­ƒĵ‚ЃЂı‚ħƒĵƒĞ + /// + internal ExNativeArray localScaleArray; + + /// + /// ƒŻƒĵƒĞƒ‰ċ¤‰ĉ›ƒžƒˆƒŞƒƒ‚Ż‚ı + /// + internal ExNativeArray localToWorldMatrixArray; + + /// + /// ĉŽçĥšƒƒĵƒ ID(0=Ş—) + /// + internal ExNativeArray teamIdArray; + + /// + /// èŞ­żèĵżç”¨ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ‚˘‚Ż‚ğ‚ı配ċˆ— + /// “é…ċˆ—Żä¸Šè¨˜é…ċˆ—‚°ƒĞƒĵƒ—¨‚¤ƒ³ƒ‡ƒƒ‚݁ŒċŒĉœŸ—Ĥ„‚‹ + /// + internal TransformAccessArray transformAccessArray; + + + internal int Count => flagArray?.Count ?? 0; + + //========================================================================================= + /// + /// ‚³ƒ³ƒƒĵƒƒ³ƒˆç”¨ƒŻƒĵƒĞƒ‰ċ§żċ‹˘ + /// + internal ExNativeArray componentPositionArray; + internal ExNativeArray componentMinScaleArray; // “‚ı‚ħƒĵƒĞċ€¤ŻXYZĉœ€ċ°çµĥċŻċ€¤ïĵˆç”¨é€”Żïĵ‚ı‚ħƒĵƒĞċˆ¤ċšïĵ‰ + + /// + /// ‚³ƒ³ƒƒĵƒƒ³ƒˆç”¨ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ  + /// + internal TransformAccessArray componentTransformAccessArray; + + internal NativeReference existFixedTeam; + + bool isValid; + + //========================================================================================= + public void Dispose() + { + isValid = false; + + flagArray?.Dispose(); + initLocalPositionArray?.Dispose(); + initLocalRotationArray?.Dispose(); + baseLocalPositionArray?.Dispose(); + baseLocalRotationArray?.Dispose(); + positionArray?.Dispose(); + rotationArray?.Dispose(); + //inverseRotationArray?.Dispose(); + scaleArray?.Dispose(); + localPositionArray?.Dispose(); + localRotationArray?.Dispose(); + localScaleArray?.Dispose(); + localToWorldMatrixArray?.Dispose(); + teamIdArray?.Dispose(); + //writeIndexArray?.Dispose(); + + flagArray = null; + initLocalPositionArray = null; + initLocalRotationArray = null; + baseLocalPositionArray = null; + baseLocalRotationArray = null; + positionArray = null; + rotationArray = null; + //inverseRotationArray = null; + scaleArray = null; + localPositionArray = null; + localRotationArray = null; + localScaleArray = null; + localToWorldMatrixArray = null; + teamIdArray = null; + //writeIndexArray = null; + + if (transformAccessArray.isCreated) + transformAccessArray.Dispose(); + //if (writeTransformAccessArray.isCreated) + // writeTransformAccessArray.Dispose(); + + componentPositionArray?.Dispose(); + componentMinScaleArray?.Dispose(); + if (componentTransformAccessArray.isCreated) + componentTransformAccessArray.Dispose(); + + if (existFixedTeam.IsCreated) + existFixedTeam.Dispose(); + } + + public void EnterdEditMode() + { + Dispose(); + } + + public void Initialize() + { + Dispose(); + + const int capacity = 256; + flagArray = new ExNativeArray(capacity); + initLocalPositionArray = new ExNativeArray(capacity); + initLocalRotationArray = new ExNativeArray(capacity); + baseLocalPositionArray = new ExNativeArray(capacity); + baseLocalRotationArray = new ExNativeArray(capacity); + positionArray = new ExNativeArray(capacity); + rotationArray = new ExNativeArray(capacity); + //inverseRotationArray = new ExNativeArray(capacity); + scaleArray = new ExNativeArray(capacity); + localPositionArray = new ExNativeArray(capacity); + localRotationArray = new ExNativeArray(capacity); + localScaleArray = new ExNativeArray(capacity); + localToWorldMatrixArray = new ExNativeArray(capacity); + teamIdArray = new ExNativeArray(capacity); + + transformAccessArray = new TransformAccessArray(capacity); + + componentPositionArray = new ExNativeArray(capacity); + componentMinScaleArray = new ExNativeArray(capacity); + componentTransformAccessArray = new TransformAccessArray(capacity); + + existFixedTeam = new NativeReference(Allocator.Persistent); + + isValid = true; + } + + public bool IsValid() + { + return isValid; + } + + //========================================================================================= + /// + /// VirtualMeshTransformData‚’èż½ċŠ ™‚‹ + /// + /// + /// + internal DataChunk AddTransform(VirtualMeshContainer cmesh, int teamId) + { + if (isValid == false) + return default; + + Debug.Assert(cmesh != null); + int cnt = cmesh.GetTransformCount(); + + // ƒ‡ƒĵ‚ż‚³ƒ”ƒĵèż½ċŠ  + var c = flagArray.AddRange(cmesh.shareVirtualMesh.transformData.flagArray); + initLocalPositionArray.AddRange(cmesh.shareVirtualMesh.transformData.initLocalPositionArray); + initLocalRotationArray.AddRange(cmesh.shareVirtualMesh.transformData.initLocalRotationArray); + baseLocalPositionArray.AddRange(cmesh.shareVirtualMesh.transformData.initLocalPositionArray); + baseLocalRotationArray.AddRange(cmesh.shareVirtualMesh.transformData.initLocalRotationArray); + + // 領ċŸŸżèż½ċŠ  + positionArray.AddRange(cnt); + rotationArray.AddRange(cnt); + //inverseRotationArray.AddRange(cnt); + scaleArray.AddRange(cnt); + localPositionArray.AddRange(cnt); + localRotationArray.AddRange(cnt); + localScaleArray.AddRange(cnt); + localToWorldMatrixArray.AddRange(cnt); + + // ƒƒĵƒ ID + teamIdArray.AddRange(cnt, (short)teamId); + + // ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ  + int nowcnt = transformAccessArray.length; + + // ƒ‡ƒĵ‚żƒƒ£ƒ³‚݁開ċ§‹§ċŸ‹‚‚‹ + var meshT = cmesh.GetCenterTransform(); + int start = c.startIndex; + while (nowcnt < start) + { + transformAccessArray.Add(meshT); + nowcnt++; + } + + for (int i = 0; i < cnt; i++) + { + Transform t = cmesh.GetTransformFromIndex(i); + if (t == null) + t = meshT; + int index = c.startIndex + i; + if (index < nowcnt) + transformAccessArray[index] = t; + else + transformAccessArray.Add(t); + } + + return c; + } + + /// + /// Transformé ˜ċŸŸżèż½ċŠ ™‚‹ + /// + /// + /// + internal DataChunk AddTransform(int count, int teamId, Transform t) + { + if (isValid == false) + return default; + + // 領ċŸŸżèż½ċŠ ™‚‹ + var c = flagArray.AddRange(count); + initLocalPositionArray.AddRange(count); + initLocalRotationArray.AddRange(count); + baseLocalPositionArray.AddRange(count); + baseLocalRotationArray.AddRange(count); + positionArray.AddRange(count); + rotationArray.AddRange(count); + //inverseRotationArray.AddRange(count); + scaleArray.AddRange(count); + localPositionArray.AddRange(count); + localRotationArray.AddRange(count); + localScaleArray.AddRange(count); + localToWorldMatrixArray.AddRange(count); + + // ƒƒĵƒ ID + teamIdArray.AddRange(count, (short)teamId); + + // ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ Ż™ıĤnull§ç™ğ録™‚‹(Unity6.1§nullç™ğ録ŻNGĞŞ£Ÿïĵ) + int nowcnt = transformAccessArray.length; + + // ƒ‡ƒĵ‚żƒƒ£ƒ³‚݁開ċ§‹§ċŸ‹‚‚‹ + int start = c.startIndex; + while (nowcnt < start) + { + transformAccessArray.Add(t); + nowcnt++; + } + + for (int i = 0; i < count; i++) + { + //Transform t = null; + int index = c.startIndex + i; + if (index < nowcnt) + transformAccessArray[index] = t; + else + transformAccessArray.Add(t); + } + + return c; + } + + /// + /// Transformïĵ‘¤‚’èż½ċŠ ™‚‹ + /// + /// + /// + /// + internal DataChunk AddTransform(Transform t, ExBitFlag8 flag, int teamId) + { + if (isValid == false) + return default; + + // ƒ‡ƒĵ‚ż‚³ƒ”ƒĵèż½ċŠ  + var c = flagArray.Add(flag); + initLocalPositionArray.Add(t.localPosition); + initLocalRotationArray.Add(t.localRotation); + baseLocalPositionArray.Add(t.localPosition); + baseLocalRotationArray.Add(t.localRotation); + positionArray.Add(t.position); + rotationArray.Add(t.rotation); + //inverseRotationArray.Add(math.inverse(t.rotation)); + scaleArray.Add(t.lossyScale); + localPositionArray.Add(t.localPosition); + localRotationArray.Add(t.localRotation); + localScaleArray.Add(t.localScale); + localToWorldMatrixArray.Add(float4x4.identity); // ““Żċ˜ä½èĦŒċˆ— + + // ƒƒĵƒ ID + teamIdArray.Add((short)teamId); + + // ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ  + int nowcnt = transformAccessArray.length; + int index = c.startIndex; + if (index < nowcnt) + transformAccessArray[index] = t; + else + transformAccessArray.Add(t); + + return c; + } + + /// + /// Transformĉƒ…ċ ħ‚’ĉ›¸ĉ›ˆ‚‹ + /// + /// + /// + /// + internal void SetTransform(Transform t, ExBitFlag8 flag, int index, int teamId) + { + if (isValid == false) + return; + + if (t != null) + { + // ƒ‡ƒĵ‚żè¨­ċš + flagArray[index] = flag; + initLocalPositionArray[index] = t.localPosition; + initLocalRotationArray[index] = t.localRotation; + baseLocalPositionArray[index] = t.localPosition; + baseLocalRotationArray[index] = t.localRotation; + positionArray[index] = t.position; + rotationArray[index] = t.rotation; + //inverseRotationArray[index] = math.inverse(t.rotation); + scaleArray[index] = t.lossyScale; + localPositionArray[index] = t.localPosition; + localRotationArray[index] = t.localRotation; + localScaleArray[index] = t.localScale; + //localToWorldMatrix[index] = t.localToWorldMatrix; // ““Żä¸èĤ + teamIdArray[index] = (short)teamId; + transformAccessArray[index] = t; + } + else + { + // ƒ‡ƒĵ‚ż‚ŻƒŞ‚˘ïĵˆç„ĦċŠıċŒ–ïĵ‰ + flagArray[index] = default; + transformAccessArray[index] = null; + teamIdArray[index] = 0; + } + } + + /// + /// Transformĉƒ…ċ ħ‚’‚³ƒ”ƒĵ™‚‹ + /// + /// + /// + internal void CopyTransform(int fromIndex, int toIndex) + { + if (isValid == false) + return; + + flagArray[toIndex] = flagArray[fromIndex]; + initLocalPositionArray[toIndex] = initLocalPositionArray[fromIndex]; + initLocalRotationArray[toIndex] = initLocalRotationArray[fromIndex]; + baseLocalPositionArray[toIndex] = baseLocalPositionArray[fromIndex]; + baseLocalRotationArray[toIndex] = baseLocalRotationArray[fromIndex]; + positionArray[toIndex] = positionArray[fromIndex]; + rotationArray[toIndex] = rotationArray[fromIndex]; + //inverseRotationArray[toIndex] = inverseRotationArray[fromIndex]; + scaleArray[toIndex] = scaleArray[fromIndex]; + localPositionArray[toIndex] = localPositionArray[fromIndex]; + localRotationArray[toIndex] = localRotationArray[fromIndex]; + localScaleArray[toIndex] = localScaleArray[fromIndex]; + //localToWorldMatrix[toIndex] = localToWorldMatrix[fromIndex]; // ““Żä¸èĤ + transformAccessArray[toIndex] = transformAccessArray[fromIndex]; + teamIdArray[toIndex] = teamIdArray[fromIndex]; + } + + /// + /// ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ‚’ċ‰Šé™¤™‚‹ + /// + /// + internal void RemoveTransform(DataChunk c) + { + if (isValid == false) + return; + if (c.IsValid == false) + return; + + flagArray.RemoveAndFill(c); + initLocalPositionArray.Remove(c); + initLocalRotationArray.Remove(c); + baseLocalPositionArray.Remove(c); + baseLocalRotationArray.Remove(c); + positionArray.Remove(c); + rotationArray.Remove(c); + //inverseRotationArray.Remove(c); + scaleArray.Remove(c); + localPositionArray.Remove(c); + localRotationArray.Remove(c); + localScaleArray.Remove(c); + localToWorldMatrixArray.Remove(c); + teamIdArray.RemoveAndFill(c, 0); + + // ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ċ‰Šé™¤ + for (int i = 0; i < c.dataLength; i++) + { + int index = c.startIndex + i; + transformAccessArray[index] = null; + } + } + + /// + /// ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ĉœ‰ċŠıçŠĥĉ…‹‚’ċˆ‡‚Šĉ›żˆ‚‹ + /// + /// + /// true=ĉœ‰ċŠı, false=ç„ĦċŠı + internal void EnableTransform(DataChunk c, bool sw) + { + if (isValid == false) + return; + if (c.IsValid == false) + return; + + var job = new EnableTransformJob() + { + chunk = c, + sw = sw, + flagList = flagArray.GetNativeArray(), + }; + job.Run(); + } + + [BurstCompile] + struct EnableTransformJob : IJob + { + public DataChunk chunk; + public bool sw; + public NativeArray flagList; + + public void Execute() + { + for (int i = 0; i < chunk.dataLength; i++) + { + int index = chunk.startIndex + i; + + var flag = flagList[index]; + if (flag.Value == 0) + continue; + + flag.SetFlag(Flag_Enable, sw); + flagList[index] = flag; + } + } + } + + /// + /// ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ĉœ‰ċŠıçŠĥĉ…‹‚’ċˆ‡‚Šĉ›żˆ‚‹ + /// + /// + /// true=ĉœ‰ċŠı, false=ç„ĦċŠı + internal void EnableTransform(int index, bool sw) + { + if (isValid == false) + return; + if (index < 0) + return; + + var flag = flagArray[index]; + if (flag.Value == 0) + return; + flag.SetFlag(Flag_Enable, sw); + flagArray[index] = flag; + } + + internal DataChunk Expand(DataChunk c, int newLength) + { + if (isValid == false) + return default; + + // 領ċŸŸ + var nc = flagArray.Expand(c, newLength); + initLocalPositionArray.Expand(c, newLength); + initLocalRotationArray.Expand(c, newLength); + baseLocalPositionArray.Expand(c, newLength); + baseLocalRotationArray.Expand(c, newLength); + positionArray.Expand(c, newLength); + rotationArray.Expand(c, newLength); + //inverseRotationArray.Expand(c, newLength); + scaleArray.Expand(c, newLength); + localPositionArray.Expand(c, newLength); + localRotationArray.Expand(c, newLength); + localScaleArray.Expand(c, newLength); + localToWorldMatrixArray.Expand(c, newLength); + + // ƒƒĵƒ ID + teamIdArray.Expand(c, newLength); + + // ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ‚˘‚Ż‚ğ‚ı配ċˆ—ĉ‹Ħċĵµ + if (c.startIndex != nc.startIndex) + { + // ĉ—§é ˜ċŸŸċ…ˆé ­Transform + Transform frontT = transformAccessArray[c.startIndex]; + + while (transformAccessArray.length < (nc.startIndex + nc.dataLength)) + transformAccessArray.Add(frontT); + + for (int i = 0; i < c.dataLength; i++) + { + Transform t = transformAccessArray[c.startIndex + i]; + transformAccessArray[nc.startIndex + i] = t; + transformAccessArray[c.startIndex + i] = null; + } + } + + return nc; + } + + //========================================================================================= + /// + /// Transform‚’ċˆĉœŸċ§żċ‹˘§ċİċ…ƒ•›‚‹‚¸ƒ§ƒ–‚’発èĦŒ™‚‹ + /// + /// + /// + /// + public JobHandle RestoreTransform(JobHandle jobHandle) + { + existFixedTeam.Value = false; + if (Count > 0) + { + //Debug.Log("RestoreTransform"); + var job = new RestoreTransformJob() + { + existFixedTeam = existFixedTeam, + + flagList = flagArray.GetNativeArray(), + localPositionArray = initLocalPositionArray.GetNativeArray(), + localRotationArray = initLocalRotationArray.GetNativeArray(), + teamIdArray = teamIdArray.GetNativeArray(), + + teamDataArray = MagicaManager.Team.teamDataArray.GetNativeArray(), + }; + jobHandle = job.Schedule(transformAccessArray, jobHandle); + } + + return jobHandle; + } + + [BurstCompile] + struct RestoreTransformJob : IJobParallelForTransform + { + [NativeDisableParallelForRestriction] + public NativeReference existFixedTeam; + + [Unity.Collections.ReadOnly] + public NativeArray flagList; + + [Unity.Collections.ReadOnly] + public NativeArray localPositionArray; + [Unity.Collections.ReadOnly] + public NativeArray localRotationArray; + [Unity.Collections.ReadOnly] + public NativeArray teamIdArray; + + // team + [Unity.Collections.ReadOnly] + public NativeArray teamDataArray; + + + public void Execute(int index, TransformAccess transform) + { + if (transform.isValid == false) + return; + var flag = flagList[index]; + if (flag.IsSet(Flag_Restore) == false) + return; + + int teamId = teamIdArray[index]; + var tdata = teamDataArray[teamId]; + + // 一ċşĤżċİċ…ƒƒ•ƒİ‚°ŒçĞ‹£Ĥ„‚‹ċ ´ċˆŻċŸèĦŒ™‚‹ + if (flag.IsSet(Flag_Enable) == false && tdata.flag.IsSet(TeamManager.Flag_RestoreTransformOnlyOnec) == false) + return; + + // Keep‚Ѓރ³‚°ĉ™‚Ż‚ı‚­ƒƒƒ—™‚‹ + if ((tdata.IsCameraCullingInvisible && tdata.IsCameraCullingKeep) || tdata.IsDistanceCullingInvisible) + return; + + transform.SetLocalPositionAndRotation(localPositionArray[index], localRotationArray[index]); + + // ç‰İ理ĉ›´ĉ–°ƒƒĵƒ ċ­˜ċœ¨ + if (tdata.IsFixedUpdate) + existFixedTeam.Value = true; + + //Debug.Log($"RestoreTransform [{index}] lpos:{localPositionArray[index]}, lrot:{localRotationArray[index]}"); + } + } + + //========================================================================================= + /// + /// UnityPhysicsƒƒĵƒ ‹¤FixedUpdateŒċŸèĦŒ•‚ŒŞ‹£Ÿƒ•ƒĴƒĵƒ Żé€€éż•›ĤŠ„Ÿƒ™ƒĵ‚ıċ§żċ‹˘§ċ†ċşĤċİċ…ƒ•›‚‹ + /// + /// + /// + /// + public JobHandle RestoreBaseTransform(JobHandle jobHandle) + { + if (Count > 0) + { + //Debug.Log("RestoreTransform"); + var job = new RestoreBaseTransformJob() + { + flagList = flagArray.GetNativeArray(), + baseLocalPositionArray = baseLocalPositionArray.GetNativeArray(), + baseLocalRotationArray = baseLocalRotationArray.GetNativeArray(), + teamIdArray = teamIdArray.GetNativeArray(), + + teamDataArray = MagicaManager.Team.teamDataArray.GetNativeArray(), + }; + jobHandle = job.Schedule(transformAccessArray, jobHandle); + } + + return jobHandle; + } + + [BurstCompile] + struct RestoreBaseTransformJob : IJobParallelForTransform + { + [Unity.Collections.ReadOnly] + public NativeArray flagList; + [Unity.Collections.ReadOnly] + public NativeArray baseLocalPositionArray; + [Unity.Collections.ReadOnly] + public NativeArray baseLocalRotationArray; + [Unity.Collections.ReadOnly] + public NativeArray teamIdArray; + + // team + [Unity.Collections.ReadOnly] + public NativeArray teamDataArray; + + + public void Execute(int index, TransformAccess transform) + { + if (transform.isValid == false) + return; + var flag = flagList[index]; + if (flag.IsSet(Flag_Restore) == false) + return; + + int teamId = teamIdArray[index]; + var tdata = teamDataArray[teamId]; + + // Fixedĉ›´ĉ–°ƒƒĵƒ ż + if (tdata.IsFixedUpdate == false) + return; + + // 一ċşĤżċİċ…ƒƒ•ƒİ‚°ŒçĞ‹£Ĥ„‚‹ċ ´ċˆŻċŸèĦŒ™‚‹ + if (flag.IsSet(Flag_Enable) == false && tdata.flag.IsSet(TeamManager.Flag_RestoreTransformOnlyOnec) == false) + return; + + // Keep‚Ѓރ³‚°ĉ™‚Ż‚ı‚­ƒƒƒ—™‚‹ + if ((tdata.IsCameraCullingInvisible && tdata.IsCameraCullingKeep) || tdata.IsDistanceCullingInvisible) + return; + + transform.SetLocalPositionAndRotation(baseLocalPositionArray[index], baseLocalRotationArray[index]); + + //Debug.Log($"RestoreTransform [{index}] lpos:{baseLocalPositionArray[index]}, lrot:{baseLocalRotationArray[index].value}"); + } + } + + //========================================================================================= + /// + /// ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ‚’èŞ­żèĵ‚€‚¸ƒ§ƒ–‚’発èĦŒ™‚‹ + /// + /// + /// + public JobHandle ReadTransformSchedule(JobHandle jobHandle) + { + if (Count > 0) + { + var job = new ReadTransformJob() + { + fixedUpdateCount = MagicaManager.Time.FixedUpdateCount, + + flagList = flagArray.GetNativeArray(), + positionArray = positionArray.GetNativeArray(), + rotationArray = rotationArray.GetNativeArray(), + scaleList = scaleArray.GetNativeArray(), + localPositionArray = localPositionArray.GetNativeArray(), + localRotationArray = localRotationArray.GetNativeArray(), + localScaleArray = localScaleArray.GetNativeArray(), + //inverseRotationArray = inverseRotationArray.GetNativeArray(), + localToWorldMatrixArray = localToWorldMatrixArray.GetNativeArray(), + baseLocalPositionArray = baseLocalPositionArray.GetNativeArray(), + baseLocalRotationArray = baseLocalRotationArray.GetNativeArray(), + + teamIdArray = teamIdArray.GetNativeArray(), + + teamDataArray = MagicaManager.Team.teamDataArray.GetNativeArray(), + }; + jobHandle = job.ScheduleReadOnly(transformAccessArray, 8, jobHandle); + } + + return jobHandle; + } + + [BurstCompile] + struct ReadTransformJob : IJobParallelForTransform + { + public int fixedUpdateCount; + + [Unity.Collections.ReadOnly] + public NativeArray flagList; + + [Unity.Collections.WriteOnly] + public NativeArray positionArray; + [Unity.Collections.WriteOnly] + public NativeArray rotationArray; + [Unity.Collections.WriteOnly] + public NativeArray scaleList; + [Unity.Collections.WriteOnly] + public NativeArray localPositionArray; + [Unity.Collections.WriteOnly] + public NativeArray localRotationArray; + [Unity.Collections.WriteOnly] + public NativeArray localScaleArray; + //[Unity.Collections.WriteOnly] + //public NativeArray inverseRotationArray; + [Unity.Collections.WriteOnly] + public NativeArray localToWorldMatrixArray; + [Unity.Collections.WriteOnly] + public NativeArray baseLocalPositionArray; + [Unity.Collections.WriteOnly] + public NativeArray baseLocalRotationArray; + + [Unity.Collections.ReadOnly] + public NativeArray teamIdArray; + + // team + [Unity.Collections.ReadOnly] + public NativeArray teamDataArray; + + public void Execute(int index, TransformAccess transform) + { + if (transform.isValid == false) + return; + var flag = flagList[index]; + if (flag.IsSet(Flag_Enable) == false) + return; + if (flag.IsSet(Flag_Read) == false) + return; + + // ‚Ѓރ³‚°ĉ™‚ŻèŞ­żèĵŞ„ + int teamId = teamIdArray[index]; + var tdata = teamDataArray[teamId]; + if (tdata.IsCullingInvisible) + return; + + transform.GetPositionAndRotation(out var pos, out var rot); + float4x4 LtoW = transform.localToWorldMatrix; + + positionArray[index] = pos; + rotationArray[index] = rot; + localPositionArray[index] = transform.localPosition; + localRotationArray[index] = transform.localRotation; + localScaleArray[index] = transform.localScale; + + // ƒžƒˆƒŞƒƒ‚Ż‚ı‹‚‰ĉ­£ç˘şŞ‚ı‚ħƒĵƒĞċ€¤‚’ç—ċ‡ş™‚‹ïĵˆ“‚ŒŻTransform.lossyScale¨ç­‰äĦïĵ‰ + var irot = math.inverse(rot); + var m2 = math.mul(new float4x4(irot, float3.zero), LtoW); + var scl = new float3(m2.c0.x, m2.c1.y, m2.c2.z); + scaleList[index] = scl; + + //Debug.Log($"ReadTransform [{index}] pos:{pos}, rot:{rot}, scl:{scl}"); + //Debug.Log($"LtoW:\n{LtoW}"); + + // ƒŻƒĵƒĞƒ‰->ƒ­ƒĵ‚ЃĞċ¤‰ĉ›ç”¨é€†‚Ż‚İƒĵ‚żƒ‹‚ރ³ + //inverseRotationArray[index] = math.inverse(rot); + + // ƒŻƒĵƒĞƒ‰ċ¤‰ĉ›ƒžƒˆƒŞƒƒ‚Ż‚ı + localToWorldMatrixArray[index] = LtoW; + + // äğŠċ›žċ§żċ‹˘‚’ċŸşĉœĴċ§żċ‹˘¨—Ĥ退避•›‚‹ + // Fixedĉ›´ĉ–°ƒƒĵƒ ‹¤FixedUpdateŒċŸèĦŒ•‚ŒĤ„‚‹ċ ´ċˆ€‚‚‚‚Fixedĉ›´ĉ–°ċ‡şŞ„ċ ´ċˆŻĉŻŽċ›ž + if ((tdata.IsFixedUpdate && fixedUpdateCount > 0) || tdata.IsFixedUpdate == false) + { + baseLocalPositionArray[index] = transform.localPosition; + baseLocalRotationArray[index] = transform.localRotation; + } + + //Debug.Log($"ReadTransform [{index}] pos:{pos}, rot:{rot}"); + } + } + + //========================================================================================= + /// + /// Transform‚’ĉ›¸èĵ‚€‚¸ƒ§ƒ–‚’発èĦŒ™‚‹ + /// + /// + /// + /// + public JobHandle WriteTransformSchedule(JobHandle jobHandle) + { + var job = new WriteTransformJob() + { + flagList = flagArray.GetNativeArray(), + worldPositions = positionArray.GetNativeArray(), + worldRotations = rotationArray.GetNativeArray(), + localPositions = localPositionArray.GetNativeArray(), + localRotations = localRotationArray.GetNativeArray(), + + teamIdArray = teamIdArray.GetNativeArray(), + + teamDataArray = MagicaManager.Team.teamDataArray.GetNativeArray(), + }; + jobHandle = job.Schedule(transformAccessArray, jobHandle); + + return jobHandle; + } + + [BurstCompile] + struct WriteTransformJob : IJobParallelForTransform + { + [Unity.Collections.ReadOnly] + public NativeArray flagList; + + [Unity.Collections.ReadOnly] + public NativeArray worldPositions; + [Unity.Collections.ReadOnly] + public NativeArray worldRotations; + [Unity.Collections.ReadOnly] + public NativeArray localPositions; + [Unity.Collections.ReadOnly] + public NativeArray localRotations; + + [Unity.Collections.ReadOnly] + public NativeArray teamIdArray; + + // team + [Unity.Collections.ReadOnly] + public NativeArray teamDataArray; + + public void Execute(int index, TransformAccess transform) + { + if (transform.isValid == false) + return; + var flag = flagList[index]; + if (flag.IsSet(Flag_Enable) == false) + return; + + int teamId = teamIdArray[index]; + var tdata = teamDataArray[teamId]; + + // ‚Ѓރ³‚°ĉ™‚Żĉ›¸èĵŞ„ + if (tdata.IsCullingInvisible) + return; + + // ĉµċ°‚ı‚ħƒĵƒĞĉ™‚Żĉ›¸èĵŞ„ + if (tdata.IsScaleSuspend) + return; + + // ĉ›¸èĵżċœĉ­˘ä¸­Ş‚‰‚ı‚­ƒƒƒ— + if (tdata.flag.IsSet(TeamManager.Flag_SkipWriting)) + return; + + if (flag.IsSet(Flag_WorldRotWrite)) + { + // ƒŻƒĵƒĞƒ‰ċ›žèğ˘ + transform.rotation = worldRotations[index]; + //Debug.Log($"WriteTransform [{index}] (World!) rot:{worldRotations[index]}"); + + // BoneSpringżƒŻƒĵƒĞƒ‰ċş§ĉ¨™‚’ĉ›¸èĵ‚€ + if (tdata.IsSpring) + { + transform.position = worldPositions[index]; + } + } + else if (flag.IsSet(Flag_LocalPosRotWrite)) + { + // ƒ­ƒĵ‚ЃĞċş§ĉ¨™ƒğċ›žèğ˘‚’ĉ›¸èĵ‚€ + transform.SetLocalPositionAndRotation(localPositions[index], localRotations[index]); + + //Debug.Log($"WriteTransform [{index}] (local!) lpos:{localPositions[index]}, lrot:{localRotations[index]}"); + } + } + } + + //========================================================================================= + /// + /// ‚³ƒ³ƒƒĵƒƒ³ƒˆç”¨ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ç™ğ録 + /// + /// + /// + internal int AddComponentTransform(Transform t) + { + if (isValid == false) + return -1; + Debug.Assert(t); + + int index = componentPositionArray.Add(float3.zero).startIndex; + componentMinScaleArray.Add(1); + + // ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ  + int nowcnt = componentTransformAccessArray.length; + if (index < nowcnt) + componentTransformAccessArray[index] = t; + else + componentTransformAccessArray.Add(t); + + return index; + } + + /// + /// ‚³ƒ³ƒƒĵƒƒ³ƒˆç”¨ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ċ‰Šé™¤ + /// + /// + internal void RemoveComponentTransform(int index) + { + if (isValid == false) + return; + if (index < 0) + return; + + componentPositionArray.Remove(index); + componentMinScaleArray.Remove(index); + + // ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ċ‰Šé™¤ + componentTransformAccessArray[index] = null; + } + + /// + /// ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ‚’èŞ­żèĵ‚€‚¸ƒ§ƒ–‚’発èĦŒ™‚‹ + /// + /// + /// + internal JobHandle ReadComponentTransform(JobHandle jobHandle) + { + if (componentPositionArray.Count > 0) + { + var job = new ReadComponentTransformJob() + { + positionArray = componentPositionArray.GetNativeArray(), + minScaleArray = componentMinScaleArray.GetNativeArray(), + }; + jobHandle = job.ScheduleReadOnly(componentTransformAccessArray, 16, jobHandle); + } + + return jobHandle; + } + + [BurstCompile] + struct ReadComponentTransformJob : IJobParallelForTransform + { + [Unity.Collections.WriteOnly] + public NativeArray positionArray; + [Unity.Collections.WriteOnly] + public NativeArray minScaleArray; + + public void Execute(int index, TransformAccess transform) + { + if (transform.isValid == false) + return; + + positionArray[index] = transform.position; + + // ‚ı‚ħƒĵƒĞXYZĉœ€ċ°çµĥċŻċ€¤ + // ‚³ƒ³ƒƒĵƒƒ³ƒˆïĵ‚ı‚ħƒĵƒĞċˆ¤ċšĞä½żç”¨ + float3 scl = transform.localToWorldMatrix.lossyScale; + float minScale = math.cmin(math.abs(scl)); + minScaleArray[index] = minScale; + + //Debug.Log(scl); + //Debug.Log(minScale); + } + } + + + //========================================================================================= + public void InformationLog(StringBuilder allsb) + { + StringBuilder sb = new StringBuilder(); + sb.AppendLine($"========== Transform Manager =========="); + if (IsValid() == false) + { + sb.AppendLine($"Transform Manager. Invalid."); + } + else + { + // transform + int tcnt = transformAccessArray.isCreated ? transformAccessArray.length : 0; + sb.AppendLine($"Transform Manager. Length:{tcnt}"); + sb.AppendLine($" -flagArray:{flagArray.ToSummary()}"); + sb.AppendLine($" -initLocalPositionArray:{initLocalPositionArray.ToSummary()}"); + sb.AppendLine($" -initLocalRotationArray:{initLocalRotationArray.ToSummary()}"); + sb.AppendLine($" -baseLocalPositionArray:{baseLocalPositionArray.ToSummary()}"); + sb.AppendLine($" -baseLocalRotationArray:{baseLocalRotationArray.ToSummary()}"); + sb.AppendLine($" -positionArray:{positionArray.ToSummary()}"); + sb.AppendLine($" -rotationArray:{rotationArray.ToSummary()}"); + //sb.AppendLine($" -inverseRotationArray:{inverseRotationArray.ToSummary()}"); + sb.AppendLine($" -scaleArray:{scaleArray.ToSummary()}"); + sb.AppendLine($" -localPositionArray:{localPositionArray.ToSummary()}"); + sb.AppendLine($" -localRotationArray:{localRotationArray.ToSummary()}"); + sb.AppendLine($" -localScaleArray:{localScaleArray.ToSummary()}"); + sb.AppendLine($" -localToWorldMatirxArray:{localToWorldMatrixArray.ToSummary()}"); + sb.AppendLine($" -teamIdArray:{teamIdArray.ToSummary()}"); + + if (transformAccessArray.isCreated) + { + for (int i = 0; i < tcnt; i++) + { + var t = transformAccessArray[i]; + var flag = flagArray[i]; + var teamId = teamIdArray[i]; + sb.Append($" [{i}] team:{teamId} ("); + sb.Append(flag.IsSet(Flag_Enable) ? "E" : ""); + sb.Append(flag.IsSet(Flag_Restore) ? "R" : ""); + sb.Append(flag.IsSet(Flag_Read) ? "r" : ""); + sb.Append(flag.IsSet(Flag_WorldRotWrite) ? "W" : ""); + sb.Append(flag.IsSet(Flag_LocalPosRotWrite) ? "w" : ""); + if (t) + sb.AppendLine($") {t.name}"); + else + sb.AppendLine($") (null)"); + } + } + + // component + tcnt = componentTransformAccessArray.isCreated ? componentTransformAccessArray.length : 0; + sb.AppendLine($"Component Transform Manager. Length:{tcnt}"); + sb.AppendLine($" -componentPositionArray:{componentPositionArray.ToSummary()}"); + sb.AppendLine($" -componentMinScaleArray:{componentMinScaleArray.ToSummary()}"); + if (componentTransformAccessArray.isCreated) + { + for (int i = 0; i < tcnt; i++) + { + var t = componentTransformAccessArray[i]; + var flag = flagArray[i]; + var teamId = teamIdArray[i]; + sb.Append($" [{i}] team:{teamId} ("); + sb.Append(flag.IsSet(Flag_Enable) ? "E" : ""); + sb.Append(flag.IsSet(Flag_Restore) ? "R" : ""); + sb.Append(flag.IsSet(Flag_Read) ? "r" : ""); + sb.Append(flag.IsSet(Flag_WorldRotWrite) ? "W" : ""); + sb.Append(flag.IsSet(Flag_LocalPosRotWrite) ? "w" : ""); + if (t) + sb.AppendLine($") {t.name}"); + else + sb.AppendLine($") (null)"); + } + } + } + sb.AppendLine(); + Debug.Log(sb.ToString()); + allsb.Append(sb); + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/TransformManager/TransformManager.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Manager/TransformManager/TransformManager.cs.meta new file mode 100644 index 00000000..65e0c492 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/TransformManager/TransformManager.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: ecc01c078ba26454fb4fd62290d2a22d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Manager/TransformManager/TransformManager.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/TransformManager/TransformRecord.cs b/Assets/MagicaCloth2/Scripts/Core/Manager/TransformManager/TransformRecord.cs new file mode 100644 index 00000000..737b144a --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/TransformManager/TransformRecord.cs @@ -0,0 +1,78 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System.Collections.Generic; +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ĉƒ…ċ ħä¸€ĉ™‚記録 + /// + public class TransformRecord : IValid, ITransform + { + public Transform transform; + public MagicaObjectId id; + public Vector3 localPosition; + public Quaternion localRotation; + public Vector3 position; + public Quaternion rotation; + public Vector3 scale; // lossy scale + public Matrix4x4 localToWorldMatrix; + public Matrix4x4 worldToLocalMatrix; + public MagicaObjectId pid; + + public TransformRecord(Transform t, bool read) + { + if (t) + { + transform = t; + id = t.GetMagicaId(); + + if (read) + { + localPosition = t.localPosition; + localRotation = t.localRotation; + position = t.position; + rotation = t.rotation; + scale = t.lossyScale; + localToWorldMatrix = t.localToWorldMatrix; + worldToLocalMatrix = t.worldToLocalMatrix; + } + + if (t.parent) + pid = t.parent.GetMagicaId(); + } + } + + public Vector3 InverseTransformDirection(Vector3 dir) + { + return Quaternion.Inverse(rotation) * dir; + } + + public bool IsValid() + { + return id.IsValid(); + } + + public void GetUsedTransform(HashSet transformSet) + { + transformSet.Add(transform); + } + + public void ReplaceTransform(Dictionary replaceDict) + { + if (replaceDict.ContainsKey(id)) + { + var t = replaceDict[id]; + transform = t; + id = transform.GetMagicaId(); + } + if (replaceDict.ContainsKey(pid)) + { + var t = replaceDict[pid]; + pid = t.GetMagicaId(); + } + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/TransformManager/TransformRecord.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Manager/TransformManager/TransformRecord.cs.meta new file mode 100644 index 00000000..e3a32625 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/TransformManager/TransformRecord.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 8baf80aea87ff80448fd14763a3a6a94 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Manager/TransformManager/TransformRecord.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/TransformManager/TransformRecordSerializeData.cs b/Assets/MagicaCloth2/Scripts/Core/Manager/TransformManager/TransformRecordSerializeData.cs new file mode 100644 index 00000000..5fb33079 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/TransformManager/TransformRecordSerializeData.cs @@ -0,0 +1,82 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2025 MagicaSoft. +// https://magicasoft.jp +using System.Collections.Generic; +using UnityEngine; + +namespace MagicaCloth2 +{ + [System.Serializable] + public class TransformRecordSerializeData : ITransform + { + public Transform transform; // ċˆİ用—Ş„Œċżµç‚şĞ記録 + public Vector3 localPosition; + public Quaternion localRotation; + public Vector3 position; + public Quaternion rotation; + public Vector3 scale; // lossy scale + public Matrix4x4 localToWorldMatrix; + public Matrix4x4 worldToLocalMatrix; + + public void Serialize(TransformRecord tr) + { + Debug.Assert(tr != null); + + transform = tr.transform; + localPosition = tr.localPosition; + localRotation = tr.localRotation; + position = tr.position; + rotation = tr.rotation; + scale = tr.scale; + localToWorldMatrix = tr.localToWorldMatrix; + worldToLocalMatrix = tr.worldToLocalMatrix; + } + + public void Deserialize(TransformRecord tr) + { + Debug.Assert(tr != null); + + // ċş§ĉ¨™ç³ğżċİċ…ƒ™‚‹ + tr.localPosition = localPosition; + tr.localRotation = localRotation; + tr.position = position; + tr.rotation = rotation; + tr.scale = scale; + tr.localToWorldMatrix = localToWorldMatrix; + tr.worldToLocalMatrix = worldToLocalMatrix; + } + + public int GetLocalHash() + { + int hash = 0; + if (transform) + hash += (123 + transform.childCount * 345); + + return hash; + } + + public int GetGlobalHash() + { + int hash = 0; + + // ƒ­ƒĵ‚ЃĞċ§żċ‹˘ż + hash += localPosition.GetHashCode(); + hash += localRotation.GetHashCode(); + + return hash; + } + + public void GetUsedTransform(HashSet transformSet) + { + if (transform) + transformSet.Add(transform); + } + + public void ReplaceTransform(Dictionary replaceDict) + { + MagicaObjectId id = transform != null ? transform.GetMagicaId() : MagicaObjectId.Invalid; + if (id.IsValid() && replaceDict.ContainsKey(id)) + transform = replaceDict[id]; + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/TransformManager/TransformRecordSerializeData.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Manager/TransformManager/TransformRecordSerializeData.cs.meta new file mode 100644 index 00000000..e8cdb1a5 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/TransformManager/TransformRecordSerializeData.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: f4930f42a38b269439caa19e9603c9aa +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Manager/TransformManager/TransformRecordSerializeData.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/VirtualMesh.meta b/Assets/MagicaCloth2/Scripts/Core/Manager/VirtualMesh.meta new file mode 100644 index 00000000..6d528dd9 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/VirtualMesh.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0a9459f4f30fe9a4582cc311664181d4 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/VirtualMesh/VirtualMeshManager.cs b/Assets/MagicaCloth2/Scripts/Core/Manager/VirtualMesh/VirtualMeshManager.cs new file mode 100644 index 00000000..c8b39be7 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/VirtualMesh/VirtualMeshManager.cs @@ -0,0 +1,1719 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System.Text; +using Unity.Burst; +using Unity.Collections; +using Unity.Jobs; +using Unity.Mathematics; +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// VirtualMeshçĦ理ƒžƒƒĵ‚¸ƒ£ + /// + public class VirtualMeshManager : IManager, IValid + { + //========================================================================================= + // ■ProxyMesh + //========================================================================================= + // ■ċ…ħ通 + /// + /// ċŻċżœ™‚‹ƒƒĵƒ ID + /// + public ExNativeArray teamIds; + + /// + /// 頂ç‚ıċħžĉ€§ + /// + public ExNativeArray attributes; + + /// + /// 頂ç‚ı”¨ĉŽçĥšƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı¨ĉ³•ç·šĉŽç·šƒ•ƒŞƒƒƒ—ƒ•ƒİ‚°ïĵˆĉœ€ċ¤§ïĵ—¤ïĵ‰ + /// “‚ŒŻĉ³•ç·š‚’ċ†è¨ˆç—™‚‹Ÿ‚Ğ用„‚‰‚Œ‚‹‚‚§ïĵ—¤‚‚Œ°ċċˆ†§‚‚‹¨ċˆ¤ĉ–­—Ÿ‚‚€‚ + /// Ÿ‚ĉ­£ç˘şŞƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĉŽçĥš‚’èĦ¨—Ĥ„Ş„€‚ + /// ƒ‡ƒĵ‚żŻ12-20bituint§ƒ‘ƒƒ‚݁•‚ŒĤ„‚‹ + /// 12(hi) = ĉ³•ç·šĉŽç·šƒ•ƒŞƒƒƒ—ƒ•ƒİ‚°(ĉ³•ç·š:0x1,ĉŽç·š:0x2)€‚ONċ ´ċˆƒ•ƒŞƒƒƒ—€‚ + /// 20(low) = ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı€‚ + /// + public ExNativeArray> vertexToTriangles; + + /// + /// 頂ç‚ı”¨ĉŽçĥšé ‚ç‚ı‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı + /// â€ğçċœ¨ĉœŞä½żç”¨ + /// + //public ExNativeArray vertexToVertexIndexArray; + //public ExNativeArray vertexToVertexDataArray; + + /// + /// 頂ç‚ı”¨ƒ‚¤ƒ³ƒ‰ƒƒĵ‚ş + /// 頂ç‚ıƒ‚¤ƒ³ƒ‰ĞŻ‚ı‚ħƒĵƒĞċ€¤Żä¸èĤ + /// + public ExNativeArray vertexBindPosePositions; + public ExNativeArray vertexBindPoseRotations; + + /// + /// ċ„é ‚ç‚ıĉ·ħ•(0.0-1.0) + /// + public ExNativeArray vertexDepths; + + /// + /// ċ„é ‚ç‚ıƒĞƒĵƒˆ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı(-1=Ş—) + /// + public ExNativeArray vertexRootIndices; + + /// + /// ċ„é ‚ç‚ıèĤށ‹‚‰ċŸşĉş–ƒ­ƒĵ‚ЃĞċş§ĉ¨™ + /// + public ExNativeArray vertexLocalPositions; + + /// + /// ċ„é ‚ç‚ıèĤށ‹‚‰ċŸşĉş–ƒ­ƒĵ‚ЃĞċ›žèğ˘ + /// + public ExNativeArray vertexLocalRotations; + + /// + /// ċ„é ‚ç‚ıèĤŞé ‚ç‚ı‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı(-1=Ş—) + /// + public ExNativeArray vertexParentIndices; + + /// + /// ċ„é ‚ç‚ıċ­é ‚ç‚ı‚¤ƒ³ƒ‡ƒƒ‚Ż‚ıƒŞ‚ıƒˆ + /// + public ExNativeArray vertexChildIndexArray; + public ExNativeArray vertexChildDataArray; + + /// + /// ĉ³•ç·šèŞżĉ•´ç”¨ċ›žèğ˘ + /// + public ExNativeArray normalAdjustmentRotations; + + /// + /// ċ„é ‚ç‚ıè§’ċşĤ計ç—用ƒ­ƒĵ‚ЃĞċ›žèğ˘ + /// pitch/yawċ€‹ċˆċˆĥ限Żv1.0§ŻċŸè£…—Ş„§ä¸€ĉ—Ĥċœĉ­˘•›‚‹ + /// + //public ExNativeArray vertexAngleCalcLocalRotations; + + /// + /// UV + /// VirtualMeshUVŻTangent計ç—用§‚‚Šƒ†‚Ż‚ıƒƒ£ƒžƒƒƒ”ƒ³‚°ç”¨§ŻŞ„§ĉ³¨ĉ„ïĵ + /// + public ExNativeArray uv; + + + public int ProxyVertexCount => teamIds?.Count ?? 0; + + // ■ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ ----------------------------------------------------- + public ExNativeArray triangleTeamIdArray; + + /// + /// ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ頂ç‚ı‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı + /// + public ExNativeArray triangles; + + /// + /// ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĉ³•ç·š + /// + public ExNativeArray triangleNormals; + + /// + /// ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĉŽç·š + /// + public ExNativeArray triangleTangents; + + public int ProxyTriangleCount => triangles?.Count ?? 0; + + // ■‚¨ƒƒ‚¸ ------------------------------------------------------------- + public ExNativeArray edgeTeamIdArray; + + /// + /// ‚¨ƒƒ‚¸é ‚ç‚ı‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı + /// + public ExNativeArray edges; + + /// + /// ‚¨ƒƒ‚¸ċ›şĉœ‰ƒ•ƒİ‚°(VirtualMesh.EdgeFlag_~) + /// + public ExNativeArray edgeFlags; + + public int ProxyEdgeCount => edges?.Count ?? 0; + + // ■ƒ™ƒĵ‚ıƒİ‚¤ƒ³ ------------------------------------------------------- + /// + /// ƒ™ƒĵ‚ıƒİ‚¤ƒ³”¨ƒ•ƒİ‚° + /// + public ExNativeArray baseLineFlags; + + /// + /// ƒ™ƒĵ‚ıƒİ‚¤ƒ³”¨ƒƒĵƒ ID + /// + public ExNativeArray baseLineTeamIds; + + /// + /// ƒ™ƒĵ‚ıƒİ‚¤ƒ³”¨ƒ‡ƒĵ‚żé–‹ċ§‹‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı + /// + public ExNativeArray baseLineStartDataIndices; + + /// + /// ƒ™ƒĵ‚ıƒİ‚¤ƒ³”¨ƒ‡ƒĵ‚żĉ•° + /// + public ExNativeArray baseLineDataCounts; + + /// + /// ƒ™ƒĵ‚ıƒİ‚¤ƒ³ƒ‡ƒĵ‚żïĵˆé ‚ç‚ı‚¤ƒ³ƒ‡ƒƒ‚Ż‚ıïĵ‰ + /// + public ExNativeArray baseLineData; + + public int ProxyBaseLineCount => baseLineFlags?.Count ?? 0; + + // ■ƒĦƒƒ‚·ƒċŸşĉœĴ(ċ…ħ通) ------------------------------------------------- + public ExNativeArray localPositions; + public ExNativeArray localNormals; + public ExNativeArray localTangents; + public ExNativeArray boneWeights; + public ExNativeArray skinBoneTransformIndices; + public ExNativeArray skinBoneBindPoses; + + public int ProxyLocalPositionCount => localPositions?.Count ?? 0; + + // ■BoneClothż ----------------------------------------------------- + public ExNativeArray vertexToTransformRotations; + + // ■ĉœ€çµ‚é ‚ç‚ıċ§żċ‹˘ + public ExNativeArray positions; + public ExNativeArray rotations; + + //========================================================================================= + // ■MappingMesh + //========================================================================================= + public ExNativeArray mappingIdArray; // (+1)•‚ŒĤ„‚‹§ĉ³¨ĉ„ïĵ + public ExNativeArray mappingReferenceIndices; + public ExNativeArray mappingAttributes; + public ExNativeArray mappingLocalPositins; + public ExNativeArray mappingLocalNormals; + public ExNativeArray mappingLocalTangents; + public ExNativeArray mappingBoneWeights; +#if MC2_DEBUG + public ExNativeArray mappingPositions; + //public ExNativeArray mappingNormals; + //public ExNativeArray mappingTangents; +#endif + + public int MappingVertexCount => mappingIdArray?.Count ?? 0; + + //========================================================================================= + bool isValid = false; + + //========================================================================================= + public void Dispose() + { + isValid = false; + + // 作ĉ­ƒƒƒƒ•‚Ħ + teamIds?.Dispose(); + attributes?.Dispose(); + vertexToTriangles?.Dispose(); + //vertexToVertexIndexArray?.Dispose(); + //vertexToVertexDataArray?.Dispose(); + vertexBindPosePositions?.Dispose(); + vertexBindPoseRotations?.Dispose(); + vertexDepths?.Dispose(); + vertexRootIndices?.Dispose(); + vertexLocalPositions?.Dispose(); + vertexLocalRotations?.Dispose(); + vertexParentIndices?.Dispose(); + vertexChildIndexArray?.Dispose(); + vertexChildDataArray?.Dispose(); + normalAdjustmentRotations?.Dispose(); + //vertexAngleCalcLocalRotations?.Dispose(); + uv?.Dispose(); + teamIds = null; + attributes = null; + vertexToTriangles = null; + //vertexToVertexIndexArray = null; + //vertexToVertexDataArray = null; + vertexBindPosePositions = null; + vertexBindPoseRotations = null; + vertexDepths = null; + vertexRootIndices = null; + vertexLocalPositions = null; + vertexLocalRotations = null; + vertexParentIndices = null; + vertexChildIndexArray = null; + vertexChildDataArray = null; + normalAdjustmentRotations = null; + //vertexAngleCalcLocalRotations = null; + uv = null; + + triangleTeamIdArray?.Dispose(); + triangles?.Dispose(); + triangleNormals?.Dispose(); + triangleTangents?.Dispose(); + triangleTeamIdArray = null; + triangles = null; + triangleNormals = null; + triangleTangents = null; + + edgeTeamIdArray?.Dispose(); + edges?.Dispose(); + edgeFlags?.Dispose(); + edgeTeamIdArray = null; + edges = null; + edgeFlags = null; + + positions?.Dispose(); + rotations?.Dispose(); + positions = null; + rotations = null; + + baseLineFlags?.Dispose(); + baseLineTeamIds?.Dispose(); + baseLineStartDataIndices?.Dispose(); + baseLineDataCounts?.Dispose(); + baseLineData?.Dispose(); + baseLineFlags = null; + baseLineTeamIds = null; + baseLineStartDataIndices = null; + baseLineDataCounts = null; + baseLineData = null; + + localPositions?.Dispose(); + localNormals?.Dispose(); + localTangents?.Dispose(); + boneWeights?.Dispose(); + skinBoneTransformIndices?.Dispose(); + skinBoneBindPoses?.Dispose(); + localPositions = null; + localNormals = null; + localTangents = null; + boneWeights = null; + skinBoneTransformIndices = null; + skinBoneBindPoses = null; + + vertexToTransformRotations?.Dispose(); + vertexToTransformRotations = null; + + mappingIdArray?.Dispose(); + mappingReferenceIndices?.Dispose(); + mappingAttributes?.Dispose(); + mappingLocalPositins?.Dispose(); + mappingLocalNormals?.Dispose(); + mappingLocalTangents?.Dispose(); + mappingBoneWeights?.Dispose(); +#if MC2_DEBUG + mappingPositions?.Dispose(); + //mappingNormals?.Dispose(); + //mappingTangents?.Dispose(); +#endif + mappingIdArray = null; + mappingReferenceIndices = null; + mappingAttributes = null; + mappingLocalPositins = null; + mappingLocalNormals = null; + mappingLocalTangents = null; + mappingBoneWeights = null; + } + + public void EnterdEditMode() + { + Dispose(); + } + + public void Initialize() + { + Dispose(); + + // 作ĉ­ƒƒƒƒ•‚Ħ + const int capacity = 0; + const bool create = true; + teamIds = new ExNativeArray(capacity, create); + attributes = new ExNativeArray(capacity, create); + vertexToTriangles = new ExNativeArray>(capacity, create); + //vertexToVertexIndexArray = new ExNativeArray(capacity, create); + //vertexToVertexDataArray = new ExNativeArray(capacity, create); + vertexBindPosePositions = new ExNativeArray(capacity, create); + vertexBindPoseRotations = new ExNativeArray(capacity, create); + vertexDepths = new ExNativeArray(capacity, create); + vertexRootIndices = new ExNativeArray(capacity, create); + vertexLocalPositions = new ExNativeArray(capacity, create); + vertexLocalRotations = new ExNativeArray(capacity, create); + vertexParentIndices = new ExNativeArray(capacity, create); + vertexChildIndexArray = new ExNativeArray(capacity, create); + vertexChildDataArray = new ExNativeArray(capacity, create); + normalAdjustmentRotations = new ExNativeArray(capacity, create); + //vertexAngleCalcLocalRotations = new ExNativeArray(capacity, create); + uv = new ExNativeArray(capacity, create); + + triangleTeamIdArray = new ExNativeArray(capacity, create); + triangles = new ExNativeArray(capacity, create); + triangleNormals = new ExNativeArray(capacity, create); + triangleTangents = new ExNativeArray(capacity, create); + + edgeTeamIdArray = new ExNativeArray(capacity, create); + edges = new ExNativeArray(capacity, create); + edgeFlags = new ExNativeArray(capacity, create); + + positions = new ExNativeArray(capacity, create); + rotations = new ExNativeArray(capacity, create); + + baseLineFlags = new ExNativeArray(capacity, create); + baseLineTeamIds = new ExNativeArray(capacity, create); + baseLineStartDataIndices = new ExNativeArray(capacity, create); + baseLineDataCounts = new ExNativeArray(capacity, create); + baseLineData = new ExNativeArray(capacity, create); + + localPositions = new ExNativeArray(capacity, create); + localNormals = new ExNativeArray(capacity, create); + localTangents = new ExNativeArray(capacity, create); + boneWeights = new ExNativeArray(capacity, create); + skinBoneTransformIndices = new ExNativeArray(capacity, create); + skinBoneBindPoses = new ExNativeArray(capacity, create); + + vertexToTransformRotations = new ExNativeArray(capacity, create); + + mappingIdArray = new ExNativeArray(capacity, create); + mappingReferenceIndices = new ExNativeArray(capacity, create); + mappingAttributes = new ExNativeArray(capacity, create); + mappingLocalPositins = new ExNativeArray(capacity, create); + mappingLocalNormals = new ExNativeArray(capacity, create); + mappingLocalTangents = new ExNativeArray(capacity, create); + mappingBoneWeights = new ExNativeArray(capacity, create); +#if MC2_DEBUG + mappingPositions = new ExNativeArray(capacity, create); + //mappingNormals = new ExNativeArray(capacity, create); + //mappingTangents = new ExNativeArray(capacity, create); +#endif + + isValid = true; + } + + public bool IsValid() + { + return isValid; + } + + //========================================================================================= + /// + /// ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒ‚’ƒžƒƒĵ‚¸ƒ£Ğç™ğ録™‚‹ + /// + public void RegisterProxyMesh(int teamId, VirtualMeshContainer proxyMeshContainer) + { + if (isValid == false) + return; + + ref var tdata = ref MagicaManager.Team.GetTeamDataRef(teamId); + var proxyMesh = proxyMeshContainer.shareVirtualMesh; + + // mesh type + tdata.proxyMeshType = proxyMesh.meshType; + + // Transform + tdata.proxyTransformChunk = MagicaManager.Bone.AddTransform(proxyMeshContainer, teamId); + + // center transform + tdata.centerTransformIndex = proxyMesh.centerTransformIndex + tdata.proxyTransformChunk.startIndex; + + // 作ĉ­ç”¨ƒƒƒƒ•‚Ħ + // ċ…ħ通 + int vcnt = proxyMesh.VertexCount; + tdata.proxyCommonChunk = teamIds.AddRange(vcnt, (short)teamId); + attributes.AddRange(proxyMesh.attributes); + vertexToTriangles.AddRange(proxyMesh.vertexToTriangles); + //vertexToVertexIndexArray.AddRange(proxyMesh.vertexToVertexIndexArray); + vertexBindPosePositions.AddRange(proxyMesh.vertexBindPosePositions); + vertexBindPoseRotations.AddRange(proxyMesh.vertexBindPoseRotations); + vertexDepths.AddRange(proxyMesh.vertexDepths); + vertexRootIndices.AddRange(proxyMesh.vertexRootIndices); + vertexLocalPositions.AddRange(proxyMesh.vertexLocalPositions); + vertexLocalRotations.AddRange(proxyMesh.vertexLocalRotations); + vertexParentIndices.AddRange(proxyMesh.vertexParentIndices); + vertexChildIndexArray.AddRange(proxyMesh.vertexChildIndexArray); + normalAdjustmentRotations.AddRange(proxyMesh.normalAdjustmentRotations); + //vertexAngleCalcLocalRotations.AddRange(proxyMesh.vertexAngleCalcLocalRotations); + uv.AddRange(proxyMesh.uv); + positions.AddRange(vcnt); + rotations.AddRange(vcnt); + + // 頂ç‚ıĉŽçĥšƒ‡ƒĵ‚ż + //tdata.proxyVertexToVertexDataChunk = vertexToVertexDataArray.AddRange(proxyMesh.vertexToVertexDataArray); + + // ċ­é ‚ç‚ıƒ‡ƒĵ‚ż + tdata.proxyVertexChildDataChunk = vertexChildDataArray.AddRange(proxyMesh.vertexChildDataArray); + + // ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ + if (proxyMesh.TriangleCount > 0) + { + tdata.proxyTriangleChunk = triangleTeamIdArray.AddRange(proxyMesh.TriangleCount, (short)teamId); + triangles.AddRange(proxyMesh.triangles); + triangleNormals.AddRange(proxyMesh.TriangleCount); + triangleTangents.AddRange(proxyMesh.TriangleCount); + } + + // ‚¨ƒƒ‚¸ïĵˆ‚¨ƒƒ‚¸Żċˆİ用ĉ™‚żïĵ‰ + if (proxyMesh.EdgeCount > 0) + { + tdata.proxyEdgeChunk = edgeTeamIdArray.AddRange(proxyMesh.EdgeCount, (short)teamId); + edges.AddRange(proxyMesh.edges); + edgeFlags.AddRange(proxyMesh.edgeFlags); + } + + // ƒ™ƒĵ‚ıƒİ‚¤ƒ³ + if (proxyMesh.BaseLineCount > 0) + { + tdata.baseLineChunk = baseLineFlags.AddRange(proxyMesh.baseLineFlags); + baseLineStartDataIndices.AddRange(proxyMesh.baseLineStartDataIndices); + baseLineDataCounts.AddRange(proxyMesh.baseLineDataCounts); + baseLineTeamIds.AddRange(proxyMesh.BaseLineCount, (short)teamId); + + tdata.baseLineDataChunk = baseLineData.AddRange(proxyMesh.baseLineData); + } + + // ƒĦƒƒ‚·ƒċŸşĉœĴ + tdata.proxyMeshChunk = localPositions.AddRange(proxyMesh.localPositions); + localNormals.AddRange(proxyMesh.localNormals); + localTangents.AddRange(proxyMesh.localTangents); + boneWeights.AddRange(proxyMesh.boneWeights); + + // ‚ı‚­ƒ‹ƒ³‚° + tdata.proxySkinBoneChunk = skinBoneTransformIndices.AddRange(proxyMesh.skinBoneTransformIndices); + skinBoneBindPoses.AddRange(proxyMesh.skinBoneBindPoses); + + // BoneClothż + if (proxyMesh.meshType == VirtualMesh.MeshType.ProxyBoneMesh) + { + tdata.proxyBoneChunk = vertexToTransformRotations.AddRange(proxyMesh.vertexToTransformRotations); + } + + // Lineƒ‡ƒĵ‚żĉœ‰ç„Ħ‚’記録 + tdata.flag.SetBits(TeamManager.Flag_ProxyMeshLine, proxyMesh.LineCount > 0); + //Develop.DebugLog($"Proxy[{proxyMesh.name}] Line:{proxyMesh.LineCount > 0}"); + + // 頂ç‚ı間ĉœ€ċ¤§è·é›˘ + //tdata.maxVertexDistance = proxyMesh.maxVertexDistance.Value; + //Debug.Log($"maxVertexDistance:{proxyMesh.maxVertexDistance.Value}"); + //Debug.Log($"averageVertexDistance:{proxyMesh.averageVertexDistance.Value}"); + } + + /// + /// ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒ‚’ƒžƒƒĵ‚¸ƒ£‹‚‰è§£é™¤™‚‹ + /// + public void ExitProxyMesh(int teamId) + { + if (isValid == false) + return; + + ref var tdata = ref MagicaManager.Team.GetTeamDataRef(teamId); + + // Transform + MagicaManager.Bone.RemoveTransform(tdata.proxyTransformChunk); + tdata.proxyTransformChunk.Clear(); + + // 作ĉ­ç”¨ƒƒƒƒ•‚Ħ + teamIds.RemoveAndFill(tdata.proxyCommonChunk); // 0§ċŸ‹‚‚‹ + attributes.RemoveAndFill(tdata.proxyCommonChunk); // 0§ċŸ‹‚‚‹ + vertexToTriangles.Remove(tdata.proxyCommonChunk); + //vertexToVertexIndexArray.Remove(tdata.proxyCommonChunk); + vertexBindPosePositions.Remove(tdata.proxyCommonChunk); + vertexBindPoseRotations.Remove(tdata.proxyCommonChunk); + vertexDepths.Remove(tdata.proxyCommonChunk); + vertexRootIndices.Remove(tdata.proxyCommonChunk); + vertexLocalPositions.Remove(tdata.proxyCommonChunk); + vertexLocalRotations.Remove(tdata.proxyCommonChunk); + vertexParentIndices.Remove(tdata.proxyCommonChunk); + vertexChildIndexArray.Remove(tdata.proxyCommonChunk); + normalAdjustmentRotations.Remove(tdata.proxyCommonChunk); + //vertexAngleCalcLocalRotations.Remove(tdata.proxyCommonChunk); + uv.Remove(tdata.proxyCommonChunk); + positions.Remove(tdata.proxyCommonChunk); + rotations.Remove(tdata.proxyCommonChunk); + tdata.proxyCommonChunk.Clear(); + + //vertexToVertexDataArray.Remove(tdata.proxyVertexToVertexDataChunk); + //tdata.proxyVertexToVertexDataChunk.Clear(); + + vertexChildDataArray.Remove(tdata.proxyVertexChildDataChunk); + tdata.proxyVertexChildDataChunk.Clear(); + + triangleTeamIdArray.RemoveAndFill(tdata.proxyTriangleChunk, 0); // 0§ċŸ‹‚‚‹ + triangles.Remove(tdata.proxyTriangleChunk); + triangleNormals.Remove(tdata.proxyTriangleChunk); + triangleTangents.Remove(tdata.proxyTriangleChunk); + tdata.proxyTriangleChunk.Clear(); + + edgeTeamIdArray.RemoveAndFill(tdata.proxyEdgeChunk, 0); // 0§ċŸ‹‚‚‹ + edges.Remove(tdata.proxyEdgeChunk); + edgeFlags.Remove(tdata.proxyEdgeChunk); + + baseLineFlags.RemoveAndFill(tdata.baseLineChunk); // 0§ċŸ‹‚‚‹ + baseLineTeamIds.Remove(tdata.baseLineChunk); + baseLineStartDataIndices.Remove(tdata.baseLineChunk); + baseLineDataCounts.Remove(tdata.baseLineChunk); + tdata.baseLineChunk.Clear(); + + baseLineData.Remove(tdata.baseLineDataChunk); + tdata.baseLineDataChunk.Clear(); + + localPositions.Remove(tdata.proxyMeshChunk); + localNormals.Remove(tdata.proxyMeshChunk); + localTangents.Remove(tdata.proxyMeshChunk); + boneWeights.Remove(tdata.proxyMeshChunk); + tdata.proxyMeshChunk.Clear(); + + skinBoneTransformIndices.Remove(tdata.proxySkinBoneChunk); + skinBoneBindPoses.Remove(tdata.proxySkinBoneChunk); + tdata.proxySkinBoneChunk.Clear(); + + vertexToTransformRotations.Remove(tdata.proxyBoneChunk); + tdata.proxyBoneChunk.Clear(); + + // ċŒĉ™‚Ğ連ċ‹•™‚‹ƒžƒƒƒ”ƒ³‚°ƒĦƒƒ‚·ƒ‚‚è§£ĉ”™‚‹ + var mappingList = MagicaManager.Team.teamMappingIndexArray[teamId]; + int mcnt = mappingList.Length; + for (int i = 0; i < mcnt; i++) + { + int mappingIndex = mappingList[i]; + ExitMappingMesh(teamId, mappingIndex); + } + } + + //========================================================================================= + /// + /// ƒžƒƒƒ”ƒ³‚°ƒĦƒƒ‚·ƒ‚’ƒžƒƒĵ‚¸ƒ£Ğç™ğ録™‚‹ïĵˆƒƒĵƒ Ğ‚‚ç™ğ録•‚Œ‚‹ïĵ‰ + /// + /// + /// + /// + public DataChunk RegisterMappingMesh( + int teamId, + VirtualMeshContainer mappingMeshContainer, + int renderDataWorkIndex + ) + { + if (isValid == false) + return DataChunk.Empty; + + ref var tdata = ref MagicaManager.Team.GetTeamDataRef(teamId); + ref var mappingList = ref MagicaManager.Team.GetTeamMappingRef(teamId); + + var mdata = new TeamManager.MappingData(); + mdata.teamId = teamId; + + var mappingMesh = mappingMeshContainer.shareVirtualMesh; + + // transform + var ct = mappingMeshContainer.GetCenterTransform(); + var c = MagicaManager.Bone.AddTransform(ct, new ExBitFlag8(TransformManager.Flag_Read | TransformManager.Flag_Enable), teamId); + mdata.centerTransformIndex = c.startIndex; + + // ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒ¸ċ¤‰ĉ› + mdata.toProxyMatrix = mappingMesh.toProxyMatrix; + mdata.toProxyRotation = mappingMesh.toProxyRotation; + + // ç™ğ録‚¤ƒ³ƒ‡ƒƒ‚Ż‚ıŒċż…èĤŞ§ċ…ˆĞç™ğ録™‚‹ + c = MagicaManager.Team.mappingDataArray.Add(mdata); + int mappingIndex = c.startIndex; + + // ċŸşĉœĴƒ‡ƒĵ‚ż + int vcnt = mappingMesh.VertexCount; + mdata.mappingCommonChunk = mappingIdArray.AddRange(vcnt, (short)(mappingIndex + 1)); // (+1)•‚Œ‚‹§ĉ³¨ĉ„ïĵ + + mappingReferenceIndices.AddRange(mappingMesh.referenceIndices); + mappingAttributes.AddRange(mappingMesh.attributes); + mappingLocalPositins.AddRange(mappingMesh.localPositions); + mappingLocalNormals.AddRange(mappingMesh.localNormals); + mappingLocalTangents.AddRange(mappingMesh.localTangents); + mappingBoneWeights.AddRange(mappingMesh.boneWeights); +#if MC2_DEBUG + mappingPositions.AddRange(vcnt); + //mappingNormals.AddRange(vcnt); + //mappingTangents.AddRange(vcnt); +#endif + + // RenderMeshWorkƒ‡ƒĵ‚ż¨ç´‘ + mdata.renderDataWorkIndex = renderDataWorkIndex; + ref var wdata = ref MagicaManager.Render.GetRenderDataWorkRef(renderDataWorkIndex); + wdata.AddMappingIndex(mappingIndex); + + // ċ†ç™ğ録 + MagicaManager.Team.mappingDataArray[mappingIndex] = mdata; + mappingList.MC2Set((short)mappingIndex); + + // vmeshĞ‚‚記録™‚‹ + mappingMesh.mappingId = mappingIndex; + + Develop.DebugLog($"RegisterMappingMesh. team:{teamId}, mappingIndex:{mappingIndex}"); + + // ƒžƒƒƒ”ƒ³‚°ƒĦƒƒ‚·ƒç™ğ録ƒƒ£ƒ³‚Ż‚’èż”™ + return mdata.mappingCommonChunk; + } + + public void ExitMappingMesh(int teamId, int mappingIndex) + { + if (isValid == false) + return; + + ref var tdata = ref MagicaManager.Team.GetTeamDataRef(teamId); + ref var mdata = ref MagicaManager.Team.mappingDataArray.GetRef(mappingIndex); + ref var mappingList = ref MagicaManager.Team.GetTeamMappingRef(teamId); + + // Transformè§£ĉ” + MagicaManager.Bone.RemoveTransform(new DataChunk(mdata.centerTransformIndex, 1)); + + // 作ĉ­ƒƒƒƒ•‚Ħè§£ĉ” + mappingIdArray.RemoveAndFill(mdata.mappingCommonChunk, 0); + mappingReferenceIndices.Remove(mdata.mappingCommonChunk); + mappingAttributes.Remove(mdata.mappingCommonChunk); + mappingLocalPositins.Remove(mdata.mappingCommonChunk); + mappingLocalNormals.Remove(mdata.mappingCommonChunk); + mappingLocalTangents.Remove(mdata.mappingCommonChunk); + mappingBoneWeights.Remove(mdata.mappingCommonChunk); +#if MC2_DEBUG + mappingPositions.Remove(mdata.mappingCommonChunk); + //mappingNormals.Remove(mdata.mappingCommonChunk); + //mappingTangents.Remove(mdata.mappingCommonChunk); +#endif + + // RenderMeshWorkƒ‡ƒĵ‚ż¨ç´‘解除 + ref var wdata = ref MagicaManager.Render.GetRenderDataWorkRef(mdata.renderDataWorkIndex); + wdata.RemoveMappingIndex(mappingIndex); + + // ƒƒĵƒ ‹‚‰ċ‰Šé™¤™‚‹ + mappingList.MC2RemoveItemAtSwapBack((short)mappingIndex); + + MagicaManager.Team.mappingDataArray.RemoveAndFill(new DataChunk(mappingIndex, 1)); + + Develop.DebugLog($"ExitMappingMesh. team:{teamId}, mappingIndex:{mappingIndex}"); + } + + //========================================================================================= + // Simulation + //========================================================================================= + /// + /// ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒé ‚ç‚ı‚ı‚­ƒ‹ƒ³‚°‚’èĦŒ„ċş§ĉ¨™ƒğĉ³•ç·šƒğĉŽç·š‚’ĉħ‚‚‚‹ + /// [BoneCloth][MeshCloth]ċ…ĵ用 + /// ċ§żċ‹˘ŻƒŻƒĵƒĞƒ‰ċş§ĉ¨™§ĉ ĵ納•‚Œ‚‹ + /// + internal static void SimulationPreProxyMeshUpdate( + DataChunk chunk, + // team + int teamId, + ref TeamManager.TeamData tdata, + + // vmesh + in NativeArray attributes, + in NativeArray localPositions, + in NativeArray localNormals, + in NativeArray localTangents, + in NativeArray boneWeights, + in NativeArray skinBoneTransformIndices, + in NativeArray skinBoneBindPoses, + ref NativeArray positions, + ref NativeArray rotations, + + // transform + in NativeArray transformLocalToWorldMatrixArray + ) + { + var pc = tdata.proxyCommonChunk; + if (pc.dataLength == 0) + return; + + // ProxyMesh‚’‚ı‚­ƒ‹ƒ³‚°—Ĥ頂ç‚ıċ§żċ‹˘‚’ĉħ‚‚‚‹ + //int vindex = pc.startIndex; + int vindex = pc.startIndex + chunk.startIndex; + //int mvindex = tdata.proxyMeshChunk.startIndex; + int mvindex = tdata.proxyMeshChunk.startIndex + chunk.startIndex; + int sb_start = tdata.proxySkinBoneChunk.startIndex; + int t_start = tdata.proxyTransformChunk.startIndex; + float4x3 wpose = 0; + float4x3 _pose = 0; + float4x3 _lpose = 0; + //for (int k = 0; k < pc.dataLength; k++, vindex++, mvindex++) + for (int k = 0; k < chunk.dataLength; k++, vindex++, mvindex++) + { + var bw = boneWeights[mvindex]; + int wcnt = bw.Count; + + wpose = 0; + _pose = 0; + + _lpose.c0 = new float4(localPositions[mvindex], 1); + _lpose.c1 = new float4(localNormals[mvindex], 0); + _lpose.c2 = new float4(localTangents[mvindex], 0); + + for (int i = 0; i < wcnt; i++) + { + float w = bw.weights[i]; + + _pose = _lpose; + //Debug.Log($"[{mvindex}] lpos:{lpos}, lnor:{lnor}, ltan:{ltan}"); + + // ƒœƒĵƒ³ƒ­ƒĵ‚ЃĞçİşé–“Ğċ¤‰ĉ› + int l_boneIndex = bw.boneIndices[i]; + float4x4 bp = skinBoneBindPoses[sb_start + l_boneIndex]; + _pose = math.mul(bp, _pose); + + // çċœ¨ƒŻƒĵƒĞƒ‰çİşé–“Ğċ¤‰ĉ› + int tindex = skinBoneTransformIndices[sb_start + l_boneIndex] + t_start; + var lw = transformLocalToWorldMatrixArray[tindex]; + _pose = math.mul(lw, _pose); + + // ‚Ĥ‚¨‚¤ƒˆ + wpose += _pose * w; + } + + float3 wpos = wpose.c0.xyz; + float3 wnor = wpose.c1.xyz; + float3 wtan = wpose.c2.xyz; + + // ƒ‚¤ƒ³ƒ‰ƒƒĵ‚şĞ‚ı‚ħƒĵƒĞŒċ…‚‹§ċ˜ä½ċŒ–™‚‹ċż…èĤŒ‚‚‹ +#if MC2_DEBUG + Develop.Assert(math.length(wnor) > 0.0f); + Develop.Assert(math.length(wtan) > 0.0f); +#endif + wnor = math.normalize(wnor); + wtan = math.normalize(wtan); + var wrot = MathUtility.ToRotation(wnor, wtan); + + positions[vindex] = wpos; + rotations[vindex] = wrot; + + //Debug.Log($"[{teamId}] pv:{vindex}, wpos:{wpos}"); + } + } + + /// + /// ‚Żƒ­‚ı‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³çµĉžœ‚’ProxyMesh¸ċĉ˜ •›‚‹ + /// ƒİ‚¤ƒ³Œ‚‚‹ċ ´ċˆŻƒ™ƒĵ‚ıƒİ‚¤ƒ³”¨Ğċ§żċ‹˘‚’ĉ•´ˆ‚‹ + /// + internal static void SimulationPostProxyMeshUpdateLine( + DataChunk chunk, + // team + ref TeamManager.TeamData tdata, + ref ClothParameters param, + // vmesh + ref NativeArray attributes, + ref NativeArray positions, + ref NativeArray rotations, + ref NativeArray vertexLocalPositions, + ref NativeArray vertexLocalRotations, + ref NativeArray vertexChildIndexArray, + ref NativeArray vertexChildDataArray, + ref NativeArray baseLineFlags, + ref NativeArray baseLineStartIndices, + ref NativeArray baseLineDataCounts, + ref NativeArray baseLineData, + // temp + ref NativeArray tempVectorBufferA, + ref NativeArray tempRotationBufferA + ) + { + // ƒİ‚¤ƒ³Œ‚‚‹ċ ´ċˆŻƒ™ƒĵ‚ıƒİ‚¤ƒ³”¨Ğċ§żċ‹˘‚’ĉ•´ˆ‚‹ + // Ÿ —LineŒċ­˜ċœ¨—Ş„ƒĦƒƒ‚·ƒŻ‚ı‚­ƒƒƒ—™‚‹€‚ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞƒ™ƒĵ‚ıċ›žèğ˘ċˆĥċĦĞ™ıĤ上ĉ›¸•‚Œ‚‹Ÿ‚€‚ + if (tdata.baseLineChunk.IsValid && tdata.flag.IsSet(TeamManager.Flag_ProxyMeshLine)) + { + // parameter + float averageRate = param.rotationalInterpolation; // ċ›žèğ˘ċı³ċ‡ċŒ–ċ‰²ċˆ + float rootInterpolation = param.rootRotation; + float animeRatio = tdata.animationPoseRatio; + float blendWeight = tdata.blendWeight; + + int s_vindex = tdata.proxyCommonChunk.startIndex; + int s_pindex = tdata.particleChunk.startIndex; + int s_dataIndex = tdata.baseLineDataChunk.startIndex; + int s_childDataIndex = tdata.proxyVertexChildDataChunk.startIndex; + + int bindex = tdata.baseLineChunk.startIndex + chunk.startIndex; + for (int k = 0; k < chunk.dataLength; k++, bindex++) + { + // ƒİ‚¤ƒ³‚’ċĞ‚€ċ ´ċˆżċŸèĦŒ™‚‹ + var bflag = baseLineFlags[bindex]; + if (bflag.IsSet(VirtualMesh.BaseLineFlag_IncludeLine) == false) + continue; + + // ƒ™ƒĵ‚ıƒİ‚¤ƒ³‚’ƒĞƒĵƒˆ‹‚‰èµ°ĉŸğ™‚‹ + int dataIndex = baseLineStartIndices[bindex] + s_dataIndex; + int dataCnt = baseLineDataCounts[bindex]; + for (int i = 0; i < dataCnt; i++, dataIndex++) + { + // è‡ŞèşĞ‚’èĤށ¨™‚‹ + int lindex = baseLineData[dataIndex]; + int vindex = lindex + s_vindex; + int pindex = lindex + s_pindex; + var pos = positions[vindex]; + var rot = rotations[vindex]; + var attr = attributes[vindex]; + + //Debug.Log($"p:[{vindex}] rot:[{rot}] wn:{MathUtility.ToNormal(rot)}, wt:{MathUtility.ToTangent(rot)}"); + + // ċ­ĉƒ…ċ ħ + var pack = vertexChildIndexArray[vindex]; + int cstart = DataUtility.Unpack12_20Low(pack); + int ccnt = DataUtility.Unpack12_20Hi(pack); + + // ★Ver2.17.0‚ˆ‚Šċ¤‰ĉ›´€‚äğ下ċ•éĦŒ‚’äżĉ­£ + // BoneClothċˆĥċĦTransformŒ‚˘ƒ‹ƒĦƒĵ‚·ƒ§ƒ³Ğ‚ˆ‚Šċ§żċ‹˘ċˆĥċĦ•‚ŒĤ„‚‹ċ ´ċˆĞĉœ€çµ‚ċ›žèğ˘Œċ…¨ä½“çš„ĞŠ‹—Ş‚‹ + // “‚ŒŻċ›žèğ˘è¨ˆç—ċ…ƒ‚’‚˘ƒ‹ƒĦƒĵ‚·ƒ§ƒ³ċ§żċ‹˘§ŻŞċˆĉœŸċ§żċ‹˘Ğċ›şċš—Ĥ„‚‹Ÿ‚ + // Ÿ‚BlendWeight=0Ğ—Ĥ‚‚‚ރނ¸ƒŠƒĞċ§żċ‹˘Ğĉˆğ‚‰ŞŞ‚‹ + // Ÿƒ™‚ŻƒˆƒĞ‚ĵƒ­è·é›˘ċˆ¤ċš‚’ċĵ·ċŒ– + + // çċœ¨ƒ™ƒĵ‚ıċ§żċ‹˘ + var basePos = tempVectorBufferA[pindex]; + var baseRot = tempRotationBufferA[pindex]; + var baseInvRot = math.inverse(baseRot); + + if (ccnt > 0 && attr.IsInvalid() == false) + { + // ċ­¸ċı³ċ‡ƒ™‚ŻƒˆƒĞ + float3 ctv = 0; + float3 cv = 0; + + // è‡ŞèşĞ‚’ċŸşĉş–Ğċ­ċ›žèğ˘‚’ĉħ‚‚‚‹€Ÿċ­¸ċı³ċ‡ƒ™‚ŻƒˆƒĞ‚’ċŠ ç—™‚‹ + for (int j = 0; j < ccnt; j++) + { + int clindex = vertexChildDataArray[s_childDataIndex + cstart + j]; + int cvindex = clindex + s_vindex; + int cpindex = clindex + s_pindex; + + // ċ­ċħžĉ€§ + var cattr = attributes[cvindex]; + + // “‚ĵƒ­è·é›˘çŠĥĉ…‹ + bool isC0 = cattr.IsSet(VertexAttribute.Flag_ZeroDistance); + + // ċ­ċş§ĉ¨™ + var cpos = positions[cvindex]; + + // ċ­çċœ¨ƒ™ƒĵ‚ıċ§żċ‹˘¨ƒ­ƒĵ‚ЃĞċ§żċ‹˘ + var cbasePos = tempVectorBufferA[cpindex]; + var cbaseRot = tempRotationBufferA[cpindex]; + float3 cbaseLocalPos = math.mul(baseInvRot, cbasePos - basePos); + quaternion cbaseLocalRot = math.mul(baseInvRot, cbaseRot); + + // 計ç—ċŸşĉş–ƒ­ƒĵ‚ЃĞ位罁¨ƒ­ƒĵ‚ЃĞċ›žèğ˘ + // AnimationPoseRatioĞ‚ˆ‚Šè£œé–“ + float3 lpos = math.lerp(vertexLocalPositions[cvindex] * tdata.negativeScaleDirection, cbaseLocalPos, animeRatio); + quaternion lrot = math.slerp(vertexLocalRotations[cvindex].value * tdata.negativeScaleQuaternionValue, cbaseLocalRot, animeRatio); + + // ċ­ĉœĴĉƒ™‚ŻƒˆƒĞ + float3 tv = isC0 ? 0.0f : math.mul(rot, lpos); + + ctv += tv; + + // ċ­çċœ¨ƒ™‚ŻƒˆƒĞ + if (cattr.IsMove()) + { + float3 v = cpos - pos; + cv += v; + + bool isV0 = MathUtility.IsZeroDistance(v); + + // ċ­ċ›žèğ˘‚’ĉħşċš + // “ĉ™‚ç‚ı§ċ­ŻèĤށĉ–ıċ‘(1.0)ċ›žèğ˘¨Ş‚‹ + var crot = math.mul(rot, lrot); + + // çċœ¨ƒ™‚ŻƒˆƒĞċ¤‰ä½Ğ‚ˆ‚‹è£œĉ­£ + if(isC0 == false) + { + var q = MathUtility.FromToRotation(tv, v); + crot = math.mul(q, crot); + } + + rotations[cvindex] = crot; + } + else + { + cv += tv; + } + } + + // ċ­ĉ–ıċ‘¸ċ›žèğ˘èŞżĉ•´ + float t = attr.IsMove() ? averageRate : rootInterpolation; + bool isCtv0 = MathUtility.IsZeroDistance(ctv); + bool isCv0 = MathUtility.IsZeroDistance(cv); + var cq = (isCtv0 || isCv0) ? quaternion.identity : MathUtility.FromToRotation(ctv, cv, t); + rot = math.mul(cq, rot); + } + + // ƒ–ƒĴƒ³ƒ‰‚Ĥ‚¨‚¤ƒˆéİ用 + rot = math.slerp(baseRot, rot, blendWeight); + + // è‡ŞèşĞċ§żċ‹˘‚’確ċš•›‚‹ + rotations[vindex] = rot; + } + } + } + } + + /// + /// ‚Żƒ­‚ı‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³çµĉžœ‚’ProxyMesh¸ċĉ˜ •›‚‹ + /// ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĉ³•ç·š¨ĉŽç·š‚’ĉħ‚‚‚‹ + /// + internal static void SimulationPostProxyMeshUpdateTriangle( + DataChunk chunk, + // team + ref TeamManager.TeamData tdata, + // vmesh + ref NativeArray positions, + ref NativeArray triangles, + ref NativeArray triangleNormals, + ref NativeArray triangleTangents, + ref NativeArray uvs + ) + { + + // ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞŒ‚‚‹ċ ´ċˆŻƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĉŽçĥšĉƒ…ċ ħ‹‚‰ĉœ€çµ‚çš„Şċ§żċ‹˘‚’ĉħ‚‚‚‹ + if (tdata.TriangleCount > 0) + { + // ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĉ³•ç·š¨ĉŽç·š‚’ĉħ‚‚‚‹ + // ċş§ĉ¨™ç³ğċ¤‰ĉ›ŻèĦŒ‚Ş„ + //int tindex = tdata.proxyTriangleChunk.startIndex; + int tindex = tdata.proxyTriangleChunk.startIndex + chunk.startIndex; + //for (int k = 0; k < tdata.proxyTriangleChunk.dataLength; k++, tindex++) + for (int k = 0; k < chunk.dataLength; k++, tindex++) + { + int3 tri = triangles[tindex]; + + // ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĉ³•ç·š‚’ĉħ‚‚‚‹ + int start = tdata.proxyCommonChunk.startIndex; + var pos1 = positions[start + tri.x]; + var pos2 = positions[start + tri.y]; + var pos3 = positions[start + tri.z]; + float3 cross = math.cross(pos2 - pos1, pos3 - pos1); + float len = math.length(cross); + if (len > Define.System.Epsilon) + { + float3 nor = cross / len; + + // ƒž‚¤ƒŠ‚ı‚ı‚ħƒĵƒĞ + nor *= tdata.negativeScaleTriangleSign.x; + + triangleNormals[tindex] = nor; + } +#if MC2_DEBUG + else + Debug.LogWarning("CalcTriangleNormalTangentJob.normal = 0!"); +#endif + + // ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĉŽç·š‚’ĉħ‚‚‚‹ + var uv1 = uvs[start + tri.x]; + var uv2 = uvs[start + tri.y]; + var uv3 = uvs[start + tri.z]; + var tan = MathUtility.TriangleTangent(pos1, pos2, pos3, uv1, uv2, uv3); + if (math.lengthsq(tan) > 0.0f) + { + // ƒž‚¤ƒŠ‚ı‚ı‚ħƒĵƒĞ + tan *= tdata.negativeScaleTriangleSign.y; + + triangleTangents[tindex] = tan; + } +#if MC2_DEBUG + else + Debug.LogWarning("CalcTriangleNormalTangentJob.tangent = 0!"); +#endif + } + } + } + + /// + /// ‚Żƒ­‚ı‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³çµĉžœ‚’ProxyMesh¸ċĉ˜ •›‚‹ + /// ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĉ³•ç·šĉŽç·š‹‚‰é ‚ç‚ıĉ³•ç·šĉŽç·š‚’ċı³ċ‡ċŒ–—Ĥĉħ‚‚‚‹ + /// + internal static void SimulationPostProxyMeshUpdateTriangleSum( + DataChunk chunk, + // team + ref TeamManager.TeamData tdata, + // vmesh + ref NativeArray rotations, + ref NativeArray triangleNormals, + ref NativeArray triangleTangents, + ref NativeArray> vertexToTriangles, + ref NativeArray normalAdjustmentRotations + ) + { + // ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞŒ‚‚‹ċ ´ċˆŻƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĉŽçĥšĉƒ…ċ ħ‹‚‰ĉœ€çµ‚çš„Şċ§żċ‹˘‚’ĉħ‚‚‚‹ + if (tdata.TriangleCount > 0) + { + // ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĉ³•ç·šĉŽç·š‹‚‰é ‚ç‚ıĉ³•ç·šĉŽç·š‚’ċı³ċ‡ċŒ–—Ĥĉħ‚‚‚‹ + // ïĵˆƒŻƒĵƒĞƒ‰ċş§ĉ¨™çİşé–“ïĵ‰ + //int vindex = tdata.proxyCommonChunk.startIndex; + int vindex = tdata.proxyCommonChunk.startIndex + chunk.startIndex; + //for (int k = 0; k < tdata.proxyCommonChunk.dataLength; k++, vindex++) + for (int k = 0; k < chunk.dataLength; k++, vindex++) + { + var tlist = vertexToTriangles[vindex]; + if (tlist.Length > 0) + { + float3 nor = 0; + float3 tan = 0; + for (int i = 0; i < tlist.Length; i++) + { + // 12-20bitƒ‘ƒƒ‚݁§ĉ ĵ納•‚ŒĤ„‚‹ + // 12(hi) = ĉ³•ç·š¨ĉŽç·šƒ•ƒŞƒƒƒ—ƒ•ƒİ‚° + // 20(low) = ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı + uint data = tlist[i]; + int flipFlag = DataUtility.Unpack12_20Hi(data); + int tindex = DataUtility.Unpack12_20Low(data); + + tindex += tdata.proxyTriangleChunk.startIndex; + nor += triangleNormals[tindex] * ((flipFlag & 0x1) == 0 ? 1 : -1); + tan += triangleTangents[tindex] * ((flipFlag & 0x2) == 0 ? 1 : -1); + } + //Debug.Log($"Vertex:{vindex} nor:{nor}, tan:{tan}"); + + // ĉ³•ç·šïĵ‚’考ĉ…™‚‹€‚ĉ³•ç·š‚’ïĵĞ™‚‹¨ƒƒŞ‚´ƒ³ŒĉĴ ‘‚‹Ÿ‚ + float ln = math.length(nor); + float lt = math.length(tan); + if (ln > 1e-06f && lt > 1e-06f) + { + nor = nor / ln; + tan = tan / lt; + + float dot = math.dot(nor, tan); + if (dot != 1.0f && dot != -1.0f) + { + // ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞċ›žèğ˘Żċ“ĉ³•ç·š‹‚‰ç—ċ‡ş™‚‹‚ˆ†Ğċ¤‰ĉ›´(v2.1.7) + float3 binor = math.normalize(math.cross(nor, tan)); + var rot = quaternion.LookRotation(binor, nor); + + // ĉ³•ç·šèŞżĉ•´ç”¨ċ›žèğ˘‚’äı—痁™‚‹ïĵˆä¸èĤŞċ ´ċˆŻċ˜ä½ċ›žèğ˘Œċ…£Ĥ„‚‹ïĵ‰ + // ƒž‚¤ƒŠ‚ı‚ı‚ħƒĵƒĞ + rot = math.mul(rot, normalAdjustmentRotations[vindex].value * tdata.negativeScaleQuaternionValue); + //rot = math.mul(rot, normalAdjustmentRotations[vindex]); // ‚ރނ¸ƒŠƒĞ + + rotations[vindex] = rot; + } + } + } + } + } + } + + /// + /// ‚Żƒ­‚ı‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³çµĉžœ‚’ProxyMesh¸ċĉ˜ •›‚‹ + /// BoneClothċ ´ċˆŻé ‚ç‚ıċ§żċ‹˘‹‚‰é€£ċ‹•™‚‹ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ƒŻƒĵƒĞƒ‰ċ§żċ‹˘‚’計痁™‚‹ + /// + internal static void SimulationPostProxyMeshUpdateWorldTransform( + DataChunk chunk, + // team + ref TeamManager.TeamData tdata, + // vmesh + ref NativeArray positions, + ref NativeArray rotations, + ref NativeArray vertexToTransformRotations, + // transform + ref NativeArray transformPositionArray, + ref NativeArray transformRotationArray + ) + { + // Transformƒ‘ƒĵƒ†‚£‚ŻƒĞ + if (tdata.proxyMeshType == VirtualMesh.MeshType.ProxyBoneMesh) + { + // Transformƒ‘ƒĵƒ†‚£‚ŻƒĞċ ´ċˆŻvertexToTransformċ›žèğ˘‚’äı—痁—ĤTransformDataĞĉƒ…ċ ħ‚’ĉ›¸ĉˆğ™ + //int vindex = tdata.proxyCommonChunk.startIndex; + int vindex = tdata.proxyCommonChunk.startIndex + chunk.startIndex; + //for (int k = 0; k < tdata.proxyCommonChunk.dataLength; k++, vindex++) + for (int k = 0; k < chunk.dataLength; k++, vindex++) + { + // pos/rotŻƒŻƒĵƒĞƒ‰çİşé–“ + var pos = positions[vindex]; + var rot = rotations[vindex]; + + // ĉœĴĉTransformċ§żċ‹˘‚’ĉħ‚‚‚‹ċ›žèğ˘‚’ĉŽ›‘‚‹ + //int boneIndex = tdata.proxyBoneChunk.startIndex + k; + int boneIndex = tdata.proxyBoneChunk.startIndex + chunk.startIndex + k; + quaternion v2t = vertexToTransformRotations[boneIndex]; + + // ƒž‚¤ƒŠ‚ı‚ı‚ħƒĵƒĞ + rot = math.mul(rot, v2t.value * tdata.negativeScaleQuaternionValue); + //rot = math.mul(rot, v2t); // ‚ރނ¸ƒŠƒĞ + + // ƒŻƒĵƒĞƒ‰ċ§żċ‹˘ + //int tindex = tdata.proxyTransformChunk.startIndex + k; + int tindex = tdata.proxyTransformChunk.startIndex + chunk.startIndex + k; + transformPositionArray[tindex] = pos; + transformRotationArray[tindex] = rot; + } + } + } + + /// + /// BoneClothċ ´ċˆŻTransformƒ­ƒĵ‚ЃĞċ§żċ‹˘‚’計痁™‚‹ + /// + internal static void SimulationPostProxyMeshUpdateLocalTransform( + // team + ref TeamManager.TeamData tdata, + // vmesh + ref NativeArray attributes, + ref NativeArray parentIndices, + // transform + ref NativeArray transformPositionArray, + ref NativeArray transformRotationArray, + ref NativeArray transformScaleArray, + ref NativeArray transformLocalPositionArray, + ref NativeArray transformLocalRotationArray + ) + { + // Transformƒ‘ƒĵƒ†‚£‚ŻƒĞ + if (tdata.proxyMeshType == VirtualMesh.MeshType.ProxyBoneMesh) + { + // Transformƒ‘ƒĵƒ†‚£‚ŻƒĞŻèĤށ‹‚‰ƒ­ƒĵ‚ЃĞċ§żċ‹˘‚’計痁—ĤTransformDataĉƒ…ċ ħĞĉ›¸èĵ‚€ + int vindex = tdata.proxyCommonChunk.startIndex; + //vindex = tdata.proxyCommonChunk.startIndex + chunk.startIndex; + for (int k = 0; k < tdata.proxyCommonChunk.dataLength; k++, vindex++) + //for (int k = 0; k < chunk.dataLength; k++, vindex++) + { + int parentIndex = parentIndices[vindex]; + if (parentIndex < 0) + continue; + + var attr = attributes[vindex]; + if (attr.IsMove() == false) + continue; + + // èĤށ‹‚‰ƒ­ƒĵ‚ЃĞċ§żċ‹˘‚’計痁—ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ĉƒ…ċ ħĞĉ›¸èĵ‚€ + int tindex = tdata.proxyTransformChunk.startIndex + k; + //int tindex = tdata.proxyTransformChunk.startIndex + chunk.startIndex + k; + int ptindex = tdata.proxyTransformChunk.startIndex + parentIndex; + var ppos = transformPositionArray[ptindex]; + var prot = transformRotationArray[ptindex]; + var pscl = transformScaleArray[ptindex]; + var pos = transformPositionArray[tindex]; + var rot = transformRotationArray[tindex]; + +#if true + var iprot = math.inverse(prot); + var v = pos - ppos; + var lpos = math.mul(iprot, v); + + //Develop.Assert(pscl.x > 0.0f && pscl.y > 0.0f && pscl.z > 0.0f); + lpos /= pscl; + var lrot = math.mul(iprot, rot); +#endif + + // ƒž‚¤ƒŠ‚ı‚ı‚ħƒĵƒĞ + lrot = lrot.value * tdata.negativeScaleQuaternionValue; + + transformLocalPositionArray[tindex] = lpos; + transformLocalRotationArray[tindex] = lrot; + } + } + } + + /// + /// ƒžƒƒƒ”ƒ³‚°ƒĦƒƒ‚·ƒé ‚ç‚ıċ§żċ‹˘‚’連ċ‹•™‚‹ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒ‹‚‰‚ı‚­ƒ‹ƒ³‚°—Ĥĉħ‚‚‚‹ + /// + internal JobHandle PostMappingMeshUpdateBatchSchedule(JobHandle jobHandle, int workerCount) + { + if (MagicaManager.Team.MappingCount == 0) + return jobHandle; + + var tm = MagicaManager.Team; + var bm = MagicaManager.Bone; + var rm = MagicaManager.Render; + + // ƒžƒƒƒ”ƒ³‚°ƒĦƒƒ‚·ƒċ¤‰ĉ›ƒžƒˆƒŞƒƒ‚Ż‚ı‚’ĉħ‚‚‚‹ + var calcMeshConvert_A_Job = new CalcMeshConvert_A_Job() + { + // team + teamDataArray = tm.teamDataArray.GetNativeArray(), + // transform + transformPositionArray = bm.positionArray.GetNativeArray(), + transformRotationArray = bm.rotationArray.GetNativeArray(), + transformScaleArray = bm.scaleArray.GetNativeArray(), + // mapping + mappingDataArray = tm.mappingDataArray.GetNativeArray(), + // render mesh + renderDataWorkArray = rm.renderDataWorkArray.GetNativeArray(), + }; + jobHandle = calcMeshConvert_A_Job.Schedule(tm.MappingCount, 1, jobHandle); + + // ƒžƒƒƒ”ƒ³‚°ƒĦƒƒ‚·ƒé ‚ç‚ıċ§żċ‹˘‚’ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒ‹‚‰é€†‚ı‚­ƒ‹ƒ³‚°—Ĥĉħ‚‚‚‹ + // ƒžƒƒƒ”ƒ³‚°ƒĦƒƒ‚·ƒé ‚ç‚ıċ§żċ‹˘‚’ĉ›¸èĵżç”¨ƒƒƒƒ•‚ĦĞĉ›¸èĵ‚€ + // ċż…èĤŒ‚‚Œ°ƒœƒĵƒ³‚Ĥ‚¨‚¤ƒˆ‚‚ĉ›¸èĵ‚€ + var calcMeshConvert_B_Job = new CalcMeshConvert_B_Job() + { + workerCount = workerCount, + // team + teamDataArray = tm.teamDataArray.GetNativeArray(), + // mapping + mappingDataArray = tm.mappingDataArray.GetNativeArray(), + //mappingIdArray = mappingIdArray.GetNativeArray(), + mappingAttributes = mappingAttributes.GetNativeArray(), + mappingLocalPositions = mappingLocalPositins.GetNativeArray(), + mappingLocalNormals = mappingLocalNormals.GetNativeArray(), + mappingLocalTangents = mappingLocalTangents.GetNativeArray(), + mappingBoneWeights = mappingBoneWeights.GetNativeArray(), +#if MC2_DEBUG + mappingPositions = mappingPositions.GetNativeArray(), + //mappingNormals = mappingNormals.GetNativeArray(), + //mappingTangents = mappingTangents.GetNativeArray(), +#endif + mappingReferenceIndices = mappingReferenceIndices.GetNativeArray(), + // proxy + proxyPositions = positions.GetNativeArray(), + proxyRotations = rotations.GetNativeArray(), + proxyVertexBindPosePositions = vertexBindPosePositions.GetNativeArray(), + proxyVertexBindPoseRotations = vertexBindPoseRotations.GetNativeArray(), + // render mesh + renderDataWorkArray = rm.renderDataWorkArray.GetNativeArray(), + renderMeshPositions = rm.renderMeshPositions.GetNativeArray(), + renderMeshNormals = rm.renderMeshNormals.GetNativeArray(), + renderMeshTangents = rm.renderMeshTangents.GetNativeArray(), + renderMeshBoneWeights = rm.renderMeshBoneWeights.GetNativeArray(), + }; + jobHandle = calcMeshConvert_B_Job.Schedule(tm.MappingCount * workerCount, 1, jobHandle); + + // ƒĴƒ³ƒ€ƒĵƒĦƒƒ‚·ƒƒ‡ƒĵ‚żċŒċ‡Ĥ理 + var postRenderDataJob = new PostRenderMeshWorkDataBatchJob() + { + // render mesh + renderDataWorkArray = rm.renderDataWorkArray.GetNativeArray(), + // mapping data + mappingDataArray = tm.mappingDataArray.GetNativeArray(), + }; + jobHandle = postRenderDataJob.Schedule(rm.RenderDataWorkCount, 8, jobHandle); + + return jobHandle; + } + + /// + /// ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒ‹‚‰ƒžƒƒƒ”ƒ³‚°ƒĦƒƒ‚·ƒ¸ċ¤‰ĉ›ƒžƒˆƒŞƒƒ‚Ż‚ı‚’ĉħ‚‚‚‹ + /// + [BurstCompile] + struct CalcMeshConvert_A_Job : IJobParallelFor + { + // team + [Unity.Collections.ReadOnly] + public NativeArray teamDataArray; + + // transform + [Unity.Collections.ReadOnly] + public NativeArray transformPositionArray; + [Unity.Collections.ReadOnly] + public NativeArray transformRotationArray; + [Unity.Collections.ReadOnly] + public NativeArray transformScaleArray; + + // mapping + public NativeArray mappingDataArray; + + // render mesh + [Unity.Collections.ReadOnly] + public NativeArray renderDataWorkArray; + + // ƒžƒƒƒ”ƒ³‚°ƒĦƒƒ‚·ƒ”¨ + public void Execute(int index) + { + var mdata = mappingDataArray[index]; + if (mdata.IsValid() == false) + return; + + var tdata = teamDataArray[mdata.teamId]; + if (tdata.IsProcess == false) + return; + + // RenderMeshWorkData + var wdata = renderDataWorkArray[mdata.renderDataWorkIndex]; + if (wdata.UseCustomMesh == false) + return; + + //======================================================================= + // ■ƒžƒƒƒ”ƒ³‚°ƒĦƒƒ‚·ƒ¨ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒċş§ĉ¨™ċ¤‰ĉ›ƒžƒˆƒŞƒƒ‚Ż‚ı‚’ĉħ‚‚‚‹ + { + // mapping + var pos = transformPositionArray[mdata.centerTransformIndex]; + var rot = transformRotationArray[mdata.centerTransformIndex]; + var scl = transformScaleArray[mdata.centerTransformIndex]; + var irot = math.inverse(rot); + + // proxy + var ppos = transformPositionArray[tdata.centerTransformIndex]; + var prot = transformRotationArray[tdata.centerTransformIndex]; + var pscl = transformScaleArray[tdata.centerTransformIndex]; + + // ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒ¨ƒžƒƒƒ”ƒ³‚°ƒĦƒƒ‚·ƒċş§ĉ¨™çİşé–“Œç­‰—„‹ċˆ¤ċš + bool sameSpace = MathUtility.CompareTransform(pos, rot, scl, ppos, prot, pscl); + mdata.sameSpace = sameSpace; + //Debug.Log($"sameSpace:{sameSpace}, scl:{scl}, pscl:{pscl}"); + + // ƒŻƒĵƒĞƒ‰çİşé–“‹‚‰ƒžƒƒƒ”ƒ³‚°ƒĦƒƒ‚·ƒ¸ċş§ĉ¨™çİşé–“ċ¤‰ĉ› + mdata.toMappingMatrix = math.inverse(MathUtility.LocalToWorldMatrix(pos, rot, scl)); + mdata.toMappingRotation = irot; + + // ƒžƒƒƒ”ƒ³‚°ƒĦƒƒ‚·ƒç”¨‚ı‚ħƒĵƒĞĉŻ”çŽ‡ + // ƒƒĵƒ ‚ıƒ†ƒƒƒ—ċŸèĦŒ¨Żç„Ħ関係ĞĉŻŽƒ•ƒĴƒĵƒ éİ用™‚‹ċż…èĤŒ‚‚‹Ÿ‚ƒƒĵƒ ‚ı‚ħƒĵƒĞĉŻ”çŽ‡¨ċˆ†é›˘™‚‹ + var initScaleLength = math.length(tdata.initScale); + Develop.Assert(initScaleLength > 0.0f); + mdata.scaleRatio = math.length(pscl) / initScaleLength; + } + + //======================================================================= + // ■ƒžƒƒƒ”ƒ³‚°ƒĦƒƒ‚·ƒƒĦƒƒ‚·ƒé ‚ç‚ıċ§żċ‹˘‚’ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒ‹‚‰é€†‚ı‚­ƒ‹ƒ³‚°—Ĥĉħ‚‚‚‹ + // ĉŽç·šĉœ‰ç„Ħ + bool useTangent = tdata.IsTangent; + // ƒœƒĵƒ³‚Ĥ‚¨‚¤ƒˆĉ›¸èĵż + bool modifyBoneWeight = wdata.HasBoneWeight && mdata.flag.IsSet(TeamManager.MappingDataFlag_ModifyBoneWeight); + + //======================================================================= + // ■結ĉžœĉ ĵ納 + mdata.flag.SetBits(TeamManager.MappingDataFlag_ChangePositionNormal, true); + mdata.flag.SetBits(TeamManager.MappingDataFlag_ChangeTangent, useTangent); + mdata.flag.SetBits(TeamManager.MappingDataFlag_ChangeBoneWeight, modifyBoneWeight); + mappingDataArray[index] = mdata; + } + } + + /// + /// ƒžƒƒƒ”ƒ³‚°ƒĦƒƒ‚·ƒé ‚ç‚ıċ§żċ‹˘‚’ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒ‹‚‰é€†‚ı‚­ƒ‹ƒ³‚°—Ĥĉħ‚‚‚‹ + /// ƒžƒƒƒ”ƒ³‚°ƒĦƒƒ‚·ƒé ‚ç‚ıċ§żċ‹˘‚’ĉ›¸èĵżç”¨ƒƒƒƒ•‚ĦĞĉ›¸èĵ‚€ + /// ċż…èĤŒ‚‚Œ°ƒœƒĵƒ³‚Ĥ‚¨‚¤ƒˆ‚‚ĉ›¸èĵ‚€ + /// + [BurstCompile] + struct CalcMeshConvert_B_Job : IJobParallelFor + { + public int workerCount; + + // team + [Unity.Collections.ReadOnly] + public NativeArray teamDataArray; + + // mapping + [Unity.Collections.ReadOnly] + public NativeArray mappingDataArray; + [Unity.Collections.ReadOnly] + public NativeArray mappingAttributes; + [Unity.Collections.ReadOnly] + public NativeArray mappingLocalPositions; + [Unity.Collections.ReadOnly] + public NativeArray mappingLocalNormals; + [Unity.Collections.ReadOnly] + public NativeArray mappingLocalTangents; + [Unity.Collections.ReadOnly] + public NativeArray mappingBoneWeights; +#if MC2_DEBUG + [NativeDisableParallelForRestriction] + [Unity.Collections.WriteOnly] + public NativeArray mappingPositions; +#endif + [Unity.Collections.ReadOnly] + public NativeArray mappingReferenceIndices; + + // proxy mesh + [Unity.Collections.ReadOnly] + public NativeArray proxyPositions; + [Unity.Collections.ReadOnly] + public NativeArray proxyRotations; + [Unity.Collections.ReadOnly] + public NativeArray proxyVertexBindPosePositions; + [Unity.Collections.ReadOnly] + public NativeArray proxyVertexBindPoseRotations; + + // render mesh + [Unity.Collections.ReadOnly] + public NativeArray renderDataWorkArray; + [NativeDisableParallelForRestriction] + [Unity.Collections.WriteOnly] + public NativeArray renderMeshPositions; + [NativeDisableParallelForRestriction] + [Unity.Collections.WriteOnly] + public NativeArray renderMeshNormals; + [NativeDisableParallelForRestriction] + public NativeArray renderMeshTangents; + [NativeDisableParallelForRestriction] + [Unity.Collections.WriteOnly] + public NativeArray renderMeshBoneWeights; + + // ƒžƒƒƒ”ƒ³‚°ƒĦƒƒ‚·ƒ”¨ + public void Execute(int dataIndex) + { + // ƒƒĵƒ ID¨ƒŻƒĵ‚ЃĵID + int localIndex = dataIndex / workerCount; + int workerIndex = dataIndex % workerCount; + + var mdata = mappingDataArray[localIndex]; + if (mdata.IsValid() == false) + return; + + var tdata = teamDataArray[mdata.teamId]; + if (tdata.IsProcess == false) + return; + + // RenderMeshWorkData + var wdata = renderDataWorkArray[mdata.renderDataWorkIndex]; + if (wdata.UseCustomMesh == false) + return; + + // 範ċ›² + var chunk = MathUtility.GetWorkerChunk(mdata.mappingCommonChunk.dataLength, workerCount, workerIndex); + if (chunk.IsValid == false) + return; + + //======================================================================= + // ■ƒžƒƒƒ”ƒ³‚°ƒĦƒƒ‚·ƒƒĦƒƒ‚·ƒé ‚ç‚ıċ§żċ‹˘‚’ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒ‹‚‰é€†‚ı‚­ƒ‹ƒ³‚°—Ĥĉħ‚‚‚‹ + // ĉŽç·šĉœ‰ç„Ħ + bool useTangent = tdata.IsTangent; + // ƒž‚¤ƒŠ‚ı‚ı‚ħƒĵƒĞ + float4 negativeScl = new float4(tdata.negativeScaleDirection, 1); + // ProxyMesh‚ı‚ħƒĵƒĞ + float3 proxyScl = tdata.initScale * mdata.scaleRatio; // ċˆĉœŸ‚ı‚ħƒĵƒĞ x çċœ¨‚ı‚ħƒĵƒĞĉŻ”çŽ‡ + // ƒœƒĵƒ³‚Ĥ‚¨‚¤ƒˆĉ›¸èĵż + bool modifyBoneWeight = wdata.HasBoneWeight && mdata.flag.IsSet(TeamManager.MappingDataFlag_ModifyBoneWeight); + + //int mvindex = mdata.mappingCommonChunk.startIndex; + int mvindex = mdata.mappingCommonChunk.startIndex + chunk.startIndex; + //for (int k = 0; k < mdata.mappingCommonChunk.dataLength; k++, mvindex++) + for (int k = 0; k < chunk.dataLength; k++, mvindex++) + { + // ç„ĦċŠı頂ç‚ıŻç„ĦèĤ–™‚‹ + var attr = mappingAttributes[mvindex]; + if (attr.IsInvalid()) + continue; + + // ċ›şċš‚‚ĉ›¸èĵŞ„ + if (attr.IsFixed()) + continue; + + // ƒžƒƒƒ”ƒ³‚°ƒĦƒƒ‚·ƒċ§żċ‹˘ + float4x3 _pose = 0; + _pose.c0 = new float4(mappingLocalPositions[mvindex], 1); + _pose.c1 = new float4(mappingLocalNormals[mvindex], 0); + _pose.c2 = math.select(0, new float4(mappingLocalTangents[mvindex], 0), useTangent); + + // ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒċş§ĉ¨™çİşé–“Ğċ¤‰ĉ›™‚‹ + if (mdata.sameSpace == false) + { + // çċœ¨ċ§żċ‹˘§ŻŞƒžƒƒƒ”ƒ³‚°ĉ™‚ċ§żċ‹˘§ċ¤‰ĉ›‚’èĦŒ† + _pose = math.mul(mdata.toProxyMatrix, _pose); + } + + // ƒž‚¤ƒŠ‚ı‚ı‚ħƒĵƒĞ + _pose *= new float4x3(negativeScl, negativeScl, negativeScl); + + // äğé™è¨ˆç—Ż™ıĤƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒƒ­ƒĵ‚ЃĞçİşé–“§èĦŒ† + var bw = mappingBoneWeights[mvindex]; + int wcnt = bw.Count; + float4x3 _opose = 0; + // ProxyMesh‚ı‚ħƒĵƒĞ + for (int i = 0; i < wcnt; i++) + { + float w = bw.weights[i]; + + int tvindex = bw.boneIndices[i] + tdata.proxyCommonChunk.startIndex; + + // ƒ‚¤ƒ³ƒ‰ƒƒĵ‚şé€†ċş§ĉ¨™¨é€†ċ›žèğ˘ + float3 bipos = proxyVertexBindPosePositions[tvindex]; + quaternion birot = proxyVertexBindPoseRotations[tvindex]; + + // ƒž‚¤ƒŠ‚ı‚ı‚ħƒĵƒĞ + bipos *= tdata.negativeScaleDirection; + birot = birot.value * tdata.negativeScaleQuaternionValue; + + // quaternion‹‚‰matrix¸ċ¤‰ĉ›Œé‡„§““Ż + float3 pos = math.mul(birot, _pose.c0.xyz + bipos); + float3 nor = math.mul(birot, _pose.c1.xyz); + float3 tan = math.mul(birot, _pose.c2.xyz); + + float3 ppos = proxyPositions[tvindex]; + quaternion prot = proxyRotations[tvindex]; + + // ƒŻƒĵƒĞƒ‰ċ¤‰ĉ› + // quaternion‹‚‰matrix¸ċ¤‰ĉ›Œé‡„§““Ż + pos = math.mul(prot, pos * proxyScl) + ppos; + nor = math.mul(prot, nor); + tan = math.mul(prot, tan); + + // ‚Ĥ‚¨‚¤ƒˆ + _opose.c0.xyz += pos * w; + _opose.c1.xyz += nor * w; + _opose.c2.xyz += tan * w; + } + + // ““§opos/orotŻƒŻƒĵƒĞƒ‰çİşé–“ + // ƒžƒƒƒ”ƒ³‚°ƒĦƒƒ‚·ƒƒ­ƒĵ‚ЃĞçİşé–“Ğċ¤‰ĉ›™‚‹ + _opose.c0.w = 1; + _opose = math.mul(mdata.toMappingMatrix, _opose); + +#if MC2_DEBUG + + // 結ĉžœĉ ĵ納 + mappingPositions[mvindex] = _opose.c0.xyz; + //mappingNormals[mvindex] = math.normalize(_opose.c1.xyz); + //if (useTangent) + // mappingTangents[mvindex] = math.normalize(_opose.c2.xyz); +#endif +#if true + // ■結ĉžœĉ ĵ納 + // ĉ›¸èĵ‚€é ‚ç‚ı‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı + int buffIndex = mappingReferenceIndices[mvindex]; + + // positoins / normals + int windex = wdata.renderMeshPositionAndNormalChunk.startIndex + buffIndex; + renderMeshPositions[windex] = _opose.c0.xyz; + renderMeshNormals[windex] = math.normalize(_opose.c1.xyz); + + // tangents + if (useTangent) + { + windex = wdata.renderMeshTangentChunk.startIndex + buffIndex; + float4 tan = renderMeshTangents[windex]; + renderMeshTangents[windex] = new float4(math.normalize(_opose.c2.xyz), tan.w); + } +#endif + // bone weights + if (modifyBoneWeight) + { + // ä½żç”¨é ‚ç‚ı‚Ĥ‚¨‚¤ƒˆŻcenterTransform100%§ĉ›¸èĵ‚€ + windex = wdata.renderMeshBoneWeightChunk.startIndex + buffIndex; + renderMeshBoneWeights[windex] = wdata.centerBoneWeight; + } + } + //Debug.Log($"[{index}] renderMeshPositions:start={mdata.renderMeshPositionAndNormalChunk.startIndex}, length={mdata.renderMeshPositionAndNormalChunk.dataLength}"); + } + } + + /// + /// ƒĴƒ³ƒ€ƒĵƒĦƒƒ‚·ƒƒ‡ƒĵ‚żċŒċ‡Ĥ理 + /// + [BurstCompile] + struct PostRenderMeshWorkDataBatchJob : IJobParallelFor + { + // render mesh + public NativeArray renderDataWorkArray; + + // mapping + [NativeDisableParallelForRestriction] + public NativeArray mappingDataArray; + + // RenderDataWork”¨ + public void Execute(int windex) + { + var wdata = renderDataWorkArray[windex]; + if (wdata.IsValid() == false) + return; + if (wdata.UseCustomMesh == false) + return; + + // ċ„ç¨ĉ›¸èĵżƒ•ƒİ‚°‚’設ċš™‚‹ + bool changePositionNormal = false; + bool changeTangent = false; + bool changeBoneWeight = false; + int mcnt = wdata.mappingDataIndexList.Length; + for (int k = 0; k < mcnt; k++) + { + int mindex = wdata.mappingDataIndexList[k]; + var mdata = mappingDataArray[mindex]; + + if (mdata.flag.IsSet(TeamManager.MappingDataFlag_ChangePositionNormal)) + { + changePositionNormal = true; + mdata.flag.SetBits(TeamManager.MappingDataFlag_ChangePositionNormal, false); + } + if (mdata.flag.IsSet(TeamManager.MappingDataFlag_ChangeTangent)) + { + changeTangent = true; + mdata.flag.SetBits(TeamManager.MappingDataFlag_ChangeTangent, false); + } + if (mdata.flag.IsSet(TeamManager.MappingDataFlag_ChangeBoneWeight)) + { + changeBoneWeight = true; + mdata.flag.SetBits(TeamManager.MappingDataFlag_ChangeBoneWeight, false); + mdata.flag.SetBits(TeamManager.MappingDataFlag_ModifyBoneWeight, false); // Modifyƒ•ƒİ‚°‚‚ĉĥˆ™ + } + + mappingDataArray[mindex] = mdata; + } + + // ĉ›¸èĵżƒ•ƒİ‚°è¨­ċš + wdata.flag.SetBits(RenderManager.RenderDataFlag_WritePositionNormal, changePositionNormal); + wdata.flag.SetBits(RenderManager.RenderDataFlag_WriteTangent, changeTangent); + wdata.flag.SetBits(RenderManager.RenderDataFlag_WriteBoneWeight, changeBoneWeight); + + renderDataWorkArray[windex] = wdata; + } + } + + //========================================================================================= + public void InformationLog(StringBuilder allsb) + { + StringBuilder sb = new StringBuilder(); + sb.AppendLine($"========== VMesh Manager =========="); + if (IsValid() == false) + { + sb.AppendLine($"VirtualMesh Manager. Invalid."); + } + else + { + sb.AppendLine($"VirtualMesh Manager."); + sb.AppendLine($" -ProxyVertexCount:{ProxyVertexCount}"); + sb.AppendLine($" -ProxyEdgeCount:{ProxyEdgeCount}"); + sb.AppendLine($" -ProxyTriangleCount:{ProxyTriangleCount}"); + sb.AppendLine($" -ProxyBaseLineCount:{ProxyBaseLineCount}"); + sb.AppendLine($" -ProxyLocalPositionCount:{ProxyLocalPositionCount}"); + + sb.AppendLine($" [ProxyMesh]"); + sb.AppendLine($" -teamIds:{teamIds.ToSummary()}"); + sb.AppendLine($" -attributes:{attributes.ToSummary()}"); + sb.AppendLine($" -vertexToTriangles:{vertexToTriangles.ToSummary()}"); + sb.AppendLine($" -vertexBindPosePositions:{vertexBindPosePositions.ToSummary()}"); + sb.AppendLine($" -vertexBindPoseRotations:{vertexBindPoseRotations.ToSummary()}"); + sb.AppendLine($" -vertexDepths:{vertexDepths.ToSummary()}"); + sb.AppendLine($" -vertexRootIndices:{vertexRootIndices.ToSummary()}"); + sb.AppendLine($" -vertexLocalPositions:{vertexLocalPositions.ToSummary()}"); + sb.AppendLine($" -vertexLocalRotations:{vertexLocalRotations.ToSummary()}"); + sb.AppendLine($" -vertexParentIndices:{vertexParentIndices.ToSummary()}"); + sb.AppendLine($" -vertexChildIndexArray:{vertexChildIndexArray.ToSummary()}"); + sb.AppendLine($" -vertexChildDataArray:{vertexChildDataArray.ToSummary()}"); + sb.AppendLine($" -normalAdjustmentRotations:{normalAdjustmentRotations.ToSummary()}"); + sb.AppendLine($" -uv:{uv.ToSummary()}"); + + sb.AppendLine($" -triangleTeamIdArray:{triangleTeamIdArray.ToSummary()}"); + sb.AppendLine($" -triangles:{triangles.ToSummary()}"); + sb.AppendLine($" -triangleNormals:{triangleNormals.ToSummary()}"); + sb.AppendLine($" -triangleTangents:{triangleTangents.ToSummary()}"); + + sb.AppendLine($" -edgeTeamIdArray:{edgeTeamIdArray.ToSummary()}"); + sb.AppendLine($" -edges:{edges.ToSummary()}"); + sb.AppendLine($" -edgeFlags:{edgeFlags.ToSummary()}"); + + sb.AppendLine($" -baseLineFlags:{baseLineFlags.ToSummary()}"); + sb.AppendLine($" -baseLineTeamIds:{baseLineTeamIds.ToSummary()}"); + sb.AppendLine($" -baseLineStartDataIndices:{baseLineStartDataIndices.ToSummary()}"); + sb.AppendLine($" -baseLineDataCounts:{baseLineDataCounts.ToSummary()}"); + sb.AppendLine($" -baseLineData:{baseLineData.ToSummary()}"); + + sb.AppendLine($" [Mesh Common]"); + sb.AppendLine($" -localPositions:{localPositions.ToSummary()}"); + sb.AppendLine($" -localNormals:{localNormals.ToSummary()}"); + sb.AppendLine($" -localTangents:{localTangents.ToSummary()}"); + sb.AppendLine($" -boneWeights:{boneWeights.ToSummary()}"); + sb.AppendLine($" -skinBoneTransformIndices:{skinBoneTransformIndices.ToSummary()}"); + sb.AppendLine($" -skinBoneBindPoses:{skinBoneBindPoses.ToSummary()}"); + + sb.AppendLine($" [Mesh Other]"); + sb.AppendLine($" -vertexToTransformRotations:{vertexToTransformRotations.ToSummary()}"); + sb.AppendLine($" -positions:{positions.ToSummary()}"); + sb.AppendLine($" -rotations:{rotations.ToSummary()}"); + + sb.AppendLine($" [Mapping]"); + sb.AppendLine($" -MappingVertexCount:{MappingVertexCount}"); + sb.AppendLine($" -mappingReferenceIndices:{mappingReferenceIndices.ToSummary()}"); + sb.AppendLine($" -mappingAttributes:{mappingAttributes.ToSummary()}"); + sb.AppendLine($" -mappingLocalPositins:{mappingLocalPositins.ToSummary()}"); + sb.AppendLine($" -mappingLocalNormals:{mappingLocalNormals.ToSummary()}"); + sb.AppendLine($" -mappingBoneWeights:{mappingBoneWeights.ToSummary()}"); + //sb.AppendLine($" -mappingPositions:{mappingPositions.ToSummary()}"); + //sb.AppendLine($" -mappingNormals:{mappingNormals.ToSummary()}"); + + //sb.AppendLine($" [RenderMeshBuffer]"); + //sb.AppendLine($" -renderMeshPositions:{renderMeshPositions.ToSummary()}"); + //sb.AppendLine($" -renderMeshNormals:{renderMeshNormals.ToSummary()}"); + //sb.AppendLine($" -renderMeshTangents:{renderMeshTangents.ToSummary()}"); + } + sb.AppendLine(); + Debug.Log(sb.ToString()); + allsb.Append(sb); + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Manager/VirtualMesh/VirtualMeshManager.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Manager/VirtualMesh/VirtualMeshManager.cs.meta new file mode 100644 index 00000000..c372b9f6 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Manager/VirtualMesh/VirtualMeshManager.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: ae2cd7d531771f9438f7fb94e886ee25 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Manager/VirtualMesh/VirtualMeshManager.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/PreBuild.meta b/Assets/MagicaCloth2/Scripts/Core/PreBuild.meta new file mode 100644 index 00000000..d9315f58 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/PreBuild.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1f85ba9270154ec4ea99adc777266a0f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Scripts/Core/PreBuild/PreBuildScriptableObject.cs b/Assets/MagicaCloth2/Scripts/Core/PreBuild/PreBuildScriptableObject.cs new file mode 100644 index 00000000..99c105ca --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/PreBuild/PreBuildScriptableObject.cs @@ -0,0 +1,64 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2024 MagicaSoft. +// https://magicasoft.jp +using System.Collections.Generic; +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// PreBuildäżċ­˜‚˘‚ğƒƒƒˆƒ‡ƒĵ‚ż + /// + [CreateAssetMenu(fileName = "Data", menuName = "MagicaCloth2/PreBuildScriptableObject")] + public class PreBuildScriptableObject : ScriptableObject + { + /// + /// 複ĉ•°PreBuildƒ‡ƒĵ‚ż‚’ĉ ĵ納ċŻèƒ½ + /// + public List sharePreBuildDataList = new List(); + + //========================================================================================= + public bool HasPreBuildData(string buildId) + { + return GetPreBuildData(buildId) != null; + } + + public SharePreBuildData GetPreBuildData(string buildId) + { + foreach (var sdata in sharePreBuildDataList) + { + if (sdata.CheckBuildId(buildId)) + return sdata; + } + + return null; + } + + public void AddPreBuildData(SharePreBuildData sdata) + { + int index = sharePreBuildDataList.FindIndex(x => x.buildId == sdata.buildId); + if (index >= 0) + sharePreBuildDataList[index] = sdata; + else + sharePreBuildDataList.Add(sdata); + } + + //========================================================================================= + /// + /// ™ıĤPreBuildƒ‡ƒĵ‚ż‚’ƒ‡‚·ƒŞ‚˘ƒİ‚¤‚ş—Ĥƒžƒƒĵ‚¸ƒ£Ğç™ğ録—™ + /// “ċ‡Ĥ理Żè² è·ŒéИ„Ÿ‚äş‹ċ‰ĞċŸèĦŒ—ĤŠ“¨§‚Żƒ­‚ıƒ‡ƒĵ‚żċˆİ用ĉ™‚è² è·‚’èğ½ĉ¸›§™ + /// Deserialize all PreBuild data and register it with the manager. + /// This process requires a high load, so running it in advance can reduce the load when using cross data. + /// + public void Warmup() + { + if (Application.isPlaying == false) + return; + + sharePreBuildDataList.ForEach(sdata => + { + MagicaManager.PreBuild.RegisterPreBuildData(sdata, false); + }); + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/PreBuild/PreBuildScriptableObject.cs.meta b/Assets/MagicaCloth2/Scripts/Core/PreBuild/PreBuildScriptableObject.cs.meta new file mode 100644 index 00000000..a7a81d93 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/PreBuild/PreBuildScriptableObject.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 45b12b58fd27b9a4bae4f50db55b4459 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/PreBuild/PreBuildScriptableObject.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/PreBuild/PreBuildSerializeData.cs b/Assets/MagicaCloth2/Scripts/Core/PreBuild/PreBuildSerializeData.cs new file mode 100644 index 00000000..ec3ccac3 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/PreBuild/PreBuildSerializeData.cs @@ -0,0 +1,101 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2024 MagicaSoft. +// https://magicasoft.jp +using System; +using System.Collections.Generic; +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// PreBuildäżċ­˜ƒ‡ƒĵ‚ż + /// + [System.Serializable] + public class PreBuildSerializeData : ITransform + { + /// + /// ĉœ‰ċŠıçŠĥĉ…‹ + /// Valid state. + /// + public bool enabled = false; + + /// + /// ƒ“ƒĞƒ‰è­˜ċˆID + /// + public string buildId; + + /// + /// ƒ“ƒĞƒ‰ƒ‡ƒĵ‚żċ…ħĉœ‰éƒ¨ċˆ† + /// “ƒ‡ƒĵ‚żŻè¤‡ĉ•°‚¤ƒ³‚ı‚żƒ³‚ı§ċ…ħĉœ‰•‚Œ‚‹Ÿ‚ScriptableObject¨—Ĥċ¤–部‚˘‚ğƒƒƒˆ¨—Ĥ保ċ­˜•‚Œ‚‹ + /// + public PreBuildScriptableObject preBuildScriptableObject = null; + + /// + /// ƒ“ƒĞƒ‰ƒ‡ƒĵ‚żċ›şĉœ‰éƒ¨ċˆ† + /// “ƒ‡ƒĵ‚żŻ‚¤ƒ³‚ı‚żƒ³‚ı”¨Ğċ›şĉœ‰¨Ş‚‹ + /// + public UniquePreBuildData uniquePreBuildData; + + //========================================================================================= + /// + /// PreBuildċˆİ用ĉœ‰ç„Ħ + /// + /// + public bool UsePreBuild() => enabled; + + /// + /// PreBuildƒ‡ƒĵ‚żĉ¤œè¨ĵ + /// + /// + public ResultCode DataValidate() + { + if (uniquePreBuildData == null) + return new ResultCode(Define.Result.PreBuildData_Empty); + + var preBuildData = GetSharePreBuildData(); + if (preBuildData == null) + return new ResultCode(Define.Result.PreBuildData_Empty); + + var result = preBuildData.DataValidate(); + if (result.IsFaild()) + return result; + + result = uniquePreBuildData.DataValidate(); + if (result.IsFaild()) + return result; + + return ResultCode.Success; + } + + public SharePreBuildData GetSharePreBuildData() + { + if (preBuildScriptableObject == null) + return null; + + if (string.IsNullOrEmpty(buildId)) + return null; + + return preBuildScriptableObject.GetPreBuildData(buildId); ; + } + + /// + /// ƒ“ƒĞƒ‰ID‚’生ĉˆ™‚‹(è‹ħĉ•°ċ­—ïĵ˜ĉ–‡ċ­—) + /// + /// + public static string GenerateBuildID() + { + Guid g = Guid.NewGuid(); + return g.ToString().Substring(0, 8); + } + + public void GetUsedTransform(HashSet transformSet) + { + uniquePreBuildData.GetUsedTransform(transformSet); + } + + public void ReplaceTransform(Dictionary replaceDict) + { + uniquePreBuildData.ReplaceTransform(replaceDict); + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/PreBuild/PreBuildSerializeData.cs.meta b/Assets/MagicaCloth2/Scripts/Core/PreBuild/PreBuildSerializeData.cs.meta new file mode 100644 index 00000000..f074ebfa --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/PreBuild/PreBuildSerializeData.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 5c7522d5a2a34f84c9588683c5574fa9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/PreBuild/PreBuildSerializeData.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/PreBuild/SharePreBuildData.cs b/Assets/MagicaCloth2/Scripts/Core/PreBuild/SharePreBuildData.cs new file mode 100644 index 00000000..c8cc0326 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/PreBuild/SharePreBuildData.cs @@ -0,0 +1,69 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2024 MagicaSoft. +// https://magicasoft.jp +using System.Collections.Generic; +using System.Text; +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// PreBuildƒ‡ƒĵ‚żċ…ħĉœ‰éƒ¨ċˆ† + /// + [System.Serializable] + public class SharePreBuildData + { + public int version; + public string buildId; + public ResultCode buildResult; + public Vector3 buildScale; + + public List renderSetupDataList = new List(); + + public VirtualMesh.ShareSerializationData proxyMesh; + public List renderMeshList = new List(); + + public DistanceConstraint.ConstraintData distanceConstraintData; + public TriangleBendingConstraint.ConstraintData bendingConstraintData; + public InertiaConstraint.ConstraintData inertiaConstraintData; + + //========================================================================================= + public ResultCode DataValidate() + { + if (version != Define.System.LatestPreBuildVersion) + return new ResultCode(Define.Result.PreBuildData_VersionMismatch); + + if (buildScale.x < Define.System.Epsilon) + return new ResultCode(Define.Result.PreBuildData_InvalidScale); + + if (buildResult.IsFaild()) + return buildResult; + + return ResultCode.Success; + } + + public bool CheckBuildId(string buildId) + { + if (string.IsNullOrEmpty(buildId)) + return false; + + return this.buildId == buildId; + } + + public override string ToString() + { + StringBuilder sb = new StringBuilder(1024); + + sb.AppendLine("<<<<< PreBuildData >>>>>"); + sb.AppendLine($"Version:{version}"); + sb.AppendLine($"BuildID:{buildId}"); + sb.AppendLine($"BuildResult:{buildResult.GetResultString()}"); + sb.AppendLine($"BuildScale:{buildScale}"); + sb.AppendLine(proxyMesh.ToString()); + sb.AppendLine($"renderMeshList:{renderMeshList.Count}"); + sb.AppendLine($"renderSetupDataList:{renderSetupDataList.Count}"); + + return sb.ToString(); + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/PreBuild/SharePreBuildData.cs.meta b/Assets/MagicaCloth2/Scripts/Core/PreBuild/SharePreBuildData.cs.meta new file mode 100644 index 00000000..748ebb35 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/PreBuild/SharePreBuildData.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 280185e34f035f44d999fc83fffe8ab9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/PreBuild/SharePreBuildData.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/PreBuild/UniquePreBuildData.cs b/Assets/MagicaCloth2/Scripts/Core/PreBuild/UniquePreBuildData.cs new file mode 100644 index 00000000..b700c559 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/PreBuild/UniquePreBuildData.cs @@ -0,0 +1,49 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2024 MagicaSoft. +// https://magicasoft.jp +using System.Collections.Generic; +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// PreBuildƒ‡ƒĵ‚żċ›şĉœ‰éƒ¨ċˆ† + /// + [System.Serializable] + public class UniquePreBuildData : ITransform + { + public int version; + public ResultCode buildResult; + + public List renderSetupDataList = new List(); + + public VirtualMesh.UniqueSerializationData proxyMesh; + public List renderMeshList = new List(); + + //========================================================================================= + public ResultCode DataValidate() + { + if (version != Define.System.LatestPreBuildVersion) + return new ResultCode(Define.Result.PreBuildData_VersionMismatch); + + if (buildResult.IsFaild()) + return buildResult; + + return ResultCode.Success; + } + + public void GetUsedTransform(HashSet transformSet) + { + renderSetupDataList.ForEach(x => x?.GetUsedTransform(transformSet)); + proxyMesh?.GetUsedTransform(transformSet); + renderMeshList.ForEach(x => x?.GetUsedTransform(transformSet)); + } + + public void ReplaceTransform(Dictionary replaceDict) + { + renderSetupDataList.ForEach(x => x?.ReplaceTransform(replaceDict)); + proxyMesh?.ReplaceTransform(replaceDict); + renderMeshList.ForEach(x => x?.ReplaceTransform(replaceDict)); + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/PreBuild/UniquePreBuildData.cs.meta b/Assets/MagicaCloth2/Scripts/Core/PreBuild/UniquePreBuildData.cs.meta new file mode 100644 index 00000000..c76b5cbc --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/PreBuild/UniquePreBuildData.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 0cee094d81395864ba3ef342016a8de6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/PreBuild/UniquePreBuildData.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Reduction.meta b/Assets/MagicaCloth2/Scripts/Core/Reduction.meta new file mode 100644 index 00000000..99e86e91 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Reduction.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ca42d530d97d6bf40aa8379befc72777 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Scripts/Core/Reduction/ReductionSettings.cs b/Assets/MagicaCloth2/Scripts/Core/Reduction/ReductionSettings.cs new file mode 100644 index 00000000..4447fe72 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Reduction/ReductionSettings.cs @@ -0,0 +1,77 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using Unity.Mathematics; +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// Configuration data for reduction. + /// ƒŞƒ€‚Ż‚·ƒ§ƒ³ç”¨è¨­ċšƒ‡ƒĵ‚ż + /// + [System.Serializable] + public class ReductionSettings : IDataValidate + { + /// + /// Simple distance reduction (% of AABB maximum distance) (0.0 ~ 1.0). + /// ċ˜ç´”Şè·é›˘Ğ‚ˆ‚‹ċ‰Šĉ¸›(AABBĉœ€ċ¤§è·é›˘%)(0.0 ~ 1.0) + /// [NG] Runtime changes. + /// [NG] Export/Import with Presets + /// + [Range(0.0f, 0.2f)] + public float simpleDistance = 0.0f; + + /// + /// Reduction by distance considering geometry (% of AABB maximum distance) (0.0 ~ 1.0). + /// ċ½˘çŠĥ‚’考ĉ…—Ÿè·é›˘Ğ‚ˆ‚‹ċ‰Šĉ¸›(AABBĉœ€ċ¤§è·é›˘%)(0.0 ~ 1.0) + /// [NG] Runtime changes. + /// [NG] Export/Import with Presets + /// + [Range(0.0f, 0.2f)] + public float shapeDistance = 0.0f; + + //========================================================================================= + public bool IsEnabled => Define.System.ReductionEnable; + + public float GetMaxConnectionDistance() + { + return math.max(math.max(Define.System.ReductionSameDistance, simpleDistance), shapeDistance); + } + + public ReductionSettings Clone() + { + return new ReductionSettings() + { + simpleDistance = simpleDistance, + shapeDistance = shapeDistance, + }; + } + + public void DataValidate() + { + simpleDistance = Mathf.Clamp(simpleDistance, 0.0f, 0.2f); + shapeDistance = Mathf.Clamp(shapeDistance, 0.0f, 0.2f); + } + + /// + /// ‚¨ƒ‡‚£‚żƒĦƒƒ‚·ƒĉ›´ĉ–°‚’ċˆ¤ċš™‚‹Ÿ‚ƒƒƒ‚·ƒ‚³ƒĵƒ‰ + /// ïĵˆ“ƒƒƒ‚·ƒŻċŸèĦŒĉ™‚ĞŻċˆİ用•‚ŒŞ„編集用‚‚ïĵ‰ + /// + /// + public override int GetHashCode() + { + int hash = 0; + hash += simpleDistance.GetHashCode(); + hash += shapeDistance.GetHashCode(); + + return hash; + } + + public override string ToString() + { + return $"ReductionSettings. sameDist:{Define.System.ReductionSameDistance}, simpleDist:{simpleDistance}, shapeDist:{shapeDistance} maxStep:{Define.System.ReductionMaxStep}"; + } + + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Reduction/ReductionSettings.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Reduction/ReductionSettings.cs.meta new file mode 100644 index 00000000..6be4d30d --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Reduction/ReductionSettings.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 143de5f6b100ea74a87486d4d796dd38 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Reduction/ReductionSettings.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Reduction/ReductionWorkData.cs b/Assets/MagicaCloth2/Scripts/Core/Reduction/ReductionWorkData.cs new file mode 100644 index 00000000..24de3b53 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Reduction/ReductionWorkData.cs @@ -0,0 +1,141 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System; +using Unity.Collections; +using Unity.Mathematics; + +namespace MagicaCloth2 +{ + public class ReductionWorkData : IDisposable + { + public VirtualMesh vmesh; + + //========================================================================================= + // ƒŞƒ€‚Ż‚·ƒ§ƒ³ä½œĉ­ƒ‡ƒĵ‚ż + //========================================================================================= + /// + /// 頂ç‚ıçµċˆċ…ˆ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı(-1=生ċ­˜—Ĥ„‚‹, 0äğ上=ċ‰Šé™¤•‚ŒĤ„‚‹) + /// + public NativeArray vertexJoinIndices; + + /// + /// 頂ç‚ı”¨ĉŽçĥšé ‚ç‚ı‚¤ƒ³ƒ‡ƒƒ‚Ż‚ıƒŞ‚ıƒˆ + /// + public NativeParallelMultiHashMap vertexToVertexMap; + + //========================================================================================= + // ƒĦƒƒ‚·ƒĉœ€éİċŒ–作ĉ­ƒ‡ƒĵ‚ż + //========================================================================================= + /// + /// ċ¤„é ‚ç‚ı‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı‹‚‰ĉ–°—„é ‚ç‚ı‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı¸ċ¤‰ĉ›ƒŞ‚ıƒˆ + /// + public NativeArray vertexRemapIndices; + + /// + /// ‚ı‚­ƒ‹ƒ³‚°ƒœƒĵƒ³‚¤ƒ³ƒ‡ƒƒ‚Ż‚ıċ¤‰ĉ›èžĉ›¸ + /// ‚­ƒĵïĵšĉœ€éİċŒ–ċ‰ƒœƒĵƒ³‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı€ƒ‡ƒĵ‚żïĵšĉœ€éİċŒ–ċŒƒœƒĵƒ³‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı + /// + public NativeParallelHashMap useSkinBoneMap; + + /// + /// ĉ–°—„é ‚ç‚ıé ‚ç‚ıĉŽçĥšƒŞ‚ıƒˆ + /// + public NativeParallelMultiHashMap newVertexToVertexMap; + + public NativeParallelHashSet edgeSet; + public NativeParallelHashSet triangleSet; + + + //========================================================================================= + // ĉœ€çµ‚çš„ŞƒĦƒƒ‚·ƒƒ‡ƒĵ‚ż + //========================================================================================= + public int oldVertexCount; + public int newVertexCount; + public int removeVertexCount; + + public ExSimpleNativeArray newAttributes; + public ExSimpleNativeArray newLocalPositions; + public ExSimpleNativeArray newLocalNormals; + public ExSimpleNativeArray newLocalTangents; + public ExSimpleNativeArray newUv; + public ExSimpleNativeArray newBoneWeights; + + public NativeReference newSkinBoneCount; + public NativeList newSkinBoneTransformIndices; + public NativeList newSkinBoneBindPoseList; + + public NativeList newLineList; + public NativeList newTriangleList; + + //========================================================================================= + public ReductionWorkData(VirtualMesh vmesh) + { + this.vmesh = vmesh; + } + + public void Dispose() + { + if (vertexJoinIndices.IsCreated) + vertexJoinIndices.Dispose(); + if (vertexToVertexMap.IsCreated) + vertexToVertexMap.Dispose(); + if (vertexRemapIndices.IsCreated) + vertexRemapIndices.Dispose(); + if (useSkinBoneMap.IsCreated) + useSkinBoneMap.Dispose(); + if (newVertexToVertexMap.IsCreated) + newVertexToVertexMap.Dispose(); + if (edgeSet.IsCreated) + edgeSet.Dispose(); + if (triangleSet.IsCreated) + triangleSet.Dispose(); + + // ĉœ€çµ‚ƒĦƒƒ‚·ƒƒ‡ƒĵ‚ż + newAttributes?.Dispose(); + newLocalPositions?.Dispose(); + newLocalNormals?.Dispose(); + newLocalTangents?.Dispose(); + newUv?.Dispose(); + newBoneWeights?.Dispose(); + if (newSkinBoneCount.IsCreated) + newSkinBoneCount.Dispose(); + if (newSkinBoneTransformIndices.IsCreated) + newSkinBoneTransformIndices.Dispose(); + if (newSkinBoneBindPoseList.IsCreated) + newSkinBoneBindPoseList.Dispose(); + if (newLineList.IsCreated) + newLineList.Dispose(); + if (newTriangleList.IsCreated) + newTriangleList.Dispose(); + } + +#if false + + public void DebugVerify() + { + // vertexToVertexMap + //using var keyArray = vertexToVertexMap.GetKeyArray(Allocator.TempJob); + //foreach (var key in keyArray) + //{ + // int cnt = vertexToVertexMap.CountValuesForKey(key); + // if (cnt == 0) + // { + // Develop.DebugLogWarning($"vertexToVertexMap. no data! :{key}"); + // } + //} + } + + public void DebugInfo() + { + // vertexToVertexMap + //using var keyArray = vertexToVertexMap.GetKeyArray(Allocator.TempJob); + //foreach (var key in keyArray) + //{ + // int cnt = vertexToVertexMap.CountValuesForKey(key); + // Develop.DebugLog($"vertexToVertexMap [{key}] cnt:{cnt}"); + //} + } +#endif + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Reduction/ReductionWorkData.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Reduction/ReductionWorkData.cs.meta new file mode 100644 index 00000000..4311ef44 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Reduction/ReductionWorkData.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 96acdb752b9af6746a6eb571598ca2dd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Reduction/ReductionWorkData.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Reduction/SameDistanceReduction.cs b/Assets/MagicaCloth2/Scripts/Core/Reduction/SameDistanceReduction.cs new file mode 100644 index 00000000..81bb4ad1 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Reduction/SameDistanceReduction.cs @@ -0,0 +1,560 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System; +using Unity.Burst; +using Unity.Collections; +using Unity.Jobs; +using Unity.Mathematics; +using UnityEngine; +#if MAGICACLOTH2_REDUCTION_DEBUG +using UnityEngine; +#endif + +namespace MagicaCloth2 +{ + /// + /// è·é›˘ċ†…™ıĤé ‚ç‚ı‚’一ċşĤĞ結ċˆ•›‚‹ + /// + public class SameDistanceReduction : IDisposable + { + string name = string.Empty; + VirtualMesh vmesh; + ReductionWorkData workData; + ResultCode result; + float mergeLength; + + //========================================================================================= + GridMap gridMap; + //NativeParallelHashSet joinPairSet; + NativeParallelMultiHashMap joinPairMap; + NativeReference resultRef; + + //========================================================================================= + public SameDistanceReduction() { } + + public SameDistanceReduction( + string name, + VirtualMesh mesh, + ReductionWorkData workingData, + float mergeLength + ) + { + this.name = name; + this.vmesh = mesh; + this.workData = workingData; + this.result = ResultCode.None; + this.mergeLength = math.max(mergeLength, 1e-09f); + } + + public virtual void Dispose() + { + //if (joinPairSet.IsCreated) + // joinPairSet.Dispose(); + if (joinPairMap.IsCreated) + joinPairMap.Dispose(); + if (resultRef.IsCreated) + resultRef.Dispose(); + gridMap?.Dispose(); + } + + public ResultCode Result => result; + + //========================================================================================= + /// + /// ƒŞƒ€‚Ż‚·ƒ§ƒ³ċŸèĦŒïĵˆ‚ıƒĴƒƒƒ‰ċŻïĵ‰ + /// + /// + public ResultCode Reduction() + { + //bool success = false; + result.Clear(); + + try + { + // ‚°ƒŞƒƒƒ‰ƒžƒƒƒ— + gridMap = new GridMap(vmesh.VertexCount); + + // ĉœ€éİŞ‚°ƒŞƒƒƒ‰‚µ‚¤‚ş‚’ċ‰²‚Šċ‡ş™(mergeLengthŻ>0Œäżè¨ĵ•‚ŒĤ„‚‹) + float gridSize = mergeLength * 2.0f; + + // 頂ç‚ı”¨ĉŽçĥšƒžƒƒƒ— + // ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ıŒè‹„ĉ–ıŒè¨˜éŒ²™‚‹ + //joinPairSet = new NativeParallelHashSet(vmesh.VertexCount / 4, Allocator.Persistent); + joinPairMap = new NativeParallelMultiHashMap(vmesh.VertexCount, Allocator.Persistent); + resultRef = new NativeReference(Allocator.Persistent); + + // ƒ‚¤ƒ³ƒˆ‚’‚°ƒŞƒƒƒ‰Ğç™ğ録 + var initGridJob = new InitGridJob() + { + vcnt = vmesh.VertexCount, + gridSize = gridSize, + localPositions = vmesh.localPositions.GetNativeArray(), + joinIndices = workData.vertexJoinIndices, + gridMap = gridMap.GetMultiHashMap(), + }; + initGridJob.Run(); + + // èż‘ċ‚é ‚ç‚ı‚’ĉ¤œç´˘€çµċˆƒžƒƒƒ—Ğç™ğ録™‚‹ + var searchJoinJob = new SearchJoinJob() + { + vcnt = vmesh.VertexCount, + gridSize = gridSize, + radius = mergeLength, + localPositions = vmesh.localPositions.GetNativeArray(), + joinIndices = workData.vertexJoinIndices, + gridMap = gridMap.GetMultiHashMap(), + //joinPairSet = joinPairSet, + joinPairMap = joinPairMap, + }; + searchJoinJob.Run(); + + // 結ċˆ™‚‹ +#if false + var joinJob = new JoinJob() + { + vertexCount = vmesh.VertexCount, + //joinPairSet = joinPairSet, + joinPairMap = joinPairMap, + joinIndices = workData.vertexJoinIndices, + vertexToVertexMap = workData.vertexToVertexMap, + boneWeights = vmesh.boneWeights.GetNativeArray(), + attributes = vmesh.attributes.GetNativeArray(), + result = resultRef, + }; + joinJob.Run(); +#endif +#if true + // éИ速ċŒ–Š‚ˆ³èݳ細ƒĦƒƒ‚·ƒŒ‚‚‹ċ ´ċˆĞïĵ‘¤é ‚ç‚ıĞċ¤§é‡Ğ結ċˆ—‚ރĵƒƒĵƒ•ƒ­ƒĵŒç™şç”Ÿ™‚‹ċ•éĦŒ‚’ċ›žéż—Ÿ‚‚ + // äğċ‰ŻA->B->C結ċˆĉ™‚ĞA->C間ŒĉŽçĥšè·é›˘äğ上§‚‚A->CŒçµċˆ•‚ŒĤ—£ŸŒ€“ĉ”ıè‰Żç‰ˆ§Ż‚ŒŒŠ“Ş‚‰Ş„ + // Ÿ‚äğċ‰¨ŻçµĉžœŒ“¨Ş‚‹“¨Ğĉ³¨ĉ„ïĵ + using var tempList = new NativeList(2048, Allocator.Persistent); + var joinJob2 = new JoinJob2() + { + vertexCount = vmesh.VertexCount, + joinPairMap = joinPairMap, + joinIndices = workData.vertexJoinIndices, + vertexToVertexMap = workData.vertexToVertexMap, + boneWeights = vmesh.boneWeights.GetNativeArray(), + attributes = vmesh.attributes.GetNativeArray(), + result = resultRef, + tempList = tempList, + }; + joinJob2.Run(); +#endif + + // 頂ç‚ıĉŽçĥšçŠĥĉ…‹‚’ĉœ€ĉ–°Ğĉ›´ĉ–°™‚‹€‚™ıĤĉœ€ĉ–°ç”Ÿċ­˜ƒ‚¤ƒ³ƒˆ‚’ĉŒ‡™‚ˆ†Ğċ¤‰ĉ›´™‚‹ + UpdateJoinAndLink(); + + // 頂ç‚ıĉƒ…ċ ħ‚’ĉ•´ç†™‚‹ + // ĉ³•ç·šċ˜ä½ċŒ– + // ƒœƒĵƒ³‚Ĥ‚¨‚¤ƒˆ‚’ïĵ‘Ğċı³ċ‡ċŒ– + UpdateReductionResultJob(); + + // ċ‰Šé™¤é ‚ç‚ıĉ•°é›†è¨ˆ + int removeVertexCount = resultRef.Value; + workData.removeVertexCount += removeVertexCount; + //Debug.Log($"[SameDistanceReduction [{name}]] mergeLength:{mergeLength} RemoveVertex:{removeVertexCount}"); + + // ċŒäş† + //success = true; + result.SetSuccess(); + } + catch (Exception exception) + { + Debug.LogError(exception); + result.SetError(Define.Result.Reduction_SameDistanceException); + } + finally + { + // 作ĉ­ƒƒƒƒ•‚Ħ‚’è§£ĉ”™‚‹ïĵˆé‡èĤïĵ‰ + // ★äğĞ‚ż‚ı‚݁Œä‹ċ¤–‚„‚­ƒ£ƒ³‚ğƒĞ•‚ŒŸ¨—Ĥ‚‚“‚Œ§ä½œĉˆ—Ÿƒƒƒƒ•‚ĦŻĉ­£—Dispose()•‚Œ‚‹ + //MagicaManager.Discard.Add(); + + // ç™ğ録—Ÿ‚¸ƒ§ƒ–‚’解除™‚‹ïĵˆé‡èĤïĵ‰ + // ★äğĞ‚ż‚ı‚݁Œä‹ċ¤–‚„‚­ƒ£ƒ³‚ğƒĞ•‚ŒŸ¨—Ĥ‚‚“‚Œ§ç™şèĦŒ—ŸJobŻĉ­£—Complete()•‚Œ‚‹ + //MagicaManager.Thread.DisposeJob(int); + } + + return result; + } + + //========================================================================================= + [BurstCompile] + struct InitGridJob : IJob + { + public int vcnt; + public float gridSize; + [Unity.Collections.ReadOnly] + public NativeArray localPositions; + [Unity.Collections.ReadOnly] + public NativeArray joinIndices; + public NativeParallelMultiHashMap gridMap; + + // 頂ç‚ı”¨ + public void Execute() + { + for (int vindex = 0; vindex < vcnt; vindex++) + { + if (joinIndices[vindex] >= 0) + continue; // isDelete + + GridMap.AddGrid(localPositions[vindex], vindex, gridMap, gridSize); + } + } + } + + [BurstCompile] + struct SearchJoinJob : IJob + { + public int vcnt; + public float gridSize; + public float radius; + + [Unity.Collections.ReadOnly] + public NativeArray localPositions; + [Unity.Collections.ReadOnly] + public NativeArray joinIndices; + [Unity.Collections.ReadOnly] + public NativeParallelMultiHashMap gridMap; + + //public NativeParallelHashSet joinPairSet; + public NativeParallelMultiHashMap joinPairMap; + + public void Execute() + { + for (int vindex = 0; vindex < vcnt; vindex++) + { + if (joinIndices[vindex] >= 0) + continue; // isDelete + + float3 pos = localPositions[vindex]; + + // 範ċ›²‚°ƒŞƒƒƒ‰èµ°ĉŸğ + foreach (int3 grid in GridMap.GetArea(pos, radius, gridMap, gridSize)) + { + if (gridMap.ContainsKey(grid) == false) + continue; + + // “‚°ƒŞƒƒƒ‰‚’ĉ¤œç´˘™‚‹ + foreach (int tvindex in gridMap.GetValuesForKey(grid)) + { + // è‡ŞèşĞŻċĵ + if (tvindex == vindex) + continue; + + // è·é›˘ċˆ¤ċš + float3 tpos = localPositions[tvindex]; + float dist = math.distance(pos, tpos); + if (dist > radius) + continue; + + // 結ċˆç™ğ録 + //int2 ehash = DataUtility.PackInt2(vindex, tvindex); + //joinPairSet.Add(ehash); + joinPairMap.Add((ushort)vindex, (ushort)tvindex); + } + } + } + } + } + + [BurstCompile] + struct JoinJob2 : IJob + { + public int vertexCount; + + [Unity.Collections.ReadOnly] + public NativeParallelMultiHashMap joinPairMap; + + public NativeArray joinIndices; + public NativeParallelMultiHashMap vertexToVertexMap; + public NativeArray boneWeights; + public NativeArray attributes; + public NativeReference result; + + public NativeList tempList; + + public void Execute() + { + int cnt = 0; + + for (ushort vindexLive = 0; vindexLive < vertexCount; vindexLive++) + { + // ™§Ğ結ċˆĉ¸ˆżŞ‚‰‚ı‚­ƒƒƒ— + if (joinIndices[vindexLive] >= 0) + continue; + + // ċŻèħĦƒĞƒĵƒ— + foreach (ushort vindexDead in joinPairMap.GetValuesForKey(vindexLive)) + { + // ċŻèħĦŒ™§Ğ結ċˆšżŞ‚‰‚ı‚­ƒƒƒ— + if (joinIndices[vindexDead] >= 0) + continue; + + // 結ċˆ(vertexDead -> vertexLive) + joinIndices[vindexDead] = vindexLive; + cnt++; + + vertexToVertexMap.MC2RemoveValue(vindexLive, vindexDead); + + tempList.Clear(); + foreach (ushort i in vertexToVertexMap.GetValuesForKey(vindexDead)) + { + tempList.Add(i); + } + foreach (ushort i in tempList) + { + if (joinIndices[i] >= 0) + continue; + if (i == vindexLive || i == vindexDead) + continue; + + vertexToVertexMap.MC2RemoveValue(i, vindexDead); + + vertexToVertexMap.MC2UniqueAdd(vindexLive, i); + vertexToVertexMap.MC2UniqueAdd(i, vindexLive); + + // p2ĞBoneWeight‚’結ċˆ + var bw = boneWeights[vindexLive]; + bw.AddWeight(boneWeights[vindexDead]); + boneWeights[vindexLive] = bw; + + // ċħžĉ€§ + var attr1 = attributes[vindexDead]; + var attr2 = attributes[vindexLive]; + attributes[vindexLive] = VertexAttribute.JoinAttribute(attr1, attr2); + attributes[vindexDead] = VertexAttribute.Invalid; // ċ‰Šé™¤é ‚ç‚ıŻç„ĦċŠıĞ™‚‹ + } + } + } + + // ċ‰Šé™¤é ‚ç‚ıĉ•°è¨˜éŒ² + result.Value = cnt; + } + } + +#if false // old + [BurstCompile] + struct JoinJob : IJob + { + [Unity.Collections.ReadOnly] + public NativeParallelHashSet joinPairSet; + + public NativeArray joinIndices; + public NativeParallelMultiHashMap vertexToVertexMap; + public NativeArray boneWeights; + public NativeArray attributes; + public NativeReference result; + + public void Execute() + { + var workSet = new FixedList512Bytes(); + int cnt = 0; + + foreach (var ehash in joinPairSet) + { + int vindexLive = ehash[0]; // 生ċ­˜ċ´ + int vindexDead = ehash[1]; // ċ‰Šé™¤ċ´ + + while (joinIndices[vindexDead] >= 0) + { + vindexDead = joinIndices[vindexDead]; + } + while (joinIndices[vindexLive] >= 0) + { + vindexLive = joinIndices[vindexLive]; + } + if (vindexDead == vindexLive) + continue; + + // 結ċˆ(vertex1 -> vertex2) + joinIndices[vindexDead] = vindexLive; + cnt++; + + // ĉŽçĥšĉ•°‚’結ċˆ™‚‹ïĵˆé‡è¤‡Żċĵ‹‚Œ‚‹ïĵ‰ + workSet.Clear(); + foreach (ushort i in vertexToVertexMap.GetValuesForKey((ushort)vindexDead)) + { + int index = i; + // 生ċ­˜‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı + while (joinIndices[index] >= 0) + { + index = joinIndices[index]; + } + if (index != vindexDead && index != vindexLive) + workSet.MC2Set((ushort)index); + } + foreach (ushort i in vertexToVertexMap.GetValuesForKey((ushort)vindexLive)) + { + int index = i; + // 生ċ­˜‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı + while (joinIndices[index] >= 0) + { + index = joinIndices[index]; + } + if (index != vindexDead && index != vindexLive) + workSet.MC2Set((ushort)index); + } + vertexToVertexMap.Remove((ushort)vindexLive); + for (int i = 0; i < workSet.Length; i++) + { + vertexToVertexMap.Add((ushort)vindexLive, workSet[i]); + } + //Debug.Assert(workSet.Length > 0); + + // p2ĞBoneWeight‚’結ċˆ + var bw = boneWeights[vindexLive]; + bw.AddWeight(boneWeights[vindexDead]); + boneWeights[vindexLive] = bw; + + // ċħžĉ€§ + var attr1 = attributes[vindexDead]; + var attr2 = attributes[vindexLive]; + attributes[vindexLive] = VertexAttribute.JoinAttribute(attr1, attr2); + attributes[vindexDead] = VertexAttribute.Invalid; // ċ‰Šé™¤é ‚ç‚ıŻç„ĦċŠıĞ™‚‹ + } + + // ċ‰Šé™¤é ‚ç‚ıĉ•°è¨˜éŒ² + result.Value = cnt; + } + } +#endif + + //========================================================================================= + /// + /// ĉŽçĥšçŠĥĉ…‹‚’ĉœ€ĉ–°Ğĉ›´ĉ–°™‚‹‚¸ƒ§ƒ–‚’発èĦŒ™‚‹ + /// + /// + /// + void UpdateJoinAndLink() + { + // JoinIndexçŠĥĉ…‹‚’ĉ›´ĉ–°™‚‹€‚çċœ¨ĉœ€ĉ–°ç”Ÿċ­˜ƒ‚¤ƒ³ƒˆ‚’ĉŒ‡™‚ˆ†Ğċ¤‰ĉ›´™‚‹ + var updateJoinIndexJob = new UpdateJoinIndexJob() + { + joinIndices = workData.vertexJoinIndices, + }; + updateJoinIndexJob.Run(vmesh.VertexCount); + + // 頂ç‚ıĉŽçĥšé ‚ç‚ıƒŞ‚ıƒˆ‚’ĉœ€ĉ–°Ğĉ›´ĉ–°™‚‹€‚™ıĤĉœ€ĉ–°ç”Ÿċ­˜ƒ‚¤ƒ³ƒˆ‚’ĉŒ‡™‚ˆ†Ğċ¤‰ĉ›´™‚‹ + var updateLinkIndexJob = new UpdateLinkIndexJob() + { + joinIndices = workData.vertexJoinIndices, + vertexToVertexMap = workData.vertexToVertexMap, + }; + updateLinkIndexJob.Run(vmesh.VertexCount); + } + + [BurstCompile] + struct UpdateJoinIndexJob : IJobParallelFor + { + [NativeDisableParallelForRestriction] + public NativeArray joinIndices; + + public void Execute(int vindex) + { + int join = joinIndices[vindex]; + if (join >= 0) + { + // ċ‰Šé™¤•‚ŒĤ„‚‹ + // ĉœ€çµ‚çš„Şç”Ÿċ­˜ƒ‚¤ƒ³ƒˆĞ連結•›‚‹ + while (joinIndices[join] >= 0) + { + join = joinIndices[join]; + } + joinIndices[vindex] = join; + } + } + } + + [BurstCompile] + struct UpdateLinkIndexJob : IJobParallelFor + { + [NativeDisableParallelForRestriction] + public NativeArray joinIndices; + public NativeParallelMultiHashMap vertexToVertexMap; + + public void Execute(int vindex) + { + int join = joinIndices[vindex]; + + // è‡ŞèşĞŒċ‰Šé™¤•‚ŒĤ„‚‹ċ ´ċˆŻç„ĦèĤ– + if (join >= 0) + return; + + // è‡ŞèşĞŒç”Ÿċ­˜—Ĥ„‚‹ + // çċœ¨ĉŽçĥš‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı‹‚‰ċ‰Šé™¤•‚ŒŸ‚‚‚’生ċ­˜‚¤ƒ³ƒ‡ƒƒ‚Ż‚ıĞċ…‚Œĉ›żˆ‚‹ + var newLinkSet = new FixedList512Bytes(); + foreach (ushort i in vertexToVertexMap.GetValuesForKey((ushort)vindex)) + { + int tvindex = i; + int tjoin = joinIndices[tvindex]; + if (tjoin >= 0) + { + // ċ‰Šé™¤•‚ŒĤ„‚‹ + tvindex = tjoin; + Debug.Assert(joinIndices[tvindex] < 0); + } + + // è‡ŞèşĞŻċĵ + if (tvindex == vindex) + continue; + + newLinkSet.MC2Set((ushort)tvindex); + } + // 生ċ­˜żĉ–°—„‚ğƒƒƒˆĞċ…‚Œĉ›żˆ + vertexToVertexMap.Remove((ushort)vindex); + for (int i = 0; i < newLinkSet.Length; i++) + { + vertexToVertexMap.Add((ushort)vindex, newLinkSet[i]); + } + //Debug.Assert(newLinkSet.Length > 0); + } + } + + //========================================================================================= + /// + /// ƒŞƒ€‚Ż‚·ƒ§ƒ³ċŒƒ‡ƒĵ‚ż‚’ĉ•´ˆ‚‹ + /// + void UpdateReductionResultJob() + { + // 頂ç‚ıĉ³•ç·šċ˜ä½ċŒ–€Š‚ˆ³ƒœƒĵƒ³‚Ĥ‚¨‚¤ƒˆ‚’ïĵ‘Ğĉ•´ˆ‚‹ + var finalVertexJob = new FinalMergeVertexJob() + { + joinIndices = workData.vertexJoinIndices, + localNormals = vmesh.localNormals.GetNativeArray(), + boneWeights = vmesh.boneWeights.GetNativeArray(), + }; + finalVertexJob.Run(vmesh.VertexCount); + } + + [BurstCompile] + struct FinalMergeVertexJob : IJobParallelFor + { + [Unity.Collections.ReadOnly] + public NativeArray joinIndices; + + public NativeArray localNormals; + public NativeArray boneWeights; + + // 頂ç‚ı”¨ + public void Execute(int vindex) + { + int join = joinIndices[vindex]; + if (join >= 0) + { + // ċ‰Šé™¤•‚ŒĤ„‚‹ + return; + } + + // ĉ³•ç·šċ˜ä½ċŒ– + localNormals[vindex] = math.normalize(localNormals[vindex]); + + // ƒœƒĵƒ³‚Ĥ‚¨‚¤ƒˆ‚’ċı³ċ‡ċŒ– + var bw = boneWeights[vindex]; + bw.AdjustWeight(); + boneWeights[vindex] = bw; + } + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Reduction/SameDistanceReduction.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Reduction/SameDistanceReduction.cs.meta new file mode 100644 index 00000000..adceda8f --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Reduction/SameDistanceReduction.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 9a8f11c168bca19409d6e7cec1de9fc8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Reduction/SameDistanceReduction.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Reduction/ShapeDistanceReduction.cs b/Assets/MagicaCloth2/Scripts/Core/Reduction/ShapeDistanceReduction.cs new file mode 100644 index 00000000..12b5973d --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Reduction/ShapeDistanceReduction.cs @@ -0,0 +1,145 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using Unity.Burst; +using Unity.Collections; +using Unity.Jobs; +using Unity.Mathematics; + +namespace MagicaCloth2 +{ + /// + /// ċ½˘çŠĥĞċˆ‚›Ÿé ‚ç‚ıƒŞƒ€‚Ż‚·ƒ§ƒ³ + /// “ƒŞƒ€‚Ż‚·ƒ§ƒ³Żé ‚ç‚ıĉŽçĥšçŠĥĉ…‹Ğĉ²ż£ĤƒŞƒ€‚Ż‚·ƒ§ƒ³‚’èĦŒ† + /// + public class ShapeDistanceReduction : StepReductionBase + { + //========================================================================================= + public ShapeDistanceReduction( + string name, + VirtualMesh mesh, + ReductionWorkData workingData, + float startMergeLength, + float endMergeLength, + int maxStep, + bool dontMakeLine, + float joinPositionAdjustment + ) + : base($"ShapeReduction [{name}]", mesh, workingData, startMergeLength, endMergeLength, maxStep, dontMakeLine, joinPositionAdjustment) + { + } + + public override void Dispose() + { + base.Dispose(); + } + + protected override void StepInitialize() + { + base.StepInitialize(); + } + + protected override void CustomReductionStep() + { + // èż‘ċ‚ƒš‚˘‚’ĉ¤œç´˘€çµċˆ‚¨ƒƒ‚¸ƒŞ‚ıƒˆĞç™ğ録 + var searchJob = new SearchJoinEdgeJob() + { + vcnt = vmesh.VertexCount, + radius = nowMergeLength, + dontMakeLine = dontMakeLine, + localPositions = vmesh.localPositions.GetNativeArray(), + joinIndices = workData.vertexJoinIndices, + //vertexToVertexArray = workData.vertexToVertexArray, + vertexToVertexMap = workData.vertexToVertexMap, + joinEdgeList = joinEdgeList, + }; + searchJob.Run(); + } + + [BurstCompile] + struct SearchJoinEdgeJob : IJob + { + public int vcnt; + public float radius; + public bool dontMakeLine; + + [Unity.Collections.ReadOnly] + public NativeArray localPositions; + [Unity.Collections.ReadOnly] + public NativeArray joinIndices; + [Unity.Collections.ReadOnly] + public NativeParallelMultiHashMap vertexToVertexMap; + //public NativeArray> vertexToVertexArray; + + public NativeList joinEdgeList; + + public void Execute() + { + for (int vindex = 0; vindex < vcnt; vindex++) + { + if (joinIndices[vindex] >= 0) + continue; // isDelete + + // ĉŽçĥšé ‚ç‚ıƒŞ‚ıƒˆ + int vcnt = vertexToVertexMap.CountValuesForKey((ushort)vindex); + if (vcnt == 0) + continue; // ĉŽçĥšŞ— + //var vlist = vertexToVertexArray[vindex]; + //if (vlist.Count == 0) + // continue; // ĉŽçĥšŞ— + + float3 pos = localPositions[vindex]; + + // è‡ŞèşĞĉŽçĥšé ‚ç‚ıĉ•° + //float linkCount = math.max(vlist.Count - 1, 1); + float linkCount = math.max(vcnt - 1, 1); + + // 範ċ›²ċ†…§ĉœ€‚‚‚³‚ıƒˆŒä½Ž„ĉŽçĥšƒš‚˘‚’ç™ğ録™‚‹ + float minCost = float.MaxValue; + int minVindex = -1; + //for (int i = 0; i < vlist.Count; i++) + foreach (ushort tvindex in vertexToVertexMap.GetValuesForKey((ushort)vindex)) + { + //int tvindex = vlist.Get(i); + + // è·é›˘ċˆ¤ċš + float3 tpos = localPositions[tvindex]; + float dist = math.distance(pos, tpos); + if (dist > radius) + continue; + + // 相ĉ‰‹ĉŽçĥšé ‚ç‚ıĉ•° + float tlinkCount = math.max(vertexToVertexMap.CountValuesForKey(tvindex) - 1, 1); + //var tvlist = vertexToVertexArray[tvindex]; + //float tlinkCount = math.max(tvlist.Count - 1, 1); + + // “é ‚ç‚ı‚’結ċˆ—Ĥċ•éĦŒŒŞ„‹èŞżı‚‹ + //if (CheckJoin(vertexToVertexArray, vindex, tvindex, vlist, tvlist, dontMakeLine) == false) + if (CheckJoin2(vertexToVertexMap, vindex, tvindex, dontMakeLine) == false) + continue; + + // ‚³‚ıƒˆè¨ˆç— + float cost = dist * (1.0f + (linkCount + tlinkCount) / 2.0f); // ¨‚Ё‚ˆš + + // ĉœ€ċ°‚³‚ıƒˆċˆ¤ċš + if (cost < minCost) + { + minCost = cost; + minVindex = tvindex; + } + } + if (minVindex >= 0) + { + // ç™ğ録 + var pair = new JoinEdge() + { + vertexPair = new int2(vindex, minVindex), + cost = minCost, + }; + joinEdgeList.Add(pair); + } + } + } + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Reduction/ShapeDistanceReduction.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Reduction/ShapeDistanceReduction.cs.meta new file mode 100644 index 00000000..64c37c81 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Reduction/ShapeDistanceReduction.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 2b8b32d329a0b2541afe170d131c5f76 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Reduction/ShapeDistanceReduction.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Reduction/SimpleDistanceReduction.cs b/Assets/MagicaCloth2/Scripts/Core/Reduction/SimpleDistanceReduction.cs new file mode 100644 index 00000000..a9d39564 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Reduction/SimpleDistanceReduction.cs @@ -0,0 +1,182 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using Unity.Burst; +using Unity.Collections; +using Unity.Jobs; +using Unity.Mathematics; + +namespace MagicaCloth2 +{ + /// + /// ċ˜ç´”Şé ‚ç‚ı間è·é›˘Ğ‚ˆ‚‹ƒŞƒ€‚Ż‚·ƒ§ƒ³ + /// “ƒŞƒ€‚Ż‚·ƒ§ƒ³Żé ‚ç‚ıĉŽçĥšçŠĥĉ…‹‚’ç„ĦèĤ–™‚‹ + /// + public class SimpleDistanceReduction : StepReductionBase + { + /// + /// ‚°ƒŞƒƒƒ‰ƒžƒƒƒ— + /// + private GridMap gridMap; + + //========================================================================================= + public SimpleDistanceReduction( + string name, + VirtualMesh mesh, + ReductionWorkData workingData, + float startMergeLength, + float endMergeLength, + int maxStep, + bool dontMakeLine, + float joinPositionAdjustment + ) + : base($"SimpleDistanceReduction [{name}]", mesh, workingData, startMergeLength, endMergeLength, maxStep, dontMakeLine, joinPositionAdjustment) + { + } + + public override void Dispose() + { + base.Dispose(); + gridMap.Dispose(); + } + + protected override void StepInitialize() + { + base.StepInitialize(); + gridMap = new GridMap(vmesh.VertexCount); + } + + protected override void CustomReductionStep() + { + // ĉœ€éİŞ‚°ƒŞƒƒƒ‰‚µ‚¤‚ş‚’ċ‰²‚Šċ‡ş™(nowMergeLengthŻ>0Œäżè¨ĵ•‚ŒĤ„‚‹) + float gridSize = nowMergeLength * 2.0f; // 1.5? + + // 作ĉ­ç”¨ƒƒƒƒ•‚Ħ‚ŻƒŞ‚˘ + gridMap.GetMultiHashMap().Clear(); + + // ƒ‚¤ƒ³ƒˆ‚’‚°ƒŞƒƒƒ‰Ğç™ğ録 + var initGridJob = new InitGridJob() + { + vcnt = vmesh.VertexCount, + gridSize = gridSize, + localPositions = vmesh.localPositions.GetNativeArray(), + joinIndices = workData.vertexJoinIndices, + gridMap = gridMap.GetMultiHashMap(), + }; + initGridJob.Run(); + + // èż‘ċ‚ƒ‚¤ƒ³ƒˆ‚’ĉ¤œç´˘€çµċˆ‚¨ƒƒ‚¸ƒŞ‚ıƒˆĞç™ğ録 + var searchJob = new SearchJoinEdgeJob() + { + vcnt = vmesh.VertexCount, + gridSize = gridSize, + radius = nowMergeLength, + localPositions = vmesh.localPositions.GetNativeArray(), + joinIndices = workData.vertexJoinIndices, + vertexToVertexMap = workData.vertexToVertexMap, // cost用 + gridMap = gridMap.GetMultiHashMap(), + joinEdgeList = joinEdgeList, + }; + searchJob.Run(); + } + + [BurstCompile] + struct InitGridJob : IJob + { + public int vcnt; + public float gridSize; + + [Unity.Collections.ReadOnly] + public NativeArray localPositions; + [Unity.Collections.ReadOnly] + public NativeArray joinIndices; + + public NativeParallelMultiHashMap gridMap; + + // 頂ç‚ı”¨ + public void Execute() + { + for (int vindex = 0; vindex < vcnt; vindex++) + { + if (joinIndices[vindex] >= 0) + continue; // isDelete + + GridMap.AddGrid(localPositions[vindex], vindex, gridMap, gridSize); + } + } + } + + [BurstCompile] + struct SearchJoinEdgeJob : IJob + { + public int vcnt; + public float gridSize; + public float radius; + + [Unity.Collections.ReadOnly] + public NativeArray localPositions; + [Unity.Collections.ReadOnly] + public NativeArray joinIndices; + + [Unity.Collections.ReadOnly] + public NativeParallelMultiHashMap vertexToVertexMap; + [Unity.Collections.ReadOnly] + public NativeParallelMultiHashMap gridMap; + + [Unity.Collections.WriteOnly] + public NativeList joinEdgeList; + + // 頂ç‚ı”¨ + public void Execute() + { + for (int vindex = 0; vindex < vcnt; vindex++) + { + if (joinIndices[vindex] >= 0) + continue; // isDelete + + float3 pos = localPositions[vindex]; + + // è‡ŞèşĞĉŽçĥšé ‚ç‚ıĉ•° + float linkCount = math.max(vertexToVertexMap.CountValuesForKey((ushort)vindex) - 1, 1); + + // 範ċ›²‚°ƒŞƒƒƒ‰èµ°ĉŸğ + foreach (int3 grid in GridMap.GetArea(pos, radius, gridMap, gridSize)) + { + if (gridMap.ContainsKey(grid) == false) + continue; + + // “‚°ƒŞƒƒƒ‰‚’ĉ¤œç´˘™‚‹ + foreach (int tindex in gridMap.GetValuesForKey(grid)) + { + // è‡ŞèşĞŻċĵ + if (tindex == vindex) + continue; + + // è·é›˘ċˆ¤ċš + float3 tpos = localPositions[tindex]; + float dist = math.distance(pos, tpos); + if (dist > radius) + continue; + + // 相ĉ‰‹ĉŽçĥšé ‚ç‚ıĉ•° + float tlinkCount = math.max(vertexToVertexMap.CountValuesForKey((ushort)tindex) - 1, 1); + + // ‚³‚ıƒˆè¨ˆç— + //float cost = dist / (linkCount + tlinkCount); // todo:¨‚Ё‚ˆšƒ†‚ıƒˆ + //float cost = dist * (1.0f / (linkCount + tlinkCount)); + float cost = dist * (1.0f + (linkCount + tlinkCount) / 2.0f); // 12 + + // ċ…¨éƒ¨ç™ğ録 + var pair = new JoinEdge() + { + vertexPair = new int2(vindex, tindex), + cost = cost, + }; + joinEdgeList.Add(pair); + } + } + } + } + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Reduction/SimpleDistanceReduction.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Reduction/SimpleDistanceReduction.cs.meta new file mode 100644 index 00000000..dc65c991 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Reduction/SimpleDistanceReduction.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: b244c982dfa4761478be41f4a264d73e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Reduction/SimpleDistanceReduction.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Reduction/StepReductionBase.cs b/Assets/MagicaCloth2/Scripts/Core/Reduction/StepReductionBase.cs new file mode 100644 index 00000000..b4e09a24 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Reduction/StepReductionBase.cs @@ -0,0 +1,773 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System; +using Unity.Burst; +using Unity.Collections; +using Unity.Jobs; +using Unity.Mathematics; +using UnityEngine; +#if MAGICACLOTH2_REDUCTION_DEBUG +using UnityEngine; +#endif + +namespace MagicaCloth2 +{ + /// + /// 結ċˆè·é›˘‚’ĉ‹Ħċ¤§•›ŞŒ‚‰ĉµéšŽçš„ĞƒŞƒ€‚Ż‚·ƒ§ƒ³™‚‹ĉ–ıċĵƒ™ƒĵ‚ı‚Żƒİ‚ı + /// éИ速ċŒ–Ÿ‚çµċˆċ€™è£œƒš‚˘†Ħ頂ç‚ıŒè˘Ğ‚‰Ş„‚‚‚’ïĵ‘ċ›ž‚ıƒ†ƒƒƒ—§™ıĤ結ċˆ•›‚‹€‚ + /// “Ÿ‚çµċˆè·é›˘ċ†…Ğ‚‚‹‹‚‚‰šçµċˆ•‚ŒŞ„ƒš‚˘Œç™şç”Ÿ™‚‹“¨ĞŞ‚‹€‚ + /// “ċ•éĦŒŻĉ‰‹é †‚’複ĉ•°ċŻċŸèĦŒ™‚‹“¨§ċ€…ĞċŽĉŸ•›Ĥè§£ĉħş™‚‹€‚ + /// + public abstract class StepReductionBase : IDisposable + { + protected string name = string.Empty; + protected VirtualMesh vmesh; + protected ReductionWorkData workData; + protected ResultCode result; + + protected float startMergeLength; + protected float endMergeLength; + protected int maxStep; + protected bool dontMakeLine; + protected float joinPositionAdjustment; + + protected int nowStepIndex; + protected float nowMergeLength; + protected float nowStepScale; + + //========================================================================================= + /// + /// 結ċˆ‚¨ƒƒ‚¸ĉƒ…ċ ħ + /// + public struct JoinEdge : IComparable + { + public int2 vertexPair; + public float cost; + + public bool Contains(in int2 pair) + { + if (vertexPair.x == pair.x || vertexPair.x == pair.y || vertexPair.y == pair.x || vertexPair.y == pair.y) + return true; + else + return false; + } + + public int CompareTo(JoinEdge other) + { + // ‚³‚ıƒˆĉ˜‡é † + if (cost != other.cost) + return cost < other.cost ? -1 : 1; + else + return 0; + } + } + protected NativeList joinEdgeList; + + // ™§Ğ結ċˆ•‚ŒŸé ‚ç‚ı‚ğƒƒƒˆ + private NativeParallelHashSet completeVertexSet; + + // 結ċˆ•‚ŒŸé ‚ç‚ıƒš‚˘(x->y¸çµċˆ) + private NativeList removePairList; + + // ‚ıƒ†ƒƒƒ—”¨ċ‰Šĉ¸›é ‚ç‚ıĉ•° + private NativeArray resultArray; + + //========================================================================================= + public StepReductionBase() { } + + public StepReductionBase( + string name, + VirtualMesh mesh, + ReductionWorkData workingData, + float startMergeLength, + float endMergeLength, + int maxStep, + bool dontMakeLine, + float joinPositionAdjustment + ) + { + this.name = name; + this.vmesh = mesh; + this.workData = workingData; + this.result = ResultCode.None; + this.startMergeLength = math.max(startMergeLength, 1e-09f); + this.endMergeLength = math.max(endMergeLength, 1e-09f); + this.maxStep = math.min(maxStep, 100); + this.dontMakeLine = dontMakeLine; + this.joinPositionAdjustment = joinPositionAdjustment; + } + + public virtual void Dispose() + { + if (joinEdgeList.IsCreated) + joinEdgeList.Dispose(); + if (completeVertexSet.IsCreated) + completeVertexSet.Dispose(); + if (removePairList.IsCreated) + removePairList.Dispose(); + if (resultArray.IsCreated) + resultArray.Dispose(); + } + + public ResultCode Result => result; + + //========================================================================================= + /// + /// ƒŞƒ€‚Ż‚·ƒ§ƒ³ċŸèĦŒïĵˆ‚ıƒĴƒƒƒ‰ċŻïĵ‰ + /// + /// + public ResultCode Reduction() + { + //bool success = false; + result.Clear(); + + try + { + // ‚ıƒ†ƒƒƒ—ċ‰ċˆĉœŸċŒ– + StepInitialize(); + + // 開ċ§‹çŻ„ċ›²‹‚‰çµ‚了範ċ›²§‚’ċŠċ„‚’ĉ‹Ħċ¤§Ğ—ŞŒ‚‰ċŸèĦŒ™‚‹ + InitStep(); + while (nowStepIndex < maxStep) + { + // ƒŞƒ€‚Ż‚·ƒ§ƒ³‚ıƒ†ƒƒƒ—ċŸèĦŒ + ReductionStep(); + + nowStepIndex++; + if (IsEndStep()) + break; + NextStep(); + } + // ĉœ€ċŒĞèż½ċŠ §ĉ•°ċ›žċŸèĦŒ™‚‹ïĵˆĉ‹‚Šç‰İċ‡Ĥ理ïĵ‰ + if (nowStepIndex < maxStep) + { + // ƒŞƒ€‚Ż‚·ƒ§ƒ³‚ıƒ†ƒƒƒ—ċŸèĦŒ + ReductionStep(); + nowStepIndex++; + } + + //Debug.Log(nowStepIndex); + + // 頂ç‚ıĉƒ…ċ ħ‚’ĉ•´ç†™‚‹ + // ĉ³•ç·šċ˜ä½ċŒ– + // ƒœƒĵƒ³‚Ĥ‚¨‚¤ƒˆ‚’ïĵ‘Ğċı³ċ‡ċŒ– + UpdateReductionResultJob(); + + // ċ‰Šé™¤é ‚ç‚ıĉ•°é›†è¨ˆ + int removeVertexCount = 0; + for (int i = 0; i < nowStepIndex; i++) + { + removeVertexCount += resultArray[i]; + //Debug.Log($"[Step:{i + 1}] => {resultArray[i]}"); + } + workData.removeVertexCount += removeVertexCount; + + // ċŒäş† + //success = true; + result.SetSuccess(); + } + catch (Exception exception) + { + Debug.LogError(exception); + if (result.IsError() == false) + { + if (this is SimpleDistanceReduction) + result.SetError(Define.Result.Reduction_SimpleDistanceException); + else if (this is ShapeDistanceReduction) + result.SetError(Define.Result.Reduction_ShapeDistanceException); + else + result.SetError(Define.Result.Reduction_Exception); + } + } + finally + { + // 作ĉ­ƒƒƒƒ•‚Ħ‚’è§£ĉ”™‚‹ïĵˆé‡èĤïĵ‰ + // ★äğĞ‚ż‚ı‚݁Œä‹ċ¤–‚„‚­ƒ£ƒ³‚ğƒĞ•‚ŒŸ¨—Ĥ‚‚“‚Œ§ä½œĉˆ—Ÿƒƒƒƒ•‚ĦŻĉ­£—Dispose()•‚Œ‚‹ + //MagicaManager.Discard.Add(); + + // ç™ğ録—Ÿ‚¸ƒ§ƒ–‚’解除™‚‹ïĵˆé‡èĤïĵ‰ + // ★äğĞ‚ż‚ı‚݁Œä‹ċ¤–‚„‚­ƒ£ƒ³‚ğƒĞ•‚ŒŸ¨—Ĥ‚‚“‚Œ§ç™şèĦŒ—ŸJobŻĉ­£—Complete()•‚Œ‚‹ + //MagicaManager.Thread.DisposeJob(int); + } + + return result; + } + + void InitStep() + { + nowStepIndex = 0; + nowMergeLength = startMergeLength; + nowStepScale = 2.0f; + } + + bool IsEndStep() + { + return nowMergeLength == endMergeLength; + } + + void NextStep() + { + nowStepScale = math.max(nowStepScale * 0.93f, 1.1f); + nowMergeLength = math.min(nowMergeLength * nowStepScale, endMergeLength); + } + + /// + /// ƒŞƒ€‚Ż‚·ƒ§ƒ³‚ıƒ†ƒƒƒ—ċ‡Ĥ理 + /// + /// + /// + /// + /// + /// + void ReductionStep() + { + //Debug.Log($"nowMergeLength:{nowMergeLength}"); + + // ‚ıƒ†ƒƒƒ—ċ‰ċ‡Ĥ理 + // 結ċˆƒš‚˘ƒŞ‚ıƒˆ‚ŻƒŞ‚˘ + PreReductionStep(); + + // 結ċˆƒš‚˘èż½ċŠ  + CustomReductionStep(); + + // ‚ıƒ†ƒƒƒ—ċŒċ‡Ĥ理 + // 結ċˆƒš‚˘ƒŞ‚ıƒˆ‹‚‰é ‚ç‚ıŒè˘Ğ‚‰Ş„ƒš‚˘‚’ĉ‘˜ċ‡ş—結ċˆ‚’ċŸèĦŒ™‚‹ + // 結ċˆċŒĞ頂ç‚ıĉŽçĥšçŠĥĉ…‹‚’ĉœ€ĉ–°Ğĉ›´ĉ–°™‚‹ + PostReductionStep(); + } + + //========================================================================================= + /// + /// ‚ıƒ†ƒƒƒ—ċ‡Ĥ理ċ‰ċˆĉœŸċŒ– + /// “é–˘ĉ•°‚’‚ރĵƒƒĵƒİ‚¤ƒ‰—ċż…èĤŞ‚ıƒ†ƒƒƒ—ċ‰ċˆĉœŸċŒ–‚’èż½ċŠ ™‚‹ + /// + protected virtual void StepInitialize() + { + int vcnt = vmesh.VertexCount; + joinEdgeList = new NativeList(vcnt / 4, Allocator.Persistent); + completeVertexSet = new NativeParallelHashSet(vcnt, Allocator.Persistent); + removePairList = new NativeList(vcnt, Allocator.Persistent); + resultArray = new NativeArray(maxStep, Allocator.Persistent); + } + + /// + /// “é–˘ĉ•°‚’‚ރĵƒƒĵƒİ‚¤ƒ‰—joinEdgeListĞċ‰Šé™¤ċ€™è£œƒš‚˘‚’èż½ċŠ ™‚‹ċ‡Ĥ理‚’è¨˜èż°™‚‹ + /// + /// + /// + protected virtual void CustomReductionStep() + { + } + + //========================================================================================= + /// + /// ƒŞƒ€‚Ż‚·ƒ§ƒ³‚ıƒ†ƒƒƒ—ċ‰ċ‡Ĥ理 + /// + /// + /// + void PreReductionStep() + { + // 作ĉ­ç”¨ƒƒƒƒ•‚Ħ‚ŻƒŞ‚˘ + joinEdgeList.Clear(); + } + + //========================================================================================= + /// + /// ƒŞƒ€‚Ż‚·ƒ§ƒ³‚ıƒ†ƒƒƒ—ċŒċ‡Ĥ理 + /// + /// + /// + void PostReductionStep() + { + // 結ċˆċ€™è£œ‚’‚½ƒĵƒˆ™‚‹ + SortJoinEdge(); + + // 結ċˆƒŞ‚ıƒˆ‚’作ĉˆ™‚‹ + DetermineJoinEdge(); + + // 結ċˆ‚’ċŸèĦŒ™‚‹ + RunJoinEdge(); + + // 頂ç‚ıĉŽçĥšçŠĥĉ…‹‚’ĉœ€ĉ–°Ğĉ›´ĉ–°™‚‹€‚™ıĤĉœ€ĉ–°ç”Ÿċ­˜ƒ‚¤ƒ³ƒˆ‚’ĉŒ‡™‚ˆ†Ğċ¤‰ĉ›´™‚‹ + UpdateJoinAndLink(); + + //Debug.Log($"[{name}] Step:{nowStepIndex} mergeLength:{nowMergeLength} RemoveVertex:{resultArray[nowStepIndex]}"); + } + + //========================================================================================= + /// + /// 結ċˆċ€™è£œƒš‚˘ƒŞ‚ıƒˆ‚’‚³‚ıƒˆĉ˜‡é †§‚½ƒĵƒˆ™‚‹‚¸ƒ§ƒ–‚’発èĦŒ™‚‹ + /// + /// + /// + void SortJoinEdge() + { + // ‚³‚ıƒˆĉ˜‡é †§‚½ƒĵƒˆ™‚‹ + joinEdgeList.Sort(); + } + + //========================================================================================= + /// + /// 結ċˆċ€™è£œ‹‚‰è·é›˘é †ä½Ğ頂ç‚ıŒè˘Ğ‚‰Ş„‚ˆ†Ğ結ċˆƒš‚˘‚’選ĉŠž™‚‹‚¸ƒ§ƒ–‚’発èĦŒ™‚‹ + /// 頂ç‚ıŒè˘Ğ‚‰Ş„§“‚Œ‚‰ƒš‚˘Żä¸Ĥċˆ—Ğ結ċˆċ‡Ĥ理‚’èĦŒ£Ĥ‚‚ċ•éĦŒŞŞ‚‹ + /// + /// + /// + void DetermineJoinEdge() + { + var reductionJob = new DeterminJoinEdgeJob() + { + stepIndex = nowStepIndex, + mergeLength = nowMergeLength, + joinEdgeList = joinEdgeList, + completeVertexSet = completeVertexSet, + removePairList = removePairList, + resultArray = resultArray, + }; + reductionJob.Run(); + //Debug.Log($"Step:{nowStepIndex} mergeLength:{nowMergeLength} RemoveVertex:{resultArray[nowStepIndex]}"); + } + + [BurstCompile] + struct DeterminJoinEdgeJob : IJob + { + public int stepIndex; + public float mergeLength; + + [Unity.Collections.ReadOnly] + public NativeList joinEdgeList; + + public NativeParallelHashSet completeVertexSet; + public NativeList removePairList; + public NativeArray resultArray; + + public void Execute() + { + // ™§Ğ結ċˆ•‚ŒŸé ‚ç‚ı‚ğƒƒƒˆ + completeVertexSet.Clear(); + removePairList.Clear(); + + int cnt = 0; + for (int i = 0; i < joinEdgeList.Length; i++) + { + var joinEdge = joinEdgeList[i]; + var vertexPair = joinEdge.vertexPair; + + // 頂ç‚ıŒ™§Ğ結ċˆ•‚ŒĤ„‚‹Ş‚‰°‚ı‚­ƒƒƒ—™‚‹ + if (completeVertexSet.Contains(vertexPair.x) || completeVertexSet.Contains(vertexPair.y)) + continue; + + // “‚¨ƒƒ‚¸‚’結ċˆ™‚‹ + // 結ċˆƒŞ‚ıƒˆĞèż½ċŠ ™‚‹ + removePairList.Add(vertexPair.xy); + + // ċ‡Ĥ理ĉ¸ˆżƒžƒƒƒ—Ğèż½ċŠ  + completeVertexSet.Add(vertexPair.x); + completeVertexSet.Add(vertexPair.y); + + cnt++; + } + + // ċ‰Šĉ¸›é ‚ç‚ıĉ•°‚’保ċ­˜ + resultArray[stepIndex] = cnt; + + } + } + + //========================================================================================= + /// + /// 結ċˆƒš‚˘‚’ċŸéš›Ğ結ċˆ™‚‹‚¸ƒ§ƒ–‚’発èĦŒ™‚‹ + /// + /// + /// + void RunJoinEdge() + { + var organizeJoinEdgeJob = new JoinPairJob() + { + joinPositionAdjustment = joinPositionAdjustment, + removePairList = removePairList, + localPositions = vmesh.localPositions.GetNativeArray(), + localNormals = vmesh.localNormals.GetNativeArray(), + joinIndices = workData.vertexJoinIndices, + vertexToVertexMap = workData.vertexToVertexMap, + boneWeights = vmesh.boneWeights.GetNativeArray(), + attributes = vmesh.attributes.GetNativeArray(), + }; + organizeJoinEdgeJob.Run(); + } + + [BurstCompile] + struct JoinPairJob : IJob + { + public float joinPositionAdjustment; + + [Unity.Collections.ReadOnly] + public NativeList removePairList; + + public NativeArray localPositions; + public NativeArray localNormals; + public NativeParallelMultiHashMap vertexToVertexMap; + public NativeArray boneWeights; + public NativeArray attributes; + + public NativeArray joinIndices; + + public void Execute() + { + for (int index = 0; index < removePairList.Length; index++) + { + int2 pair = removePairList[index]; + + // pair.x -> pair.yĞ結ċˆ™‚‹ + int vindex1 = pair.x; + int vindex2 = pair.y; + float3 pos1 = localPositions[vindex1]; + float3 pos2 = localPositions[vindex2]; + float3 nor1 = localNormals[vindex1]; + float3 nor2 = localNormals[vindex2]; + + // vertex2Ğvertex1‚’結ċˆ—€vertex1Żċ‰Šé™¤¨—Ĥƒžƒĵ‚݁™‚‹ + // 結ċˆ(vertex1 -> vertex2) + joinIndices[vindex1] = vindex2; + + // vertex2ĉ–°—„ċş§ĉ¨™ + // ċ„é ‚ç‚ıĉŽçĥšĉ•°Ğċżœ˜Ĥ結ċˆä½ç½‚Ĥ‚¨‚¤ƒˆ‚’ċ¤‰ˆ‚‹ïĵˆĉŽçĥšĉ•°Œċ¤š„ğİċ‹•‹Ş„ïĵ‰ + float linkCnt1 = math.max(vertexToVertexMap.CountValuesForKey((ushort)vindex1) - 1, 1); // ĉŽçĥšƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ‚’ĉƒ³ċš—Ĥïĵ‘‚’ċĵ• + float linkCnt2 = math.max(vertexToVertexMap.CountValuesForKey((ushort)vindex2) - 1, 1); // ĉŽçĥšƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ‚’ĉƒ³ċš—Ĥïĵ‘‚’ċĵ• + float ratio = linkCnt2 / (linkCnt1 + linkCnt2); + + // 頂ç‚ıĉŽċˆä½ç½ƒĤƒĵ‚ĥƒĵèŞżĉ•´(1.0ċ ´ċˆŻċı³ċ‡ä½ç½ĞŞ‚‹ïĵ‰ + ratio = math.lerp(ratio, 0.5f, joinPositionAdjustment); + + // p2ċş§ĉ¨™‚’ċ¤‰ĉ›´ + float3 newpos = math.lerp(pos2, pos1, ratio); + localPositions[vindex2] = newpos; + localNormals[vindex2] = (nor1 + nor2); + + // ĉŽçĥšĉ•°‚’結ċˆ™‚‹ïĵˆé‡è¤‡Żċĵ‹‚Œ‚‹ïĵ‰ + var newLink = new FixedList512Bytes(); + foreach (ushort nindex in vertexToVertexMap.GetValuesForKey((ushort)vindex1)) + { + if (nindex != vindex1 && nindex != vindex2) + newLink.MC2Set(nindex); + } + foreach (ushort nindex in vertexToVertexMap.GetValuesForKey((ushort)vindex2)) + { + if (nindex != vindex1 && nindex != vindex2) + newLink.MC2Set(nindex); + } + vertexToVertexMap.Remove((ushort)vindex2); + for (int i = 0; i < newLink.Length; i++) + { + vertexToVertexMap.Add((ushort)vindex2, newLink[i]); + } + //Debug.Assert(newLink.Length > 0); + + // p2ĞBoneWeight‚’結ċˆ + var bw = boneWeights[vindex2]; + bw.AddWeight(boneWeights[vindex1]); + boneWeights[vindex2] = bw; + + // 頂ç‚ıċħžĉ€§ + var attr1 = attributes[vindex1]; + var attr2 = attributes[vindex2]; + attributes[vindex2] = VertexAttribute.JoinAttribute(attr1, attr2); + attributes[vindex1] = VertexAttribute.Invalid; // ċ‰Šé™¤é ‚ç‚ıŻç„ĦċŠıĞ™‚‹ + } + } + } + + //========================================================================================= + /// + /// ĉŽçĥšçŠĥĉ…‹‚’ĉœ€ĉ–°Ğĉ›´ĉ–°™‚‹‚¸ƒ§ƒ–‚’発èĦŒ™‚‹ + /// + /// + /// + void UpdateJoinAndLink() + { + // JoinIndexçŠĥĉ…‹‚’ĉ›´ĉ–°™‚‹€‚çċœ¨ĉœ€ĉ–°ç”Ÿċ­˜ƒ‚¤ƒ³ƒˆ‚’ĉŒ‡™‚ˆ†Ğċ¤‰ĉ›´™‚‹ + var updateJoinIndexJob = new UpdateJoinIndexJob() + { + joinIndices = workData.vertexJoinIndices, + }; + updateJoinIndexJob.Run(vmesh.VertexCount); + + // 頂ç‚ıĉŽçĥšé ‚ç‚ıƒŞ‚ıƒˆ‚’ĉœ€ĉ–°Ğĉ›´ĉ–°™‚‹€‚™ıĤĉœ€ĉ–°ç”Ÿċ­˜ƒ‚¤ƒ³ƒˆ‚’ĉŒ‡™‚ˆ†Ğċ¤‰ĉ›´™‚‹ + var updateLinkIndexJob = new UpdateLinkIndexJob() + { + joinIndices = workData.vertexJoinIndices, + vertexToVertexMap = workData.vertexToVertexMap, + }; + updateLinkIndexJob.Run(vmesh.VertexCount); + } + + [BurstCompile] + struct UpdateJoinIndexJob : IJobParallelFor + { + [NativeDisableParallelForRestriction] + public NativeArray joinIndices; + + public void Execute(int vindex) + { + int join = joinIndices[vindex]; + if (join >= 0) + { + // ċ‰Šé™¤•‚ŒĤ„‚‹ + // ĉœ€çµ‚çš„Şç”Ÿċ­˜ƒ‚¤ƒ³ƒˆĞ連結•›‚‹ + while (joinIndices[join] >= 0) + { + join = joinIndices[join]; + } + joinIndices[vindex] = join; + } + } + } + + [BurstCompile] + struct UpdateLinkIndexJob : IJobParallelFor + { + [NativeDisableParallelForRestriction] + public NativeArray joinIndices; + + public NativeParallelMultiHashMap vertexToVertexMap; + + public void Execute(int vindex) + { + int join = joinIndices[vindex]; + + // è‡ŞèşĞŒċ‰Šé™¤•‚ŒĤ„‚‹ċ ´ċˆŻç„ĦèĤ– + if (join >= 0) + return; + + // è‡ŞèşĞŒç”Ÿċ­˜—Ĥ„‚‹ + // çċœ¨ĉŽçĥš‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı‹‚‰ċ‰Šé™¤•‚ŒŸ‚‚‚’生ċ­˜‚¤ƒ³ƒ‡ƒƒ‚Ż‚ıĞċ…‚Œĉ›żˆ‚‹ + var newLinkSet = new FixedList512Bytes(); + foreach (ushort i in vertexToVertexMap.GetValuesForKey((ushort)vindex)) + { + int tvindex = i; + int tjoin = joinIndices[tvindex]; + if (tjoin >= 0) + { + // ċ‰Šé™¤•‚ŒĤ„‚‹ + tvindex = tjoin; + Debug.Assert(joinIndices[tvindex] < 0); + } + + // è‡ŞèşĞŻċĵ + if (tvindex == vindex) + continue; + + newLinkSet.MC2Set((ushort)tvindex); + } + // 生ċ­˜żĉ–°—„‚ğƒƒƒˆĞċ…‚Œĉ›żˆ + vertexToVertexMap.Remove((ushort)vindex); + for (int i = 0; i < newLinkSet.Length; i++) + { + vertexToVertexMap.Add((ushort)vindex, newLinkSet[i]); + } + //Debug.Assert(newLinkSet.Length > 0); + } + } + + //========================================================================================= + /// + /// ƒŞƒ€‚Ż‚·ƒ§ƒ³ċŒƒ‡ƒĵ‚ż‚’ĉ•´ˆ‚‹ + /// + void UpdateReductionResultJob() + { + // 頂ç‚ıĉ³•ç·šċ˜ä½ċŒ–€Š‚ˆ³ƒœƒĵƒ³‚Ĥ‚¨‚¤ƒˆ‚’ïĵ‘Ğĉ•´ˆ‚‹ + var finalVertexJob = new FinalMergeVertexJob() + { + joinIndices = workData.vertexJoinIndices, + localNormals = vmesh.localNormals.GetNativeArray(), + boneWeights = vmesh.boneWeights.GetNativeArray(), + }; + finalVertexJob.Run(vmesh.VertexCount); + } + + [BurstCompile] + struct FinalMergeVertexJob : IJobParallelFor + { + [Unity.Collections.ReadOnly] + public NativeArray joinIndices; + + public NativeArray localNormals; + public NativeArray boneWeights; + + public void Execute(int vindex) + { + int join = joinIndices[vindex]; + if (join >= 0) + { + // ċ‰Šé™¤•‚ŒĤ„‚‹ + return; + } + + // ĉ³•ç·šċ˜ä½ċŒ– + localNormals[vindex] = math.normalize(localNormals[vindex]); + + // ƒœƒĵƒ³‚Ĥ‚¨‚¤ƒˆ‚’ċı³ċ‡ċŒ– + var bw = boneWeights[vindex]; + bw.AdjustWeight(); + boneWeights[vindex] = bw; + } + } + + //========================================================================================= + // Job Utility + //========================================================================================= + /// + /// 頂ç‚ı‚’結ċˆ—Ĥċ•éĦŒŒŞ„‹èŞżı‚‹ + /// + /// + /// + /// + /// + /// + /// + /// + protected static bool CheckJoin2( + in NativeParallelMultiHashMap vertexToVertexMap, + int vindex, + int tvindex, + bool dontMakeLine + ) + { + // 結ċˆċŒĉŽçĥšƒŞ‚ıƒˆ‚’äğ作ĉˆ™‚‹ + var joinVlink = new FixedList512Bytes(); + + foreach (ushort index in vertexToVertexMap.GetValuesForKey((ushort)vindex)) + { + if (index != vindex && index != tvindex) + joinVlink.MC2Set(index); + } + foreach (ushort index in vertexToVertexMap.GetValuesForKey((ushort)tvindex)) + { + if (index != vindex && index != tvindex) + joinVlink.MC2Set(index); + } + + // ç‚ıĞŞ‚‹ŻNG + // 結ċˆċŒĞĉŽçĥšŒïĵĞŞ‚‹ċ ´ċˆŻNG + if (joinVlink.Length == 0) + { + //Debug.LogWarning("joinVlink.Count = 0!"); + return false; + } + + // ċŻèƒ½Şé™‚Šƒİ‚¤ƒ³‚’作‚‰Ş„ïĵˆ‚ރ—‚·ƒ§ƒ³ïĵ‰ + if (dontMakeLine) + { + // 結ċˆċŒƒˆƒİ‚¤‚˘ƒ³‚°ƒĞċ¤–ċ‘¨‚’²¨ç­†ĉ›¸—€™ıĤċ¤–ċ‘¨é ‚ç‚ıŒä½ż‚‚ŒĤ„‚‹Ş‚‰OK! + // ċ¤–ċ‘¨é ‚ç‚ıŒä¸€ç­†ĉ›¸§Ş„ċ ´ċˆŻïĵ’¤äğ上‚°ƒĞƒĵƒ—Ğċˆ†‹‚Œ„‚‹ïĵˆXċž‹ĞŞ‚‹ïĵ‰ + var stack = new FixedList512Bytes(); + stack.MC2Push(joinVlink[0]); + while (stack.Length > 0) + { + ushort index = stack.MC2Pop(); + if (joinVlink.Contains(index) == false) + continue; + joinVlink.MC2RemoveItemAtSwapBack(index); + + foreach (ushort nindex in vertexToVertexMap.GetValuesForKey((ushort)index)) + { + if (joinVlink.Contains(nindex)) + { + // next + stack.MC2Push(nindex); + } + } + } + if (joinVlink.Length > 0) + { + // ċ¤–ċ‘¨‚’一筆ĉ›¸—Ÿ‚¨§‚‚ é ‚ç‚ıŒĉ‹£Ĥ„‚‹ïĵ + // “‚ŒŻé ‚ç‚ıŒXċž‹ĞŞ‚‹§NGïĵ + return false; + } + } + + // ċ¤§ä¸ˆċ¤Ğ + return true; + } + + /// + /// 頂ç‚ı‚’結ċˆ—Ĥċ•éĦŒŒŞ„‹èŞżı‚‹ + /// + /// + /// + /// + /// + /// + /// + /// + protected static bool CheckJoin( + in NativeArray> vertexToVertexArray, + int vindex, + int tvindex, + in FixedList128Bytes vlist, + in FixedList128Bytes tvlist, + bool dontMakeLine + ) + { + // 結ċˆċŒĉŽçĥšƒŞ‚ıƒˆ‚’äğ作ĉˆ™‚‹ + var joinVlink = new FixedList128Bytes(); + for (int i = 0; i < vlist.Length; i++) + { + int index = vlist[i]; + if (index != vindex && index != tvindex) + joinVlink.MC2SetLimit((ushort)index); + } + for (int i = 0; i < tvlist.Length; i++) + { + int index = tvlist[i]; + if (index != vindex && index != tvindex) + joinVlink.MC2SetLimit((ushort)index); + } + + // ç‚ıĞŞ‚‹ŻNG + // 結ċˆċŒĞĉŽçĥšŒïĵĞŞ‚‹ċ ´ċˆŻNG + if (joinVlink.Length == 0) + { + //Debug.LogWarning("joinVlink.Count = 0!"); + return false; + } + + // ċŻèƒ½Şé™‚Šƒİ‚¤ƒ³‚’作‚‰Ş„ïĵˆ‚ރ—‚·ƒ§ƒ³ïĵ‰ + if (dontMakeLine) + { + // 結ċˆċŒƒˆƒİ‚¤‚˘ƒ³‚°ƒĞċ¤–ċ‘¨‚’²¨ç­†ĉ›¸—€™ıĤċ¤–ċ‘¨é ‚ç‚ıŒä½ż‚‚ŒĤ„‚‹Ş‚‰OK! + // ċ¤–ċ‘¨é ‚ç‚ıŒä¸€ç­†ĉ›¸§Ş„ċ ´ċˆŻïĵ’¤äğ上‚°ƒĞƒĵƒ—Ğċˆ†‹‚Œ„‚‹ïĵˆXċž‹ĞŞ‚‹ïĵ‰ + var stack = new FixedList512Bytes(); + stack.MC2Push(joinVlink[0]); + while (stack.Length > 0) + { + ushort index = stack.MC2Pop(); + if (joinVlink.Contains(index) == false) + continue; + joinVlink.MC2RemoveItemAtSwapBack(index); + + var link = vertexToVertexArray[index]; + for (int i = 0; i < link.Length; i++) + { + ushort nindex = link[i]; + if (joinVlink.Contains(nindex)) + { + // next + stack.MC2Push(nindex); + } + } + } + if (joinVlink.Length > 0) + { + // ċ¤–ċ‘¨‚’一筆ĉ›¸—Ÿ‚¨§‚‚ é ‚ç‚ıŒĉ‹£Ĥ„‚‹ïĵ + // “‚ŒŻé ‚ç‚ıŒXċž‹ĞŞ‚‹§NGïĵ + return false; + } + } + + // ċ¤§ä¸ˆċ¤Ğ + return true; + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Reduction/StepReductionBase.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Reduction/StepReductionBase.cs.meta new file mode 100644 index 00000000..5a322f53 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Reduction/StepReductionBase.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: facec8b9837c5ca4d8d05ccc7f1ca6a9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Reduction/StepReductionBase.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Settings.meta b/Assets/MagicaCloth2/Scripts/Core/Settings.meta new file mode 100644 index 00000000..d877e19a --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Settings.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a4f9ed180f9a7b14093bd9e1104e33ea +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Scripts/Core/Settings/ClothDebugSettings.cs b/Assets/MagicaCloth2/Scripts/Core/Settings/ClothDebugSettings.cs new file mode 100644 index 00000000..c133b74b --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Settings/ClothDebugSettings.cs @@ -0,0 +1,120 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +#if MC2_DEBUG +using UnityEngine; +#endif + +namespace MagicaCloth2 +{ + /// + /// ‚Żƒ­‚ıƒ‡ƒƒƒ‚°èĦ¨ç¤şè¨­ċš + /// + [System.Serializable] + public class ClothDebugSettings + { + public enum DebugAxis + { + None, + Normal, + All, + } + + //===================================================================== + // ■ċ…Ĵ開™‚‹‚‚ + //===================================================================== + public bool enable = false; + public bool ztest = false; + public bool position = true; + public DebugAxis axis = DebugAxis.None; + public bool shape = false; + public bool baseLine = false; + public bool depth = false; + public bool collider = true; + public bool animatedPosition = false; + public DebugAxis animatedAxis = DebugAxis.None; + public bool animatedShape = false; + public bool inertiaCenter = true; + public bool customSkinningBone = true; + + //===================================================================== + // ■ƒ‡ƒƒƒ‚°ç”¨ + //===================================================================== +#if MC2_DEBUG + //[Space] + //[Header("[MC2_DEBUG]")] + [Header("<<< MC2_DEBUG >>>")] + [Range(0.003f, 0.1f)] + public float pointSize = 0.01f; + public bool referOldPos = false; + public bool radius = true; + public bool localNumber = false; + public bool particleNumber = false; + public bool triangleNumber = false; + public bool friction = false; + public bool staticFriction = false; + public bool attribute = false; + //public bool verticalDistanceConstraint = false; + //public bool horizontalDistanceConstraint = false; + public bool collisionNormal = false; + public bool cellCube = false; + public bool baseLinePos = false; + public int vertexMinIndex = 0; + public int vertexMaxIndex = 100000; + public int triangleMinIndex = 0; + public int triangleMaxIndex = 100000; +#endif + + //========================================================================================= + public bool CheckParticleDrawing(int index) + { +#if MC2_DEBUG + return index >= vertexMinIndex && index <= vertexMaxIndex; +#else + return true; +#endif + } + + public bool CheckTriangleDrawing(int index) + { +#if MC2_DEBUG + return index >= triangleMinIndex && index <= triangleMaxIndex; +#else + return true; +#endif + } + + public bool CheckRadiusDrawing() + { +#if MC2_DEBUG + return radius; +#else + return true; +#endif + } + + public float GetPointSize() + { +#if MC2_DEBUG + return pointSize; +#else + return 0.01f; +#endif + } + + public float GetLineSize() => 0.05f; // ċ›şċš + + public float GetInertiaCenterRadius() => 0.01f; // ċ›şċš + + public float GetCustomSkinningRadius() => 0.02f; // ċ›şċš + + public bool IsReferOldPos() + { +#if MC2_DEBUG + return referOldPos; +#else + return false; +#endif + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Settings/ClothDebugSettings.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Settings/ClothDebugSettings.cs.meta new file mode 100644 index 00000000..3bb27e71 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Settings/ClothDebugSettings.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 376c4b12fa90b6e429730e7ff5424c71 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Settings/ClothDebugSettings.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Settings/VirtualMeshDebugSettings.cs b/Assets/MagicaCloth2/Scripts/Core/Settings/VirtualMeshDebugSettings.cs new file mode 100644 index 00000000..9a6fcb04 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Settings/VirtualMeshDebugSettings.cs @@ -0,0 +1,54 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +#if MC2_DEBUG +using UnityEngine; +#endif + +namespace MagicaCloth2 +{ +#if MC2_DEBUG + /// + /// VirtualMeshƒ‡ƒƒƒ‚°èĦ¨ç¤şè¨­ċš + /// + [System.Serializable] + public class VirtualMeshDebugSettings + { + public enum DebugAxis + { + None, + Normal, + All, + } + + [Header("<<< MC2_DEBUG >>>")] + public bool enable = false; + [Range(0.003f, 0.1f)] + public float pointSize = 0.01f; + [Range(0.003f, 0.1f)] + public float lineSize = 0.03f; + public bool position = true; + public bool axis = false; + public bool indexNumber = false; + public bool boneWeight = false; + public bool uv = false; + public bool depth = false; + public bool rootIndex = false; + public bool parentIndex = false; + public bool line = true; + public bool edgeNumber = false; + public bool triangle = true; + public bool triangleNormal = false; + public bool triangleTangent = false; + public bool triangleNumber = false; + public bool baseLine = false; + public bool boneName = false; + public int vertexMinIndex = 0; + public int vertexMaxIndex = 100000; + public int edgeMinIndex = 0; + public int edgeMaxIndex = 100000; + public int triangleMinIndex = 0; + public int triangleMaxIndex = 100000; + } +#endif // MC2_DEBUG +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Settings/VirtualMeshDebugSettings.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Settings/VirtualMeshDebugSettings.cs.meta new file mode 100644 index 00000000..110f7fc3 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Settings/VirtualMeshDebugSettings.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 531c6af0cb86f0e40b49ae9f19e2f83d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Settings/VirtualMeshDebugSettings.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility.meta b/Assets/MagicaCloth2/Scripts/Core/Utility.meta new file mode 100644 index 00000000..dc76c6d4 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1751485edafdc6c41b324979e75d0a46 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/Data.meta b/Assets/MagicaCloth2/Scripts/Core/Utility/Data.meta new file mode 100644 index 00000000..74a0f3c7 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/Data.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 95fa82dc80bceb64688ab606c9212a14 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/Data/DataUtility.cs b/Assets/MagicaCloth2/Scripts/Core/Utility/Data/DataUtility.cs new file mode 100644 index 00000000..20053116 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/Data/DataUtility.cs @@ -0,0 +1,528 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System; +using System.Runtime.CompilerServices; +using Unity.Mathematics; +using UnityEngine; + +namespace MagicaCloth2 +{ + public class DataUtility + { + /// + /// ïĵ’¤int‚’int2Ğƒ‘ƒƒ‚݁™‚‹ + /// ƒ‡ƒĵ‚żŻĉ˜‡é †Ğ‚½ƒĵƒˆ•‚Œ‚‹ + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 PackInt2(int d0, int d1) + { + return d0 < d1 ? new int2(d0, d1) : new int2(d1, d0); + } + + /// + /// int2‚’ƒ‡ƒĵ‚żĉ˜‡é †Ğ‚½ƒĵƒˆ—Ĥĉ ĵ納—ç›´™ + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 PackInt2(in int2 d) => PackInt2(d.x, d.y); + + /// + /// ïĵ“¤int‚’int3Ğƒ‘ƒƒ‚݁™‚‹ + /// ƒ‡ƒĵ‚żŻĉ˜‡é †Ğ‚½ƒĵƒˆ•‚Œ‚‹ + /// + /// + /// + /// + /// + public static int3 PackInt3(int d0, int d1, int d2) + { + if (d0 < d1 && d0 < d2) + { + // d0,x,x + if (d1 < d2) + return new int3(d0, d1, d2); + else + return new int3(d0, d2, d1); + } + if (d1 < d2) + { + // d1,x,x + if (d0 < d2) + return new int3(d1, d0, d2); + else + return new int3(d1, d2, d0); + } + else + { + // d2,x,x + if (d0 < d1) + return new int3(d2, d0, d1); + else + return new int3(d2, d1, d0); + } + } + + public static int3 PackInt3(in int3 d) => PackInt3(d.x, d.y, d.z); + + /// + /// ïĵ”¤int‚’int4Ğƒ‘ƒƒ‚݁™‚‹ + /// ƒ‡ƒĵ‚żŻĉ˜‡é †Ğ‚½ƒĵƒˆ•‚Œ‚‹ + /// + /// + /// + /// + /// + /// + public static int4 PackInt4(int d0, int d1, int d2, int d3) + { + int w; + + // step1 + if (d0 > d3) + { + w = d0; + d0 = d3; + d3 = w; + } + if (d1 > d2) + { + w = d1; + d1 = d2; + d2 = w; + } + + // step2 + if (d0 > d1) + { + w = d0; + d0 = d1; + d1 = w; + } + if (d2 > d3) + { + w = d2; + d2 = d3; + d3 = w; + } + + // step3 + if (d1 > d2) + { + w = d1; + d1 = d2; + d2 = w; + } + + return new int4(d0, d1, d2, d3); + } + + public static int4 PackInt4(int4 d) => PackInt4(d.x, d.y, d.z, d.w); + + + /// + /// ïĵ’¤int‚’ushortĞċ¤‰ĉ›—ïĵ‘¤uintĞƒ‘ƒƒ‚­ƒ³‚°™‚‹ + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint Pack32(int hi, int low) + { + return (uint)hi << 16 | (uint)low & 0xffff; + } + + /// + /// ïĵ’¤int‚’ushortĞċ¤‰ĉ›—ïĵ‘¤uintĞƒ‘ƒƒ‚­ƒ³‚°™‚‹ + /// ƒ‡ƒĵ‚żċ°•„ğ†Œä¸Šä½Ğĉ ĵ納•‚Œ‚‹‚ˆ†Ğ‚½ƒĵƒˆ•‚Œ‚‹ + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint Pack32Sort(int a, int b) + { + if (a > b) + { + return (uint)b << 16 | (uint)a & 0xffff; + } + else + { + return (uint)a << 16 | (uint)b & 0xffff; + } + } + + /// + /// uintƒ‘ƒƒ‚Żƒ‡ƒĵ‚ż‹‚‰ä¸Šä½16bit‚’intĞ—Ĥèż”™ + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int Unpack32Hi(uint pack) + { + return (int)((pack >> 16) & 0xffff); + } + + /// + /// uintƒ‘ƒƒ‚Żƒ‡ƒĵ‚ż‹‚‰ä¸‹ä½16bit‚’intĞ—Ĥèż”™ + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int Unpack32Low(uint pack) + { + return (int)(pack & 0xffff); + } + +#if false + /// + /// ïĵ’¤int‚’hi(10bit)¨low(22bit)Ğċˆ‡‚Šèݰ‚Ĥïĵ‘¤uintĞƒ‘ƒƒ‚­ƒ³‚°™‚‹ + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint Pack10_22(int hi, int low) + { + return (uint)hi << 22 | (uint)low & 0x3fffff; + } + + /// + /// uint10-22ƒ‘ƒƒ‚Żƒ‡ƒĵ‚ż‹‚‰ä¸Šä½10bitƒ‡ƒĵ‚ż‚’intĞ—Ĥèż”™ + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int Unpack10_22Hi(uint pack) + { + return (int)((pack >> 22) & 0x3ff); + } + + /// + /// uint10-22ƒ‘ƒƒ‚Żƒ‡ƒĵ‚ż‹‚‰ä¸‹ä½22bitƒ‡ƒĵ‚ż‚’intĞ—Ĥèż”™ + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int Unpack10_22Low(uint pack) + { + return (int)(pack & 0x3fffff); + } + + /// + /// uint10-22ƒ‘ƒƒ‚Żƒ‡ƒĵ‚ż‚’ċˆ†è§£—Ĥïĵ’¤int¨—Ĥèż”™ + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void Unpack10_22(uint pack, out int hi, out int low) + { + hi = (int)((pack >> 22) & 0x3ff); + low = (int)(pack & 0x3fffff); + } +#endif + + /// + /// ïĵ’¤int‚’hi(12bit)¨low(20bit)Ğċˆ‡‚Šèݰ‚Ĥïĵ‘¤uintĞƒ‘ƒƒ‚­ƒ³‚°™‚‹ + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint Pack12_20(int hi, int low) + { + return (uint)hi << 20 | (uint)low & 0xfffff; + } + + /// + /// uint12-20ƒ‘ƒƒ‚Żƒ‡ƒĵ‚ż‹‚‰ä¸Šä½12bitƒ‡ƒĵ‚ż‚’intĞ—Ĥèż”™ + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int Unpack12_20Hi(uint pack) + { + return (int)((pack >> 20) & 0xfff); + } + + /// + /// uint12-20ƒ‘ƒƒ‚Żƒ‡ƒĵ‚ż‹‚‰ä¸‹ä½20bitƒ‡ƒĵ‚ż‚’intĞ—Ĥèż”™ + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int Unpack12_20Low(uint pack) + { + return (int)(pack & 0xfffff); + } + + /// + /// uint12-20ƒ‘ƒƒ‚Żƒ‡ƒĵ‚ż‚’ċˆ†è§£—Ĥïĵ’¤int¨—Ĥèż”™ + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void Unpack12_20(uint pack, out int hi, out int low) + { + hi = (int)((pack >> 20) & 0xfff); + low = (int)(pack & 0xfffff); + } + + /// + /// ïĵ”¤int‚’ushortĞċ¤‰ĉ›—ïĵ‘¤ulongĞƒ‘ƒƒ‚­ƒ³‚°™‚‹ + /// + /// + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ulong Pack64(int x, int y, int z, int w) + { + return (((ulong)x) & 0xffff) << 48 | (((ulong)y) & 0xffff) << 32 | (((ulong)z) & 0xffff) << 16 | ((ulong)w) & 0xffff; + } + + /// + /// int4‚’ushortĞċ¤‰ĉ›—ïĵ‘¤ulongĞƒ‘ƒƒ‚­ƒ³‚°™‚‹ + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ulong Pack64(in int4 a) + { + return Pack64(a.x, a.y, a.z, a.w); + } + + /// + /// ulongƒ‘ƒƒ‚Żƒ‡ƒĵ‚ż‹‚‰int4Ğċħ•é–‹—Ĥèż”™ + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 Unpack64(in ulong pack) + { + return new int4( + (int)((pack >> 48) & 0xffff), + (int)((pack >> 32) & 0xffff), + (int)((pack >> 16) & 0xffff), + (int)(pack & 0xffff) + ); + } + + /// + /// ulongƒ‘ƒƒ‚Żƒ‡ƒĵ‚ż‹‚‰xċ€¤‚’ċ–‚Šċ‡ş™ + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int Unpack64X(in ulong pack) + { + return (int)((pack >> 48) & 0xffff); + } + + /// + /// ulongƒ‘ƒƒ‚Żƒ‡ƒĵ‚ż‹‚‰yċ€¤‚’ċ–‚Šċ‡ş™ + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int Unpack64Y(in ulong pack) + { + return (int)((pack >> 32) & 0xffff); + } + + /// + /// ulongƒ‘ƒƒ‚Żƒ‡ƒĵ‚ż‹‚‰zċ€¤‚’ċ–‚Šċ‡ş™ + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int Unpack64Z(in ulong pack) + { + return (int)((pack >> 16) & 0xffff); + } + + /// + /// ulongƒ‘ƒƒ‚Żƒ‡ƒĵ‚ż‹‚‰wċ€¤‚’ċ–‚Šċ‡ş™ + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int Unpack64W(in ulong pack) + { + return (int)(pack & 0xffff); + } + + /// + /// ïĵ”¤int‚’byteĞċ¤‰ĉ›—ïĵ‘¤uintĞƒ‘ƒƒ‚­ƒ³‚°™‚‹ + /// + /// + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static uint Pack32(int x, int y, int z, int w) + { + return (((uint)x) & 0xff) << 24 | (((uint)y) & 0xff) << 16 | (((uint)z) & 0xff) << 8 | ((uint)w) & 0xff; + } + + /// + /// int4‚’byteĞċ¤‰ĉ›—ïĵ‘¤uintĞƒ‘ƒƒ‚­ƒ³‚°™‚‹ + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ulong Pack32(in int4 a) + { + return Pack64(a.x, a.y, a.z, a.w); + } + + /// + /// uintƒ‘ƒƒ‚Żƒ‡ƒĵ‚ż‹‚‰int4Ğċħ•é–‹—Ĥèż”™ + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int4 Unpack32(in uint pack) + { + return new int4( + (int)((pack >> 24) & 0xff), + (int)((pack >> 16) & 0xff), + (int)((pack >> 8) & 0xff), + (int)(pack & 0xff) + ); + } + + /// + /// int3†Ħuse(int2)§ä½ż‚‚ŒĤ„Ş„ĉ‹‚Ёïĵ‘¤ƒ‡ƒĵ‚ż‚’èż”™ + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int RemainingData(in int3 data, in int2 use) + { + if (data.x != use.x && data.x != use.y) + return data.x; + if (data.y != use.x && data.y != use.y) + return data.y; + return data.z; + } + + //========================================================================================= + /// + /// AnimationCurve‚’16ċ€‹floatƒŞ‚ıƒˆ(float4x4)Ğċ¤‰ĉ›™‚‹ + /// + /// + /// + public static float4x4 ConvertAnimationCurve(AnimationCurve curve) + { + float4x4 m = 0; + for (int i = 0; i < 16; i++) + { + float time = i / 15.0f; + float val = curve.Evaluate(time); + m.MC2SetValue(i, val); + } + + return m; + } + + /// + /// AnimationCurveŒĉ ĵ納•‚ŒŸfloat4x4‹‚‰ƒ‡ƒĵ‚ż‚’ċ–ċ—™‚‹ + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float EvaluateCurve(in float4x4 curve, float time) + { + const float interval = 1.0f / 15.0f; + int index = (int)(math.saturate(time) * 15); + time -= index * interval; + float t = time / interval; + return math.lerp(curve.MC2GetValue(index), curve.MC2GetValue(index + 1), t); + } + + //========================================================================================= + /// + /// 16bitƒ•ƒİ‚°Ğ‚³ƒİ‚¤ƒ€ƒĵ‚ż‚¤ƒ—‚’設ċš™‚‹ + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ExBitFlag16 SetColliderType(ExBitFlag16 flag, ColliderManager.ColliderType ctype) + { + flag.Value = (ushort)((flag.Value & 0xfff0) | (ushort)ctype); + return flag; + } + + /// + /// 16bitƒ•ƒİ‚°‹‚‰‚³ƒİ‚¤ƒ€ƒĵ‚ż‚¤ƒ—‚’ċ–ċ—™‚‹ + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ColliderManager.ColliderType GetColliderType(in ExBitFlag16 flag) + { + return (ColliderManager.ColliderType)(flag.Value & 0x000f); + } + + /// + /// 16bitƒ•ƒİ‚°Ğ‚·ƒ³ƒĦƒˆƒŞƒĵ‚ż‚¤ƒ—‚’設ċš™‚‹ + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ExBitFlag16 SetSymmetryType(ExBitFlag16 flag, ColliderManager.SymmetryType stype) + { + flag.Value = (ushort)((flag.Value & 0xff0f) | (((ushort)stype) << 4)); + return flag; + } + + /// + /// 16bitƒ•ƒİ‚°‹‚‰‚·ƒ³ƒĦƒˆƒŞƒĵ‚ż‚¤ƒ—‚’ċ–ċ—™‚‹ + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ColliderManager.SymmetryType GetSymmetryType(in ExBitFlag16 flag) + { + return (ColliderManager.SymmetryType)((flag.Value & 0x00f0) >> 4); + } + + //========================================================================================= + /// + /// 配ċˆ—‚’Deep‚³ƒ”ƒĵ™‚‹ + /// + /// + /// + /// + public static void ArrayCopy(T[] src, ref T[] dst) + { + if (src == null) + { + dst = null; + return; + } + if (src.Length == 0) + { + dst = new T[0]; + } + else + { + dst = new T[src.Length]; + Array.Copy(src, dst, src.Length); + } + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/Data/DataUtility.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Utility/Data/DataUtility.cs.meta new file mode 100644 index 00000000..5c22d260 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/Data/DataUtility.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 5749112885888a44fa11de392614144a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Utility/Data/DataUtility.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/Data/MagicaObjectId.cs b/Assets/MagicaCloth2/Scripts/Core/Utility/Data/MagicaObjectId.cs new file mode 100644 index 00000000..8e9ab68a --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/Data/MagicaObjectId.cs @@ -0,0 +1,98 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2026 MagicaSoft. +// https://magicasoft.jp +using System; +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// Unityƒƒĵ‚¸ƒ§ƒ³ċ·ç•°ïĵˆInstanceID vs EntityIdïĵ‰‚’ċ¸ċŽ™‚‹IDĉ§‹é€ ä½“€‚ + /// çċœ¨ŻUnity6.4äğ上§EntityIdĞċˆ‡‚Šĉ›żˆ + /// + public readonly struct MagicaObjectId : IEquatable + { + // ------------------------------------------------------- + // ċ†…部ƒ‡ƒĵ‚żäżĉŒ + // ------------------------------------------------------- +#if UNITY_6000_4_OR_NEWER + private readonly EntityId _value; + + public MagicaObjectId(EntityId id) + { + _value = id; + } + + // ç„ĦċŠıŞIDċšçİïĵˆEntityIdäğ•ĉ§˜Ğċˆ‚›‚‹ïĵ‰ + public static readonly MagicaObjectId Invalid = new(EntityId.None); + + public bool IsValid() => _value.IsValid(); + +#else + private readonly int _value; + + public MagicaObjectId(int id) + { + _value = id; + } + + // ċ“ĉInstanceID§Ż0Œäş‹ċŸä¸Šç„ĦċŠıċ€¤¨—Ĥĉ‰ħ‚‚Œ‚‹“¨Œċ¤š„ + public static readonly MagicaObjectId Invalid = new MagicaObjectId(0); + + public bool IsValid() => _value != 0; +#endif + + public bool Equals(MagicaObjectId other) + { + return _value.Equals(other._value); + } + + public override bool Equals(object obj) + { + return obj is MagicaObjectId other && Equals(other); + } + + public override int GetHashCode() + { + return _value.GetHashCode(); + } + + public static bool operator ==(MagicaObjectId left, MagicaObjectId right) + { + return left.Equals(right); + } + + public static bool operator !=(MagicaObjectId left, MagicaObjectId right) + { + return !left.Equals(right); + } + + // “‚ŒŻƒ‡ƒƒƒ‚°ç”¨é€”äğċ¤–§Żä½ż‚Ş„ + public override string ToString() + { + return _value.ToString(); + } + } + + // ------------------------------------------------------- + // ĉ‹ĦċĵµƒĦ‚½ƒƒƒ‰ + // ------------------------------------------------------- + public static class MagicaObjectIdExtensions + { + /// + /// GameObject‚„Component‹‚‰ƒƒĵ‚¸ƒ§ƒ³Ğċˆ‚›ŸID‚’ċ–ċ—™‚‹ + /// + public static MagicaObjectId GetMagicaId(this UnityEngine.Object obj) + { + if (obj == null) return MagicaObjectId.Invalid; + +#if UNITY_6000_4_OR_NEWER + // Unity 6.4 API + return new MagicaObjectId(obj.GetEntityId()); +#else + // ċ“ĉ API + return new MagicaObjectId(obj.GetInstanceID()); +#endif + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/Data/MagicaObjectId.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Utility/Data/MagicaObjectId.cs.meta new file mode 100644 index 00000000..be415d5b --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/Data/MagicaObjectId.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 527929c5c74a0224b91228de398467f3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Utility/Data/MagicaObjectId.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/Data/MultiDataBuilder.cs b/Assets/MagicaCloth2/Scripts/Core/Utility/Data/MultiDataBuilder.cs new file mode 100644 index 00000000..0f3c79ee --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/Data/MultiDataBuilder.cs @@ -0,0 +1,133 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System; +using System.Collections.Generic; +using Unity.Collections; + +namespace MagicaCloth2 +{ + /// + /// Tċž‹ƒ‡ƒĵ‚żƒŞ‚ıƒˆ‚’ĉ§‹ç݉—èĤç´ ”¨Ğ‚ı‚żƒĵƒˆ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı¨ƒ‡ƒĵ‚ż‚Ğ‚Ĥƒ³‚ż‚’生ĉˆ™‚‹ + /// ċ‡şċŠ›ŻTċž‹ƒ‡ƒĵ‚żé…ċˆ—¨€èĤç´ ”¨‚ı‚żƒĵƒˆ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı¨‚Ğ‚Ĥƒ³‚żŒïĵ‘¤uintĞƒ‘ƒƒ‚݁•‚ŒŸé…ċˆ—ïĵ’¤ + /// + /// + public class MultiDataBuilder : IDisposable where T : unmanaged + { + int indexCount; + + public NativeParallelMultiHashMap Map; + + //========================================================================================= + public MultiDataBuilder(int indexCount, int dataCapacity) + { + this.indexCount = indexCount; + Map = new NativeParallelMultiHashMap(dataCapacity, Allocator.Persistent); + } + + + public void Dispose() + { + if (Map.IsCreated) + Map.Dispose(); + } + + public int Count() => Map.Count(); + + public int GetDataCount(int index) + { + if (Map.ContainsKey(index) == false) + return 0; + + return Map.CountValuesForKey(index); + } + + public void Add(int key, T data) + { + Map.Add(key, data); + } + + //public int AddAndReturnIndex(int key, T data) + //{ + // int cnt = Map.CountValuesForKey(key); + // Map.Add(key, data); + // return cnt; + //} + + public int CountValuesForKey(int key) + { + return Map.CountValuesForKey(key); + } + + //========================================================================================= + /// + /// ċ†…部HashMapƒ‡ƒĵ‚ż‚’Tċž‹é…ċˆ—¨èĤç´ ”¨‚ı‚żƒĵƒˆ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı¨‚Ğ‚Ĥƒ³‚żé…ċˆ—ïĵ’¤Ğċˆ†é›˘—Ĥèż”™ + /// ċ‡şċŠ›ŻTċž‹ƒ‡ƒĵ‚żé…ċˆ—¨€èĤç´ ”¨‚ı‚żƒĵƒˆ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı(20bit)¨‚Ğ‚Ĥƒ³‚ż(12bit)‚’ïĵ‘¤uintĞƒ‘ƒƒ‚݁—Ÿé…ċˆ—¨Ş‚‹ + /// + /// + public (T[], uint[]) ToArray() + { + if (Map.IsCreated == false || indexCount == 0) + return (null, null); + + var indexArray = new uint[indexCount]; + var dataList = new List(Map.Capacity); + + for (int i = 0; i < indexCount; i++) + { + int start = dataList.Count; + int cnt = 0; + + if (Map.ContainsKey(i)) + { + foreach (var data in Map.GetValuesForKey(i)) + { + dataList.Add(data); + cnt++; + } + } + + indexArray[i] = DataUtility.Pack12_20(cnt, start); + } + + return (dataList.ToArray(), indexArray); + } + + public uint[] ToIndexArray() + { + (var _, uint[] indexArray) = ToArray(); + return indexArray; + } + + /// + /// ċ†…部HashMapƒ‡ƒĵ‚ż‚’Tċž‹é…ċˆ—¨èĤç´ ”¨‚ı‚żƒĵƒˆ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı+‚Ğ‚Ĥƒ³‚żïĵ’¤NativeArrayĞċˆ†é›˘—Ĥèż”™ + /// ċ‡şċŠ›ŻTċž‹ƒ‡ƒĵ‚żé…ċˆ—¨€èĤç´ ”¨‚ı‚żƒĵƒˆ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı(20bit)¨‚Ğ‚Ĥƒ³‚ż(12bit)‚’ïĵ‘¤uintĞƒ‘ƒƒ‚݁—Ÿé…ċˆ—¨Ş‚‹ + /// + /// + /// + public void ToNativeArray(out NativeArray indexArray, out NativeArray dataArray) + { + indexArray = new NativeArray(indexCount, Allocator.Persistent); + var dataList = new List(Map.Capacity); + + for (int i = 0; i < indexCount; i++) + { + int start = dataList.Count; + int cnt = 0; + + if (Map.ContainsKey(i)) + { + foreach (var data in Map.GetValuesForKey(i)) + { + dataList.Add(data); + cnt++; + } + } + + indexArray[i] = DataUtility.Pack12_20(cnt, start); + } + + dataArray = new NativeArray(dataList.ToArray(), Allocator.Persistent); + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/Data/MultiDataBuilder.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Utility/Data/MultiDataBuilder.cs.meta new file mode 100644 index 00000000..2a25722e --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/Data/MultiDataBuilder.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 437001a616042194796b2fa354bebbb3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Utility/Data/MultiDataBuilder.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/Grid.meta b/Assets/MagicaCloth2/Scripts/Core/Utility/Grid.meta new file mode 100644 index 00000000..c9e7fc4b --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/Grid.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a4a34e42bc2ef104fb3237f69dbdd2f0 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/Grid/GridMap.cs b/Assets/MagicaCloth2/Scripts/Core/Utility/Grid/GridMap.cs new file mode 100644 index 00000000..08cceaee --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/Grid/GridMap.cs @@ -0,0 +1,233 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System; +using System.Collections; +using System.Collections.Generic; +using System.Runtime.CompilerServices; +using Unity.Collections; +using Unity.Mathematics; + +namespace MagicaCloth2 +{ + /// + /// ‚°ƒŞƒƒƒ‰ƒžƒƒƒ—¨ƒĤƒĵƒ†‚£ƒŞƒ†‚£é–˘ĉ•°ç¤ + /// Job§ċˆİ用™‚‹Ÿ‚Ğĉœ€ä½Žé™çĦ理ƒ‡ƒĵ‚żż + /// Ÿ‚GridSizeŞİƒ‡ƒĵ‚żŻ“‚Żƒİ‚ı§ŻäżĉŒ—Ş„ + /// GridSize>0§‚‚‹ċż…èĤ‚‚Š! + /// + /// + public class GridMap : IDisposable where T : unmanaged // , IEquatable + { + private NativeParallelMultiHashMap gridMap; + + //========================================================================================= + public GridMap(int capacity = 0) + { + gridMap = new NativeParallelMultiHashMap(capacity, Allocator.Persistent); + } + + public void Dispose() + { + if (gridMap.IsCreated) + gridMap.Dispose(); + } + + public NativeParallelMultiHashMap GetMultiHashMap() => gridMap; + + public int DataCount => gridMap.Count(); + + //========================================================================================= + /// + /// ‚°ƒŞƒƒƒ‰çŻ„ċ›²‚’èµ°ĉŸğ™‚‹Enumerator‚’èż”™ + /// + /// + /// + /// + public static GridEnumerator GetArea(int3 startGrid, int3 endGrid, NativeParallelMultiHashMap gridMap) + { + return new GridEnumerator + { + gridMap = gridMap, + startGrid = math.min(startGrid, endGrid), + endGrid = math.max(startGrid, endGrid), + currentGrid = math.min(startGrid, endGrid), + isFirst = true, + }; + } + + /// + /// 球範ċ›²‚’èµ°ĉŸğ™‚‹Enumerator‚’èż”™ + /// + /// + /// + /// + public static GridEnumerator GetArea(float3 pos, float radius, NativeParallelMultiHashMap gridMap, float gridSize) + { + // ĉ¤œç´˘‚°ƒŞƒƒƒ‰çŻ„ċ›² + int3 minGrid = GetGrid(pos - radius, gridSize); + int3 maxGrid = GetGrid(pos + radius, gridSize); + + return GetArea(minGrid, maxGrid, gridMap); + } + + /// + /// ‚°ƒŞƒƒƒ‰èµ°ĉŸğ用Enumerator + /// + public struct GridEnumerator : IEnumerator + { + internal NativeParallelMultiHashMap gridMap; + internal int3 startGrid; + internal int3 endGrid; + internal int3 currentGrid; + internal bool isFirst; + + public int3 Current => currentGrid; + + object IEnumerator.Current => Current; + + public void Dispose() + { + } + + public bool MoveNext() + { + // ƒ‡ƒĵ‚żŒċ­˜ċœ¨—Ş¨‚‚èµ°ĉŸğ™‚‹ + if (isFirst) + { + isFirst = false; + return true; + } + currentGrid.x++; + if (currentGrid.x > endGrid.x) + { + currentGrid.x = startGrid.x; + currentGrid.y++; + if (currentGrid.y > endGrid.y) + { + currentGrid.y = startGrid.y; + currentGrid.z++; + if (currentGrid.z > endGrid.z) + { + return false; + } + } + } + return true; + } + + public void Reset() + { + currentGrid = startGrid; + isFirst = true; + } + + public GridEnumerator GetEnumerator() { return this; } + } + + + //========================================================================================= + /// + /// ċş§ĉ¨™‹‚‰ïĵ“ĉĴĦċ…ƒ‚°ƒŞƒƒƒ‰ċş§ĉ¨™‚’ċ‰²‚Šċ‡ş™ + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 GetGrid(float3 pos, float gridSize) + { + Develop.Assert(gridSize > 0); + return new int3(math.floor(pos / gridSize)); + } + + /// + /// ‚°ƒŞƒƒƒ‰ƒžƒƒƒ—Ğƒ‡ƒĵ‚ż‚’èż½ċŠ ™‚‹ + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void AddGrid(int3 grid, T data, NativeParallelMultiHashMap gridMap) + { + gridMap.Add(grid, data); + } + + /// + /// ċş§ĉ¨™‹‚‰‚°ƒŞƒƒƒ‰ƒžƒƒƒ—Ğƒ‡ƒĵ‚ż‚’èż½ċŠ ™‚‹ + /// + /// + /// + /// + /// + /// + /// èż½ċŠ •‚ŒŸ‚°ƒŞƒƒƒ‰‚’èż”™ + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 AddGrid(float3 pos, T data, NativeParallelMultiHashMap gridMap, float gridSize) + { + int3 grid = GetGrid(pos, gridSize); + gridMap.Add(grid, data); + return grid; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 AddGrid(float3 pos, T data, NativeParallelMultiHashMap.ParallelWriter gridMap, float gridSize) + { + int3 grid = GetGrid(pos, gridSize); + gridMap.Add(grid, data); + return grid; + } + + /// + /// ‚°ƒŞƒƒƒ‰ƒžƒƒƒ—‹‚‰ƒ‡ƒĵ‚ż‚’ċ‰Šé™¤™‚‹ + /// + /// + /// + /// + /// ċ‰Šé™¤ĞĉˆċŠŸ—Ÿċ ´ċˆŻtrue + public static bool RemoveGrid(int3 grid, T data, NativeParallelMultiHashMap gridMap) + { + if (gridMap.ContainsKey(grid)) + { + NativeParallelMultiHashMapIterator it; + T item; + if (gridMap.TryGetFirstValue(grid, out item, out it)) + { + do + { + if (item.Equals(data)) + { + gridMap.Remove(it); + return true; + } + } + while (gridMap.TryGetNextValue(out item, ref it)); + } + } + + return false; + } + + /// + /// ‚°ƒŞƒƒƒ‰ƒžƒƒƒ—‹‚‰ƒ‡ƒĵ‚ż‚’ç§ğċ‹••›‚‹ + /// + /// + /// + /// + /// + /// ƒ‡ƒĵ‚żŒç§ğċ‹••‚ŒŸċ ´ċˆtrue, ç§ğċ‹•ċż…èĤŒŞ„ċ ´ċˆŻfalse + public static bool MoveGrid(int3 fromGrid, int3 toGrid, T data, NativeParallelMultiHashMap gridMap) + { + // ç§ğċ‹•ċż…èĤŒŞ‘‚Œ°çµ‚了 + if (fromGrid.Equals(toGrid)) + return false; + + // remove + RemoveGrid(fromGrid, data, gridMap); + + // add + AddGrid(toGrid, data, gridMap); + + return true; + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/Grid/GridMap.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Utility/Grid/GridMap.cs.meta new file mode 100644 index 00000000..d4b86f90 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/Grid/GridMap.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: f11ea30bdf2932444ae39633749006cb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Utility/Grid/GridMap.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/Jobs.meta b/Assets/MagicaCloth2/Scripts/Core/Utility/Jobs.meta new file mode 100644 index 00000000..359252c7 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/Jobs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a2f52f64422b8ad49ae673c135e28e9e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/Jobs/InterlockUtility.cs b/Assets/MagicaCloth2/Scripts/Core/Utility/Jobs/InterlockUtility.cs new file mode 100644 index 00000000..cec2405e --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/Jobs/InterlockUtility.cs @@ -0,0 +1,114 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System.Runtime.CompilerServices; +using System.Threading; +using Unity.Mathematics; + +namespace MagicaCloth2 +{ + /// + /// Nativeƒƒƒƒ•‚Ħ¸‚¤ƒ³‚żƒĵƒ­ƒƒ‚Żĉ›¸èĵżċˆĥċĦé–˘é€£ + /// + public static class InterlockUtility + { + /// + /// ċ›şċšċ°ĉ•°ç‚ı¸ċ¤‰ĉ›ċ€çއ + /// + internal const int ToFixed = 1000000; + + /// + /// ċ°‘ĉ•°¸ċİċ…ƒċ€çއ + /// + internal const float ToFloat = 0.000001f; + + //========================================================================================= + /// + /// 集計ƒƒƒƒ•‚ĦĉŒ‡ċš‚¤ƒ³ƒ‡ƒƒ‚Ż‚ıĞfloat3‚’ċ›şċšċ°ĉ•°ç‚ı¨—ĤċŠ ç——‚Ğ‚Ĥƒ³‚ż‚’‚¤ƒ³‚ŻƒŞƒĦƒ³ƒˆ™‚‹ + /// + /// + /// + /// + /// + unsafe internal static void AddFloat3(int index, float3 add, int* cntPt, int* sumPt) + { + Interlocked.Increment(ref cntPt[index]); + int3 iadd = (int3)(add * ToFixed); + //Debug.Log($"InterlockAdd [{index}]:{iadd}"); + index *= 3; + for (int i = 0; i < 3; i++, index++) + { + if (iadd[i] != 0) + Interlocked.Add(ref sumPt[index], iadd[i]); + } + } + + /// + /// 集計ƒƒƒƒ•‚ĦĉŒ‡ċš‚¤ƒ³ƒ‡ƒƒ‚Ż‚ıĞfloat3‚’ċ›şċšċ°ĉ•°ç‚ı¨—ĤċŠ ç—™‚‹ïĵˆ‚Ğ‚Ĥƒ³ƒˆŻĉ“ä½œ—Ş„ïĵ‰ + /// + /// + /// + /// + unsafe internal static void AddFloat3(int index, float3 add, int* sumPt) + { + int3 iadd = (int3)(add * ToFixed); + index *= 3; + for (int i = 0; i < 3; i++, index++) + { + if (iadd[i] != 0) + Interlocked.Add(ref sumPt[index], iadd[i]); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + unsafe internal static void Max(int index, float value, int* pt) + { + int ival = (int)value * ToFixed; + int now = pt[index]; + int oldNow = now + 1; + + while (ival > now && now != oldNow) + { + oldNow = now; + now = Interlocked.CompareExchange(ref pt[index], ival, now); + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + unsafe internal static float3 ReadAverageFloat3(int index, int* cntPt, int* sumPt) + { + int count = cntPt[index]; + if (count == 0) + return 0; + + int dataIndex = index * 3; + + // 集計 + float3 add = new float3(sumPt[dataIndex], sumPt[dataIndex + 1], sumPt[dataIndex + 2]); + add /= count; + + // ƒ‡ƒĵ‚żŻċ›şċšċ°ĉ•°ç‚ıŞ§ĉˆğ™ + add *= ToFloat; + + return add; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + unsafe internal static float3 ReadFloat3(int index, int* vecPt) + { + int dataIndex = index * 3; + float3 v = new float3(vecPt[dataIndex], vecPt[dataIndex + 1], vecPt[dataIndex + 2]); + + // ƒ‡ƒĵ‚żŻċ›şċšċ°ĉ•°ç‚ıŞ§ĉˆğ™ + v *= ToFloat; + + return v; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + unsafe internal static float ReadFloat(int index, int* floatPt) + { + return floatPt[index] * ToFloat; + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/Jobs/InterlockUtility.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Utility/Jobs/InterlockUtility.cs.meta new file mode 100644 index 00000000..3f7d76f9 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/Jobs/InterlockUtility.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: a2fbf5e2678edef418b3d95dd46af37b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Utility/Jobs/InterlockUtility.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/Jobs/JobUtility.cs b/Assets/MagicaCloth2/Scripts/Core/Utility/Jobs/JobUtility.cs new file mode 100644 index 00000000..68c7ee4b --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/Jobs/JobUtility.cs @@ -0,0 +1,717 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System; +using Unity.Burst; +using Unity.Collections; +using Unity.Jobs; +using Unity.Mathematics; +using UnityEngine; + +namespace MagicaCloth2 +{ + public static class JobUtility + { + //========================================================================================= + /// + /// 配ċˆ—‚’Value§ċŸ‹‚‚‹‚¸ƒ§ƒ–‚’発èĦŒ—™ + /// ‚¸‚§ƒƒŞƒƒ‚Żċž‹‚¸ƒ§ƒ–Żĉ˜Žç¤şçš„Ğċž‹‚’§ĉŒ‡ċš™‚‹ċż…èĤŒ‚‚‹Ÿ‚ċž‹”¨Ğ関ĉ•°Œç™şç”Ÿ—™ + /// + /// + /// + /// + /// + /// + /// + public static JobHandle Fill(NativeArray array, int length, int value, JobHandle dependsOn = new JobHandle()) + { + var job = new FillJob() { value = value, array = array, }; + return job.Schedule(length, 32, dependsOn); + } + + public static JobHandle Fill(NativeArray array, int length, Vector4 value, JobHandle dependsOn = new JobHandle()) + { + var job = new FillJob() { value = value, array = array, }; + return job.Schedule(length, 32, dependsOn); + } + + public static JobHandle Fill(NativeArray array, int length, VirtualMeshBoneWeight value, JobHandle dependsOn = new JobHandle()) + { + var job = new FillJob() { value = value, array = array, }; + return job.Schedule(length, 32, dependsOn); + } + + public static JobHandle Fill(NativeArray array, int length, byte value, JobHandle dependsOn = new JobHandle()) + { + var job = new FillJob() { value = value, array = array, }; + return job.Schedule(length, 32, dependsOn); + } + + public static void FillRun(NativeArray array, int length, int value) + { + var job = new FillJob() { value = value, array = array, }; + job.Run(length); + } + + public static void FillRun(NativeArray array, int length, Vector4 value) + { + var job = new FillJob() { value = value, array = array, }; + job.Run(length); + } + + public static void FillRun(NativeArray array, int length, quaternion value) + { + var job = new FillJob() { value = value, array = array, }; + job.Run(length); + } + + public static void FillRun(NativeArray array, int length, VirtualMeshBoneWeight value) + { + var job = new FillJob() { value = value, array = array, }; + job.Run(length); + } + + + [BurstCompile] + struct FillJob : IJobParallelFor where T : unmanaged + { + public T value; + + [Unity.Collections.WriteOnly] + public NativeArray array; + + public void Execute(int index) + { + array[index] = value; + } + } + + /// + /// 配ċˆ—‚’Value§ċŸ‹‚‚‹‚¸ƒ§ƒ–‚’発èĦŒ—™(startIndex‚‚Š) + /// ‚¸‚§ƒƒŞƒƒ‚Żċž‹‚¸ƒ§ƒ–Żĉ˜Žç¤şçš„Ğċž‹‚’§ĉŒ‡ċš™‚‹ċż…èĤŒ‚‚‹Ÿ‚ċž‹”¨Ğ関ĉ•°Œç™şç”Ÿ—™ + /// + /// + /// + /// + /// + /// + /// + /// + public static JobHandle Fill(NativeArray array, int startIndex, int length, int value, JobHandle dependsOn = new JobHandle()) + { + var job = new FillJob2() { value = value, startIndex = startIndex, array = array, }; + return job.Schedule(length, 32, dependsOn); + } + + [BurstCompile] + struct FillJob2 : IJobParallelFor where T : unmanaged + { + public T value; + public int startIndex; + + [NativeDisableParallelForRestriction] + [Unity.Collections.WriteOnly] + public NativeArray array; + + public void Execute(int index) + { + array[startIndex + index] = value; + } + } + + public static JobHandle Fill(NativeReference reference, int value, JobHandle dependsOn = new JobHandle()) + { + var job = new FillRefJob() { value = value, reference = reference, }; + return job.Schedule(dependsOn); + } + + [BurstCompile] + struct FillRefJob : IJob where T : unmanaged + { + public T value; + + [Unity.Collections.WriteOnly] + public NativeReference reference; + + public void Execute() + { + reference.Value = value; + } + } + + //========================================================================================= + /// + /// 配ċˆ—Ğé€£ç•Ş‚’ĉ ĵ納™‚‹‚¸ƒ§ƒ–‚’発èĦŒ—™ + /// + /// + /// + /// + /// + public static JobHandle SerialNumber(NativeArray array, int length, JobHandle dependsOn = new JobHandle()) + { + var job = new SerialNumberJob() + { + array = array, + }; + return job.Schedule(length, 32, dependsOn); + } + + public static void SerialNumberRun(NativeArray array, int length) + { + var job = new SerialNumberJob() + { + array = array, + }; + job.Run(length); + + } + + [BurstCompile] + struct SerialNumberJob : IJobParallelFor + { + [Unity.Collections.WriteOnly] + public NativeArray array; + + public void Execute(int index) + { + array[index] = index; + } + } + + //========================================================================================= + /// + /// NativeHashSet‚­ƒĵ‚’NativeListĞċ¤‰ĉ›™‚‹‚¸ƒ§ƒ–‚’発èĦŒ—™ + /// ‚¸‚§ƒƒŞƒƒ‚Żċž‹‚¸ƒ§ƒ–Żĉ˜Žç¤şçš„Ğċž‹‚’§ĉŒ‡ċš™‚‹ċż…èĤŒ‚‚‹Ÿ‚ċž‹”¨Ğ関ĉ•°Œç™şç”Ÿ—™ + /// + /// + /// + /// + /// + /// + public static JobHandle ConvertHashSetToNativeList(NativeParallelHashSet hashSet, NativeList list, JobHandle dependsOn = new JobHandle()) + { + var job = new ConvertHashSetToListJob() { hashSet = hashSet, list = list, }; + return job.Schedule(dependsOn); + } + + [BurstCompile] + struct ConvertHashSetToListJob : IJob where T : unmanaged, IEquatable + { + [Unity.Collections.ReadOnly] + public NativeParallelHashSet hashSet; + [Unity.Collections.WriteOnly] + public NativeList list; + + public void Execute() + { + foreach (var key in hashSet) + { + list.AddNoResize(key); + } + } + } + + //========================================================================================= +#if false + /// + /// NativeMultiHashMap‚­ƒĵ‚’NativeListĞċ¤‰ĉ›™‚‹‚¸ƒ§ƒ–‚’発èĦŒ™‚‹ + /// ‚¸‚§ƒƒŞƒƒ‚Żċž‹‚¸ƒ§ƒ–Żĉ˜Žç¤şçš„Ğċž‹‚’§ĉŒ‡ċš™‚‹ċż…èĤŒ‚‚‹Ÿ‚ċž‹”¨Ğ関ĉ•°Œç™şç”Ÿ—™ + /// + /// + /// + /// + /// + /// + /// + public static JobHandle ConvertMultiHashMapKeyToNativeList( + NativeParallelMultiHashMap hashMap, + NativeList keyList, + JobHandle dependsOn = new JobHandle()) + { + // todo:“ċ‡Ĥ理Żé‡„ + var job = new ConvertMultiHashMapKeyToListJob() + { + hashMap = hashMap, + list = keyList, + }; + return job.Schedule(dependsOn); + } + + [BurstCompile] + struct ConvertMultiHashMapKeyToListJob : IJob where T : unmanaged, IEquatable where U : unmanaged + { + [Unity.Collections.ReadOnly] + public NativeParallelMultiHashMap hashMap; + [Unity.Collections.WriteOnly] + public NativeList list; + + public void Execute() + { + var keySet = new NativeParallelHashSet(hashMap.Count(), Allocator.Temp); // ““Œċ•éĦŒ¨Ş‚‹ċŻèƒ½ĉ€§Œ‚‚‹(unity2023.1.5事äğĥ) + var keyArray = hashMap.GetKeyArray(Allocator.Temp); // ““Œċ•éĦŒ¨Ş‚‹ċŻèƒ½ĉ€§Œ‚‚‹(unity2023.1.5事äğĥ) + // GetKeyArray()çµĉžœŻ‚­ƒĵŒé‡è¤‡—Ÿé †ä¸ċŒŞ§ĉ³¨ĉ„ïĵ + for (int i = 0; i < keyArray.Length; i++) + keySet.Add(keyArray[i]); + + foreach (var key in keySet) + list.Add(key); + } + } +#endif + + //========================================================================================= + /// + /// NativeHashSetċ†…ċı‚’NativeListĞċ¤‰ĉ›™‚‹‚¸ƒ§ƒ–‚’発èĦŒ™‚‹ + /// ‚¸‚§ƒƒŞƒƒ‚Żċž‹‚¸ƒ§ƒ–Żĉ˜Žç¤şçš„Ğċž‹‚’§ĉŒ‡ċš™‚‹ċż…èĤŒ‚‚‹Ÿ‚ċž‹”¨Ğ関ĉ•°Œç™şç”Ÿ—™ + /// + /// + /// + /// + /// + public static JobHandle ConvertHashSetKeyToNativeList( + NativeParallelHashSet hashSet, + NativeList keyList, + JobHandle dependsOn = new JobHandle()) + { + var job = new ConvertHashSetKeyToListJob() { hashSet = hashSet, list = keyList, }; + return job.Schedule(dependsOn); + } + + public static JobHandle ConvertHashSetKeyToNativeList( + NativeParallelHashSet hashSet, + NativeList keyList, + JobHandle dependsOn = new JobHandle()) + { + var job = new ConvertHashSetKeyToListJob() { hashSet = hashSet, list = keyList, }; + return job.Schedule(dependsOn); + } + + [BurstCompile] + struct ConvertHashSetKeyToListJob : IJob where T : unmanaged, IEquatable + { + [Unity.Collections.ReadOnly] + public NativeParallelHashSet hashSet; + [Unity.Collections.WriteOnly] + public NativeList list; + + public void Execute() + { + // 順不ċŒŞ§ĉ³¨ĉ„ïĵ + foreach (var key in hashSet) + list.Add(key); + } + } + + //========================================================================================= + /// + /// AABB‚’計痁—Ĥèż”™‚¸ƒ§ƒ–‚’発èĦŒ™‚‹(NativeArray) + /// + /// + /// + /// + /// + /// + public static JobHandle CalcAABB(NativeArray positions, int length, NativeReference outAABB, JobHandle dependsOn = new JobHandle()) + { + var job = new CalcAABBJob() + { + length = length, + positions = positions, + outAABB = outAABB, + }; + return job.Schedule(dependsOn); + } + + public static void CalcAABBRun(NativeArray positions, int length, NativeReference outAABB) + { + var job = new CalcAABBJob() + { + length = length, + positions = positions, + outAABB = outAABB, + }; + job.Run(); + } + + /// + /// AABB‚’計痁—Ĥèż”™‚¸ƒ§ƒ–‚’発èĦŒ™‚‹(NativeList) + /// + /// + /// + /// + /// + public static JobHandle CalcAABB(NativeList positions, NativeReference outAABB, JobHandle dependsOn = new JobHandle()) + { + var job = new CalcAABBDeferJob() + { + positions = positions, + outAABB = outAABB, + }; + return job.Schedule(dependsOn); + } + + public static void CalcAABBRun(NativeList positions, NativeReference outAABB) + { + var job = new CalcAABBDeferJob() + { + positions = positions, + outAABB = outAABB, + }; + job.Run(); + } + + [BurstCompile] + struct CalcAABBJob : IJob + { + public int length; + + [Unity.Collections.ReadOnly] + public NativeArray positions; + + public NativeReference outAABB; + + public void Execute() + { + outAABB.Value = CalcAABBInternal(positions, length); + } + } + + [BurstCompile] + struct CalcAABBDeferJob : IJob + { + [Unity.Collections.ReadOnly] + public NativeList positions; + + public NativeReference outAABB; + + public void Execute() + { + outAABB.Value = CalcAABBInternal(positions.AsArray(), positions.Length); + } + } + + static AABB CalcAABBInternal(in NativeArray positions, int length) + { + if (positions.Length == 0) + { + return new AABB(); + } + + //float3 min = 0; + //float3 max = 0; + float3 min = float.MaxValue; + float3 max = float.MinValue; + + for (int i = 0; i < length; i++) + { + float3 pos = positions[i]; + min = math.min(min, pos); + max = math.max(max, pos); + } + + var aabb = new AABB(min, max); + return aabb; + } + + //========================================================================================= + /// + /// ‚ıƒ•‚£‚˘ƒžƒƒƒ”ƒ³‚°‚’èĦŒ„UV‚’ç—ċ‡ş™‚‹‚¸ƒ§ƒ–‚’発èĦŒ™‚‹ + /// “UVŻĉŽç·šè¨ˆç—用§‚‚Šƒ†‚Ż‚ıƒƒ£ç”¨§ŻŞ„§ĉ³¨ĉ„ïĵ + /// + /// + /// + /// + /// + /// + /// + public static JobHandle CalcUVWithSphereMapping(NativeArray positions, int length, NativeReference aabb, NativeArray outUVs, JobHandle dependsOn = new JobHandle()) + { + var job = new CalcUVJob() + { + positions = positions, + aabb = aabb, + uvs = outUVs, + }; + return job.Schedule(length, 32, dependsOn); + } + + public static void CalcUVWithSphereMappingRun(NativeArray positions, int length, NativeReference aabb, NativeArray outUVs) + { + var job = new CalcUVJob() + { + positions = positions, + aabb = aabb, + uvs = outUVs, + }; + job.Run(length); + } + + [BurstCompile] + struct CalcUVJob : IJobParallelFor + { + [Unity.Collections.ReadOnly] + public NativeArray positions; + [Unity.Collections.ReadOnly] + public NativeReference aabb; + + [Unity.Collections.WriteOnly] + public NativeArray uvs; + + public void Execute(int index) + { + // 中ċżƒä½ç½‹‚‰‚ıƒ•‚£‚˘ƒžƒƒƒ”ƒ³‚° + float3 lv = positions[index] - aabb.Value.Center; + lv = math.normalize(lv); + + float u = math.atan2(lv.x, lv.z); + u = math.clamp(math.unlerp(-math.PI, math.PI, u), 0.0f, 1.0f); + + float v = math.dot(math.up(), lv); + v = math.clamp(math.unlerp(1.0f, -1.0f, v), 0.0f, 1.0f); + + //float2 uv = new float2(u, v); // “Ħ‚‰Żĉ¨Şĉ–ıċ‘ƒ™ƒĵ‚ıĞŞ‚‹ + float2 uv = new float2(v, u); // “Ħ‚‰Żç¸Ĥĉ–ıċ‘ƒ™ƒĵ‚ıĞŞ‚‹ + +#if false + float len = math.length(lv); + float add = index * 0.001234f; // UV‚’ċċĤ™Ğš‚‰™Ÿ‚ċŠ ç—ċ€¤ + uv += len * 0.01f + add; +#endif +#if false + //float len = math.length(lv); + float add = index * 0.0001234f; // UV‚’ċċĤ™Ğš‚‰™Ÿ‚ċŠ ç—ċ€¤ + //uv += len * 0.1f + add; + uv += add; +#endif +#if true + // ĉ–ıċ‘ƒ™‚ŻƒˆƒĞ上ĞċŒ˜UVŒç”Ÿĉˆ•‚ŒĤ—†‚’避‘‚‹Ÿ‚UVĞè·é›˘‚’ċŠ ç——Ĥš‚‰™ + float add = index * 0.0001234f; // UV‚’ċċĤ™Ğš‚‰™Ÿ‚ċŠ ç—ċ€¤ + + // 頂ç‚ı間UVé–“éš”‚’ċşƒ‚Ğċ–‚Š€ċŒ˜UVŒç™şç”Ÿ—Ş„‚ˆ†Ğ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı‚’ä½ż„ċċĤ™Ğċ€¤‚’š‚‰™ + uv = uv * 10.0f + add; +#endif + + //Debug.Log($"[{index}] {uv}"); + uvs[index] = uv; + } + } + + //========================================================================================= + /// + /// intƒ‡ƒĵ‚ż‚’ċŠ ç——Ĥĉ–°—„é ˜ċŸŸĞ‚³ƒ”ƒĵ™‚‹ + /// + [BurstCompile] + public struct AddIntDataCopyJob : IJobParallelFor + { + public int dstOffset; + public int addData; + + // src + [Unity.Collections.ReadOnly] + public NativeArray srcData; + + // dst + [NativeDisableParallelForRestriction] + [Unity.Collections.WriteOnly] + public NativeArray dstData; + + public void Execute(int index) + { + int dindex = dstOffset + index; + var data = srcData[index]; + data += addData; + dstData[dindex] = data; + } + } + + /// + /// int2ƒ‡ƒĵ‚ż‚’ċŠ ç——Ĥĉ–°—„é ˜ċŸŸĞ‚³ƒ”ƒĵ™‚‹ + /// + [BurstCompile] + public struct AddInt2DataCopyJob : IJobParallelFor + { + public int dstOffset; + public int2 addData; + + // src + [Unity.Collections.ReadOnly] + public NativeArray srcData; + + // dst + [NativeDisableParallelForRestriction] + [Unity.Collections.WriteOnly] + public NativeArray dstData; + + public void Execute(int index) + { + int dindex = dstOffset + index; + var data = srcData[index]; + data += addData; + dstData[dindex] = data; + } + } + + /// + /// int3ƒ‡ƒĵ‚ż‚’ċŠ ç——Ĥĉ–°—„é ˜ċŸŸĞ‚³ƒ”ƒĵ™‚‹ + /// + [BurstCompile] + public struct AddInt3DataCopyJob : IJobParallelFor + { + public int dstOffset; + public int3 addData; + + // src + [Unity.Collections.ReadOnly] + public NativeArray srcData; + + // dst + [NativeDisableParallelForRestriction] + [Unity.Collections.WriteOnly] + public NativeArray dstData; + + public void Execute(int index) + { + int dindex = dstOffset + index; + var data = srcData[index]; + data += addData; + dstData[dindex] = data; + } + } + + //========================================================================================= + /// + /// ċş§ĉ¨™‚’ċ¤‰ĉ›™‚‹‚¸ƒ§ƒ–‚’発èĦŒ—™ + /// + /// + /// + /// + /// + /// + public static JobHandle TransformPosition(NativeArray positions, int length, in float4x4 toM, JobHandle dependsOn = new JobHandle()) + { + var job = new TransformPositionJob() { toM = toM, positions = positions, }; + return job.Schedule(length, 32, dependsOn); + } + + public static void TransformPositionRun(NativeArray positions, int length, in float4x4 toM) + { + var job = new TransformPositionJob() { toM = toM, positions = positions, }; + job.Run(length); + } + + public static JobHandle TransformPosition(NativeArray srcPositions, NativeArray dstPositions, int length, in float4x4 toM, JobHandle dependsOn = new JobHandle()) + { + var job = new TransformPositionJob2() { toM = toM, srcPositions = srcPositions, dstPositions = dstPositions }; + return job.Schedule(length, 32, dependsOn); + } + + public static void TransformPositionRun(NativeArray srcPositions, NativeArray dstPositions, int length, in float4x4 toM) + { + var job = new TransformPositionJob2() { toM = toM, srcPositions = srcPositions, dstPositions = dstPositions }; + job.Run(length); + } + + [BurstCompile] + public struct TransformPositionJob : IJobParallelFor + { + public float4x4 toM; + public NativeArray positions; + + public void Execute(int vindex) + { + positions[vindex] = MathUtility.TransformPoint(positions[vindex], toM); + } + } + + [BurstCompile] + public struct TransformPositionJob2 : IJobParallelFor + { + public float4x4 toM; + [Unity.Collections.ReadOnly] + public NativeArray srcPositions; + [Unity.Collections.WriteOnly] + public NativeArray dstPositions; + + public void Execute(int vindex) + { + dstPositions[vindex] = MathUtility.TransformPoint(srcPositions[vindex], toM); + } + } + + //========================================================================================= + /// + /// ‚ı‚żƒĵƒˆ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ıïĵ‹ƒ‡ƒĵ‚żĉ•°¨ƒ‡ƒĵ‚żïĵ’¤é…ċˆ—‹‚‰HashMap‚’ĉ§‹ç݉—Ĥèż”™ + /// + /// + /// + /// + public static NativeParallelMultiHashMap ToNativeMultiHashMap(in NativeArray indexArray, in NativeArray dataArray) + { + var map = new NativeParallelMultiHashMap(dataArray.Length, Allocator.Persistent); + + var job = new ConvertArrayToMapJob() + { + indexArray = indexArray, + dataArray = dataArray, + map = map, + }; + job.Run(); + + return map; + } + + [BurstCompile] + struct ConvertArrayToMapJob : IJob where TData : unmanaged + { + [Unity.Collections.ReadOnly] + public NativeArray indexArray; + [Unity.Collections.ReadOnly] + public NativeArray dataArray; + + [Unity.Collections.WriteOnly] + public NativeParallelMultiHashMap map; + + public void Execute() + { + int cnt = indexArray.Length; + for (int i = 0; i < cnt; i++) + { + DataUtility.Unpack12_20(indexArray[i], out var dcnt, out var dstart); + + for (int j = 0; j < dcnt; j++) + { + var data = dataArray[dstart + j]; + map.Add(i, data); + } + } + } + } + + //========================================================================================= + /// + /// NativeReference‚’‚ŻƒŞ‚˘™‚‹‚¸ƒ§ƒ–‚’発èĦŒ™‚‹ + /// + /// + /// + /// + public static JobHandle ClearReference(NativeReference reference, JobHandle jobHandle) + { + var job = new ClearReferenceJob() + { + reference = reference, + }; + return job.Schedule(jobHandle); + } + + [BurstCompile] + struct ClearReferenceJob : IJob + { + public NativeReference reference; + + public void Execute() + { + reference.Value = 0; + } + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/Jobs/JobUtility.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Utility/Jobs/JobUtility.cs.meta new file mode 100644 index 00000000..eac63c41 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/Jobs/JobUtility.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: d429f1aa0fb37ca4d9eedbec119474ea +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Utility/Jobs/JobUtility.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/Math.meta b/Assets/MagicaCloth2/Scripts/Core/Utility/Math.meta new file mode 100644 index 00000000..2c567a16 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/Math.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5abf9b52a60ea9843b4f61eee44d06f7 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/Math/AABB.cs b/Assets/MagicaCloth2/Scripts/Core/Utility/Math/AABB.cs new file mode 100644 index 00000000..933517d4 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/Math/AABB.cs @@ -0,0 +1,238 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System; +using System.Runtime.CompilerServices; +using Unity.Mathematics; + +namespace MagicaCloth2 +{ + /// + /// “AABBĉ§‹é€ ä½“ŻUnity.Mathematics.Geometry.MinMaxAABB‚’ç§ğĉ¤—Ÿ‚‚§™€‚ + /// MinMaxAABBŻinternalŸ‚ċ¤–部‹‚‰ċˆİ用™‚‹“¨Œ§›‚“€‚ + /// “‚³ƒĵƒ‰Ż™ıĤMinMaxAABB‚³ƒ”ƒĵ¨Ş‚Ё™€‚ + /// + [System.Serializable] + public struct AABB : IEquatable + { + /// + /// The minimum point contained by the AABB. + /// + /// + /// If any component of is greater than then this AABB is invalid. + /// + /// + public float3 Min; + + /// + /// The maximum point contained by the AABB. + /// + /// + /// If any component of is less than then this AABB is invalid. + /// + /// + public float3 Max; + + /// + /// Constructs the AABB with the given minimum and maximum. + /// + /// + /// If you have a center and extents, you can call or + /// to create the AABB. + /// + /// Minimum point inside AABB. + /// Maximum point inside AABB. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public AABB(in float3 min, in float3 max) + { + Min = min; + Max = max; + } + + /// + /// Creates the AABB from a center and extents. + /// + /// + /// This function takes full extents. It is the distance between and . + /// If you have half extents, you can call . + /// + /// Center of AABB. + /// Full extents of AABB. + /// AABB created from inputs. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static AABB CreateFromCenterAndExtents(float3 center, float3 extents) + { + return CreateFromCenterAndHalfExtents(center, extents * 0.5f); + } + + /// + /// Creates the AABB from a center and half extents. + /// + /// + /// This function takes half extents. It is half the distance between and . + /// If you have full extents, you can call . + /// + /// Center of AABB. + /// Half extents of AABB. + /// AABB created from inputs. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static AABB CreateFromCenterAndHalfExtents(float3 center, float3 halfExtents) + { + return new AABB(center - halfExtents, center + halfExtents); + } + + /// + /// Computes the extents of the AABB. + /// + /// + /// Extents is the componentwise distance between min and max. + /// + public float3 Extents => Max - Min; + + /// + /// Computes the half extents of the AABB. + /// + /// + /// HalfExtents is half of the componentwise distance between min and max. Subtracting HalfExtents from Center + /// gives Min and adding HalfExtents to Center gives Max. + /// + public float3 HalfExtents => (Max - Min) * 0.5f; + + /// + /// Computes the center of the AABB. + /// + public float3 Center => (Max + Min) * 0.5f; + + /// + /// ĉœ€ċ¤§èşé•·•‚’èż”™ + /// + public float MaxSideLength + { + get + { + var ext = Extents; + return math.max(math.max(ext.x, ext.y), ext.z); + } + } + + /// + /// Check if the AABB is valid. + /// + /// + /// An AABB is considered valid if is componentwise less than or equal to . + /// + /// True if is componentwise less than or equal to . + public bool IsValid => math.all(Min <= Max); + + /// + /// Computes the surface area for this axis aligned bounding box. + /// + public float SurfaceArea + { + get + { + float3 diff = Max - Min; + return 2 * math.dot(diff, diff.yzx); + } + } + + /// + /// Tests if the input point is contained by the AABB. + /// + /// Point to test. + /// True if AABB contains the input point. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Contains(in float3 point) => math.all(point >= Min & point <= Max); + + /// + /// Tests if the input AABB is contained entirely by this AABB. + /// + /// AABB to test. + /// True if input AABB is contained entirely by this AABB. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Contains(in AABB aabb) => math.all((Min <= aabb.Min) & (Max >= aabb.Max)); + + /// + /// Tests if the input AABB overlaps this AABB. + /// + /// AABB to test. + /// True if input AABB overlaps with this AABB. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Overlaps(in AABB aabb) + { + return math.all(Max >= aabb.Min & Min <= aabb.Max); + } + + /// + /// Expands the AABB by the given signed distance. + /// + /// + /// Positive distance expands the AABB while negative distance shrinks the AABB. + /// + /// Signed distance to expand the AABB with. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Expand(float signedDistance) + { + Min -= signedDistance; + Max += signedDistance; + } + + /// + /// Encapsulates the given AABB. + /// + /// + /// Modifies this AABB so that it contains the given AABB. If the given AABB is already contained by this AABB, + /// then this AABB doesn't change. + /// + /// + /// AABB to encapsulate. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Encapsulate(in AABB aabb) + { + Min = math.min(Min, aabb.Min); + Max = math.max(Max, aabb.Max); + } + + /// + /// Encapsulate the given point. + /// + /// + /// Modifies this AABB so that it contains the given point. If the given point is already contained by this AABB, + /// then this AABB doesn't change. + /// + /// + /// Point to encapsulate. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Encapsulate(in float3 point) + { + Min = math.min(Min, point); + Max = math.max(Max, point); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(AABB other) + { + return Min.Equals(other.Min) && Max.Equals(other.Max); + } + + /// + /// ċ¤‰ĉ›ƒžƒˆƒŞƒƒ‚Ż‚ıĞ‚ˆ‚Šċş§ĉ¨™‚’ċ¤‰ĉ›•›‚‹ + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Transform(in float4x4 toM) + { + float3 min = math.transform(toM, Min); + float3 max = math.transform(toM, Max); + Min = math.min(min, max); + Max = math.max(min, max); + } + + public override string ToString() + { + //return string.Format("AABB({0}, {1})", Min, Max); + return $"AABB Center:{Center}, HalfExtents:{HalfExtents}, Min:{Min}, Max:{Max}"; + } + } + +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/Math/AABB.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Utility/Math/AABB.cs.meta new file mode 100644 index 00000000..a9c837f7 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/Math/AABB.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: ae15307e07485a447aa84cda0ddb05e1 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Utility/Math/AABB.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/Math/IntAABB.cs b/Assets/MagicaCloth2/Scripts/Core/Utility/Math/IntAABB.cs new file mode 100644 index 00000000..dcfcfe5e --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/Math/IntAABB.cs @@ -0,0 +1,158 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System; +using System.Runtime.CompilerServices; +using Unity.Mathematics; + +namespace MagicaCloth2 +{ + /// + /// int3ċž‹AABB + /// + [System.Serializable] + public struct IntAABB : IEquatable + { + /// + /// The minimum point contained by the AABB. + /// + /// + /// If any component of is greater than then this AABB is invalid. + /// + /// + public int3 Min; + + /// + /// The maximum point contained by the AABB. + /// + /// + /// If any component of is less than then this AABB is invalid. + /// + /// + public int3 Max; + + /// + /// Constructs the AABB with the given minimum and maximum. + /// + /// + /// If you have a center and extents, you can call or + /// to create the AABB. + /// + /// Minimum point inside AABB. + /// Maximum point inside AABB. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public IntAABB(int3 min, int3 max) + { + Min = min; + Max = max; + } + + /// + /// Computes the extents of the AABB. + /// + /// + /// Extents is the componentwise distance between min and max. + /// + public int3 Extents => Max - Min; + + /// + /// Computes the center of the AABB. + /// + public int3 Center => (Max + Min) / 2; + + /// + /// Check if the AABB is valid. + /// + /// + /// An AABB is considered valid if is componentwise less than or equal to . + /// + /// True if is componentwise less than or equal to . + public bool IsValid => math.all(Min <= Max); + + /// + /// Tests if the input point is contained by the AABB. + /// + /// Point to test. + /// True if AABB contains the input point. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Contains(int3 point) => math.all(point >= Min & point <= Max); + + /// + /// Tests if the input AABB is contained entirely by this AABB. + /// + /// AABB to test. + /// True if input AABB is contained entirely by this AABB. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Contains(IntAABB aabb) => math.all((Min <= aabb.Min) & (Max >= aabb.Max)); + + /// + /// Tests if the input AABB overlaps this AABB. + /// + /// AABB to test. + /// True if input AABB overlaps with this AABB. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Overlaps(IntAABB aabb) + { + return math.all(Max >= aabb.Min & Min <= aabb.Max); + } + + /// + /// Expands the AABB by the given signed distance. + /// + /// + /// Positive distance expands the AABB while negative distance shrinks the AABB. + /// + /// Signed distance to expand the AABB with. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Expand(int signedDistance) + { + Min -= signedDistance; + Max += signedDistance; + } + + /// + /// Encapsulates the given AABB. + /// + /// + /// Modifies this AABB so that it contains the given AABB. If the given AABB is already contained by this AABB, + /// then this AABB doesn't change. + /// + /// + /// AABB to encapsulate. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Encapsulate(IntAABB aabb) + { + Min = math.min(Min, aabb.Min); + Max = math.max(Max, aabb.Max); + } + + /// + /// Encapsulate the given point. + /// + /// + /// Modifies this AABB so that it contains the given point. If the given point is already contained by this AABB, + /// then this AABB doesn't change. + /// + /// + /// Point to encapsulate. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Encapsulate(int3 point) + { + Min = math.min(Min, point); + Max = math.max(Max, point); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(IntAABB other) + { + return Min.Equals(other.Min) && Max.Equals(other.Max); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override string ToString() + { + return string.Format("AABB({0}, {1})", Min, Max); + } + } + +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/Math/IntAABB.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Utility/Math/IntAABB.cs.meta new file mode 100644 index 00000000..1e0afc14 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/Math/IntAABB.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 93dbd06f10c49dd4b9ae88b2a9c4c099 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Utility/Math/IntAABB.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/Math/MathExtensions.cs b/Assets/MagicaCloth2/Scripts/Core/Utility/Math/MathExtensions.cs new file mode 100644 index 00000000..c328dc43 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/Math/MathExtensions.cs @@ -0,0 +1,61 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System.Runtime.CompilerServices; +using Unity.Mathematics; + +namespace MagicaCloth2 +{ + public static class MathExtensions + { + /// + /// float4x4‚’16é…ċˆ—¨—Ĥĉ‰ħ†Ÿ‚ĉ‹Ħċĵµ + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float MC2GetValue(in this float4x4 m, int index) + { + index = math.clamp(index, 0, 15); + return m[index / 4][index % 4]; + } + + /// + /// float4x4‚’16é…ċˆ—¨—Ĥĉ‰ħ†Ÿ‚ĉ‹Ħċĵµ + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void MC2SetValue(ref this float4x4 m, int index, float value) + { + index = math.clamp(index, 0, 15); + m[index / 4][index % 4] = value; + } + + /// + /// AnimationCurveŒĉ ĵ納•‚ŒŸfloat4x4‹‚‰ƒ‡ƒĵ‚ż‚’ċ–ċ—™‚‹(0.0 ~ 1.0§‚Żƒİƒ³ƒ—) + /// + /// + /// 0.0 ~ 1.0 + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float MC2EvaluateCurveClamp01(in this float4x4 m, float time) + { + return math.saturate(DataUtility.EvaluateCurve(m, time)); + } + + /// + /// AnimationCurveŒĉ ĵ納•‚ŒŸfloat4x4‹‚‰ƒ‡ƒĵ‚ż‚’ċ–ċ—™‚‹ + /// + /// + /// 0.0 ~ 1.0 + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float MC2EvaluateCurve(in this float4x4 m, float time) + { + return DataUtility.EvaluateCurve(m, time); + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/Math/MathExtensions.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Utility/Math/MathExtensions.cs.meta new file mode 100644 index 00000000..c8ac2e2b --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/Math/MathExtensions.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: ae8fc4e69ea083a4081671c5eff29606 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Utility/Math/MathExtensions.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/Math/MathUtility.cs b/Assets/MagicaCloth2/Scripts/Core/Utility/Math/MathUtility.cs new file mode 100644 index 00000000..ee98ceae --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/Math/MathUtility.cs @@ -0,0 +1,1814 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System.Runtime.CompilerServices; +using Unity.Mathematics; +using UnityEngine; + +namespace MagicaCloth2 +{ + public static class MathUtility + { + /// + /// NaNċˆ¤ċš + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool IsNaN(float3 v) + { + return math.any(math.isnan(v)); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool IsNaN(float4 v) + { + return math.any(math.isnan(v)); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool IsNaN(quaternion q) + { + return math.any(math.isnan(q.value)); + } + + /// + /// ‚ĵƒ­é•·•ċˆ¤ċš + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool IsZeroDistance(float3 v) + { + return math.length(v) < 1e-8f; + } + + /// + /// ĉ•°ċ€¤‚’(-1.0f~1.0f)Ğ‚Żƒİƒ³ƒ—™‚‹ + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float Clamp1(float a) + { + return math.clamp(a, -1.0f, 1.0f); + } + + /// + /// ĉŠ•ċ½ħƒ™‚ŻƒˆƒĞ‚’ĉħ‚‚‚‹ + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 Project(in float3 v, in float3 n) + { + return math.dot(v, n) * n; + } + + /// + /// ƒ™‚ŻƒˆƒĞ‚’ċı³é˘ĞĉŠ•ċ½ħ™‚‹ + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 ProjectOnPlane(in float3 v, in float3 n) + { + return v - math.dot(v, n) * n; + } + + /// + /// ïĵ’¤ƒ™‚ŻƒˆƒĞŞ™è§’‚’èż”™ïĵˆƒİ‚¸‚˘ƒ³ïĵ‰ + /// + /// + /// + /// ƒİ‚¸‚˘ƒ³ + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float Angle(in float3 v1, in float3 v2) + { + float len1 = math.length(v1); + float len2 = math.length(v2); + + Develop.Assert(len1 * len2 > 0.0f); + float cos_sita = math.dot(v1, v2) / (len1 * len2); + + float sita = math.acos(Clamp1(cos_sita)); + + //return degrees(sita); + return sita; + } + + /// + /// ƒ™‚ŻƒˆƒĞé•·•‚’‚Żƒİƒ³ƒ—™‚‹ + /// + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 ClampVector(float3 v, float minlength, float maxlength) + { + float len = math.length(v); + if (len > 1e-09f) + { + if (len > maxlength) + { + v *= (maxlength / len); + } + else if (len < minlength) + { + v *= (minlength / len); + } + } + + return v; + } + + /// + /// ƒ™‚ŻƒˆƒĞé•·•‚’‚Żƒİƒ³ƒ—™‚‹ + /// + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 ClampVector(float3 v, float maxlength) + { + float len = math.length(v); + if (len > 1e-09f && len > maxlength) + { + v *= (maxlength / len); + } + + return v; + } + + /// + /// frotm‹‚‰to¸ç§ğċ‹•‚’ĉœ€ċ¤§ç§ğċ‹•è·é›˘§‚Żƒİƒ³ƒ—™‚‹ + /// + /// ċŸşĉş–ċş§ĉ¨™ + /// ç›ĉ¨™ċş§ĉ¨™ + /// ĉœ€ċ¤§ç§ğċ‹•è·é›˘ + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 ClampDistance(float3 from, float3 to, float maxlength) + { + float len = math.distance(from, to); + if (len <= maxlength) + return to; + + Develop.Assert(len > 0.0f); + float t = maxlength / len; + return math.lerp(from, to, t); + } + + /// + /// ƒ™‚ŻƒˆƒĞ(dir)‚’ĉœ€ċ¤§è§’ċşĤĞ‚Żƒİƒ³ƒ—™‚‹ + /// + /// + /// + /// ĉœ€ċ¤§è§’ċşĤïĵˆƒİ‚¸‚˘ƒ³ïĵ‰ + /// + public static bool ClampAngle(in float3 dir, in float3 basedir, float maxAngle, out float3 outdir) + { + float3 v1 = math.normalize(dir); + float3 v2 = math.normalize(basedir); + + float c = Clamp1(math.dot(v1, v2)); + float angle = math.acos(c); + + //if (c > 0.9995f || angle <= maxAngle) + if (angle <= maxAngle) + { + // ‚Żƒİƒ³ƒ—ċż…èĤŞ— + outdir = dir; + return false; + } + + // ĉˆğ™ċ‰²ċˆ + Develop.Assert(angle != 0.0f); + float t = (angle - maxAngle) / angle; + + // dir‚’maxAngleĞ‚Żƒİƒ³ƒ—™‚‹‚Ż‚İƒĵ‚żƒ‹‚ރ³‚’ĉħ‚‚‚‹ + float3 axis = math.cross(v1, v2); + if (math.abs(1.0f + c) < 1e-06f) + { + angle = (float)math.PI; + + if (v1.x > v1.y && v1.x > v1.z) + { + axis = math.cross(v1, new float3(0, 1, 0)); + } + else + { + axis = math.cross(v1, new float3(1, 0, 0)); + } + } + else if (math.abs(1.0f - c) < 1e-06f) + { + //angle = 0.0f; + //axis = new float3(1, 0, 0); + outdir = dir; + return false; + } + var q = quaternion.AxisAngle(math.normalize(axis), angle * t); + + outdir = math.mul(q, dir); + return true; + } + + /// + /// from‹‚‰to¸ċ›žèğ˘•›‚‹‚Ż‚İƒĵ‚żƒ‹‚ރ³‚’èż”—™ + /// + /// + /// + /// 補間率(0.0-1.0) + /// + public static quaternion FromToRotation(in float3 from, in float3 to, float t = 1.0f) + { + float3 v1 = math.normalize(from); + float3 v2 = math.normalize(to); + + float c = Clamp1(math.dot(v1, v2)); + float angle = math.acos(c); + float3 axis = math.cross(v1, v2); + + if (math.abs(1.0f + c) < 1e-06f) + { + angle = (float)math.PI; + + if (v1.x > v1.y && v1.x > v1.z) + { + axis = math.cross(v1, new float3(0, 1, 0)); + } + else + { + axis = math.cross(v1, new float3(1, 0, 0)); + } + } + else if (math.abs(1.0f - c) < 1e-06f) + { + //angle = 0.0f; + //axis = new float3(1, 0, 0); + return quaternion.identity; + } + + return quaternion.AxisAngle(math.normalize(axis), angle * t); + } + + /// + /// from‹‚‰to¸ċ›žèğ˘•›‚‹‚Ż‚İƒĵ‚żƒ‹‚ރ³‚’èż”—™(ċ˜ä½ċŒ–Ş—) + /// + /// + /// + /// 補間率(0.0-1.0) + /// + public static quaternion FromToRotationWithoutNormalize(in float3 v1, in float3 v2, float t = 1.0f) + { + //float3 v1 = math.normalize(from); + //float3 v2 = math.normalize(to); + + float c = Clamp1(math.dot(v1, v2)); + float angle = math.acos(c); + float3 axis = math.cross(v1, v2); + + if (math.abs(1.0f + c) < 1e-06f) + { + angle = (float)math.PI; + + if (v1.x > v1.y && v1.x > v1.z) + { + axis = math.cross(v1, new float3(0, 1, 0)); + } + else + { + axis = math.cross(v1, new float3(1, 0, 0)); + } + } + else if (math.abs(1.0f - c) < 1e-06f) + { + //angle = 0.0f; + //axis = new float3(1, 0, 0); + return quaternion.identity; + } + + return quaternion.AxisAngle(math.normalize(axis), angle * t); + } + + /// + /// from‹‚‰to¸ċ›žèğ˘•›‚‹‚Ż‚İƒĵ‚żƒ‹‚ރ³‚’èż”—™ + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static quaternion FromToRotation(in quaternion from, in quaternion to) + { + return math.mul(to, math.inverse(from)); + } + + /// + /// ïĵ’¤‚Ż‚İƒĵ‚żƒ‹‚ރ³è§’ċşĤ‚’èż”—™ïĵˆƒİ‚¸‚˘ƒ³ïĵ‰ + /// 不ĉ­£Ş‚Ż‚İƒĵ‚żƒ‹‚ރ³§ŻçµĉžœŒä¸ċšĞŞ‚‹§ĉ³¨ĉ„ïĵä‹:(0,0,0,0)Şİ + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float Angle(in quaternion a, in quaternion b) + { + const float PI2 = math.PI * 2.0f; + + float dot = math.dot(a, b); + if (math.abs(dot) < 0.9999f) + { + var ang = math.acos(Clamp1(dot)) * 2.0f; // x2.0Œċż…èĤ + return ang > math.PI ? PI2 - ang : ang; + } + else + return 0; + } + + /// + /// ‚Ż‚İƒĵ‚żƒ‹‚ރ³‚’ĉœ€ċ¤§è§’ċşĤĞ‚Żƒİƒ³ƒ——™ + /// + /// ċŸşĉş–ċ›žèğ˘ + /// ç›ĉ¨™ċ›žèğ˘ + /// ĉœ€ċ¤§è§’ċşĤïĵˆƒİ‚¸‚˘ƒ³ïĵ‰ + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static quaternion ClampAngle(quaternion from, quaternion to, float maxAngle) + { + var ang = Angle(from, to); + if (ang <= maxAngle) + return to; + + Develop.Assert(ang != 0.0f); + float t = maxAngle / ang; + + return math.slerp(from, to, t); + } + + /// + /// ĉ³•ç·š¨ĉŽç·š‹‚‰ċ›žèğ˘ċ§żċ‹˘‚’ĉħ‚‚‚‹ + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static quaternion ToRotation(in float3 nor, in float3 tan) + { +#if MC2_DEBUG + // ċ‰ċ…¨ĉ€§ç˘şèލ + float ln = math.length(nor); + float lt = math.length(tan); + Develop.Assert(ln > 0.99f && ln < 1.01f); + Develop.Assert(lt > 0.99f && lt < 1.01f); + float dot = math.dot(nor / ln, tan / lt); + Develop.Assert(dot != 1.0f && dot != -1.0f); +#endif + // 2 ¤ċ…ċŠ›ƒ™‚ŻƒˆƒĞŻċ˜ä½é•·§‚‚Š€ċŒä¸€ç›´ç·šä¸ŠĞŞ„“¨Œċ‰ĉ¨Ş‚Ё™€‚ + return quaternion.LookRotation(tan, nor); + } + + /// + /// ċ›žèğ˘ċ§żċ‹˘‚’ĉ³•ç·š¨ĉŽç·šĞċˆ†è§£—Ĥèż”™ + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void ToNormalTangent(in quaternion rot, out float3 nor, out float3 tan) + { + nor = math.mul(rot, math.up()); + tan = math.mul(rot, math.forward()); + } + + /// + /// ċ›žèğ˘ċ§żċ‹˘‹‚‰ĉ³•ç·š‚’ċ–‚Šċ‡ş™ + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 ToNormal(in quaternion rot) + { + return math.mul(rot, math.up()); + } + + /// + /// ċ›žèğ˘ċ§żċ‹˘‹‚‰ĉŽç·š‚’ċ–‚Šċ‡ş™ + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 ToTangent(in quaternion rot) + { + return math.mul(rot, math.forward()); + } + + /// + /// ċ›žèğ˘ċ§żċ‹˘‹‚‰ċ“ĉ³•ç·š‚’ċ–‚Šċ‡ş™ + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 ToBinormal(in quaternion rot) + { + return math.mul(rot, math.right()); + } + + /// + /// ĉ³•ç·šïĵĉŽç·š‹‚‰ċ“ĉ³•ç·š‚’ĉħ‚‚Ĥèż”™ + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 Binormal(in float3 nor, in float3 tan) + { + return math.cross(nor, tan); + } + + /// + /// ĉ–ıċ‘ƒ™‚ŻƒˆƒĞ‚’XYċ›žèğ˘è§’ċşĤ(ƒİ‚¸‚˘ƒ³)Ğċˆ†é›˘™‚‹€Z角ċşĤŻċ¸¸Ğïĵ§‚‚‹ + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 AxisToEuler(in float3 axis) + { + float angy = math.atan2(axis.x, axis.z); + float angx = math.atan2(-axis.y, math.length(axis - new float3(0, axis.y, 0))); + return new float3(angx, angy, 0); + } + + /// + /// ĉ–ıċ‘ƒ™‚ŻƒˆƒĞ‹‚‰‚Ż‚İƒĵ‚żƒ‹‚ރ³‚’作ĉˆ—Ĥèż”™ + /// ƒ™‚ŻƒˆƒĞŻä¸€ĉ—Ĥ‚Ş‚¤ƒİƒĵ角Ğċˆ†è§£•‚ŒĤ‹‚‰‚Ż‚İƒĵ‚żƒ‹‚ރ³¸çµ„żçĞ‹Ĥ直•‚Œ‚‹ + /// XYċ›žèğ˘è𸂒ċ‰ċš•›‚‹Ÿ‚ + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static quaternion AxisQuaternion(float3 dir) + { + return quaternion.Euler(AxisToEuler(dir)); + } + + /// + /// ‚Ż‚İƒĵ‚żƒ‹‚ރ³‹‚‰ċ›žèğ˘è𸁨ċ›žèğ˘è§’ċşĤ(rad)‚’ċ–ċ—™‚‹ + /// “çµĉžœŻUnity.Quaternion.ToAngleAxis¨ċŒ˜§‚‚‹ïĵˆċƒ…‹ĞèŞ¤ċ·‚‚Šïĵ‰ + /// Ÿ ċ›žèğ˘è§’ċşĤŒ360ċşĤ‚’èĥЁˆ‚‹¨è𸁌逆èğ˘™‚‹§ĉ³¨ĉ„ïĵïĵˆ“‚ŒŻUnity.ToAngleAxis()§‚‚ċŒ˜ïĵ‰ + /// ċ›žèğ˘Œğĵïĵċ ´ċˆŻċ›žèğ˘è𸁨—Ĥ(0, 0, 0)‚’èż”™ïĵˆUnity.ToAngleAxis§Ż(1, 0, 0)) + /// + /// + /// ċ›žèğ˘è§’ċşĤ(rad) + /// ċ›žèğ˘èğ¸ + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void ToAngleAxis(in quaternion q, out float angle, out float3 axis) + { + float a = math.abs(q.value.w) < 0.9999f ? math.acos(q.value.w) : 0; + angle = 2.0f * a; + + float s = math.sin(a); + if (math.abs(s) < 1e-06f) + axis = 0; // Unity.Quaternion.ToAngleAxis§Ż(1, 0, 0) + else + axis = q.value.xyz / s; + } + + /// + /// ‚Ż‚İƒĵ‚żƒ‹‚ރ³‹‚‰‚Ş‚¤ƒİƒĵ角ċşĤ‚’計痁—Ĥèż”™ + /// + /// + /// (Deg)角ċşĤ + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 ToEuler(in quaternion q) + { + float3 angles = 0; + + // ‚Ż‚İƒĵ‚żƒ‹‚ރ³ĉˆċˆ† + float qx = q.value.x; + float qy = q.value.y; + float qz = q.value.z; + float qw = q.value.w; + + // ƒ”ƒƒƒ (xèğ¸ċ›žèğ˘) + float sinX = 2f * (qw * qx - qz * qy); + if (math.abs(sinX) >= 0.99999f) // ‚¸ƒ³ƒƒĞƒ­ƒƒ‚݁ĉ¤œċ‡ş + { + angles.x = math.sign(sinX) * 90f; // Âħ90ċşĤ(deg) + angles.y = math.atan2(2f * (qw * qy + qx * qz), 1f - 2f * (qx * qx + qy * qy)); + angles.y = math.degrees(angles.y); + angles.z = 0f; // ‚¸ƒ³ƒƒĞƒ­ƒƒ‚݁§ƒ­ƒĵƒĞŻä¸ċš + } + else + { + angles.x = math.asin(sinX); + // ƒ¨ƒĵ (yèğ¸ċ›žèğ˘) + angles.y = math.atan2(2f * (qw * qy + qx * qz), 1f - 2f * (qx * qx + qy * qy)); + // ƒ­ƒĵƒĞ (zèğ¸ċ›žèğ˘) + //angles.z = math.atan2(2f * (qw * qz + qx * qy), 1f - 2f * (qy * qy + qz * qz)); + angles.z = math.atan2(2f * (qw * qz + qx * qy), 1f - 2f * (qx * qx + qz * qz)); // İ†‚„‚‰“‚Œ£½„ + angles = math.degrees(angles); + } + + return angles; + } + + /// + /// 与ˆ‚‰‚ŒŸç·šċˆ†abŠ‚ˆ³ç‚ıcĞċ݁—Ĥ€ab上ĉœ€èż‘ĉŽç‚ıt(0.0-1.0)‚’計痁—Ĥèż”™ + /// + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float ClosestPtPointSegmentRatio(in float3 c, in float3 a, in float3 b) + { + float3 ab = b - a; + // ƒ‘ƒİƒĦƒĵ‚żċŒ–•‚ŒĤ„‚‹ä½ç½d(t) = a + t * (b - a) è¨ˆç—Ğ‚ˆ‚ŠabĞc‚’ċ°„ċ½ħ + float dot = math.dot(ab, ab); + // abŒċŒ˜ċş§ĉ¨™‚’考ĉ… + if (dot == 0.0f) + return 0.0f; + //Develop.Assert(dot != 0.0f); + float t = math.dot(c - a, ab) / dot; + // 線ċˆ†ċ¤–ċ´Ğ‚‚‹ċ ´ċˆ€t(ċ“£Ĥd)‚’ĉœ€èż‘ĉŽç‚ı§‚Żƒİƒ³ƒ— + t = math.saturate(t); + return t; + } + + /// + /// 与ˆ‚‰‚ŒŸç·šċˆ†abŠ‚ˆ³ç‚ıcĞċ݁—Ĥ€ab上ĉœ€èż‘ĉŽç‚ıt‚’計痁—Ĥèż”™€‚tŻ‚Żƒİƒ³ƒ—•‚ŒŞ„ + /// + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float ClosestPtPointSegmentRatioNoClamp(float3 c, float3 a, float3 b) + { + float3 ab = b - a; + // ƒ‘ƒİƒĦƒĵ‚żċŒ–•‚ŒĤ„‚‹ä½ç½d(t) = a + t * (b - a) è¨ˆç—Ğ‚ˆ‚ŠabĞc‚’ċ°„ċ½ħ + float dot = math.dot(ab, ab); + Develop.Assert(dot != 0.0f); + float t = math.dot(c - a, ab) / dot; + return t; + } + + /// + /// 与ˆ‚‰‚ŒŸç·šċˆ†abŠ‚ˆ³ç‚ıcĞċ݁—Ĥ€ab上ĉœ€èż‘ĉŽç‚ıċş§ĉ¨™d‚’計痁—Ĥèż”™ + /// + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 ClosestPtPointSegment(float3 c, float3 a, float3 b) + { + float3 ab = b - a; + // ƒ‘ƒİƒĦƒĵ‚żċŒ–•‚ŒĤ„‚‹ä½ç½d(t) = a + t * (b - a) è¨ˆç—Ğ‚ˆ‚ŠabĞc‚’ċ°„ċ½ħ + float dot = math.dot(ab, ab); + Develop.Assert(dot != 0.0f); + float t = math.dot(c - a, ab) / dot; + // 線ċˆ†ċ¤–ċ´Ğ‚‚‹ċ ´ċˆ€t(ċ“£Ĥd)‚’ĉœ€èż‘ĉŽç‚ı§‚Żƒİƒ³ƒ— + t = math.saturate(t); + // ‚Żƒİƒ³ƒ—•‚ŒĤ„‚‹t‹‚‰ċ°„ċ½ħ•‚ŒĤ„‚‹ä½ç½‚’è¨ˆç— + return a + t * ab; + } + + /// + /// 与ˆ‚‰‚ŒŸç·šċˆ†abŠ‚ˆ³ç‚ıcĞċ݁—Ĥ€ab上ĉœ€èż‘ĉŽç‚ıċş§ĉ¨™d‚’計痁—Ĥèż”™€‚dŻ‚Żƒİƒ³ƒ—•‚ŒŞ„ + /// + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 ClosestPtPointSegmentNoClamp(float3 c, float3 a, float3 b) + { + float3 ab = b - a; + // ƒ‘ƒİƒĦƒĵ‚żċŒ–•‚ŒĤ„‚‹ä½ç½d(t) = a + t * (b - a) è¨ˆç—Ğ‚ˆ‚ŠabĞc‚’ċ°„ċ½ħ + float dot = math.dot(ab, ab); + Develop.Assert(dot != 0.0f); + float t = math.dot(c - a, ab) / dot; + // ‚Żƒİƒ³ƒ—•‚ŒĤ„‚‹t‹‚‰ċ°„ċ½ħ•‚ŒĤ„‚‹ä½ç½‚’è¨ˆç— + return a + t * ab; + } + + /// + /// ïĵ’¤ç·šċˆ†(p1-q1)(p2-q2)ĉœ€èż‘ĉŽç‚ı(c1, c2)‚’計痁™‚‹ + /// ĉˆğ‚Šċ€¤¨—Ĥĉœ€èż‘ĉŽç‚ıè·é›˘ċı³ĉ–ı‚’èż”™ + /// + /// 線ċˆ†ïĵ‘ċ§‹ç‚ı + /// 線ċˆ†ïĵ‘çµ‚ç‚ı + /// 線ċˆ†ïĵ’ċ§‹ç‚ı + /// 線ċˆ†ïĵ’çµ‚ç‚ı + /// ĉœ€èż‘ĉŽç‚ıïĵ‘ + /// ĉœ€èż‘ĉŽç‚ıïĵ’ + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float ClosestPtSegmentSegment(in float3 p1, in float3 q1, in float3 p2, in float3 q2, out float s, out float t, out float3 c1, out float3 c2) + { + //s = 0.0f; + //t = 0.0f; + float3 d1 = q1 - p1; // 線ċˆ†s1ĉ–ıċ‘ƒ™‚ŻƒˆƒĞ + float3 d2 = q2 - p2; // 線ċˆ†s2ĉ–ıċ‘ƒ™‚ŻƒˆƒĞ + float3 r = p1 - p2; + float a = math.dot(d1, d1); // 線ċˆ†s1è·é›˘ċı³ĉ–ı€ċ¸¸Ğĉ­£ + float e = math.dot(d2, d2); // 線ċˆ†s2è·é›˘ċı³ĉ–ı€ċ¸¸Ğĉ­£ + float f = math.dot(d2, r); + // 片ĉ–ı‚‚‹„Żä¸Ħĉ–ıç·šċˆ†Œç‚ıĞç¸é€€—Ĥ„‚‹‹İ†‹ƒ‚§ƒƒ‚Ż + if (a <= 1e-8f && e <= 1e-8f) + { + // ä¸Ħĉ–ıç·šċˆ†Œç‚ıĞç¸é€€ + s = t = 0.0f; + c1 = p1; + c2 = p2; + return math.dot(c1 - c2, c1 - c2); + } + if (a <= 1e-8f) + { + // ĉœ€ċˆç·šċˆ†Œç‚ıĞç¸é€€ + s = 0.0f; + t = math.saturate(f / e); + } + else + { + float c = math.dot(d1, r); + if (e <= 1e-8f) + { + // 2番盁線ċˆ†Œç‚ıĞç¸é€€ + t = 0.0f; + s = math.saturate(-c / a); + } + else + { + // ““‹‚‰ä¸€èˆĴ的Şç¸é€€ċ ´ċˆ‚’é–‹ċ§‹ + float b = math.dot(d1, d2); + float denom = a * e - b * b; // ċ¸¸Ğĉ­£ + // 線ċˆ†Œċı³èĦŒ§Ş„ċ ´ċˆ€L1上L2Ğċ݁™‚‹ĉœ€èż‘ĉŽç‚ı‚’計痀—Ĥ + // 線ċˆ†s1Ğċ݁—Ĥ‚Żƒİƒ³ƒ—€‚†§Ş„ċ ´ċˆŻäğğĉ„s(““§Ż0)‚’選ĉŠž + if (denom != 0.0f) + { + s = math.saturate((b * f - c * e) / denom); + } + else + { + s = 0.0f; + } + // L2上s1(s)Ğċ݁™‚‹ĉœ€èż‘ĉŽç‚ı‚’äğ下‚’用„Ĥè¨ˆç— + // t = dot((p1 + d1 * s) - p2, d2) / dot(d2, d2) = (b * s + f) / e + t = (b * s + f) / e; + // tŒ[0,1]ä¸­Ğ‚‚Œ°çµ‚了€‚ + // †§Ş‘‚Œ°t‚’‚Żƒİƒ³ƒ—€s‚’tĉ–°—„ċ€¤Ğċ݁—Ĥäğ下‚’用„Ĥċ†è¨ˆç— + // s = dot((p2 + d2 * t) - p1, d1) / dot(d1, d1) = (t * b - c) / a + // —Ĥs‚’[0,1]Ğ‚Żƒİƒ³ƒ— + if (t < 0.0f) + { + t = 0.0f; + s = math.saturate(-c / a); + } + else if (t > 1.0f) + { + t = 1.0f; + s = math.saturate((b - c) / a); + } + } + } + + c1 = p1 + d1 * s; + c2 = p2 + d2 * t; + + return math.dot(c1 - c2, c1 - c2); + } + + /// + /// ïĵ’¤ç·šċˆ†(p1-q1)(p2-q2)ĉœ€èż‘ĉŽç‚ı(s, t)‚’計痁™‚‹ + /// “é–˘ĉ•°§Żs/tż§ĉŽç‚ı¨è·é›˘Żè¨ˆç——Ş„ + /// + /// 線ċˆ†ïĵ‘ċ§‹ç‚ı + /// 線ċˆ†ïĵ‘çµ‚ç‚ı + /// 線ċˆ†ïĵ’ċ§‹ç‚ı + /// 線ċˆ†ïĵ’çµ‚ç‚ı + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void ClosestPtSegmentSegment2(in float3 p1, in float3 q1, in float3 p2, in float3 q2, out float s, out float t) + { + //s = 0.0f; + //t = 0.0f; + float3 d1 = q1 - p1; // 線ċˆ†s1ĉ–ıċ‘ƒ™‚ŻƒˆƒĞ + float3 d2 = q2 - p2; // 線ċˆ†s2ĉ–ıċ‘ƒ™‚ŻƒˆƒĞ + float3 r = p1 - p2; + float a = math.dot(d1, d1); // 線ċˆ†s1è·é›˘ċı³ĉ–ı€ċ¸¸Ğĉ­£ + float e = math.dot(d2, d2); // 線ċˆ†s2è·é›˘ċı³ĉ–ı€ċ¸¸Ğĉ­£ + float f = math.dot(d2, r); + // 片ĉ–ı‚‚‹„Żä¸Ħĉ–ıç·šċˆ†Œç‚ıĞç¸é€€—Ĥ„‚‹‹İ†‹ƒ‚§ƒƒ‚Ż + if (a <= 1e-8f && e <= 1e-8f) + { + // ä¸Ħĉ–ıç·šċˆ†Œç‚ıĞç¸é€€ + s = t = 0.0f; + } + else if (a <= 1e-8f) + { + // ĉœ€ċˆç·šċˆ†Œç‚ıĞç¸é€€ + s = 0.0f; + t = math.saturate(f / e); + } + else + { + float c = math.dot(d1, r); + if (e <= 1e-8f) + { + // 2番盁線ċˆ†Œç‚ıĞç¸é€€ + t = 0.0f; + s = math.saturate(-c / a); + } + else + { + // ““‹‚‰ä¸€èˆĴ的Şç¸é€€ċ ´ċˆ‚’é–‹ċ§‹ + float b = math.dot(d1, d2); + float denom = a * e - b * b; // ċ¸¸Ğĉ­£ + // 線ċˆ†Œċı³èĦŒ§Ş„ċ ´ċˆ€L1上L2Ğċ݁™‚‹ĉœ€èż‘ĉŽç‚ı‚’計痀—Ĥ + // 線ċˆ†s1Ğċ݁—Ĥ‚Żƒİƒ³ƒ—€‚†§Ş„ċ ´ċˆŻäğğĉ„s(““§Ż0)‚’選ĉŠž + if (denom != 0.0f) + { + s = math.saturate((b * f - c * e) / denom); + } + else + { + s = 0.0f; + } + // L2上s1(s)Ğċ݁™‚‹ĉœ€èż‘ĉŽç‚ı‚’äğ下‚’用„Ĥè¨ˆç— + // t = dot((p1 + d1 * s) - p2, d2) / dot(d2, d2) = (b * s + f) / e + t = (b * s + f) / e; + // tŒ[0,1]ä¸­Ğ‚‚Œ°çµ‚了€‚ + // †§Ş‘‚Œ°t‚’‚Żƒİƒ³ƒ—€s‚’tĉ–°—„ċ€¤Ğċ݁—Ĥäğ下‚’用„Ĥċ†è¨ˆç— + // s = dot((p2 + d2 * t) - p1, d1) / dot(d1, d1) = (t * b - c) / a + // —Ĥs‚’[0,1]Ğ‚Żƒİƒ³ƒ— + if (t < 0.0f) + { + t = 0.0f; + s = math.saturate(-c / a); + } + else if (t > 1.0f) + { + t = 1.0f; + s = math.saturate((b - c) / a); + } + } + } + } + + /// + /// 三角ċ½˘(abc)‹‚‰ç‚ı(p)¸ĉœ€èż‘ĉŽç‚ı¨é‡ċżƒċş§ĉ¨™uvw‚’èż”™ + /// + /// + /// + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 ClosestPtPointTriangle(in float3 p, in float3 a, in float3 b, in float3 c, out float3 uvw) + { + uvw = 0; + float v = 0, w = 0; + + // PŒAċ¤–ċ´é ‚ç‚ı領ċŸŸä¸­Ğ‚‚‹‹İ†‹ƒ‚§ƒƒ‚Ż + var ab = b - a; + var ac = c - a; + var ap = p - a; + float d1 = math.dot(ab, ap); + float d2 = math.dot(ac, ap); + if (d1 <= 0.0f && d2 <= 0.0f) + { + uvw.x = 1; // 重ċżƒċş§ĉ¨™(1,0,0) + return a; + } + + // PŒBċ¤–ċ´é ‚ç‚ı領ċŸŸä¸­Ğ‚‚‹‹İ†‹ƒ‚§ƒƒ‚Ż + var bp = p - b; + float d3 = math.dot(ab, bp); + float d4 = math.dot(ac, bp); + if (d3 >= 0.0f && d4 <= d3) + { + uvw.y = 1; // 重ċżƒċş§ĉ¨™(0,1,0) + return b; + } + + // PŒABèşé ˜ċŸŸä¸­Ğ‚‚‹‹İ†‹ƒ‚§ƒƒ‚݁—€‚‚Œ°PAB上Ğċ݁™‚‹ċ°„ċ½ħ‚’èż”™ + float vc = d1 * d4 - d3 * d2; + if (vc <= 0.0f && d1 >= 0.0f && d3 <= 0.0f) + { + Develop.Assert((d1 - d3) != 0.0f); + v = d1 / (d1 - d3); + uvw = new float3(1 - v, v, 0); // 重ċżƒċş§ĉ¨™(1-v,v,0) + return a + v * ab; + } + + // PŒCċ¤–ċ´é ‚ç‚ı領ċŸŸä¸­Ğ‚‚‹‹İ†‹ƒ‚§ƒƒ‚Ż + var cp = p - c; + float d5 = math.dot(ab, cp); + float d6 = math.dot(ac, cp); + if (d6 >= 0.0f && d5 <= d6) + { + uvw.z = 1; // 重ċżƒċş§ĉ¨™(0,0,1) + return c; + } + + // PŒACèşé ˜ċŸŸä¸­Ğ‚‚‹‹İ†‹ƒ‚§ƒƒ‚݁—€‚‚Œ°PAC上Ğċ݁™‚‹ċ°„ċ½ħ‚’èż”™ + float vb = d5 * d2 - d1 * d6; + if (vb <= 0.0f && d2 >= 0.0f && d6 <= 0.0f) + { + Develop.Assert((d2 - d6) != 0.0f); + w = d2 / (d2 - d6); + uvw = new float3(1 - w, 0, w); // 重ċżƒċş§ĉ¨™(1-w,0,w) + return a + w * ac; + } + + // PŒBCèşé ˜ċŸŸä¸­Ğ‚‚‹‹İ†‹ƒ‚§ƒƒ‚݁—€‚‚Œ°PBC上Ğċ݁™‚‹ċ°„ċ½ħ‚’èż”™ + float va = d3 * d6 - d5 * d4; + if (va <= 0.0f && (d4 - d3) >= 0.0f && (d5 - d6) >= 0.0f) + { + float g = (d4 - d3) + (d5 - d6); + Develop.Assert(g != 0.0f); + w = (d4 - d3) / g; + uvw = new float3(0, 1 - w, w); // 重ċżƒċş§ĉ¨™(0,1-w,w) + return b + w * (c - b); + } + + // PŻé˘é ˜ċŸŸä¸­Ğ‚‚‹€‚Q‚’é‡ċżƒċş§ĉ¨™(u,v,w)‚’用„Ĥè¨ˆç— + float h = va + vb + vc; + Develop.Assert(h != 0.0f); + float denom = 1.0f / h; + v = vb * denom; + w = vc * denom; + uvw = new float3(1 - v - w, v, w); // 重ċżƒċş§ĉ¨™ + return a + ab * v + ac * w; + } + + /// + /// 三角ċ½˘¨ç‚ıĉœ€èż‘ĉŽç‚ı重ċżƒ(uvw)‹‚‰ç‚ıŒä¸‰è§’ċ½˘ċ†…部Ğ‚‚‹‹ċˆ¤ċš™‚‹ + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool PointInTriangleUVW(float3 uvw) + { + return math.all(uvw); + } + + + /// + /// ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞé‡ċżƒ‚’èż”™ + /// + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 TriangleCenter(in float3 p0, in float3 p1, in float3 p2) + { + return (p0 + p1 + p2) / 3.0f; + } + + /// + /// ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĉ³•ç·š‚’計痁—Ĥèż”™ + /// + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 TriangleNormal(in float3 p0, in float3 p1, in float3 p2) + { + var c = math.cross(p1 - p0, p2 - p0); +#if MC2_DEBUG + Develop.Assert(math.length(c) > 0.0f); +#endif + return math.normalize(c); + } + + /// + /// ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞé˘çݍ‚’ĉħ‚‚Ĥèż”™ + /// + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float TriangleArea(in float3 p0, in float3 p1, in float3 p2) + { + var c = math.cross(p1 - p0, p2 - p0); + return math.length(c); + } + + /// + /// ċ‰ċ…¨Şƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ‹ċˆ¤ċš™‚‹ + /// 面çݍŒĉµçĞŻĞċ°•„ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞŻä¸ĉ­£¨™‚‹ + /// + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool IsSafeTriangle(in float3 p0, in float3 p1, in float3 p2) + { + return TriangleArea(p0, p1, p2) > 1e-06f; + } + + /// + /// ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĉŽç·š‚’計痁—Ĥèż”™€‚ + /// ĉŽç·šŻċ˜ä½ċŒ–•‚Œ‚‹€‚Ÿ —€çŠĥĉ³Ğ‚ˆ‚Šé•·•ïĵ¨Ş‚‹‚ħƒĵ‚ıŒ‚‚Ёċ ´ċˆŻƒ™‚ŻƒˆƒĞïĵ‚’èż”™€‚ + /// + /// + /// + /// + /// + /// + /// + /// + public static float3 TriangleTangent(in float3 p0, in float3 p1, in float3 p2, in float2 uv0, in float2 uv1, in float2 uv2) + { + // ĉŽç·š(頂ç‚ıċş§ĉ¨™¨UV‹‚‰ĉŽç·š‚’ĉħ‚‚‚‹ä¸€èˆĴ的Ş‚˘ƒĞ‚´ƒŞ‚şƒ ) + float3 distBA = p1 - p0; + float3 distCA = p2 - p0; + float2 tdistBA = uv1 - uv0; + float2 tdistCA = uv2 - uv0; + float area = tdistBA.x * tdistCA.y - tdistBA.y * tdistCA.x; + float3 tan = 0; + if (area == 0.0f) + { +#if MC2_DEBUG + Debug.LogWarning($"Calc tangent area = 0!\np0:{p0},p1:{p1},p2:{p2}\nuv0:{uv0},uv1:{uv1},uv2:{uv2}"); +#endif + + // İ†—Ĥ‚‚‚ŒĞ発生™‚‹§ä¸€ĉ—Ĥċšĉ•°§ċ‡Ĥ理‚’ĉµ—Ĥż‚‹ + area = 1; + } + + //else + { + float delta = 1.0f / area; + tan = new float3( + (distBA.x * tdistCA.y) + (distCA.x * -tdistBA.y), + (distBA.y * tdistCA.y) + (distCA.y * -tdistBA.y), + (distBA.z * tdistCA.y) + (distCA.z * -tdistBA.y) + ) * delta; + // ċ·Ĥĉ‰‹ċş§ĉ¨™ç³ğĞċˆ‚›‚‹ + tan = -tan; + } + + // 長•ïĵŻƒ™‚ŻƒˆƒĞïĵ¨Ş‚‹ + tan = math.normalizesafe(tan, 0); + //#if MC2_DEBUG + // Debug.Assert(math.length(tan) > Define.System.Epsilon); + //#endif + // tan = math.normalize(tan); + + return tan; + } + +#if false + /// + /// ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞċ›žèğ˘ċ§żċ‹˘‚’èż”™ + /// ĉ³•ç·š¨(重ċżƒ-p0)è𸁋‚‰Ş‚‹‚Ż‚İƒĵ‚żƒ‹‚ރ³ + /// + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static quaternion TriangleRotation(float3 p0, float3 p1, float3 p2) + { + var n = TriangleNormal(p0, p1, p2); + var cen = TriangleCenter(p0, p1, p2); + var tan = math.normalize(p0 - cen); + return quaternion.LookRotation(tan, n); + } + + /// + /// 隣ĉށ™‚‹ïĵ’¤ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞċ›žèğ˘ċ§żċ‹˘‚’èż”™ + /// ĉ³•ç·šċı³ċ‡¨ċ…ħ通‚¨ƒƒ‚¸‹‚‰Ş‚‹‚Ż‚İƒĵ‚żƒ‹‚ރ³ + /// + /// + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static quaternion TriangleCenterRotation(float3 p0, float3 p1, float3 p2, float3 p3) + { + var n0 = TriangleNormal(p0, p2, p3); + var n1 = TriangleNormal(p1, p3, p2); + var n = (n0 + n1) * 0.5f; + var tan = math.normalize(p3 - p2); + return quaternion.LookRotation(tan, n); + } +#endif + + /// + /// ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞƒš‚˘Ş™è§’‚’èż”™ïĵˆƒİ‚¸‚˘ƒ³ïĵ‰ + /// v2 + + /// / \ + /// v0 +---+ v1 + /// \ / + /// v3 + + /// + /// + /// + /// ƒİ‚¸‚˘ƒ³€ĉ°´ċı³ĉ™‚Ż0¨Ş‚‹ + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float TriangleAngle(in float3 v0, in float3 v1, in float3 v2, in float3 v3) + { + var ev = v1 - v0; + var va = v2 - v0; + var vb = v3 - v0; + var na = math.cross(va, ev); + var nb = math.cross(ev, vb); + float ang = Angle(na, nb); + + return ang; + } + + /// + /// ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ重ċżƒ‹‚‰è·é›˘‚’èż”™ + /// + /// + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float DistanceTriangleCenter(float3 p, float3 p0, float3 p1, float3 p2) + { + var cen = (p0 + p1 + p2) / 3.0f; + return math.distance(p, cen); + } + + /// + /// ç‚ıpŒƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĉ­£è² İĦ‚‰ċ‘Ğ‚‚‹‹èż”™(-1/0/+1) + /// + /// + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float DirectionPointTriangle(float3 p, float3 a, float3 b, float3 c) + { + var ab = b - a; + var ac = c - a; + var ap = p - a; + + float3 n = math.cross(ab, ac); + + float d = math.dot(ap, n); + return math.sign(d); + } + + /// + /// ïĵ’¤ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ¨ċ…ħ通™‚‹‚¨ƒƒ‚¸‹‚‰ĉ‹‚Ёïĵ’¤é ‚ç‚ıïĵˆċŻè§’ç‚ıïĵ‰‚’èż”™ + /// + /// + /// + /// + /// + public static int2 GetRestTriangleVertex(int3 tri1, int3 tri2, int2 edge) + { + int2 r = -1; + + for (int i = 0; i < 3; i++) + { + var val = tri1[i]; + if (val != edge.x && val != edge.x && val != edge.y && val != edge.y) + { + r[0] = val; + break; + } + } + for (int i = 0; i < 3; i++) + { + var val = tri2[i]; + if (val != edge.x && val != edge.x && val != edge.y && val != edge.y) + { + r[1] = val; + break; + } + } + + return r; + } + + /// + /// ïĵ’¤ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ‹‚‰ċ…ħ通™‚‹èş‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı‚’èż”™ + /// + /// + /// + /// èĤ‹¤‹‚‰Ş„ċ ´ċˆŻ(0,0) + public static int2 GetCommonEdgeFromTrianglePair(int3 tri1, int3 tri2) + { + int2 e = 0; + int eindex = 0; + + for (int i = 0; i < 3; i++) + { + if (tri1[i] == tri2.x || tri1[i] == tri2.y || tri1[i] == tri2.z) + { + e[eindex] = tri1[i]; + eindex++; + } + } + if (eindex != 2) + { + Debug.LogError("Common edge nothing!"); + return 0; + } + + if (e.x > e.y) + { + int w = e.x; + e.x = e.y; + e.y = w; + } + + return e; + } + + /// + /// ċ…ħ通™‚‹èş‚’‚‚¤ïĵ’¤ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ‹‚‰ċ››è§’‚’ċ½˘ĉˆ™‚‹ïĵ”¤é ‚ç‚ı‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı‚’èż”™ + /// 頂ç‚ı‚¤ƒ³ƒ‡ƒƒ‚Ż‚ıŻ[2][3]Œċ…ħ通™‚‹èş‚’示—€[0][1]Żċ„ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĉ‹‚Ё‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı + /// v2 + + /// /|\ + /// v0 + | + v1 + /// \|/ + /// v3 + + /// + /// + /// + /// + public static int4 GetTrianglePairIndices(int3 tri1, int3 tri2) + { + // ċ…ħ通èş + int2 e = GetCommonEdgeFromTrianglePair(tri1, tri2); + Debug.Assert((e.x > 0 || e.y > 0) && e.x != e.y); + + int4 r = new int4(0, 0, e.x, e.y); + for (int i = 0; i < 3; i++) + { + if (tri1[i] != e.x && tri1[i] != e.y) + r[0] = tri1[i]; + if (tri2[i] != e.x && tri2[i] != e.y) + r[1] = tri2[i]; + } + + return r; + } + + /// + /// ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĞ¤„ĤĉŒ‡ċš‚¨ƒƒ‚¸äğċ¤–é ‚ç‚ı‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı‚’èż”™ + /// + /// + /// + /// + public static int GetUnuseTriangleIndex(int3 tri, int2 edge) + { + if (tri.x != edge.x && tri.x != edge.y) + return tri.x; + if (tri.y != edge.x && tri.y != edge.y) + return tri.y; + if (tri.z != edge.x && tri.z != edge.y) + return tri.z; + + return -1; + } + + /// + /// ċ…ħ通™‚‹‚¨ƒƒ‚¸‚’‚‚¤ïĵ’¤ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞŞ™è§’‚’ĉħ‚‚‚‹ïĵˆƒİ‚¸‚˘ƒ³ïĵ‰ + /// v2 + + /// /|\ + /// v0 + | + v1 + /// \|/ + /// v3 + + /// + /// + /// + /// + /// + /// ƒİ‚¸‚˘ƒ³ + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float GetTrianglePairAngle(float3 pos0, float3 pos1, float3 pos2, float3 pos3) + { + var va = pos3 - pos2; + var vb = pos0 - pos2; + var vc = pos1 - pos2; + + var n0 = math.cross(va, vb); + var n1 = math.cross(vc, va); + + float ang = Angle(n0, n1); + return ang; + } + + /// + /// ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ‚’ċèğ˘•›‚‹ + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int3 FlipTriangle(in int3 tri) + { + return tri.xzy; + } + + /// + /// ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ‚’ċŒ…‚€çƒä¸­ċżƒ¨ċŠċ„‚’ĉħ‚‚‚‹ + /// “‚ŒŻçƒ‹‚‰ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞŒŻżċ‡ş‚‹äş‹ŻŞ„ŒċŒċ…¨Ğĉ­£ç˘ş§ŻŞ„§ĉ³¨ĉ„ïĵ + /// ‚§èĦçށċˆ¤ċšƒ–ƒ­ƒĵƒ‰ƒ•‚§ƒĵ‚şŞİ§ä½żç”¨™‚‹“¨Œç›çš„‚‚ + /// ĉ­£ç˘şĉ€§‚ˆ‚Š‚‚速ċşĤ‚’重èĤ–—ŸċŸè£…¨Ş£Ĥ„‚‹ + /// + /// + /// + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void GetTriangleSphere(float3 pos0, float3 pos1, float3 pos2, out float3 sc, out float sr) + { + float3 max = math.max(math.max(pos0, pos1), pos2); + float3 min = math.min(math.min(pos0, pos1), pos2); + sc = (min + max) * 0.5f; + sr = math.distance(min, max) * 0.5f; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 LocalToWorldMatrix(in float3 wpos, in quaternion wrot, in float3 wscl) + { + return Matrix4x4.TRS(wpos, wrot, wscl); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 WorldToLocalMatrix(in float3 wpos, in quaternion wrot, in float3 wscl) + { + return math.inverse(Matrix4x4.TRS(wpos, wrot, wscl)); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 TransformPoint(in float3 pos, in float3 wpos, in quaternion wrot, in float3 wscl) + { + return math.transform(Matrix4x4.TRS(wpos, wrot, wscl), pos); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 TransformPoint(in float3 pos, in float4x4 m) + { + return math.transform(m, pos); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 TransformVector(in float3 vec, in float4x4 m) + { + return math.mul(m, new float4(vec, 0)).xyz; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 TransformDirection(in float3 dir, in float4x4 m) + { + float len = math.length(dir); + if (len > 0.0f) + return math.normalize(TransformVector(dir, m)) * len; + else + return dir; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 TransformNormal(in float3 dir, in float4x4 m, float3 errDir) + { + // ċ§żċ‹˘ċ¤‰ĉ›ċŒĞċ˜ä½ċŒ–™‚‹ + return math.normalizesafe(TransformVector(dir, m), errDir); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static quaternion TransformRotation(in quaternion rot, in float4x4 m, in float3 normalTangentFlip) + { + ToNormalTangent(rot, out float3 nor, out float3 tan); + nor = math.mul(m, new float4(nor, 0)).xyz * normalTangentFlip.y; + tan = math.mul(m, new float4(tan, 0)).xyz * normalTangentFlip.z; + return quaternion.LookRotation(tan, nor); + } + + /// + /// è·é›˘‚’çİşé–“ċ¤‰ĉ›™‚‹ + /// 非一ĉ§˜‚ı‚ħƒĵƒĞ‚’考ĉ…—Ĥċ„èğ¸ċı³ċ‡ċ€¤‚’èż”™ + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float TransformDistance(in float dist, in float4x4 localToWorldMatrix) + { + var dist3 = math.mul(localToWorldMatrix, new float4(dist, dist, dist, 0)).xyz; + return math.csum(dist3) / 3; // ċı³ċ‡ċŒ– + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void TransformPositionNormalTangent(in float3 tpos, in quaternion trot, in float3 tscl, ref float3 pos, ref float3 nor, ref float3 tan) + { + // position + pos *= tscl; + pos = math.mul(trot, pos); + pos += tpos; + + // normal + nor = math.mul(trot, nor); + + // tangent + tan = math.mul(trot, tan); + } + + /// + /// 長•‚’ƒžƒˆƒŞƒƒ‚Ż‚ıçİşé–“Ğċ¤‰ĉ›™‚‹ + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float TransformLength(float length, in float4x4 matrix) + { + return math.length(math.mul(matrix, new float4(length, length, length, 0)).xyz) / 1.73205f; + } + + // ïĵïĵ“‚ŒŻ‚ı‚ħƒĵƒĞŒċ…‚‹¨†èĦŒ‹Ş„ + //[MethodImpl(MethodImplOptions.AggressiveInlining)] + //public static quaternion TransformRotation(in quaternion rot, in float4x4 localToWorldMatrix) + //{ + // return math.mul(rot, new quaternion(localToWorldMatrix)); + //} + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 InverseTransformPoint(in float3 pos, in float4x4 worldToLocalMatrix) + { + return math.transform(worldToLocalMatrix, pos); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 InverseTransformPoint(in float3 pos, in float3 wpos, in quaternion wrot, in float3 wscl) + { + return math.transform(math.inverse(Matrix4x4.TRS(wpos, wrot, wscl)), pos); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 InverseTransformVector(in float3 vec, in float4x4 worldToLocalMatrix) + { + return math.mul(worldToLocalMatrix, new float4(vec, 0)).xyz; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 InverseTransformVector(in float3 vec, in quaternion rot) + { + return math.mul(math.inverse(rot), vec); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float3 InverseTransformDirection(in float3 dir, in float4x4 worldToLocalMatrix) + { + float len = math.length(dir); + if (len > 0.0f) + return math.normalize(InverseTransformVector(dir, worldToLocalMatrix)) * len; + else + return dir; + } + + // ïĵïĵ“‚ŒŻ‚ı‚ħƒĵƒĞŒċ…‚‹¨†èĦŒ‹Ş„ + //[MethodImpl(MethodImplOptions.AggressiveInlining)] + //public static quaternion InverseTransformRotation(in quaternion rot, in float4x4 worldToLocalMatrix) + //{ + // return math.mul(new quaternion(worldToLocalMatrix), rot); + //} + + /// + /// fromƒ­ƒĵ‚ЃĞċş§ĉ¨™‚’toƒ­ƒĵ‚ЃĞċş§ĉ¨™Ğċ¤‰ĉ›™‚‹matrix‚’èż”™ + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float4x4 Transform(in float4x4 fromLocalToWorldMatrix, in float4x4 toWorldToLocalMatrix) + { + return math.mul(toWorldToLocalMatrix, fromLocalToWorldMatrix); + } + + /// + /// ïĵ’¤ƒžƒˆƒŞƒƒ‚Ż‚ıŒç­‰—„‹ċˆ¤ċš™‚‹ + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool CompareMatrix(in float4x4 m1, in float4x4 m2) + { +#if true + var b4 = m1 == m2; + return math.all(b4.c0) && math.all(b4.c1) && math.all(b4.c2) && math.all(b4.c3); +#else + // ƒƒƒ‚·ƒĉ–ıŒĉ—݁„‹Ş + // ★ƒƒƒ‚·ƒ§Ż™ĞèĦçށ‚’èµ·“™§ ‚ïĵ + return math.hash(m1) == math.hash(m2); +#endif + } + + /// + /// ïĵ’¤ċş§ĉ¨™ç³ğŒç­‰—„‹ċˆ¤ċš™‚‹ + /// + /// + /// + /// + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool CompareTransform(in float3 pos1, in quaternion rot1, in float3 scl1, in float3 pos2, in quaternion rot2, in float3 scl2) + { + return pos1.Equals(pos2) && rot1.Equals(rot2) && scl1.Equals(scl2); + } + + /// + /// 線ċˆ†pqŠ‚ˆ³ä¸‰è§’ċ½˘abcĞċ݁—Ĥ€ç·šċˆ†Œä¸‰è§’ċ½˘¨äş¤ċ·—Ĥ„‚‹‹İ†‹‚’èż”™ + /// 交ċ·—Ĥ„‚‹ċ ´ċˆŻ€äş¤ċ·ç‚ıé‡ċżƒ(u,v,w)¨ç·šċˆ†ä½ç½t‚’èż”™ + /// + /// + /// + /// + /// + /// + /// ä¸Ħ面ċˆ¤ċšŻtrue + /// + /// + /// + /// + /// + public static bool IntersectSegmentTriangle(in float3 p, in float3 q, float3 a, float3 b, float3 c, bool doubleSide, out float u, out float v, out float w, out float t) + { + t = 0.0f; + u = 0.0f; + v = 0.0f; + w = 0.0f; + + var ab = b - a; + var ac = c - a; + var qp = p - q; + + float3 n = math.cross(ab, ac); + + float d = math.dot(qp, n); + + // ĉ°´ċı³Żç„ĦċŠı + if (math.abs(d) < 1e-09f) + return false; + + if (doubleSide == false) + { + // ĉ³•ç·šĉ–ıċ‘‹‚‰äµċ…żïĵˆ‚ރނ¸ƒŠƒĞïĵ‰ + if (d <= 0.0f) + return false; + } + else if (d < 0.0f) + { + // 三角ċ½˘ä¸Ħ面‹‚‰èĦçށ‚’è¨ħċŻ™‚‹ + n = -n; + float3 x = b; + b = c; + c = x; + ab = b - a; + ac = c - a; + d = math.dot(qp, n); + } + + var ap = p - a; + t = math.dot(ap, n); + if (t < 0.0f) + return false; + if (t > d) + return false; + + float3 e = math.cross(qp, ap); + v = math.dot(ac, e); + if (v < 0.0f || v > d) + return false; + w = -math.dot(ab, e); + if (w < 0.0f || (v + w) > d) + return false; + + float ood = 1.0f / d; + t *= ood; + v *= ood; + w *= ood; + u = 1.0f - v - w; + + return true; + } + + /// + /// 線ċˆ†pqŠ‚ˆ³ä¸‰è§’ċ½˘abcĞċ݁—Ĥ€ç·šċˆ†Œä¸‰è§’ċ½˘¨äş¤ċ·—Ĥ„‚‹‹İ†‹‚’èż”™ + /// 交ċ·—Ĥ„‚‹ċ ´ċˆŻ€äş¤ċ·ç‚ıé‡ċżƒ(u,v,w)¨ç·šċˆ†ä½ç½t‚’èż”™ + /// + /// + /// + /// + /// + /// + /// + public static bool IntersectSegmentTriangle(in float3 p, in float3 q, float3 a, float3 b, float3 c) + { + var ab = b - a; + var ac = c - a; + var qp = p - q; + + float3 n = math.cross(ab, ac); + + float d = math.dot(qp, n); + + // ĉ°´ċı³Żç„ĦċŠı + if (math.abs(d) < 1e-09f) + return false; + + if (d < 0.0f) + { + // 三角ċ½˘ä¸Ħ面‹‚‰èĦçށ‚’è¨ħċŻ™‚‹ + n = -n; + float3 x = b; + b = c; + c = x; + ab = b - a; + ac = c - a; + d = math.dot(qp, n); + } + + var ap = p - a; + var t = math.dot(ap, n); + if (t < 0.0f) + return false; + if (t > d) + return false; + + float3 e = math.cross(qp, ap); + var v = math.dot(ac, e); + if (v < 0.0f || v > d) + return false; + var w = -math.dot(ab, e); + if (w < 0.0f || (v + w) > d) + return false; + + return true; + } + + /// + /// ç‚ı¨é˘èĦçށċˆ¤ċš + /// èĦçށ—Ÿċ ´ċˆĞĉŠĵ—ċ‡ş—位罂’計痁—Ĥèż”™ + /// + /// + /// + /// + /// + /// ċı³é˘§è·é›˘€‚ĉŠĵ—ċ‡ş•‚ŒŸïĵˆèĦçށïĵ‰ċ ´ċˆŻ0.0äğ下(ƒž‚¤ƒŠ‚ı) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float IntersectPointPlaneDist(in float3 planePos, in float3 planeDir, in float3 pos, out float3 outPos) + { + float3 v = pos - planePos; + + // ĉŠĵċ‡ş—ƒ™‚ŻƒˆƒĞ + float3 gv = Project(v, planeDir); + var len = math.length(gv); + + if (math.dot(planeDir, v) < 0.0f) + { + // ĉŠĵ—ċ‡ş—ç™şç”Ÿ + // ĉŠĵċ‡ş—ċş§ĉ¨™ + outPos = pos - gv; + + // 面§è·é›˘‚’ƒž‚¤ƒŠ‚ı§èż”™ + return -len; + //return 0.0f; + } + else + { + // ĉŠĵ—ċ‡ş—不èĤ€‚何‚‚—Ş„ + outPos = pos; + + // 面§è·é›˘‚’èż”™(+) + return len; + } + } + + + /// + /// ċ…‰ç·š¨çƒŒäş¤ċ·—Ĥ„‚‹‹ċˆ¤ċš™‚‹ + /// 交ċ·—Ĥ„‚‹ċ ´ċˆŻäş¤ċ·—Ĥ„‚‹tċ€¤Š‚ˆ³äş¤ċ·ç‚ıd‚’èż”™ + /// + /// ċ…‰ç·šċ§‹ç‚ı + /// ċ…‰ç·šĉ–ıċ‘|d|=1 + /// 球ä½ç½ + /// 球ċŠċ„ + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool IntersectRaySphere(in float3 p, in float3 d, in float3 sc, in float sr, ref float t, ref float3 q) + { + float3 m = p - sc; + float b = math.dot(m, d); + float c = math.dot(m, m) - sr * sr; + // rċŽŸç‚ıŒsċ¤–ċ´Ğ‚‚Š(c > 0),rŒs‹‚‰é›˘‚ŒĤ„ĉ–ıċ‘‚’ĉŒ‡—Ĥ„‚‹ċ ´ċˆ(b > 0)Ğ終了 + if (c > 0.0f && b > 0.0f) + return false; + float discr = b * b - c; + // è² ċˆ¤ċšċĵŻċ…‰ç·šŒçƒ‚’ċ¤–‚ŒĤ„‚‹“¨Ğ一致 + if (discr < 0.0f) + return false; + // “‚Œ§ċ…‰ç·šŻçƒ¨äş¤ċ·—Ĥ„‚‹“¨Œ‚‹‚Šäş¤ċ·™‚‹ĉœ€ċ°t‚’è¨ˆç— + t = -b - math.sqrt(discr); + // tŒè² §‚‚‹ċ ´ċˆ€ċ…‰ç·šŻçƒċ†…部‹‚‰é–‹ċ§‹—Ĥ„‚‹§t‚’‚ĵƒ­Ğ‚Żƒİƒ³ƒ— + if (t < 0.0f) + t = 0.0f; + q = p + t * d; + return true; + } + + /// + /// ç‚ıC¨ç·šċˆ†abé–“è·é›˘ċı³ĉ–ı‚’èż”™ + /// + /// + /// + /// + /// + public static float SqDistPointSegment(Vector3 a, Vector3 b, Vector3 c) + { + Vector3 ab = b - a; + Vector3 ac = c - a; + Vector3 bc = c - b; + float e = Vector3.Dot(ac, ab); + + // CŒabċ¤–ċ´Ğċ°„ċ½ħ•‚Œ‚‹ċ ´ċˆ‚’ĉ‰ħ† + if (e <= 0) + return Vector3.Dot(ac, ac); + float f = Vector3.Dot(ab, ab); + if (e >= f) + return Vector3.Dot(bc, bc); + + // CŒab上Ğċ°„ċ½ħ•‚Œ‚‹ċ ´ċˆ‚’ĉ‰ħ† + Develop.Assert(f != 0.0f); + return Vector3.Dot(ac, ac) - e * e / f; + } + + /// + /// ċş§ĉ¨™‚’Pivotƒ­ƒĵ‚ЃĞċ§żċ‹˘‚’保ĦŞŒ‚‰‚·ƒ•ƒˆ•›‚‹ + /// ä¸ğĞĉ…£ĉ€§‚·ƒ•ƒˆç”¨ + /// + /// ç§ğċ‹•ċ‰ċş§ĉ¨™ + /// ç§ğċ‹•ċ‰‚·ƒ•ƒˆä¸­ċżƒċş§ĉ¨™ + /// ‚·ƒ•ƒˆç§ğċ‹•量 + /// ‚·ƒ•ƒˆċ›žèğ˘é‡ + /// + public static float3 ShiftPosition(in float3 oldPos, in float3 oldPivotPosition, in float3 shiftVector, in quaternion shiftRotation) + { + float3 lpos = oldPos - oldPivotPosition; + lpos = math.mul(shiftRotation, lpos); + lpos += shiftVector; + return oldPivotPosition + lpos; + } + + //========================================================================================= + /// + /// ĉ·ħ•‹‚‰é‡é‡‚’計痁—Ĥèż”™ + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float CalcMass(float depth) + { + var a = (1.0f - depth); + return 1.0f + a * a * Define.System.DepthMass; + } + + /// + /// ĉ‘İĉ“Ĥ係ĉ•°‹‚‰é€†é‡é‡‚’計痁—Ĥèż”™ + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float CalcInverseMass(float friction) + { + // ĉ‘İĉ“Ĥ(0.0 ~ 1.0)Ğ‚ˆ‚Šé‡é‡Œċ˘—ċŠ ™‚‹ + float mass = 1.0f + friction * Define.System.FrictionMass; + + Develop.Assert(mass > 0.0f); + return 1.0f / mass; + } + + /// + /// 逆重量‚’計痁—Ĥèż”™ + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float CalcInverseMass(float friction, float depth) + { + float mass = 1.0f; + + // ĉ‘İĉ“Ĥ(0.0 ~ 1.0)Ğ‚ˆ‚Šé‡é‡‚’ċ˘—ċŠ •›‚‹ + mass += friction * Define.System.FrictionMass; + + // ĉ·ħ•Ğ‚ˆ‚Šé‡é‡‚’ċ˘—ċŠ •›‚‹ + //mass += (1.0f - depth) * Define.System.DepthMass; + var a = (1.0f - depth); + mass += a * a * Define.System.DepthMass; + + Develop.Assert(mass > 0.0f); + return 1.0f / mass; + } + + /// + /// 逆重量‚’計痁—Ĥèż”™ + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float CalcInverseMass(float friction, float depth, bool fix, float fixMass) + { + //return fix ? (1.0f / 100.0f) : CalcInverseMass(friction, depth); + //return fix ? (1.0f / 30.0f) : CalcInverseMass(friction, depth); + + return fix ? (1.0f / fixMass) : CalcInverseMass(friction, depth); + } + + /// + /// ‚ğƒĞƒ•‚³ƒŞ‚¸ƒ§ƒ³ç”¨é€†é‡é‡‚’計痁—Ĥèż”™ + /// ċ›şċšƒ‘ƒĵƒ†‚£‚ŻƒĞŻğ¨‚“İċ‹•‹Ş™‚‹ + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float CalcSelfCollisionInverseMass(float friction, bool fix, float clothMass) + { + float mass = fix ? Define.System.SelfCollisionFixedMass : 1.0f + friction * Define.System.SelfCollisionFrictionMass; + mass += clothMass * Define.System.SelfCollisionClothMass; + Develop.Assert(mass > 0.0f); + return 1.0f / mass; + } + + /// + /// ĉ•°‚’nċˆ†ċ‰²—Ĥ€ĉŒ‡ċš‚¤ƒ³ƒ‡ƒƒ‚Ż‚ıçŻ„ċ›²‚’èż”—™€‚ + /// ĉ•°Żĉ•´ĉ•°ż€‚ + /// ä‹ïĵš100(dataLength)‚’5(divCount)ċˆ†ċ‰²—Ÿçµĉžœ + /// divIndex(0):0~20 + /// divIndex(1):20~40 + /// divIndex(2):40~60 + /// divIndex(3):60~80 + /// divIndex(4):80~100 + /// + /// Ÿ —€ĉ•°Œċˆ†ċ‰²ĉ•°‚’下ċ›ž‚‹ċ ´ċˆŻçŻ„ċ›²ċ¤–‚¤ƒ³ƒ‡ƒƒ‚Ż‚ıŻ-1¨Ş‚‹ + /// ä‹ïĵš3(dataLength)‚’5(divCount)ċˆ†ċ‰²—Ÿçµĉžœ + /// divIndex(0):0~1 + /// divIndex(1):1~2 + /// divIndex(2):2~3 + /// divIndex(3):-1~-1 + /// divIndex(4):-1~-1 + /// + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int2 CalcSplitRange(int dataLength, int divCount, int divIndex) + { + if (dataLength <= 0) + return -1; + + if (dataLength < divCount) + { + if (divIndex < dataLength) + return new int2(divIndex, divIndex + 1); + else + return -1; + } + + float segment = (float)dataLength / divCount; + int start = (int)(segment * divIndex); + int end = (divIndex == divCount - 1) ? dataLength : (int)(segment * (divIndex + 1)); + return new int2(start, end); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static DataChunk GetWorkerChunk(int dataLenght, int workerCount, int workerIndex) + { + int2 range = CalcSplitRange(dataLenght, workerCount, workerIndex); + if (range.x < 0) + return DataChunk.Empty; + else + return new DataChunk(range.x, range.y - range.x); + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/Math/MathUtility.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Utility/Math/MathUtility.cs.meta new file mode 100644 index 00000000..bfe1bffa --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/Math/MathUtility.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 7ad45eb87d191fb4890da353d511a024 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Utility/Math/MathUtility.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/Math/MinimumData.cs b/Assets/MagicaCloth2/Scripts/Core/Utility/Math/MinimumData.cs new file mode 100644 index 00000000..5e229900 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/Math/MinimumData.cs @@ -0,0 +1,57 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System.Collections.Generic; + +namespace MagicaCloth2 +{ + /// + /// ĉœ€ċ°è·é›˘ƒ‡ƒĵ‚żż‚’保ĉŒ™‚‹‚Żƒİ‚ı + /// + /// + /// + public class MinimumData where T1 : unmanaged where T2 : unmanaged + { + T1 minDist; + T2 minData; + bool isValid = false; + + /// + /// ƒ‡ƒĵ‚żèż½ċŠ €‚çċœ¨ƒ‡ƒĵ‚ż‚ˆ‚Šè·é›˘ŒçŸ­„ċ ´ċˆżä¸Šĉ›¸™‚‹ + /// + /// + /// + public void Add(T1 distance, T2 data) + { + if (isValid) + { + if (Comparer.Default.Compare(distance, minDist) < 0) + { + minDist = distance; + minData = data; + } + } + else + { + minDist = distance; + minData = data; + isValid = true; + } + } + + public void Clear() + { + isValid = false; + } + + + public bool IsValid => isValid; + public T1 MinDistance => minDist; + public T2 MinData => minData; + + public override string ToString() + { + return $"MinimumData. IsValid:{isValid}, minDist:{minDist}, minData:{minData}"; + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/Math/MinimumData.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Utility/Math/MinimumData.cs.meta new file mode 100644 index 00000000..28ae4958 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/Math/MinimumData.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 334bdeb060898f14f811bc5b01ac3f19 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Utility/Math/MinimumData.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/Mesh.meta b/Assets/MagicaCloth2/Scripts/Core/Utility/Mesh.meta new file mode 100644 index 00000000..2349209a --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/Mesh.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e1339b9964cd3cc4db9e724b185506c2 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/Mesh/MeshUtility.cs b/Assets/MagicaCloth2/Scripts/Core/Utility/Mesh/MeshUtility.cs new file mode 100644 index 00000000..d99e041c --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/Mesh/MeshUtility.cs @@ -0,0 +1,99 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using UnityEngine; + +namespace MagicaCloth2 +{ + public static class MeshUtility + { + /// + /// ƒĴƒ³ƒ€ƒİƒĵ‹‚‰SharedMesh‚’ċ–ċ—™‚‹ + /// + /// + /// + public static Mesh GetSharedMesh(Renderer ren) + { + if (ren == null) + return null; + + if (ren is SkinnedMeshRenderer) + { + var sren = ren as SkinnedMeshRenderer; + return sren.sharedMesh; + } + else + { + // mesh filter + if (!ren.TryGetComponent(out var filter)) + { + Debug.LogError("Not found MeshFilter!"); + return null; + } + + return filter.sharedMesh; + } + } + + /// + /// ƒĴƒ³ƒ€ƒİƒĵĞƒĦƒƒ‚·ƒ‚’設ċš™‚‹ + /// + /// + /// + /// + public static bool SetMesh(Renderer ren, Mesh mesh, Transform[] skinBones = null) + { + if (ren is SkinnedMeshRenderer) + { + var sren = ren as SkinnedMeshRenderer; + sren.sharedMesh = mesh; + + if (skinBones != null && skinBones.Length > 0) + sren.bones = skinBones; + } + else + { + // mesh filter + if (!ren.TryGetComponent(out var filter)) + { + Debug.LogError("Not found MeshFilter!"); + return false; + } + + filter.mesh = mesh; + } + + return true; + } + + /// + /// “ƒĴƒ³ƒ€ƒİƒĵŒċˆİ用—Ĥ„‚‹Transformĉ•°‚’èż”™ + /// “ĉ•°ŻĉĤ‚痁§‚‚Šĉ­£ç˘ş§ŻŞ„§ĉ³¨ĉ„ïĵ + /// + /// + /// + public static int GetTransformCount(Renderer ren) + { + int tcnt = 0; + + if (ren) + { + // renderer + tcnt++; + + if (ren is SkinnedMeshRenderer) + { + var sren = ren as SkinnedMeshRenderer; + + // root bone + tcnt++; + + // skin bones + tcnt += sren.bones?.Length ?? 0; + } + } + + return tcnt; + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/Mesh/MeshUtility.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Utility/Mesh/MeshUtility.cs.meta new file mode 100644 index 00000000..c9d06bda --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/Mesh/MeshUtility.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: b4de31f1b32056a4d868784716d5ff27 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Utility/Mesh/MeshUtility.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/Misc.meta b/Assets/MagicaCloth2/Scripts/Core/Utility/Misc.meta new file mode 100644 index 00000000..126435d3 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/Misc.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 881419a3fff203d4b9c3bdaa61adf5c7 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/Misc/Develop.cs b/Assets/MagicaCloth2/Scripts/Core/Utility/Misc/Develop.cs new file mode 100644 index 00000000..ad8f7dbb --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/Misc/Develop.cs @@ -0,0 +1,53 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// 開発用ƒĤƒĵƒ†‚£ƒŞƒ†‚£ + /// + public static class Develop + { + public static void Log(in object mes) + { + Debug.Log($"[MC2] {mes}"); + } + + public static void LogWarning(in object mes) + { + Debug.LogWarning($"[MC2] {mes}"); + } + + public static void LogError(in object mes) + { + Debug.LogError($"[MC2] {mes}"); + } + + [System.Diagnostics.Conditional("MC2_LOG")] + public static void DebugLog(in object mes) + { + Debug.Log($"[MC2 DEBUG] {mes}"); + } + + [System.Diagnostics.Conditional("MC2_DEBUG")] + public static void DebugLogWarning(in object mes) + { + Debug.LogWarning($"[MC2 DEBUG] {mes}"); + } + + [System.Diagnostics.Conditional("MC2_DEBUG")] + public static void DebugLogError(in object mes) + { + Debug.LogError($"[MC2 DEBUG] {mes}"); + } + + [System.Diagnostics.Conditional("MC2_DEBUG")] + public static void Assert(bool condition) + { + // 何ĉ•…‹ƒĦƒƒ‚ğƒĵ‚¸‚’èż½ċŠ ™‚‹¨ĉݟ能—Ş„.. + Debug.Assert(condition); + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/Misc/Develop.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Utility/Misc/Develop.cs.meta new file mode 100644 index 00000000..9976e958 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/Misc/Develop.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: e02e1cb346cdf1d4babc2bf1470dac90 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Utility/Misc/Develop.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/Misc/StaticStringBuilder.cs b/Assets/MagicaCloth2/Scripts/Core/Utility/Misc/StaticStringBuilder.cs new file mode 100644 index 00000000..adbc829c --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/Misc/StaticStringBuilder.cs @@ -0,0 +1,97 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System.Text; + +namespace MagicaCloth2 +{ + /// + /// 静的StringBuilder‚Żƒİ‚ı + /// + public class StaticStringBuilder + { + private static StringBuilder stringBuilder = new StringBuilder(1024); + + /// + /// StringBuilder‚¤ƒ³‚ı‚żƒ³‚ı‚’ċ–ċ—™‚‹ + /// + public static StringBuilder Instance + { + get + { + return stringBuilder; + } + } + + /// + /// ċ†…部‚’‚ŻƒŞ‚˘™‚‹ + /// + public static void Clear() + { + stringBuilder.Length = 0; + } + + /// + /// 与ˆ‚‰‚ŒŸĉ–‡ċ­—‚’結ċˆ™‚‹ + /// + /// + /// + public static StringBuilder Append(params object[] args) + { + for (int i = 0; i < args.Length; i++) + { + stringBuilder.Append(args[i]); + } + return stringBuilder; + } + + /// + /// 与ˆ‚‰‚ŒŸĉ–‡ċ­—ċˆ—‚’結ċˆ—€ĉœ€ċŒĞĉ”ıèĦŒ‚³ƒĵƒ‰‚’ĉŒżċ…™‚‹ + /// + /// + /// + public static StringBuilder AppendLine(params object[] args) + { + for (int i = 0; i < args.Length; i++) + { + stringBuilder.Append(args[i]); + } + stringBuilder.Append("\n"); + return stringBuilder; + } + + /// + /// ĉ”ıèĦŒ‚’èż½ċŠ ™‚‹ + /// + /// + public static StringBuilder AppendLine() + { + stringBuilder.Append("\n"); + return stringBuilder; + } + + /// + /// 与ˆ‚‰‚ŒŸĉ–‡ċ­—‚’結ċˆ—Ĥ€çµċˆĉ–‡ċ­—ċˆ—‚’èż”™ + /// + /// + /// + public static string AppendToString(params object[] args) + { + stringBuilder.Length = 0; + for (int i = 0; i < args.Length; i++) + { + stringBuilder.Append(args[i]); + } + return stringBuilder.ToString(); + } + + /// + /// ĉ–‡ċ­—ċˆ—‚’èż”™ + /// + /// + public static new string ToString() + { + return stringBuilder.ToString(); + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/Misc/StaticStringBuilder.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Utility/Misc/StaticStringBuilder.cs.meta new file mode 100644 index 00000000..2d12222f --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/Misc/StaticStringBuilder.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 4d925c104701fe242b9f070700e73997 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Utility/Misc/StaticStringBuilder.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection.meta b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection.meta new file mode 100644 index 00000000..501b18f7 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 05c459b696cc77144b66c9cfc2a404b6 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/DataChunk.cs b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/DataChunk.cs new file mode 100644 index 00000000..544b0efd --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/DataChunk.cs @@ -0,0 +1,55 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp + +namespace MagicaCloth2 +{ + /// + /// 配ċˆ—ĉ–­ç‰‡‚’çĦ理™‚‹ + /// + public struct DataChunk + { + /// + /// 開ċ§‹‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı + /// + public int startIndex; + + /// + /// ƒ‡ƒĵ‚żĉ•° + /// + public int dataLength; + + public bool IsValid => dataLength > 0; + + public static DataChunk Empty + { + get + { + return new DataChunk(); + } + } + + public DataChunk(int sindex, int length) + { + startIndex = sindex; + dataLength = length; + } + + public DataChunk(int sindex) + { + startIndex = sindex; + dataLength = 1; + } + + public void Clear() + { + startIndex = 0; + dataLength = 0; + } + + public override string ToString() + { + return $"[startIndex={startIndex}, dataLength={dataLength}]"; + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/DataChunk.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/DataChunk.cs.meta new file mode 100644 index 00000000..e12396b5 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/DataChunk.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 1da73ff56787abd45804252538471bf6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/DataChunk.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExBitFlag16.cs b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExBitFlag16.cs new file mode 100644 index 00000000..8bd4e88c --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExBitFlag16.cs @@ -0,0 +1,51 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System.Runtime.CompilerServices; + +namespace MagicaCloth2 +{ + /// + /// 16ƒ“ƒƒƒˆƒ•ƒİ‚° + /// + [System.Serializable] + public struct ExBitFlag16 + { + public ushort Value; + + public ExBitFlag16(ushort initialValue = 0) + { + Value = initialValue; + } + + public void Clear() + { + Value = 0; + } + + /// + /// ƒ•ƒİ‚°è¨­ċšïĵˆƒ“ƒƒƒˆç›´ĉŒ‡ċšïĵ‰ + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void SetFlag(ushort flag, bool sw) + { + if (sw) + Value |= flag; + else + Value = (ushort)(Value & ~flag); + } + + /// + /// ƒ•ƒİ‚°ċˆ¤ċšïĵˆƒ“ƒƒƒˆç›´ĉŒ‡ċšïĵ‰ + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool IsSet(ushort flag) + { + return (Value & flag) != 0; + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExBitFlag16.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExBitFlag16.cs.meta new file mode 100644 index 00000000..1589cbf7 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExBitFlag16.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 82468a45671e5e1498d4df5c19611f32 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExBitFlag16.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExBitFlag8.cs b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExBitFlag8.cs new file mode 100644 index 00000000..be9adb17 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExBitFlag8.cs @@ -0,0 +1,52 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System.Runtime.CompilerServices; + +namespace MagicaCloth2 +{ + /// + /// ïĵ˜ƒ“ƒƒƒˆƒ•ƒİ‚° + /// + [System.Serializable] + public struct ExBitFlag8 + { + public byte Value; + + public ExBitFlag8(byte initialValue = 0) + { + Value = initialValue; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Clear() + { + Value = 0; + } + + /// + /// ƒ•ƒİ‚°è¨­ċš + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void SetFlag(byte flag, bool sw) + { + if (sw) + Value |= flag; + else + Value = (byte)(Value & ~flag); + } + + /// + /// ƒ•ƒİ‚°ċˆ¤ċš + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool IsSet(byte flag) + { + return (Value & flag) != 0; + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExBitFlag8.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExBitFlag8.cs.meta new file mode 100644 index 00000000..ba873351 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExBitFlag8.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: eb16200a6206d394d9e12963263352b0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExBitFlag8.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExCostSortedList1.cs b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExCostSortedList1.cs new file mode 100644 index 00000000..ee10fc2e --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExCostSortedList1.cs @@ -0,0 +1,73 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System; +using System.Runtime.CompilerServices; +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// ĉœ€‚‚低„‚³‚ıƒˆ¨ƒ‡ƒĵ‚ż‚’ïĵ‘¤ĉ ĵ納™‚‹SortedList + /// ‚³‚ıƒˆŻïĵäğ上§Ş‘‚Œ°Ş‚‰Ş„ + /// ċż…š‚³ƒ³‚ıƒˆƒİ‚Ż‚ż§ƒž‚¤ƒŠ‚ı‚³‚ıƒˆ‚’ĉŒ‡ċš—Ĥ‹‚‰ċˆİ用™‚‹“¨ + /// var dlist = new ExCostSortedList1(-1); + /// + public struct ExCostSortedList1 : IComparable + { + internal float cost; + internal int data; + + /// + /// ċż…šƒž‚¤ƒŠ‚ıè·é›˘§ċˆĉœŸċŒ–™‚‹“¨ + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public ExCostSortedList1(float invalidCost) + { + cost = invalidCost; + data = 0; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public ExCostSortedList1(float invalidCost, int initData) + { + cost = invalidCost; + data = initData; + } + + + public bool IsValid => cost >= 0.0f; + + public int Count => IsValid ? 1 : 0; + + public float Cost => cost; + + public int Data => data; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Add(float cost, int item) + { + Debug.Assert(cost >= 0.0f); + if (IsValid == false || cost < this.cost) + { + this.cost = cost; + data = item; + } + } + + public int CompareTo(ExCostSortedList1 other) + { + // ‚³‚ıƒˆĉ˜‡é † + if (cost != other.cost) + return cost < other.cost ? -1 : 1; + else + return 0; + } + + public override string ToString() + { + return $"({cost} : {data})"; + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExCostSortedList1.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExCostSortedList1.cs.meta new file mode 100644 index 00000000..2f4afc93 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExCostSortedList1.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: b8b3cd069c36d174ea801cadc4d95919 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExCostSortedList1.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExCostSortedList4.cs b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExCostSortedList4.cs new file mode 100644 index 00000000..f8c1341a --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExCostSortedList4.cs @@ -0,0 +1,186 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System.Runtime.CompilerServices; +using Unity.Collections; +using Unity.Mathematics; +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// ‚³‚ıƒˆĉ˜‡é †Ğïĵ”¤§ƒ‡ƒĵ‚ż‚’ĉ ĵ納§‚‹ċ›şċšSortedList + /// ‚³‚ıƒˆŻïĵäğ上§Ş‘‚Œ°Ş‚‰Ş„ + /// ċż…š‚³ƒ³‚ıƒˆƒİ‚Ż‚ż§ƒž‚¤ƒŠ‚ı‚³‚ıƒˆ‚’ĉŒ‡ċš—Ĥ‹‚‰ċˆİ用™‚‹“¨ + /// var dlist = new ExCostSortedList4(-1); + /// + public struct ExCostSortedList4 + { + internal float4 costs; + internal int4 data; + + /// + /// ċż…šƒž‚¤ƒŠ‚ıè·é›˘§ċˆĉœŸċŒ–™‚‹“¨ + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public ExCostSortedList4(float invalidCost) + { + costs = invalidCost; + data = 0; + } + + public int Count + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get + { + for (int i = 3; i >= 0; i--) + { + if (costs[i] >= 0.0f) + return i + 1; + } + + return 0; + } + } + + public bool IsValid => costs[0] >= 0.0f; + + public bool Add(float cost, int item) + { + Debug.Assert(cost >= 0.0f); + + // ™§Ğƒ‡ƒĵ‚żŒä¸€ĉŻ§ĉœ€ċ¤§‚³‚ıƒˆ‚ˆ‚Šä¸ŠŞ‚‰ċ…‚‰Ş„ + if (costs[3] >= 0.0f && cost > costs[3]) + return false; + + + // è·é›˘ĉ˜‡é †§ĉŒżċ…™‚‹€ĉœ€ċ¤§ĉ•°Żïĵ” + for (int i = 0; i < 4; i++) + { + float d = costs[i]; + if (d < 0.0f) + { + // èż½ċŠ  + costs[i] = cost; + data[i] = item; + return true; + } + else if (cost < d) + { + // ĉŒżċ… + for (int j = 2; j >= i; j--) + { + costs[j + 1] = costs[j]; + data[j + 1] = data[j]; + } + costs[i] = cost; + data[i] = item; + return true; + } + } + + // ċ…‚‰Ş„ + return false; + } + + //[MethodImpl(MethodImplOptions.AggressiveInlining)] + //public (float, int) Get(int index) + //{ + // return (costs[index], data[index]); + //} + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Contains(int item) + { + for (int i = 0; i < 4; i++) + { + if (costs[i] >= 0.0f && data[i] == item) + return true; + } + return false; + } + + /// + /// ƒ‡ƒĵ‚żċ†…‚˘‚¤ƒ†ƒ ‚’ĉ¤œç´˘—Ĥç™ğ録‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı‚’èż”™€‚(-1=Ş—) + /// + /// + /// + public int indexOf(int item) + { + for (int i = 0; i < 4; i++) + { + if (costs[i] >= 0.0f && data[i] == item) + return i; + } + + return -1; + } + + /// + /// ƒ‡ƒĵ‚żċ†…‚˘‚¤ƒ†ƒ ‚’ċ‰Šé™¤—ƒ‡ƒĵ‚ż‚’ïĵ‘¤èݰ‚‚‹ + /// + /// + public void RemoveItem(int item) + { + int itemIndex = -1; + for (int i = 0; i < 4; i++) + { + if (costs[i] >= 0.0f && data[i] == item) + { + itemIndex = i; + break; + } + } + if (itemIndex < 0) + return; + + for (int j = itemIndex; j < 3; j++) + { + costs[j] = costs[j + 1]; + data[j] = data[j + 1]; + } + costs[3] = -1; + } + + /// + /// ƒ‡ƒĵ‚żċ†…ĉœ€ċ°‚³‚ıƒˆ‚’èż”™ + /// + public float MinCost + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get + { + return costs[0]; + } + } + + /// + /// ƒ‡ƒĵ‚żċ†…ĉœ€ċ¤§‚³‚ıƒˆ‚’èż”™ + /// + public float MaxCost + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get + { + for (int i = 3; i >= 0; i--) + { + if (costs[i] >= 0.0f) + return costs[i]; + } + return 0.0f; + } + } + + public override string ToString() + { + var s = new FixedString512Bytes(); + for (int i = 0; i < Count; i++) + { + s.Append($"({costs[i]} : {data[i]}) "); + } + return s.ToString(); + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExCostSortedList4.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExCostSortedList4.cs.meta new file mode 100644 index 00000000..0890ae7a --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExCostSortedList4.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 117c9e1f7003d1b418193a8ee6f8a850 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExCostSortedList4.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExNativeArray.cs b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExNativeArray.cs new file mode 100644 index 00000000..7ada7e3d --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExNativeArray.cs @@ -0,0 +1,709 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System; +using System.Collections.Generic; +using System.Text; +using Unity.Collections; +using Unity.Collections.LowLevel.Unsafe; +using Unity.Mathematics; +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// ĉ‹ĦċĵµċŻèƒ½ŞNativeArray‚Żƒİ‚ı + /// 領ċŸŸŒä¸èĥ³™‚‹¨è‡Şċ‹•§ĉ‹Ħċĵµ™‚‹ + /// ƒ‡ƒĵ‚żŻChankDataĞ‚ˆ‚Šé–‹ċ§‹‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı¨é•·•ŒçĦ理•‚Œ‚‹ + /// ƒ‡ƒĵ‚żŻċ‰Šé™¤ċŻèƒ½§ċ‰Šé™¤•‚ŒŸé ˜ċŸŸŻçĦ理•‚Œċ†ċˆİ用•‚Œ‚‹ + /// 領ċŸŸçĦ理Œċż…èĤŞŸ‚ExSimpleNativeArrayĞĉŻ”ıĤ‚„‚„重„§ĉ³¨ĉ„ïĵ + /// + /// + public class ExNativeArray : IDisposable where T : unmanaged + { + NativeArray nativeArray; + + List emptyChunks = new List(); + + int useCount; + + public void Dispose() + { + if (nativeArray.IsCreated) + { + nativeArray.Dispose(); + } + emptyChunks.Clear(); + useCount = 0; + } + + public bool IsValid => nativeArray.IsCreated; + + /// + /// NativeArrayé ˜ċŸŸ‚µ‚¤‚ş + /// ċŸéš›Ğċˆİ用•‚ŒĤ„‚‹‚µ‚¤‚ş¨Żç•°Ş‚‹§ĉ³¨ĉ„ïĵ + /// + public int Length => nativeArray.IsCreated ? nativeArray.Length : 0; + + /// + /// ċŸéš›Ğċˆİ用•‚ŒĤ„‚‹ƒ‡ƒĵ‚żĉ•°ïĵˆĉœ€ċŒƒƒ£ƒ³‚݁ĉœ€ċŒċ°ïĵ‹ïĵ‘ïĵ‰ + /// + public int Count => useCount; + + //========================================================================================= + public ExNativeArray() + { + } + + public ExNativeArray(int emptyLength, bool create = false) : this() + { + if (emptyLength > 0) + { + nativeArray = new NativeArray(emptyLength, Allocator.Persistent); + var chunk = new DataChunk(0, emptyLength); + emptyChunks.Add(chunk); + + if (create) + { + // 領ċŸŸ‚’確保™‚‹ + AddRange(emptyLength); + } + } + else if (create) + { + // Native配ċˆ—żïĵ§ç˘şäżïĵˆä¸ğĞ‚¸ƒ§ƒ–§‚¨ƒİƒĵċŻç­–ïĵ‰ + nativeArray = new NativeArray(0, Allocator.Persistent); + } + } + + public ExNativeArray(int emptyLength, T fillData) : this(emptyLength) + { + if (emptyLength > 0) + Fill(fillData); + } + + public ExNativeArray(NativeArray dataArray) : this() + { + AddRange(dataArray); + } + + public ExNativeArray(T[] dataArray) : this() + { + AddRange(dataArray); + } + + //========================================================================================= +#if false + /// + /// ä½żç”¨é…ċˆ—‚Ğ‚Ĥƒ³ƒˆ‚’設ċš™‚‹ + /// ĉœ‰ċŠıĉ•°‚’ĉ›¸ĉ›ˆ™ıĤƒ‡ƒĵ‚ż‚’ïĵ‘¤ƒƒ£ƒ³‚݁¨—Ĥä½żç”¨ä¸­¨™‚‹ + /// ‹Ş‚Šċĵ·ċŠ›Şĉݟ能Ş§ĉ‰ħ„ĞŻĉ³¨ĉ„™‚‹“¨ïĵ + /// + /// + public void SetUseCount(int count) + { + useCount = count; + emptyChunks.Clear(); + if (useCount > Length) + { + // ĉœŞä½żç”¨é ˜ċŸŸ‚’ïĵ‘¤çİşƒƒ£ƒ³‚݁¨—Ĥç™ğ録™‚‹ + var chunk = new DataChunk(useCount, Length - useCount); + emptyChunks.Add(chunk); + } + } +#endif + + /// + /// ĉŒ‡ċš‚µ‚¤‚şé ˜ċŸŸ‚’èż½ċŠ —ƒƒ£ƒ³‚Ż‚’èż”™ + /// + /// + /// + public DataChunk AddRange(int dataLength) + { + // ‚µ‚¤‚ş0ċŻċżœ + if (dataLength == 0) + { + // 領ċŸŸ ‘Ż0§ç˘şäż™‚‹ + if (nativeArray.IsCreated == false) + nativeArray = new NativeArray(0, Allocator.Persistent); + + return DataChunk.Empty; + } + + var chunk = GetEmptyChunk(dataLength); + + if (chunk.IsValid == false) + { + // çİş‚’ċ˘—‚„™ + int nowLength = Length; + int nextLength = Length + math.max(dataLength, nowLength); + if (nowLength == 0) + { + // ĉ–°èĤ + if (nativeArray.IsCreated) + nativeArray.Dispose(); + nativeArray = new NativeArray(nextLength, Allocator.Persistent); + chunk.dataLength = dataLength; + } + else + { + // ĉ‹Ħċĵµ + var newNativeArray = new NativeArray(nextLength, Allocator.Persistent); + + // copy + NativeArray.Copy(nativeArray, newNativeArray, nowLength); + nativeArray.Dispose(); + nativeArray = newNativeArray; + + // data chunk + chunk.startIndex = nowLength; + chunk.dataLength = dataLength; + + int last = nowLength + dataLength; + if (last < nextLength) + { + var emptyChunk = new DataChunk(last, nextLength - last); + AddEmptyChunk(emptyChunk); + } + } + } + + // ä½żç”¨é‡ + useCount = math.max(useCount, chunk.startIndex + chunk.dataLength); + + return chunk; + } + + public DataChunk AddRange(int dataLength, T fillData = default(T)) + { + var chunk = AddRange(dataLength); + Fill(chunk, fillData); + return chunk; + } + + public DataChunk AddRange(T[] array) + { + if (array == null || array.Length == 0) + return DataChunk.Empty; + + int dataLength = array.Length; + var chunk = AddRange(dataLength); + + // copy + NativeArray.Copy(array, 0, nativeArray, chunk.startIndex, dataLength); + + return chunk; + } + + public DataChunk AddRange(NativeArray narray, int length = 0) + { + if (narray.IsCreated == false || narray.Length == 0) + return DataChunk.Empty; + + int dataLength = length > 0 ? length : narray.Length; + var chunk = AddRange(dataLength); + // copy + NativeArray.Copy(narray, 0, nativeArray, chunk.startIndex, dataLength); + + return chunk; + } + + public DataChunk AddRange(ExNativeArray exarray) + { + return AddRange(exarray.GetNativeArray(), exarray.Count); + } + + public DataChunk AddRange(ExSimpleNativeArray exarray) + { + return AddRange(exarray.GetNativeArray(), exarray.Count); + } + + /// + /// ċž‹Żç•°Ş‚‹Œċž‹‚µ‚¤‚şŻċŒ˜é…ċˆ—‚’èż½ċŠ ™‚‹€‚Vector3->float3Şİ€‚ + /// + /// + /// + /// + public unsafe DataChunk AddRange(U[] array) where U : struct + { + if (array == null || array.Length == 0) + return DataChunk.Empty; + + int dstSize = UnsafeUtility.SizeOf(); + int dataLength = array.Length; + var chunk = AddRange(dataLength); + + ulong src_gcHandle; + void* src_p = UnsafeUtility.PinGCArrayAndGetDataAddress(array, out src_gcHandle); + byte* dst_p = (byte*)nativeArray.GetUnsafePtr(); + + UnsafeUtility.MemCpy(dst_p + chunk.startIndex * dstSize, src_p, dataLength * dstSize); + UnsafeUtility.ReleaseGCObject(src_gcHandle); + + return chunk; + } + + /// + /// ċž‹Żç•°Ş‚‹Œċž‹‚µ‚¤‚şŻċŒ˜NativeArray‚’èż½ċŠ ™‚‹€‚Vector3->float3Şİ€‚ + /// + /// + /// + /// + public DataChunk AddRange(NativeArray udata) where U : struct + { + if (udata.IsCreated == false || udata.Length == 0) + return DataChunk.Empty; + + int dataLength = udata.Length; + var chunk = AddRange(dataLength); + + // copy + NativeArray.Copy(udata.Reinterpret(), 0, nativeArray, chunk.startIndex, dataLength); + + return chunk; + } + + /// + /// ċž‹‚‚‚µ‚¤‚ş‚‚ç•°Ş‚‹é…ċˆ—‚’èż½ċŠ ™‚‹€‚int[] -> int3[]Şİ€‚ + /// ƒ‡ƒĵ‚żŻƒĦƒ˘ƒŞ‚³ƒ”ƒĵ•‚Œ‚‹€‚䋁ˆ°int[]‹‚‰int3[]¸èż½ċŠ ™‚‹¨ĉĴĦ‚ˆ†ĞŞ‚‹€‚ + /// int[]{1, 2, 3, 4, 5, 6} => int3[]{{1, 2, 3}, {4, 5, 6}} + /// + /// + /// + /// + public unsafe DataChunk AddRangeTypeChange(U[] array) where U : struct + { + if (array == null || array.Length == 0) + return DataChunk.Empty; + + int srcSize = UnsafeUtility.SizeOf(); + int dstSize = UnsafeUtility.SizeOf(); + + int dataLength = (array.Length * srcSize) / dstSize; + var chunk = AddRange(dataLength); + + ulong src_gcHandle; + void* src_p = UnsafeUtility.PinGCArrayAndGetDataAddress(array, out src_gcHandle); + byte* dst_p = (byte*)nativeArray.GetUnsafePtr(); + + UnsafeUtility.MemCpy(dst_p + chunk.startIndex * dstSize, src_p, dataLength * dstSize); + UnsafeUtility.ReleaseGCObject(src_gcHandle); + + return chunk; + } + + /// + /// ċž‹‚‚‚µ‚¤‚ş‚‚ç•°Ş‚‹é…ċˆ—‚’部ċˆ†çš„Ğ‚³ƒ”ƒĵ™‚‹€‚Vector4[] -> float3Şİ€‚ + /// + /// + /// + /// + public unsafe DataChunk AddRangeStride(U[] array) where U : struct + { + if (array == null || array.Length == 0) + return DataChunk.Empty; + + int srcSize = UnsafeUtility.SizeOf(); + int dstSize = UnsafeUtility.SizeOf(); + int dataLength = array.Length; + var chunk = AddRange(dataLength); + + ulong src_gcHandle; + void* src_p = UnsafeUtility.PinGCArrayAndGetDataAddress(array, out src_gcHandle); + byte* dst_p = (byte*)nativeArray.GetUnsafePtr(); + int elementSize = math.min(srcSize, dstSize); + + UnsafeUtility.MemCpyStride(dst_p + chunk.startIndex * dstSize, dstSize, src_p, srcSize, elementSize, dataLength); + UnsafeUtility.ReleaseGCObject(src_gcHandle); + + return chunk; + } + + public DataChunk Add(T data) + { + var chunk = AddRange(1); + nativeArray[chunk.startIndex] = data; + return chunk; + } + + /// + /// ĉŒ‡ċšƒƒ£ƒ³‚݁ƒ‡ƒĵ‚żĉ•°‚’ĉ‹Ħċĵµ—ĉ–°—„ƒƒ£ƒ³‚Ż‚’èż”™ + /// ċ¤„ƒƒ£ƒ³‚݁ƒ‡ƒĵ‚żŻĉ–°—„ƒƒ£ƒ³‚ŻĞ‚³ƒ”ƒĵ•‚Œ‚‹ + /// + /// + /// + /// + public DataChunk Expand(DataChunk c, int newDataLength) + { + Develop.Assert(c.IsValid); + if (c.IsValid == false) + return c; + if (newDataLength <= c.dataLength) + return c; + + // ĉ–°—„é ˜ċŸŸ‚’確保™‚‹ + var nc = AddRange(newDataLength); + + // ċ¤„é ˜ċŸŸ‚’‚³ƒ”ƒĵ™‚‹ + NativeArray.Copy(nativeArray, c.startIndex, nativeArray, nc.startIndex, c.dataLength); + + // ċ¤„é ˜ċŸŸ‚’é–‹ĉ”™‚‹ + Remove(c); + + return nc; + } + + /// + /// ĉŒ‡ċšƒƒ£ƒ³‚݁ƒ‡ƒĵ‚żĉ•°‚’ĉ‹Ħċĵµ—ĉ–°—„ƒƒ£ƒ³‚Ż‚’èż”™ + /// ċ¤„ƒƒ£ƒ³‚݁ƒ‡ƒĵ‚żŻĉ–°—„ƒƒ£ƒ³‚ŻĞ‚³ƒ”ƒĵ•‚Œ‚‹ + /// + /// + /// + /// + public DataChunk ExpandAndFill(DataChunk c, int newDataLength, T fillData = default(T), T clearData = default(T)) + { + Develop.Assert(c.IsValid); + if (c.IsValid == false) + return c; + if (newDataLength <= c.dataLength) + return c; + + // ĉ–°—„é ˜ċŸŸ‚’確保™‚‹ + var nc = AddRange(newDataLength, fillData); + + // ċ¤„é ˜ċŸŸ‚’‚³ƒ”ƒĵ™‚‹ + NativeArray.Copy(nativeArray, c.startIndex, nativeArray, nc.startIndex, c.dataLength); + + // ċ¤„é ˜ċŸŸ‚’é–‹ĉ”™‚‹ + RemoveAndFill(c, clearData); + + return nc; + } + + public T[] ToArray() + { + return nativeArray.ToArray(); + } + + public void CopyTo(T[] array) + { + NativeArray.Copy(nativeArray, array); + } + + public void CopyTo(T[] array, int startIndex) + { + Debug.Assert(array != null); + NativeArray.Copy(nativeArray, startIndex, array, 0, array.Length); + } + + public void CopyTo(U[] array) where U : struct + { + NativeArray.Copy(nativeArray.Reinterpret(), array); + } + + public void CopyFrom(NativeArray array) + { + NativeArray.Copy(array, nativeArray); + } + + public void CopyFrom(T[] array, int startIndex) + { + Debug.Assert(array != null); + NativeArray.Copy(array, 0, nativeArray, startIndex, array.Length); + } + + public void CopyFrom(NativeArray array) where U : struct + { + NativeArray.Copy(array.Reinterpret(), nativeArray); + } + + public void CopyFrom(NativeArray array, int dstIndex, int length) where U : struct + { + NativeArray.Copy(array.Reinterpret(), 0, nativeArray, dstIndex, length); + } + + /// + /// ċž‹‚‚‚µ‚¤‚ş‚‚ç•°Ş‚‹é…ċˆ—Ğƒ‡ƒĵ‚ż‚’‚³ƒ”ƒĵ™‚‹€‚ + /// int3 -> int[]Şİ + /// + /// + /// + public unsafe void CopyTypeChange(U[] array) where U : struct + { + int srcSize = UnsafeUtility.SizeOf(); + int dstSize = UnsafeUtility.SizeOf(); + int dataLength = (Length * srcSize) / dstSize; + + byte* src_p = (byte*)nativeArray.GetUnsafePtr(); + ulong dst_gcHandle; + void* dst_p = UnsafeUtility.PinGCArrayAndGetDataAddress(array, out dst_gcHandle); + + UnsafeUtility.MemCpy(dst_p, src_p, dataLength * dstSize); + UnsafeUtility.ReleaseGCObject(dst_gcHandle); + } + + /// + /// ċž‹‚‚‚µ‚¤‚ş‚‚ç•°Ş‚‹é…ċˆ—Ğƒ‡ƒĵ‚ż‚’ĉ–­ç‰‡çš„Ğ‚³ƒ”ƒĵ™‚‹€‚ + /// float3 -> Vector4[]Şİ€‚“ċ ´ċˆŻVector4ĞŻxyzżĉ›¸èĵ‚Œ‚‹€‚ + /// + /// + /// + public unsafe void CopyTypeChangeStride(U[] array) where U : struct + { + int srcSize = UnsafeUtility.SizeOf(); + int dstSize = UnsafeUtility.SizeOf(); + int dataLength = Length; + + byte* src_p = (byte*)nativeArray.GetUnsafePtr(); + ulong dst_gcHandle; + void* dst_p = UnsafeUtility.PinGCArrayAndGetDataAddress(array, out dst_gcHandle); + + int elementSize = srcSize; + + UnsafeUtility.MemCpyStride(dst_p, dstSize, src_p, srcSize, elementSize, dataLength); + UnsafeUtility.ReleaseGCObject(dst_gcHandle); + } + + /// + /// ™Ğċˆİ用§‚‹çİşé ˜ċŸŸżèż½ċŠ ™‚‹ + /// + /// + public void AddEmpty(int dataLength) + { + var chunk = AddRange(dataLength); + Remove(chunk); + } + + public void Remove(DataChunk chunk) + { + if (chunk.IsValid == false) + return; + + AddEmptyChunk(chunk); + + // ä½żç”¨é‡ċ†è¨ˆç— + if ((chunk.startIndex + chunk.dataLength) == useCount) + { + useCount = 0; + foreach (var echunk in emptyChunks) + { + useCount = math.max(useCount, echunk.startIndex); + } + } + } + + public void Remove(int index) + { + Remove(new DataChunk(index)); + } + + public void RemoveAndFill(DataChunk chunk, T clearData = default(T)) + { + Remove(chunk); + + // ƒ‡ƒĵ‚ż‚ŻƒŞ‚˘ + // C# + //Parallel.For(0, chunk.dataLength, i => + //{ + // nativeArray[chunk.startIndex + i] = clearData; + //}); + //FillInternal(chunk.startIndex, chunk.dataLength, clearData); + Fill(chunk, clearData); + } + + public void Fill(T fillData = default(T)) + { + if (IsValid == false) + return; + + // C# + //Parallel.For(0, nativeArray.Length, i => + //{ + // nativeArray[i] = fillData; + //}); + FillInternal(0, nativeArray.Length, fillData); + } + + public void Fill(DataChunk chunk, T fillData = default(T)) + { + if (IsValid == false || chunk.IsValid == false) + return; + + // C# + //Parallel.For(0, chunk.dataLength, i => + //{ + // nativeArray[chunk.startIndex + i] = fillData; + //}); + FillInternal(chunk.startIndex, chunk.dataLength, fillData); + } + + unsafe void FillInternal(int start, int size, T fillData = default(T)) + { + //byte* dst_p = (byte*)nativeArray.GetUnsafePtr(); + void* dst_p = nativeArray.GetUnsafePtr(); + int index = start; + for (int i = 0; i < size; i++, index++) + { + UnsafeUtility.WriteArrayElement(dst_p, index, fillData); + } + } + + + public void Clear() + { + emptyChunks.Clear(); + useCount = 0; + + // empty chunk + if (IsValid && Length > 0) + { + var chunk = new DataChunk(0, Length); + emptyChunks.Add(chunk); + } + } + + public T this[int index] + { + get + { + return nativeArray[index]; + } + set + { + nativeArray[index] = value; + } + } + + public unsafe ref T GetRef(int index) + { + T* p = (T*)nativeArray.GetUnsafePtr(); + return ref *(p + index); + } + + //public unsafe ref T GetRef(int index) + //{ + // var span = new Span(nativeArray.GetUnsafePtr(), nativeArray.Length); + // return ref span[index]; + //} + + /// + /// Job§ċˆİ用™‚‹ċ ´ċˆŻ“é–˘ĉ•°§NativeArrayĞċ¤‰ĉ›—Ĥċ—‘ĉ¸Ħ™ + /// + /// + public NativeArray GetNativeArray() + { + return nativeArray; + } + + /// + /// Job§ċˆİ用™‚‹ċ ´ċˆŻ“é–˘ĉ•°§NativeArrayĞċ¤‰ĉ›—Ĥċ—‘ĉ¸Ħ™(ċž‹ċ¤‰ĉ›´‚‚Š) + /// + /// + /// + public NativeArray GetNativeArray() where U : struct + { + return nativeArray.Reinterpret(); + } + + //========================================================================================= + DataChunk GetEmptyChunk(int dataLength) + { + if (dataLength <= 0) + return new DataChunk(); + + for (int i = 0; i < emptyChunks.Count; i++) + { + var c = emptyChunks[i]; + if (dataLength == c.dataLength) + { + // “ƒƒ£ƒ³‚Ż‚’™ıĤċˆİ用™‚‹ + emptyChunks.RemoveAtSwapBack(i); + return c; + } + else if (dataLength < c.dataLength) + { + // “ƒƒ£ƒ³‚Ż‚’一部ċˆİ用™‚‹ + var chunk = new DataChunk(); + chunk.startIndex = c.startIndex; + chunk.dataLength = dataLength; + c.startIndex += dataLength; + c.dataLength -= dataLength; + emptyChunks[i] = c; + return chunk; + } + } + + // ċˆİ用§‚‹ƒƒ£ƒ³‚ŻŻŞ— + return new DataChunk(); + } + + void AddEmptyChunk(DataChunk chunk) + { + if (chunk.IsValid == false) + return; + + // ċŒ‚Ğ連結§‚‹ċ ´ĉ‰€‚’ĉŽ˘™ + for (int i = 0; i < emptyChunks.Count; i++) + { + var c = emptyChunks[i]; + if ((c.startIndex + c.dataLength) == chunk.startIndex) + { + // ““Ğ連結™‚‹ + c.dataLength += chunk.dataLength; + chunk = c; + + // c‚’ċ‰Šé™¤™‚‹ + emptyChunks.RemoveAtSwapBack(i); + break; + } + } + + // ċ‰Ğ連結§‚‹ċ ´ĉ‰€‚’ĉŽ˘™ + for (int i = 0; i < emptyChunks.Count; i++) + { + var c = emptyChunks[i]; + if (c.startIndex == (chunk.startIndex + chunk.dataLength)) + { + // ““Ğ連結™‚‹ + chunk.dataLength += c.dataLength; + + // c‚’ċ‰Šé™¤™‚‹ + emptyChunks.RemoveAtSwapBack(i); + break; + } + } + + // chunk‚’èż½ċŠ ™‚‹ + emptyChunks.Add(chunk); + } + + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + + sb.AppendLine($"ExNativeArray Length:{Length} Count:{Count} IsValid:{IsValid}"); + sb.AppendLine("---- Datas[100] ----"); + if (IsValid) + { + for (int i = 0; i < Length && i < 100; i++) + { + sb.AppendLine(nativeArray[i].ToString()); + } + } + + sb.AppendLine("---- Empty Chunks ----"); + foreach (var c in emptyChunks) + { + sb.AppendLine(c.ToString()); + } + sb.AppendLine(); + + return sb.ToString(); + } + + public string ToSummary() + { + return $"ExNativeArray Length:{Length} Count:{Count} IsValid:{IsValid}"; + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExNativeArray.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExNativeArray.cs.meta new file mode 100644 index 00000000..41a0493b --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExNativeArray.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 10d8d6da3ac2b13489c729db68ef39ec +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExNativeArray.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExProcessingList.cs b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExProcessingList.cs new file mode 100644 index 00000000..19b9240e --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExProcessingList.cs @@ -0,0 +1,80 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System; +using Unity.Collections; +using Unity.Collections.LowLevel.Unsafe; + +namespace MagicaCloth2 +{ + /// + /// ïĵ‘¤ƒƒƒƒ•‚ĦĞä¸Ĥċˆ—Ğƒ‡ƒĵ‚ż‚’ĉ›¸èĵ‚‚‹‚ˆ†Ğ™‚‹Ÿ‚ĉ§‹é€ €‚ + /// ‚Ğ‚Ĥƒ³‚żƒĵ‚’‚˘ƒˆƒŸƒƒ‚Żĉ“ä½œ™‚‹“¨Ğ‚ˆ‚Ёé–‹ċ§‹‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı‚’çĦ理™‚‹€‚ + /// + /// + public unsafe class ExProcessingList : IDisposable, IValid where T : struct + { + /// + /// ƒƒƒƒ•‚Ħçċœ¨ƒ‡ƒĵ‚żĉ•°‚’‚Ğ‚Ĥƒ³ƒˆ™‚‹Ÿ‚‚Ğ‚Ĥƒ³‚żƒĵ + /// + public NativeReference Counter; + + /// + /// ƒ‡ƒĵ‚żƒƒƒƒ•‚Ħ + /// + public NativeArray Buffer; + + //========================================================================================= + public void Dispose() + { + if (Counter.IsCreated) + Counter.Dispose(); + if (Buffer.IsCreated) + Buffer.Dispose(); + } + + public bool IsValid() + { + return Counter.IsCreated; + } + + //========================================================================================= + public ExProcessingList() + { + Counter = new NativeReference(Allocator.Persistent); + } + + //========================================================================================= + /// + /// ‚­ƒ£ƒ‘‚·ƒ†‚£ŒċŽ‚‹‚ˆ†Ğƒƒƒƒ•‚Ħ‚’ĉ‹Ħċĵµ™‚‹€‚ + /// ™§Ğċı量Œç˘şäż§Ĥ„‚‹ċ ´ċˆŻä½•‚‚—Ş„€‚ + /// + /// + public void UpdateBuffer(int capacity) + { + if (Buffer.IsCreated == false || Buffer.Length < capacity) + { + if (Buffer.IsCreated) + Buffer.Dispose(); + Buffer = new NativeArray(capacity, Allocator.Persistent); + } + } + + /// + /// ‚¸ƒ§ƒ–‚ı‚ħ‚¸ƒƒĵƒĞ用‚Ğ‚Ĥƒ³ƒˆintƒ‚¤ƒ³‚żƒĵ‚’ċ–ċ—™‚‹ + /// + /// + /// + public int* GetJobSchedulePtr() + { + return (int*)Counter.GetUnsafePtrWithoutChecks(); + } + + public override string ToString() + { + int counter = Counter.IsCreated ? Counter.Value : 0; + int bufferLength = Buffer.IsCreated ? Buffer.Length : 0; + return $"ExProcessingList BufferLength:{bufferLength} Counter:{counter}"; + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExProcessingList.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExProcessingList.cs.meta new file mode 100644 index 00000000..906ce0f6 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExProcessingList.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 5a3ca7c202548c1439db91f92cc30790 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExProcessingList.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExSimpleNativeArray.cs b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExSimpleNativeArray.cs new file mode 100644 index 00000000..c675310e --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExSimpleNativeArray.cs @@ -0,0 +1,603 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System; +using System.Text; +using Unity.Collections; +using Unity.Collections.LowLevel.Unsafe; +using Unity.Mathematics; +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// ‚µ‚¤‚şĉ‹ĦċĵµċŻèƒ½ŞNativeArrayçĦ理‚Żƒİ‚ı + /// 領ċŸŸŒä¸èĥ³™‚‹¨è‡Şċ‹•§‚µ‚¤‚ş‚’ĉ‹Ħċĵµ™‚‹ + /// Ÿ —é ˜ċŸŸĉ‹Ħċĵµż§ċ‰Šé™¤‚„é ˜ċŸŸċ†ċˆİ用Ż§Ş„ + /// + /// + public class ExSimpleNativeArray : IDisposable where T : unmanaged + { + NativeArray nativeArray; + + int count; + int length; + + //========================================================================================= + public ExSimpleNativeArray() + { + count = 0; + length = 0; + } + + /// + /// 領ċŸŸ‚’確保™‚‹ + /// + /// + /// true=領ċŸŸż§ċˆİ用‚Ğ‚Ĥƒ³ƒˆ‚’進‚Ş„ + public ExSimpleNativeArray(int dataLength, bool areaOnly = false) : this() + { + nativeArray = new NativeArray(dataLength, Allocator.Persistent); + length = dataLength; + if (areaOnly == false) + count = length; + } + + public ExSimpleNativeArray(T[] dataArray) : this() + { + Debug.Assert(dataArray != null); + nativeArray = new NativeArray(dataArray, Allocator.Persistent); + length = dataArray.Length; + count = length; + } + + public ExSimpleNativeArray(NativeArray array) : this() + { + Debug.Assert(array.IsCreated); + nativeArray = new NativeArray(array, Allocator.Persistent); + length = array.Length; + count = length; + } + + public ExSimpleNativeArray(NativeList array) : this() + { + Debug.Assert(array.IsCreated); + nativeArray = new NativeArray(array.AsArray(), Allocator.Persistent); + length = array.Length; + count = length; + } + + public ExSimpleNativeArray(SerializationData sdata) + { + Deserialize(sdata); + } + + public void Dispose() + { + if (nativeArray.IsCreated) + { + nativeArray.Dispose(); + } + count = 0; + length = 0; + } + + public bool IsValid + { + get + { + return nativeArray.IsCreated; + } + } + + /// + /// ċŸéš›Ğä½żç”¨•‚ŒĤ„‚‹èĤç´ ĉ•° + /// + public int Count => count; + + /// + /// 確保•‚ŒĤ„‚‹é…ċˆ—èĤç´ ĉ•° + /// + public int Length => length; + + /// + /// ä½żç”¨é…ċˆ—‚Ğ‚Ĥƒ³ƒˆ‚’設ċš™‚‹ + /// + /// + public void SetCount(int newCount) + { + Debug.Assert(newCount <= length && newCount >= 0); + count = newCount; + } + + //========================================================================================= + /// + /// 領ċŸŸżĉ‹Ħċĵµ™‚‹ + /// ™§Ğé•·•é ˜ċŸŸŒç˘şäż•‚ŒĤ„‚‹ċ ´ċˆŻä½•‚‚—Ş„ + /// + /// + public void SetLength(int newLength) + { + if (newLength > length) + Expand(newLength - length, force: true, copy: true); + } + + /// + /// ‚µ‚¤‚şċˆ†çİşƒ‡ƒĵ‚ż‚’èż½ċŠ ™‚‹ + /// + /// + public void AddRange(int dataLength) + { + Expand(dataLength); + count += dataLength; + } + + /// + /// 配ċˆ—ƒ‡ƒĵ‚ż‚’èż½ċŠ ™‚‹ + /// + /// + public void AddRange(T[] dataArray) + { + Debug.Assert(dataArray != null); + + if (length == 0) + { + if (nativeArray.IsCreated) + nativeArray.Dispose(); + + nativeArray = new NativeArray(dataArray, Allocator.Persistent); + length = dataArray.Length; + count = length; + } + else + { + int dataLength = dataArray.Length; + Expand(dataLength); + // copy + NativeArray.Copy(dataArray, 0, nativeArray, count, dataLength); + count += dataLength; + } + } + + /// + /// 配ċˆ—ƒ‡ƒĵ‚ż‚’èż½ċŠ ™‚‹ + /// + /// + public void AddRange(T[] dataArray, int cnt) + { + Debug.Assert(dataArray != null); + + if (length == 0) + { + if (nativeArray.IsCreated) + nativeArray.Dispose(); + + nativeArray = new NativeArray(cnt, Allocator.Persistent); + // copy + NativeArray.Copy(dataArray, 0, nativeArray, 0, cnt); + length = cnt; + count = length; + } + else + { + int dataLength = cnt; + Expand(dataLength); + // copy + NativeArray.Copy(dataArray, 0, nativeArray, count, dataLength); + count += dataLength; + } + } + + /// + /// 領ċŸŸ‚’確保—設ċšċ€¤§ċŸ‹‚‚‹ïĵˆ‚ŒŞ‚Ё‚³‚ıƒˆŒç™şç”Ÿ™‚‹§ĉ³¨ĉ„ïĵïĵ‰ + /// + /// + /// + public void AddRange(int dataLength, T fillData = default(T)) + { + Expand(dataLength); + Fill(count, dataLength, fillData); + count += dataLength; + } + + public void AddRange(NativeArray narray) + { + Debug.Assert(narray.IsCreated); + + if (length == 0) + { + if (nativeArray.IsCreated) + nativeArray.Dispose(); + + nativeArray = new NativeArray(narray, Allocator.Persistent); + length = narray.Length; + count = length; + } + else + { + int dataLength = narray.Length; + Expand(dataLength); + // copy + NativeArray.Copy(narray, 0, nativeArray, count, dataLength); + count += dataLength; + } + } + + public void AddRange(NativeArray narray, int start, int length) + { + if (length > 0) + { + Expand(length); + NativeArray.Copy(narray, start, nativeArray, count, length); + count += length; + } + } + + public void AddRange(NativeList nlist) + { + Debug.Assert(nlist.IsCreated); + AddRange(nlist.AsArray()); + } + + public void AddRange(ExSimpleNativeArray exarray) + { + AddRange(exarray.GetNativeArray()); + } + + /// + /// ċž‹Żç•°Ş‚‹Œċž‹‚µ‚¤‚şŻċŒ˜é…ċˆ—‚’èż½ċŠ ™‚‹€‚Vector3->float3Şİ€‚ + /// + /// + /// + /// + public unsafe void AddRange(U[] array) where U : struct + { + Debug.Assert(array != null); + + int dataLength = array.Length; + Expand(dataLength); + + // copy + int dstSize = UnsafeUtility.SizeOf(); + ulong src_gcHandle; + void* src_p = UnsafeUtility.PinGCArrayAndGetDataAddress(array, out src_gcHandle); + byte* dst_p = (byte*)nativeArray.GetUnsafePtr(); + UnsafeUtility.MemCpy(dst_p + count * dstSize, src_p, dataLength * dstSize); + UnsafeUtility.ReleaseGCObject(src_gcHandle); + count += dataLength; + } + + /// + /// ċž‹‚‚‚µ‚¤‚ş‚‚ç•°Ş‚‹é…ċˆ—‚’èż½ċŠ ™‚‹€‚int[] -> int3[]Şİ€‚ + /// ƒ‡ƒĵ‚żŻƒĦƒ˘ƒŞ‚³ƒ”ƒĵ•‚Œ‚‹€‚䋁ˆ°int[]‹‚‰int3[]¸èż½ċŠ ™‚‹¨ĉĴĦ‚ˆ†ĞŞ‚‹€‚ + /// int[]{1, 2, 3, 4, 5, 6} => int3[]{{1, 2, 3}, {4, 5, 6}} + /// + /// + /// + /// + public unsafe void AddRangeTypeChange(U[] array) where U : struct + { + Debug.Assert(array != null); + + int srcSize = UnsafeUtility.SizeOf(); + int dstSize = UnsafeUtility.SizeOf(); + int dataLength = (array.Length * srcSize) / dstSize; + + Expand(dataLength); + + ulong src_gcHandle; + void* src_p = UnsafeUtility.PinGCArrayAndGetDataAddress(array, out src_gcHandle); + byte* dst_p = (byte*)nativeArray.GetUnsafePtr(); + + UnsafeUtility.MemCpy(dst_p + count * dstSize, src_p, dataLength * dstSize); + UnsafeUtility.ReleaseGCObject(src_gcHandle); + count += dataLength; + } + + public unsafe void AddRangeTypeChange(NativeArray array) where U : struct + { + Debug.Assert(array.IsCreated); + + int srcSize = UnsafeUtility.SizeOf(); + int dstSize = UnsafeUtility.SizeOf(); + int dataLength = (array.Length * srcSize) / dstSize; + + Expand(dataLength); + + byte* src_p = (byte*)array.GetUnsafePtr(); + byte* dst_p = (byte*)nativeArray.GetUnsafePtr(); + + UnsafeUtility.MemCpy(dst_p + count * dstSize, src_p, dataLength * dstSize); + count += dataLength; + } + + /// + /// ċž‹‚‚‚µ‚¤‚ş‚‚ç•°Ş‚‹é…ċˆ—‚’部ċˆ†çš„Ğ‚³ƒ”ƒĵ™‚‹€‚Vector4[] -> float3Şİ€‚ + /// + /// + /// + /// + public unsafe void AddRangeStride(U[] array) where U : struct + { + Debug.Assert(array != null); + int dataLength = array.Length; + Expand(dataLength); + + int srcSize = UnsafeUtility.SizeOf(); + int dstSize = UnsafeUtility.SizeOf(); + + ulong src_gcHandle; + void* src_p = UnsafeUtility.PinGCArrayAndGetDataAddress(array, out src_gcHandle); + byte* dst_p = (byte*)nativeArray.GetUnsafePtr(); + int elementSize = math.min(srcSize, dstSize); + + UnsafeUtility.MemCpyStride(dst_p + count * dstSize, dstSize, src_p, srcSize, elementSize, dataLength); + UnsafeUtility.ReleaseGCObject(src_gcHandle); + count += dataLength; + } + + public void Add(T data) + { + if (Length == 0) + { + // ‚‚‹ç¨‹ċşĤƒƒƒƒ•‚Ħ‚’確保 + Expand(16); + } + else if (count == Length) + { + // ċ€Ğĉ‹Ħċĵµ™‚‹ + Expand(Length); + } + + nativeArray[count] = data; + count++; + } + + public T[] ToArray() + { + return nativeArray.ToArray(); + } + + public void CopyTo(T[] array) + { + NativeArray.Copy(nativeArray, array); + } + + public void CopyTo(U[] array) where U : struct + { + NativeArray.Copy(nativeArray.Reinterpret(), array); + } + + /// + /// ċž‹‚‚‚µ‚¤‚ş‚‚ç•°Ş‚‹é…ċˆ—Ğƒ‡ƒĵ‚ż‚’‚³ƒ”ƒĵ™‚‹€‚ + /// int3 -> int[]Şİ + /// + /// + /// + public unsafe void CopyToWithTypeChange(U[] array) where U : struct + { + int srcSize = UnsafeUtility.SizeOf(); + int dstSize = UnsafeUtility.SizeOf(); + int dataLength = (Length * srcSize) / dstSize; + + byte* src_p = (byte*)nativeArray.GetUnsafePtr(); + ulong dst_gcHandle; + void* dst_p = UnsafeUtility.PinGCArrayAndGetDataAddress(array, out dst_gcHandle); + + UnsafeUtility.MemCpy(dst_p, src_p, dataLength * dstSize); + UnsafeUtility.ReleaseGCObject(dst_gcHandle); + } + + /// + /// ċž‹‚‚‚µ‚¤‚ş‚‚ç•°Ş‚‹é…ċˆ—Ğƒ‡ƒĵ‚ż‚’ĉ–­ç‰‡çš„Ğ‚³ƒ”ƒĵ™‚‹€‚ + /// float3 -> Vector4[]Şİ€‚“ċ ´ċˆŻVector4ĞŻxyzżĉ›¸èĵ‚Œ‚‹€‚ + /// + /// + /// + public unsafe void CopyToWithTypeChangeStride(U[] array) where U : struct + { + int srcSize = UnsafeUtility.SizeOf(); + int dstSize = UnsafeUtility.SizeOf(); + int dataLength = Length; + + byte* src_p = (byte*)nativeArray.GetUnsafePtr(); + ulong dst_gcHandle; + void* dst_p = UnsafeUtility.PinGCArrayAndGetDataAddress(array, out dst_gcHandle); + + int elementSize = srcSize; + + UnsafeUtility.MemCpyStride(dst_p, dstSize, src_p, srcSize, elementSize, dataLength); + UnsafeUtility.ReleaseGCObject(dst_gcHandle); + } + + public void CopyFrom(NativeArray array) + { + NativeArray.Copy(array, nativeArray); + } + + public void CopyFrom(NativeArray array) where U : struct + { + NativeArray.Copy(array.Reinterpret(), nativeArray); + } + + public unsafe void CopyFromWithTypeChangeStride(NativeArray array) where U : struct + { + int srcSize = UnsafeUtility.SizeOf(); + int dstSize = UnsafeUtility.SizeOf(); + int dataLength = array.Length; + + byte* src_p = (byte*)array.GetUnsafePtr(); + byte* dst_p = (byte*)nativeArray.GetUnsafePtr(); + + int elementSize = dstSize; + UnsafeUtility.MemCpyStride(dst_p, dstSize, src_p, srcSize, elementSize, dataLength); + } + + /// + /// 設ċšċ€¤§ċŸ‹‚‚‹ïĵˆ‚ŒŞ‚Ё‚³‚ıƒˆŒç™şç”Ÿ™‚‹§ĉ³¨ĉ„ïĵïĵ‰ + /// + /// + /// + /// + public void Fill(int startIndex, int dataLength, T fillData = default(T)) + { + // C# + //Parallel.For(0, dataLength, i => + //{ + // nativeArray[startIndex + i] = fillData; + //}); + FillInternal(startIndex, dataLength, fillData); + } + + unsafe void FillInternal(int start, int size, T fillData = default(T)) + { + //byte* dst_p = (byte*)nativeArray.GetUnsafePtr(); + void* dst_p = nativeArray.GetUnsafePtr(); + int index = start; + for (int i = 0; i < size; i++, index++) + { + UnsafeUtility.WriteArrayElement(dst_p, index, fillData); + } + } + + + public T this[int index] + { + get + { + return nativeArray[index]; + } + set + { + nativeArray[index] = value; + } + } + + /// + /// Job§ċˆİ用™‚‹ċ ´ċˆŻ“é–˘ĉ•°§NativeArrayĞċ¤‰ĉ›—Ĥċ—‘ĉ¸Ħ™ + /// + /// + public NativeArray GetNativeArray() + { + return nativeArray; + } + + /// + /// Job§ċˆİ用™‚‹ċ ´ċˆŻ“é–˘ĉ•°§NativeArrayĞċ¤‰ĉ›—Ĥċ—‘ĉ¸Ħ™(ċž‹ċ¤‰ĉ›´‚‚Š) + /// + /// + /// + public NativeArray GetNativeArray() where U : struct + { + return nativeArray.Reinterpret(); + } + + //========================================================================================= + /// + /// 領ċŸŸ‚’ĉ‹Ħċĵµ™‚‹ïĵˆċż…èĤŒŞ‘‚Œ°ä½•‚‚—Ş„ïĵ‰ + /// + /// + /// ċĵ·ċˆĥ的Ğ領ċŸŸ‚’èż½ċŠ  + /// ċ¤„ƒ‡ƒĵ‚ż‚’‚³ƒ”ƒĵ™‚‹‹İ†‹ + void Expand(int dataLength, bool force = false, bool copy = true) + { + int newlength = force ? length + dataLength : count + dataLength; + + if (length == 0) + { + if (nativeArray.IsCreated) + nativeArray.Dispose(); + + nativeArray = new NativeArray(dataLength, Allocator.Persistent); + length = dataLength; + } + else if (newlength > Length) + { + // ĉ‹Ħċĵµ + var newNativeArray = new NativeArray(newlength, Allocator.Persistent); + + // copy + if (copy) + { + // ‚³ƒ”ƒĵŻä½żç”¨ċˆ† ‘ + NativeArray.Copy(nativeArray, newNativeArray, count); + } + + nativeArray.Dispose(); + nativeArray = newNativeArray; + length = newlength; + } + } + + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + + sb.AppendLine($"ExSimpleNativeArray Length:{Length} Count:{Count} IsValid:{IsValid}"); + sb.AppendLine("---- Datas[~100] ----"); + if (IsValid) + { + for (int i = 0; i < Length && i < 100; i++) + { + sb.AppendLine(nativeArray[i].ToString()); + } + } + + return sb.ToString(); + } + + //========================================================================================= + /// + /// ‚·ƒŞ‚˘ƒİ‚¤‚şƒ‡ƒĵ‚ż + /// + [System.Serializable] + public class SerializationData + { + public int count; + public int length; + public byte[] arrayBytes; + } + + /// + /// ‚·ƒŞ‚˘ƒİ‚¤‚ş™‚‹ + /// + /// + public SerializationData Serialize() + { + var data = new SerializationData(); + data.count = count; + data.length = length; + if (nativeArray.IsCreated && nativeArray.Length > 0) + { + data.arrayBytes = nativeArray.MC2ToRawBytes(); + } + + return data; + } + + /// + /// ƒ‡‚·ƒŞ‚˘ƒİ‚¤‚ş™‚‹ + /// + /// + /// + public bool Deserialize(SerializationData data) + { + try + { + Dispose(); + count = data.count; + length = data.length; + if (data.length > 0 && data.arrayBytes != null) + { + nativeArray = NativeArrayExtensions.MC2FromRawBytes(data.arrayBytes, Allocator.Persistent); + } + return true; + } + catch (Exception exception) + { + Debug.LogException(exception); + return false; + } + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExSimpleNativeArray.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExSimpleNativeArray.cs.meta new file mode 100644 index 00000000..f00fdbd3 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExSimpleNativeArray.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 5184cf224e308d044a655a8da0580401 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExSimpleNativeArray.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExTransformAccessArray.cs b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExTransformAccessArray.cs new file mode 100644 index 00000000..19bd0a80 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExTransformAccessArray.cs @@ -0,0 +1,210 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.Jobs; + +namespace MagicaCloth2 +{ + /// + /// ċ›şċš‚¤ƒ³ƒ‡ƒƒ‚Ż‚ıċž‹ċ›şċš‚¤ƒ³ƒ‡ƒƒ‚Ż‚ıTransformAccessArrayçĦ理‚Żƒİ‚ı + /// 一ċşĤ確保—Ÿ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ıŻ‚şƒĴŞ„ïĵˆ““重èĤïĵ‰ + /// ċŒ˜ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ Ğ関—ĤŻċ‚ç…§‚Ğ‚Ĥƒ³‚ż§¨‚‚‹ïĵˆTransformAccessArrayŻé‡è¤‡‚’è¨ħ•Ş„Ÿ‚ïĵ‰ + /// + public class ExTransformAccessArray : IDisposable + { + TransformAccessArray transformArray; + + /// + /// ƒ‚¤ƒ†‚£ƒ–ƒŞ‚ıƒˆé…ċˆ—ĉ•° + /// â€ğ‚¸ƒ§ƒ–§‚¨ƒİƒĵŒċ‡şŞ„‚ˆ†Ğ事ċ‰Ğ確保—ĤŠ + /// + int nativeLength; + + /// + /// çİş‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı‚ı‚żƒƒ‚Ż + /// + Queue emptyStack; + + /// + /// ä½żç”¨‚¤ƒ³ƒ‡ƒƒ‚Ż‚ıèžĉ›¸ + /// + Dictionary useIndexDict; + + /// + /// ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ıèžĉ›¸ + /// + Dictionary indexDict; + + /// + /// ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ċ‚ç…§‚Ğ‚Ĥƒ³‚żèžĉ›¸ + /// + Dictionary referenceDict; + + //========================================================================================= + public ExTransformAccessArray(int capacity, int desiredJobCount = -1) + { + transformArray = new TransformAccessArray(capacity, desiredJobCount); + nativeLength = transformArray.length; + + emptyStack = new Queue(capacity); + useIndexDict = new Dictionary(capacity); + indexDict = new Dictionary(capacity); + referenceDict = new Dictionary(capacity); + } + + public void Dispose() + { + if (transformArray.isCreated) + transformArray.Dispose(); + emptyStack.Clear(); + useIndexDict.Clear(); + indexDict.Clear(); + referenceDict.Clear(); + nativeLength = 0; + } + + /// + /// TransformAccessArray‚’ċ–ċ—™‚‹ + /// + /// + public TransformAccessArray GetTransformAccessArray() + { + return transformArray; + } + + /// ƒ‡ƒĵ‚żèż½ċŠ  + /// èż½ċŠ —Ÿ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı‚’èż”™ + /// + /// + /// + public int Add(Transform element) + { + int index = 0; + + MagicaObjectId id = element.GetMagicaId(); + + if (referenceDict.ContainsKey(id)) + { + // ċ‚ç…§‚Ğ‚Ĥƒ³‚żïĵ‹ + referenceDict[id] = referenceDict[id] + 1; + return indexDict[id]; + } + + if (emptyStack.Count > 0) + { + // ċ†ċˆİ用 + index = emptyStack.Dequeue(); + transformArray[index] = element; + } + else + { + // ĉ–°èĤ + index = transformArray.length; + transformArray.Add(element); + } + useIndexDict.Add(index, id); + indexDict.Add(id, index); + referenceDict.Add(id, 1); + nativeLength = transformArray.length; + + return index; + } + + /// + /// ƒ‡ƒĵ‚żċ‰Šé™¤ + /// ċ‰Šé™¤•‚ŒŸ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ıŻċ†ċˆİ用•‚Œ‚‹ + /// + /// + public void Remove(int index) + { + if (useIndexDict.ContainsKey(index)) + { + MagicaObjectId id = useIndexDict[index]; + int cnt = referenceDict[id] - 1; + if (cnt > 0) + { + // ċ‚ç…§‚Ğ‚Ĥƒ³‚ż- + referenceDict[id] = cnt; + return; + } + + // ċ‰Šé™¤ + transformArray[index] = null; + emptyStack.Enqueue(index); + useIndexDict.Remove(index); + indexDict.Remove(id); + referenceDict.Remove(id); + nativeLength = transformArray.length; + } + } + + public bool Exist(int index) + { + return useIndexDict.ContainsKey(index); + } + + public bool Exist(Transform element) + { + if (element == null) + return false; + return indexDict.ContainsKey(element.GetMagicaId()); + } + + /// + /// ƒ‡ƒĵ‚żä½żç”¨é‡ + /// + public int Count + { + get + { + return useIndexDict.Count; + } + } + + /// + /// ƒ‡ƒĵ‚żé…ċˆ—ĉ•° + /// + public int Length + { + get + { + return nativeLength; + } + } + + public Transform this[int index] + { + get + { + return transformArray[index]; + } + } + + public int GetIndex(Transform element) + { + if (element == null) + return -1; + MagicaObjectId id = element.GetMagicaId(); + if (indexDict.ContainsKey(id)) + return indexDict[id]; + else + return -1; + } + + public void Clear() + { + // 配ċˆ—ĉ•°ŻĞ‚ŻƒŞ‚˘™‚‹ + foreach (var index in useIndexDict.Keys) + emptyStack.Enqueue(index); + useIndexDict.Clear(); + for (int i = 0, cnt = Length; i < cnt; i++) + transformArray[i] = null; + indexDict.Clear(); + referenceDict.Clear(); + nativeLength = 0; + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExTransformAccessArray.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExTransformAccessArray.cs.meta new file mode 100644 index 00000000..b3db47a1 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExTransformAccessArray.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 01fb00afd02fc7f48bfe4f6519f7d358 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/ExTransformAccessArray.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/FixedList128BytesExtensions.cs b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/FixedList128BytesExtensions.cs new file mode 100644 index 00000000..5faa7ec6 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/FixedList128BytesExtensions.cs @@ -0,0 +1,117 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System; +using System.Runtime.CompilerServices; +using Unity.Collections; +using UnityEngine; + +namespace MagicaCloth2 +{ + //[BurstCompatible] + public static class FixedList128BytesExtensions + { + //===================================================================== + // Common + //===================================================================== + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool MC2IsCapacity(ref this FixedList128Bytes fixedList) where T : unmanaged, IEquatable + { + return fixedList.Length >= fixedList.Capacity; + } + + //===================================================================== + // Set + //===================================================================== + /// + /// ƒ‡ƒĵ‚żŒċ­˜ċœ¨—Ş„ċ ´ċˆżèż½ċŠ ™‚‹ + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void MC2Set(ref this FixedList128Bytes fixedList, T item) where T : unmanaged, IEquatable + { + if (fixedList.Contains(item) == false) + { + fixedList.Add(item); + } + } + + /// + /// ƒ‡ƒĵ‚żŒċ­˜ċœ¨—Ş„ċ ´ċˆżèż½ċŠ ™‚‹ + /// ™§Ğċı量Œä¸€ĉŻċ ´ċˆŻè­Ĥċ‘Š‚’èĦ¨ç¤ş—èż½ċŠ —Ş„€‚ + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void MC2SetLimit(ref this FixedList128Bytes fixedList, T item) where T : unmanaged, IEquatable + { + if (fixedList.Length >= fixedList.Capacity) + { + Debug.LogWarning($"FixedSet128.Limit!:{fixedList.Capacity}"); + return; + } + if (fixedList.Contains(item) == false) + { + fixedList.Add(item); + } + } + + /// + /// ƒŞ‚ıƒˆ‹‚‰ƒ‡ƒĵ‚ż‚’ĉ¤œç´˘—Ĥċ‰Šé™¤™‚‹ + /// ċ‰Šé™¤é ˜ċŸŸĞŻƒŞ‚ıƒˆĉœ€ċŒƒ‡ƒĵ‚żŒç§ğċ‹•™‚‹(SwapBack) + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void MC2RemoveItemAtSwapBack(ref this FixedList128Bytes fixedList, T item) where T : unmanaged, IEquatable + { + for (int i = 0; i < fixedList.Length; i++) + { + if (fixedList.ElementAt(i).Equals(item)) + { + fixedList.RemoveAtSwapBack(i); + break; + } + } + } + + //===================================================================== + // Stack + //===================================================================== + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void MC2Push(ref this FixedList128Bytes fixedList, T item) where T : unmanaged, IEquatable + { + fixedList.Add(item); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static T MC2Pop(ref this FixedList128Bytes fixedList) where T : unmanaged, IEquatable + { + int index = fixedList.Length - 1; + T item = fixedList[index]; + fixedList.RemoveAt(index); + return item; + } + + //===================================================================== + // Queue + //===================================================================== + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void MC2Enqueue(ref this FixedList128Bytes fixedList, T item) where T : unmanaged, IEquatable + { + fixedList.Add(item); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static T MC2Dequque(ref this FixedList128Bytes fixedList) where T : unmanaged, IEquatable + { + T item = fixedList[0]; + fixedList.RemoveAt(0); + return item; + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/FixedList128BytesExtensions.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/FixedList128BytesExtensions.cs.meta new file mode 100644 index 00000000..8d85a3f0 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/FixedList128BytesExtensions.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: a5001a2e03a42e64cade535d198c1e91 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/FixedList128BytesExtensions.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/FixedList32BytesExtensions.cs b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/FixedList32BytesExtensions.cs new file mode 100644 index 00000000..43707fcb --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/FixedList32BytesExtensions.cs @@ -0,0 +1,117 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System; +using System.Runtime.CompilerServices; +using Unity.Collections; +using UnityEngine; + +namespace MagicaCloth2 +{ + public static class FixedList32BytesExtensions + { + //===================================================================== + // Common + //===================================================================== + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool MC2IsCapacity(ref this FixedList32Bytes fixedList) where T : unmanaged, IEquatable + { + return fixedList.Length >= fixedList.Capacity; + } + + //===================================================================== + // Set + //===================================================================== + /// + /// ƒ‡ƒĵ‚żŒċ­˜ċœ¨—Ş„ċ ´ċˆżèż½ċŠ ™‚‹ + /// ċı量Œ‚ރĵƒƒĵ™‚‹¨ä‹ċ¤–Œç™şç”Ÿ™‚‹ + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void MC2Set(ref this FixedList32Bytes fixedList, T item) where T : unmanaged, IEquatable + { + if (fixedList.Contains(item) == false) + { + fixedList.Add(item); + } + } + + /// + /// ƒ‡ƒĵ‚żŒċ­˜ċœ¨—Ş„ċ ´ċˆżèż½ċŠ ™‚‹ + /// ™§Ğċı量Œä¸€ĉŻċ ´ċˆŻè­Ĥċ‘Š‚’èĦ¨ç¤ş—èż½ċŠ —Ş„€‚ + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void MC2SetLimit(ref this FixedList32Bytes fixedList, T item) where T : unmanaged, IEquatable + { + if (fixedList.Length >= fixedList.Capacity) + { + Debug.LogWarning($"FixedSet32.Limit!:{fixedList.Capacity}"); + return; + } + if (fixedList.Contains(item) == false) + { + fixedList.Add(item); + } + } + + /// + /// ƒŞ‚ıƒˆ‹‚‰ƒ‡ƒĵ‚ż‚’ĉ¤œç´˘—Ĥċ‰Šé™¤™‚‹ + /// ċ‰Šé™¤é ˜ċŸŸĞŻƒŞ‚ıƒˆĉœ€ċŒƒ‡ƒĵ‚żŒç§ğċ‹•™‚‹(SwapBack) + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void MC2RemoveItemAtSwapBack(ref this FixedList32Bytes fixedList, T item) where T : unmanaged, IEquatable + { + for (int i = 0; i < fixedList.Length; i++) + { + if (fixedList.ElementAt(i).Equals(item)) + { + fixedList.RemoveAtSwapBack(i); + break; + } + } + } + + //===================================================================== + // Stack + //===================================================================== + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void MC2Push(ref this FixedList32Bytes fixedList, T item) where T : unmanaged, IEquatable + { + fixedList.Add(item); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static T MC2Pop(ref this FixedList32Bytes fixedList) where T : unmanaged, IEquatable + { + int index = fixedList.Length - 1; + T item = fixedList[index]; + fixedList.RemoveAt(index); + return item; + } + + //===================================================================== + // Queue + //===================================================================== + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void MC2Enqueue(ref this FixedList32Bytes fixedList, T item) where T : unmanaged, IEquatable + { + fixedList.Add(item); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static T MC2Dequque(ref this FixedList32Bytes fixedList) where T : unmanaged, IEquatable + { + T item = fixedList[0]; + fixedList.RemoveAt(0); + return item; + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/FixedList32BytesExtensions.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/FixedList32BytesExtensions.cs.meta new file mode 100644 index 00000000..0afafc60 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/FixedList32BytesExtensions.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 5876be4e9da8a2943b26b98bbeb9cb22 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/FixedList32BytesExtensions.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/FixedList4096BytesExtensions.cs b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/FixedList4096BytesExtensions.cs new file mode 100644 index 00000000..8e327769 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/FixedList4096BytesExtensions.cs @@ -0,0 +1,117 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System; +using System.Runtime.CompilerServices; +using Unity.Collections; +using UnityEngine; + +namespace MagicaCloth2 +{ + //[BurstCompatible] + public static class FixedList4096BytesExtensions + { + //===================================================================== + // Common + //===================================================================== + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool MC2IsCapacity(ref this FixedList4096Bytes fixedList) where T : unmanaged, IEquatable + { + return fixedList.Length >= fixedList.Capacity; + } + + //===================================================================== + // Set + //===================================================================== + /// + /// ƒ‡ƒĵ‚żŒċ­˜ċœ¨—Ş„ċ ´ċˆżèż½ċŠ ™‚‹ + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void MC2Set(ref this FixedList4096Bytes fixedList, T item) where T : unmanaged, IEquatable + { + if (fixedList.Contains(item) == false) + { + fixedList.Add(item); + } + } + + /// + /// ƒ‡ƒĵ‚żŒċ­˜ċœ¨—Ş„ċ ´ċˆżèż½ċŠ ™‚‹ + /// ™§Ğċı量Œä¸€ĉŻċ ´ċˆŻè­Ĥċ‘Š‚’èĦ¨ç¤ş—èż½ċŠ —Ş„€‚ + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void MC2SetLimit(ref this FixedList4096Bytes fixedList, T item) where T : unmanaged, IEquatable + { + if (fixedList.Length >= fixedList.Capacity) + { + Debug.LogWarning($"FixedSet4096.Limit!:{fixedList.Capacity}"); + return; + } + if (fixedList.Contains(item) == false) + { + fixedList.Add(item); + } + } + + /// + /// ƒŞ‚ıƒˆ‹‚‰ƒ‡ƒĵ‚ż‚’ĉ¤œç´˘—Ĥċ‰Šé™¤™‚‹ + /// ċ‰Šé™¤é ˜ċŸŸĞŻƒŞ‚ıƒˆĉœ€ċŒƒ‡ƒĵ‚żŒç§ğċ‹•™‚‹(SwapBack) + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void MC2RemoveItemAtSwapBack(ref this FixedList4096Bytes fixedList, T item) where T : unmanaged, IEquatable + { + for (int i = 0; i < fixedList.Length; i++) + { + if (fixedList.ElementAt(i).Equals(item)) + { + fixedList.RemoveAtSwapBack(i); + break; + } + } + } + + //===================================================================== + // Stack + //===================================================================== + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void MC2Push(ref this FixedList4096Bytes fixedList, T item) where T : unmanaged, IEquatable + { + fixedList.Add(item); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static T MC2Pop(ref this FixedList4096Bytes fixedList) where T : unmanaged, IEquatable + { + int index = fixedList.Length - 1; + T item = fixedList[index]; + fixedList.RemoveAt(index); + return item; + } + + //===================================================================== + // Queue + //===================================================================== + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void MC2Enqueue(ref this FixedList4096Bytes fixedList, T item) where T : unmanaged, IEquatable + { + fixedList.Add(item); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static T MC2Dequque(ref this FixedList4096Bytes fixedList) where T : unmanaged, IEquatable + { + T item = fixedList[0]; + fixedList.RemoveAt(0); + return item; + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/FixedList4096BytesExtensions.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/FixedList4096BytesExtensions.cs.meta new file mode 100644 index 00000000..17c0dec2 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/FixedList4096BytesExtensions.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: a672a8e0e07ce1344817a15060cd375f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/FixedList4096BytesExtensions.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/FixedList512BytesExtensions.cs b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/FixedList512BytesExtensions.cs new file mode 100644 index 00000000..e7123739 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/FixedList512BytesExtensions.cs @@ -0,0 +1,117 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System; +using System.Runtime.CompilerServices; +using Unity.Collections; +using UnityEngine; + +namespace MagicaCloth2 +{ + //[BurstCompatible] + public static class FixedList512BytesExtensions + { + //===================================================================== + // Common + //===================================================================== + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool MC2IsCapacity(ref this FixedList512Bytes fixedList) where T : unmanaged, IEquatable + { + return fixedList.Length >= fixedList.Capacity; + } + + //===================================================================== + // Set + //===================================================================== + /// + /// ƒ‡ƒĵ‚żŒċ­˜ċœ¨—Ş„ċ ´ċˆżèż½ċŠ ™‚‹ + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void MC2Set(ref this FixedList512Bytes fixedList, T item) where T : unmanaged, IEquatable + { + if (fixedList.Contains(item) == false) + { + fixedList.Add(item); + } + } + + /// + /// ƒ‡ƒĵ‚żŒċ­˜ċœ¨—Ş„ċ ´ċˆżèż½ċŠ ™‚‹ + /// ™§Ğċı量Œä¸€ĉŻċ ´ċˆŻè­Ĥċ‘Š‚’èĦ¨ç¤ş—èż½ċŠ —Ş„€‚ + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void MC2SetLimit(ref this FixedList512Bytes fixedList, T item) where T : unmanaged, IEquatable + { + if (fixedList.Length >= fixedList.Capacity) + { + Debug.LogWarning($"FixedSet512.Limit!:{fixedList.Capacity}"); + return; + } + if (fixedList.Contains(item) == false) + { + fixedList.Add(item); + } + } + + /// + /// ƒŞ‚ıƒˆ‹‚‰ƒ‡ƒĵ‚ż‚’ĉ¤œç´˘—Ĥċ‰Šé™¤™‚‹ + /// ċ‰Šé™¤é ˜ċŸŸĞŻƒŞ‚ıƒˆĉœ€ċŒƒ‡ƒĵ‚żŒç§ğċ‹•™‚‹(SwapBack) + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void MC2RemoveItemAtSwapBack(ref this FixedList512Bytes fixedList, T item) where T : unmanaged, IEquatable + { + for (int i = 0; i < fixedList.Length; i++) + { + if (fixedList.ElementAt(i).Equals(item)) + { + fixedList.RemoveAtSwapBack(i); + break; + } + } + } + + //===================================================================== + // Stack + //===================================================================== + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void MC2Push(ref this FixedList512Bytes fixedList, T item) where T : unmanaged, IEquatable + { + fixedList.Add(item); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static T MC2Pop(ref this FixedList512Bytes fixedList) where T : unmanaged, IEquatable + { + int index = fixedList.Length - 1; + T item = fixedList[index]; + fixedList.RemoveAt(index); + return item; + } + + //===================================================================== + // Queue + //===================================================================== + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void MC2Enqueue(ref this FixedList512Bytes fixedList, T item) where T : unmanaged, IEquatable + { + fixedList.Add(item); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static T MC2Dequque(ref this FixedList512Bytes fixedList) where T : unmanaged, IEquatable + { + T item = fixedList[0]; + fixedList.RemoveAt(0); + return item; + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/FixedList512BytesExtensions.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/FixedList512BytesExtensions.cs.meta new file mode 100644 index 00000000..9070f279 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/FixedList512BytesExtensions.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 844ad8e2dd5bec94c8684bd46b5ae53b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/FixedList512BytesExtensions.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/FixedList64BytesExtensions.cs b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/FixedList64BytesExtensions.cs new file mode 100644 index 00000000..7aad0bce --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/FixedList64BytesExtensions.cs @@ -0,0 +1,117 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System; +using System.Runtime.CompilerServices; +using Unity.Collections; +using UnityEngine; + +namespace MagicaCloth2 +{ + //[BurstCompatible] + public static class FixedList64BytesExtensions + { + //===================================================================== + // Common + //===================================================================== + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool MC2IsCapacity(ref this FixedList64Bytes fixedList) where T : unmanaged, IEquatable + { + return fixedList.Length >= fixedList.Capacity; + } + + //===================================================================== + // Set + //===================================================================== + /// + /// ƒ‡ƒĵ‚żŒċ­˜ċœ¨—Ş„ċ ´ċˆżèż½ċŠ ™‚‹ + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void MC2Set(ref this FixedList64Bytes fixedList, T item) where T : unmanaged, IEquatable + { + if (fixedList.Contains(item) == false) + { + fixedList.Add(item); + } + } + + /// + /// ƒ‡ƒĵ‚żŒċ­˜ċœ¨—Ş„ċ ´ċˆżèż½ċŠ ™‚‹ + /// ™§Ğċı量Œä¸€ĉŻċ ´ċˆŻè­Ĥċ‘Š‚’èĦ¨ç¤ş—èż½ċŠ —Ş„€‚ + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void MC2SetLimit(ref this FixedList64Bytes fixedList, T item) where T : unmanaged, IEquatable + { + if (fixedList.Length >= fixedList.Capacity) + { + Debug.LogWarning($"FixedSet64.Limit!:{fixedList.Capacity}"); + return; + } + if (fixedList.Contains(item) == false) + { + fixedList.Add(item); + } + } + + /// + /// ƒŞ‚ıƒˆ‹‚‰ƒ‡ƒĵ‚ż‚’ĉ¤œç´˘—Ĥċ‰Šé™¤™‚‹ + /// ċ‰Šé™¤é ˜ċŸŸĞŻƒŞ‚ıƒˆĉœ€ċŒƒ‡ƒĵ‚żŒç§ğċ‹•™‚‹(SwapBack) + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void MC2RemoveItemAtSwapBack(ref this FixedList64Bytes fixedList, T item) where T : unmanaged, IEquatable + { + for (int i = 0; i < fixedList.Length; i++) + { + if (fixedList.ElementAt(i).Equals(item)) + { + fixedList.RemoveAtSwapBack(i); + break; + } + } + } + + //===================================================================== + // Stack + //===================================================================== + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void MC2Push(ref this FixedList64Bytes fixedList, T item) where T : unmanaged, IEquatable + { + fixedList.Add(item); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static T MC2Pop(ref this FixedList64Bytes fixedList) where T : unmanaged, IEquatable + { + int index = fixedList.Length - 1; + T item = fixedList[index]; + fixedList.RemoveAt(index); + return item; + } + + //===================================================================== + // Queue + //===================================================================== + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static void MC2Enqueue(ref this FixedList64Bytes fixedList, T item) where T : unmanaged, IEquatable + { + fixedList.Add(item); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static T MC2Dequque(ref this FixedList64Bytes fixedList) where T : unmanaged, IEquatable + { + T item = fixedList[0]; + fixedList.RemoveAt(0); + return item; + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/FixedList64BytesExtensions.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/FixedList64BytesExtensions.cs.meta new file mode 100644 index 00000000..2548d416 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/FixedList64BytesExtensions.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 29fde9f6ce7d36a449d5ed4e3d952f35 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/FixedList64BytesExtensions.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/NativeArrayExtensions.cs b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/NativeArrayExtensions.cs new file mode 100644 index 00000000..2abce8c1 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/NativeArrayExtensions.cs @@ -0,0 +1,85 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using Unity.Collections; + +namespace MagicaCloth2 +{ + /// + /// NativeArrayĉ‹ĦċĵµƒĦ‚½ƒƒƒ‰ + /// + public static class NativeArrayExtensions + { + /// + /// NativeArrayŒç˘şäż•‚ŒĤ„‚‹ċ ´ċˆżDispose()™‚‹ + /// + /// + /// + public static void MC2DisposeSafe(ref this NativeArray array) where T : unmanaged + { + if (array.IsCreated) + array.Dispose(); + } + + /// + /// NativeArray‚’ƒŞ‚µ‚¤‚ş™‚‹ + /// ĉŒ‡ċš‚µ‚¤‚şĉœŞĉş€ċ ´ċˆĞƒĦƒ˘ƒŞ‚’è§£ĉ”—Ĥĉ–°—„‚µ‚¤‚ş§ç˘şäż—ç›´™ + /// ƒŞ‚µ‚¤‚şĉ™‚Ğċ†…ċıŻ‚³ƒ”ƒĵ—Ş„ + /// + /// + /// + /// + /// + /// + public static void MC2Resize(ref this NativeArray array, int size, Allocator allocator = Allocator.Persistent, NativeArrayOptions options = NativeArrayOptions.ClearMemory) where T : unmanaged + { + if (array.IsCreated == false || array.Length < size) + { + array.MC2DisposeSafe(); + array = new NativeArray(size, allocator, options); + } + } + + /// + /// NativeArray‚’byte[]Ğċ¤‰ĉ›™‚‹ + /// + /// + /// + /// + public static byte[] MC2ToRawBytes(ref this NativeArray array) where T : unmanaged + { + if (array.IsCreated == false || array.Length == 0) + return null; + var slice = new NativeSlice(array).SliceConvert(); + var bytes = new byte[slice.Length]; + slice.CopyTo(bytes); + return bytes; + } + + /// + /// byte[]‹‚‰NativeArray‚’作ĉˆ™‚‹ + /// + /// + /// + /// + /// + public static NativeArray MC2FromRawBytes(byte[] bytes, Allocator allocator = Allocator.Persistent) where T : unmanaged + { + if (bytes == null) + return new NativeArray(); + + int structSize = Unity.Collections.LowLevel.Unsafe.UnsafeUtility.SizeOf(); + + int length = bytes.Length / structSize; + var array = new NativeArray(length, allocator); + if (length > 0) + { + using var byteArray = new NativeArray(bytes, Allocator.Temp); + //using var byteArray = new NativeArray(bytes, Allocator.Persistent); + var slice = new NativeSlice(byteArray).SliceConvert(); + slice.CopyTo(array); + } + return array; + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/NativeArrayExtensions.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/NativeArrayExtensions.cs.meta new file mode 100644 index 00000000..ed09b68d --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/NativeArrayExtensions.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 93d2b52144a75c64b91e75d4f974d74a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/NativeArrayExtensions.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/NativeMultiHashMapExtensions.cs b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/NativeMultiHashMapExtensions.cs new file mode 100644 index 00000000..c78fd383 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/NativeMultiHashMapExtensions.cs @@ -0,0 +1,227 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System; +using Unity.Burst; +using Unity.Collections; +using Unity.Jobs; +using Unity.Mathematics; +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// NativeMultiHashMapĉ‹ĦċĵµƒĦ‚½ƒƒƒ‰ + /// + public static class NativeMultiHashMapExtensions + { + /// + /// NativeParallelMultiHashMap‚­ƒĵĞĉŒ‡ċšƒ‡ƒĵ‚żŒċ­˜ċœ¨™‚‹‹ċˆ¤ċš™‚‹ + /// + /// + /// + /// + /// + /// + /// +#if MC2_COLLECTIONS_200 + public static bool MC2Contains(ref this NativeParallelMultiHashMap map, TKey key, TValue value) where TKey : unmanaged, IEquatable where TValue : unmanaged, IEquatable +#else + public static bool MC2Contains(ref this NativeParallelMultiHashMap map, TKey key, TValue value) where TKey : struct, IEquatable where TValue : struct, IEquatable +#endif + { + foreach (TValue val in map.GetValuesForKey(key)) + { + if (val.Equals(value)) + return true; + } + return false; + } + + /// + /// NativeParallelMultiHashMap‚­ƒĵĞċ݁—Ĥ重複Ş—ƒ‡ƒĵ‚ż‚’èż½ċŠ ™‚‹ + /// ™§Ğ‚­ƒĵĞċŒ˜ƒ‡ƒĵ‚żŒċ­˜ċœ¨™‚‹ċ ´ċˆŻèż½ċŠ —Ş„€‚ + /// + /// + /// + /// + /// + /// +#if MC2_COLLECTIONS_200 + public static void MC2UniqueAdd(ref this NativeParallelMultiHashMap map, TKey key, TValue value) where TKey : unmanaged, IEquatable where TValue : unmanaged, IEquatable +#else + public static void MC2UniqueAdd(ref this NativeParallelMultiHashMap map, TKey key, TValue value) where TKey : struct, IEquatable where TValue : struct, IEquatable +#endif + { + if (map.MC2Contains(key, value) == false) + { + map.Add(key, value); + } + } + + /// + /// NativeMultiHashMap‚­ƒĵĞċ­˜ċœ¨™‚‹ƒ‡ƒĵ‚ż‚’ċ‰Šé™¤™‚‹ + /// + /// + /// + /// + /// + /// + /// +#if MC2_COLLECTIONS_200 + public static bool MC2RemoveValue(ref this NativeParallelMultiHashMap map, TKey key, TValue value) where TKey : unmanaged, IEquatable where TValue : unmanaged, IEquatable +#else + public static bool MC2RemoveValue(ref this NativeParallelMultiHashMap map, TKey key, TValue value) where TKey : struct, IEquatable where TValue : struct, IEquatable +#endif + { + NativeParallelMultiHashMapIterator it; + TValue item; + if (map.TryGetFirstValue(key, out item, out it)) + { + do + { + if (item.Equals(value)) + { + map.Remove(it); + return true; + } + } + while (map.TryGetNextValue(out item, ref it)); + } + + return false; + } + + /// + /// çċœ¨‚­ƒĵƒ‡ƒĵ‚ż‚’FixedList512BytesĞċ¤‰ĉ›—Ĥèż”™ + /// + /// + /// +#if MC2_COLLECTIONS_200 + public static FixedList512Bytes MC2ToFixedList512Bytes(ref this NativeParallelMultiHashMap map, TKey key) where TKey : unmanaged, IEquatable where TValue : unmanaged, IEquatable +#else + public static FixedList512Bytes MC2ToFixedList512Bytes(ref this NativeParallelMultiHashMap map, TKey key) where TKey : struct, IEquatable where TValue : unmanaged, IEquatable +#endif + { + var fixlist = new FixedList512Bytes(); + if (map.ContainsKey(key)) + { + foreach (var data in map.GetValuesForKey(key)) + { + fixlist.Add(data); + } + } + + return fixlist; + } + + /// + /// çċœ¨‚­ƒĵƒ‡ƒĵ‚ż‚’FixedList128BytesĞċ¤‰ĉ›—Ĥèż”™ + /// + /// + /// +#if MC2_COLLECTIONS_200 + public static FixedList128Bytes MC2ToFixedList128Bytes(ref this NativeParallelMultiHashMap map, TKey key) where TKey : unmanaged, IEquatable where TValue : unmanaged, IEquatable +#else + public static FixedList128Bytes MC2ToFixedList128Bytes(ref this NativeParallelMultiHashMap map, TKey key) where TKey : struct, IEquatable where TValue : unmanaged, IEquatable +#endif + { + var fixlist = new FixedList128Bytes(); + if (map.ContainsKey(key)) + { + foreach (var data in map.GetValuesForKey(key)) + { + fixlist.Add(data); + } + } + + return fixlist; + } + + /// + /// NativeParallelMultiHashMap‚’Key¨Valueé…ċˆ—Ğċ¤‰ĉ›—™ + /// + /// + /// + /// + /// +#if MC2_COLLECTIONS_200 + public static (TKey[], TValue[]) MC2Serialize(ref this NativeParallelMultiHashMap map) where TKey : unmanaged, IEquatable where TValue : unmanaged +#else + public static (TKey[], TValue[]) MC2Serialize(ref this NativeParallelMultiHashMap map) where TKey : struct, IEquatable where TValue : struct +#endif + { + if (map.IsCreated == false || map.Count() == 0 || map.IsEmpty) + return (null, null); + + using var keyNativeArray = map.GetKeyArray(Allocator.Persistent); + using var valueNativeArray = map.GetValueArray(Allocator.Persistent); + + return (keyNativeArray.ToArray(), valueNativeArray.ToArray()); + } + + /// + /// Key¨Valueé…ċˆ—‹‚‰NativeParallelMultiHashMap‚’ċİċ…ƒ—™ + /// éИ速ċŒ–Ÿ‚Burst‚’ċˆİ用 + /// ‚¸‚§ƒƒŞƒƒ‚Żċž‹‚¸ƒ§ƒ–Żĉ˜Žç¤şçš„Ğċž‹‚’ĉŒ‡ċš™‚‹ċż…èĤŒ‚‚‹Ÿ‚ċž‹”¨Ğ関ĉ•°Œç™şç”Ÿ—™ + /// + /// + /// + /// + public static NativeParallelMultiHashMap MC2Deserialize(int2[] keyArray, ushort[] valueArray) + { + int keyCount = keyArray?.Length ?? 0; + int valueCount = valueArray?.Length ?? 0; + Debug.Assert(keyCount == valueCount); + var map = new NativeParallelMultiHashMap(keyCount, Allocator.Persistent); + if (keyCount > 0 && valueCount > 0) + { + using var keyNativeArray = new NativeArray(keyArray, Allocator.Persistent); + using var valueNativeArray = new NativeArray(valueArray, Allocator.Persistent); + var job = new SetParallelMultiHashMapJob() { map = map, keyArray = keyNativeArray, valueArray = valueNativeArray }; + job.Run(); + } + + return map; + } + + [BurstCompile] +#if MC2_COLLECTIONS_200 + struct SetParallelMultiHashMapJob : IJob where TKey : unmanaged, IEquatable where TValue : unmanaged +#else + struct SetParallelMultiHashMapJob : IJob where TKey : struct, IEquatable where TValue : struct +#endif + { + public NativeParallelMultiHashMap map; + [Unity.Collections.ReadOnly] + public NativeArray keyArray; + [Unity.Collections.ReadOnly] + public NativeArray valueArray; + + public void Execute() + { + int cnt = keyArray.Length; + for (int i = 0; i < cnt; i++) + { + map.Add(keyArray[i], valueArray[i]); + } + } + } + + /// + /// NativeParallelMultiHashMapŒç˘şäż•‚ŒĤ„‚‹ċ ´ċˆżDispose()™‚‹ + /// + /// + /// + /// +#if MC2_COLLECTIONS_200 + public static void MC2DisposeSafe(ref this NativeParallelMultiHashMap map) where TKey : unmanaged, IEquatable where TValue : unmanaged, IEquatable +#else + public static void MC2DisposeSafe(ref this NativeParallelMultiHashMap map) where TKey : struct, IEquatable where TValue : struct, IEquatable +#endif + { + if (map.IsCreated) + map.Dispose(); + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/NativeMultiHashMapExtensions.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/NativeMultiHashMapExtensions.cs.meta new file mode 100644 index 00000000..a3f2ed87 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/NativeMultiHashMapExtensions.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: b133d9becc3f7ce46b4504e63586056b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/NativeMultiHashMapExtensions.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/NativeParallelHashMapExtensions.cs b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/NativeParallelHashMapExtensions.cs new file mode 100644 index 00000000..2ca0e18a --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/NativeParallelHashMapExtensions.cs @@ -0,0 +1,30 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2024 MagicaSoft. +// https://magicasoft.jp +using System; +using Unity.Collections; + +namespace MagicaCloth2 +{ + /// + /// NativeParallelHashMapĉ‹ĦċĵµƒĦ‚½ƒƒƒ‰ + /// + public static class NativeParallelHashMap + { + /// + /// NativeParallelMultiHashMapŒç˘şäż•‚ŒĤ„‚‹ċ ´ċˆżDispose()™‚‹ + /// + /// + /// + /// +#if MC2_COLLECTIONS_200 + public static void MC2DisposeSafe(ref this NativeParallelHashMap map) where TKey : unmanaged, IEquatable where TValue : unmanaged, IEquatable +#else + public static void MC2DisposeSafe(ref this NativeParallelHashMap map) where TKey : struct, IEquatable where TValue : struct, IEquatable +#endif + { + if (map.IsCreated) + map.Dispose(); + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/NativeParallelHashMapExtensions.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/NativeParallelHashMapExtensions.cs.meta new file mode 100644 index 00000000..a643bf41 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/NativeParallelHashMapExtensions.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: f6dcd839c56f63b42af8231ec3cb1841 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/NativeParallelHashMapExtensions.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/NativeReferenceExtensions.cs b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/NativeReferenceExtensions.cs new file mode 100644 index 00000000..34013474 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/NativeReferenceExtensions.cs @@ -0,0 +1,28 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System.Runtime.CompilerServices; +using System.Threading; +using Unity.Collections; +using Unity.Collections.LowLevel.Unsafe; + +namespace MagicaCloth2 +{ + static class NativeReferenceExtensions + { + /// + /// ‚Ğ‚Ĥƒ³‚żƒĵĞƒ‡ƒĵ‚żĉ•°‚’èż½ċŠ —Ĥèż½ċŠ ċ‰é–‹ċ§‹‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı‚’èż”™ + /// “é–˘ĉ•°Ż‚ıƒĴƒƒƒ‰‚ğƒĵƒ•§‚‚‹ + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + unsafe public static int MC2InterlockedStartIndex(ref this NativeReference counter, int dataCount) + { + int* cntPt = (int*)counter.GetUnsafePtr(); + int start = Interlocked.Add(ref *cntPt, dataCount) - dataCount; + return start; + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/NativeReferenceExtensions.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/NativeReferenceExtensions.cs.meta new file mode 100644 index 00000000..0fa599cf --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/NativeReferenceExtensions.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: a86bf182de69e9b4b8b212407378a96a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Utility/NativeCollection/NativeReferenceExtensions.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/ResultCode.meta b/Assets/MagicaCloth2/Scripts/Core/Utility/ResultCode.meta new file mode 100644 index 00000000..7ef9c71a --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/ResultCode.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d7a14441047ec414c86b093b4a7940ed +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/ResultCode/Exception.cs b/Assets/MagicaCloth2/Scripts/Core/Utility/ResultCode/Exception.cs new file mode 100644 index 00000000..3afa60cc --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/ResultCode/Exception.cs @@ -0,0 +1,31 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System; + +namespace MagicaCloth2 +{ + /// + /// ċ‡Ĥ理ä‹ċ¤– + /// “‚ŒŻäşˆĉœŸ•‚ŒŸ‚¨ƒİƒĵĞ‚ˆ‚Šċ‡Ĥ理‚’中ĉ–­™‚‹ċ ´ċˆĞ用„‚‹ + /// + [Serializable] + public class MagicaClothProcessingException : Exception + { + public MagicaClothProcessingException() : base() { } + public MagicaClothProcessingException(string message) : base(message) { } + public MagicaClothProcessingException(string message, Exception inner) : base(message, inner) { } + } + + /// + /// ‚­ƒ£ƒ³‚ğƒĞä‹ċ¤– + /// “‚ŒŻ‚¨ƒİƒĵç„Ħ—Ğċ‡Ĥ理‚’ĉ‰“Ħċˆ‡‚‹ċ ´ċˆĞ用„‚‹ + /// + [Serializable] + public class MagicaClothCanceledException : Exception + { + public MagicaClothCanceledException() : base() { } + public MagicaClothCanceledException(string message) : base(message) { } + public MagicaClothCanceledException(string message, Exception inner) : base(message, inner) { } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/ResultCode/Exception.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Utility/ResultCode/Exception.cs.meta new file mode 100644 index 00000000..1a0ddde3 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/ResultCode/Exception.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: ab191ee61f2d8e14598d1adc5359890d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Utility/ResultCode/Exception.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/ResultCode/ResultCode.cs b/Assets/MagicaCloth2/Scripts/Core/Utility/ResultCode/ResultCode.cs new file mode 100644 index 00000000..71bcac95 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/ResultCode/ResultCode.cs @@ -0,0 +1,165 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System.Diagnostics; +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// ĉ§˜€…Şċ‡Ĥ理çµĉžœ + /// + [System.Serializable] + public struct ResultCode + { + [SerializeField] + volatile Define.Result result; + + /// + /// è­Ĥċ‘Šïĵšè­Ĥċ‘ЁŻïĵ‘¤żäżĉŒ + /// + [SerializeField] + volatile Define.Result warning; + + public Define.Result Result => result; + + public static ResultCode None => new ResultCode(Define.Result.None); + public static ResultCode Empty => new ResultCode(Define.Result.Empty); + public static ResultCode Success => new ResultCode(Define.Result.Success); + public static ResultCode Error => new ResultCode(Define.Result.Error); + + public ResultCode(Define.Result initResult) + { + result = initResult; + warning = Define.Result.None; + } + + public void Clear() + { + result = Define.Result.None; + warning = Define.Result.None; + } + + public void SetResult(Define.Result code) + { + result = code; + } + + public void SetSuccess() + { + SetResult(Define.Result.Success); + } + + public void SetCancel() + { + SetResult(Define.Result.Cancel); + } + + public void SetError(Define.Result code = Define.Result.Error) + { + result = code; +#if MC2_DEBUG + Develop.DebugLogError(GetResultString()); +#endif + } + + public void SetWarning(Define.Result code = Define.Result.Warning) + { + if (code == Define.Result.None) + return; + + warning = code; +#if MC2_DEBUG + Develop.DebugLogWarning(GetWarningString()); +#endif + } + + public void Merge(ResultCode src) + { + if (src.IsError()) + result = src.result; + if (src.IsWarning()) + warning = src.warning; + } + + public void SetProcess() + { + SetResult(Define.Result.Process); + } + + public bool IsResult(Define.Result code) + { + return result == code; + } + + public bool IsNone() => result == Define.Result.None; + public bool IsSuccess() => result == Define.Result.Success; + public bool IsFaild() => !IsSuccess(); + public bool IsCancel() => result == Define.Result.Cancel; + public bool IsNormal() => result < Define.Result.Warning; + public bool IsError() => result >= Define.Result.Error; + public bool IsProcess() => result == Define.Result.Process; + public bool IsWarning() => warning != Define.Result.None; + + public string GetResultString() + { + if (IsNormal()) + return result.ToString(); + else + return $"({(int)result}) {result}"; + } + + public string GetWarningString() + { + return $"({(int)warning}) {warning}"; + } + + /// + /// 結ĉžœ‚³ƒĵƒ‰Ğċ݁™‚‹èż½ċŠ ĉƒ…ċ ħ‚’ċ–ċ—™‚‹€‚Ş„ċ ´ċˆŻnullŒèż”‚‹€‚ + /// + /// + public string GetResultInformation() + { + switch (result) + { + case Define.Result.RenderSetup_Unreadable: + return "It is necessary to turn on [Read/Write] in the model import settings."; + case Define.Result.RenderSetup_Over65535vertices: + return "Original mesh must have no more than 65,535 vertices."; + case Define.Result.SerializeData_Over31Renderers: + return $"There are {Define.System.MaxRendererCount} renderers that can be set."; + case Define.Result.Init_ScaleIsZero: + return "Component scale values is 0."; + case Define.Result.Init_NegativeScale: + return "Component has negative scale."; + default: + return null; + } + } + + public string GetWarningInformation() + { + switch (warning) + { + case Define.Result.RenderMesh_VertexWeightIs5BonesOrMore: + return "The source renderer mesh contains vertex weights that utilize more than 5 bones.\nA weight of 5 or more is invalid."; + case Define.Result.Init_NonUniformScale: + return "Component scale values ​​should be uniform.\nIf the scale is not uniform, there is a risk that it will not work properly."; + default: + return null; + } + } + + [Conditional("MC2_DEBUG")] + public void DebugLog(bool error = true, bool warning = true, bool normal = true) + { + if (IsError() && error) + Develop.DebugLogError(GetResultString()); + else if (normal) + Develop.DebugLog(GetResultString()); + + if (IsWarning() && warning) + Develop.DebugLogWarning(GetWarningString()); + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/ResultCode/ResultCode.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Utility/ResultCode/ResultCode.cs.meta new file mode 100644 index 00000000..afb13b81 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/ResultCode/ResultCode.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: f7830dff664b1ff409e8ae3d8456371a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Utility/ResultCode/ResultCode.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/Time.meta b/Assets/MagicaCloth2/Scripts/Core/Utility/Time.meta new file mode 100644 index 00000000..2ce74c1d --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/Time.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 87fbdda2219d11649892645df5504b0d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/Time/TimeSpan.cs b/Assets/MagicaCloth2/Scripts/Core/Utility/Time/TimeSpan.cs new file mode 100644 index 00000000..b2fcd618 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/Time/TimeSpan.cs @@ -0,0 +1,71 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System; + +namespace MagicaCloth2 +{ + /// + /// ĉ™‚間計ĉ¸Ĵ‚Żƒİ‚ı + /// + public class TimeSpan + { + string name = string.Empty; + DateTime stime; + DateTime etime; + bool isFinish; + + public TimeSpan() { } + + public TimeSpan(string name) + { + this.name = name; + stime = DateTime.Now; + isFinish = false; + } + + public void Start() + { + stime = DateTime.Now; + isFinish = false; + } + + public void Finish() + { + //etime = DateTime.Now; + if (isFinish == false) + { + etime = DateTime.Now; + isFinish = true; + } + } + + public double TotalSeconds() + { + Finish(); + return (etime - stime).TotalSeconds; + } + + public double TotalMilliSeconds() + { + Finish(); + return (etime - stime).TotalMilliseconds; + } + + public override string ToString() + { + //return $"TimeSpan [{name}] : {TotalSeconds()}(s)"; + return $"TimeSpan [{name}] : {TotalMilliSeconds()}(ms)"; + } + + public void DebugLog() + { + Develop.DebugLog(this); + } + + public void Log() + { + Develop.Log(this); + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/Time/TimeSpan.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Utility/Time/TimeSpan.cs.meta new file mode 100644 index 00000000..21829a88 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/Time/TimeSpan.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 37c049d9587e21243b12c35054b5582b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Utility/Time/TimeSpan.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/Time/UnityTimeSpan.cs b/Assets/MagicaCloth2/Scripts/Core/Utility/Time/UnityTimeSpan.cs new file mode 100644 index 00000000..0ad1bbd7 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/Time/UnityTimeSpan.cs @@ -0,0 +1,56 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// ĉ™‚間計ĉ¸Ĵ‚Żƒİ‚ı(UnityEngine.Time‚’ä½żç”¨™‚‹ïĵ‰ + /// + public class UnityTimeSpan + { + string name = string.Empty; + float stime; + float etime; + bool isFinish; + + public UnityTimeSpan(string name) + { + this.name = name; + stime = Time.realtimeSinceStartup; + } + + public void Finish() + { + if (isFinish == false) + { + etime = Time.realtimeSinceStartup; + isFinish = true; + } + } + + public float TotalSeconds() + { + Finish(); + return (etime - stime); + } + + public float TotalMilliSeconds() + { + Finish(); + return (etime - stime) * 1000.0f; + } + + public override string ToString() + { + //return $"TimeSpan [{name}] : {TotalSeconds()}(s)"; + return $"UnityTimeSpan [{name}] : {TotalMilliSeconds()}(ms)"; + } + + public void DebugLog() + { + Debug.Log(this); + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/Utility/Time/UnityTimeSpan.cs.meta b/Assets/MagicaCloth2/Scripts/Core/Utility/Time/UnityTimeSpan.cs.meta new file mode 100644 index 00000000..ce7e6d43 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/Utility/Time/UnityTimeSpan.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 60bc0f15f2991074f9db6ecacf0eb4bd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/Utility/Time/UnityTimeSpan.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/VirtualMesh.meta b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh.meta new file mode 100644 index 00000000..a4bab0ac --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e445d9f5e13ea1b4dbbec70883e9ef2c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function.meta b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function.meta new file mode 100644 index 00000000..a2abfd19 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 50f98a3f39e39d24fbd368941ed7dc51 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshInputOutput.cs b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshInputOutput.cs new file mode 100644 index 00000000..01b44bde --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshInputOutput.cs @@ -0,0 +1,1910 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System; +using System.Collections.Generic; +using Unity.Burst; +using Unity.Collections; +using Unity.Jobs; +using Unity.Mathematics; +using UnityEngine; + +namespace MagicaCloth2 +{ + public partial class VirtualMesh + { + /// + /// ƒĴƒ³ƒ€ƒĵĉƒ…ċ ħ‹‚‰‚¤ƒ³ƒƒĵƒˆ™‚‹ïĵˆ‚ıƒĴƒƒƒ‰ċŻïĵ‰ + /// + /// + /// + /// + public void ImportFrom(RenderSetupData rsetup, int uvChannel) + { + try + { + // ★ċŸşĉœĴ的Ğ一連ä½œĉ­ŒċŒäş†™‚‹§‚­ƒ£ƒ³‚ğƒĞŻ•›Ş„ïĵˆċ‰ċ…¨ĉ€§Ÿ‚ïĵ‰ + if (rsetup == null) + { + result.SetError(Define.Result.VirtualMesh_InvalidSetup); + throw new MagicaClothProcessingException(); + } + if (rsetup.IsFaild()) + { + result.SetError(Define.Result.VirtualMesh_InvalidSetup); + throw new MagicaClothProcessingException(); + } + + // ========== Transform ========= + // ‚ğƒƒƒˆ‚˘ƒƒƒ—ĉƒ…ċ ħ‹‚‰ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ‚’ç™ğ録™‚‹ + if (transformData == null) + transformData = new TransformData(rsetup.TransformCount); + int[] indices = transformData.AddTransformRange( + rsetup.transformList, + rsetup.transformIdList, + rsetup.transformParentIdList, + rsetup.rootTransformIdList, + rsetup.transformLocalPositions, + rsetup.transformLocalRotations, + rsetup.transformPositions, + rsetup.transformRotations, + rsetup.transformScales, + rsetup.transformInverseRotations + ); + + // center + centerTransformIndex = indices[rsetup.renderTransformIndex]; + + // ċˆĉœŸċŒ–ĉ™‚ƒžƒˆƒŞƒƒ‚Ż‚ı‚’記録 + initLocalToWorld = rsetup.initRenderLocalToWorld; + initWorldToLocal = rsetup.initRenderWorldtoLocal; + initRotation = rsetup.initRenderRotation; + initInverseRotation = math.inverse(initRotation); + initScale = rsetup.initRenderScale; + + // ========== ““‹‚‰Mesh/Bone§ċˆ†ċ² ========== + if (rsetup.setupType == RenderSetupData.SetupType.MeshCloth) + { + // ƒĦƒƒ‚·ƒ‚ż‚¤ƒ— + meshType = MeshType.NormalMesh; + isBoneCloth = false; + ImportMeshType(rsetup, indices, uvChannel); + + // ‚ı‚­ƒ‹ƒ³‚°ƒĦƒƒ‚·ƒ§Żïĵ‘ċ›ž‚ı‚­ƒ‹ƒ³‚°‚’èĦŒ„‚Żƒ­‚ıƒ­ƒĵ‚ЃĞçİşé–“Ğċ§żċ‹˘‚’ċ¤‰ĉ›™‚‹ + if (rsetup.hasBoneWeight) + { + ImportMeshSkinning(); + } + } + else if (rsetup.setupType == RenderSetupData.SetupType.BoneCloth || rsetup.setupType == RenderSetupData.SetupType.BoneSpring) + { + // ƒœƒĵƒ³‚ż‚¤ƒ— + meshType = MeshType.NormalBoneMesh; + isBoneCloth = true; + ImportBoneType(rsetup, indices); + } + else + { + result.SetError(Define.Result.RenderSetup_InvalidType); + throw new IndexOutOfRangeException(); + } + + // AABB + boundingBox = new NativeReference(Allocator.Persistent); + JobUtility.CalcAABBRun(localPositions.GetNativeArray(), VertexCount, boundingBox); + + // UV + switch (rsetup.setupType) + { + case RenderSetupData.SetupType.BoneCloth: + case RenderSetupData.SetupType.BoneSpring: + if (TriangleCount > 0) + { + // ƒœƒĵƒ³‚ż‚¤ƒ—§ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ‚’ċĞ‚€ċ ´ċˆ + JobUtility.CalcUVWithSphereMappingRun( + localPositions.GetNativeArray(), + VertexCount, + boundingBox, + uv.GetNativeArray() + ); + } + break; + } + + // 頂ç‚ıċı³ċ‡ĉŽçĥšè·é›˘ç—ċ‡ş + CalcAverageAndMaxVertexDistanceRun(); + } + catch (Exception) + { + if (result.IsNone()) result.SetError(Define.Result.VirtualMesh_ImportError); + throw; + } + finally + { + } + } + + /// + /// Mesh‚ż‚¤ƒ—‚¤ƒ³ƒƒĵƒˆ + /// + /// + /// + void ImportMeshType(RenderSetupData rsetup, int[] transformIndices, int uvChannel) + { + // root bone + skinRootIndex = transformIndices[rsetup.skinRootBoneIndex]; + + // skin bones + skinBoneTransformIndices.AddRange(transformIndices, rsetup.skinBoneCount); + + // bind pose + skinBoneBindPoses.AddRange(rsetup.bindPoseList.ToArray()); + + // ========== MeshData ========= + var meshData = rsetup.meshDataArray[0]; + int vcnt = meshData.vertexCount; + //flags.AddRange(vcnt); + localPositions.AddRange(vcnt); + localNormals.AddRange(vcnt); + localTangents.AddRange(vcnt); + uv.AddRange(vcnt); + boneWeights.AddRange(vcnt); + + + meshData.GetVertices(localPositions.GetNativeArray()); + meshData.GetNormals(localNormals.GetNativeArray()); + if (meshData.HasVertexAttribute(UnityEngine.Rendering.VertexAttribute.Tangent)) + { + // ĉŽç·šĉƒ…ċ ħŒƒĦƒƒ‚·ƒĞċ­˜ċœ¨™‚‹ + using var tangents = new NativeArray(vcnt, Allocator.TempJob); + meshData.GetTangents(tangents); + // tangentċ¤‰ĉ›(Vector4->float3) + localTangents.CopyFromWithTypeChangeStride(tangents); + } + else + { + // ĉŽç·šĉƒ…ċ ħŒƒĦƒƒ‚·ƒĞċ­˜ċœ¨—Ş„ + Develop.DebugLogWarning($"[{name}] Tangents not found!"); + // tangent‚’生ĉˆ™‚‹ + // “tangentŻĉç”ğ用§Żç„Ħċ§żċ‹˘ċˆĥċĦ用Ş§‚‚‹ĉ„ċ‘³éİċ½“§‚‚ċ¤§ä¸ˆċ¤Ğ + var job = new Import_GenerateTangentJob() + { + localNormals = localNormals.GetNativeArray(), + localTangents = localTangents.GetNativeArray(), + }; + job.Run(vcnt); + } + if (meshData.HasVertexAttribute(UnityEngine.Rendering.VertexAttribute.TexCoord0)) + { + uvChannel = Mathf.Clamp(uvChannel, 0, 7); + UnityEngine.Rendering.VertexAttribute useTexCoord = UnityEngine.Rendering.VertexAttribute.TexCoord0 + uvChannel; + if (meshData.HasVertexAttribute(useTexCoord) == false) + { + Develop.LogWarning($"[{name}] UV{uvChannel} not found! => Use UV0."); + uvChannel = 0; + } + //Debug.Log($"Fetch UV:{uvChannel}"); + meshData.GetUVs(uvChannel, uv.GetNativeArray()); + } + else + { + Develop.LogWarning($"[{name}] UV0 not found!"); + } + + // ċħžĉ€§ + attributes.AddRange(vcnt); + + // ċ‚ç…§‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı + referenceIndices.AddRange(vcnt); + + // bone weights + using var startBoneWeightIndices = new NativeArray(vcnt, Allocator.TempJob); + + // ċ‚ç…§‚¤ƒ³ƒ‡ƒƒ‚Ż‚ıĞé€£ç•Ş‚’ĉŒŻ‚‹ + JobUtility.SerialNumberRun(referenceIndices.GetNativeArray(), vcnt); + + // bone weights + if (rsetup.hasBoneWeight) + { + // bonesPerVertexArray‹‚‰é ‚ç‚ı”¨ƒ‡ƒĵ‚żé–‹ċ§‹‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı‚’ç—ċ‡ş™‚‹ + var importBoneWeightJob1 = new Import_BoneWeightJob1() + { + vcnt = vcnt, + bonesPerVertexArray = rsetup.bonesPerVertexArray, + startBoneWeightIndices = startBoneWeightIndices, + }; + importBoneWeightJob1.Run(); + + // 頂ç‚ı”¨ƒœƒĵƒ³‚Ĥ‚¨‚¤ƒˆ‚’VirtualMeshBoneWeightsĉ§‹é€ ä½“¨—Ĥĉ ĵ納™‚‹ + // Ÿ —ĉœ€ċ¤§‚Ĥ‚¨‚¤ƒˆĉ•°Żïĵ”§ĉ‰“Ħċˆ‡‚‹ + var importBoneWeightJob2 = new Import_BoneWeightJob2() + { + startBoneWeightIndices = startBoneWeightIndices, + boneWeightArray = rsetup.boneWeightArray, + bonesPerVertexArray = rsetup.bonesPerVertexArray, + boneWeights = boneWeights.GetNativeArray(), + }; + importBoneWeightJob2.Run(vcnt); + } + else + { + // 通ċ¸¸ƒĦƒƒ‚·ƒŻ‚ğƒ³‚żƒĵƒˆƒİƒ³‚ıƒ•‚݃ĵƒ 100%§‚Ĥ‚¨‚¤ƒˆ‚’ä𘁑‚‹ + JobUtility.FillRun(boneWeights.GetNativeArray(), vcnt, new VirtualMeshBoneWeight(0, new float4(1, 0, 0, 0))); + } + + // triangle + for (int i = 0; i < meshData.subMeshCount; i++) + { + var submeshData = meshData.GetSubMesh(i); + using var triangleIndices = new NativeArray(submeshData.indexCount, Allocator.Persistent); + meshData.GetIndices(triangleIndices, i); + + // èż½ċŠ  + triangles.AddRangeTypeChange(triangleIndices); + } + } + + /// + /// tangent‚’ĉ“Ĵäĵĵ生ĉˆ™‚‹ + /// “tangentŻĉç”ğ用§Żç„Ħċ§żċ‹˘ċˆĥċĦ用Ş§‚‚‹ĉ„ċ‘³éİċ½“§‚‚ċ¤§ä¸ˆċ¤Ğ + /// + [BurstCompile] + struct Import_GenerateTangentJob : IJobParallelFor + { + [Unity.Collections.ReadOnly] + public NativeArray localNormals; + [Unity.Collections.WriteOnly] + public NativeArray localTangents; + + public void Execute(int vindex) + { + var nor = localNormals[vindex]; + float3 tan = math.up(); + if (math.dot(nor, tan) < 0.9) + { + tan = math.normalize(math.cross(nor, tan)); + } + else + { + tan = math.normalize(math.cross(nor, math.right())); + } + localTangents[vindex] = tan; + } + } + + + /// + /// ‚ı‚­ƒ‹ƒ³‚°ƒĦƒƒ‚·ƒé ‚ç‚ı‚’‚ı‚­ƒ‹ƒ³‚°—Ĥċ…ƒƒ­ƒĵ‚ЃĞçİşé–“Ğċ¤‰ĉ›™‚‹ + /// + void ImportMeshSkinning() + { + var job = new Import_CalcSkinningJob() + { + localPositions = localPositions.GetNativeArray(), + localNormals = localNormals.GetNativeArray(), + localTangents = localTangents.GetNativeArray(), + boneWeights = boneWeights.GetNativeArray(), + skinBoneTransformIndices = skinBoneTransformIndices.GetNativeArray(), + bindPoses = skinBoneBindPoses.GetNativeArray(), + + transformPositionArray = transformData.positionArray.GetNativeArray(), + transformRotationArray = transformData.rotationArray.GetNativeArray(), + transformScaleArray = transformData.scaleArray.GetNativeArray(), + + toM = initWorldToLocal, + }; + job.Run(VertexCount); + } + + /// + /// 頂ç‚ı‚ı‚­ƒ‹ƒ³‚°‚’èĦŒ„ƒŻƒĵƒĞƒ‰ċş§ĉ¨™ƒğĉ³•ç·šƒğĉŽç·š‚’ĉħ‚‚‚‹ + /// + [BurstCompile] + struct Import_CalcSkinningJob : IJobParallelFor + { + //[Unity.Collections.ReadOnly] + public NativeArray localPositions; + //[Unity.Collections.ReadOnly] + public NativeArray localNormals; + //[Unity.Collections.ReadOnly] + public NativeArray localTangents; + [Unity.Collections.ReadOnly] + public NativeArray boneWeights; + [Unity.Collections.ReadOnly] + public NativeArray skinBoneTransformIndices; + [Unity.Collections.ReadOnly] + public NativeArray bindPoses; + [Unity.Collections.ReadOnly] + public NativeArray transformPositionArray; + [Unity.Collections.ReadOnly] + public NativeArray transformRotationArray; + [Unity.Collections.ReadOnly] + public NativeArray transformScaleArray; + + public float4x4 toM; + + public void Execute(int vindex) + { + var bw = boneWeights[vindex]; + int wcnt = bw.Count; + float3 wpos = 0; + float3 wnor = 0; + float3 wtan = 0; + for (int i = 0; i < wcnt; i++) + { + float w = bw.weights[i]; + + int boneIndex = bw.boneIndices[i]; + float4x4 bp = bindPoses[boneIndex]; + float4 lpos = new float4(localPositions[vindex], 1); + float4 lnor = new float4(localNormals[vindex], 0); + float4 ltan = new float4(localTangents[vindex], 0); + + float3 pos = math.mul(bp, lpos).xyz; + float3 nor = math.mul(bp, lnor).xyz; + float3 tan = math.mul(bp, ltan).xyz; + + int tindex = skinBoneTransformIndices[boneIndex]; + var tpos = transformPositionArray[tindex]; + var trot = transformRotationArray[tindex]; + var tscl = transformScaleArray[tindex]; + MathUtility.TransformPositionNormalTangent(tpos, trot, tscl, ref pos, ref nor, ref tan); + + wpos += pos * w; + wnor += nor * w; + wtan += tan * w; + } + + // ċ†³ƒ­ƒĵ‚ЃĞçİşé–“Ğċ¤‰ĉ›™‚‹ + localPositions[vindex] = MathUtility.TransformPoint(wpos, toM); + //localNormals[vindex] = MathUtility.TransformDirection(wnor, toM); + //localTangents[vindex] = MathUtility.TransformDirection(wtan, toM); + localNormals[vindex] = MathUtility.TransformNormal(wnor, toM, math.up()); + localTangents[vindex] = MathUtility.TransformNormal(wtan, toM, math.right()); + } + } + + + [BurstCompile] + struct Import_BoneWeightJob1 : IJob + { + public int vcnt; + + [Unity.Collections.ReadOnly] + public NativeArray bonesPerVertexArray; + + [Unity.Collections.WriteOnly] + public NativeArray startBoneWeightIndices; + + public void Execute() + { + int sindex = 0; + for (int i = 0; i < vcnt; i++) + { + startBoneWeightIndices[i] = sindex; + sindex += bonesPerVertexArray[i]; + } + } + } + + [BurstCompile] + struct Import_BoneWeightJob2 : IJobParallelFor + { + [Unity.Collections.ReadOnly] + public NativeArray startBoneWeightIndices; + [Unity.Collections.ReadOnly] + public NativeArray boneWeightArray; + [Unity.Collections.ReadOnly] + public NativeArray bonesPerVertexArray; + + [Unity.Collections.WriteOnly] + public NativeArray boneWeights; + + public void Execute(int vindex) + { + int sindex = startBoneWeightIndices[vindex]; + int wcnt = bonesPerVertexArray[vindex]; + var bw = new VirtualMeshBoneWeight(); + + // ĉœ€ċ¤§‚Ĥ‚¨‚¤ƒˆĉ•°Żïĵ”§ + int index = 0; + for (int i = 0; i < wcnt && i < 4; i++) + { + var bw1 = boneWeightArray[sindex + i]; + if (bw1.weight > 0.0f) + { + bw.weights[index] = bw1.weight; + bw.boneIndices[index] = bw1.boneIndex; + index++; + } + } + + // ‚Ĥ‚¨‚¤ƒˆĉ•°Œïĵ•äğ上‚£Ÿċ ´ċˆŻ‚Ĥ‚¨‚¤ƒˆċ€¤‚’ċ˜ä½ċŒ–™‚‹ + if (wcnt > 4) + { + bw.AdjustWeight(); + } + + boneWeights[vindex] = bw; + } + } + + /// + /// Bone‚ż‚¤ƒ—‚¤ƒ³ƒƒĵƒˆ + /// + /// + /// + void ImportBoneType(RenderSetupData rsetup, int[] transformIndices) + { + // Transformĉƒ…ċ ħ‹‚‰ƒĦƒƒ‚·ƒ‚’ĉ§‹ç݉™‚‹ + int vcnt = rsetup.TransformCount - 1; + //flags.AddRange(vcnt); + localPositions.AddRange(vcnt); + localNormals.AddRange(vcnt); + localTangents.AddRange(vcnt); + uv.AddRange(vcnt); + boneWeights.AddRange(vcnt); + attributes.AddRange(vcnt); + referenceIndices.AddRange(vcnt); + + // BoneCloth‚‚‚ı‚­ƒ‹ƒ³‚°ċ‡Ĥ理Ğçµħ一™‚‹Ÿ‚‚ı‚­ƒ‹ƒ³‚°ç”¨ƒœƒĵƒ³‚’ç™ğ録 + skinBoneTransformIndices.AddRange(transformIndices, rsetup.skinBoneCount); + skinBoneBindPoses.AddRange(vcnt); + + // Transformĉƒ…ċ ħ‚’‚Żƒ­‚ıƒ­ƒĵ‚ЃĞçİşé–“Ğċ¤‰ĉ›—é ‚ç‚ıĉƒ…ċ ħĞċ‰²‚Šċ½“Ĥ‚‹ + // Š‚ˆ³ƒ‚¤ƒ³ƒ‰ƒƒĵ‚şç—ċ‡ş + var WtoL = rsetup.initRenderWorldtoLocal; + var LtoW = rsetup.initRenderLocalToWorld; + var boneVertexJob = new Import_BoneVertexJob() + { + WtoL = WtoL, + LtoW = LtoW, + + transformPositions = rsetup.transformPositions, + transformRotations = rsetup.transformRotations, + transformScales = rsetup.transformScales, + + localPositions = localPositions.GetNativeArray(), + localNormals = localNormals.GetNativeArray(), + localTangents = localTangents.GetNativeArray(), + boneWeights = boneWeights.GetNativeArray(), + skinBoneBindPoses = skinBoneBindPoses.GetNativeArray(), + }; + boneVertexJob.Run(vcnt); + + // ċ‚ç…§‚¤ƒ³ƒ‡ƒƒ‚Ż‚ıĞé€£ç•Ş‚’ĉŒŻ‚‹ + JobUtility.SerialNumberRun(referenceIndices.GetNativeArray(), vcnt); + + // Line/Triangleċ½˘ĉˆ + // ★““Żĉ•°‚‚ċ°‘Ş‚‚ŠBurstĉİĉµ‚’ċ—‘‚‰‚ŒŞ„§ĉ™é€šĞC#§ĉ§‹ĉˆ™‚‹ + if (rsetup.boneConnectionMode == RenderSetupData.BoneConnectionMode.Line) + { + // LineĉŽçĥš + var lineList = new List(vcnt); + for (int i = 0; i < vcnt; i++) + { + // èĤށĞĉŽçĥš•›‚‹ + int pindex = rsetup.GetParentTransformIndex(i, true); // ‚ğƒ³‚żƒĵƒˆƒİƒ³‚ıƒ•‚݃ĵƒ Żé™¤ċ¤– + if (pindex >= 0) + { + int2 line = DataUtility.PackInt2(pindex, i); + lineList.Add(line); + } + } + + // BoneSpring§è¨­ċš + if (rsetup.setupType == RenderSetupData.SetupType.BoneSpring) + { + // ‚ıƒ—ƒŞƒ³‚°§Ż‚³ƒŞ‚¸ƒ§ƒ³ç„ĦċŠı§ċˆĉœŸċŒ– + attributes.Fill(0, vcnt, VertexAttribute.DisableCollision); + + // ‚³ƒŞ‚¸ƒ§ƒ³¨—ĤĉŒ‡ċš•‚ŒŸƒœƒĵƒ³żèĦçށċˆ¤ċš‚’ĉœ‰ċŠıċŒ–™‚‹ + if (rsetup.collisionBoneIndexList != null) + { + foreach (int index in rsetup.collisionBoneIndexList) + { + if (index >= 0) + { + attributes[index] = VertexAttribute.Invalid; + } + } + } + } + + if (lineList.Count > 0) + lines = new ExSimpleNativeArray(lineList.ToArray()); + } + else + { + // MeshĉŽçĥš + // ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ID‹‚‰‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı¸èžĉ›¸‚’作ĉˆ + var idToIndexDict = new Dictionary(vcnt); + for (int i = 0; i < vcnt; i++) + { + if (idToIndexDict.ContainsKey(rsetup.transformIdList[i]) == false) + idToIndexDict.Add(rsetup.transformIdList[i], i); + } + + // ƒĞƒĵƒ—ĉŽçĥšƒ•ƒİ‚° + bool loopConnection = rsetup.boneConnectionMode == RenderSetupData.BoneConnectionMode.SequentialLoopMesh; + + // 順ĉĴĦĉŽçĥšƒ•ƒİ‚° + bool sequentialConnection = rsetup.boneConnectionMode == RenderSetupData.BoneConnectionMode.SequentialLoopMesh + || rsetup.boneConnectionMode == RenderSetupData.BoneConnectionMode.SequentialNonLoopMesh; + + // ƒĞƒĵƒˆƒŞ‚ıƒˆ + var rootTransformIdList = new List(rsetup.rootTransformIdList); // copy + int rootCnt = rootTransformIdList.Count; + const int firstRootIndex = 0; + int lastRootIndex = rootCnt - 1; + + // ‚ރĵƒˆĉŽçĥšċ ´ċˆŻƒĞƒĵƒˆċŒċ£ĞŒĉœ€èż‘ĉŽç‚ıĞŞ‚‹‚ˆ†Ğä¸Ĥıĉ›żˆ‚‹ + if (rsetup.boneConnectionMode == RenderSetupData.BoneConnectionMode.AutomaticMesh) + { + var tempRootIdList = new List(rootTransformIdList); + + rootTransformIdList.Clear(); + rootTransformIdList.Add(tempRootIdList[0]); + float lastDist = 0; + while (tempRootIdList.Count > 0) + { + MagicaObjectId rootId = rootTransformIdList[rootTransformIdList.Count - 1]; + tempRootIdList.Remove(rootId); + int vindex = idToIndexDict[rootId]; + var pos = localPositions[vindex]; + + // next connection + float minDist = float.MaxValue; + MagicaObjectId minId = MagicaObjectId.Invalid; + for (int i = 0; i < tempRootIdList.Count; i++) + { + MagicaObjectId rootId2 = tempRootIdList[i]; + int vindex2 = idToIndexDict[rootId2]; + var pos2 = localPositions[vindex2]; + + float dist = math.distance(pos, pos2); + if (dist < minDist) + { + minDist = dist; + minId = rootId2; + } + + } + if (minId.IsValid()) + { + if (lastDist == 0 || minDist < lastDist * 1.5f) + { + rootTransformIdList.Add(minId); + lastDist = lastDist == 0 ? minDist : (lastDist + minDist) * 0.5f; + } + else + { + // reverse + rootTransformIdList.Reverse(); + lastDist = 0; + } + } + } + + // ĉœ€ċˆ¨ĉœ€ċŒƒĞƒĵƒˆè·é›˘Œċı³ċ‡äğ下Ş‚‰°ƒĞƒĵƒ—ĉŽçĥšĞ™‚‹ + if (rootTransformIdList.Count >= 3) + { + MagicaObjectId rootId1 = rootTransformIdList[0]; + MagicaObjectId rootId2 = rootTransformIdList[rootTransformIdList.Count - 1]; + int vindex1 = idToIndexDict[rootId1]; + int vindex2 = idToIndexDict[rootId2]; + var pos1 = localPositions[vindex1]; + var pos2 = localPositions[vindex2]; + float dist = math.distance(pos1, pos2); + if (dist < lastDist * 1.5f) + { + loopConnection = true; + } + } + + + // debug + //Debug.Log($"rootTransformIdList.Count:{rootTransformIdList.Count}"); + //foreach (var rid in rootTransformIdList) + //{ + // Debug.Log($"[{rid}]"); + //} + } + + // 頂ç‚ı”¨ĉŽçĥšĉƒ…ċ ħä½œĉˆ + var linkList = new FixedList128Bytes[vcnt]; + var vertexLvList = new int[vcnt]; + var vertexRootIndex = new int[vcnt]; + var lvIndexList = new List>(); // ƒĴƒ™ƒĞ”¨ƒŞ‚ıƒˆ + var mainEdgeSet = new HashSet(); // ƒĦ‚¤ƒ³‚¨ƒƒ‚¸ + + // šƒˆƒİƒ³‚ıƒ•‚݃ĵƒ èĤŞċ­é–˘äż‚ĞĉŽçĥš + var stack = new Stack(vcnt); + var lvstack = new Stack(vcnt); + for (int i = 0; i < rootCnt; i++) + { + stack.Clear(); + stack.Push(rootTransformIdList[i]); // root id + lvstack.Clear(); + lvstack.Push(0); + + while (stack.Count > 0) + { + MagicaObjectId id = stack.Pop(); + int lv = lvstack.Pop(); + int vindex = idToIndexDict[id]; + var pos = localPositions[vindex]; + + if (lvIndexList.Count <= lv) + lvIndexList.Add(new FixedList512Bytes()); + var indexList = lvIndexList[lv]; + indexList.Add(vindex); + lvIndexList[lv] = indexList; + + var link = new FixedList128Bytes(); + + // parent + MagicaObjectId pid = rsetup.transformParentIdList[vindex]; + if (idToIndexDict.ContainsKey(pid)) + { + int vindex2 = idToIndexDict[pid]; + link.Add(vindex2); + + // main edge + uint mainEdge = DataUtility.Pack32Sort(vindex, vindex2); + mainEdgeSet.Add(mainEdge); + } + + // child + var clist = rsetup.transformChildIdList[vindex]; + if (clist.Length > 0) + { + for (int j = 0; j < clist.Length; j++) + { + MagicaObjectId cid = clist[j]; + stack.Push(cid); + lvstack.Push(lv + 1); + + int vindex2 = idToIndexDict[cid]; + link.Add(vindex2); + + // main edge + uint mainEdge = DataUtility.Pack32Sort(vindex, vindex2); + mainEdgeSet.Add(mainEdge); + } + } + + linkList[vindex] = link; + vertexLvList[vindex] = lv; + vertexRootIndex[vindex] = i; + } + } + + // debug + //foreach (var mainEdge in mainEdgeSet) + // Debug.Log($"mainEdge:{DataUtility.Unpack32Hi(mainEdge)} - {DataUtility.Unpack32Low(mainEdge)}"); + + // ĉĴĦĞċŒƒĴƒ™ƒĞĉ¨Ş‚’ĉŽçĥš™‚‹ + uint startEndRootIndexPack = DataUtility.Pack32Sort(firstRootIndex, lastRootIndex); + for (int i = 0; i < vcnt; i++) + { + int lv = vertexLvList[i]; + var lvList = lvIndexList[lv]; + var pos = localPositions[i]; + var link = linkList[i]; + var rootIndex = vertexRootIndex[i]; + + // šĉœ€èż‘ç‚ı‚’¤Ş’‚‹ + float firstDist = float.MaxValue; + int firstIndex = -1; + foreach (var vindex in lvList) + { + if (vindex == i) + continue; + + // 非ƒĞƒĵƒ—Ş‚‰°ċ§‹ç‚ı¨çµ‚ç‚ıƒĞƒĵƒˆƒİ‚¤ƒ³ŻĉŽçĥš—Ş„ + var rootIndex2 = vertexRootIndex[vindex]; + bool firstLast = startEndRootIndexPack == DataUtility.Pack32Sort(rootIndex, rootIndex2) && startEndRootIndexPack > 0; + if (loopConnection == false && firstLast) + continue; + + // 順ĉĴĦĉŽçĥšŞ‚‰è‡ŞèşĞċ‰ċŒƒĞƒĵƒˆƒİ‚¤ƒ³żĉŽçĥš + if (sequentialConnection && !(loopConnection && firstLast)) + { + + if (math.abs(rootIndex - rootIndex2) > 1) + continue; + } + + var pos2 = localPositions[vindex]; + float dist = math.distance(pos, pos2); + if (dist < firstDist) + { + firstDist = dist; + firstIndex = vindex; + } + } + if (firstIndex >= 0) + { + link.Add(firstIndex); + + // ĉĴĦĞĉœ€ċˆĞĉŽçĥš—Ÿè·é›˘ċ°‘—ċ¤§‚çŻ„ċ›²Ğ‚‚‹™ıĤé ‚ç‚ı‚’¤Ş’‚‹ + // Ÿ —é †ĉĴĦĉŽçĥšċ ´ċˆŻè·é›˘Żç„ĦèĤ–™‚‹ + firstDist = sequentialConnection ? float.MaxValue : firstDist * 1.5f; // 1.5f? + foreach (var vindex in lvList) + { + if (vindex == i || vindex == firstIndex) + continue; + + // 非ƒĞƒĵƒ—Ş‚‰°ċ§‹ç‚ı¨çµ‚ç‚ıƒĞƒĵƒˆƒİ‚¤ƒ³ŻĉŽçĥš—Ş„ + var rootIndex2 = vertexRootIndex[vindex]; + bool firstLast = startEndRootIndexPack == DataUtility.Pack32Sort(rootIndex, rootIndex2) && startEndRootIndexPack > 0; + if (loopConnection == false && firstLast) + continue; + + // 順ĉĴĦĉŽçĥšŞ‚‰è‡ŞèşĞċ‰ċŒƒĞƒĵƒˆƒİ‚¤ƒ³żĉŽçĥš + if (sequentialConnection && !(loopConnection && firstLast)) + { + if (math.abs(rootIndex - rootIndex2) > 1) + continue; + } + + var pos2 = localPositions[vindex]; + float dist = math.distance(pos, pos2); + if (dist <= firstDist) + { + link.Add(vindex); + } + } + } + + linkList[i] = link; + + // debug + //Debug.Log($"vindex:{i}, root:{vertexRootIndex[i]}, lv:{lv}, linkCount:{link.Length}"); + //for (int l = 0; l < link.Length; l++) + // Debug.Log($"->{link[l]}"); + } + + // 頂ç‚ıĉŽçĥšĉƒ…ċ ħ‹‚‰ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ‚’ċ½˘ĉˆ™‚‹ + var edgeSet = new HashSet(); + var triangleEdgeSet = new HashSet(); + var triangleSet = new HashSet(); + for (int i = 0; i < vcnt; i++) + { + var link = linkList[i]; + if (link.Length == 0) + { + Debug.LogError($"Connection 0! [{i}]"); + continue; + } + if (link.Length == 1) + { + // lineż + edgeSet.Add(DataUtility.PackInt2(i, link[0])); + } + else + { + // š‚¨ƒƒ‚¸¨—Ĥ™ıĤç™ğ録 + for (int j = 0; j < link.Length; j++) + { + int vindex1 = link[j]; + edgeSet.Add(DataUtility.PackInt2(i, vindex1)); + } + + int rootIndex = vertexRootIndex[i]; + + // ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞċ½˘ĉˆ + var pos = localPositions[i]; + for (int j = 0; j < link.Length - 1; j++) + { + int vindex1 = link[j]; + var pos1 = localPositions[vindex1]; + var v1 = pos1 - pos; + for (int k = j + 1; k < link.Length; k++) + { + int vindex2 = link[k]; + var pos2 = localPositions[vindex2]; + var v2 = pos2 - pos; + + // 頂ç‚ı位罁ŒċŒ˜ċş§ĉ¨™‚’考ĉ… + if (math.lengthsq(v1) < 1e-06f || math.lengthsq(v2) < 1e-06f) + continue; + + // ƒš‚˘è§’ċşĤŒä¸€ċšäğ上Ş‚‰°‚ı‚­ƒƒƒ—™‚‹ + var ang = math.degrees(MathUtility.Angle(v1, v2)); + if (ang >= Define.System.ProxyMeshBoneClothTriangleAngle) + continue; + + // ïĵ“¤ƒĞƒĵƒˆƒİ‚¤ƒ³ĞŸŒ‚‹ĉŽçĥšŻèĦŒ‚Ş„ + int rootIndex1 = vertexRootIndex[vindex1]; + int rootIndex2 = vertexRootIndex[vindex2]; + if (rootIndex1 != rootIndex && rootIndex2 != rootIndex && rootIndex1 != rootIndex2) + continue; + + // ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞŻïĵ‘¤äğ上ƒĦ‚¤ƒ³‚¨ƒƒ‚¸‚’ċĞ‚“§„Ş‘‚Œ°Ş‚‰Ş„ + int mainEdgeCount = 0; + mainEdgeCount += mainEdgeSet.Contains(DataUtility.Pack32Sort(i, vindex1)) ? 1 : 0; + mainEdgeCount += mainEdgeSet.Contains(DataUtility.Pack32Sort(i, vindex2)) ? 1 : 0; + mainEdgeCount += mainEdgeSet.Contains(DataUtility.Pack32Sort(vindex1, vindex2)) ? 1 : 0; + if (mainEdgeCount == 0) + continue; + + // ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ生ĉˆ + int3 tri = DataUtility.PackInt3(i, vindex1, vindex2); + + if (triangleSet.Contains(tri) == false) + { + //Debug.Log($"v:{i}, Tri:{tri}"); + triangleSet.Add(tri); + + // “ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ§ċˆİ用•‚ŒŸ‚¨ƒƒ‚¸‚’記録 + triangleEdgeSet.Add(DataUtility.PackInt2(i, vindex1)); + triangleEdgeSet.Add(DataUtility.PackInt2(i, vindex2)); + } + } + } + } + } + + // ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞç™ğ録 + if (triangleSet.Count > 0) + { + triangles = new ExSimpleNativeArray(triangleSet.Count); + int index = 0; + foreach (int3 tri in triangleSet) + { + //Debug.Log($"Tri:{tri}"); + triangles[index] = tri; + index++; + } + } + + // ƒİ‚¤ƒ³ç™ğ録 + // ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĞċˆİ用•‚ŒŞ‹£Ÿ‚¨ƒƒ‚¸żç™ğ録 + foreach (int2 edge in triangleEdgeSet) + { + edgeSet.Remove(edge); + } + if (edgeSet.Count > 0) + { + lines = new ExSimpleNativeArray(edgeSet.Count); + int index = 0; + foreach (int2 line in edgeSet) + { + //Debug.Log($"Line:{line}"); + lines[index] = line; + index++; + } + } + } + } + + [BurstCompile] + struct Import_BoneVertexJob : IJobParallelFor + { + public float4x4 WtoL; + public float4x4 LtoW; + + [Unity.Collections.ReadOnly] + public NativeArray transformPositions; + [Unity.Collections.ReadOnly] + public NativeArray transformRotations; + [Unity.Collections.ReadOnly] + public NativeArray transformScales; + + [Unity.Collections.WriteOnly] + public NativeArray localPositions; + [Unity.Collections.WriteOnly] + public NativeArray localNormals; + [Unity.Collections.WriteOnly] + public NativeArray localTangents; + [Unity.Collections.WriteOnly] + public NativeArray boneWeights; + [Unity.Collections.WriteOnly] + public NativeArray skinBoneBindPoses; + + public void Execute(int vindex) + { + // ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ċ§żċ‹˘ + float3 pos = transformPositions[vindex]; + quaternion rot = transformRotations[vindex]; + float3 scl = transformScales[vindex]; + + // ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ċ§żċ‹˘‚’‚Żƒ­‚ıƒ­ƒĵ‚ЃĞçİşé–“Ğċ¤‰ĉ›™‚‹ + // ‚ރނ¸ƒŠƒĞ +#if true + float3 lpos = MathUtility.InverseTransformPoint(pos, WtoL); + float3 lnor, ltan; + lnor = math.mul(rot, math.up()); + ltan = math.mul(rot, math.forward()); + lnor = MathUtility.InverseTransformDirection(lnor, WtoL); + ltan = MathUtility.InverseTransformDirection(ltan, WtoL); +#endif + //Debug.Log($"Import [{vindex}] lpos:{lpos}, lnor:{lnor}, ltan:{ltan}"); + + localPositions[vindex] = lpos; + localNormals[vindex] = lnor; + localTangents[vindex] = ltan; + + // bone weight + var bw = new VirtualMeshBoneWeight(new int4(vindex, 0, 0, 0), new float4(1, 0, 0, 0)); + boneWeights[vindex] = bw; + + // bind pose + var ltow = float4x4.TRS(pos, rot, scl); + var wtol = math.inverse(ltow); + var bindPose = math.mul(wtol, LtoW); + skinBoneBindPoses[vindex] = bindPose; + } + } + + + /// + /// ƒĴƒ³ƒ€ƒĵƒ‡ƒĵ‚ż‹‚‰‚¤ƒ³ƒƒĵƒˆ™‚‹ + /// + /// + public void ImportFrom(RenderData renderData, int uvChannel) + { + try + { + if (renderData == null) + { + result.SetError(Define.Result.VirtualMesh_InvalidRenderData); + throw new MagicaClothProcessingException(); + } + + ImportFrom(renderData.setupData, uvChannel); + } + catch (MagicaClothProcessingException) + { + if (result.IsError() == false) + result.SetError(Define.Result.VirtualMesh_ImportError); + throw; + } + catch (Exception) + { + //Debug.LogException(e); + result.SetError(Define.Result.VirtualMesh_ImportError); + throw; + } + } + + //========================================================================================= + /// + /// ‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚ż‚’‚‚¨ĞƒĦƒƒ‚·ƒ‚’ċˆ‡‚Šċ–‚‹ïĵˆ‚ıƒĴƒƒƒ‰ċŻïĵ‰ + /// ‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚żç§ğċ‹•ċħžĉ€§Ğċ½ħ響™‚‹ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞż‚’ĉ‘˜ċ‡ş™‚‹ + /// 結ĉžœçš„ĞƒĦƒƒ‚·ƒé ‚ç‚ıïĵƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĉ•°ŒïĵĞŞ‚‹ċ ´ċˆ‚‚‚‚‹§ĉ³¨ĉ„ïĵ + /// + /// + /// ‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚żċŸşĉş–ċ§żċ‹˘ + /// ĉ¤œç´˘è·é›˘ + public void SelectionMesh( + SelectionData selectionData, + float4x4 selectionLocalToWorldMatrix, + float mergin + ) + { + try + { + if (selectionData == null || selectionData.IsValid() == false) + { + result.SetError(Define.Result.VirtualMesh_InvalidSelection); + throw new MagicaClothProcessingException(); + } + + // ‚¸ƒ§ƒ–作ĉ­ç”¨ + int selectionCount = selectionData.Count; + using var selectionPositions = selectionData.GetPositionNativeArray(); + using var selectionAttribues = selectionData.GetAttributeNativeArray(); + + // ċş§ĉ¨™çİşé–“Œç•°Ş‚‹ċ ´ċˆŻ‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚ż‚’ƒĦƒƒ‚·ƒçİşé–“Ğċˆ‚›‚‹ + bool sameSpace = MathUtility.CompareMatrix(selectionLocalToWorldMatrix, initLocalToWorld); + if (sameSpace == false) + { + // ċş§ĉ¨™ċ¤‰ĉ› + var toM = MathUtility.Transform(selectionLocalToWorldMatrix, initWorldToLocal); + JobUtility.TransformPositionRun(selectionPositions, selectionCount, toM); + } + + //Develop.DebugLog($"sameSpace:{sameSpace}"); + Develop.DebugLog($"Selection.mergin:{mergin}"); + + // ‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚ż‚’配罁—Ÿ‚°ƒŞƒƒƒ‰ƒžƒƒƒ—‚’作ĉˆ™‚‹ + float gridSize = mergin * 1.0f; + using var gridMap = SelectionData.CreateGridMapRun(gridSize, selectionPositions, selectionAttribues, move: true, fix: true, ignore: true, invalid: false); + + // ç§ğċ‹•ƒ‚¤ƒ³ƒˆ‹‚‰ċˆİ用™‚‹ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ¨é ‚ç‚ıĉƒ…ċ ħ‚’選ċˆ™‚‹ + using var newTriangleList = new NativeList(TriangleCount, Allocator.Persistent); + using var newVertexRemapIndices = new NativeArray(VertexCount, Allocator.Persistent); + using var newVertexCount = new NativeReference(Allocator.Persistent); + var selectGridJob = new Select_GridJob() + { + gridSize = gridSize, + gridMap = gridMap.GetMultiHashMap(), + + selectionCount = selectionCount, + selectionPositions = selectionPositions, + selectionAttributes = selectionAttribues, + + vertexCount = VertexCount, + triangleCount = TriangleCount, + searchRadius = mergin, + meshPositions = localPositions.GetNativeArray(), + meshTriangles = triangles.GetNativeArray(), + + newTriangles = newTriangleList, + newVertexRemapIndices = newVertexRemapIndices, + newVertexCount = newVertexCount, + }; + selectGridJob.Run(); + + // 結ĉžœçš„Ğĉœ‰ċŠıŞé ‚ç‚ıŒĉ¸›£Ÿċ ´ċˆŻé ‚ç‚ıŠ‚ˆ³ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĉƒ…ċ ħ‚’ċ†ĉ§‹ç݉™‚‹ + if (newVertexCount.Value < VertexCount) + { + // 頂ç‚ıĉƒ…ċ ħ‚’ċ…‚Œĉ›żˆ‚‹ + int nvcnt = newVertexCount.Value; + var newReferenceIndices = new ExSimpleNativeArray(nvcnt); + var newAttributes = new ExSimpleNativeArray(nvcnt); + var newLocalPositions = new ExSimpleNativeArray(nvcnt); + var newLocalNormals = new ExSimpleNativeArray(nvcnt); + var newLocalTangents = new ExSimpleNativeArray(nvcnt); + var newUv = new ExSimpleNativeArray(nvcnt); + var newBoneWeights = new ExSimpleNativeArray(nvcnt); + + var packVertexJob = new Select_PackVertexJob() + { + vertexCount = VertexCount, + newVertexRemapIndices = newVertexRemapIndices, + + attributes = attributes.GetNativeArray(), + localPositions = localPositions.GetNativeArray(), + localNormals = localNormals.GetNativeArray(), + localTangents = localTangents.GetNativeArray(), + uv = uv.GetNativeArray(), + boneWeights = boneWeights.GetNativeArray(), + + newReferenceIndices = newReferenceIndices.GetNativeArray(), + newAttributes = newAttributes.GetNativeArray(), + newLocalPositions = newLocalPositions.GetNativeArray(), + newLocalNormals = newLocalNormals.GetNativeArray(), + newLocalTangents = newLocalTangents.GetNativeArray(), + newUv = newUv.GetNativeArray(), + newBoneWeights = newBoneWeights.GetNativeArray(), + + }; + packVertexJob.Run(); + + referenceIndices.Dispose(); + attributes.Dispose(); + localPositions.Dispose(); + localNormals.Dispose(); + localTangents.Dispose(); + uv.Dispose(); + boneWeights.Dispose(); + + referenceIndices = newReferenceIndices; + attributes = newAttributes; + localPositions = newLocalPositions; + localNormals = newLocalNormals; + localTangents = newLocalTangents; + uv = newUv; + boneWeights = newBoneWeights; + + // ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĉƒ…ċ ħ‚’ċ…‚Œĉ›żˆ‚‹ + var newTriangles = new ExSimpleNativeArray(newTriangleList); + triangles.Dispose(); + triangles = newTriangles; + } + } + catch (MagicaClothProcessingException) + { + if (result.IsError() == false) + result.SetError(Define.Result.VirtualMesh_SelectionUnknownError); + result.DebugLog(); + } + catch (Exception exception) + { + Debug.LogException(exception); + result.SetError(Define.Result.VirtualMesh_SelectionException); + } + finally + { + } + } + + [BurstCompile] + struct Select_PackVertexJob : IJob + { + public int vertexCount; + [Unity.Collections.ReadOnly] + public NativeArray newVertexRemapIndices; + + [Unity.Collections.ReadOnly] + public NativeArray attributes; + [Unity.Collections.ReadOnly] + public NativeArray localPositions; + [Unity.Collections.ReadOnly] + public NativeArray localNormals; + [Unity.Collections.ReadOnly] + public NativeArray localTangents; + [Unity.Collections.ReadOnly] + public NativeArray uv; + [Unity.Collections.ReadOnly] + public NativeArray boneWeights; + + [Unity.Collections.WriteOnly] + public NativeArray newReferenceIndices; + [Unity.Collections.WriteOnly] + public NativeArray newAttributes; + [Unity.Collections.WriteOnly] + public NativeArray newLocalPositions; + [Unity.Collections.WriteOnly] + public NativeArray newLocalNormals; + [Unity.Collections.WriteOnly] + public NativeArray newLocalTangents; + [Unity.Collections.WriteOnly] + public NativeArray newUv; + [Unity.Collections.WriteOnly] + public NativeArray newBoneWeights; + + public void Execute() + { + // 頂ç‚ıƒ‘ƒƒ‚­ƒ³‚° + for (int i = 0; i < vertexCount; i++) + { + int remapIndex = newVertexRemapIndices[i]; + if (remapIndex >= 0) + { + newReferenceIndices[remapIndex] = i; // ċ…ƒ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı + newAttributes[remapIndex] = attributes[i]; + newLocalPositions[remapIndex] = localPositions[i]; + newLocalNormals[remapIndex] = localNormals[i]; + newLocalTangents[remapIndex] = localTangents[i]; + newUv[remapIndex] = uv[i]; + newBoneWeights[remapIndex] = boneWeights[i]; + } + } + } + } + + [BurstCompile] + struct Select_GridJob : IJob + { + public float gridSize; + [Unity.Collections.ReadOnly] + public NativeParallelMultiHashMap gridMap; + + public int selectionCount; + [Unity.Collections.ReadOnly] + public NativeArray selectionPositions; + [Unity.Collections.ReadOnly] + public NativeArray selectionAttributes; + + public int vertexCount; + public int triangleCount; + public float searchRadius; + [Unity.Collections.ReadOnly] + public NativeArray meshPositions; + [Unity.Collections.ReadOnly] + public NativeArray meshTriangles; + + public NativeList newTriangles; + public NativeArray newVertexRemapIndices; + [Unity.Collections.WriteOnly] + public NativeReference newVertexCount; + + public void Execute() + { + // (1)ç§ğċ‹•ƒ‚¤ƒ³ƒˆä¸€ċšè·é›˘Ğ‚‚‹ƒĦƒƒ‚·ƒé ‚ç‚ı‚’ƒžƒĵ‚݁™‚‹ + for (int vindex = 0; vindex < vertexCount; vindex++) + { + var pos = meshPositions[vindex]; + var remapIndex = -1; + +#if true + // 範ċ›²‚°ƒŞƒƒƒ‰èµ°ĉŸğ + // 範ċ›²ċ†…Ğç„ĦċŠıäğċ¤–ƒ‚¤ƒ³ƒˆŒ‚‚‹ċ ´ċˆŻĉœ‰ċŠıĞŞ‚‹ + foreach (int3 grid in GridMap.GetArea(pos, searchRadius, gridMap, gridSize)) + { + if (gridMap.ContainsKey(grid) == false) + continue; + + // “‚°ƒŞƒƒƒ‰‚’ĉ¤œç´˘™‚‹ + foreach (int sindex in gridMap.GetValuesForKey(grid)) + { + // è·é›˘ċˆ¤ċš + float3 spos = selectionPositions[sindex]; + float dist = math.distance(pos, spos); + if (dist > searchRadius) + continue; + + // “é ‚ç‚ıŻċˆİ用™‚‹ + remapIndex = 1; + break; + } + + if (remapIndex >= 0) + break; + } +#endif +#if false + // 頂ç‚ıĞĉœ€‚‚èż‘„‚ğƒĴ‚Ż‚·ƒ§ƒ³ċħžĉ€§‚’èŞżı‚‹ + // (1)一ċšçŻ„ċ›²ċ†…Ğmove/fixed/ignoreŒ‚‚‹ċ ´ċˆŻċˆİ用™‚‹ + var nearAttr = VertexAttribute.Invalid; + float nearDist = float.MaxValue; + bool nearMove = false; // 一ċšçŻ„ċ›²ċ†…Ğç§ğċ‹•é ‚ç‚ıŒċ­˜ċœ¨™‚‹‹İ†‹ + // 範ċ›²‚°ƒŞƒƒƒ‰èµ°ĉŸğ + foreach (int3 grid in GridMap.GetArea(pos, searchRadius, gridMap, gridSize)) + { + if (gridMap.ContainsKey(grid) == false) + continue; + + // “‚°ƒŞƒƒƒ‰‚’ĉ¤œç´˘™‚‹ + foreach (int sindex in gridMap.GetValuesForKey(grid)) + { + // è·é›˘ċˆ¤ċš + float3 spos = selectionPositions[sindex]; + float dist = math.distance(pos, spos); + var attr = selectionAttributes[sindex]; + + // ĉœ€‚‚èż‘„ċħžĉ€§ + if (dist < nearDist) + { + nearDist = dist; + nearAttr = attr; + } + + // ç‰ıċšçŻ„ċ›²ċ†…Ğç§ğċ‹•ċħžĉ€§Œċ­˜ċœ¨™‚‹‹İ†‹ + if (dist <= searchRadius && attr.IsMove()) + { + nearMove = true; + } + } + } + // ĉœ€‚‚èż‘„ċħžĉ€§Ğ‚ˆ‚Šċˆİ用ċˆ¤ċš™‚‹ + if (nearAttr.IsInvalid() == false) + { + // move/fixed/ignoreŻċˆİ用™‚‹ + remapIndex = 1; + } + else + { + // ç„ĦċŠı頂ç‚ıċ ´ċˆŻä¸€ċšçŻ„ċ›²ċ†…Ğç§ğċ‹•é ‚ç‚ıŒ‚‚‹ċ ´ċˆżċ›şċš¨—Ĥċˆİ用™‚‹ + if (nearMove) + remapIndex = 1; + } +#endif + + newVertexRemapIndices[vindex] = remapIndex; + } + + // (2)ĉœ‰ċŠıŞé ‚ç‚ı‚’ċĞ‚€ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ‚’ĉ‘˜ċ‡ş™‚‹ + for (int tindex = 0; tindex < triangleCount; tindex++) + { + int3 tri = meshTriangles[tindex]; + if (newVertexRemapIndices[tri.x] >= 0 || newVertexRemapIndices[tri.y] >= 0 || newVertexRemapIndices[tri.z] >= 0) + { + // “ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞŻċˆİ用™‚‹ + newTriangles.Add(tri); + } + } + + // (3)ĉœ‰ċŠıƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ‚’ċˆİ用™‚‹é ‚ç‚ıĞä½żç”¨ƒ•ƒİ‚°‚’¤‘‚‹ + int ntcnt = newTriangles.Length; + for (int i = 0; i < ntcnt; i++) + { + int3 tri = newTriangles[i]; + + // 頂ç‚ıċˆİ用ƒžƒĵ‚Ż + newVertexRemapIndices[tri.x] = 1; + newVertexRemapIndices[tri.y] = 1; + newVertexRemapIndices[tri.z] = 1; + } + + // (4)ä½żç”¨é ‚ç‚ıƒŞƒžƒƒƒ—‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı‚’作ĉˆ™‚‹ + int newIndex = 0; + for (int i = 0; i < vertexCount; i++) + { + int remapIndex = newVertexRemapIndices[i]; + if (remapIndex >= 0) + { + // “é ‚ç‚ıŻä½żç”¨™‚‹ + newVertexRemapIndices[i] = newIndex; + newIndex++; + } + } + // ĉ‹£Ÿċˆİ用頂ç‚ıĉ•° + newVertexCount.Value = newIndex; + + // (5)ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ頂ç‚ı‚’ƒŞƒžƒƒƒ—™‚‹ + int newTriCount = newTriangles.Length; + for (int i = 0; i < newTriCount; i++) + { + int3 tri = newTriangles[i]; + tri.x = newVertexRemapIndices[tri.x]; + tri.y = newVertexRemapIndices[tri.y]; + tri.z = newVertexRemapIndices[tri.z]; + newTriangles[i] = tri; + } + } + } + + /// + /// çċœ¨ƒĦƒƒ‚·ƒĞċ݁—Ĥĉœ€éİŞ‚ğƒĴ‚Ż‚·ƒ§ƒ³ä½™ç™½è·é›˘‚’ç—ċ‡ş™‚‹ + /// + /// + /// + /// + public float CalcSelectionMergin(ReductionSettings settings) + { + float aveDist = averageVertexDistance.Value; + float reductionDist = 0; + if (settings != null && settings.IsEnabled) + { + reductionDist = boundingBox.Value.MaxSideLength * settings.GetMaxConnectionDistance(); + } + + // ċ¤§„ĉ–ı‚’ĉŽĦ用 + float mergin = math.max(aveDist, reductionDist); + + // ċ¤§‚Ğ™‚‹ + //mergin *= 2.0f; + mergin *= 1.5f; + + // ċ°‘—ċ°•™‚‹ + //mergin *= 0.7f; + + return mergin; + } + + + //========================================================================================= + /// + /// ƒĦƒƒ‚·ƒ‚’èż½ċŠ ™‚‹ïĵˆ‚ıƒĴƒƒƒ‰ċŻïĵ‰ + /// + /// + public void AddMesh(VirtualMesh cmesh) + { + try + { + if (IsError) + throw new InvalidOperationException(); + + if (cmesh == null || cmesh.IsSuccess == false || cmesh.IsError) + throw new InvalidOperationException(); + + // ċŸèĦŒċ‰çŠĥĉ…‹ + int skinBoneStart = SkinBoneCount; + int vertexStart = VertexCount; + int triangleStart = TriangleCount; + int lineStart = LineCount; + int transformStart = transformData.Count; + + // èż½ċŠ ƒĦƒƒ‚·ƒċş§ĉ¨™çİşé–“‚’ċ¤‰ĉ›™‚‹ƒžƒˆƒŞƒƒ‚Ż‚ı + float4x4 toM = cmesh.CenterTransformTo(this); + + // ‚ı‚­ƒ³ƒœƒĵƒ³ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ‚’ç™ğ録™‚‹ + int skinBoneCount = cmesh.SkinBoneCount; + skinBoneTransformIndices.AddRange(skinBoneCount); + for (int i = 0; i < skinBoneCount; i++) + { + int stindex = cmesh.skinBoneTransformIndices[i]; + // 重複‚’ċĵ„Ĥèż½ċŠ ™‚‹ + int tindex = transformData.AddTransform(cmesh.transformData, stindex, checkDuplicate: true); + skinBoneTransformIndices[skinBoneStart + i] = tindex; + } + + // 結ċˆçŻ„ċ›² + int vcnt = cmesh.VertexCount; + cmesh.mergeChunk = new DataChunk(VertexCount, vcnt); + + // 領ċŸŸç˘şäż + attributes.AddRange(vcnt); + localPositions.AddRange(vcnt); + localNormals.AddRange(vcnt); + localTangents.AddRange(vcnt); + uv.AddRange(vcnt); + boneWeights.AddRange(vcnt); + + // èż½ċŠ ƒĦƒƒ‚·ƒċş§ĉ¨™‚’èż½ċŠ ċ…ˆƒ­ƒĵ‚ЃĞçİşé–“Ğċ¤‰ĉ›—Ĥ‚³ƒ”ƒĵ™‚‹ + var copyVerticesJob = new Add_CopyVerticesJob() + { + vertexOffset = vertexStart, + skinBoneOffset = skinBoneStart, + + toM = toM, + + // èż½ċŠ ƒĦƒƒ‚·ƒ + srcAttributes = cmesh.attributes.GetNativeArray(), + srclocalPositions = cmesh.localPositions.GetNativeArray(), + srclocalNormals = cmesh.localNormals.GetNativeArray(), + srclocalTangents = cmesh.localTangents.GetNativeArray(), + srcUV = cmesh.uv.GetNativeArray(), + srcBoneWeights = cmesh.boneWeights.GetNativeArray(), + + // èż½ċŠ ċ…ˆ + dstAttributes = attributes.GetNativeArray(), + dstlocalPositions = localPositions.GetNativeArray(), + dstlocalNormals = localNormals.GetNativeArray(), + dstlocalTangents = localTangents.GetNativeArray(), + dstUV = uv.GetNativeArray(), + dstBoneWeights = boneWeights.GetNativeArray(), + dstSkinBoneIndices = skinBoneTransformIndices.GetNativeArray(), + }; + copyVerticesJob.Run(cmesh.VertexCount); + + + // skin bone bindpose + { + // “ƒĦƒƒ‚·ƒċş§ĉ¨™çİşé–“Ğċˆ‚›Ĥƒ‚¤ƒ³ƒ‰ƒƒĵ‚ş‚’ċ†è¨ˆç—™‚‹ + skinBoneBindPoses.AddRange(skinBoneCount); + var job = new Add_CalcBindPoseJob() + { + skinBoneOffset = skinBoneStart, + srcSkinBoneTransformIndices = cmesh.skinBoneTransformIndices.GetNativeArray(), + srcTransformPositionArray = cmesh.transformData.positionArray.GetNativeArray(), + srcTransformRotationArray = cmesh.transformData.rotationArray.GetNativeArray(), + srcTransformScaleArray = cmesh.transformData.scaleArray.GetNativeArray(), + dstCenterLocalToWorldMatrix = initLocalToWorld, + dstSkinBoneBindPoses = skinBoneBindPoses.GetNativeArray(), + }; + job.Run(skinBoneCount); + } + + // triangle + if (cmesh.TriangleCount > 0) + { + // add copy + triangles.AddRange(cmesh.TriangleCount); + var copyTriangleJob = new JobUtility.AddInt3DataCopyJob() + { + dstOffset = triangleStart, + addData = vertexStart, + srcData = cmesh.triangles.GetNativeArray(), + dstData = triangles.GetNativeArray(), + }; + copyTriangleJob.Run(cmesh.TriangleCount); + } + + // line + if (cmesh.LineCount > 0) + { + // add copy + lines.AddRange(cmesh.LineCount); + var copyLineJob = new JobUtility.AddInt2DataCopyJob() + { + dstOffset = lineStart, + addData = vertexStart, + srcData = cmesh.lines.GetNativeArray(), + dstData = lines.GetNativeArray(), + }; + copyLineJob.Run(cmesh.LineCount); + } + + // bounding box + // ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒçİşé–“Ğċ¤‰ĉ›—Ĥèż½ċŠ  + float3 bmin = cmesh.boundingBox.Value.Min; + float3 bmax = cmesh.boundingBox.Value.Max; + bmin = math.transform(toM, bmin); + bmax = math.transform(toM, bmax); + var aabb = new AABB(bmin, bmax); + if (boundingBox.IsCreated) + { + var bounds = boundingBox.Value; + bounds.Encapsulate(aabb); + boundingBox.Value = bounds; + } + else + boundingBox = new NativeReference(aabb, Allocator.Persistent); + //Develop.DebugLog($"merge boundingBox:{boundingBox.Value}"); + + // 頂ç‚ıé–“è·é›˘ + // ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒçİşé–“Ğċ¤‰ĉ›—ċ¤§„ĉ–ı‚’ĉŽĦ用™‚‹ + float scaleRatio = math.length(cmesh.initScale) / math.length(initScale); + //Debug.Log($"cmesh.initScale:{cmesh.initScale}, proxyMesh.initScale:{initScale}, scaleRatio:{scaleRatio}"); + averageVertexDistance.Value = math.max(averageVertexDistance.Value, cmesh.averageVertexDistance.Value * scaleRatio); + maxVertexDistance.Value = math.max(maxVertexDistance.Value, cmesh.maxVertexDistance.Value * scaleRatio); + + +#if false + // test + int maxBoneIndex = 0; + for (int i = 0; i < VertexCount; i++) + { + var bw = boneWeights[i]; + for (int j = 0; j < 4; j++) + { + if (bw.weights[j] > 0.0f) + maxBoneIndex = math.max(maxBoneIndex, bw.boneIndices[j]); + } + } + Debug.Log($"MaxBoneIndex:{maxBoneIndex}"); +#endif + } + catch (Exception e) + { + Debug.LogException(e); + result.SetError(); + throw; + } + finally + { + } + } + + /// + /// çİşé–“Œċ¤‰ĉ›´•‚ŒŸċ ´ċˆŻƒ‚¤ƒ³ƒ‰ƒƒĵ‚ş‚’ċ†è¨ˆç—™‚‹ + /// + [BurstCompile] + struct Add_CalcBindPoseJob : IJobParallelFor + { + public int skinBoneOffset; + + [Unity.Collections.ReadOnly] + public NativeArray srcSkinBoneTransformIndices; + [Unity.Collections.ReadOnly] + public NativeArray srcTransformPositionArray; + [Unity.Collections.ReadOnly] + public NativeArray srcTransformRotationArray; + [Unity.Collections.ReadOnly] + public NativeArray srcTransformScaleArray; + + public float4x4 dstCenterLocalToWorldMatrix; + + [NativeDisableParallelForRestriction] + [Unity.Collections.WriteOnly] + public NativeArray dstSkinBoneBindPoses; + + public void Execute(int boneIndex) + { + // çİşé–“Œċ¤‰ĉ›´•‚ŒŸċ ´ċˆŻƒ‚¤ƒ³ƒ‰ƒƒĵ‚ş‚’ċ†è¨ˆç—™‚‹ċż…èĤŒ‚‚‹ + int srcIndex = srcSkinBoneTransformIndices[boneIndex]; + var tpos = srcTransformPositionArray[srcIndex]; + var trot = srcTransformRotationArray[srcIndex]; + var tscl = srcTransformScaleArray[srcIndex]; + + var ltow = float4x4.TRS(tpos, trot, tscl); + var wtol = math.inverse(ltow); + + var bindPose = math.mul(wtol, dstCenterLocalToWorldMatrix); + dstSkinBoneBindPoses[skinBoneOffset + boneIndex] = bindPose; + } + } + + /// + /// 頂ç‚ıƒ‡ƒĵ‚ż‚’ĉ–°—„é ˜ċŸŸĞ‚³ƒ”ƒĵ™‚‹ + /// + [BurstCompile] + struct Add_CopyVerticesJob : IJobParallelFor + { + public int vertexOffset; + public int skinBoneOffset; + + // ċş§ĉ¨™çİşé–“ċ¤‰ĉ› + //public int same; // èż½ċŠ ċ…ˆ¨ċŒ˜çİşé–“Ş‚‰(1) + public float4x4 toM; + + // src + //[Unity.Collections.ReadOnly] + //public NativeArray srcFlags; + [Unity.Collections.ReadOnly] + public NativeArray srcAttributes; + //[Unity.Collections.ReadOnly] + //public NativeArray srcWorldPositions; + //[Unity.Collections.ReadOnly] + //public NativeArray srcWorldRotations; + [Unity.Collections.ReadOnly] + public NativeArray srclocalPositions; + [Unity.Collections.ReadOnly] + public NativeArray srclocalNormals; + [Unity.Collections.ReadOnly] + public NativeArray srclocalTangents; + [Unity.Collections.ReadOnly] + public NativeArray srcUV; + [Unity.Collections.ReadOnly] + public NativeArray srcBoneWeights; + + // dst + //[NativeDisableParallelForRestriction] + //[Unity.Collections.WriteOnly] + //public NativeArray dstFlags; + [NativeDisableParallelForRestriction] + [Unity.Collections.WriteOnly] + public NativeArray dstAttributes; + [NativeDisableParallelForRestriction] + [Unity.Collections.WriteOnly] + public NativeArray dstlocalPositions; + [NativeDisableParallelForRestriction] + [Unity.Collections.WriteOnly] + public NativeArray dstlocalNormals; + [NativeDisableParallelForRestriction] + [Unity.Collections.WriteOnly] + public NativeArray dstlocalTangents; + [NativeDisableParallelForRestriction] + [Unity.Collections.WriteOnly] + public NativeArray dstUV; + [NativeDisableParallelForRestriction] + [Unity.Collections.WriteOnly] + public NativeArray dstBoneWeights; + [Unity.Collections.ReadOnly] + public NativeArray dstSkinBoneIndices; + + public void Execute(int vindex) + { + int dindex = vertexOffset + vindex; + + // positin / normal + //float3 wpos = srcWorldPositions[vindex]; + //quaternion wrot = srcWorldRotations[vindex]; + //float3 wnor = MathUtility.ToNormal(wrot); + //float3 wtan = MathUtility.ToTangent(wrot); + float3 lpos = srclocalPositions[vindex]; + float3 lnor = srclocalNormals[vindex]; + float3 ltan = srclocalTangents[vindex]; + //if (same == 0) + //{ + // // ċş§ĉ¨™çİşé–“Œç•°Ş‚‹§‚³ƒ³ƒƒĵƒˆ™‚‹ + // lpos = MathUtility.TransformPoint(lpos, toM); + // lnor = MathUtility.TransformDirection(lnor, toM); + // ltan = MathUtility.TransformDirection(ltan, toM); + //} + + // ƒ­ƒĵ‚ЃĞċ¤‰ĉ› + //float3 lpos = MathUtility.TransformPoint(wpos, toM); + //float3 lnor = MathUtility.TransformDirection(wnor, toM); + //float3 ltan = MathUtility.TransformDirection(wtan, toM); + + // ċş§ĉ¨™çİşé–“ċ¤‰ĉ› + lpos = MathUtility.TransformPoint(lpos, toM); + lnor = MathUtility.TransformDirection(lnor, toM); + ltan = MathUtility.TransformDirection(ltan, toM); + + dstlocalPositions[dindex] = lpos; + dstlocalNormals[dindex] = lnor; + dstlocalTangents[dindex] = ltan; + dstUV[dindex] = srcUV[vindex]; + + // boneWeights + if (vindex < srcBoneWeights.Length) + { + var bw = srcBoneWeights[vindex]; + bw.boneIndices += skinBoneOffset; + + // boneIndexé‡è¤‡ŒŞ„‚ˆ†Ğ‚ˆ‚Šè‹„‚¤ƒ³ƒ‡ƒƒ‚Ż‚ıĞ組żĉ›żˆ‚‹ + for (int i = 0; i < 4; i++) + { + if (bw.weights[i] < 1e-06f) + continue; + + int bindex = bw.boneIndices[i]; + int tindex = dstSkinBoneIndices[bindex]; + for (int j = 0; j < bindex; j++) + { + if (dstSkinBoneIndices[j] == tindex) + { + // 組żĉ›ˆ + bw.boneIndices[i] = j; + break; + } + } + } + + dstBoneWeights[dindex] = bw; + } + + // attribute + dstAttributes[dindex] = srcAttributes[vindex]; + + // flag + //dstFlags[dindex] = srcFlags[vindex]; + } + } + + //========================================================================================= + /// + /// ƒĦƒƒ‚·ƒċŸşĉş–ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ‚’設ċš™‚‹ïĵˆƒĦ‚¤ƒ³‚ıƒĴƒƒƒ‰żïĵ‰ + /// + /// + /// 不èĤŞ‚‰null + /// 不èĤŞ‚‰Invalid + /// 不èĤŞ‚‰Invalid + //public void SetTransform(Transform center, Transform skinRoot = null, int centerId = 0, int skinRootId = 0) + public void SetTransform(Transform center, Transform skinRoot, MagicaObjectId centerId, MagicaObjectId skinRootId) + { + SetCenterTransform(center, centerId); + if (skinRoot != null) + SetSkinRoot(skinRoot, skinRootId); + else + SetSkinRoot(center, centerId); + + // ċŸşĉş–ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ĉƒ…ċ ħ‚’記録 + initLocalToWorld = center.localToWorldMatrix; + initWorldToLocal = math.inverse(initLocalToWorld); + initRotation = center.rotation; + initInverseRotation = math.inverse(initRotation); + initScale = center.lossyScale; + } + + /// + /// ƒĴ‚³ƒĵƒ‰ĉƒ…ċ ħ‹‚‰ƒĦƒƒ‚·ƒċŸşĉş–ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ‚’設ċš™‚‹ïĵˆ‚ıƒĴƒƒƒ‰ċŻïĵ‰ + /// + /// + public void SetTransform(TransformRecord centerRecord, TransformRecord skinRootRecord = null) + { + centerTransformIndex = transformData.AddTransform(centerRecord, MagicaObjectId.Invalid); + if (skinRootRecord != null) + skinRootIndex = transformData.AddTransform(skinRootRecord, MagicaObjectId.Invalid); + else + skinRootIndex = centerTransformIndex; + + // ċŸşĉş–ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ĉƒ…ċ ħ‚’記録 + initLocalToWorld = centerRecord.localToWorldMatrix; + initWorldToLocal = centerRecord.worldToLocalMatrix; + initRotation = centerRecord.rotation; + initInverseRotation = math.inverse(initRotation); + initScale = centerRecord.scale; + } + + //public void SetCenterTransform(Transform t, int tid = 0) + public void SetCenterTransform(Transform t, MagicaObjectId tid) + { + if (t) + { + // ™§Ğċ­˜ċœ¨™‚‹ċ ´ċˆŻċ…‚Œĉ›żˆ + if (centerTransformIndex >= 0) + { + transformData.ReplaceTransform(centerTransformIndex, t, tid, MagicaObjectId.Invalid); + } + else + { + centerTransformIndex = transformData.AddTransform(t, tid, MagicaObjectId.Invalid); + } + } + } + + //public void SetSkinRoot(Transform t, int tid = 0) + public void SetSkinRoot(Transform t, MagicaObjectId tid) + { + if (t) + { + // ™§Ğċ­˜ċœ¨™‚‹ċ ´ċˆŻċ…‚Œĉ›żˆ + if (skinRootIndex >= 0) + { + transformData.ReplaceTransform(skinRootIndex, t, tid, MagicaObjectId.Invalid); + } + else + { + skinRootIndex = transformData.AddTransform(t, tid, MagicaObjectId.Invalid); + } + } + } + + public Transform GetCenterTransform() + { + return transformData.GetTransformFromIndex(centerTransformIndex); + } + + /// + /// ‚Ğ‚ı‚żƒ ‚ı‚­ƒ‹ƒ³‚°ç”¨ƒœƒĵƒ³‚’ç™ğ録™‚‹ + /// + /// + public void SetCustomSkinningBones(TransformRecord clothTransformRecord, List bones) + { + if (bones == null || bones.Count == 0) + return; + + customSkinningBoneIndices = new int[bones.Count]; + for (int i = 0; i < bones.Count; i++) + { + var rd = bones[i]; + int index = -1; + if (rd.IsValid()) + { + // ‚Żƒ­‚ıƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ƒ­ƒĵ‚ЃĞçİşé–“Ğċ¤‰ĉ›—Ĥç™ğ録™‚‹ + rd.localPosition = clothTransformRecord.worldToLocalMatrix.MultiplyPoint(rd.position); + + // ƒœƒĵƒ³ç™ğ録€‚‚ı‚­ƒ‹ƒ³‚°ç”¨ƒœƒĵƒ³¨—Ĥ‚‚ç™ğ録€‚ + index = skinBoneTransformIndices.Count; + int tindex = transformData.AddTransform(rd, pid: MagicaObjectId.Invalid, checkDuplicate: false); // 重複‚‚Ё§ĉœ€ċŒĞèż½ċŠ ™‚‹ + skinBoneTransformIndices.Add(tindex); + var bindPose = math.mul(rd.worldToLocalMatrix, initLocalToWorld); // bind pose + skinBoneBindPoses.Add(bindPose); + } + customSkinningBoneIndices[i] = index; + } + } + + /// + /// “ƒĦƒƒ‚·ƒ¨ċŻèħĦƒĦƒƒ‚·ƒċş§ĉ¨™çİşé–“ŒċŒ˜‹ċˆ¤ċš™‚‹ + /// “‚ŒŻ‚Œž‚ŒċˆĉœŸċŒ–ĉ™‚ƒžƒˆƒŞƒƒ‚Ż‚ı§ĉŻ”èĵƒ•‚Œ‚‹ + /// + /// + /// + public bool CompareSpace(VirtualMesh target) + { + return MathUtility.CompareMatrix(initLocalToWorld, target.initLocalToWorld); + } + + /// + /// “ƒĦƒƒ‚·ƒċş§ĉ¨™çİşé–“‚’toƒĦƒƒ‚·ƒċş§ĉ¨™çİşé–“Ğċ¤‰ĉ›™‚‹ƒžƒˆƒŞƒƒ‚Ż‚ı‚’èż”™ + /// “‚ŒŻ‚Œž‚ŒċˆĉœŸċŒ–ĉ™‚ƒžƒˆƒŞƒƒ‚Ż‚ı§è¨ˆç—•‚Œ‚‹ + /// + /// + /// + public float4x4 CenterTransformTo(VirtualMesh to) + { + bool sameSpace = CompareSpace(to); + return sameSpace ? float4x4.identity : MathUtility.Transform(initLocalToWorld, to.initWorldToLocal); + } + + //========================================================================================= +#if false + /// + /// UnityMeshĞċ‡şċŠ›™‚‹ïĵˆƒĦ‚¤ƒ³‚ıƒĴƒƒƒ‰żïĵ‰ + /// â€ğğĵƒ‡ƒƒƒ‚°ç”¨ + /// + /// + public Mesh ExportToMesh(bool buildSkinning = false, bool recalculationNormals = false, bool recalculationBounds = true) + { + Debug.Assert(IsSuccess); + + var mesh = new Mesh(); + mesh.MarkDynamic(); + + // vertices + var newVertices = new Vector3[VertexCount]; + var newNormals = new Vector3[VertexCount]; + localPositions.CopyTo(newVertices); + localNormals.CopyTo(newNormals); + + // ĉŽç·šŻw‚’(-1)Ğ—Ĥĉ›¸èĵ‚€ + using var tangentArray = new NativeArray(VertexCount, Allocator.TempJob); + JobUtility.FillRun(tangentArray, VertexCount, new Vector4(0, 0, 0, -1)); + var newTangents = tangentArray.ToArray(); + localTangents.CopyToWithTypeChangeStride(newTangents); // float3[] -> Vector4[]‚³ƒ”ƒĵ + + mesh.vertices = newVertices; + if (recalculationNormals == false) + mesh.normals = newNormals; + mesh.tangents = newTangents; + + // dymmy uv + var newUvs = new Vector2[VertexCount]; + uv.CopyTo(newUvs); // 一ċżœ‚³ƒ”ƒĵïĵˆVirtualMeshUVŻTangent計ç—用€ƒ†‚Ż‚ıƒƒ£ƒžƒƒƒ”ƒ³‚°ç”¨§ŻŞ„ïĵ‰ + mesh.uv = newUvs; + + // triangle + if (TriangleCount > 0) + { + var newTriangles = new int[TriangleCount * 3]; + triangles.CopyToWithTypeChange(newTriangles); + mesh.triangles = newTriangles; + } + + // skinning + if (buildSkinning) + { + // bone weight + var newBoneWeights = new BoneWeight[VertexCount]; + boneWeights.CopyTo(newBoneWeights); + mesh.boneWeights = newBoneWeights; + + // bind poses + var newBindPoses = new Matrix4x4[SkinBoneCount]; + skinBoneBindPoses.CopyTo(newBindPoses); + mesh.bindposes = newBindPoses; + } + + if (recalculationNormals) + mesh.RecalculateNormals(); + //mesh.RecalculateTangents(); + if (recalculationBounds) + mesh.RecalculateBounds(); + + + return mesh; + } +#endif + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshInputOutput.cs.meta b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshInputOutput.cs.meta new file mode 100644 index 00000000..7ff557e7 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshInputOutput.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 3acc8678caf149b42977b7b3d3e8079b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshInputOutput.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshMapping.cs b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshMapping.cs new file mode 100644 index 00000000..9b069fb6 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshMapping.cs @@ -0,0 +1,710 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System; +using Unity.Burst; +using Unity.Collections; +using Unity.Jobs; +using Unity.Mathematics; +using UnityEngine; + +namespace MagicaCloth2 +{ + public partial class VirtualMesh + { + struct MappingWorkData + { + public float3 position; + public int vertexIndex; + public int proxyVertexIndex; + public float proxyVertexDistance; + } + + /// + /// ƒĦƒƒ‚·ƒ‚’ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒĞƒžƒƒƒ”ƒ³‚°™‚‹ïĵˆ‚ıƒĴƒƒƒ‰ċŻïĵ‰ + /// + /// + public void Mapping(VirtualMesh proxyMesh) + { + try + { + if (IsError) + { + throw new MagicaClothProcessingException(); + } + + if (proxyMesh == null || proxyMesh.IsSuccess == false) + { + result.SetError(Define.Result.MappingMesh_ProxyError); + throw new MagicaClothProcessingException(); + } + + // ċ‡Ĥ理中Ğċˆ‡‚Šĉ›żˆ + result.SetProcess(); + + // “ƒžƒƒƒ”ƒ³‚°ƒĦƒƒ‚·ƒƒ­ƒĵ‚ЃĞċş§ĉ¨™‚’ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒçİşé–“Ğċ¤‰ĉ›™‚‹ƒžƒˆƒŞƒƒ‚Ż‚ı‚’ĉħ‚‚‚‹ + var toP = CenterTransformTo(proxyMesh); + + // 頂ç‚ı‚’ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒİé ‚ç‚ıĞƒžƒƒƒ”ƒ³‚°™ı‹ĉƒ…ċ ħ + using var mappingWorkData = new NativeArray(VertexCount, Allocator.Persistent); + + if (mergeChunk.IsValid) + { + // ■ƒ€‚¤ƒĴ‚Żƒˆƒžƒƒƒ”ƒ³‚°ïĵˆƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒĞċˆİ用•‚ŒŸƒĦƒƒ‚·ƒċ ´ċˆïĵ‰ + // ƒŞƒ€‚Ż‚·ƒ§ƒ³çµĉžœ‹‚‰ĉŽçĥš™‚‹§ç˘şċŸ§é€Ÿ„ïĵ + Develop.DebugLog($"Direct Mappingïĵ"); + var directConnectionJob = new Mapping_DirectConnectionVertexDataJob() + { + toP = toP, + vcnt = VertexCount, + mergeChunk = mergeChunk, + localPositions = localPositions.GetNativeArray(), + attributes = attributes.GetNativeArray(), + + joinIndices = proxyMesh.joinIndices, + proxyAttributes = proxyMesh.attributes.GetNativeArray(), + proxyLocalPositions = proxyMesh.localPositions.GetNativeArray(), + + mappingWorkData = mappingWorkData, + }; + directConnectionJob.Run(); + + // 頂ç‚ıƒžƒƒƒ”ƒ³‚° + // ċı³ċ‡ĉŽçĥšè·é›˘ + var avgDist = proxyMesh.averageVertexDistance.Value; + float weightLength = avgDist * 1.5f; + //Debug.Log($"avgDist:{avgDist}, weightLength:{weightLength}"); + using var useSet = new NativeParallelHashSet(1024, Allocator.Persistent); // Unity2023.1.5ċŻċżœ + var calcDirectWeightJob = new Mapping_CalcDirectWeightJob() + { + vcnt = mappingWorkData.Length, + weightLength = weightLength, + mappingWorkData = mappingWorkData, + + attributes = attributes.GetNativeArray(), + boneWeights = boneWeights.GetNativeArray(), + + proxyLocalPositions = proxyMesh.localPositions.GetNativeArray(), + proxyVertexToVertexIndexArray = proxyMesh.vertexToVertexIndexArray, + proxyVertexToVertexDataArray = proxyMesh.vertexToVertexDataArray, + + useSet = useSet, // Unity2023.1.5ċŻċżœ + }; + calcDirectWeightJob.Run(); + } + else + { + // ■ ĉ¤œç´˘ƒžƒƒƒ”ƒ³‚°€‚“‚ŒŻç²ċşĤŒĉ‚ށ„§ĉ³¨ĉ„ïĵ + // ĉ¤œç´˘ċŠċ„ + // “‚ŒŻƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒċş§ĉ¨™çİşé–“§é•·•¨Ş‚‹ + float averageDistance = MathUtility.TransformLength(averageVertexDistance.Value, toP); + averageDistance = math.max(averageDistance, Define.System.MinimumGridSize); + float searchRadius = averageDistance * 2.5f; // test(2.0?) + Develop.DebugLog($"Search Mapping! searchRadius:{searchRadius}"); + + // ƒ—ƒ­‚­‚·é ‚ç‚ı‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı‚’ĉ ĵ納—Ÿ‚°ƒŞƒƒƒ‰ƒžƒƒƒ—‚’作ĉˆ™‚‹ + float gridSize = averageDistance * 1.5f; + using var gridMap = proxyMesh.CreateVertexIndexGridMapRun(gridSize); + + // 頂ç‚ı‚’ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒİé ‚ç‚ıĞƒžƒƒƒ”ƒ³‚°™ı‹ċˆ¤ċš™‚‹ + var calcVertexDataJob = new Mapping_CalcConnectionVertexDataJob() + { + gridSize = gridSize, + searchRadius = searchRadius, + + toP = toP, + vcnt = VertexCount, + localPositions = localPositions.GetNativeArray(), + boneWeights = boneWeights.GetNativeArray(), + transformIds = transformData.idArray.GetNativeArray(), + attributes = attributes.GetNativeArray(), + + gridMap = gridMap.GetMultiHashMap(), + proxyAttributes = proxyMesh.attributes.GetNativeArray(), + proxyLocalPositions = proxyMesh.localPositions.GetNativeArray(), + proxyBoneWeights = proxyMesh.boneWeights.GetNativeArray(), + proxyTransformIds = proxyMesh.transformData.idArray.GetNativeArray(), + + mappingWorkData = mappingWorkData, + }; + calcVertexDataJob.Run(); + + // 頂ç‚ı‚’ƒžƒƒƒ”ƒ³‚°™‚‹ + if (mappingWorkData.Length > 0) + { + var calcWeightJob = new Mapping_CalcWeightJob() + { + mappingWorkData = mappingWorkData, + attributes = attributes.GetNativeArray(), + boneWeights = boneWeights.GetNativeArray(), + + proxyAttributes = proxyMesh.attributes.GetNativeArray(), + proxyLocalPositions = proxyMesh.localPositions.GetNativeArray(), + proxyLocalNormals = proxyMesh.localNormals.GetNativeArray(), + proxyVertexToVertexIndexArray = proxyMesh.vertexToVertexIndexArray, + proxyVertexToVertexDataArray = proxyMesh.vertexToVertexDataArray, + }; + calcWeightJob.Run(mappingWorkData.Length); + } + } + + // ĉŽçĥšƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒ + mappingProxyMesh = proxyMesh; + + // ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒ¸ċ¤‰ĉ›ƒžƒˆƒŞƒƒ‚Ż‚ı‚’記録 + toProxyMatrix = toP; + toProxyRotation = math.mul(proxyMesh.initInverseRotation, initRotation); + + // ƒĦƒƒ‚·ƒ‚ż‚¤ƒ— + meshType = MeshType.Mapping; + + // ċŒäş† + result.SetSuccess(); + } + catch (MagicaClothProcessingException) + { + if (result.IsError() == false) + result.SetError(Define.Result.MappingMesh_UnknownError); + result.DebugLog(); + } + catch (Exception exception) + { + Debug.LogException(exception); + result.SetError(Define.Result.MappingMesh_Exception); + } + } + + [BurstCompile] + struct Mapping_DirectConnectionVertexDataJob : IJob + { + // render meshċş§ĉ¨™‚’proxyƒ­ƒĵ‚ЃĞçİşé–“Ğċ¤‰ĉ›™‚‹Transform + public float4x4 toP; + + // render mesh + public int vcnt; + public DataChunk mergeChunk; + [Unity.Collections.ReadOnly] + public NativeArray localPositions; + [Unity.Collections.WriteOnly] + public NativeArray attributes; + + // proxy mesh + [Unity.Collections.ReadOnly] + public NativeArray joinIndices; + [Unity.Collections.ReadOnly] + public NativeArray proxyAttributes; + [Unity.Collections.ReadOnly] + public NativeArray proxyLocalPositions; + + // out + [Unity.Collections.WriteOnly] + public NativeArray mappingWorkData; + + public void Execute() + { + for (int vindex = 0; vindex < vcnt; vindex++) + { + // ĉŽçĥšƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒé ‚ç‚ı‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı + int proxyVertexIndex = joinIndices[mergeChunk.startIndex + vindex]; + + // ƒ—ƒ­‚­‚·é ‚ç‚ıċħžĉ€§ + var proxyAttr = proxyAttributes[proxyVertexIndex]; + + // ƒ—ƒ­‚­‚·é ‚ç‚ıŒç„ĦċŠıŞ‚‰°ƒžƒƒƒ”ƒ³‚°—Ş„ + if (proxyAttr.IsInvalid()) + { + // 頂ç‚ıċħžĉ€§‚’ç„ĦċŠı¨—Ĥƒžƒĵ‚݁™‚‹ + attributes[vindex] = VertexAttribute.Invalid; + continue; + } + + // 頂ç‚ı‚’記録 + // ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒċş§ĉ¨™çİşé–“Ğċ¤‰ĉ›™‚‹ + float3 pos = MathUtility.TransformPoint(localPositions[vindex], toP); + + float3 proxyPos = proxyLocalPositions[proxyVertexIndex]; + + var wdata = new MappingWorkData() + { + position = pos, + vertexIndex = vindex, + proxyVertexIndex = proxyVertexIndex, + proxyVertexDistance = math.distance(pos, proxyPos), + }; + mappingWorkData[vindex] = wdata; + attributes[vindex] = proxyAttr; + } + } + } + + [BurstCompile] + struct Mapping_CalcDirectWeightJob : IJob + { + // data + public int vcnt; + public float weightLength; + [Unity.Collections.ReadOnly] + public NativeArray mappingWorkData; + + // render mesh + [Unity.Collections.ReadOnly] + public NativeArray attributes; + [Unity.Collections.WriteOnly] + public NativeArray boneWeights; + + // proxy + [Unity.Collections.ReadOnly] + public NativeArray proxyLocalPositions; + [Unity.Collections.ReadOnly] + public NativeArray proxyVertexToVertexIndexArray; + [Unity.Collections.ReadOnly] + public NativeArray proxyVertexToVertexDataArray; + + public NativeParallelHashSet useSet; // Unity2023.1.5ċŻċżœ + + public void Execute() + { + // ċ‡Ĥ理ĉ¸ˆż‚ğƒƒƒˆ + //var useSet = new NativeParallelHashSet(1024, Allocator.Temp); // Unity2023.1.5ċŻċżœ + var stack = new FixedList4096Bytes(); + + for (int vindex = 0; vindex < vcnt; vindex++) + { + // ™§ĞInvalidŞ‚‰ç„ĦċŠı + if (attributes[vindex].IsInvalid()) + continue; + + var wdata = mappingWorkData[vindex]; + ushort pindex = (ushort)wdata.proxyVertexIndex; + + useSet.Clear(); + stack.Clear(); + + // ‚Ĥ‚¨‚¤ƒˆƒƒƒƒ•‚Ħ + var weights = new ExCostSortedList4(-1); + + stack.MC2Push(pindex); + while (stack.IsEmpty == false) + { + pindex = stack.MC2Pop(); + + if (useSet.Contains(pindex)) + continue; + useSet.Add(pindex); + + // è·é›˘ƒ‚§ƒƒ‚Ż + float dist = math.distance(wdata.position, proxyLocalPositions[pindex]); + if (dist > weightLength) + continue; + + // ‚Ĥ‚¨‚¤ƒˆç—ċ‡ş + const float weightPow = 3.0f; + //float w = Mathf.Clamp01((1.0f - dist / weightLength) + 0.001f); + float w = Mathf.Clamp01(1.0f - dist / weightLength); + w = Mathf.Pow(w, weightPow); // powƒ‡ƒ•‚݃ЃˆŻ(3.0) + weights.Add(1.0f - w, pindex); // ExCostSortedList4Żĉ˜‡é †ĉ ĵ納Ş§ä¸€ĉ—Ĥ1.0‹‚‰ċĵ• + + // ĉĴĦĉŽçĥš + DataUtility.Unpack12_20(proxyVertexToVertexIndexArray[pindex], out var dcnt, out var dstart); + for (int i = 0; i < dcnt && stack.MC2IsCapacity() == false; i++) + { + ushort tindex = proxyVertexToVertexDataArray[dstart + i]; + + if (useSet.Contains(tindex)) + continue; + + // è·é›˘ƒ‚§ƒƒ‚Ż + dist = math.distance(wdata.position, proxyLocalPositions[tindex]); + if (dist > weightLength) + continue; + + stack.MC2Push(tindex); + } + } + + if (weights.Count == 0) + { + // 何‚‚ĉŽçĥšċ‡şĉŞ„ċ ´ċˆŻƒ‡ƒ•‚݃Ѓˆƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒé ‚ç‚ı‚’‚Ĥ‚¨‚¤ƒˆ100%§ĉŽçĥš•›‚‹ + weights.Add(1.0f, pindex); + } + else + { + // ‚Ĥ‚¨‚¤ƒˆ‚’ċˆè¨ˆïĵ‘ĞèŞżĉ•´™‚‹ + int wcnt = weights.Count; + for (int i = 0; i < 4; i++) + { + if (i < wcnt) + { + // ExCostSortedList4Żĉ˜‡é †ĉ ĵ納Ş§‚‚¨Ğĉˆğ™ + weights.costs[i] = 1.0f - weights.costs[i]; + } + else + { + weights.costs[i] = 0; + weights.data[i] = 0; + } + } + float total = math.csum(weights.costs); + + // ™ıĤé ‚ç‚ıŒweightLengthċ ´ċˆŻċˆè¨ˆ‚Ĥ‚¨‚¤ƒˆïĵŒ‚‚Šċ—‚‹§ç‰ıċˆĞċı³ċ‡ċŒ–™‚‹ + if (total == 0.0f) + { + float w = 1.0f / wcnt; + for (int i = 0; i < wcnt; i++) + weights.costs[i] = w; + } + else + weights.costs = math.saturate(weights.costs / total); + } + + // ‚Ĥ‚¨‚¤ƒˆĉ ĵ納 + boneWeights[vindex] = new VirtualMeshBoneWeight(weights.data, weights.costs); + } + } + } + + /// + /// 頂ç‚ı”¨Ğproxy頂ç‚ı‚’ĉ¤œç´˘—‚Ĥ‚¨‚¤ƒˆç—ċ‡ş—boneWeightsĞĉ ĵ納™‚‹ + /// + [BurstCompile] + struct Mapping_CalcConnectionVertexDataJob : IJob + { + public float gridSize; + public float searchRadius; + + // vmeshċş§ĉ¨™‚’proxyƒ­ƒĵ‚ЃĞçİşé–“Ğċ¤‰ĉ›™‚‹Transform + public float4x4 toP; + + // vmesh + public int vcnt; + [Unity.Collections.ReadOnly] + public NativeArray localPositions; + [Unity.Collections.ReadOnly] + public NativeArray boneWeights; + [Unity.Collections.ReadOnly] + public NativeArray transformIds; + [Unity.Collections.WriteOnly] + public NativeArray attributes; + + // proxy vmesh + [Unity.Collections.ReadOnly] + public NativeParallelMultiHashMap gridMap; + [Unity.Collections.ReadOnly] + public NativeArray proxyAttributes; + [Unity.Collections.ReadOnly] + public NativeArray proxyLocalPositions; + [Unity.Collections.ReadOnly] + public NativeArray proxyBoneWeights; + [Unity.Collections.ReadOnly] + public NativeArray proxyTransformIds; + + // out + [Unity.Collections.WriteOnly] + public NativeArray mappingWorkData; + + public void Execute() + { + for (int vindex = 0; vindex < vcnt; vindex++) + { + // posŻproxyċş§ĉ¨™çİşé–“Ğċ¤‰ĉ›™‚‹ + float3 pos = MathUtility.TransformPoint(localPositions[vindex], toP); + + // ‚ރނ¸ƒŠƒĞƒœƒĵƒ³‚Ĥ‚¨‚¤ƒˆ + VirtualMeshBoneWeight bw = boneWeights[vindex]; + Debug.Assert(bw.IsValid); + + // ‚‚£¨‚‚‚Ĥ‚¨‚¤ƒˆŒé‡„ƒœƒĵƒ³ƒƒƒ‚·ƒ + MagicaObjectId boneId = transformIds[bw.boneIndices[0]]; + + + // ‚°ƒŞƒƒƒ‰çŻ„ċ›²‚’ĉ¤œç´˘™‚‹ + // ċŒ˜ƒœƒĵƒ³‚’ċĞ‚€ĉœ€‚‚èż‘„é ‚ç‚ı‚’ïĵ‘¤é¸ĉŠž™‚‹ + var nearVertex = new ExCostSortedList1(-1); + var weightVertex = new ExCostSortedList1(-1); + foreach (int3 grid in GridMap.GetArea(pos, searchRadius, gridMap, gridSize)) + { + if (gridMap.ContainsKey(grid) == false) + continue; + + foreach (int tindex in gridMap.GetValuesForKey(grid)) + { + var tpos = proxyLocalPositions[tindex]; + + // ĉ¤œç´˘è·é›˘ƒ‚§ƒƒ‚Ż + float dist = math.distance(pos, tpos); + if (dist > searchRadius) + continue; + + // ċŻèħĦ頂ç‚ı‚Ĥ‚¨‚¤ƒˆĞƒžƒƒƒ”ƒ³‚°é ‚ç‚ıƒœƒĵƒ³ŒċĞ‚ŒĤ„‚‹‹ƒ‚§ƒƒ‚݁™‚‹ + var tbw = proxyBoneWeights[tindex]; + Debug.Assert(tbw.IsValid); + bool hasBone = false; + for (int j = 0; j < tbw.Count && hasBone == false; j++) + { + MagicaObjectId tboneId = proxyTransformIds[tbw.boneIndices[j]]; + if (tboneId == boneId) + hasBone = true; + } + + if (hasBone) + { + // ĉœ€‚‚èż‘„è·é›˘żè¨˜éŒ²™‚‹ + weightVertex.Add(dist, tindex); + } + //else + { + // ‚Ĥ‚¨‚¤ƒˆé ‚ç‚ıŒèĤ‹¤‹‚‰Ş„ċ ´ċˆŻĉœ€‚‚èż‘„é ‚ç‚ı‚’記録™‚‹ + nearVertex.Add(dist, tindex); + } + } + } + +#if false + // ċŒ˜ƒœƒĵƒ³‚’ċĞ‚€èż‘ċ‚é ‚ç‚ı‚’ċ„Şċ…ˆ€èĤ‹¤‹‚‰Ş„ċ ´ċˆŻĉœ€‚‚èż‘„é ‚ç‚ıĞƒžƒƒƒ”ƒ³‚° + var connectionVertex = weightVertex.IsValid ? weightVertex : nearVertex; +#else + // ċŒ˜ƒœƒĵƒ³‚’ċĞ‚€èż‘ċ‚é ‚ç‚ı‚’ċ„Şċ…ˆ€èĤ‹¤‹‚‰Ş„ċ ´ċˆŻĉœ€‚‚èż‘„é ‚ç‚ıĞƒžƒƒƒ”ƒ³‚° + // Ÿ —è·é›˘Œċ¤§é›˘‚Œ‚‹ċ ´ċˆŻèż‘„ĉ–ı‚’ċ„Şċ…ˆ™‚‹ + ExCostSortedList1 connectionVertex = nearVertex; + if (weightVertex.IsValid && weightVertex.Cost < nearVertex.Cost * 3.0f) + { + connectionVertex = weightVertex; + } +#endif + + // ĉ¤œç´˘çŻ„ċ›²ċ†…Ğ£Ÿé ‚ç‚ıŒŞ„ċ ´ċˆŻƒžƒƒƒ”ƒ³‚°—Ş„ + // ¤‚ŠĉœŞĉŽçĥšé ‚ç‚ı¨Ş‚‹ + if (connectionVertex.IsValid == false) + { + // 頂ç‚ıċħžĉ€§‚’ç„ĦċŠı¨—Ĥƒžƒĵ‚݁™‚‹ + attributes[vindex] = VertexAttribute.Invalid; + continue; + } + + // èĤ‹¤‹£Ÿèż‘ċ‚é ‚ç‚ıċħžĉ€§ + var connectionAttr = proxyAttributes[connectionVertex.Data]; + + // èż‘ċ‚é ‚ç‚ıŒç„ĦċŠıŞ‚‰°ƒžƒƒƒ”ƒ³‚°—Ş„ + if (connectionAttr.IsInvalid()) + { + // 頂ç‚ıċħžĉ€§‚’ç„ĦċŠı¨—Ĥƒžƒĵ‚݁™‚‹ + attributes[vindex] = VertexAttribute.Invalid; + continue; + } + + // èĤ‹¤‹£Ÿèż‘ċ‚é ‚ç‚ı‚’記録 + var wdata = new MappingWorkData() + { + position = pos, + vertexIndex = vindex, + proxyVertexIndex = connectionVertex.Data, + proxyVertexDistance = connectionVertex.Cost, + }; + mappingWorkData[vindex] = wdata; + attributes[vindex] = connectionAttr; + } + } + } + + /// + /// èż‘ċ‚ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒé ‚ç‚ı‚’ċŸşĉş–Ğ頂ç‚ı‚Ĥ‚¨‚¤ƒˆ‚’ç—ċ‡ş™‚‹ + /// + [BurstCompile] + struct Mapping_CalcWeightJob : IJobParallelFor + { + [Unity.Collections.ReadOnly] + public NativeArray mappingWorkData; + + public NativeArray attributes; + [Unity.Collections.WriteOnly] + public NativeArray boneWeights; + + [Unity.Collections.ReadOnly] + public NativeArray proxyAttributes; + [Unity.Collections.ReadOnly] + public NativeArray proxyLocalPositions; + [Unity.Collections.ReadOnly] + public NativeArray proxyLocalNormals; + [Unity.Collections.ReadOnly] + public NativeArray proxyVertexToVertexIndexArray; + [Unity.Collections.ReadOnly] + public NativeArray proxyVertexToVertexDataArray; + + public void Execute(int vindex) + { + // ™§ĞInvalidŞ‚‰ç„ĦċŠı + if (attributes[vindex].IsInvalid()) + return; + + var wdata = mappingWorkData[vindex]; + int pindex = wdata.proxyVertexIndex; + +#if false + // šèż‘ċ‚é ‚ç‚ıċı³é˘Ğƒžƒƒƒ”ƒ³‚°é ‚ç‚ı‚’ĉŠ•ċ½ħ™‚‹ + // “‚ŒŻç•°Ş‚‹ċ½˘çŠĥƒĦƒƒ‚·ƒ‚’ƒžƒƒƒ”ƒ³‚°™‚‹¨Ğ頂ç‚ıŒċ¤šé›˘‚ŒĤ„‚‹ċ ´ċˆ¸ċŻċ‡Ĥ + var pos = wdata.position; + var ppos = proxyLocalPositions[pindex]; + var pnor = proxyLocalNormals[pindex]; + var v = pos - ppos; + var vlen = math.length(v); + if (vlen > 1e-06f) + { + var pv = math.project(v, pnor); + //var nlen = math.dot(v, pnor) * 0.5f; + var nlen = math.length(pv) * 0.5f; + pos = ppos + v * (vlen - nlen) / vlen; + } + float vertexDistance = math.distance(pos, ppos); +#endif +#if true + // šèż‘ċ‚é ‚ç‚ıċı³é˘Ğƒžƒƒƒ”ƒ³‚°é ‚ç‚ı‚’ĉŠ•ċ½ħ™‚‹ + // “‚ŒŻç•°Ş‚‹ċ½˘çŠĥƒĦƒƒ‚·ƒ‚’ƒžƒƒƒ”ƒ³‚°™‚‹¨Ğ頂ç‚ıŒċ¤šé›˘‚ŒĤ„‚‹ċ ´ċˆ¸ċŻċ‡Ĥ + var pos = wdata.position; + var ppos = proxyLocalPositions[pindex]; + var pnor = proxyLocalNormals[pindex]; + var v = pos - ppos; + pos = pos - math.project(v, pnor); + float vertexDistance = math.distance(pos, ppos); +#endif +#if false + float vertexDistance = wdata.proxyVertexDistance; + var pos = wdata.position; +#endif + + + // 頂ç‚ı‚Ĥ‚¨‚¤ƒˆè¨ˆç— + // èĤ‹¤‹£Ÿèż‘ċ‚é ‚ç‚ı‹‚‰ĉŽçĥšé ‚ç‚ı‚’èŞżıĤè·é›˘ĉ˜‡é †Ğïĵ”¤§é¸ĉŠž™‚‹ + //float wradius = wdata.proxyVertexDistance * 4.0f; // ĉ¤œç´˘çŻ„ċ›²Żèż‘ċ‚é ‚ç‚ıè·é›˘ï½˜N§ + float wradius = vertexDistance * 4.0f; // ĉ¤œç´˘çŻ„ċ›²Żèż‘ċ‚é ‚ç‚ıè·é›˘ï½˜N§ + var vertexDist = new ExCostSortedList4(-1); + + // ƒ‚§ƒƒ‚݁Żèż‘ċ‚é ‚ç‚ıĉŽçĥšïĵ’ƒĴƒ™ƒĞż¨™‚‹ + // ★結ĉžœïĵšè‰Ż„€‚ĉœ€ċˆƒƒĵ‚¸ƒ§ƒ³¨çµĉžœŒċŒ˜§è² è·Żĉż€ĉ¸›—Ÿ€‚ + vertexDist.Add(vertexDistance, pindex); + DataUtility.Unpack12_20(proxyVertexToVertexIndexArray[pindex], out var dcnt, out var dstart); + // ƒĴƒ™ƒĞïĵ‘ĉŽçĥš + for (int i = 0; i < dcnt; i++) + { + int index2 = proxyVertexToVertexDataArray[dstart + i]; + if (vertexDist.Contains(index2)) + continue; + + float3 tpos = proxyLocalPositions[index2]; + + // ç›´ç·šè·é›˘ + float dist = math.distance(pos, tpos); + + // è·é›˘ŒçŻ„ċ›²ċ†…Ş‚‰è¨˜éŒ² + if (dist <= wradius) + { + vertexDist.Add(dist, index2); + } + + // ƒĴƒ™ƒĞïĵ’ĉŽçĥš + DataUtility.Unpack12_20(proxyVertexToVertexIndexArray[index2], out var dcnt2, out var dstart2); + for (int j = 0; j < dcnt2; j++) + { + int index3 = proxyVertexToVertexDataArray[dstart2 + j]; + if (index3 == pindex || index3 == index2) + continue; + if (vertexDist.Contains(index3)) + continue; + + // è·é›˘ + tpos = proxyLocalPositions[index3]; + dist = math.distance(pos, tpos); + + // è·é›˘ŒçŻ„ċ›²ċ†…Ş‚‰è¨˜éŒ² + if (dist <= wradius) + { + vertexDist.Add(dist, index3); + } + } + } + Debug.Assert(vertexDist.IsValid); + + // èż‘ċ‚é ‚ç‚ıè·é›˘‚’‚Ĥ‚¨‚¤ƒˆĞċ¤‰ĉ›™‚‹ + float4 weights = CalcVertexWeights(vertexDist.costs); + Debug.Assert(weights[0] > 0.0f); + + // ‚Ĥ‚¨‚¤ƒˆ‚’ĉ ĵ納™‚‹ + var bw = new VirtualMeshBoneWeight(vertexDist.data, weights); + boneWeights[vindex] = bw; + + // 頂ç‚ıċħžĉ€§ + // èż‘ċ‚ƒ—ƒ­‚­‚·é ‚ç‚ıċħžĉ€§‚’ċ—‘çĥ™ + //attributes[vindex] = proxyAttributes[pindex]; + // èż‘ċ‚ƒ—ƒ­‚­‚·é ‚ç‚ıċħžĉ€§Ğ‚Ĥ‚¨‚¤ƒˆ‚’ĉŽ›‘Ĥç—ċ‡ş™‚‹ + // ç§ğċ‹•¨ċ›şċšċ½ħ響ċŠ›ŒéИ„ĉ–ı‚’ĉŽĦ用™‚‹ + float fixedValue = 0; + float moveValue = 0; + int wcnt = bw.Count; + for (int i = 0; i < wcnt; i++) + { + pindex = bw.boneIndices[i]; + var attr = proxyAttributes[pindex]; + if (attr.IsMove()) + moveValue += bw.weights[i]; + else if (attr.IsFixed()) + fixedValue += bw.weights[i]; + } + attributes[vindex] = moveValue > fixedValue ? VertexAttribute.Move : VertexAttribute.Fixed; + } + } + + /// + /// è·é›˘ƒŞ‚ıƒˆ‹‚‰‚Ĥ‚¨‚¤ƒˆċ€¤‚’ç—ċ‡ş—Ĥèż”™ + /// + /// + /// + static float4 CalcVertexWeights(float4 distances) + { + Debug.Assert(distances[0] >= 0.0f); + +#if false + // ĉœ€ċ¤§è·é›˘n%‚’ĉ¸›ç—™‚‹ + // ĉœ€èż‘ĉށ‚Ĥ‚¨‚¤ƒˆ‚’ċĵ·™‚‹Ÿ‚ + const float lengthCut = 0.5f; + float cutdist = distances[0] * lengthCut; + distances = distances - cutdist; +#endif + + // ƒž‚¤ƒŠ‚ıïĵˆç„ĦċŠıċ€¤ïĵ‰ŻïĵĞ™‚‹ + distances = math.max(distances, 0); + +#if true + // è·é›˘‚’näı—™‚‹ + // è·é›˘Ğ‚ˆ‚‹‚Ĥ‚¨‚¤ƒˆĉ¸›èĦ° + const float pow = 4.0f; // 2.0? + distances = math.pow(distances, pow); +#endif + + // ĉœ€ċ°ċ€¤é€†ĉ•°Ğ™‚‹ + float min = distances[0]; + for (int i = 0; i < 4; i++) + distances[i] = distances[i] > 0.0f ? min / distances[i] : 0.0f; + + // ċ˜ä½ċŒ–™‚‹(1.0) + float sum = math.csum(distances); + if (sum <= 0.0f) + { + // “ĉ™‚ç‚ı§ïĵŞ‚‰°ïĵè·é›˘Ş§[0]=100%§èż”™ + return new float4(1, 0, 0, 0); + } + distances /= sum; + + // ĉµċ°‚Ĥ‚¨‚¤ƒˆŻċ‰Šé™¤™‚‹ + const float removeWeight = 0.01f; + for (int i = 3; i >= 1; i--) + { + if (distances[i] < removeWeight) + distances[i] = 0; + } + + // ċ†ċşĤċ˜ä½ċŒ–(1.0) + distances /= math.csum(distances); + + return distances; + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshMapping.cs.meta b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshMapping.cs.meta new file mode 100644 index 00000000..88648eb2 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshMapping.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 9f5b40e8547616f4eb331cc9fd5c5e1c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshMapping.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshOptimization.cs b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshOptimization.cs new file mode 100644 index 00000000..58878533 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshOptimization.cs @@ -0,0 +1,237 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System; +using Unity.Burst; +using Unity.Collections; +using Unity.Jobs; +using Unity.Mathematics; +using UnityEngine; + +namespace MagicaCloth2 +{ + public partial class VirtualMesh + { + /// + /// ƒĦƒƒ‚·ƒ‚’ĉœ€éİċŒ–™‚‹ + /// + public void Optimization() + { + try + { + // 重複ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞċ‰Šé™¤ + RemoveDuplicateTriangles(); + } + catch (Exception exception) + { + Debug.LogException(exception); + result.SetError(Define.Result.Optimize_Exception); + } + } + + /// + /// 重複™‚‹ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ‚’除ċŽğ™‚‹ + /// + void RemoveDuplicateTriangles() + { + if (TriangleCount < 2) + return; + + using var edgeToTriangleList = new NativeParallelHashMap>(TriangleCount * 2, Allocator.Persistent); + using var newTriangles = new NativeList(TriangleCount, Allocator.Persistent); + + using var useQuadSet = new NativeParallelHashSet(TriangleCount / 4, Allocator.Persistent); // Unity2023.1.5ċŻċżœ + using var removeTriangleSet = new NativeParallelHashSet(TriangleCount / 4, Allocator.Persistent); // Unity2023.1.5ċŻċżœ + + var job1 = new Optimize_EdgeToTrianlgeJob() + { + tcnt = TriangleCount, + triangles = triangles.GetNativeArray(), + localPositions = localPositions.GetNativeArray(), + edgeToTriangleList = edgeToTriangleList, + newTriangles = newTriangles, + + useQuadSet = useQuadSet, // Unity2023.1.5ċŻċżœ + removeTriangleSet = removeTriangleSet, // Unity2023.1.5ċŻċżœ + }; + job1.Run(); + + // ĉ–°—„ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞƒŞ‚ıƒˆĞċ…‚Œĉ›żˆ‚‹ + triangles?.Dispose(); + triangles = new ExSimpleNativeArray(); + if (newTriangles.Length > 0) + { + triangles.AddRange(newTriangles); + } + } + + [BurstCompile] + struct Optimize_EdgeToTrianlgeJob : IJob + { + public int tcnt; + [Unity.Collections.ReadOnly] + public NativeArray triangles; + [Unity.Collections.ReadOnly] + public NativeArray localPositions; + + public NativeParallelHashMap> edgeToTriangleList; + [Unity.Collections.WriteOnly] + public NativeList newTriangles; + + public NativeParallelHashSet useQuadSet; // Unity2023.1.5ċŻċżœ + public NativeParallelHashSet removeTriangleSet; // Unity2023.1.5ċŻċżœ + + public void Execute() + { + // ‚¨ƒƒ‚¸ĞĉŽçĥš™‚‹ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞƒŞ‚ıƒˆ‚’作ĉˆ™‚‹ + for (int i = 0; i < tcnt; i++) + { + int3 tri = triangles[i]; + int2x3 edges = new int2x3(tri.xy, tri.yz, tri.zx); + for (int j = 0; j < 3; j++) + { + int2 edge = DataUtility.PackInt2(edges[j]); + if (edgeToTriangleList.ContainsKey(edge)) + { + var tlist = edgeToTriangleList[edge]; + if (tlist.Length < tlist.Capacity) // Capacity check + { + tlist.MC2Set(i); + edgeToTriangleList[edge] = tlist; + } + } + else + { + var tlist = new FixedList128Bytes(); + tlist.MC2Set(i); + edgeToTriangleList.Add(edge, tlist); + } + } + } + + // debug + //foreach (var kv in edgeToTriangleList) + //{ + // Debug.Log($"edge[{kv.Key}]"); + // var data = kv.Value; + // for (int i = 0; i < data.Length; i++) + // Debug.Log($":{data[i]}"); + //} + + // ğĵĉ°´ċı³Şƒˆƒİ‚¤‚˘ƒ³‚°ƒĞƒš‚˘‚’ç™ğ録—Ĥ„€ƒš‚˘Œé‡è¤‡—Ÿċ ´ċˆŻïĵ‘¤‚’ĉ‹—Ĥċ‰Šé™¤ċŻèħĦ¨™‚‹ + //var useQuadSet = new NativeParallelHashSet(tcnt / 4, Allocator.Temp); // Unity2023.1.5ċŻċżœ + //var removeTriangleSet = new NativeParallelHashSet(tcnt / 4, Allocator.Temp); // Unity2023.1.5ċŻċżœ + foreach (var kv in edgeToTriangleList) + { + int2 edge = kv.Key; + var px = localPositions[edge.x]; + var py = localPositions[edge.y]; + var tlist = kv.Value; + int tcnt = tlist.Length; + for (int i = 0; i < tcnt - 1; i++) + { + int3 tri1 = triangles[tlist[i]]; + int z = DataUtility.RemainingData(tri1, edge); + var pz = localPositions[z]; + for (int j = i + 1; j < tcnt; j++) + { + int3 tri2 = triangles[tlist[j]]; + int w = DataUtility.RemainingData(tri2, edge); + var pw = localPositions[w]; + + // z + + // / \ + // edge.x +---+ edge.y + // \ / + // w + + + // ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞƒš‚˘Ş™è§’‚’ĉħ‚‚‚‹ + float ang = math.degrees(MathUtility.TriangleAngle(px, py, pz, pw)); + //Debug.Log($"[{edge.x},{edge.y},{z},{w}] :{ang}"); + + //if (edge.x == 107 || edge.y == 107 || z == 107 || w == 107) + // Debug.Log($"[{edge.x}-{edge.y},{z},{w}], ang:{ang}"); + + // ğĵĉ°´ċı³ŒċŻèħĦïĵˆĉ­ŞŞċ½˘çŠĥ‚‚ċĵ‹‚Œ‚‹ïĵ‰ + if (math.abs(ang) > Define.System.ProxyMeshTrianglePairAngle) + continue; + + // ċ­—ċž‹ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞƒš‚˘Żç„ĦèĤ–™‚‹ + MathUtility.ClosestPtSegmentSegment(px, py, pz, pw, out var s, out var t, out _, out _); + if (s == 0.0f || s == 1.0f || t == 0.0f || t == 1.0f) + continue; + + // “ïĵ’¤ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞƒš‚˘ċ››èşċ½˘ + int4 quad = DataUtility.PackInt4(edge.x, edge.y, z, w); + + // ™§Ğ“ċ››èşċ½˘Œç™ğ録•‚ŒĤ„‚‹Ş‚‰°ïĵ’¤ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞŻċ‰Šé™¤ċŻèħĦĞċ…‚Œ‚‹ + if (useQuadSet.Contains(quad)) + { + removeTriangleSet.Add(tri1); + removeTriangleSet.Add(tri2); + //Debug.Log($"removeTriangleSet:{tri1}"); + //Debug.Log($"removeTriangleSet:{tri2}"); + } + else + { + useQuadSet.Add(quad); + } + } + } + } + + // ċ‰Šé™¤ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ‚’除„Ÿĉ–°—„ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞƒŞ‚ıƒˆ‚’作ĉˆ™‚‹ + for (int i = 0; i < tcnt; i++) + { + int3 tri = triangles[i]; + if (removeTriangleSet.Contains(tri)) + continue; + + // ç™ğ録 + newTriangles.AddNoResize(tri); + } + //foreach (var tri in removeTriangleSet) + //{ + // Debug.Log($"Remove Triangle:{tri}"); + //} + } + } + + /// + /// ċ…ħ通™‚‹‚¨ƒƒ‚¸‚’‚‚¤ïĵ’¤ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞŒé–‹„Ĥ„‚‹‹ċˆ¤ċš™‚‹ + /// + /// + /// + /// + /// + bool CheckTwoTriangleOpen(in int3 tri1, in int3 tri2, in int2 edge, in float3 tri1n) + { + var sv0 = DataUtility.RemainingData(tri2, edge); + var v = math.normalize(localPositions[sv0] - localPositions[edge.x]); + return math.dot(tri1n, v) <= 0.0f; + } + + /// + /// ċ…ħ通™‚‹‚¨ƒƒ‚¸‚’‚‚¤ïĵ’¤ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞŞ™è§’‚’ĉħ‚‚‚‹ïĵˆƒ‡‚°ƒŞƒĵ角ïĵ‰ + /// + /// + /// + /// + /// + float CalcTwoTriangleAngle(in int3 tri1, in int3 tri2, in int2 edge) + { + var sv1 = DataUtility.RemainingData(tri1, edge); + var sv2 = DataUtility.RemainingData(tri2, edge); + + // ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ角ċşĤ + var va = localPositions[edge.y] - localPositions[edge.x]; + var vb = localPositions[sv1] - localPositions[edge.x]; + var vc = localPositions[sv2] - localPositions[edge.x]; + + var n0 = math.cross(va, vb); + var n1 = math.cross(vc, va); + + return math.degrees(MathUtility.Angle(n0, n1)); + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshOptimization.cs.meta b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshOptimization.cs.meta new file mode 100644 index 00000000..f524c8ea --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshOptimization.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: a5ea1d28ce226d74bb733f6c9a5a08e0 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshOptimization.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshProxy.cs b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshProxy.cs new file mode 100644 index 00000000..e702ff61 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshProxy.cs @@ -0,0 +1,2426 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System; +using System.Collections.Generic; +using Unity.Burst; +using Unity.Collections; +using Unity.Collections.LowLevel.Unsafe; +using Unity.Jobs; +using Unity.Mathematics; +using UnityEngine; + +namespace MagicaCloth2 +{ + public partial class VirtualMesh + { + /// + /// ƒĦƒƒ‚·ƒ‚’ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒĞċ¤‰ĉ›™‚‹ïĵˆ‚ıƒĴƒƒƒ‰ċŻïĵ‰ + /// ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒŻé ‚ç‚ıĉ³•ç·šĉŽç·š‚’ĉŽçĥš™‚‹ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ‹‚‰ĉħ‚‚‚‹‚ˆ†ĞŞ‚‹ + /// Ÿƒžƒƒƒ”ƒ³‚°ç”¨é ‚ç‚ı”¨ƒ‚¤ƒ³ƒ‰ƒƒĵ‚ş‚‚保ĉŒ™‚‹ + /// + public void ConvertProxyMesh( + ClothSerializeData sdata, + TransformRecord clothTransformRecord, + List customSkinningBoneRecords, + TransformRecord normalAdjustmentTransformRecord + ) + { + try + { + if (IsError) + { + //Debug.LogError($"Invalid VirtualMesh! [{this.name}]"); + throw new MagicaClothProcessingException(); + } + + // ‚Ğ‚ı‚żƒ ‚ı‚­ƒ‹ƒ³‚°ƒœƒĵƒ³èż½ċŠ  + if (sdata.customSkinningSetting.enable && sdata.IsBoneSpring() == false) + { + SetCustomSkinningBones(clothTransformRecord, customSkinningBoneRecords); + } + + // 頂ç‚ıĞĉŽçĥš™‚‹ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ + vertexToTriangles = new NativeArray>(VertexCount, Allocator.Persistent); + + // 頂ç‚ı”¨ƒ‚¤ƒ³ƒ‰ƒƒĵ‚ş + vertexBindPosePositions = new NativeArray(VertexCount, Allocator.Persistent); + vertexBindPoseRotations = new NativeArray(VertexCount, Allocator.Persistent); + + // 頂ç‚ı”¨Transformċ¤‰ĉ›ç”¨ċ›žèğ˘ + vertexToTransformRotations = new NativeArray(VertexCount, Allocator.Persistent); + JobUtility.FillRun(vertexToTransformRotations, VertexCount, quaternion.identity); + + // 頂ç‚ıĞĉŽçĥš™‚‹é ‚ç‚ıƒŞ‚ıƒˆ‚’ĉħ‚‚‚‹ + // ‚¨ƒƒ‚¸ƒŞ‚ıƒˆ‚’作ĉˆ™‚‹ + using var vertexDataBuilder = new MultiDataBuilder(VertexCount, VertexCount * 4); + using var edgeSet = new NativeParallelHashSet(VertexCount * 2, Allocator.Persistent); + if (TriangleCount > 0) + { + var calcTriangleVertexToVertexJob = new Proxy_CalcVertexToVertexFromTriangleJob() + { + triangleCount = TriangleCount, + triangles = triangles.GetNativeArray(), + vertexToVertexMap = vertexDataBuilder.Map, + edgeSet = edgeSet, + }; + calcTriangleVertexToVertexJob.Run(); + } + if (LineCount > 0) + { + var calcLineVertexToVertexJob = new Proxy_CalcVertexToVertexFromLineJob() + { + lineCount = LineCount, + lines = lines.GetNativeArray(), + vertexToVertexMap = vertexDataBuilder.Map, + edgeSet = edgeSet, + }; + calcLineVertexToVertexJob.Run(); + } + + // ‚¨ƒƒ‚¸‚’ƒŞ‚ıƒˆċŒ–—Ĥĉ ĵ納™‚‹ + edges = edgeSet.ToNativeArray(Allocator.Persistent); + //Debug.Log($"edges:{edges.Length}"); + + // 頂ç‚ıĉŽçĥšé ‚ç‚ı‚’ƒŞ‚ıƒˆċŒ–—Ĥĉ ĵ納™‚‹ + vertexDataBuilder.ToNativeArray(out vertexToVertexIndexArray, out vertexToVertexDataArray); + +#if false + // debug + for (int i = 0; i < VertexCount; i++) + { + uint pack = vertexToVertexIndexArray[i]; + int cnt = DataUtility.Unpack10_22Hi(pack); + Debug.Assert(cnt > 0); + Debug.Log($"[{i}] cnt:{cnt}"); + } +#endif +#if false + // ç„ĦċŠıċħžĉ€§Żç§ğċ‹•ċħžĉ€§ĞĉŽçĥš™‚‹ċ ´ċˆżċ›şċšĞċ¤‰ĉ›´™‚‹ + var convertInvalidJob = new Proxy_ConvertInvalidToFixedJob() + { + attributes = attributes.GetNativeArray(), + vertexToVertexIndexArray = vertexToVertexIndexArray, + vertexToVertexDataArray = vertexToVertexDataArray, + }; + convertInvalidJob.Run(VertexCount); +#endif + + // ‚¨ƒƒ‚¸”¨ĉŽçĥšƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ‚’ĉħ‚‚‚‹ + if (TriangleCount > 0) + { + // ‚¨ƒƒ‚¸”¨ĉŽçĥšƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ‚’ĉħ‚‚‚‹ + edgeToTriangles = new NativeParallelMultiHashMap(TriangleCount * 2, Allocator.Persistent); + var calcEdgeToTriangleJob = new Proxy_CalcEdgeToTriangleJob() + { + tcnt = TriangleCount, + triangles = triangles.GetNativeArray(), + edgeToTriangles = edgeToTriangles, + }; + calcEdgeToTriangleJob.Run(); + + // ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĉ³•ç·š‚’ĉħ‚‚‚‹ + using var triNormals = new NativeArray(TriangleCount, Allocator.Persistent); + var calcTriangleNormalJob = new Proxy_CalcTriangleNormalJob() + { + triangles = triangles.GetNativeArray(), + localPositins = localPositions.GetNativeArray(), + triangleNormals = triNormals, + }; + calcTriangleNormalJob.Run(TriangleCount); + + // ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞċ‘‚’§‚‹é™‚Šĉƒˆ‚‹ + //OptimizeTriangleDirection(triNormals, sdata.sameSurfaceAngle); + OptimizeTriangleDirection(triNormals, Define.System.SameSurfaceAngle); + + // ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĉŽç·š‚’ĉħ‚‚‚‹ + using var triTangents = new NativeArray(TriangleCount, Allocator.Persistent); + var calcTriangleTangentJob = new Proxy_CalcTriangleTangentJob() + { + triangles = triangles.GetNativeArray(), + localPositins = localPositions.GetNativeArray(), + uv = uv.GetNativeArray(), + triangleTangents = triTangents, + }; + calcTriangleTangentJob.Run(TriangleCount); + + // 頂ç‚ıĞĉŽçĥš™‚‹ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ‚ğƒƒƒˆ‚’ĉħ‚‚‚‹ïĵˆĉœ€ċ¤§ïĵ—¤ïĵ‰ + var createVertexToTriangleJob = new Proxy_CreateVertexToTrianglesJob() + { + triangles = triangles.GetNativeArray(), + vertexToTriangles = vertexToTriangles, + }; + createVertexToTriangleJob.Run(); + + // ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ‹‚‰é ‚ç‚ıĉ³•ç·š‚’計痁™‚‹Ÿ‚vertexToTriangles‚’ĉħ‚‚‚‹ + // Ÿé ‚ç‚ıŒƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĞċħž™‚‹ċ ´ċˆŻƒ•ƒİ‚°‚’çĞ‹Ĥ‚‹ + var organizeVertexToTriangleJob = new Proxy_OrganizeVertexToTrianglsJob() + { + vertexToTriangles = vertexToTriangles, + triangleNormals = triNormals, + triangleTangents = triTangents, + attributes = attributes.GetNativeArray(), + }; + organizeVertexToTriangleJob.Run(VertexCount); + + // ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ組żċˆ‚›‹‚‰ĉ³•ç·š¨ĉŽç·š‚’ĉħ‚‚‚‹ + var calcVertexNormalTangentBindposeJob = new Proxy_CalcVertexNormalTangentFromTriangleJob() + { + triangleNormals = triNormals, + triangleTangents = triTangents, + vertexToTriangles = vertexToTriangles, + localNormals = localNormals.GetNativeArray(), + localTangents = localTangents.GetNativeArray(), + }; + calcVertexNormalTangentBindposeJob.Run(VertexCount); + } + else + { + // ‚¨ƒƒ‚¸”¨ĉŽçĥšƒˆƒİ‚¤‚˘ƒ³‚°ƒĞŻçİşĞ™‚‹ + edgeToTriangles = new NativeParallelMultiHashMap(1, Allocator.Persistent); + } + + // ‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³Ğ関係™‚‹é ‚ç‚ı‹‚‰AABB¨ċ›şċšé ‚ç‚ıƒŞ‚ıƒˆ‚’作ĉˆ™‚‹ + ProxyCreateFixedListAndAABB(); + + // ƒ™ƒĵ‚ıƒİ‚¤ƒ³ä½œĉˆ + if (isBoneCloth) + { + // BoneCloth + CreateTransformBaseLine(); + } + else + { + // MeshCloth + CreateMeshBaseLine(); + } + + // ĉ³•ç·šĉ–ıċ‘èŞżĉ•´ + ProxyNormalAdjustment(sdata, normalAdjustmentTransformRecord); + + // BoneCloth§Żƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ĉ›¸ĉˆğ—用ċ›žèğ˘‚’ĉħ‚‚‚‹ + if (isBoneCloth) + { + var calcVertexToTransformJob = new Proxy_CalcVertexToTransformJob() + { + invRot = initInverseRotation, + localNormals = localNormals.GetNativeArray(), + localTangents = localTangents.GetNativeArray(), + vertexToTransformRotations = vertexToTransformRotations, + transformRotations = transformData.rotationArray.GetNativeArray(), + }; + calcVertexToTransformJob.Run(VertexCount); + } + + // 頂ç‚ıƒ‚¤ƒ³ƒ‰ƒƒĵ‚ş‚’ĉħ‚‚‚‹ + var calcVertexBindposeJob = new Proxy_CalcVertexBindPoseJob2() + { + localPositions = localPositions.GetNativeArray(), + localNormals = localNormals.GetNativeArray(), + localTangents = localTangents.GetNativeArray(), + vertexBindPosePositions = vertexBindPosePositions, + vertexBindPoseRotations = vertexBindPoseRotations, + }; + calcVertexBindposeJob.Run(VertexCount); + + // ‚¨ƒƒ‚¸ċ›şĉœ‰ƒ•ƒİ‚°‚’設ċš + edgeFlags = new NativeArray(EdgeCount, Allocator.Persistent); + if (EdgeCount > 0) + { + var createEdgeFlagJob = new Proxy_CreateEdgeFlagJob() + { + edges = edges, + edgeToTriangles = edgeToTriangles, + edgeFlags = edgeFlags, + }; + createEdgeFlagJob.Run(EdgeCount); + } + + // ƒ™ƒĵ‚ıƒİ‚¤ƒ³ċŸşĉœĴċ§żċ‹˘‚’ĉħ‚‚‚‹ + CreateBaseLinePose(); + + // 頂ç‚ı”¨ƒĞƒĵƒˆ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı¨ĉ·ħ•‚’ĉħ‚‚‚‹ + CreateVertexRootAndDepth(); + + // AABBċ†è¨ˆç— + //JobUtility.CalcAABBRun(localPositions.GetNativeArray(), VertexCount, boundingBox); + + // ‚Ğ‚ı‚żƒ ‚ı‚­ƒ‹ƒ³‚°è¨­ċš + if (sdata.customSkinningSetting.enable && sdata.IsBoneSpring() == false) + { + CreateCustomSkinning(sdata.customSkinningSetting, customSkinningBoneRecords); + } + + // ƒĦƒƒ‚·ƒ‚ż‚¤ƒ— + if (isBoneCloth) + meshType = MeshType.ProxyBoneMesh; + else + meshType = MeshType.ProxyMesh; + } + catch (MagicaClothProcessingException) + { + if (result.IsError() == false) + result.SetError(Define.Result.ProxyMesh_UnknownError); + result.DebugLog(); + } + catch (Exception exception) + { + Debug.LogException(exception); + result.SetError(Define.Result.ProxyMesh_Exception); + } + finally + { + } + } + +#if false + [BurstCompile] + struct Proxy_ConvertInvalidToFixedJob : IJobParallelFor + { + // proxy mesh + public NativeArray attributes; + [Unity.Collections.ReadOnly] + public NativeArray vertexToVertexIndexArray; + [Unity.Collections.ReadOnly] + public NativeArray vertexToVertexDataArray; + + public void Execute(int vindex) + { + var attr = attributes[vindex]; + + // ç„ĦċŠıċˆ¤ċš + if (attr.IsInvalid()) + { + // ç§ğċ‹•ċħžĉ€§ĞĉŽçĥš™‚‹ċ ´ċˆżċ›şċšĞċ¤‰ĉ›´™‚‹ + var pack = vertexToVertexIndexArray[vindex]; + DataUtility.Unpack10_22(pack, out var dcnt, out var dstart); + for (int i = 0; i < dcnt; i++) + { + int tvindex = vertexToVertexDataArray[dstart + i]; + var tattr = attributes[tvindex]; + if (tattr.IsMove()) + { + // ċ›şċšĞċ¤‰ĉ›´ + attr.SetFlag(VertexAttribute.Flag_Ignore, true); + attr.SetFlag(VertexAttribute.Flag_Fixed, true); + attributes[vindex] = attr; + return; + } + } + } + } + } +#endif + + /// + /// ĉ³•ç·šĉ–ıċ‘èŞżĉ•´ + /// + void ProxyNormalAdjustment(ClothSerializeData sdata, TransformRecord normalAdjustmentTransformRecord) + { + int vcnt = VertexCount; + if (vcnt == 0) + return; + + // 配ċˆ—ċˆĉœŸċŒ–ïĵˆĉœŞä½żç”¨§‚‚é ˜ċŸŸç˘şäżïĵ‰ + normalAdjustmentRotations = new NativeArray(vcnt, Allocator.Persistent); + JobUtility.FillRun(normalAdjustmentRotations, vcnt, quaternion.identity); + + var mode = sdata.normalAlignmentSetting.alignmentMode; + if (mode == NormalAlignmentSettings.AlignmentMode.None) + return; + + // 中ċżƒ‹‚‰ĉ”ċ°„ + if (mode == NormalAlignmentSettings.AlignmentMode.BoundingBoxCenter || mode == NormalAlignmentSettings.AlignmentMode.Transform) + { + float3 center; + if (mode == NormalAlignmentSettings.AlignmentMode.BoundingBoxCenter) + { + center = boundingBox.Value.Center; + } + else + { + center = math.transform(initWorldToLocal, normalAdjustmentTransformRecord.position); + } + + var job1 = new ProxyNormalRadiationAdjustmentJob() + { + center = center, + localPositions = localPositions.GetNativeArray(), + + localNormals = localNormals.GetNativeArray(), + localTangents = localTangents.GetNativeArray(), + normalAdjustmentRotations = normalAdjustmentRotations, + }; + job1.Run(vcnt); + } + } + + [BurstCompile] + struct ProxyNormalRadiationAdjustmentJob : IJobParallelFor + { + public float3 center; + [Unity.Collections.ReadOnly] + public NativeArray localPositions; + + // out + public NativeArray localNormals; + public NativeArray localTangents; + [Unity.Collections.WriteOnly] + public NativeArray normalAdjustmentRotations; + + public void Execute(int vindex) + { + var lpos = localPositions[vindex]; + var v = lpos - center; + if (math.length(v) < Define.System.Epsilon) + return; + + // ĉŒ‡ċš•‚ŒŸ‚ğƒ³‚żƒĵ‹‚‰ĉ”ċ°„ĉ–ıċ‘Ğĉ³•ç·š‚’ċ¤‰ĉ›´™‚‹ + var n = math.normalize(v); + + // çċœ¨ċ›žèğ˘ + var ln = localNormals[vindex]; + var lt = localTangents[vindex]; + var lrot = MathUtility.ToRotation(ln, lt); + + // ĉŽç·š‚’補ĉ­£™‚‹ + float dot = math.dot(n, lt); + if (dot < 0.99f) + { + float3 bn = math.normalize(math.cross(n, lt)); + lt = math.normalize(math.cross(bn, n)); + } + else + { + // ċ…ƒĉŽç·š¨ĉ–°—„ĉ³•ç·šŒċŒ˜ƒ™‚ŻƒˆƒĞċ ´ċˆŻ€ċ“ĉ³•ç·š‹‚‰ĉ–°—„ĉŽç·š‚’ç—ċ‡ş™‚‹ + var lbn = math.normalize(math.cross(ln, lt)); + lt = math.normalize(math.cross(lbn, n)); + } + + localNormals[vindex] = n; + localTangents[vindex] = lt; + var nrot = MathUtility.ToRotation(n, lt); + + // 補ĉ­£ç”¨ċ›žèğ˘‚’ç—ċ‡ş—ĉ ĵ納™‚‹ + normalAdjustmentRotations[vindex] = math.mul(math.inverse(lrot), nrot); + } + } + + /// + /// ‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³Ğ関係™‚‹é ‚ç‚ı‹‚‰AABB¨ċ›şċšé ‚ç‚ıƒŞ‚ıƒˆ‚’作ĉˆ™‚‹ + /// + void ProxyCreateFixedListAndAABB() + { + localCenterPosition = new NativeReference(0, Allocator.Persistent); + + using var fixedList = new NativeList(VertexCount / 20 + 1, Allocator.TempJob); + var job = new ProxyCreateFixedListAndAABBJob() + { + vcnt = VertexCount, + attributes = attributes.GetNativeArray(), + localPositions = localPositions.GetNativeArray(), + vertexToVertexIndexArray = vertexToVertexIndexArray, + vertexToVertexDataArray = vertexToVertexDataArray, + + outAABB = boundingBox, + fixedList = fixedList, + localCenterPosition = localCenterPosition, + }; + job.Run(); + + // ċ›şċšé ‚ç‚ıƒŞ‚ıƒˆĉ ĵ納 + if (fixedList.Length > 0) + { +#if MC2_COLLECTIONS_200 + centerFixedList = fixedList.AsArray().ToArray(); +#else + centerFixedList = fixedList.ToArray(); +#endif + } + //Debug.Log($"Local Center Pos:{localCenterPosition.Value}"); + } + + [BurstCompile] + struct ProxyCreateFixedListAndAABBJob : IJob + { + public int vcnt; + [Unity.Collections.ReadOnly] + public NativeArray attributes; + [Unity.Collections.ReadOnly] + public NativeArray localPositions; + [Unity.Collections.ReadOnly] + public NativeArray vertexToVertexIndexArray; + [Unity.Collections.ReadOnly] + public NativeArray vertexToVertexDataArray; + + // out + [Unity.Collections.WriteOnly] + public NativeReference outAABB; + [Unity.Collections.WriteOnly] + public NativeList fixedList; + [Unity.Collections.WriteOnly] + public NativeReference localCenterPosition; + + public void Execute() + { + fixedList.Clear(); + + float3 lcenpos = 0; + int fixcnt = 0; + + int cnt = 0; + float3 min = float.MaxValue; + float3 max = float.MinValue; + for (int i = 0; i < vcnt; i++) + { + var lpos = localPositions[i]; + + // ċ›şċšé ‚ç‚ıċ ´ċˆŻĉŽçĥšŒ™ıĤċ›şċšŞ‚‰°ç„ĦċŠı¨™‚‹ïĵˆ‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³Ğç„Ħ関係ïĵ‰ + if (attributes[i].IsMove() == false) + { + var pack = vertexToVertexIndexArray[i]; + DataUtility.Unpack12_20(pack, out var dcnt, out var dstart); + int j = 0; + for (; j < dcnt; j++) + { + int tindex = vertexToVertexDataArray[dstart + j]; + if (attributes[tindex].IsMove()) + { + // OK + break; + } + } + if (j == dcnt && dcnt > 0) + continue; + + // ċ›şċšé ‚ç‚ıƒŞ‚ıƒˆĞèż½ċŠ ™‚‹ + fixedList.Add((ushort)i); + + lcenpos += lpos; + fixcnt++; + } + + // min/max + min = math.min(min, lpos); + max = math.max(max, lpos); + cnt++; + } + + // aabb + outAABB.Value = cnt > 0 ? new AABB(min, max) : new AABB(); + + // local center position + if (fixcnt > 0) + lcenpos = lcenpos / fixcnt; + localCenterPosition.Value = lcenpos; + } + } + + + /// + /// ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĉ–ıċ‘‚’é ‚ç‚ıĉ³•ç·šĞĉ²ż†‚ˆ†Ğ§‚‹ ‘ċˆ‚›‚‹ + /// â€ğ“ċ‡Ĥ理Ż¨Ĥ‚‚重èĤ€‚“ċˆ‚›Ğ‚ˆ‚Šĉ³•ç·šè¨ˆç—ç²ċşĤŒä¸ŠŒ‚‹€‚ + /// + void OptimizeTriangleDirection(NativeArray triangleNormals, float sameSurfaceAngle) + { + if (TriangleCount == 0) + return; + + // ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ‚’隣ĉށ™‚‹ĉ³•ç·šè§’ċşĤĞ‚ˆ‚ŠƒĴ‚¤ƒ¤ƒĵċˆ†‘—ŞŒ‚‰ĉ³•ç·š‚’ĉƒˆ‚‹ + int startIndex = 0; + //var useTriSet = new HashSet(TriangleCount); + var useTriSet = new HashSet(); + var triQueue = new Queue(TriangleCount / 2); + var layerList = new List(TriangleCount); + while (startIndex < TriangleCount) + { + // ƒĴ‚¤ƒ¤ƒĵèµ·ç‚ıƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ + if (useTriSet.Contains(startIndex)) + { + // ™§Ğċ‡Ĥ理ĉ¸ˆż + startIndex++; + continue; + } + useTriSet.Add(startIndex); + triQueue.Clear(); + triQueue.Enqueue(startIndex); + layerList.Clear(); + int openCount = 0; + int closeCount = 0; + + //Debug.Log($"ƒĴ‚¤ƒ¤ƒĵèµ·ç‚ı:{startIndex}"); + + // èµ·ç‚ıƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĉƒ…ċ ħ + while (triQueue.Count > 0) + { + // ïĵ‘¤ċ–‚Šċ‡ş— + int tindex = triQueue.Dequeue(); + var n = triangleNormals[tindex]; + int3 tri = triangles[tindex]; + layerList.Add(tindex); + + //Debug.Log($"ƒĴ‚¤ƒ¤ƒĵèµ·ç‚ı:{tindex}, tri:{tri}"); + + // 隣ĉŽƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ + int2x3 edges = new int2x3( + DataUtility.PackInt2(tri.xy), + DataUtility.PackInt2(tri.yz), + DataUtility.PackInt2(tri.zx) + ); + for (int i = 0; i < 3; i++) + { + int2 edge = edges[i]; + + if (edgeToTriangles.ContainsKey(edge) == false) + continue; + + foreach (var data in edgeToTriangles.GetValuesForKey(edge)) + { + int tindex2 = data; + + // ™§Ğċ‡Ĥ理ĉ¸ˆżŞ‚‰‚ı‚­ƒƒƒ— + if (useTriSet.Contains(tindex2)) + continue; + + // ċŒä¸€ƒĴ‚¤ƒ¤ƒĵċˆ¤ċšïĵˆƒˆƒİ‚¤‚˘ƒ³‚°ƒĞŞ™è§’ċşĤïĵ‰ + int3 tri2 = triangles[tindex2]; + var n2 = triangleNormals[tindex2]; + float ang = CalcTwoTriangleAngle(tri, tri2, edge); + //Debug.Log($"tindex2:{tindex2}, tri2:{tri2}, ang:{ang}"); + + // é˘è§’ċşĤŒä¸€ċšä¸ŠŞ‚‰°ä¸é€£çĥš¨—Ĥ‚ı‚­ƒƒƒ—™‚‹ + if (ang > sameSurfaceAngle) // 80.0f? + continue; + + // 面ĉ³•ç·šŒä¸€ċšĉ–ıċ‘‚’ċ‘‚ˆ†ĞèŞżĉ•´™‚‹ + if (math.dot(n, n2) < 0.0f) + { + // ƒ•ƒŞƒƒƒ— + tri2 = MathUtility.FlipTriangle(tri2); + triangles[tindex2] = tri2; + triangleNormals[tindex2] = -n2; + //Debug.Log($"ƒ•ƒŞƒƒƒ—:{tri2}"); + } + + // 隣ĉŽƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĉ³•ç·šŒé–‹„Ĥ„‚‹‹é–‰˜Ĥ„‚‹‹‚Ğ‚Ĥƒ³ƒˆ + if (CheckTwoTriangleOpen(tri, tri2, edge, n)) + openCount++; + else + closeCount++; + + // ċŒä¸€ƒĴ‚¤ƒ¤ƒĵ¨—Ĥċ‡Ĥ理™‚‹ + useTriSet.Add(tindex2); + triQueue.Enqueue(tindex2); + } + } + } + + // 閉˜Ĥ„‚‹ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞğ†Œċ¤š„ċ ´ċˆŻƒĴ‚¤ƒ¤ƒĵċ…¨ä½“ĉ³•ç·š‚’ƒ•ƒŞƒƒƒ—•›‚‹ + //Debug.Log("layer tcnt:" + layerList.Count + " open:" + openCount + " close:" + closeCount); + if (closeCount > openCount) + { + foreach (int tindex in layerList) + { + triangles[tindex] = MathUtility.FlipTriangle(triangles[tindex]); + triangleNormals[tindex] = -triangleNormals[tindex]; + } + } + } + } + + + /// + /// ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĉ³•ç·š‚’ĉħ‚‚‚‹ + /// + [BurstCompile] + struct Proxy_CalcTriangleNormalJob : IJobParallelFor + { + [Unity.Collections.ReadOnly] + public NativeArray triangles; + [Unity.Collections.ReadOnly] + public NativeArray localPositins; + + [Unity.Collections.WriteOnly] + public NativeArray triangleNormals; + + public void Execute(int tindex) + { + int3 tri = triangles[tindex]; + + // ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĉ³•ç·š‚’ĉħ‚‚‚‹ + var p0 = localPositins[tri.x]; + var p1 = localPositins[tri.y]; + var p2 = localPositins[tri.z]; + var n = MathUtility.TriangleNormal(p0, p1, p2); + triangleNormals[tindex] = n; + } + } + + /// + /// ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĉŽç·š‚’ĉħ‚‚‚‹ + /// + [BurstCompile] + struct Proxy_CalcTriangleTangentJob : IJobParallelFor + { + [Unity.Collections.ReadOnly] + public NativeArray triangles; + [Unity.Collections.ReadOnly] + public NativeArray localPositins; + [Unity.Collections.ReadOnly] + public NativeArray uv; + + [Unity.Collections.WriteOnly] + public NativeArray triangleTangents; + + public void Execute(int tindex) + { + int3 tri = triangles[tindex]; + + // ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĉŽç·š‚’ĉħ‚‚‚‹ + var p0 = localPositins[tri.x]; + var p1 = localPositins[tri.y]; + var p2 = localPositins[tri.z]; + var uv0 = uv[tri.x]; + var uv1 = uv[tri.y]; + var uv2 = uv[tri.z]; + var tan = MathUtility.TriangleTangent(p0, p1, p2, uv0, uv1, uv2); + Develop.Assert(math.lengthsq(tan) > 0.0f); + triangleTangents[tindex] = tan; + } + } + + /// + /// 頂ç‚ı”¨ĞĉŽçĥš™‚‹ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ‚’ĉħ‚‚‚‹ïĵˆĉœ€ċ¤§ïĵ—¤ïĵ‰ + /// + [BurstCompile] + unsafe struct Proxy_CreateVertexToTrianglesJob : IJob + { + [Unity.Collections.ReadOnly] + public NativeArray triangles; + + public NativeArray> vertexToTriangles; + + public void Execute() + { + var ptr = (FixedList32Bytes*)vertexToTriangles.GetUnsafePtr(); + + int tcnt = triangles.Length; + for (uint tindex = 0; tindex < tcnt; tindex++) + { + int3 tri = triangles[(int)tindex]; + + var vset_x = (ptr + tri.x); + var vset_y = (ptr + tri.y); + var vset_z = (ptr + tri.z); + + if (vset_x->Length < 7) + vset_x->MC2Set(tindex); + if (vset_y->Length < 7) + vset_y->MC2Set(tindex); + if (vset_z->Length < 7) + vset_z->MC2Set(tindex); + } + } + } + + /// + /// ĉŽçĥšƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ‹‚‰é ‚ç‚ıĉ³•ç·šĉŽç·š‚’計痁™‚‹Ÿ‚Ğĉœ€éİŞƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĉ–ıċ‘‚’計痁—Ĥĉ ĵ納™‚‹ + /// Ÿƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĞċħž™‚‹é ‚ç‚ıĞŻƒ•ƒİ‚°‚’çĞ‹Ĥ‚‹ + /// + [BurstCompile] + struct Proxy_OrganizeVertexToTrianglsJob : IJobParallelFor + { + public NativeArray> vertexToTriangles; + + [Unity.Collections.ReadOnly] + public NativeArray triangleNormals; + [Unity.Collections.ReadOnly] + public NativeArray triangleTangents; + + public NativeArray attributes; + + public void Execute(int vindex) + { + var tset = vertexToTriangles[vindex]; + int tcnt = tset.Length; + if (tcnt == 0) + return; + + // “é ‚ç‚ıŻƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĞċħž™‚‹ + var attr = attributes[vindex]; + attr.SetFlag(VertexAttribute.Flag_Triangle, true); + attributes[vindex] = attr; + + // šĉ™é€šĞçċœ¨ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ面ĉ³•ç·š‹‚‰é ‚ç‚ıĉ³•ç·š‚’ĉħ‚‚Ĥż‚‹ + float3 finalNormal = 0; + float3 finalTangent = 0; + for (int i = 0; i < tcnt; i++) + { + int tindex = (int)tset[i]; + finalNormal += triangleNormals[tindex]; + finalTangent += triangleTangents[tindex]; + } + + //if (math.length(finalTangent) < 0.5f) + // Debug.LogError($"vindex:{vindex} finalTangent:{finalTangent}"); + + // ĉ™é€šĞĉħ‚‚Ÿĉ³•ç·šŒçŸ­„ċ ´ċˆŻĉœ€éİŞĉ³•ç·š‚’ç—ċ‡ş™‚‹ + if (math.length(finalNormal) < 0.5f) + { + // ™ıĤĉŽçĥšƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ‚’ƒĞƒĵƒ— + // ƒĞƒĵƒ—ĉœ€ċˆƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ‚’ċŸşĉş–¨—Ĥĉ³•ç·šĉ–ıċ‘Ğä𖁃ˆƒİ‚¤‚˘ƒ³‚°ƒĞ‚’‚‚›Ĥż‚‹ + // ĉ³•ç·šċˆè¨ˆé•·•Œ‚‚£¨‚‚é•·„‚‚‚’ĉŽĦ用™‚‹ + float maxDist = -1; + finalNormal = 0; + + for (int i = 0; i < tcnt; i++) + { + // “ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ‚’ċŸşĉş–¨—Ĥ計痁™‚‹ + int tindex1 = (int)tset[i]; + float3 n = 0; + float3 tn1 = triangleNormals[tindex1]; + + for (int j = 0; j < tcnt; j++) + { + int tindex2 = (int)tset[j]; + if (tindex2 == tindex1) + continue; + + float3 tn2 = triangleNormals[tindex2]; + if (math.dot(tn1, tn2) >= 0.0f) + n += tn2; + else + n += -tn2; + } + + // 計痁•‚ŒŸĉ³•ç·šé•·•‚’ċˆ¤ċš + // ĉœ€‚‚é•·„‚‚‚’ċŸşĉş–ĉ³•ç·š¨—ĤĉŽĦ用™‚‹ + float ndist = math.lengthsq(n); + if (ndist > maxDist) + { + maxDist = ndist; + finalNormal = tn1; + } + } + } + else + { + // “ĉ³•ç·š‚’ċŸşĉş–ĉ³•ç·š¨™‚‹ + finalNormal = math.normalize(finalNormal); + } + + // ĉ™é€šĞĉħ‚‚ŸĉŽç·šŒçŸ­„ċ ´ċˆŻĉœ€éİŞĉŽç·š‚’ç—ċ‡ş™‚‹ + if (math.length(finalTangent) < 0.5f) + { + // ™ıĤĉŽçĥšƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ‚’ƒĞƒĵƒ— + // ƒĞƒĵƒ—ĉœ€ċˆƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ‚’ċŸşĉş–¨—ĤĉŽç·šĉ–ıċ‘Ğä𖁃ˆƒİ‚¤‚˘ƒ³‚°ƒĞ‚’‚‚›Ĥż‚‹ + // ĉŽç·šċˆè¨ˆé•·•Œ‚‚£¨‚‚é•·„‚‚‚’ĉŽĦ用™‚‹ + float maxDist = -1; + finalTangent = 0; + + for (int i = 0; i < tcnt; i++) + { + // “ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ‚’ċŸşĉş–¨—Ĥ計痁™‚‹ + int tindex1 = (int)tset[i]; + float3 n = 0; + float3 tt1 = triangleTangents[tindex1]; + + for (int j = 0; j < tcnt; j++) + { + int tindex2 = (int)tset[j]; + if (tindex2 == tindex1) + continue; + + float3 tt2 = triangleTangents[tindex2]; + if (math.dot(tt1, tt2) >= 0.0f) + n += tt2; + else + n += -tt2; + } + + // 計痁•‚ŒŸĉŽç·šé•·•‚’ċˆ¤ċš + // ĉœ€‚‚é•·„‚‚‚’ċŸşĉş–ĉŽç·š¨—ĤĉŽĦ用™‚‹ + float ndist = math.lengthsq(n); + if (ndist > maxDist) + { + maxDist = ndist; + finalTangent = tt1; + } + } + } + else + { + // “ĉŽç·š‚’ċŸşĉş–¨™‚‹ + finalTangent = math.normalize(finalTangent); + } + + // ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ‚’ç™ğ録™‚‹ + // ċŒĉ™‚Ğĉ³•ç·š¨ĉŽç·šċŠ ç—ĉ–ıċ‘‚’ƒ•ƒİ‚°¨—Ĥèż½ċŠ ™‚‹ + for (int i = 0; i < tcnt; i++) + { + int tindex = (int)tset[i]; + + float3 tn = triangleNormals[tindex]; + float3 tt = triangleTangents[tindex]; + + // ċèğ˘ƒ•ƒİ‚° + int flipFlag = 0; + if (math.dot(finalNormal, tn) < 0.0f) + flipFlag |= 0x1; + if (math.dot(finalTangent, tt) < 0.0f) + flipFlag |= 0x2; + + // 12-20bit§uintĞƒ‘ƒƒ‚݁™‚‹ + tset[i] = DataUtility.Pack12_20(flipFlag, tindex); + } + + /* + // ç—ċ‡ş•‚ŒŸĉ³•ç·šċ‘Ğċˆ‚›‚‹‚ˆ†Ğƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ‚’ç™ğ録™‚‹ + // ċèğ˘ċ ´ċˆŻƒž‚¤ƒŠ‚ı‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı§ç™ğ録™‚‹ + for (int i = 0; i < tcnt; i++) + { + int tindex = tset[i]; + + float3 tn = triangleNormals[tindex]; + + // ċŸşĉş–ĉ³•ç·š¨é€†ċ‘Ş‚‰ƒž‚¤ƒŠ‚ı‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı¨—Ĥ記録™‚‹ + // ★‚¤ƒ³ƒ‡ƒƒ‚Ż‚ıŻïĵ‹ïĵ‘—Ĥ記録™‚‹§ĉ³¨ĉ„ïĵïĵˆïĵ‚’除ċ¤–™‚‹Ÿ‚ïĵ‰ + int registTriangleIndex = math.dot(finalNormal, tn) >= 0.0f ? (tindex + 1) : -(tindex + 1); + + // ċ†ç™ğ録 + tset[i] = registTriangleIndex; + } + */ + + // 結ĉžœĉ ĵ納 + vertexToTriangles[vindex] = tset; + } + } + + /// + /// çċœ¨ƒĦƒƒ‚·ƒé ‚ç‚ıĉ³•ç·šĉŽç·š‚’ĉŽçĥšƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĉƒ…ċ ħ‹‚‰ĉ›´ĉ–°™‚‹ + /// + [BurstCompile] + struct Proxy_CalcVertexNormalTangentFromTriangleJob : IJobParallelFor + { + [Unity.Collections.ReadOnly] + public NativeArray triangleNormals; + [Unity.Collections.ReadOnly] + public NativeArray triangleTangents; + + [Unity.Collections.ReadOnly] + public NativeArray> vertexToTriangles; + public NativeArray localNormals; + public NativeArray localTangents; + + public void Execute(int vindex) + { + var tset = vertexToTriangles[vindex]; + int tcnt = tset.Length; + if (tcnt > 0) + { + float3 nor = 0; + float3 tan = 0; + + for (int i = 0; i < tcnt; i++) + { + // 12-20bitƒ‘ƒƒ‚݁§ĉ ĵ納•‚ŒĤ„‚‹ + uint data = tset[i]; + int flipFlag = DataUtility.Unpack12_20Hi(data); + int tindex = DataUtility.Unpack12_20Low(data); + + nor += triangleNormals[tindex] * ((flipFlag & 0x1) == 0 ? 1 : -1); + tan += triangleTangents[tindex] * ((flipFlag & 0x2) == 0 ? 1 : -1); + + //int data = tset[i]; + //int tindex = math.abs(data) - 1; + + // ĉ³•ç·šƒ•ƒŞƒƒƒ—ƒ•ƒİ‚° + //float flip = math.sign(data); + + //nor += triangleNormals[tindex] * flip; + //tan += triangleTangents[tindex]; // ĉŽç·šŻƒ•ƒŞƒƒƒ—•›ĤŻé§„ç›ïĵ + } + + nor = math.normalize(nor); + + // ċ“ĉ³•ç·šĞċ¤‰ĉ›´(v2.1.7) + //tan = math.normalize(tan); + float3 binor = math.normalize(math.cross(nor, tan)); + + localNormals[vindex] = nor; + //localTangents[vindex] = tan; + localTangents[vindex] = binor; // ċ“ĉ³•ç·šĞċ¤‰ĉ›´(v2.1.7) + } + } + } + + [BurstCompile] + struct Proxy_CalcVertexToTransformJob : IJobParallelFor + { + public quaternion invRot; + + // vmesh + [Unity.Collections.ReadOnly] + public NativeArray localNormals; + [Unity.Collections.ReadOnly] + public NativeArray localTangents; + [Unity.Collections.WriteOnly] + public NativeArray vertexToTransformRotations; + + // transform + [Unity.Collections.ReadOnly] + public NativeArray transformRotations; + + public void Execute(int vindex) + { + // ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ƒ­ƒĵ‚ЃĞċ›žèğ˘ + var trot = math.mul(invRot, transformRotations[vindex]); + + // 頂ç‚ıƒ­ƒĵ‚ЃĞċ›žèğ˘ + var vrot = MathUtility.ToRotation(localNormals[vindex], localTangents[vindex]); + + // 頂ç‚ıƒ­ƒĵ‚ЃĞċ›žèğ˘‚’ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ƒ­ƒĵ‚ЃĞċ›žèğ˘Ğċİċ…ƒ™‚‹ċ›žèğ˘‚’ĉħ‚‚‚‹ + var toRot = math.mul(math.inverse(vrot), trot); + + vertexToTransformRotations[vindex] = toRot; + } + } + + /// + /// ‚¨ƒƒ‚¸”¨ĉŽçĥšƒˆƒİ‚¤‚˘ƒ³‚°ƒĞƒžƒƒƒ—‚’作ĉˆ™‚‹ + /// + [BurstCompile] + struct Proxy_CalcEdgeToTriangleJob : IJob + { + public int tcnt; + [Unity.Collections.ReadOnly] + public NativeArray triangles; + public NativeParallelMultiHashMap edgeToTriangles; + + public void Execute() + { + for (int i = 0; i < tcnt; i++) + { + var tri = triangles[i]; + int2x3 edges = new int2x3( + DataUtility.PackInt2(tri.xy), + DataUtility.PackInt2(tri.yz), + DataUtility.PackInt2(tri.zx) + ); + for (int j = 0; j < 3; j++) + { + int2 edge = edges[j]; + edgeToTriangles.MC2UniqueAdd(edge, (ushort)i); + } + } + } + } + + /// + /// 頂ç‚ıƒ‚¤ƒ³ƒ‰ƒƒĵ‚ş‚’ĉħ‚‚‚‹ + /// + [BurstCompile] + struct Proxy_CalcVertexBindPoseJob2 : IJobParallelFor + { + [Unity.Collections.ReadOnly] + public NativeArray localPositions; + [Unity.Collections.ReadOnly] + public NativeArray localNormals; + [Unity.Collections.ReadOnly] + public NativeArray localTangents; + + [Unity.Collections.WriteOnly] + public NativeArray vertexBindPosePositions; + [Unity.Collections.WriteOnly] + public NativeArray vertexBindPoseRotations; + + public void Execute(int vindex) + { + float3 lpos = localPositions[vindex]; + var lnor = localNormals[vindex]; + var ltan = localTangents[vindex]; + + // ƒžƒƒƒ”ƒ³‚°ç”¨é ‚ç‚ıƒ‚¤ƒ³ƒ‰ƒƒĵ‚ş‚’ĉħ‚‚‚‹ + quaternion rot = MathUtility.ToRotation(lnor, ltan); + vertexBindPosePositions[vindex] = -lpos; + vertexBindPoseRotations[vindex] = math.inverse(rot); + } + } + + /// + /// ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĞĉŽçĥš™‚‹é ‚ç‚ı‚ğƒƒƒˆ‚’ĉħ‚‚‚‹ + /// Š‚ˆ³‚¨ƒƒ‚¸‚ğƒƒƒˆ‚’作ĉˆ™‚‹ + /// + [BurstCompile] + struct Proxy_CalcVertexToVertexFromTriangleJob : IJob + { + public int triangleCount; + + [Unity.Collections.ReadOnly] + public NativeArray triangles; + public NativeParallelMultiHashMap vertexToVertexMap; + public NativeParallelHashSet edgeSet; + + public void Execute() + { + for (int i = 0; i < triangleCount; i++) + { + int3 tri = triangles[i]; + + ushort x = (ushort)tri.x; + ushort y = (ushort)tri.y; + ushort z = (ushort)tri.z; + + vertexToVertexMap.MC2UniqueAdd(tri.x, y); + vertexToVertexMap.MC2UniqueAdd(tri.x, z); + vertexToVertexMap.MC2UniqueAdd(tri.y, x); + vertexToVertexMap.MC2UniqueAdd(tri.y, z); + vertexToVertexMap.MC2UniqueAdd(tri.z, x); + vertexToVertexMap.MC2UniqueAdd(tri.z, y); + + edgeSet.Add(DataUtility.PackInt2(tri.xy)); + edgeSet.Add(DataUtility.PackInt2(tri.yz)); + edgeSet.Add(DataUtility.PackInt2(tri.zx)); + } + } + } + + /// + /// ƒİ‚¤ƒ³ĞĉŽçĥš™‚‹é ‚ç‚ı‚ğƒƒƒˆ‚’ĉħ‚‚‚‹ + /// Š‚ˆ³‚¨ƒƒ‚¸‚ğƒƒƒˆ‚’作ĉˆ™‚‹ + /// + [BurstCompile] + struct Proxy_CalcVertexToVertexFromLineJob : IJob + { + public int lineCount; + + [Unity.Collections.ReadOnly] + public NativeArray lines; + public NativeParallelMultiHashMap vertexToVertexMap; + public NativeParallelHashSet edgeSet; + + public void Execute() + { + for (int i = 0; i < lineCount; i++) + { + int2 line = lines[i]; + + vertexToVertexMap.MC2UniqueAdd(line.x, (ushort)line.y); + vertexToVertexMap.MC2UniqueAdd(line.y, (ushort)line.x); + + edgeSet.Add(DataUtility.PackInt2(line)); + } + } + } + + [BurstCompile] + struct Proxy_CreateEdgeFlagJob : IJobParallelFor + { + [Unity.Collections.ReadOnly] + public NativeArray edges; + [Unity.Collections.ReadOnly] + public NativeParallelMultiHashMap edgeToTriangles; + + [Unity.Collections.WriteOnly] + public NativeArray edgeFlags; + + public void Execute(int eindex) + { + var flag = new ExBitFlag8(); + + // ċˆ‡‚Šċ£‚¨ƒƒ‚¸‹ċˆ¤ċš™‚‹ + var edge = edges[eindex]; + if (edgeToTriangles.ContainsKey(edge)) + { + if (edgeToTriangles.CountValuesForKey(edge) <= 1) + { + flag.SetFlag(EdgeFlag_Cut, true); + //Debug.Log($"ċˆ‡‚Šċ£‚¨ƒƒ‚¸. eindex:{eindex}, edge:{edge}"); + } + } + + edgeFlags[eindex] = flag; + } + } + + //========================================================================================= + struct SkinningBoneInfo + { + //public int transformIndex; + public int parentTransformIndex; + public float3 parentPos; + public int childTransformIndex; + public float3 childPos; + } + + /// + /// ‚Ğ‚ı‚żƒ ‚ı‚­ƒ‹ƒ³‚°ĉƒ…ċ ħä½œĉˆ + /// + void CreateCustomSkinning(CustomSkinningSettings setting, List bones) + { + if (CustomSkinningBoneCount == 0) + return; + + // ƒœƒĵƒ³ĉƒ…ċ ħĉ§‹ç݉ + using var boneInfoList = new NativeList(CustomSkinningBoneCount * 2, Allocator.Persistent); + for (int i = 0; i < CustomSkinningBoneCount; i++) + { + int tindex = customSkinningBoneIndices[i]; + if (tindex == -1) + continue; + +#if MC2_CUSTOM_SKINNING_V1 + // ĉ—§ + int pid = bones[i].pid; + if (pid == 0) + continue; + int pindex = bones.FindIndex(x => x.id == pid); + if (pindex < 0) + continue; + + // ƒœƒĵƒ³ƒİ‚¤ƒ³ĉƒ…ċ ħä½œĉˆ + // localPositonŻ‚Żƒ­‚ıçİşé–“§ċş§ĉ¨™Ğċ¤‰ĉ›ĉ¸ˆż + var info = new SkinningBoneInfo(); + info.parentTransformIndex = customSkinningBoneIndices[pindex]; + info.parentPos = bones[pindex].localPosition; + info.childTransformIndex = tindex; + info.childPos = bones[i].localPosition; + + // è·é›˘ŒğĵïĵŞ‚‰ç„ĦċŠı + if (math.distance(info.parentPos, info.childPos) < Define.System.Epsilon) + continue; +#else + // V2 + var info = new SkinningBoneInfo(); + info.childTransformIndex = tindex; + info.childPos = bones[i].localPosition; +#endif + + // ç™ğ録 + boneInfoList.Add(info); + //Debug.Log($"[{boneInfoList.Length - 1}] parent:{pindex} -> {i}"); + } + if (boneInfoList.Length == 0) + return; + + // 頂ç‚ı”¨Ğ‚Ğ‚ı‚żƒ ‚ı‚­ƒ‹ƒ³‚°‚Ĥ‚¨‚¤ƒˆ‚’ç—ċ‡ş +#if MC2_CUSTOM_SKINNING_V1 + // ĉ—§ + var job = new Proxy_CalcCustomSkinningWeightsJob() + { + isBoneCloth = isBoneCloth, + angularAttenuation = Define.System.CustomSkinningAngularAttenuation, + distanceReduction = Define.System.CustomSkinningDistanceReduction, + distancePow = Define.System.CustomSkinningDistancePow, + + attributes = attributes.GetNativeArray(), + localPositions = localPositions.GetNativeArray(), + boneInfoList = boneInfoList, + boneWeights = boneWeights.GetNativeArray(), + }; +#else + // V2 + var job = new Proxy_CalcCustomSkinningWeightsJobV2() + { + isBoneCloth = isBoneCloth, + angularAttenuation = Define.System.CustomSkinningAngularAttenuation, + distanceReduction = Define.System.CustomSkinningDistanceReduction, + distancePow = Define.System.CustomSkinningDistancePow, + + attributes = attributes.GetNativeArray(), + localPositions = localPositions.GetNativeArray(), + boneInfoList = boneInfoList, + boneWeights = boneWeights.GetNativeArray(), + }; +#endif + job.Run(VertexCount); + } + +#if !MC2_CUSTOM_SKINNING_V1 + // V2 + [BurstCompile] + struct Proxy_CalcCustomSkinningWeightsJobV2 : IJobParallelFor + { + public bool isBoneCloth; + public float angularAttenuation; + public float distanceReduction; + public float distancePow; + + [Unity.Collections.ReadOnly] + public NativeArray attributes; + [Unity.Collections.ReadOnly] + public NativeArray localPositions; + [Unity.Collections.ReadOnly] + public NativeList boneInfoList; + [Unity.Collections.WriteOnly] + public NativeArray boneWeights; + + // ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒé ‚ç‚ı”¨ + public void Execute(int vindex) + { + // ç§ğċ‹•ċħžĉ€§ż + if (attributes[vindex].IsDontMove()) + return; + + var lpos = localPositions[vindex]; + + var costList = new ExCostSortedList4(-1); + int bcnt = boneInfoList.Length; + for (int i = 0; i < bcnt; i++) + { + var binfo = boneInfoList[i]; + var bpos = binfo.childPos; + int boneIndex = binfo.childTransformIndex; + + // è·é›˘ + var v = lpos - bpos; + float dist = math.length(v); + + // ç™ğ録€‚™§Ğç™ğ録ĉ¸ˆżŞ‚‰°distŒ‚ˆ‚Šċ°•„ċ ´ċˆżċ†ç™ğ録 + int nowIndex = costList.indexOf(boneIndex); + if (nowIndex >= 0) + { + if (dist < costList.costs[nowIndex]) + { + costList.RemoveItem(boneIndex); + costList.Add(dist, boneIndex); + } + } + else + costList.Add(dist, boneIndex); + } + + // (1)ĉœ€ċ°è·é›˘n%‚’ĉ¸›ç—™‚‹ + int cnt = costList.Count; + float mindist = costList.MinCost * distanceReduction; // 0.6 + for (int i = 0; i < cnt; i++) + costList.costs[i] = costList.costs[i] - mindist; + + // (2)distance‚’näı—™‚‹ + for (int i = 0; i < cnt; i++) + costList.costs[i] = math.pow(costList.costs[i], distancePow); // 2.0 + + // ‚Ĥ‚¨‚¤ƒˆç—ċ‡ş + if (costList.MinCost < Define.System.Epsilon) + { + costList.costs = new float4(1, 0, 0, 0); + costList.data = new int4(costList.data[0], 0, 0, 0); + } + else + { + // ‚³‚ıƒˆé€†ĉ•°ċˆè¨ˆ + cnt = costList.Count; + float sum = 0; + for (int i = 0; i < cnt; i++) + { + sum += 1.0f / costList.costs[i]; + } + + // 1.0fĞĉ­£èĤċŒ– + for (int i = 0; i < cnt; i++) + { + costList.costs[i] = (1.0f / costList.costs[i]) / sum; + } + + // ĉµċ°‚Ĥ‚¨‚¤ƒˆŻċ‰Šé™¤™‚‹ + const float InvalidWeight = 0.001f; // 0.1% + sum = 0; + for (int i = 0; i < 4; i++) + { + if (costList.costs[i] < InvalidWeight || i >= cnt) + { + // ĉ‰“Ħċˆ‡‚Š + costList.costs[i] = 0.0f; + costList.data[i] = 0; + } + else + { + sum += costList.costs[i]; + } + } + Debug.Assert(sum > 0); + costList.costs /= sum; // ċ†ċşĤ1.0ĉ­£èĤċŒ– + } + //Debug.Log($"[{vindex}] :{costList}"); + + // ‚Ĥ‚¨‚¤ƒˆĉ§‹é€ ä½“Ğċ¤‰ĉ›—Ĥĉ ĵ納 + var bw = new VirtualMeshBoneWeight(costList.data, costList.costs); + boneWeights[vindex] = bw; + } + } +#endif + +#if MC2_CUSTOM_SKINNING_V1 + [BurstCompile] + struct Proxy_CalcCustomSkinningWeightsJob : IJobParallelFor + { + public bool isBoneCloth; + public float angularAttenuation; + public float distanceReduction; + public float distancePow; + + [Unity.Collections.ReadOnly] + public NativeArray attributes; + [Unity.Collections.ReadOnly] + public NativeArray localPositions; + [Unity.Collections.ReadOnly] + public NativeList boneInfoList; + [Unity.Collections.WriteOnly] + public NativeArray boneWeights; + + // ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒé ‚ç‚ı”¨ + public void Execute(int vindex) + { + // BoneCloth‚Ğ‚ı‚żƒ ‚ı‚­ƒ‹ƒ³‚°§Żċ›şċšŻċ‹•‹•Ş„ + if (isBoneCloth && attributes[vindex].IsFixed()) + return; + + var lpos = localPositions[vindex]; + + var costList = new ExCostSortedList4(-1); + int bcnt = boneInfoList.Length; + for (int i = 0; i < bcnt; i++) + { + var binfo = boneInfoList[i]; + float3 d = MathUtility.ClosestPtPointSegment(lpos, binfo.parentPos, binfo.childPos); + //float dist = math.distance(lpos, d); + + // ƒœƒĵƒ³ƒİ‚¤ƒ³¨è§’ċşĤĞ‚ˆ‚Šċˆ¤ċšè·é›˘‚’èŞżĉ•´™‚‹ + // ƒİ‚¤ƒ³¨ĉ°´ċı³ĞŞ‚‹ğİċ½ħ響Œ‚ˆ‚Ş‚‹ + var v = lpos - d; + var bv = binfo.childPos - binfo.parentPos; + float dot = math.dot(math.normalize(v), math.normalize(bv)); + float ratio = 1.0f + math.abs(dot) * angularAttenuation; // 1.0 + + // ç™ğ録€‚™§Ğç™ğ録ĉ¸ˆżŞ‚‰°distŒ‚ˆ‚Šċ°•„ċ ´ċˆżċ†ç™ğ録 + for (int j = 0; j < 2; j++) + { + int boneIndex = j == 0 ? binfo.parentTransformIndex : binfo.childTransformIndex; + float dist = j == 0 ? math.distance(lpos, binfo.parentPos) : math.distance(lpos, binfo.childPos); + dist *= ratio; + + int nowIndex = costList.indexOf(boneIndex); + if (nowIndex >= 0) + { + if (dist < costList.costs[nowIndex]) + { + costList.RemoveItem(boneIndex); + costList.Add(dist, boneIndex); + } + } + else + costList.Add(dist, boneIndex); + } + } + + // ‚Ĥ‚¨‚¤ƒˆç—ċ‡ş + // (0)ĉœ€ċ°è·é›˘n%‚’ĉ¸›ç—™‚‹ + int cnt = costList.Count; + float mindist = costList.MinCost * distanceReduction; // 0.6 + costList.costs -= mindist; + + // (1)distance‚’näı—™‚‹ + costList.costs = math.pow(costList.costs, distancePow); // 2.0 + + // (2)ĉœ€ċ°ċ€¤é€†ĉ•°Ğ™‚‹ + float min = math.max(costList.MinCost, 1e-06f); + float sum = 0; + for (int i = 0; i < cnt; i++) + { + costList.costs[i] = min / costList.costs[i]; + sum += costList.costs[i]; + } + + // (3)ċ‰²ċˆ‚’ċ‡ş™ + costList.costs /= sum; + + // (4)ĉµċ°‚Ĥ‚¨‚¤ƒˆŻċ‰Šé™¤™‚‹ + sum = 0; + for (int i = 0; i < 4; i++) + { + if (costList.costs[i] < 0.01f || i >= cnt) + { + // ĉ‰“Ħċˆ‡‚Š + costList.costs[i] = 0.0f; + costList.data[i] = 0; + } + else + { + sum += costList.costs[i]; + } + } + Debug.Assert(sum > 0); + + // (5)ċ†ċşĤ1.0Ğċı³ċ‡ċŒ– + costList.costs /= sum; + + //Debug.Log($"[{vindex}] :{costList}"); + + // ‚Ĥ‚¨‚¤ƒˆä½œĉˆ + var bw = new VirtualMeshBoneWeight(costList.data, costList.costs); + boneWeights[vindex] = bw; + } + } +#endif + + //========================================================================================= + /// + /// ‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚żċħžĉ€§‚’ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒĞċĉ˜ •›‚‹ïĵˆ‚ıƒĴƒƒƒ‰ċŻïĵ‰ + /// + /// + public void ApplySelectionAttribute(SelectionData selectionData) + { + try + { + //Debug.Log($"ApplySelection.SearchRadius:{searchRadius}"); + + using var selectionPositions = selectionData.GetPositionNativeArray(); + using var selectionAttributes = selectionData.GetAttributeNativeArray(); + + // ‚°ƒŞƒƒƒ‰‚µ‚¤‚şè¨ˆç— + // ĉ¤œç´˘ċŠċ„ïĵˆƒĦƒƒ‚·ƒċı³ċ‡ĉŽçĥšè·é›˘¨‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚żĉœ€ċ¤§ĉŽçĥšè·é›˘ċ¤§„ĉ–ıïĵ‰ + float searchRadius = math.max(averageVertexDistance.Value, selectionData.maxConnectionDistance); + searchRadius = math.max(searchRadius, Define.System.MinimumGridSize); + float gridSize = searchRadius * 1.5f; + //Develop.DebugLog($"ApplySelectionAttribute. searchRadius:{searchRadius}, gridSize:{gridSize}"); + + // ‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚ż‚’‚°ƒŞƒƒƒ‰ƒžƒƒƒ—Ğĉ ĵ納™‚‹ + using var gridMap = SelectionData.CreateGridMapRun(gridSize, selectionPositions, selectionAttributes); + + // ƒĦƒƒ‚·ƒé ‚ç‚ı”¨Ğĉœ€‚‚èż‘„‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚żĞĉŽçĥš—é ‚ç‚ıċħžĉ€§‚’ĉħşċš™‚‹ + var applyJob = new Proxy_ApplySelectionJob() + { + gridSize = gridSize, + radius = searchRadius, + localPositions = localPositions.GetNativeArray(), + attributes = attributes.GetNativeArray(), + + gridMap = gridMap.GetMultiHashMap(), + selectionPositions = selectionPositions, + selectionAttributes = selectionAttributes, + }; + applyJob.Run(VertexCount); + + // BoneClothċ ´ċˆŻTransformĉ›¸èĵżĉ–ıĉ³•‚’TransformFlagĞ設ċš™‚‹ + if (isBoneCloth) + { + var transformFlagJob = new Proxy_BoneClothApplayTransformFlagJob() + { + attributes = attributes.GetNativeArray(), + transformFlags = transformData.flagArray.GetNativeArray(), + }; + transformFlagJob.Run(VertexCount); + } + } + catch (Exception) + { + result.SetError(Define.Result.ProxyMesh_ApplySelectionError); + } + } + + [BurstCompile] + struct Proxy_ApplySelectionJob : IJobParallelFor + { + public float gridSize; + public float radius; + + // proxy mesh + [Unity.Collections.ReadOnly] + public NativeArray localPositions; + public NativeArray attributes; + + // selection + [Unity.Collections.ReadOnly] + public NativeParallelMultiHashMap gridMap; + [Unity.Collections.ReadOnly] + public NativeArray selectionPositions; + [Unity.Collections.ReadOnly] + public NativeArray selectionAttributes; + + public void Execute(int vindex) + { + float3 pos = localPositions[vindex]; + + // ċħžĉ€§ƒ•ƒİ‚°Ż™§Ğ設ċš•‚ŒĤ„‚‹ċ ´ċˆŒ‚‚‹§èż½ċŠ ĉ›¸èĵżĞ™‚‹ + var attr = attributes[vindex]; + + // 範ċ›²‚°ƒŞƒƒƒ‰èµ°ĉŸğ + float minDist = float.MaxValue; + //VertexAttribute minAttr = default; + VertexAttribute minAttr = VertexAttribute.Invalid; + foreach (int3 grid in GridMap.GetArea(pos, radius, gridMap, gridSize)) + { + if (gridMap.ContainsKey(grid) == false) + continue; + + // “‚°ƒŞƒƒƒ‰‚’ĉ¤œç´˘™‚‹ + foreach (int tindex in gridMap.GetValuesForKey(grid)) + { + // è·é›˘ċˆ¤ċš + float3 tpos = selectionPositions[tindex]; + float dist = math.distance(pos, tpos); + if (dist > radius) + continue; + if (dist > minDist) + continue; + + // èż‘ċ‚ċħžĉ€§ + minDist = dist; + minAttr = selectionAttributes[tindex]; + } + } + + // ċħžĉ€§ċĉ˜  + //if (minAttr.IsInvalid()) + // minAttr = VertexAttribute.Fixed; // InvalidŻFixedĞċ¤‰ĉ› + //Debug.Log($"vindex:{vindex} minAttr:{minAttr.Value:X}"); + attr.SetFlag(minAttr, true); // ƒ•ƒİ‚°çµċˆ + attributes[vindex] = attr; + } + } + + [BurstCompile] + struct Proxy_BoneClothApplayTransformFlagJob : IJobParallelFor + { + [Unity.Collections.ReadOnly] + public NativeArray attributes; + + public NativeArray transformFlags; + + public void Execute(int vindex) + { + var attr = attributes[vindex]; + + var flag = transformFlags[vindex]; + + // ĉ›¸èĵżĉ–ıĉ³• + if (attr.IsMove()) + flag.SetFlag(TransformManager.Flag_LocalPosRotWrite, true); + else if (attr.IsFixed()) + flag.SetFlag(TransformManager.Flag_WorldRotWrite, true); + + // ċİċ…ƒ + if (attr.IsInvalid() == false) + flag.SetFlag(TransformManager.Flag_Restore, true); + + transformFlags[vindex] = flag; + } + } + + //----------------------------------------------------------------------------------------- + /// + /// [MeshCloth]ƒ™ƒĵ‚ıƒİ‚¤ƒ³ä½œĉˆ + /// 頂ç‚ıĉŽçĥšĉƒ…ċ ħ‹‚‰èĤŞĉƒ…ċ ħ‚’作ĉˆ™‚‹ + /// + void CreateMeshBaseLine() + { + int vcnt = VertexCount; + vertexParentIndices = new NativeArray(vcnt, Allocator.Persistent); + using var dataBuilder = new MultiDataBuilder(vcnt, vcnt); + + // èĤŞĉŽçĥš‚’(-1)§ċˆĉœŸċŒ–™‚‹ + JobUtility.FillRun(vertexParentIndices, vcnt, -1); + + // ċ›şċšé ‚ç‚ıƒŞ‚ıƒˆ‚’作ĉˆ™‚‹ + using var fixedList = new NativeList(vcnt, Allocator.Persistent); + var job1 = new BaseLine_Mesh_CareteFixedListJob() + { + vcnt = vcnt, + attribues = attributes.GetNativeArray(), + fixedList = fixedList, + }; + job1.Run(); + + // ċ›şċšĉ•°ŒïĵŞ‚‰°ƒ™ƒĵ‚ıƒİ‚¤ƒ³Żä½œ‚ŒŞ„ïĵ + if (fixedList.Length == 0) + { + //Debug.LogWarning("BaseLine.fixedPoint count = 0!"); + vertexChildIndexArray = new NativeArray(vcnt, Allocator.Persistent, NativeArrayOptions.ClearMemory); + vertexChildDataArray = new NativeArray(0, Allocator.Persistent); + return; + } + + // 頂ç‚ıĉŽçĥšĉƒ…ċ ħ‹‚‰èĤŞĉŽçĥš‚’作ĉˆ™‚‹ + using var nextList = new NativeList(vcnt, Allocator.Persistent); + using var markBuff = new NativeArray(vcnt, Allocator.Persistent, NativeArrayOptions.ClearMemory); // Unity2023.1.5ċŻċżœ + using var vertexMap = new NativeParallelHashMap(vcnt, Allocator.Persistent); // Unity2023.1.5ċŻċżœ + var job2 = new BaseLine_Mesh_CreateParentJob2() + { + vcnt = vcnt, + avgDist = averageVertexDistance.Value, + + attribues = attributes.GetNativeArray(), + localPositions = localPositions.GetNativeArray(), + vertexToVertexIndexArray = vertexToVertexIndexArray, + vertexToVertexDataArray = vertexToVertexDataArray, + + vertexParentIndices = vertexParentIndices, + vertexChildMap = dataBuilder.Map, + + fixedList = fixedList, + nextList = nextList, + + markBuff = markBuff, // Unity2023.1.5ċŻċżœ + vertexMap = vertexMap, // Unity2023.1.5ċŻċżœ + }; + job2.Run(); + + // ƒ™ƒĵ‚ıƒİ‚¤ƒ³ĉ§‹ç݉ + var stack = new Stack(vcnt); + var lineFlags = new List(fixedList.Length); + var startIndices = new List(fixedList.Length); + var dataCounts = new List(fixedList.Length); + var indices = new List(vcnt); + for (int i = 0; i < fixedList.Length; i++) + { + int fvindex = fixedList[i]; + // ċ­ŒĉŽçĥš•‚ŒĤ„Ş„ċ›şċšé ‚ç‚ıŻç„ĦċŠı + if (dataBuilder.GetDataCount(fvindex) == 0) + continue; + + // “é ‚ç‚ı‚’èµ·ç‚ı¨—Ĥƒİ‚¤ƒ³‚’ċ½˘ĉˆ™‚‹ + stack.Clear(); + stack.Push(fvindex); + + ushort start = (ushort)indices.Count; + ushort count = 0; + ExBitFlag8 lineflag = new ExBitFlag8(); + + while (stack.Count > 0) + { + int vindex = stack.Pop(); + indices.Add((ushort)vindex); + count++; + + // “é ‚ç‚ıŒƒİ‚¤ƒ³Ğċħž—Ĥ„‚‹ċ ´ċˆŻƒ•ƒİ‚°‚’çĞ‹Ĥ‚‹ + if (attributes[vindex].IsSet(VertexAttribute.Flag_Triangle) == false) + { + lineflag.SetFlag(BaseLineFlag_IncludeLine, true); + } + + if (dataBuilder.Map.ContainsKey(vindex)) + { + foreach (var data in dataBuilder.Map.GetValuesForKey(vindex)) + { + stack.Push(data); + } + } + } + + // ĉ ĵ納 + lineFlags.Add(lineflag); + startIndices.Add(start); + dataCounts.Add(count); + //Debug.Log($"BaseLine data count:{count}"); + } + baseLineFlags = new NativeArray(lineFlags.ToArray(), Allocator.Persistent); + baseLineStartDataIndices = new NativeArray(startIndices.ToArray(), Allocator.Persistent); + baseLineDataCounts = new NativeArray(dataCounts.ToArray(), Allocator.Persistent); + baseLineData = new NativeArray(indices.ToArray(), Allocator.Persistent); + + (ushort[] dataArry, uint[] indexArray) = dataBuilder.ToArray(); + vertexChildIndexArray = new NativeArray(indexArray, Allocator.Persistent); + vertexChildDataArray = new NativeArray(dataArry, Allocator.Persistent); + } + + struct BaseLineWork : IComparable + { + public int vindex; + public float dist; + + public int CompareTo(BaseLineWork other) + { + return (int)math.sign(dist - other.dist); + } + } + + [BurstCompile] + struct BaseLine_Mesh_CreateParentJob2 : IJob + { + public int vcnt; + public float avgDist; + + [Unity.Collections.ReadOnly] + public NativeArray attribues; + [Unity.Collections.ReadOnly] + public NativeArray localPositions; + [Unity.Collections.ReadOnly] + public NativeArray vertexToVertexIndexArray; + [Unity.Collections.ReadOnly] + public NativeArray vertexToVertexDataArray; + + public NativeArray vertexParentIndices; + public NativeParallelMultiHashMap vertexChildMap; + + [Unity.Collections.ReadOnly] + public NativeList fixedList; + public NativeList nextList; + + public NativeArray markBuff; // Unity2023.1.5ċŻċżœ + public NativeParallelHashMap vertexMap; // Unity2023.1.5ċŻċżœ + + public void Execute() + { + // ċ‡Ĥ理ĉ¸ˆżƒžƒĵ‚Ż + //var markBuff = new NativeArray(vcnt, Allocator.Temp, NativeArrayOptions.ClearMemory); // Unity2023.1.5ċŻċżœ + //var vertexMap = new NativeParallelHashMap(vcnt, Allocator.Temp); // Unity2023.1.5ċŻċżœ + + // ĉœ€ċˆä½œĉ­ƒƒƒƒ•‚Ħ‚’ċ›şċšé ‚ç‚ı§ċˆĉœŸċŒ–™‚‹ + foreach (int vindex in fixedList) + { + nextList.Add(new BaseLineWork() { vindex = vindex, dist = 0 }); + } + int level = 0; + + while (nextList.Length > 0) + { + foreach (var data in nextList) + { + int vindex = data.vindex; + + // èĤށ¸ĉŽçĥš‚’作ĉˆ™‚‹ + var attr = attribues[vindex]; + if (attr.IsDontMove()) + continue; + + var pos = localPositions[vindex]; + + // ■èĤށŒċ›şċšŞ‚‰°è·é›˘Œèż‘„ĉ–ı€èĤށŒç§ğċ‹•Ş‚‰•‚‰ĞèĤށ¸ƒ™‚ŻƒˆƒĞ角ċşĤŒĉµ…„ĉ–ı‚’ĉŽĦ用™‚‹ + var cost = new ExCostSortedList1(-1, -1); + DataUtility.Unpack12_20(vertexToVertexIndexArray[vindex], out var dcnt, out var dstart); + for (int i = 0; i < dcnt; i++) + { + int tindex = vertexToVertexDataArray[dstart + i]; + if (markBuff[tindex] == 0) + continue; + var tpos = localPositions[tindex]; + + if (attribues[tindex].IsDontMove()) + { + // èĤށŒċ›şċšŞ‚‰è·é›˘ċ„Şċ…ˆ + float tdist = math.distance(pos, tpos); + cost.Add(tdist, tindex); + } + else + { + // èĤށèĤށ¸ƒ™‚ŻƒˆƒĞ + int pindex = vertexParentIndices[tindex]; + var v1 = tpos - pos; + var v2 = localPositions[pindex] - tpos; + float ang = MathUtility.Angle(v1, v2); + cost.Add(ang, tindex); + } + } + if (cost.IsValid) + { + int pindex = cost.data; + vertexParentIndices[vindex] = pindex; + markBuff[vindex] = 1; + } + } + + // ¨‚ + foreach (var data in nextList) + { + int vindex = data.vindex; + + // äğŠċ›ž‚ğƒƒƒˆ‚’ċ‡Ĥ理ĉ¸ˆż¨—Ĥƒžƒĵ‚݁™‚‹ + markBuff[vindex] = 2; + + // ċ­ĉŽçĥšĉƒ…ċ ħ‚’作ĉˆ + int pindex = vertexParentIndices[vindex]; + if (pindex >= 0) + { + vertexChildMap.MC2UniqueAdd(pindex, (ushort)vindex); + } + } + + // ĉĴĦä½œĉ­‚ğƒƒƒˆ‚’作ĉˆ™‚‹ + vertexMap.Clear(); + int mapcnt = 0; + foreach (var data in nextList) + { + int vindex = data.vindex; + + // è‡ŞèşĞĉŽçĥš‚’èŞżı‚‹ + DataUtility.Unpack12_20(vertexToVertexIndexArray[vindex], out var dcnt, out var dstart); + if (dcnt == 0) + continue; + + var pos = localPositions[vindex]; + + for (int i = 0; i < dcnt; i++) + { + int tindex = vertexToVertexDataArray[dstart + i]; + var tattr = attribues[tindex]; + if (tattr.IsInvalid()) + continue; + // ċ‡Ĥ理ĉ¸ˆżŞ‚‰é™¤ċ¤–™‚‹ + if (markBuff[tindex] != 0) + continue; + + // ĉĴĦċ€™è£œ¨—Ĥç™ğ録™‚‹ + float dist = math.distance(pos, localPositions[tindex]); + if (vertexMap.ContainsKey(tindex)) + { + var d = vertexMap[tindex]; + if (dist < d.dist) + { + d.dist = dist; + vertexMap[tindex] = d; + } + } + else + { + vertexMap.Add(tindex, new BaseLineWork() { vindex = tindex, dist = dist }); + mapcnt++; + } + } + } + + // nextƒŞ‚ıƒˆĉ§‹ç݉ + nextList.Clear(); + if (mapcnt > 0) + { + // Unity2023.1.5ċŻċżœ + //nextList.AddRange(vertexMap.GetValueArray(Allocator.Temp)); + foreach (var kv in vertexMap) + { + nextList.Add(kv.Value); + } + + // èĤށ¸è·é›˘ĉ˜‡é †Ğ‚½ƒĵƒˆ + nextList.Sort(); + } + + level++; + } + } + } + + /// + /// (Mesh)ċ›şċšƒ‚¤ƒ³ƒˆ‚’ƒŞ‚ıƒˆĞ™‚‹ + /// + [BurstCompile] + struct BaseLine_Mesh_CareteFixedListJob : IJob + { + public int vcnt; + [Unity.Collections.ReadOnly] + public NativeArray attribues; + + public NativeList fixedList; + + public void Execute() + { + for (int i = 0; i < vcnt; i++) + { + var attr = attribues[i]; + if (attr.IsFixed()) + { + fixedList.Add(i); + } + } + } + } + + //----------------------------------------------------------------------------------------- + /// + /// [BoneCloth]ƒ™ƒĵ‚ıƒİ‚¤ƒ³ĉƒ…ċ ħä½œĉˆ + /// BoneCloth§Żċ˜ç´”ĞTransformèĤŞċ­ĉ§‹é€ Œƒ™ƒĵ‚ıƒİ‚¤ƒ³¨Ş‚‹ + /// + void CreateTransformBaseLine() + { + int vcnt = VertexCount; + vertexParentIndices = new NativeArray(vcnt, Allocator.Persistent); + using var dataBuilder = new MultiDataBuilder(vcnt, vcnt * 2); + + // ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ĉƒ…ċ ħ‹‚‰èĤŞċ­é–˘äż‚‚’ĉ§‹ç݉™‚‹ + // parent + var idToIndexDict = new Dictionary(vcnt); + var idArray = transformData.idArray.GetNativeArray(); + var parentIdArray = transformData.parentIdArray.GetNativeArray(); + for (int i = 0; i < vcnt; i++) + { + idToIndexDict.Add(idArray[i], i); + } + for (int index = 0; index < vcnt; index++) + { + MagicaObjectId pid = parentIdArray[index]; + if (idToIndexDict.ContainsKey(pid)) + vertexParentIndices[index] = idToIndexDict[pid]; + else + vertexParentIndices[index] = -1; + } + + // child + var job = new BaseLine_Bone_CreateBoneChildInfoJob() + { + vcnt = vcnt, + parentIndices = vertexParentIndices, + childMap = dataBuilder.Map, + }; + job.Run(); + + // èĤŞċ­é–˘äż‚‹‚‰ƒ™ƒĵ‚ıƒİ‚¤ƒ³‚’ĉ§‹ç݉™‚‹ + int rootCount = transformData.RootCount; + Debug.Assert(rootCount > 0); + var rootStack = new Stack(vcnt); + var stack = new Stack(vcnt); + var lineFlags = new List(rootCount); + var startIndices = new List(rootCount); + var dataCounts = new List(rootCount); + var indices = new List(vcnt); + foreach (MagicaObjectId id in transformData.rootIdList) + { + // ƒĞƒĵƒˆ‹‚‰Transform‚’èµ°ĉŸğ—Ĥĉœ€ċˆç§ğċ‹•ƒ‚¤ƒ³ƒˆ‚’ĉŒ¤ċ›şċš‚’èµ·ç‚ı¨™‚‹ + rootStack.Clear(); + int rootIndex = idToIndexDict[id]; + rootStack.Push(rootIndex); + + while (rootStack.Count > 0) + { + int index0 = rootStack.Pop(); + var attr = attributes[index0]; + if (attr.IsDontMove() == false) + continue; + + // ċ­Ğç§ğċ‹•ŒċĞ‚Œ‚‹‹ƒ‚§ƒƒ‚Ż + bool hasMove = false; + foreach (var data in dataBuilder.Map.GetValuesForKey(index0)) + { + if (attributes[data].IsMove()) + hasMove = true; + } + + // ċ­Ğç§ğċ‹•ŒċĞ‚ŒŞ„ċ ´ċˆŻ•‚‰Ğĉ·ħĉ½œ‚‹ + if (hasMove == false) + { + foreach (var data in dataBuilder.Map.GetValuesForKey(index0)) + { + if (attributes[data].IsDontMove()) + rootStack.Push(data); + } + continue; + } + + // è‡ŞèşĞŒċ›şċš§ċ­Ğç§ğċ‹•ŒċĞ‚Œ‚‹ċ ´ċˆŻ““‚’ƒ™ƒĵ‚ıƒİ‚¤ƒ³èµ·ç‚ı¨—Ĥĉ§‹ç݉™‚‹ + stack.Clear(); + stack.Push(index0); + ushort start = (ushort)indices.Count; + ushort count = 0; + ExBitFlag8 lineflag = new ExBitFlag8(); + + while (stack.Count > 0) + { + int index = stack.Pop(); + indices.Add((ushort)index); + count++; + + // “é ‚ç‚ıŒƒİ‚¤ƒ³Ğċħž—Ĥ„‚‹ċ ´ċˆŻƒ•ƒİ‚°‚’çĞ‹Ĥ‚‹ + if (attributes[index].IsSet(VertexAttribute.Flag_Triangle) == false) + { + lineflag.SetFlag(BaseLineFlag_IncludeLine, true); + } + + // ċ­ + if (dataBuilder.Map.ContainsKey(index)) + { + foreach (var data in dataBuilder.Map.GetValuesForKey(index)) + { + // ç§ğċ‹•ċħžĉ€§äğċ¤–Żç„ĦèĤ–™‚‹ + if (attributes[data].IsDontMove()) + continue; + + stack.Push(data); + } + } + } + + // ĉ ĵ納 + lineFlags.Add(lineflag); + startIndices.Add(start); + dataCounts.Add(count); + } + } + baseLineFlags = new NativeArray(lineFlags.ToArray(), Allocator.Persistent); + baseLineStartDataIndices = new NativeArray(startIndices.ToArray(), Allocator.Persistent); + baseLineDataCounts = new NativeArray(dataCounts.ToArray(), Allocator.Persistent); + baseLineData = new NativeArray(indices.ToArray(), Allocator.Persistent); + + dataBuilder.ToNativeArray(out vertexChildIndexArray, out vertexChildDataArray); + } + + /// + /// (Bone)ƒ™ƒĵ‚ıƒİ‚¤ƒ³ä¸Šé ‚ç‚ı”¨ċ­é ‚ç‚ıƒŞ‚ıƒˆ‚’ĉħ‚‚‚‹ + /// + [BurstCompile] + struct BaseLine_Bone_CreateBoneChildInfoJob : IJob + { + public int vcnt; + + [Unity.Collections.ReadOnly] + public NativeArray parentIndices; + //[Unity.Collections.WriteOnly] + public NativeParallelMultiHashMap childMap; + + public void Execute() + { + // 頂ç‚ı”¨ċ­é ‚ç‚ı‚’èŞżı‚‹Ĥĉ ĵ納™‚‹ + for (int i = 0; i < vcnt; i++) + { + int pindex = parentIndices[i]; + if (pindex >= 0) + { + childMap.Add(pindex, (ushort)i); + } + } + } + } + + //----------------------------------------------------------------------------------------- + /// + /// (Mesh/Bone)ƒ™ƒĵ‚ıƒİ‚¤ƒ³ċŸşĉş–ċ§żċ‹˘‚’ĉħ‚‚‚‹ + /// + void CreateBaseLinePose() + { + int dataCount = baseLineData.Length; + vertexLocalPositions = new NativeArray(VertexCount, Allocator.Persistent); + vertexLocalRotations = new NativeArray(VertexCount, Allocator.Persistent); + var calcLinePoseJob = new BaseLine_CalcLocalPositionRotationJob() + { + attributes = attributes.GetNativeArray(), + parentIndices = vertexParentIndices, + localPositions = localPositions.GetNativeArray(), + localNormals = localNormals.GetNativeArray(), + localTangents = localTangents.GetNativeArray(), + baseLineIndices = baseLineData, + vertexLocalPositions = vertexLocalPositions, + vertexLocalRotations = vertexLocalRotations, + }; + calcLinePoseJob.Run(dataCount); + } + + /// + /// ƒ™ƒĵ‚ıƒİ‚¤ƒ³ċŸşĉş–ċ§żċ‹˘‚’ĉħ‚‚‚‹ + /// + [BurstCompile] + struct BaseLine_CalcLocalPositionRotationJob : IJobParallelFor + { + [NativeDisableParallelForRestriction] + public NativeArray attributes; + + [Unity.Collections.ReadOnly] + public NativeArray parentIndices; + [Unity.Collections.ReadOnly] + public NativeArray localPositions; + [Unity.Collections.ReadOnly] + public NativeArray localNormals; + [Unity.Collections.ReadOnly] + public NativeArray localTangents; + + + [Unity.Collections.ReadOnly] + public NativeArray baseLineIndices; + [NativeDisableParallelForRestriction] + [Unity.Collections.WriteOnly] + public NativeArray vertexLocalPositions; + [NativeDisableParallelForRestriction] + [Unity.Collections.WriteOnly] + public NativeArray vertexLocalRotations; + + public void Execute(int index) + { + int vindex = baseLineIndices[index]; + + int pvindex = parentIndices[vindex]; + if (pvindex >= 0) + { + float3 ppos = localPositions[pvindex]; + float3 pnor = localNormals[pvindex]; + float3 ptan = localTangents[pvindex]; + quaternion prot = MathUtility.ToRotation(pnor, ptan); + quaternion iprot = math.inverse(prot); + + float3 pos = localPositions[vindex]; + float3 nor = localNormals[vindex]; + float3 tan = localTangents[vindex]; + quaternion rot = MathUtility.ToRotation(nor, tan); + + float3 lpos = math.mul(iprot, pos - ppos); + quaternion lrot = math.mul(iprot, rot); + vertexLocalPositions[vindex] = lpos; + vertexLocalRotations[vindex] = lrot; + + // èĤށ¨‚ĵƒ­è·é›˘ċˆ¤ċš€‚ƒ•ƒİ‚°‚’çĞ‹Ĥ‚‹ + if (MathUtility.IsZeroDistance(lpos)) + { + var flag = attributes[vindex]; + flag.SetFlag(VertexAttribute.Flag_ZeroDistance, true); + attributes[vindex] = flag; + } + + //Debug.Log($"vertexLocalPositions [{vindex}] : {lpos}"); + //Debug.Log($"vertexLocalRotations [{vindex}] : {lrot}"); + } + else + { + vertexLocalPositions[vindex] = 0; + vertexLocalRotations[vindex] = quaternion.identity; + + //Debug.Log($"vertexLocalPositions [{vindex}] : 0"); + //Debug.Log($"vertexLocalRotations [{vindex}] : (0, 0, 0, 1)"); + } + } + } + + /// + /// 頂ç‚ı”¨ƒĞƒĵƒˆ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı¨ĉ·ħ•‚’ĉħ‚‚‚‹ + /// + void CreateVertexRootAndDepth() + { + // ƒ™ƒĵ‚ıƒİ‚¤ƒ³Œċ­˜ċœ¨—Ş¨‚‚配ċˆ—Żç”¨ĉ„™‚‹ + int vcnt = VertexCount; + vertexDepths = new NativeArray(vcnt, Allocator.Persistent); + vertexRootIndices = new NativeArray(vcnt, Allocator.Persistent); + + // 作ĉ­ƒƒƒƒ•‚Ħ + using var rootLengthArray = new NativeArray(vcnt, Allocator.Persistent); + + // 頂ç‚ı”¨ƒĞƒĵƒˆ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı¨ĉ·ħ•‚’計痁™‚‹ + var job = new BaseLine_CalcMaxBaseLineLengthJob() + { + vcnt = vcnt, + attribues = attributes.GetNativeArray(), + localPositions = localPositions.GetNativeArray(), + vertexParentIndices = vertexParentIndices, + + vertexDepths = vertexDepths, + vertexRootIndices = vertexRootIndices, + + rootLengthArray = rootLengthArray, + }; + job.Run(); + + } + + [BurstCompile] + struct BaseLine_CalcMaxBaseLineLengthJob : IJob + { + public int vcnt; + + [Unity.Collections.ReadOnly] + public NativeArray attribues; + [Unity.Collections.ReadOnly] + public NativeArray localPositions; + [Unity.Collections.ReadOnly] + public NativeArray vertexParentIndices; + + [Unity.Collections.WriteOnly] + public NativeArray vertexDepths; + [Unity.Collections.WriteOnly] + public NativeArray vertexRootIndices; + + public NativeArray rootLengthArray; + + + public void Execute() + { + float maxLen = 0; + + // ċ„ç§ğċ‹•é ‚ç‚ıƒĞƒĵƒˆ§è·é›˘‚’計痁™‚‹ + // Š‚ˆ³ƒĞƒĵƒˆé ‚ç‚ı‚’記録™‚‹ + for (int i = 0; i < vcnt; i++) + { + int rootIndex = -1; + float rootLen = 0; + + if (attribues[i].IsMove()) + { + int cindex = i; + int pindex = vertexParentIndices[cindex]; + while (pindex >= 0) + { + var pos = localPositions[cindex]; + var ppos = localPositions[pindex]; + float dist = math.distance(pos, ppos); + rootLen += dist; + rootIndex = pindex; + + // èĤށŒċ›şċšŞ‚‰°““ŒƒĞƒĵƒˆ¨Ş‚Šçµ‚了 + if (attribues[pindex].IsMove() == false) + break; + + // next + cindex = pindex; + pindex = vertexParentIndices[cindex]; + } + } + + vertexRootIndices[i] = rootIndex; + rootLengthArray[i] = rootLen; + + // ĉœ€ċ¤§è·é›˘ + maxLen = math.max(maxLen, rootLen); + } + + // ĉ·ħ•‚’ċ‰²‚Šċ‡ş™ + if (maxLen > Define.System.Epsilon) + { + for (int i = 0; i < vcnt; i++) + { + var rootLen = rootLengthArray[i]; + float depth = math.saturate(rootLen / maxLen); + vertexDepths[i] = depth; + } + } + } + } + + //========================================================================================= +#if false // pitch/yawċ€‹ċˆċˆĥ限Żv1.0§ŻċŸè£…—Ş„§ä¸€ĉ—Ĥċœĉ­˘ + /// + /// 角ċşĤċˆĥ限計ç—用ƒ­ƒĵ‚ЃĞċ›žèğ˘ç—ċ‡ş + /// + public void CreateAngleCalcLocalRotation(NormalCalcMode normalCalcMode, float3 normalCalcCenter) + { + if (VertexCount == 0) + return; + + // 配ċˆ—ċˆĉœŸċŒ– + vertexAngleCalcLocalRotations = new NativeArray(VertexCount, Allocator.Persistent); + JobUtility.FillRun(vertexAngleCalcLocalRotations, VertexCount, quaternion.identity); + + // 頂ç‚ı”¨Ğç—ċ‡ş™‚‹ + var job = new AngleCalcLocalRotationJob() + { + calcMode = normalCalcMode, + calcPoint = normalCalcCenter, + //calcPoint = GetCenterTransform().TransformPoint(normalCalcCenter), + //calcPoint = math.transform(initLocalToWorld, normalCalcCenter), + + attribues = attributes.GetNativeArray(), + localPositions = localPositions.GetNativeArray(), + localNormals = localNormals.GetNativeArray(), + localTangents = localTangents.GetNativeArray(), + vertexParentIndices = vertexParentIndices, + vertexChildIndices = vertexChildIndices, + vertexAngleCalcLocalRotations = vertexAngleCalcLocalRotations, + }; + job.Run(VertexCount); + } + + [BurstCompile] + struct AngleCalcLocalRotationJob : IJobParallelFor + { + public NormalCalcMode calcMode; + public float3 calcPoint; + [Unity.Collections.ReadOnly] + public NativeArray attribues; + [Unity.Collections.ReadOnly] + public NativeArray localPositions; + [Unity.Collections.ReadOnly] + public NativeArray localNormals; + [Unity.Collections.ReadOnly] + public NativeArray localTangents; + [Unity.Collections.ReadOnly] + public NativeArray vertexParentIndices; + [Unity.Collections.ReadOnly] + public NativeArray> vertexChildIndices; + + [Unity.Collections.WriteOnly] + public NativeArray vertexAngleCalcLocalRotations; + + public void Execute(int vindex) + { + // ċ­¸ĉ–ıċ‘€ċ­Œ„Ş„ċ ´ċˆŻèĤށ‹‚‰ĉ–ıċ‘‚’fowardƒ™‚ŻƒˆƒĞ¨™‚‹ + float3 z = 0; + var clist = vertexChildIndices[vindex]; + int pindex = vertexParentIndices[vindex]; + var pos = localPositions[vindex]; + var nor = localNormals[vindex]; // ċŸŻforward + var tan = localTangents[vindex]; // ċŸŻup + var bin = MathUtility.Binormal(nor, tan); + if (clist.Count > 0) + { + // ċ­¸ĉ–ıċ‘ċı³ċ‡ƒ™‚ŻƒˆƒĞ + for (int i = 0; i < clist.Count; i++) + { + int cindex = clist.Get(i); + var cpos = localPositions[cindex]; + z += (cpos - pos); + } + z = math.normalize(z); + } + else if (pindex >= 0) + { + // èĤށ‹‚‰ƒ™‚ŻƒˆƒĞ + var ppos = localPositions[pindex]; + z = math.normalize(pos - ppos); + } + else + return; + + // upƒ™‚ŻƒˆƒĞ + float3 y = 0; + if (calcMode == NormalCalcMode.Auto) + { + // zĉ–ıċ‘¨ċ†…çݍŒ‚‚£¨‚‚0Ğèż‘„‚‚‚’èĤ‹¤‘‚‹ïĵˆ¤‚Šç›´è§’ïĵ‰ + // è𸂒upƒ™‚ŻƒˆƒĞ¨™‚‹ + float norDot = math.abs(math.dot(z, nor)); + float tanDot = math.abs(math.dot(z, tan)); + y = norDot < tanDot ? nor : tan; + } + else if (calcMode == NormalCalcMode.X_Axis) + { + // ċ…ƒXè𸂒upƒ™‚ŻƒˆƒĞ¨™‚‹ + y = bin; + } + else if (calcMode == NormalCalcMode.Y_Axis) + { + // ċ…ƒYè𸂒upƒ™‚ŻƒˆƒĞ¨™‚‹ + y = tan; + } + else if (calcMode == NormalCalcMode.Z_Axis) + { + // ċ…ƒZè𸂒upƒ™‚ŻƒˆƒĞ¨™‚‹ + y = nor; + } + else if (calcMode == NormalCalcMode.Point_Outside) + { + // ĉŒ‡ċš•‚ŒŸä¸­ċżƒç‚ı‹‚‰ċ¤–ċ´¸ + y = math.normalize(pos - calcPoint); + } + else if (calcMode == NormalCalcMode.Point_Inside) + { + // ĉŒ‡ċš•‚ŒŸä¸­ċżƒç‚ı‹‚‰ċ†…ċ´¸ + y = math.normalize(calcPoint - pos); + } + else + { + Debug.LogError(" ĉœŞċŸè£…ïĵ"); + return; + } + + // rightƒ™‚ŻƒˆƒĞ‚’ĉħ‚‚‚‹ + float3 x = math.cross(z, y); + + // ‚‚†ä¸€ċşĤupƒ™‚ŻƒˆƒĞ‚’ĉħ‚‚‚‹ + y = math.cross(x, z); + + // “z/yè𸁧ċ›žèğ˘‚’ä½œĉˆ + var angleRot = quaternion.LookRotation(z, y); + + // ċ…ƒé ‚ç‚ıċ›žèğ˘ċ§żċ‹˘ + var rot = MathUtility.ToRotation(nor, tan); + + // ƒ­ƒĵ‚ЃĞċ›žèğ˘Ğċ¤‰ĉ› + angleRot = math.mul(math.inverse(rot), angleRot); + + + vertexAngleCalcLocalRotations[vindex] = angleRot; + } + } +#endif + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshProxy.cs.meta b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshProxy.cs.meta new file mode 100644 index 00000000..c71bb2a1 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshProxy.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: f23f05fdc7b93ce40beda3969f3012e6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshProxy.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshReduction.cs b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshReduction.cs new file mode 100644 index 00000000..141e70d5 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshReduction.cs @@ -0,0 +1,892 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System; +using System.Threading; +using Unity.Burst; +using Unity.Collections; +using Unity.Jobs; +using Unity.Mathematics; +using UnityEngine; + +namespace MagicaCloth2 +{ + public partial class VirtualMesh + { + //static readonly ProfilerMarker reductionProfiler = new ProfilerMarker("Reduction"); + + //========================================================================================= + /// + /// ƒŞƒ€‚Ż‚·ƒ§ƒ³‚’ċŸèĦŒ™‚‹ïĵˆ‚ıƒĴƒƒƒ‰ċŻïĵ‰ + /// ċ‡Ĥ理ĉ™‚é–“Œé•·„Ÿ‚CancellationToken‚’ċ—‘ċ…‚Œ‚‹ + /// + /// + /// + public void Reduction(ReductionSettings settings, CancellationToken ct) + { + //reductionProfiler.Begin(); + + try + { + // ƒŞƒ€‚Ż‚·ƒ§ƒ³ä½œĉ­ƒ‡ƒĵ‚ż + using var workData = new ReductionWorkData(this); + + // 作ĉ­ƒ‡ƒĵ‚żċˆĉœŸċŒ– + InitReductionWorkData(workData); + if (result.IsError()) + { + throw new MagicaClothProcessingException(); + } + + // ƒŞƒ€‚Ż‚·ƒ§ƒ³ƒŞƒ‹‚˘è·é›˘‚’AABBĉœ€ċ¤§èşé•·•‚’ċŸşĉş–Ğç—ċ‡ş™‚‹ + float maxSideLength = boundingBox.Value.MaxSideLength; + if (maxSideLength < 1e-08f) + { + result.SetError(Define.Result.Reduction_MaxSideLengthZero); + throw new MagicaClothProcessingException(); // ƒŞƒ€‚Ż‚·ƒ§ƒ³ċ¤ħĉ•— + } + float sameDistance = maxSideLength * math.saturate(Define.System.ReductionSameDistance); + float simpleDistance = maxSideLength * math.saturate(settings.simpleDistance); + float shapeDistance = maxSideLength * math.saturate(settings.shapeDistance); + Develop.DebugLog($"ReductionDista. maxSideLength:{maxSideLength}, same:{sameDistance}, simple:{simpleDistance}, shape:{shapeDistance}"); + + // ċŒä¸€è·é›˘ƒŞƒ€‚Ż‚·ƒ§ƒ³ + ct.ThrowIfCancellationRequested(); +#if true + using (var sameReduction = new SameDistanceReduction(this.name, this, workData, sameDistance)) + { + sameReduction.Reduction(); + if (sameReduction.Result.IsError()) + { + result = sameReduction.Result; + throw new MagicaClothProcessingException(); // ƒŞƒ€‚Ż‚·ƒ§ƒ³ċ¤ħĉ•— + } + //workData.DebugVerify(); + } +#endif + + // è·é›˘ƒŞƒ€‚Ż‚·ƒ§ƒ³ + ct.ThrowIfCancellationRequested(); + if (simpleDistance > sameDistance) + { + float startDistance = math.min(sameDistance * 2.0f, simpleDistance); + using (var simpleReduction = new SimpleDistanceReduction(this.name, this, workData, startDistance, simpleDistance, Define.System.ReductionMaxStep, Define.System.ReductionDontMakeLine, Define.System.ReductionJoinPositionAdjustment)) + { + simpleReduction.Reduction(); + if (simpleReduction.Result.IsError()) + { + result = simpleReduction.Result; + throw new MagicaClothProcessingException(); // ƒŞƒ€‚Ż‚·ƒ§ƒ³ċ¤ħĉ•— + } + //workData.DebugVerify(); + } + } + + // ĉŽçĥšƒŞƒ€‚Ż‚·ƒ§ƒ³ + ct.ThrowIfCancellationRequested(); + if (shapeDistance > 0.0f && shapeDistance > simpleDistance) + { + float startDistance = math.min(math.max(sameDistance * 2.0f, simpleDistance), shapeDistance); + using (var shapeReduction = new ShapeDistanceReduction(this.name, this, workData, startDistance, shapeDistance, Define.System.ReductionMaxStep, Define.System.ReductionDontMakeLine, Define.System.ReductionJoinPositionAdjustment)) + { + shapeReduction.Reduction(); + if (shapeReduction.Result.IsError()) + { + result = shapeReduction.Result; + throw new MagicaClothProcessingException(); // ƒŞƒ€‚Ż‚·ƒ§ƒ³ċ¤ħĉ•— + } + //workData.DebugVerify(); + } + } + + //workData.DebugInfo(); + + // ƒŞƒ€‚Ż‚·ƒ§ƒ³çµĉžœ‹‚‰ƒĦƒƒ‚·ƒ‚’ċ†ĉ§‹ĉˆ™‚‹ + ct.ThrowIfCancellationRequested(); + Organization(settings, workData); + if (result.IsError()) + { + throw new MagicaClothProcessingException(); + } + + //Debug.Log($"Vertex:{workData.newVertexCount}, Line:{workData.newLineList.Length}, Triangle:{workData.newTriangleList.Length}"); + + // 結ĉžœ‚’vmeshĞĉ›¸èĵ‚€ + ct.ThrowIfCancellationRequested(); + OrganizeStoreVirtualMesh(workData); + if (result.IsError()) + { + throw new MagicaClothProcessingException(); + } + + // ċı³ċ‡é ‚ç‚ıé–“è·é›˘‚’ċ†è¨ˆç—™‚‹ + CalcAverageAndMaxVertexDistanceRun(); + + // ĉˆċŠŸ + ct.ThrowIfCancellationRequested(); + } + catch (MagicaClothProcessingException) + { + if (result.IsError() == false) + result.SetError(Define.Result.Reduction_UnknownError); + result.DebugLog(); + } + catch (OperationCanceledException) + { + result.SetCancel(); + } + catch (Exception exception) + { + Debug.LogError(exception); + result.SetError(Define.Result.Reduction_Exception); + } + finally + { + } + + //reductionProfiler.End(); + } + + //========================================================================================= + /// + /// ƒŞƒ€‚Ż‚·ƒ§ƒ³ç”¨ä½œĉ­ƒ‡ƒĵ‚żċˆĉœŸċŒ– + /// + /// + void InitReductionWorkData(ReductionWorkData workData) + { + try + { + int vertexCount = VertexCount; + int triangleCount = TriangleCount; + + // 頂ç‚ı結ċˆċ…ˆƒŞ‚ıƒˆä½œĉˆ + workData.vertexJoinIndices = new NativeArray(vertexCount, Allocator.Persistent); + JobUtility.FillRun(workData.vertexJoinIndices, vertexCount, -1); + + // 頂ç‚ı”¨ĉŽçĥšċ…ˆé ‚ç‚ıƒžƒƒƒ—ĉ§‹ç݉ + workData.vertexToVertexMap = new NativeParallelMultiHashMap(vertexCount, Allocator.Persistent); + new Reduction_InitVertexToVertexJob2() + { + triangleCount = triangleCount, + triangles = triangles.GetNativeArray(), + vertexToVertexMap = workData.vertexToVertexMap, + }.Run(); + } + catch (Exception) + { + result.SetError(Define.Result.Reduction_InitError); + } + } + + [BurstCompile] + unsafe struct Reduction_InitVertexToVertexJob2 : IJob + { + public int triangleCount; + + [Unity.Collections.ReadOnly] + public NativeArray triangles; + + public NativeParallelMultiHashMap vertexToVertexMap; + + public void Execute() + { + for (int i = 0; i < triangleCount; i++) + { + int3 tri = triangles[i]; + + ushort x = (ushort)tri.x; + ushort y = (ushort)tri.y; + ushort z = (ushort)tri.z; + + vertexToVertexMap.Add(x, y); + vertexToVertexMap.Add(x, z); + vertexToVertexMap.Add(y, x); + vertexToVertexMap.Add(y, z); + vertexToVertexMap.Add(z, x); + vertexToVertexMap.Add(z, y); + } + } + } + +#if false + [BurstCompile] + unsafe struct Reduction_InitVertexToVertexJob : IJob + { + public int triangleCount; + + [Unity.Collections.ReadOnly] + public NativeArray triangles; + + public NativeArray> vertexToVertexArray; + + public void Execute() + { + var arrayPtr = (FixedList128Bytes*)vertexToVertexArray.GetUnsafePtr(); + + for (int i = 0; i < triangleCount; i++) + { + int3 tri = triangles[i]; + + var ptrx = (arrayPtr + tri.x); + var ptry = (arrayPtr + tri.y); + var ptrz = (arrayPtr + tri.z); + + ushort x = (ushort)tri.x; + ushort y = (ushort)tri.y; + ushort z = (ushort)tri.z; + ptrx->SetLimit(y); + ptrx->SetLimit(z); + ptry->SetLimit(x); + ptry->SetLimit(z); + ptrz->SetLimit(x); + ptrz->SetLimit(y); + } + } + } +#endif + + //========================================================================================= + /// + /// ƒŞƒ€‚Ż‚·ƒ§ƒ³çµĉžœ‹‚‰ƒ‡ƒĵ‚ż‚’ċ†ç·¨ĉˆ™‚‹ + /// + /// + /// + void Organization(ReductionSettings setting, ReductionWorkData workData) + { + try + { + // ċ†ç·¨ĉˆĞċż…èĤŞ™ıĤĉş–ċ‚™‚’ĉ•´ˆ‚‹ + OrganizationInit(setting, workData); + + // ƒŞƒžƒƒƒ—ƒ‡ƒĵ‚żä½œĉˆ + OrganizationCreateRemapData(workData); + + // ċŸşĉœĴƒ‡ƒĵ‚żä½œĉˆ + OrganizationCreateBasicData(workData); + + // ƒİ‚¤ƒ³ïĵƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ生ĉˆ + OrganizationCreateLineTriangle(workData); + } + catch (Exception) + { + result.SetError(Define.Result.Reduction_OrganizationError); + } + } + + //========================================================================================= + /// + /// ċ†ç·¨ĉˆĞċż…èĤŞ™ıĤĉş–ċ‚™‚’ĉ•´ˆ‚‹ + /// + /// + /// + void OrganizationInit(ReductionSettings setting, ReductionWorkData workData) + { + // ĉœ€çµ‚çš„Şé ‚ç‚ıĉ•° + // 生ċ­˜é ‚ç‚ıżƒŞ‚ıƒˆ + // ĉ—§é ‚ç‚ıƒŞ‚ıƒˆ‹‚‰é€£ċ‹•‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı + workData.oldVertexCount = VertexCount; + workData.newVertexCount = workData.oldVertexCount - workData.removeVertexCount; + + int newVertexCount = workData.newVertexCount; + + // ċ‰Šé™¤•‚ŒŸé ‚ç‚ı‚„ƒœƒĵƒ³‚’生ċ­˜™‚‹ƒ‡ƒĵ‚ż¸ĉŽçĥš™‚‹ + // OrganizationCreateRemapData用 + { + // 頂ç‚ıƒŞƒžƒƒƒ—ƒ‡ƒĵ‚ż + workData.vertexRemapIndices = new NativeArray(workData.oldVertexCount, Allocator.Persistent); + + // ‚ı‚­ƒ³ƒœƒĵƒ³ƒŞƒžƒƒƒ—ƒ‡ƒĵ‚żä½œĉˆ + workData.useSkinBoneMap = new NativeParallelHashMap(SkinBoneCount, Allocator.Persistent); + + // ä½żç”¨ƒœƒĵƒ³Ğĉ–°—„‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı‚’ċ‰²‚ŠĉŒŻ‚‹ + // ¤„§Ğĉ–°—„‚ı‚­ƒ³ƒœƒĵƒ³ƒŞ‚ıƒˆ¨ƒ‚¤ƒ³ƒ‰ƒƒĵ‚şƒŞ‚ıƒˆ‚’作ĉˆ™‚‹ + workData.newSkinBoneCount = new NativeReference(Allocator.Persistent); + workData.newSkinBoneTransformIndices = new NativeList(SkinBoneCount, Allocator.Persistent); + workData.newSkinBoneBindPoseList = new NativeList(SkinBoneCount, Allocator.Persistent); + } + + // ċŸşĉœĴƒ‡ƒĵ‚żä½œĉˆ + //OrganizationCreateBasicData用 + { + workData.newAttributes = new ExSimpleNativeArray(newVertexCount); + workData.newLocalPositions = new ExSimpleNativeArray(newVertexCount); + workData.newLocalNormals = new ExSimpleNativeArray(newVertexCount); + workData.newLocalTangents = new ExSimpleNativeArray(newVertexCount); + workData.newUv = new ExSimpleNativeArray(newVertexCount); + workData.newBoneWeights = new ExSimpleNativeArray(newVertexCount); + + // ĉ–°—„é ‚ç‚ıĉŽçĥšé ‚ç‚ıƒŞ‚ıƒˆ + workData.newVertexToVertexMap = new NativeParallelMultiHashMap(newVertexCount, Allocator.Persistent); + } + + // ƒİ‚¤ƒ³ïĵƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ生ĉˆ + // OrganizationCreateLineTriangle用 + { + workData.edgeSet = new NativeParallelHashSet(newVertexCount * 2, Allocator.Persistent); + workData.triangleSet = new NativeParallelHashSet(newVertexCount, Allocator.Persistent); + workData.newLineList = new NativeList(newVertexCount, Allocator.Persistent); + workData.newTriangleList = new NativeList(newVertexCount, Allocator.Persistent); + } + } + + //========================================================================================= + /// + /// ƒŞƒžƒƒƒ—ƒ‡ƒĵ‚żä½œĉˆ + /// ċ‰Šé™¤•‚ŒŸé ‚ç‚ı‚„ƒœƒĵƒ³‚’生ċ­˜™‚‹ƒ‡ƒĵ‚ż¸ĉŽçĥš™‚‹ + /// + /// + void OrganizationCreateRemapData(ReductionWorkData workData) + { + // 頂ç‚ıƒŞƒžƒƒƒ—ƒ‡ƒĵ‚żä½œĉˆ + // 生ċ­˜é ‚ç‚ıĞ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı‚’ċ‰²‚ŠĉŒŻ‚‹€ċ‰Šé™¤é ‚ç‚ıĞĉ–°—„生ċ­˜é ‚ç‚ı‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı‚’ċ‰²‚ŠĉŒŻ‚‹ + var vertexRemapJob = new Organize_RemapVertexJob() + { + oldVertexCount = workData.oldVertexCount, + joinIndices = workData.vertexJoinIndices, + vertexRemapIndices = workData.vertexRemapIndices, + }; + vertexRemapJob.Run(); + + // ‚ı‚­ƒ‹ƒ³‚°ƒœƒĵƒ³ƒŞƒžƒƒƒ—ƒ‡ƒĵ‚żä½œĉˆ + // ä½żç”¨—Ĥ„‚‹ƒœƒĵƒ³‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı‚’ċŽé›†™‚‹ + //Debug.Log($"workData.useSkinBoneMap count:{workData.useSkinBoneMap.Count()}"); + using var useSkinBoneMapKeyList = new NativeList(Allocator.Persistent); // Unity2023.1.5ċŻċżœ + var collectUseSkinJob = new Organize_CollectUseSkinBoneJob() + { + oldVertexCount = workData.oldVertexCount, + joinIndices = workData.vertexJoinIndices, + oldBoneWeights = boneWeights.GetNativeArray(), + oldBindPoses = skinBoneBindPoses.GetNativeArray(), + useSkinBoneMap = workData.useSkinBoneMap, + newSkinBoneTransformIndices = workData.newSkinBoneTransformIndices, + newSkinBoneBindPoses = workData.newSkinBoneBindPoseList, + newSkinBoneCount = workData.newSkinBoneCount, + useSkinBoneMapKeyList = useSkinBoneMapKeyList, // Unity2023.1.5ċŻċżœ + }; + collectUseSkinJob.Run(); + } + + /// + /// 生ċ­˜é ‚ç‚ıĞ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı‚’ċ‰²‚ŠĉŒŻ‚‹ + /// + [BurstCompile] + struct Organize_RemapVertexJob : IJob + { + public int oldVertexCount; + + [Unity.Collections.ReadOnly] + public NativeArray joinIndices; + public NativeArray vertexRemapIndices; + + public void Execute() + { + // 生ċ­˜é ‚ç‚ıĞĉ–°—„‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı‚’ċ‰²‚ŠĉŒŻ‚‹ + int remapIndex = 0; + for (int i = 0; i < oldVertexCount; i++) + { + int join = joinIndices[i]; + if (join < 0) + { + // live + vertexRemapIndices[i] = remapIndex; + remapIndex++; + } + } + + // ċ‰Šé™¤é ‚ç‚ıĞĉ–°—„生ċ­˜é ‚ç‚ı‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı‚’ċ‰²‚ŠĉŒŻ‚‹ + for (int i = 0; i < oldVertexCount; i++) + { + int join = joinIndices[i]; + if (join >= 0) + { + // delete + vertexRemapIndices[i] = vertexRemapIndices[join]; + } + } + } + } + + /// + /// ä½żç”¨—Ĥ„‚‹‚ı‚­ƒ‹ƒ³‚°ƒœƒĵƒ³‚’ċŽé›†™‚‹ + /// + [BurstCompile] + struct Organize_CollectUseSkinBoneJob : IJob + { + public int oldVertexCount; + + [Unity.Collections.ReadOnly] + public NativeArray joinIndices; + [Unity.Collections.ReadOnly] + public NativeArray oldBoneWeights; + [Unity.Collections.ReadOnly] + public NativeArray oldBindPoses; + + public NativeParallelHashMap useSkinBoneMap; + + public NativeList newSkinBoneTransformIndices; + public NativeList newSkinBoneBindPoses; + public NativeReference newSkinBoneCount; + + public NativeList useSkinBoneMapKeyList; // Unity2023.1.5ċŻċżœ + + public void Execute() + { + // 生ċ­˜é ‚ç‚ı§ä½żç”¨•‚ŒĤ„‚‹ĉ—§ƒœƒĵƒ³‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı‚’ċŽé›†™‚‹ + for (int vindex = 0; vindex < oldVertexCount; vindex++) + { + int join = joinIndices[vindex]; + if (join >= 0) + continue; // isDelete + + // ä½żç”¨—Ĥ„‚‹ĉ—§ƒœƒĵƒ³‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı‚’ċŽé›†™‚‹ + var bw = oldBoneWeights[vindex]; + for (int i = 0; i < 4; i++) + { + if (bw.weights[i] > 0.0f) + { + //Debug.Log(bw.boneIndices[i]); + + // šŻĉ—§ƒœƒĵƒ³‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı‚’ċŽé›† + int index = bw.boneIndices[i]; + useSkinBoneMap.TryAdd(bw.boneIndices[i], 0); + } + } + } + + // ċˆİ用•‚Œ‚‹ƒœƒĵƒ³Ğé€£ç•Ş‚’µ‚‹ + // Unity2023.1.5ċŻċżœ + //var oldBoneIndexArray = useSkinBoneMap.GetKeyArray(Allocator.Temp); + useSkinBoneMapKeyList.Clear(); + foreach (var kv in useSkinBoneMap) + { + useSkinBoneMapKeyList.Add(kv.Key); + } + + // 不èĤŞƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ‚’ċ‰Šé™¤—Ÿĉ–°—„‚ı‚­ƒ‹ƒ³‚°ƒœƒĵƒ³¨ƒ‚¤ƒ³ƒ‰ƒƒĵ‚şƒŞ‚ıƒˆ‚’作ĉˆ™‚‹ + //for (int i = 0; i < oldBoneIndexArray.Length; i++) // Unity2023.1.5ċŻċżœ + for (int i = 0; i < useSkinBoneMapKeyList.Length; i++) // Unity2023.1.5ċŻċżœ + { + //int oldBoneIndex = oldBoneIndexArray[i]; // Unity2023.1.5ċŻċżœ + int oldBoneIndex = useSkinBoneMapKeyList[i]; // Unity2023.1.5ċŻċżœ + useSkinBoneMap[oldBoneIndex] = i; + + // ĉ–°—„ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı + newSkinBoneTransformIndices.Add(i); + + // ƒ‚¤ƒ³ƒ‰ƒƒĵ‚ş + newSkinBoneBindPoses.Add(oldBindPoses[oldBoneIndex]); + } + + // ĉœ€éİċŒ–ċŒ‚ı‚­ƒ³ƒœƒĵƒ³ĉ•° + //newSkinBoneCount.Value = oldBoneIndexArray.Length; // Unity2023.1.5ċŻċżœ + newSkinBoneCount.Value = useSkinBoneMapKeyList.Length; // Unity2023.1.5ċŻċżœ + } + } + + //========================================================================================= + /// + /// ċŸşĉœĴƒ‡ƒĵ‚żä½œĉˆ + /// Line/Triangle‚’ċ†ç·¨ĉˆ™‚‹Ÿ‚ċŸşĉœĴ的Şƒ‡ƒĵ‚ż‚’作ĉˆ™‚‹ + /// + /// + void OrganizationCreateBasicData(ReductionWorkData workData) + { + int newVertexCount = workData.newVertexCount; + int oldVertexCount = workData.oldVertexCount; + + // position/normal/tangent/attribute‚³ƒ”ƒĵ + var copyVertexJob = new Organize_CopyVertexJob() + { + joinIndices = workData.vertexJoinIndices, + vertexRemapIndices = workData.vertexRemapIndices, + oldAttributes = attributes.GetNativeArray(), + oldLocalPositions = localPositions.GetNativeArray(), + oldLocalNormals = localNormals.GetNativeArray(), + oldLocalTangents = localTangents.GetNativeArray(), + newAttributes = workData.newAttributes.GetNativeArray(), + newLocalPositions = workData.newLocalPositions.GetNativeArray(), + newLocalNormals = workData.newLocalNormals.GetNativeArray(), + newLocalTangents = workData.newLocalTangents.GetNativeArray(), + }; + copyVertexJob.Run(oldVertexCount); + + // ĉ–°—„uv‚’計痁™‚‹ïĵˆ“UVŻĉŽç·šè¨ˆç—用§‚‚Šƒ†‚Ż‚ıƒƒ£ç”¨§ŻŞ„§ĉ³¨ĉ„ïĵïĵ‰ + JobUtility.CalcUVWithSphereMappingRun(workData.newLocalPositions.GetNativeArray(), newVertexCount, workData.vmesh.boundingBox, workData.newUv.GetNativeArray()); + + // ĉ–°—„ƒœƒĵƒ³‚Ĥ‚¨‚¤ƒˆƒŞ‚ıƒˆ‚’作ĉˆ™‚‹ + var remapBoneWeightJob = new Organize_RemapBoneWeightJob() + { + joinIndices = workData.vertexJoinIndices, + vertexRemapIndices = workData.vertexRemapIndices, + useSkinBoneMap = workData.useSkinBoneMap, + oldSkinBoneIndices = skinBoneTransformIndices.GetNativeArray(), + oldBoneWeights = boneWeights.GetNativeArray(), + newBoneWeights = workData.newBoneWeights.GetNativeArray(), + }; + remapBoneWeightJob.Run(oldVertexCount); + + // ĉ–°—„é ‚ç‚ıĉŽçĥšé ‚ç‚ıƒŞ‚ıƒˆ‚’作ĉˆ™‚‹ + var remapLinkPointArrayJob = new Organize_RemapLinkPointArrayJob() + { + joinIndices = workData.vertexJoinIndices, + vertexRemapIndices = workData.vertexRemapIndices, + oldVertexToVertexMap = workData.vertexToVertexMap, + newVertexToVertexMap = workData.newVertexToVertexMap, + }; + remapLinkPointArrayJob.Run(VertexCount); + + } + + /// + /// ĉ–°—„é ‚ç‚ıĞƒŞƒ€‚Ż‚·ƒ§ƒ³ċŒPositin/Normal/Tangent/Attribute‚’‚³ƒ”ƒĵ™‚‹ + /// + [BurstCompile] + struct Organize_CopyVertexJob : IJobParallelFor + { + [Unity.Collections.ReadOnly] + public NativeArray joinIndices; + [Unity.Collections.ReadOnly] + public NativeArray vertexRemapIndices; + [Unity.Collections.ReadOnly] + public NativeArray oldAttributes; + [Unity.Collections.ReadOnly] + public NativeArray oldLocalPositions; + [Unity.Collections.ReadOnly] + public NativeArray oldLocalNormals; + [Unity.Collections.ReadOnly] + public NativeArray oldLocalTangents; + + [NativeDisableParallelForRestriction] + [Unity.Collections.WriteOnly] + public NativeArray newAttributes; + [NativeDisableParallelForRestriction] + [Unity.Collections.WriteOnly] + public NativeArray newLocalPositions; + [NativeDisableParallelForRestriction] + [Unity.Collections.WriteOnly] + public NativeArray newLocalNormals; + [NativeDisableParallelForRestriction] + [Unity.Collections.WriteOnly] + public NativeArray newLocalTangents; + + public void Execute(int index) + { + int join = joinIndices[index]; + if (join < 0) + { + // live + int remapIndex = vertexRemapIndices[index]; + newAttributes[remapIndex] = oldAttributes[index]; + newLocalPositions[remapIndex] = oldLocalPositions[index]; + newLocalNormals[remapIndex] = oldLocalNormals[index]; + newLocalTangents[remapIndex] = oldLocalTangents[index]; + } + } + } + + /// + /// ĉ–°—„ƒœƒĵƒ³‚Ĥ‚¨‚¤ƒˆƒŞ‚ıƒˆ‚’作ĉˆ™‚‹ + /// + [BurstCompile] + struct Organize_RemapBoneWeightJob : IJobParallelFor + { + [Unity.Collections.ReadOnly] + public NativeArray joinIndices; + [Unity.Collections.ReadOnly] + public NativeArray vertexRemapIndices; + [Unity.Collections.ReadOnly] + public NativeParallelHashMap useSkinBoneMap; + + [Unity.Collections.ReadOnly] + public NativeArray oldSkinBoneIndices; + [Unity.Collections.ReadOnly] + public NativeArray oldBoneWeights; + [NativeDisableParallelForRestriction] + [Unity.Collections.WriteOnly] + public NativeArray newBoneWeights; + + public void Execute(int vindex) + { + int join = joinIndices[vindex]; + if (join < 0) + { + // live + int remapIndex = vertexRemapIndices[vindex]; + var bw = oldBoneWeights[vindex]; + + // ƒœƒĵƒ³‚¤ƒ³ƒ‡ƒƒ‚Ż‚ıƒŞƒžƒƒƒ— + for (int j = 0; j < 4; j++) + { + if (bw.weights[j] > 0.0f) + { + int oldBoneIndex = bw.boneIndices[j]; + bw.boneIndices[j] = useSkinBoneMap[oldBoneIndex]; + } + else + { + bw.boneIndices[j] = 0; + } + } + newBoneWeights[remapIndex] = bw; + } + } + } + + /// + /// ĉ–°—„é ‚ç‚ıĉŽçĥšé ‚ç‚ıƒŞ‚ıƒˆ‚’作ĉˆ™‚‹ + /// + [BurstCompile] + struct Organize_RemapLinkPointArrayJob : IJobParallelFor + { + [Unity.Collections.ReadOnly] + public NativeArray joinIndices; + [Unity.Collections.ReadOnly] + public NativeArray vertexRemapIndices; + [Unity.Collections.ReadOnly] + public NativeParallelMultiHashMap oldVertexToVertexMap; + [NativeDisableParallelForRestriction] + public NativeParallelMultiHashMap newVertexToVertexMap; + + public void Execute(int vindex) + { + int join = joinIndices[vindex]; + if (join >= 0) + return; // è‡ŞèşĞŻċ‰Šé™¤•‚ŒĤ„‚‹ + + int newIndex = vertexRemapIndices[vindex]; + + foreach (var oldVertexIndex in oldVertexToVertexMap.GetValuesForKey((ushort)vindex)) + { + int newIndex2 = vertexRemapIndices[oldVertexIndex]; + //Debug.Assert(newIndex != newIndex2); + newVertexToVertexMap.MC2UniqueAdd((ushort)newIndex, (ushort)newIndex2); + } + + //Debug.Log($"[{newIndex}] cnt:{newVertexToVertexMap.CountValuesForKey((ushort)newIndex)}"); + //Debug.Assert(newVertexToVertexMap.ContainsKey((ushort)newIndex)); + //Debug.Assert(newVertexToVertexMap.CountValuesForKey((ushort)newIndex) > 0); + } + } + + //========================================================================================= + /// + /// ĉ–°—„ƒİ‚¤ƒ³¨ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ‚’生ĉˆ™‚‹ + /// + /// + void OrganizationCreateLineTriangle(ReductionWorkData workData) + { + // ĉ–°—„é ‚ç‚ıĉŽçĥšĉƒ…ċ ħ‹‚‰‚¨ƒƒ‚¸‚ğƒƒƒˆ‚’作ĉˆ™‚‹ + var createLineTriangleJob = new Organize_CreateLineTriangleJob() + { + newVertexCount = workData.newVertexCount, + newVertexToVertexMap = workData.newVertexToVertexMap, + edgeSet = workData.edgeSet, + }; + createLineTriangleJob.Run(); + + // ‚¨ƒƒ‚¸‚ğƒƒƒˆ‹‚‰ƒİ‚¤ƒ³¨ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ‚ğƒƒƒˆ‚’作ĉˆ™‚‹ + var createLineTriangleJob2 = new Organize_CreateLineTriangleJob2() + { + newVertexToVertexMap = workData.newVertexToVertexMap, + newLineList = workData.newLineList, + edgeSet = workData.edgeSet, + triangleSet = workData.triangleSet, + }; + createLineTriangleJob2.Run(); + + // ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ‚ğƒƒƒˆ‹‚‰ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞƒŞ‚ıƒˆ‚’作ĉˆ™‚‹ + var createNewTriangleJob3 = new Organize_CreateNewTriangleJob3() + { + newTriangleList = workData.newTriangleList, + triangleSet = workData.triangleSet, + }; + createNewTriangleJob3.Run(); + } + + /// + /// ‚¨ƒƒ‚¸‚ğƒƒƒˆ‚’作ĉˆ™‚‹ + /// + [BurstCompile] + struct Organize_CreateLineTriangleJob : IJob + { + public int newVertexCount; + + [Unity.Collections.ReadOnly] + public NativeParallelMultiHashMap newVertexToVertexMap; + + [Unity.Collections.WriteOnly] + public NativeParallelHashSet edgeSet; + + public void Execute() + { + // ĉ–°—„é ‚ç‚ıĉŽçĥšĉƒ…ċ ħ‹‚‰‚¨ƒƒ‚¸‚ğƒƒƒˆ‚’作ĉˆ™‚‹ + //Debug.Log($"newVertexCount:{newVertexCount}"); + for (int vindex = 0; vindex < newVertexCount; vindex++) + { + //Debug.Assert(newVertexToVertexMap.CountValuesForKey((ushort)vindex) > 0); + + foreach (ushort vindex2 in newVertexToVertexMap.GetValuesForKey((ushort)vindex)) + { + int2 edge = DataUtility.PackInt2(vindex, vindex2); + edgeSet.Add(edge); + + //Debug.Log($"edge {vindex} -> {vindex2}"); + } + } + } + } + + /// + /// ‚¨ƒƒ‚¸‚ğƒƒƒˆ‹‚‰ƒİ‚¤ƒ³¨ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ‚ğƒƒƒˆ‚’作ĉˆ™‚‹ + /// + [BurstCompile] + struct Organize_CreateLineTriangleJob2 : IJob + { + [Unity.Collections.ReadOnly] + public NativeParallelMultiHashMap newVertexToVertexMap; + + [Unity.Collections.WriteOnly] + public NativeList newLineList; + + [Unity.Collections.ReadOnly] + public NativeParallelHashSet edgeSet; + [Unity.Collections.WriteOnly] + public NativeParallelHashSet triangleSet; + + public void Execute() + { + // ‚¨ƒƒ‚¸‚ğƒƒƒˆ‹‚‰ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ¨ƒİ‚¤ƒ³‚’生ĉˆ™‚‹ + foreach (int2 edge in edgeSet) + { + int tcnt = 0; + foreach (ushort vindex in newVertexToVertexMap.GetValuesForKey((ushort)edge.x)) + { + if (vindex == edge.x || vindex == edge.y) + continue; + + if (newVertexToVertexMap.MC2Contains((ushort)edge.y, vindex)) + { + // ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ生ĉˆ + int3 tri = DataUtility.PackInt3(edge.x, edge.y, vindex); + triangleSet.Add(tri); + tcnt++; + + //if (math.all(tri - 927) == false) + // Debug.Log($"tri:{tri}"); + } + } + // ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞŒç”Ÿĉˆċ‡şĉŞ„ċ ´ċˆŻƒİ‚¤ƒ³¨—Ĥç™ğ録™‚‹ + if (tcnt == 0) + { + newLineList.Add(edge); + + //if (math.all(edge - 927) == false) + // Debug.Log($"line:{edge}"); + } + } + } + } + + /// + /// ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ‚ğƒƒƒˆ‹‚‰ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞƒŞ‚ıƒˆ‚’作ĉˆ™‚‹ + /// + [BurstCompile] + struct Organize_CreateNewTriangleJob3 : IJob + { + [Unity.Collections.WriteOnly] + public NativeList newTriangleList; + + [Unity.Collections.ReadOnly] + public NativeParallelHashSet triangleSet; + + public void Execute() + { + // ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞƒžƒƒƒ—‹‚‰ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞƒŞ‚ıƒˆ‚’生ĉˆ™‚‹ + foreach (int3 tri in triangleSet) + { + int3 newTri = tri; + newTriangleList.Add(newTri); + + //if (math.all(tri - 927) == false) + // Debug.Log($"new tri:{tri}"); + } + } + } + + //========================================================================================= + /// + /// ƒŞƒ€‚Ż‚·ƒ§ƒ³çµĉžœ‚’vmeshĞċĉ˜ •›‚‹ + /// + /// + /// + void OrganizeStoreVirtualMesh(ReductionWorkData workData) + { + try + { + int vcnt = workData.newVertexCount; + + // ċ‚ç…§‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı + // ™ıĤé€£ç•Ş§ċ†è¨­ċš™‚‹ + referenceIndices.Dispose(); + referenceIndices = new ExSimpleNativeArray(vcnt); + JobUtility.SerialNumberRun(referenceIndices.GetNativeArray(), vcnt); + + // attribute + attributes.Dispose(); + attributes = workData.newAttributes; + workData.newAttributes = null; + + // positin + localPositions.Dispose(); + localPositions = workData.newLocalPositions; + workData.newLocalPositions = null; + + // normal + localNormals.Dispose(); + localNormals = workData.newLocalNormals; + workData.newLocalNormals = null; + + // tangent + localTangents.Dispose(); + localTangents = workData.newLocalTangents; + workData.newLocalTangents = null; + + // uv + uv.Dispose(); + uv = workData.newUv; + workData.newUv = null; + + // bone weight + boneWeights.Dispose(); + boneWeights = workData.newBoneWeights; + workData.newBoneWeights = null; + + // line + lines.Dispose(); + lines = new ExSimpleNativeArray(workData.newLineList); + + // triangle + triangles.Dispose(); + triangles = new ExSimpleNativeArray(workData.newTriangleList); + + // ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ĉƒ…ċ ħċ†ç·¨ĉˆ + transformData.OrganizeReductionTransform(this, workData); + + // skin bone index + skinBoneTransformIndices.Dispose(); + skinBoneTransformIndices = new ExSimpleNativeArray(workData.newSkinBoneTransformIndices); + + // skin bone bind pose + skinBoneBindPoses.Dispose(); + skinBoneBindPoses = new ExSimpleNativeArray(workData.newSkinBoneBindPoseList); + + // ċ…ƒé ‚ç‚ıçµċˆé ‚ç‚ı‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı + joinIndices = new NativeArray(workData.vertexRemapIndices, Allocator.Persistent); + } + catch (Exception) + { + result.SetError(Define.Result.Reduction_StoreVirtualMeshError); + } + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshReduction.cs.meta b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshReduction.cs.meta new file mode 100644 index 00000000..ec044f35 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshReduction.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 90031fc5a00f3f045b88eac913436848 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshReduction.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshSerialization.cs b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshSerialization.cs new file mode 100644 index 00000000..6a223f46 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshSerialization.cs @@ -0,0 +1,291 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2024 MagicaSoft. +// https://magicasoft.jp +using System; +using System.Collections.Generic; +using System.Text; +using Unity.Collections; +using Unity.Mathematics; +using UnityEngine; + +namespace MagicaCloth2 +{ + public partial class VirtualMesh + { + /// + /// PreBuildċ…ħĉœ‰éƒ¨ċˆ†ƒ‡ƒĵ‚ż + /// + [System.Serializable] + public class ShareSerializationData + { + public string name; + public MeshType meshType; + public bool isBoneCloth; + + // ċŸşĉœĴ + public ExSimpleNativeArray.SerializationData referenceIndices; + public ExSimpleNativeArray.SerializationData attributes; + public ExSimpleNativeArray.SerializationData localPositions; + public ExSimpleNativeArray.SerializationData localNormals; + public ExSimpleNativeArray.SerializationData localTangents; + public ExSimpleNativeArray.SerializationData uv; + public ExSimpleNativeArray.SerializationData boneWeights; + public ExSimpleNativeArray.SerializationData triangles; + public ExSimpleNativeArray.SerializationData lines; + public int centerTransformIndex; + public float4x4 initLocalToWorld; + public float4x4 initWorldToLocal; + public quaternion initRotation; + public quaternion initInverseRotation; + public float3 initScale; + public int skinRootIndex; + public ExSimpleNativeArray.SerializationData skinBoneTransformIndices; + public ExSimpleNativeArray.SerializationData skinBoneBindPoses; + public TransformData.ShareSerializationData transformData; + public AABB boundingBox; + public float averageVertexDistance; + public float maxVertexDistance; + + // ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒ + public byte[] vertexToTriangles; + public byte[] vertexToVertexIndexArray; + public byte[] vertexToVertexDataArray; + public byte[] edges; + public byte[] edgeFlags; + public int2[] edgeToTrianglesKeys; + public ushort[] edgeToTrianglesValues; + public byte[] vertexBindPosePositions; + public byte[] vertexBindPoseRotations; + public byte[] vertexToTransformRotations; + public byte[] vertexDepths; + public byte[] vertexRootIndices; + public byte[] vertexParentIndices; + public byte[] vertexChildIndexArray; + public byte[] vertexChildDataArray; + public byte[] vertexLocalPositions; + public byte[] vertexLocalRotations; + public byte[] normalAdjustmentRotations; + public byte[] baseLineFlags; + public byte[] baseLineStartDataIndices; + public byte[] baseLineDataCounts; + public byte[] baseLineData; + public int[] customSkinningBoneIndices; + public ushort[] centerFixedList; + public float3 localCenterPosition; + + // ƒžƒƒƒ”ƒ³‚°ƒĦƒƒ‚·ƒ + public float3 centerWorldPosition; + public quaternion centerWorldRotation; + public float3 centerWorldScale; + public float4x4 toProxyMatrix; + public quaternion toProxyRotation; + + public override string ToString() + { + StringBuilder sb = new StringBuilder(1024); + + sb.AppendLine("===== VirtualMesh.SerializeData ====="); + sb.AppendLine($"name:{name}"); + sb.AppendLine($"meshType:{meshType}"); + sb.AppendLine($"isBoneCloth:{isBoneCloth}"); + sb.AppendLine($"VertexCount:{attributes.count}"); + sb.AppendLine($"TriangleCount:{triangles.count}"); + sb.AppendLine($"LineCount:{lines.count}"); + + return sb.ToString(); + } + } + + public ShareSerializationData ShareSerialize() + { + var sdata = new ShareSerializationData(); + try + { + sdata.name = name; + sdata.meshType = meshType; + sdata.isBoneCloth = isBoneCloth; + + // ċŸşĉœĴ + sdata.referenceIndices = referenceIndices.Serialize(); + sdata.attributes = attributes.Serialize(); + sdata.localPositions = localPositions.Serialize(); + sdata.localNormals = localNormals.Serialize(); + sdata.localTangents = localTangents.Serialize(); + sdata.uv = uv.Serialize(); + sdata.boneWeights = boneWeights.Serialize(); + sdata.triangles = triangles.Serialize(); + sdata.lines = lines.Serialize(); + sdata.centerTransformIndex = centerTransformIndex; + sdata.initLocalToWorld = initLocalToWorld; + sdata.initWorldToLocal = initWorldToLocal; + sdata.initRotation = initRotation; + sdata.initInverseRotation = initInverseRotation; + sdata.initScale = initScale; + sdata.skinRootIndex = skinRootIndex; + sdata.skinBoneTransformIndices = skinBoneTransformIndices.Serialize(); + sdata.skinBoneBindPoses = skinBoneBindPoses.Serialize(); + sdata.transformData = transformData?.ShareSerialize(); + if (boundingBox.IsCreated) + sdata.boundingBox = boundingBox.Value; + if (averageVertexDistance.IsCreated) + sdata.averageVertexDistance = averageVertexDistance.Value; + if (maxVertexDistance.IsCreated) + sdata.maxVertexDistance = maxVertexDistance.Value; + + // ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒ + sdata.vertexToTriangles = vertexToTriangles.MC2ToRawBytes(); + sdata.vertexToVertexIndexArray = vertexToVertexIndexArray.MC2ToRawBytes(); + sdata.vertexToVertexDataArray = vertexToVertexDataArray.MC2ToRawBytes(); + sdata.edges = edges.MC2ToRawBytes(); + sdata.edgeFlags = edgeFlags.MC2ToRawBytes(); + (sdata.edgeToTrianglesKeys, sdata.edgeToTrianglesValues) = edgeToTriangles.MC2Serialize(); + sdata.vertexBindPosePositions = vertexBindPosePositions.MC2ToRawBytes(); + sdata.vertexBindPoseRotations = vertexBindPoseRotations.MC2ToRawBytes(); + sdata.vertexToTransformRotations = vertexToTransformRotations.MC2ToRawBytes(); + sdata.vertexDepths = vertexDepths.MC2ToRawBytes(); + sdata.vertexRootIndices = vertexRootIndices.MC2ToRawBytes(); + sdata.vertexParentIndices = vertexParentIndices.MC2ToRawBytes(); + sdata.vertexChildIndexArray = vertexChildIndexArray.MC2ToRawBytes(); + sdata.vertexChildDataArray = vertexChildDataArray.MC2ToRawBytes(); + sdata.vertexLocalPositions = vertexLocalPositions.MC2ToRawBytes(); + sdata.vertexLocalRotations = vertexLocalRotations.MC2ToRawBytes(); + sdata.normalAdjustmentRotations = normalAdjustmentRotations.MC2ToRawBytes(); + sdata.baseLineFlags = baseLineFlags.MC2ToRawBytes(); + sdata.baseLineStartDataIndices = baseLineStartDataIndices.MC2ToRawBytes(); + sdata.baseLineDataCounts = baseLineDataCounts.MC2ToRawBytes(); + sdata.baseLineData = baseLineData.MC2ToRawBytes(); + DataUtility.ArrayCopy(customSkinningBoneIndices, ref sdata.customSkinningBoneIndices); + DataUtility.ArrayCopy(centerFixedList, ref sdata.centerFixedList); + if (localCenterPosition.IsCreated) + sdata.localCenterPosition = localCenterPosition.Value; + + // ƒžƒƒƒ”ƒ³‚°ƒĦƒƒ‚·ƒ + sdata.centerWorldPosition = centerWorldPosition; + sdata.centerWorldRotation = centerWorldRotation; + sdata.centerWorldScale = centerWorldScale; + sdata.toProxyMatrix = toProxyMatrix; + sdata.toProxyRotation = toProxyRotation; + } + catch (Exception exception) + { + Debug.LogException(exception); + } + + return sdata; + } + + public static VirtualMesh ShareDeserialize(ShareSerializationData sdata) + { + var vmesh = new VirtualMesh(); + vmesh.isManaged = true; + + try + { + vmesh.name = sdata.name; + vmesh.meshType = sdata.meshType; + vmesh.isBoneCloth = sdata.isBoneCloth; + + // ċŸşĉœĴ + vmesh.referenceIndices.Deserialize(sdata.referenceIndices); + vmesh.attributes.Deserialize(sdata.attributes); + vmesh.localPositions.Deserialize(sdata.localPositions); + vmesh.localNormals.Deserialize(sdata.localNormals); + vmesh.localTangents.Deserialize(sdata.localTangents); + vmesh.uv.Deserialize(sdata.uv); + vmesh.boneWeights.Deserialize(sdata.boneWeights); + vmesh.triangles.Deserialize(sdata.triangles); + vmesh.lines.Deserialize(sdata.lines); + vmesh.centerTransformIndex = sdata.centerTransformIndex; + vmesh.initLocalToWorld = sdata.initLocalToWorld; + vmesh.initWorldToLocal = sdata.initWorldToLocal; + vmesh.initRotation = sdata.initRotation; + vmesh.initInverseRotation = sdata.initInverseRotation; + vmesh.initScale = sdata.initScale; + vmesh.skinRootIndex = sdata.skinRootIndex; + vmesh.skinBoneTransformIndices.Deserialize(sdata.skinBoneTransformIndices); + vmesh.skinBoneBindPoses.Deserialize(sdata.skinBoneBindPoses); + vmesh.transformData = TransformData.ShareDeserialize(sdata.transformData); + vmesh.boundingBox = new NativeReference(sdata.boundingBox, Allocator.Persistent); + vmesh.averageVertexDistance = new NativeReference(sdata.averageVertexDistance, Allocator.Persistent); + vmesh.maxVertexDistance = new NativeReference(sdata.maxVertexDistance, Allocator.Persistent); + + // ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒ + vmesh.vertexToTriangles = NativeArrayExtensions.MC2FromRawBytes>(sdata.vertexToTriangles); + vmesh.vertexToVertexIndexArray = NativeArrayExtensions.MC2FromRawBytes(sdata.vertexToVertexIndexArray); + vmesh.vertexToVertexDataArray = NativeArrayExtensions.MC2FromRawBytes(sdata.vertexToVertexDataArray); + vmesh.edges = NativeArrayExtensions.MC2FromRawBytes(sdata.edges); + vmesh.edgeFlags = NativeArrayExtensions.MC2FromRawBytes(sdata.edgeFlags); + vmesh.edgeToTriangles = NativeMultiHashMapExtensions.MC2Deserialize(sdata.edgeToTrianglesKeys, sdata.edgeToTrianglesValues); + vmesh.vertexBindPosePositions = NativeArrayExtensions.MC2FromRawBytes(sdata.vertexBindPosePositions); + vmesh.vertexBindPoseRotations = NativeArrayExtensions.MC2FromRawBytes(sdata.vertexBindPoseRotations); + vmesh.vertexToTransformRotations = NativeArrayExtensions.MC2FromRawBytes(sdata.vertexToTransformRotations); + vmesh.vertexDepths = NativeArrayExtensions.MC2FromRawBytes(sdata.vertexDepths); + vmesh.vertexRootIndices = NativeArrayExtensions.MC2FromRawBytes(sdata.vertexRootIndices); + vmesh.vertexParentIndices = NativeArrayExtensions.MC2FromRawBytes(sdata.vertexParentIndices); + vmesh.vertexChildIndexArray = NativeArrayExtensions.MC2FromRawBytes(sdata.vertexChildIndexArray); + vmesh.vertexChildDataArray = NativeArrayExtensions.MC2FromRawBytes(sdata.vertexChildDataArray); + vmesh.vertexLocalPositions = NativeArrayExtensions.MC2FromRawBytes(sdata.vertexLocalPositions); + vmesh.vertexLocalRotations = NativeArrayExtensions.MC2FromRawBytes(sdata.vertexLocalRotations); + vmesh.normalAdjustmentRotations = NativeArrayExtensions.MC2FromRawBytes(sdata.normalAdjustmentRotations); + vmesh.baseLineFlags = NativeArrayExtensions.MC2FromRawBytes(sdata.baseLineFlags); + vmesh.baseLineStartDataIndices = NativeArrayExtensions.MC2FromRawBytes(sdata.baseLineStartDataIndices); + vmesh.baseLineDataCounts = NativeArrayExtensions.MC2FromRawBytes(sdata.baseLineDataCounts); + vmesh.baseLineData = NativeArrayExtensions.MC2FromRawBytes(sdata.baseLineData); + DataUtility.ArrayCopy(sdata.customSkinningBoneIndices, ref vmesh.customSkinningBoneIndices); + DataUtility.ArrayCopy(sdata.centerFixedList, ref vmesh.centerFixedList); + vmesh.localCenterPosition = new NativeReference(sdata.localCenterPosition, Allocator.Persistent); + + // ƒžƒƒƒ”ƒ³‚°ƒĦƒƒ‚·ƒ + vmesh.centerWorldPosition = sdata.centerWorldPosition; + vmesh.centerWorldRotation = sdata.centerWorldRotation; + vmesh.centerWorldScale = sdata.centerWorldScale; + vmesh.toProxyMatrix = sdata.toProxyMatrix; + vmesh.toProxyRotation = sdata.toProxyRotation; + + vmesh.result.SetSuccess(); + } + catch (Exception exception) + { + Debug.LogException(exception); + vmesh.result.SetError(Define.Result.PreBuildData_VirtualMeshDeserializationException); + } + + return vmesh; + } + + //========================================================================================= + /// + /// PreBuildċ›şĉœ‰éƒ¨ċˆ†ƒ‡ƒĵ‚ż + /// + [System.Serializable] + public class UniqueSerializationData : ITransform + { + public TransformData.UniqueSerializationData transformData; + + public void GetUsedTransform(HashSet transformSet) + { + transformData?.GetUsedTransform(transformSet); + } + + public void ReplaceTransform(Dictionary replaceDict) + { + transformData?.ReplaceTransform(replaceDict); + } + } + + public UniqueSerializationData UniqueSerialize() + { + var sdata = new UniqueSerializationData(); + try + { + sdata.transformData = transformData?.UniqueSerialize(); + } + catch (Exception exception) + { + Debug.LogException(exception); + } + + return sdata; + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshSerialization.cs.meta b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshSerialization.cs.meta new file mode 100644 index 00000000..eb1daf84 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshSerialization.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 0d0b2768c9c7600468b9f1a7b39dd80d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshSerialization.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshWork.cs b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshWork.cs new file mode 100644 index 00000000..0c0eecb4 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshWork.cs @@ -0,0 +1,465 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System; +using Unity.Burst; +using Unity.Collections; +using Unity.Jobs; +using Unity.Mathematics; +using UnityEngine; + +namespace MagicaCloth2 +{ + public partial class VirtualMesh + { + //========================================================================================= + /// + /// 頂ç‚ı間ċı³ċ‡/ĉœ€ċ¤§è·é›˘‚’èŞżı‚‹ïĵˆ‚ıƒĴƒƒƒ‰ċŻïĵ‰ + /// 結ĉžœŻaverageVertexDistance/maxVertexDistanceĞĉ ĵ納•‚Œ‚‹ + /// + internal void CalcAverageAndMaxVertexDistanceRun() + { + try + { + if (averageVertexDistance.IsCreated == false) + averageVertexDistance = new NativeReference(Allocator.Persistent); + if (maxVertexDistance.IsCreated == false) + maxVertexDistance = new NativeReference(Allocator.Persistent); + + averageVertexDistance.Value = 0; + maxVertexDistance.Value = 0; + using var averageCount = new NativeReference(Allocator.TempJob); + + // triangle + if (TriangleCount > 0) + { + var job = new Work_AverageTriangleDistanceJob() + { + vcnt = VertexCount, + tcnt = TriangleCount, + localPositions = localPositions.GetNativeArray(), + triangles = triangles.GetNativeArray(), + averageVertexDistance = averageVertexDistance, + averageCount = averageCount, + maxVertexDistance = maxVertexDistance, + }; + job.Run(); + } + + // line + if (LineCount > 0) + { + var job = new Work_AverageLineDistanceJob() + { + vcnt = VertexCount, + lcnt = LineCount, + localPositions = localPositions.GetNativeArray(), + lines = lines.GetNativeArray(), + averageVertexDistance = averageVertexDistance, + averageCount = averageCount, + maxVertexDistance = maxVertexDistance, + }; + job.Run(); + } + + // ċı³ċ‡ċŒ–™‚‹ + int cnt = averageCount.Value; + if (cnt > 0) + { + float sqlen = averageVertexDistance.Value; + averageVertexDistance.Value = math.sqrt(sqlen / cnt); + maxVertexDistance.Value = math.sqrt(maxVertexDistance.Value); + //Debug.Log($"max:{maxVertexDistance.Value}"); + } + } + catch (Exception exception) + { + Debug.LogException(exception); + result.SetError(Define.Result.Reduction_CalcAverageException); + } + } + + [BurstCompile] + struct Work_AverageTriangleDistanceJob : IJob + { + public int vcnt; + public int tcnt; + + [Unity.Collections.ReadOnly] + public NativeArray localPositions; + [Unity.Collections.ReadOnly] + public NativeArray triangles; + + public NativeReference averageVertexDistance; + public NativeReference averageCount; + public NativeReference maxVertexDistance; + + public void Execute() + { + // èŞżı‚‹ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞŻĉœ€ċ¤§100§ + int step = math.max(tcnt / 100, 1); + float sumsqlen = 0; + float maxsqlen = 0; + int cnt = 0; + for (int tindex = 0; tindex < tcnt; tindex += step) + { + int3 tri = triangles[tindex]; + var p0 = localPositions[tri.x]; + var p1 = localPositions[tri.y]; + var p2 = localPositions[tri.z]; + float sqlen0 = math.distancesq(p0, p1); + float sqlen1 = math.distancesq(p1, p2); + float sqlen2 = math.distancesq(p2, p0); + sumsqlen += sqlen0; + sumsqlen += sqlen1; + sumsqlen += sqlen2; + cnt += 3; + maxsqlen = math.max(maxsqlen, sqlen0); + maxsqlen = math.max(maxsqlen, sqlen1); + maxsqlen = math.max(maxsqlen, sqlen2); + } + + averageVertexDistance.Value = averageVertexDistance.Value + sumsqlen; + averageCount.Value = averageCount.Value + cnt; + + // ĉœ€ċ¤§ + maxVertexDistance.Value = math.max(maxVertexDistance.Value, maxsqlen); + } + } + + [BurstCompile] + struct Work_AverageLineDistanceJob : IJob + { + public int vcnt; + public int lcnt; + + [Unity.Collections.ReadOnly] + public NativeArray localPositions; + [Unity.Collections.ReadOnly] + public NativeArray lines; + + public NativeReference averageVertexDistance; + public NativeReference averageCount; + public NativeReference maxVertexDistance; + + public void Execute() + { + // èŞżı‚‹ƒİ‚¤ƒ³Żĉœ€ċ¤§100§ + int step = math.max(lcnt / 100, 1); + float sumsqlen = 0; + int cnt = 0; + float maxsqlen = 0; + for (int lindex = 0; lindex < lcnt; lindex += step) + { + int2 line = lines[lindex]; + var p0 = localPositions[line.x]; + var p1 = localPositions[line.y]; + float sqlen = math.distancesq(p0, p1); + sumsqlen += sqlen; + cnt++; + maxsqlen = math.max(maxsqlen, sqlen); + } + + averageVertexDistance.Value = averageVertexDistance.Value + sumsqlen; + averageCount.Value = averageCount.Value + cnt; + + // ĉœ€ċ¤§ + maxVertexDistance.Value = math.max(maxVertexDistance.Value, maxsqlen); + } + } + + //========================================================================================= + /// + /// 頂ç‚ı‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı‚’ĉ ĵ納—Ÿ‚°ƒŞƒƒƒ‰ƒžƒƒƒ—‚’作ĉˆ—Ĥèż”™ + /// + /// + /// + internal GridMap CreateVertexIndexGridMapRun(float gridSize) + { + int vcnt = VertexCount; + var gridMap = new GridMap(vcnt); + + if (vcnt > 0) + { + var addJob = new Work_AddVertexIndexGirdMapJob() + { + gridSize = gridSize, + vcnt = vcnt, + positins = localPositions.GetNativeArray(), + gridMap = gridMap.GetMultiHashMap(), + }; + addJob.Run(); + } + + return gridMap; + } + + [BurstCompile] + struct Work_AddVertexIndexGirdMapJob : IJob + { + public float gridSize; + public int vcnt; + + [Unity.Collections.ReadOnly] + public NativeArray positins; + [Unity.Collections.WriteOnly] + public NativeParallelMultiHashMap gridMap; + + public void Execute() + { + for (int vindex = 0; vindex < vcnt; vindex++) + { + float3 pos = positins[vindex]; + GridMap.AddGrid(pos, vindex, gridMap, gridSize); + } + } + } + + //========================================================================================= + public VirtualMeshRaycastHit IntersectRayMesh(float3 rayPos, float3 rayDir, bool doubleSide, float pointRadius) + { + // ƒĴ‚¤‚’ƒĦƒƒ‚·ƒƒ­ƒĵ‚ЃĞçİşé–“Ğċ¤‰ĉ›™‚‹ + var t = GetCenterTransform(); + float3 localRayPos = t.InverseTransformPoint(rayPos); + float3 localRayDir = t.InverseTransformDirection(rayDir); + float3 rayEndPos = rayPos + rayDir * 1000; + float3 localRayEndPos = t.InverseTransformPoint(rayEndPos); + float localPointRadius = pointRadius / t.lossyScale.x; + + // ƒ’ƒƒƒˆƒƒƒƒ•‚Ħ + //int buffSize = (VertexCount + TriangleCount) / 10 + 10; + int buffSize = 100; // Š‚‰ċċˆ†Şċ¤§• + using var hitList = new NativeList(buffSize, Allocator.TempJob); + + JobHandle jobHandle = default; + + // ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ交ċ·ċˆ¤ċš + var job1 = new Work_IntersectTriangleJob() + { + localRayPos = localRayPos, + localRayDir = localRayDir, + localRayEndPos = localRayEndPos, + doubleSide = doubleSide, + + localPositions = localPositions.GetNativeArray(), + triangles = triangles.GetNativeArray(), + + hitList = hitList.AsParallelWriter(), + }; + jobHandle = job1.Schedule(TriangleCount, 16, jobHandle); + + // ‚¨ƒƒ‚¸äş¤ċ·ċˆ¤ċš + var job2 = new Work_IntersectEdgeJob() + { + localRayPos = localRayPos, + localRayDir = localRayDir, + localRayEndPos = localRayEndPos, + //rayDir = rayDir, + rayDir = localRayDir, + + localEdgeRadius = localPointRadius, + localPositions = localPositions.GetNativeArray(), + edges = edges, + edgeToTriangles = edgeToTriangles, + + hitList = hitList.AsParallelWriter(), + }; + jobHandle = job2.Schedule(EdgeCount, 16, jobHandle); + +#if false + // ƒ‚¤ƒ³ƒˆäş¤ċ·ċˆ¤ċš + var job2 = new Work_IntersectPointJob() + { + localRayPos = localRayPos, + localRayDir = localRayDir, + rayDir = rayDir, + + localPointRadius = localPointRadius, + localPositions = localPositions.GetNativeArray(), + vertexToTriangles = vertexToTriangles, + + hitList = hitList.AsParallelWriter(), + }; + jobHandle = job2.Schedule(VertexCount, 16, jobHandle); +#endif + + // ‚½ƒĵƒˆ + var job3 = new Work_IntersetcSortJob() + { + hitList = hitList, + }; + jobHandle = job3.Schedule(jobHandle); + + // ċŒäş†ċ…Ħ + jobHandle.Complete(); + + // ĉœ€‚‚èż‘„ƒ’ƒƒƒˆĉƒ…ċ ħ‚’èż”™ + var rayhit = hitList.Length > 0 ? hitList[0] : default; + + //Debug.Log($"IntersectMesh: {rayhit}"); + + return rayhit; + } + + [BurstCompile] + struct Work_IntersectTriangleJob : IJobParallelFor + { + public float3 localRayPos; + public float3 localRayDir; + public float3 localRayEndPos; + public bool doubleSide; + + [Unity.Collections.ReadOnly] + public NativeArray localPositions; + [Unity.Collections.ReadOnly] + public NativeArray triangles; + + // output + [Unity.Collections.WriteOnly] + public NativeList.ParallelWriter hitList; + + + public void Execute(int tindex) + { + int3 tri = triangles[tindex]; + var pos0 = localPositions[tri.x]; + var pos1 = localPositions[tri.y]; + var pos2 = localPositions[tri.z]; + + // ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ‚’ċŒ…‚€çƒ + MathUtility.GetTriangleSphere(pos0, pos1, pos2, out float3 sc, out float sr); + + // 球¨ƒĴ‚¤èĦçށċˆ¤ċš + float t = 0; + float3 q = 0; + if (MathUtility.IntersectRaySphere(localRayPos, localRayDir, sc, sr, ref t, ref q) == false) + return; + + // ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ¨ƒĴ‚¤èݳ細ċˆ¤ċš + if (MathUtility.IntersectSegmentTriangle(localRayPos, localRayEndPos, pos0, pos1, pos2, doubleSide, out _, out _, out _, out t) == false) + return; + + // èĦçŞä½ç½ + float3 hitPos = math.lerp(localRayPos, localRayEndPos, t); + + // ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĉ³•ç·š + float3 tn = MathUtility.TriangleNormal(pos0, pos1, pos2); + + // ĉ ĵ納 + //Debug.Log($"Triangle Hit!. tindex:{tindex}, tri:{tri} hitpos:{hitPos}, tn:{tn}"); + var hit = new VirtualMeshRaycastHit(); + hit.type = VirtualMeshPrimitive.Triangle; + hit.index = tindex; + hit.position = hitPos; + hit.distance = t; + hit.normal = tn; + hitList.AddNoResize(hit); + } + } + + [BurstCompile] + struct Work_IntersectEdgeJob : IJobParallelFor + { + public float3 localRayPos; + public float3 localRayDir; + public float3 localRayEndPos; + public float3 rayDir; + + public float localEdgeRadius; + [Unity.Collections.ReadOnly] + public NativeArray localPositions; + [Unity.Collections.ReadOnly] + public NativeArray edges; + [Unity.Collections.ReadOnly] + public NativeParallelMultiHashMap edgeToTriangles; + + // output + [Unity.Collections.WriteOnly] + public NativeList.ParallelWriter hitList; + + public void Execute(int eindex) + { + int2 edge = edges[eindex]; + + // ‚¨ƒƒ‚¸Œƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĞċħž™‚‹ċ ´ċˆŻç„ĦċŠı + if (edgeToTriangles.ContainsKey(edge)) + return; + + var pos0 = localPositions[edge.x]; + var pos1 = localPositions[edge.y]; + + // ïĵ’¤ç›´ç·šèĦçށċˆ¤ċš + float distSq = MathUtility.ClosestPtSegmentSegment(pos0, pos1, localRayPos, localRayEndPos, out float s, out float t, out float3 c1, out float3 c2); + float dist = math.sqrt(distSq); + if (dist > localEdgeRadius) + return; + + // èĦçŞä½ç½ + float3 hitPos = c2; + + // ĉ ĵ納 + var hit = new VirtualMeshRaycastHit(); + hit.type = VirtualMeshPrimitive.Edge; + hit.index = eindex; + hit.position = hitPos; + hit.distance = t; + hit.normal = -rayDir; + hitList.AddNoResize(hit); + } + } + + [BurstCompile] + struct Work_IntersectPointJob : IJobParallelFor + { + public float3 localRayPos; + public float3 localRayDir; + public float3 rayDir; + + public float localPointRadius; + [Unity.Collections.ReadOnly] + public NativeArray localPositions; + [Unity.Collections.ReadOnly] + public NativeArray> vertexToTriangles; + + // output + [Unity.Collections.WriteOnly] + public NativeList.ParallelWriter hitList; + + public void Execute(int vindex) + { + // 頂ç‚ıŒƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĞĉŽçĥš•‚ŒĤ„‚‹ċ ´ċˆŻç„ĦċŠı + if (vertexToTriangles[vindex].Length > 0) + return; + + var pos = localPositions[vindex]; + + // 球¨ƒĴ‚¤èĦçށċˆ¤ċš + float t = 0; + float3 q = 0; + if (MathUtility.IntersectRaySphere(localRayPos, localRayDir, pos, localPointRadius, ref t, ref q) == false) + return; + + // ĉ ĵ納 + var hit = new VirtualMeshRaycastHit(); + hit.type = VirtualMeshPrimitive.Point; + hit.index = vindex; + hit.position = pos; + hit.distance = t; + hit.normal = -rayDir; + hitList.AddNoResize(hit); + } + } + + [BurstCompile] + struct Work_IntersetcSortJob : IJob + { + public NativeList hitList; + + public void Execute() + { + if (hitList.Length > 1) + hitList.Sort(); + } + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshWork.cs.meta b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshWork.cs.meta new file mode 100644 index 00000000..853f3fb2 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshWork.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 7547f9437ec9b1f45bb3c8305bb8aadc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/VirtualMesh/Function/VirtualMeshWork.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VertexAttribute.cs b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VertexAttribute.cs new file mode 100644 index 00000000..74da2f7d --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VertexAttribute.cs @@ -0,0 +1,167 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System; +using System.Runtime.CompilerServices; + +namespace MagicaCloth2 +{ + /// + /// 頂ç‚ıċħžĉ€§ + /// + [System.Serializable] + public struct VertexAttribute : IEquatable + { + /// + /// ƒ“ƒƒƒˆƒ•ƒİ‚° + /// + public const byte Flag_Fixed = 0x01; // ċ›şċš + public const byte Flag_Move = 0x02; // ç§ğċ‹• + //public const byte Flag_Ignore = 0x04; // ç„ĦèĤ–ïĵˆ‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ċŻèħĦ¨—Ş„ïĵ‰:一ĉ—Ĥ‚ރŸƒƒƒˆ! + public const byte Flag_InvalidMotion = 0x08; // ƒ˘ƒĵ‚·ƒ§ƒ³ċˆĥ約ç„ĦċŠı + public const byte Flag_DisableCollision = 0x10; // ‚³ƒŞ‚¸ƒ§ƒ³ç„ĦċŠı + public const byte Flag_ZeroDistance = 0x20; // “é ‚ç‚ıŻèĤށ¨è·é›˘Œ‚ĵƒ­ + public const byte Flag_Triangle = 0x80; // “é ‚ç‚ıŻƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĞċħž—Ĥ„‚‹ + + public static readonly VertexAttribute Invalid = new VertexAttribute(); + public static readonly VertexAttribute Fixed = new VertexAttribute(Flag_Fixed); + public static readonly VertexAttribute Move = new VertexAttribute(Flag_Move); + public static readonly VertexAttribute DisableCollision = new VertexAttribute(Flag_DisableCollision); + + //========================================================================================= + /// + /// ċħžĉ€§ċ€¤ïĵˆƒ“ƒƒƒˆƒ•ƒİ‚°ïĵ‰ + /// + public byte Value; + + //========================================================================================= + public VertexAttribute(byte initialValue = 0) + { + Value = initialValue; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Clear() + { + Value = 0; + } + + /// + /// ƒ•ƒİ‚°è¨­ċš + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void SetFlag(byte flag, bool sw) + { + if (sw) + Value |= flag; + else + Value = (byte)(Value & ~flag); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void SetFlag(VertexAttribute attr, bool sw) + { + if (sw) + Value |= attr.Value; + else + Value = (byte)(Value & ~attr.Value); + } + + /// + /// ƒ•ƒİ‚°ċˆ¤ċš + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool IsSet(byte flag) + { + return (Value & flag) != 0; + } + + /// + /// ç„ĦċŠıċħžĉ€§ċˆ¤ċš(Move/Fixedİ‚Œ§‚‚Ş„ċ ´ċˆ) + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool IsInvalid() => IsSet(Flag_Fixed | Flag_Move) == false; + //public bool IsInvalid() => IsSet(Flag_Fixed | Flag_Move | Flag_Ignore) == false; + + /// + /// ċ›şċšċħžĉ€§ċˆ¤ċš + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool IsFixed() => IsSet(Flag_Fixed); + + /// + /// ç§ğċ‹•ċħžĉ€§ċˆ¤ċš + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool IsMove() => IsSet(Flag_Move); + + /// + /// ç§ğċ‹•—Ş„ƒ‘ƒĵƒ†‚£‚ŻƒĞ‹ċˆ¤ċš™‚‹ + /// “‚ŒŻċ›şċšċħžĉ€§äğċ¤–Ğ‚‚ĉŽ´‚ŒŸ“¨Ğ‚ˆ‚Šċ‹•‹ŞŞ£Ÿƒ‘ƒĵƒ†‚£‚ŻƒĞ‚‚ċĞ‚Œ‚‹ + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool IsDontMove() => !IsSet(Flag_Move); + + /// + /// ç„ĦèĤ–ċħžĉ€§ċˆ¤ċš + /// + /// + //[MethodImpl(MethodImplOptions.AggressiveInlining)] + //public bool IsIgnore() => IsSet(Flag_Ignore); + + /// + /// ƒ˘ƒĵ‚·ƒ§ƒ³ċˆĥ約ĉœ‰ċŠıċˆ¤ċš + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool IsMotion() => IsSet(Flag_InvalidMotion) == false; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool IsDisableCollision() => IsSet(Flag_DisableCollision); + + //========================================================================================= + /// + /// ïĵ’¤é ‚ç‚ıċħžĉ€§‚’結ċˆ—Ĥĉ–°—„ċħžĉ€§‚’èż”™ + /// ċŸşĉœĴ的Ğċħžĉ€§ċ€¤Œä½Ž„ĉ–ıŒċ„Şċ…ˆ•‚Œ‚‹ïĵˆç„ĦċŠı(0)ïĵžċ›şċš(1)ïĵžç§ğċ‹•(2)ïĵ‰ + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static VertexAttribute JoinAttribute(VertexAttribute attr1, VertexAttribute attr2) + { + // todo:““Żé ‚ç‚ıċħžĉ€§Œċ˘—ˆ‚‹¨ċŽ„äğ‹‹‚‚ + return attr1.Value < attr2.Value ? attr1 : attr2; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(VertexAttribute other) + { + return Value == other.Value; + } + + public override bool Equals(object obj) + { + return obj is VertexAttribute converted && Equals(converted); + } + + public override int GetHashCode() + { + return Value; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==(VertexAttribute lhs, VertexAttribute rhs) { return lhs.Value == rhs.Value; } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator !=(VertexAttribute lhs, VertexAttribute rhs) { return lhs.Value != rhs.Value; } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VertexAttribute.cs.meta b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VertexAttribute.cs.meta new file mode 100644 index 00000000..19c658cb --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VertexAttribute.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: bd2250d458ce5eb4f9fbb2ad312b5762 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VertexAttribute.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VirtualMesh.cs b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VirtualMesh.cs new file mode 100644 index 00000000..bc028ac7 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VirtualMesh.cs @@ -0,0 +1,534 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System; +using System.Text; +using Unity.Collections; +using Unity.Mathematics; + +namespace MagicaCloth2 +{ + /// + /// MagicaCloth§ċˆİ用™‚‹äğĉƒ³ƒĦƒƒ‚·ƒĉ§‹é€  + /// ƒğƒĦƒƒ‚·ƒèĤŞċ­é–˘äż‚Ğ‚ˆ‚Šé ‚ç‚ıŒé€£ċ‹•™‚‹ + /// ƒğƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ ‘§Şƒİ‚¤ƒ³ĉ§‹é€ ‚‚èލ‚‚‹ + /// ƒğ‚ıƒĴƒƒƒ‰§ċˆİ用§‚‹‚ˆ†Ğ™‚‹ + /// ƒğ頂ç‚ıĉ•°Żĉœ€ċ¤§65535Ğċˆĥ限€Ÿ —一部‚’除‚¤ƒ³ƒ‡ƒƒ‚Ż‚ıŻint§ĉ‰ħ† + /// + public partial class VirtualMesh : IDisposable, IValid + { + + public string name = string.Empty; + + public ResultCode result = new ResultCode(); + + public bool isManaged; // PreBuild DeserializeManagerçĦ理 + + /// + /// ƒĦƒƒ‚·ƒ‚ż‚¤ƒ— + /// + public enum MeshType + { + /// + /// 通ċ¸¸ƒĦƒƒ‚·ƒ + /// ċş§ĉ¨™è¨ˆç—ïĵšTransform‹‚‰‚ı‚­ƒ‹ƒ³‚°€ĉ³•ç·šĉŽç·šè¨ˆç—ïĵšTransform‹‚‰‚ı‚­ƒ‹ƒ³‚° + /// + NormalMesh = 0, + + /// + /// Transform連ċ‹•ƒĦƒƒ‚·ƒ + /// ċş§ĉ¨™è¨ˆç—ïĵšTransform直ċ€¤€ĉ³•ç·šĉŽç·šè¨ˆç—ïĵšTransform直ċ€¤ + /// + NormalBoneMesh = 1, + + /// + /// ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒ + /// ĉ³•ç·šĉŽç·šè¨ˆç—‚’ĉŽçĥš™‚‹ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ‹‚‰ĉħ‚‚‚‹ + /// ċş§ĉ¨™è¨ˆç—ïĵšTransform‹‚‰‚ı‚­ƒ‹ƒ³‚°€ĉ³•ç·šĉŽç·šè¨ˆç—ïĵšĉŽçĥšƒˆƒİ‚¤‚˘ƒ³‚°ƒĞċı³ċ‡ċŒ– or ‚ı‚­ƒ‹ƒ³‚°ç›´ċ€¤ + /// + ProxyMesh = 2, + + /// + /// Transform連ċ‹•ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒ + /// ‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ċ‰ĞTransformċİċ…ƒ‚’èĦŒ„€‚·ƒŸƒƒĴƒĵ‚·ƒ§ƒ³ċŒĞTransform‚’ĉ›¸èĵ‚€ + /// ċş§ĉ¨™è¨ˆç—ïĵšTransform直ċ€¤€ĉ³•ç·šĉŽç·šè¨ˆç—ïĵšĉŽçĥšƒˆƒİ‚¤‚˘ƒ³‚°ƒĞċı³ċ‡ċŒ– or Transform直ċ€¤ + /// + ProxyBoneMesh = 3, + + /// + /// ƒžƒƒƒ”ƒ³‚°ƒĦƒƒ‚·ƒ(MeshClothż) + /// ƒĦƒƒ‚·ƒŒƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒĞƒžƒƒƒ”ƒ³‚°•‚ŒŸçŠĥĉ…‹ + /// ċş§ĉ¨™è¨ˆç—ïĵšĉŽçĥšProxyMesh頂ç‚ı‹‚‰‚ı‚­ƒ‹ƒ³‚°€ĉ³•ç·šĉŽç·šè¨ˆç—ïĵšĉŽçĥšProxyMesh‹‚‰‚ı‚­ƒ‹ƒ³‚° + /// + Mapping = 4, + } + public MeshType meshType = MeshType.NormalMesh; + + /// + /// Transform¨ç›´ĉŽé€£ċ‹•™‚‹‹İ†‹(=BoneCloth) + /// + public bool isBoneCloth = false; + + //========================================================================================= + // ƒĦƒƒ‚·ƒĉƒ…ċ ħïĵˆċŸşĉœĴïĵ‰ + //========================================================================================= + /// + /// çċœ¨é ‚ç‚ıŒĉŒ‡™ċ…ƒé ‚ç‚ı‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı + /// + public ExSimpleNativeArray referenceIndices = new ExSimpleNativeArray(); + + /// + /// 頂ç‚ıċħžĉ€§ + /// + public ExSimpleNativeArray attributes = new ExSimpleNativeArray(); + + public ExSimpleNativeArray localPositions = new ExSimpleNativeArray(); + public ExSimpleNativeArray localNormals = new ExSimpleNativeArray(); + public ExSimpleNativeArray localTangents = new ExSimpleNativeArray(); + + /// + /// VirtualMeshUVŻTangent計ç—用§‚‚Šƒ†‚Ż‚ıƒƒ£ƒžƒƒƒ”ƒ³‚°ç”¨§ŻŞ„§ĉ³¨ĉ„ïĵ + /// + public ExSimpleNativeArray uv = new ExSimpleNativeArray(); + public ExSimpleNativeArray boneWeights = new ExSimpleNativeArray(); + + public ExSimpleNativeArray triangles = new ExSimpleNativeArray(); + public ExSimpleNativeArray lines = new ExSimpleNativeArray(); + + /// + /// ƒĦƒƒ‚·ƒċŸşĉş–ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ  + /// + public int centerTransformIndex = -1; + + /// + /// “ƒĦƒƒ‚·ƒċŸşĉş–ƒžƒˆƒŞƒƒ‚Ż‚ı¨ċ›žèğ˘ + /// + public float4x4 initLocalToWorld; + public float4x4 initWorldToLocal; + public quaternion initRotation; + public quaternion initInverseRotation; + public float3 initScale; + + /// + /// 計ç—用‚ı‚ħƒĵƒĞ(Xè𸁁ż§ċˆ¤ċš) + /// + public float InitCalcScale => initScale.x; + + /// + /// ‚ı‚­ƒ‹ƒ³‚°ƒĞƒĵƒˆƒœƒĵƒ³ + /// + public int skinRootIndex = -1; + + /// + /// ‚ı‚­ƒ‹ƒ³‚°ƒœƒĵƒ³ + /// + public ExSimpleNativeArray skinBoneTransformIndices = new ExSimpleNativeArray(); + public ExSimpleNativeArray skinBoneBindPoses = new ExSimpleNativeArray(); + + /// + /// “ƒĦƒƒ‚·ƒ§ċˆİ用™‚‹Transformĉƒ…ċ ħ + /// + public TransformData transformData; + + /// + /// ƒ‚Ĥƒ³ƒ‡‚£ƒ³‚°ƒœƒƒ‚Ż‚ı + /// + public NativeReference boundingBox; + + /// + /// 頂ç‚ıċı³ċ‡ĉŽçĥšè·é›˘ + /// + public NativeReference averageVertexDistance; + + /// + /// 頂ç‚ıĉœ€ċ¤§ĉŽçĥšè·é›˘ + /// + public NativeReference maxVertexDistance; + + public bool IsSuccess => result.IsSuccess(); + public bool IsError => result.IsError(); + public bool IsProcess => result.IsProcess(); + public int VertexCount => localPositions.Count; + public int TriangleCount => triangles.Count; + public int LineCount => lines.Count; + public int SkinBoneCount => skinBoneTransformIndices.Count; + public int TransformCount => transformData?.Count ?? 0; + public bool IsProxy => meshType == MeshType.ProxyMesh || meshType == MeshType.ProxyBoneMesh; + public bool IsMapping => meshType == MeshType.Mapping; + + //========================================================================================= + // 結ċˆïĵƒŞƒ€‚Ż‚·ƒ§ƒ³ + //========================================================================================= + /// + /// 結ċˆ•‚ŒŸé ‚ç‚ı範ċ›²ïĵˆçµċˆ‚‚¨ƒĦƒƒ‚·ƒŒäżĉŒ™‚‹ïĵ‰ + /// + public DataChunk mergeChunk; + + /// + /// ċ…ƒé ‚ç‚ı‹‚‰çµċˆ¨ƒŞƒ€‚Ż‚·ƒ§ƒ³ċŒé ‚ç‚ı¸‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı + /// + public NativeArray joinIndices; + + //========================================================================================= + // ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒ + //========================================================================================= + /// + /// 頂ç‚ı”¨ĉŽçĥšƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı¨ĉ³•ç·šĉŽç·šƒ•ƒŞƒƒƒ—ƒ•ƒİ‚°ïĵˆĉœ€ċ¤§ïĵ—¤ïĵ‰ + /// “‚ŒŻĉ³•ç·š‚’ċ†è¨ˆç—™‚‹Ÿ‚Ğ用„‚‰‚Œ‚‹‚‚§ïĵ—¤‚‚Œ°ċċˆ†§‚‚‹¨ċˆ¤ĉ–­—Ÿ‚‚€‚ + /// Ÿ‚ĉ­£ç˘şŞƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĉŽçĥš‚’èĦ¨—Ĥ„Ş„€‚ + /// ƒ‡ƒĵ‚żŻ12-20bituint§ƒ‘ƒƒ‚݁•‚ŒĤ„‚‹ + /// 12(hi) = ĉ³•ç·šĉŽç·šƒ•ƒŞƒƒƒ—ƒ•ƒİ‚°(ĉ³•ç·š:0x1,ĉŽç·š:0x2)€‚ONċ ´ċˆƒ•ƒŞƒƒƒ—€‚ + /// 20(low) = ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı€‚ + /// + public NativeArray> vertexToTriangles; + + /// + /// 頂ç‚ı”¨ĉŽçĥšé ‚ç‚ı‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı + /// vertexToVertexIndexArrayŻé ‚ç‚ı”¨ƒ‡ƒĵ‚żé–‹ċ§‹‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı(22bit)¨‚Ğ‚Ĥƒ³‚ż(10bit)‚’ïĵ‘¤uintĞ結ċˆ—Ÿ‚‚ + /// todo:““ŻMultiHashMap§è‰Ż„‹‚‚—‚ŒŞ„ + /// + public NativeArray vertexToVertexIndexArray; + public NativeArray vertexToVertexDataArray; + + /// + /// ‚¨ƒƒ‚¸ƒŞ‚ıƒˆ + /// + public NativeArray edges; + + /// + /// ‚¨ƒƒ‚¸ċ›şĉœ‰ƒ•ƒİ‚° + /// + public const byte EdgeFlag_Cut = 0x1; // ċˆ‡‚Šċ£‚¨ƒƒ‚¸ + public NativeArray edgeFlags; + + /// + /// ‚¨ƒƒ‚¸”¨ĉŽçĥšƒˆƒİ‚¤‚˘ƒ³‚°ƒĞ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı + /// + public NativeParallelMultiHashMap edgeToTriangles; + + /// + /// 頂ç‚ı”¨ƒ‚¤ƒ³ƒ‰ƒƒĵ‚ş + /// 頂ç‚ıƒ‚¤ƒ³ƒ‰ĞŻ‚ı‚ħƒĵƒĞċ€¤Żä¸èĤ + /// + public NativeArray vertexBindPosePositions; + public NativeArray vertexBindPoseRotations; + + /// + /// 頂ç‚ı”¨è¨ˆç—ċ§żċ‹˘‹‚‰Transform¸ċ¤‰ĉ›ċ›žèğ˘(BoneClothż) + /// + public NativeArray vertexToTransformRotations; + + /// + /// ċ„é ‚ç‚ıƒĴƒ™ƒĞïĵˆèµ·ç‚ıŻïĵ‹‚‰ïĵ‰ + /// + //public NativeArray vertexLevels; + + /// + /// ċ„é ‚ç‚ıĉ·ħ•(0.0-1.0) + /// + public NativeArray vertexDepths; + + /// + /// ċ„é ‚ç‚ıƒĞƒĵƒˆ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı(-1=Ş—) + /// + public NativeArray vertexRootIndices; + + /// + /// ċ„é ‚ç‚ıèĤŞé ‚ç‚ı‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı(-1=Ş—) + /// + public NativeArray vertexParentIndices; + + /// + /// ċ„é ‚ç‚ıċ­é ‚ç‚ı‚¤ƒ³ƒ‡ƒƒ‚Ż‚ıƒŞ‚ıƒˆ + /// + public NativeArray vertexChildIndexArray; + public NativeArray vertexChildDataArray; + + /// + /// ċ„é ‚ç‚ıèĤށ‹‚‰ċŸşĉş–ƒ­ƒĵ‚ЃĞċş§ĉ¨™ + /// + public NativeArray vertexLocalPositions; + + /// + /// ċ„é ‚ç‚ıèĤށ‹‚‰ċŸşĉş–ƒ­ƒĵ‚ЃĞċ›žèğ˘ + /// + public NativeArray vertexLocalRotations; + + /// + /// ĉ³•ç·šèŞżĉ•´ç”¨ċ›žèğ˘ + /// + public NativeArray normalAdjustmentRotations; + +#if false + /// + /// 角ċşĤ計ç—用ċŸşĉş–ĉ³•ç·šè¨ˆç—ĉ–ıĉ³• + /// + public enum NormalCalcMode + { + Auto = 0, + X_Axis = 1, + Y_Axis = 2, + Z_Axis = 3, + Point_Outside = 4, + Point_Inside = 5, + //Line_Outside = 6, + //Line_Inside = 7, + } + //public NormalCalcMode normalCalcMode = NormalCalcMode.Auto; + + /// + /// ċ„é ‚ç‚ıè§’ċşĤ計ç—用ċŸşĉş–ƒ­ƒĵ‚ЃĞċ›žèğ˘ + /// -AngleLimitConstraint§ä½żç”¨™‚‹ + /// pitch/yawċ€‹ċˆċˆĥ限Żv1.0§ŻċŸè£…—Ş„§ä¸€ĉ—Ĥċœĉ­˘•›‚‹ + /// + //public NativeArray vertexAngleCalcLocalRotations; +#endif + + /// + /// ĉœ€ċ¤§ƒĴƒ™ƒĞċ€¤ + /// + //public NativeReference vertexMaxLevel; + + /// + /// ƒ™ƒĵ‚ıƒİ‚¤ƒ³”¨ƒ•ƒİ‚° + /// + public const byte BaseLineFlag_IncludeLine = 0x01; // ƒİ‚¤ƒ³‚’ċĞ‚€ + public NativeArray baseLineFlags; + + /// + /// ƒ™ƒĵ‚ıƒİ‚¤ƒ³”¨ƒ‡ƒĵ‚żé–‹ċ§‹‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı + /// + public NativeArray baseLineStartDataIndices; + + /// + /// ƒ™ƒĵ‚ıƒİ‚¤ƒ³”¨ƒ‡ƒĵ‚żĉ•° + /// + public NativeArray baseLineDataCounts; + + /// + /// ƒ™ƒĵ‚ıƒİ‚¤ƒ³ƒ‡ƒĵ‚żïĵˆé ‚ç‚ı‚¤ƒ³ƒ‡ƒƒ‚Ż‚ıïĵ‰ + /// + public NativeArray baseLineData; + + /// + /// ‚Ğ‚ı‚żƒ ‚ı‚­ƒ‹ƒ³‚°ƒœƒĵƒ³ç™ğ録ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı + /// + public int[] customSkinningBoneIndices; + + /// + /// ‚ğƒ³‚żƒĵ計ç—用ċ›şċšé ‚ç‚ıƒŞ‚ıƒˆ + /// + public ushort[] centerFixedList; + + /// + /// ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒĉ§‹ç݉ĉ™‚‚ğƒ³‚żƒĵ位ç½ïĵˆƒ­ƒĵ‚ЃĞïĵ‰ + /// ċ›şċšé ‚ç‚ıŒç„Ħ„ċ ´ċˆŻ(0,0,0) + /// + public NativeReference localCenterPosition; + + public int BaseLineCount => baseLineStartDataIndices.IsCreated ? baseLineStartDataIndices.Length : 0; + public int EdgeCount => edges.IsCreated ? edges.Length : 0; + public int CustomSkinningBoneCount => customSkinningBoneIndices?.Length ?? 0; + public int CenterFixedPointCount => centerFixedList?.Length ?? 0; + public int NormalAdjustmentRotationCount => normalAdjustmentRotations.IsCreated ? normalAdjustmentRotations.Length : 0; + + //========================================================================================= + // ƒžƒƒƒ”ƒ³‚°ƒĦƒƒ‚·ƒ + //========================================================================================= + /// + /// ĉŽçĥš—Ĥ„‚‹ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒ + /// + public VirtualMesh mappingProxyMesh; + + /// + /// ƒžƒƒƒ”ƒ³‚°ƒĦƒƒ‚·ƒ‚ğƒ³‚żƒĵƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ĉƒ…ċ ħ + /// ĉŻŽƒ•ƒĴƒĵƒ ĉ›´ĉ–°•‚Œ‚‹ + /// Meshċ ´ċˆŻƒĴƒ³ƒ€ƒİƒĵƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ¨Ş‚‹ + /// + public float3 centerWorldPosition; + public quaternion centerWorldRotation; + public float3 centerWorldScale; + + /// + /// ċˆĉœŸçŠĥĉ…‹§ƒžƒƒƒ”ƒ³‚°ƒĦƒƒ‚·ƒ¸ċ¤‰ĉ›ƒžƒˆƒŞƒƒ‚Ż‚ı¨ċ¤‰ĉ›ċ›žèğ˘ + /// “ċ§żċ‹˘ŻċˆĉœŸċŒ–ĉ™‚Ğċ›şċš•‚Œ‚‹ + /// + public float4x4 toProxyMatrix; + public quaternion toProxyRotation; + + /// + /// ƒžƒƒĵ‚¸ƒ£¸ç™ğ録ID + /// + public int mappingId; + + //========================================================================================= + public VirtualMesh() { } + + public VirtualMesh(bool initialize) + { + if (initialize) + { + transformData = new TransformData(100); + + // ĉœ€ċ°é™ƒ‡ƒĵ‚ż + averageVertexDistance = new NativeReference(0.0f, Allocator.Persistent); + maxVertexDistance = new NativeReference(0.0f, Allocator.Persistent); + + // 作ĉ­ä¸­Ğ—ĤŠ + result.SetProcess(); + } + } + + public VirtualMesh(string name) : this(true) + { + this.name = name; + } + + public void Dispose() + { + // PreBuild DeserializeManagerçĦ理中Żç ´ĉ£„•›Ş„ + if (isManaged) + return; + + result.Clear(); + referenceIndices.Dispose(); + attributes.Dispose(); + localPositions.Dispose(); + localNormals.Dispose(); + localTangents.Dispose(); + uv.Dispose(); + boneWeights.Dispose(); + triangles.Dispose(); + lines.Dispose(); + skinBoneTransformIndices.Dispose(); + skinBoneBindPoses.Dispose(); + + if (joinIndices.IsCreated) + joinIndices.Dispose(); + + if (vertexToTriangles.IsCreated) + vertexToTriangles.Dispose(); + if (vertexToVertexIndexArray.IsCreated) + vertexToVertexIndexArray.Dispose(); + if (vertexToVertexDataArray.IsCreated) + vertexToVertexDataArray.Dispose(); + if (edges.IsCreated) + edges.Dispose(); + if (edgeFlags.IsCreated) + edgeFlags.Dispose(); + if (edgeToTriangles.IsCreated) + edgeToTriangles.Dispose(); + if (vertexBindPosePositions.IsCreated) + vertexBindPosePositions.Dispose(); + if (vertexBindPoseRotations.IsCreated) + vertexBindPoseRotations.Dispose(); + if (vertexToTransformRotations.IsCreated) + vertexToTransformRotations.Dispose(); + if (vertexRootIndices.IsCreated) + vertexRootIndices.Dispose(); + if (vertexParentIndices.IsCreated) + vertexParentIndices.Dispose(); + if (vertexChildIndexArray.IsCreated) + vertexChildIndexArray.Dispose(); + if (vertexChildDataArray.IsCreated) + vertexChildDataArray.Dispose(); + if (baseLineFlags.IsCreated) + baseLineFlags.Dispose(); + if (baseLineStartDataIndices.IsCreated) + baseLineStartDataIndices.Dispose(); + if (baseLineDataCounts.IsCreated) + baseLineDataCounts.Dispose(); + if (baseLineData.IsCreated) + baseLineData.Dispose(); + if (localCenterPosition.IsCreated) + localCenterPosition.Dispose(); + if (vertexLocalPositions.IsCreated) + vertexLocalPositions.Dispose(); + if (vertexLocalRotations.IsCreated) + vertexLocalRotations.Dispose(); + if (normalAdjustmentRotations.IsCreated) + normalAdjustmentRotations.Dispose(); + //if (vertexAngleCalcLocalRotations.IsCreated) + // vertexAngleCalcLocalRotations.Dispose(); + //if (vertexMaxLevel.IsCreated) + // vertexMaxLevel.Dispose(); + //if (vertexLevels.IsCreated) + // vertexLevels.Dispose(); + if (vertexDepths.IsCreated) + vertexDepths.Dispose(); + if (boundingBox.IsCreated) + boundingBox.Dispose(); + if (averageVertexDistance.IsCreated) + averageVertexDistance.Dispose(); + if (maxVertexDistance.IsCreated) + maxVertexDistance.Dispose(); + + transformData?.Dispose(); + } + + public void SetName(string newName) + { + name = newName; + } + + /// + /// ĉœ€ä½Žé™ƒ‡ƒĵ‚żĉ¤œè¨ĵ + /// + /// + public bool IsValid() + { + if (transformData == null) + return false; + + // ƒĴƒ³ƒ€ƒİƒĵŒċ­˜ċœ¨™‚‹ċ ´ċˆŻċ­˜ċœ¨‚’確èލ™‚‹ + // Ÿ —PreBuild§ŻtransformListŻçİşŞ§‚ı‚­ƒƒƒ—™‚‹ + if (centerTransformIndex >= 0 && transformData.IsEmpty == false && transformData.GetTransformFromIndex(centerTransformIndex) == null) + return false; + + return true; + } + + //========================================================================================= + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + + sb.AppendLine($"===== {name} ====="); + sb.AppendLine($"Result:{result.GetResultString()}"); + sb.AppendLine($"Type:{meshType}"); + sb.AppendLine($"Vertex:{VertexCount}"); + sb.AppendLine($"Line:{LineCount}"); + sb.AppendLine($"Triangle:{TriangleCount}"); + sb.AppendLine($"Edge:{EdgeCount}"); + sb.AppendLine($"SkinBone:{SkinBoneCount}"); + sb.AppendLine($"Transform:{TransformCount}"); + if (averageVertexDistance.IsCreated) + sb.AppendLine($"avgDist:{averageVertexDistance.Value}"); + if (maxVertexDistance.IsCreated) + sb.AppendLine($"maxDist:{maxVertexDistance.Value}"); + if (boundingBox.IsCreated) + sb.AppendLine($"AABB:{boundingBox.Value}"); + sb.AppendLine(); + + sb.AppendLine($"<<< Proxy >>>"); + sb.AppendLine($"BaseLine:{BaseLineCount}"); + sb.AppendLine($"EdgeCount:{EdgeCount}"); + int edgeToTrianglesCnt = edgeToTriangles.IsCreated ? edgeToTriangles.Count() : 0; + sb.AppendLine($"edgeToTriangles:{edgeToTrianglesCnt}"); + sb.AppendLine($"CustomSkinningBoneCount:{CustomSkinningBoneCount}"); + sb.AppendLine($"CenterFixedPointCount:{CenterFixedPointCount}"); + sb.AppendLine($"NormalAdjustmentRotationCount:{NormalAdjustmentRotationCount}"); + sb.AppendLine(); + + sb.AppendLine($"<<< Mapping >>>"); + sb.AppendLine($"centerWorldPosition:{centerWorldPosition}"); + sb.AppendLine(); + + //sb.AppendLine($"<<< TransformData >>>"); + sb.AppendLine(transformData?.ToString() ?? "(none)"); + sb.AppendLine(); + + return sb.ToString(); + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VirtualMesh.cs.meta b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VirtualMesh.cs.meta new file mode 100644 index 00000000..081e0f64 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VirtualMesh.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 12b26397b658837409cd78bc3343ac9f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VirtualMesh.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VirtualMeshBoneWeight.cs b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VirtualMeshBoneWeight.cs new file mode 100644 index 00000000..191b4c45 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VirtualMeshBoneWeight.cs @@ -0,0 +1,142 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using Unity.Mathematics; +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// VirtualMesh§ċˆİ用•‚Œ‚‹é ‚ç‚ıƒœƒĵƒ³‚Ĥ‚¨‚¤ƒˆ + /// “‚ŒŻUnity.BoneWeightĉ§‹é€ ä½“‚’ċ†ƒžƒƒƒ”ƒ³‚°—Ÿ‚‚ + /// + public struct VirtualMeshBoneWeight + { + public float4 weights; + public int4 boneIndices; + + public bool IsValid => weights[0] >= 1e-06f; + + + public VirtualMeshBoneWeight(int4 boneIndices, float4 weights) + { + this.boneIndices = boneIndices; + this.weights = weights; + } + + /// + /// ĉœ‰ċŠıŞ‚Ĥ‚¨‚¤ƒˆĉ•° + /// + public int Count + { + get + { + if (weights[3] > 0.0f) + return 4; + if (weights[2] > 0.0f) + return 3; + if (weights[1] > 0.0f) + return 2; + if (weights[0] > 0.0f) + return 1; + + return 0; + } + } + + public void AddWeight(int boneIndex, float weight) + { + if (weight < 1e-06f) + return; + + // ™§Ğç™ğ録ĉ¸ˆżŞ‚‰°‚Ĥ‚¨‚¤ƒˆżċŠ ç—™‚‹ + int wcnt = 0; + for (int i = 0; i < 4; i++) + { + float w = weights[i]; + if (w == 0.0f) + break; + if (boneIndices[i] == boneIndex) + { + // ‚Ĥ‚¨‚¤ƒˆċŠ ç— + w += weight; + weights[i] = w; + + // ‚½ƒĵƒˆ + for (int j = i; j >= 1; j--) + { + if (weights[j] > weights[j - 1]) + { + // swap + w = weights[j - 1]; + weights[j - 1] = weights[j]; + weights[j] = w; + + int x = boneIndices[j - 1]; + boneIndices[j - 1] = boneIndices[j]; + boneIndices[j] = x; + } + } + + return; + } + wcnt++; + } + + + // ™§Ğç™ğ録•‚ŒĤ„‚‹‚Ĥ‚¨‚¤ƒˆ‚ˆ‚Šċ¤§‘‚Œ°ĉŒżċ…™‚‹ + for (int i = 0; i < 4; i++) + { + float w = weights[i]; + if (w == 0.0f) + { + weights[i] = weight; + boneIndices[i] = boneIndex; + return; + } + else if (weight > w) + { + // ĉŒżċ… + for (int j = 2; j >= i; j--) + { + weights[j + 1] = weights[j]; + boneIndices[j + 1] = boneIndices[j]; + } + weights[i] = weight; + boneIndices[i] = boneIndex; + return; + } + } + } + + public void AddWeight(in VirtualMeshBoneWeight bw) + { + if (bw.IsValid) + { + for (int i = 0; i < 4; i++) + { + AddWeight(bw.boneIndices[i], bw.weights[i]); + } + } + } + + /// + /// ‚Ĥ‚¨‚¤ƒˆ‚’ċˆè¨ˆïĵ‘ĞèŞżĉ•´™‚‹ + /// + public void AdjustWeight() + { + if (IsValid == false) + return; + + float total = math.csum(weights); + Debug.Assert(total >= 1e-06f); + float scl = 1.0f / total; + weights *= scl; + } + + public override string ToString() + { + return $"[{boneIndices}] w({weights})"; + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VirtualMeshBoneWeight.cs.meta b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VirtualMeshBoneWeight.cs.meta new file mode 100644 index 00000000..67c0f83c --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VirtualMeshBoneWeight.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 9bd87b7656af7404ca81798fb1180cea +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VirtualMeshBoneWeight.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VirtualMeshContainer.cs b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VirtualMeshContainer.cs new file mode 100644 index 00000000..2a68af9d --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VirtualMeshContainer.cs @@ -0,0 +1,60 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2024 MagicaSoft. +// https://magicasoft.jp +using System; +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// VirtualMeshċ…ħĉœ‰éƒ¨ċˆ†¨ċ›şĉœ‰éƒ¨ċˆ†‚’ïĵ‘¤Ğ¨‚Ÿĉƒ…ċ ħ + /// + public class VirtualMeshContainer : IDisposable + { + public VirtualMesh shareVirtualMesh; + public VirtualMesh.UniqueSerializationData uniqueData; + + public VirtualMeshContainer() + { + } + + public VirtualMeshContainer(VirtualMesh vmesh) + { + shareVirtualMesh = vmesh; + uniqueData = null; + } + + public void Dispose() + { + shareVirtualMesh?.Dispose(); + } + + //========================================================================================= + public bool hasUniqueData => uniqueData != null; + + //========================================================================================= + public int GetTransformCount() + { + if (hasUniqueData) + return uniqueData.transformData.transformArray.Length; + else + return shareVirtualMesh.TransformCount; + } + + public Transform GetTransformFromIndex(int index) + { + if (hasUniqueData) + return uniqueData.transformData.transformArray[index]; + else + return shareVirtualMesh.transformData.GetTransformFromIndex(index); + } + + public Transform GetCenterTransform() + { + if (hasUniqueData) + return uniqueData.transformData.transformArray[shareVirtualMesh.centerTransformIndex]; + else + return shareVirtualMesh.GetCenterTransform(); + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VirtualMeshContainer.cs.meta b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VirtualMeshContainer.cs.meta new file mode 100644 index 00000000..3a2b1188 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VirtualMeshContainer.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: bac7915dc7b0bda49baed15536766603 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VirtualMeshContainer.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VirtualMeshPrimitive.cs b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VirtualMeshPrimitive.cs new file mode 100644 index 00000000..e1eef606 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VirtualMeshPrimitive.cs @@ -0,0 +1,14 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp + +namespace MagicaCloth2 +{ + public enum VirtualMeshPrimitive + { + None = 0, + Point = 1, + Edge = 2, + Triangle = 3, + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VirtualMeshPrimitive.cs.meta b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VirtualMeshPrimitive.cs.meta new file mode 100644 index 00000000..a10afc0a --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VirtualMeshPrimitive.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 28eb005f383ff844d9d7b674cefb6113 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VirtualMeshPrimitive.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VirtualMeshRaycastHit.cs b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VirtualMeshRaycastHit.cs new file mode 100644 index 00000000..6be2da7c --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VirtualMeshRaycastHit.cs @@ -0,0 +1,35 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System; +using Unity.Mathematics; + +namespace MagicaCloth2 +{ + public struct VirtualMeshRaycastHit : IComparable, IValid + { + public VirtualMeshPrimitive type; + public int index; + public float3 position; + public float3 normal; + public float distance; + + public int CompareTo(VirtualMeshRaycastHit other) + { + if (distance != other.distance) + return distance < other.distance ? -1 : 1; + else + return 0; + } + + public bool IsValid() + { + return type != VirtualMeshPrimitive.None; + } + + public override string ToString() + { + return $"{type} [{index}] pos:{position}, dist:{distance}, nor:{normal}"; + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VirtualMeshRaycastHit.cs.meta b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VirtualMeshRaycastHit.cs.meta new file mode 100644 index 00000000..8578f651 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VirtualMeshRaycastHit.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: b1630263613d8714dbfb6f464c6e27eb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VirtualMeshRaycastHit.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VirtualMeshTransform.cs b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VirtualMeshTransform.cs new file mode 100644 index 00000000..aeac9d5f --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VirtualMeshTransform.cs @@ -0,0 +1,168 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System.Runtime.CompilerServices; +using Unity.Collections; +using Unity.Mathematics; +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// VirtualMesh§ċˆİ用•‚Œ‚‹Transformĉƒ…ċ ħ + /// ‚ıƒĴƒƒƒ‰‹‚‰ċˆİ用‚’考ˆĤƒ‡ƒĵ‚ż‚’Transform‹‚‰ċˆ†é›˘—ĤŠ + /// + public struct VirtualMeshTransform + { + /// + /// 識ċˆċïĵˆĉœ€ċ¤§ïĵ’ïĵ™ĉ–‡ċ­—ïĵ‰ + /// + public FixedString32Bytes name; + + public int index; + //public float3 localPosition; + //public quaternion localRotation; + //public float3 localScale; + public float4x4 localToWorldMatrix; + public float4x4 worldToLocalMatrix; + + public int parentIndex; + + //========================================================================================= + public VirtualMeshTransform(Transform t) + { + Debug.Assert(t); + name = t.name.Substring(0, math.min(t.name.Length, 29)); + index = -1; + //localPosition = t.localPosition; + //localRotation = t.localRotation; + //localScale = t.localScale; + localToWorldMatrix = t.localToWorldMatrix; + worldToLocalMatrix = t.worldToLocalMatrix; + parentIndex = -1; + } + + public VirtualMeshTransform(Transform t, int index) : this(t) + { + this.index = index; + } + + public VirtualMeshTransform Clone() + { + var mt = new VirtualMeshTransform() + { + name = name, + index = index, + localToWorldMatrix = localToWorldMatrix, + worldToLocalMatrix = worldToLocalMatrix, + parentIndex = parentIndex, + }; + + return mt; + } + + /// + /// ƒŻƒĵƒĞƒ‰ċş§ĉ¨™ċŽŸç‚ı + /// + public static VirtualMeshTransform Origin + { + get + { + var mt = new VirtualMeshTransform(); + mt.name = "VirtualMesh Origin"; + //mt.localScale = 1; + mt.localToWorldMatrix = float4x4.identity; + mt.worldToLocalMatrix = float4x4.identity; + mt.parentIndex = -1; + return mt; + } + } + + /// + /// ƒƒƒ‚·ƒŻċċ‰‹‚‰ç”Ÿĉˆ™‚‹ + /// + /// + public override int GetHashCode() + { + return name.GetHashCode(); + } + + public void Update(Transform t) + { + //localPosition = t.localPosition; + //localRotation = t.localRotation; + //localScale = t.localScale; + localToWorldMatrix = t.localToWorldMatrix; + worldToLocalMatrix = t.worldToLocalMatrix; + } + + //========================================================================================= + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3 TransformPoint(float3 pos) + { + return math.transform(localToWorldMatrix, pos); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3 TransformVector(float3 vec) + { + return math.mul(localToWorldMatrix, new float4(vec, 0)).xyz; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3 TransformDirection(float3 dir) + { + float len = math.length(dir); + if (len > 0.0f) + return math.normalize(TransformVector(dir)) * len; + else + return dir; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3 InverseTransformPoint(float3 pos) + { + return math.transform(worldToLocalMatrix, pos); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3 InverseTransformVector(float3 vec) + { + return math.mul(worldToLocalMatrix, new float4(vec, 0)).xyz; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public float3 InverseTransformDirection(float3 dir) + { + float len = math.length(dir); + if (len > 0.0f) + return math.normalize(InverseTransformVector(dir)) * len; + else + return dir; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public quaternion InverseTransformRotation(quaternion rot) + { + return math.mul(new quaternion(worldToLocalMatrix), rot); + } + + /// + /// “Transformƒ­ƒĵ‚ЃĞċş§ĉ¨™‚’toƒ­ƒĵ‚ЃĞċş§ĉ¨™Ğċ¤‰ĉ›™‚‹Transform‚’èż”™ + /// + /// + /// + public VirtualMeshTransform Transform(in VirtualMeshTransform to) + { + var mt = new VirtualMeshTransform() + { + name = "__(temporary)__", + index = -1, + localToWorldMatrix = math.mul(to.worldToLocalMatrix, localToWorldMatrix), + worldToLocalMatrix = math.mul(worldToLocalMatrix, to.localToWorldMatrix), + parentIndex = -1, + }; + return mt; + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VirtualMeshTransform.cs.meta b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VirtualMeshTransform.cs.meta new file mode 100644 index 00000000..3e031546 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VirtualMeshTransform.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: f1ab03195c884cd40a4bf12a2c22217c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Core/VirtualMesh/VirtualMeshTransform.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Editor.meta b/Assets/MagicaCloth2/Scripts/Editor.meta new file mode 100644 index 00000000..b16b1741 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 56cddc7b23443aa4e82bc4a6fa59ccff +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Scripts/Editor/Cloth.meta b/Assets/MagicaCloth2/Scripts/Editor/Cloth.meta new file mode 100644 index 00000000..b9ba619c --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/Cloth.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 497187e4db74fa043afca4179151e148 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Scripts/Editor/Cloth/ClothAssetPostprocessor.cs b/Assets/MagicaCloth2/Scripts/Editor/Cloth/ClothAssetPostprocessor.cs new file mode 100644 index 00000000..698034cd --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/Cloth/ClothAssetPostprocessor.cs @@ -0,0 +1,41 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using UnityEditor; + +namespace MagicaCloth2 +{ + /// + /// ‚¤ƒ³ƒƒĵƒˆ‚˘‚ğƒƒƒˆċˆ¤ċš + /// + public class ClothAssetPostprocessor : AssetPostprocessor + { + /// + /// ƒ‡ƒĵ‚żƒ™ƒĵ‚ıĞ‚˘‚ğƒƒƒˆŒèż½ċŠ ïĵċ‰Šé™¤ïĵç§ğċ‹•ïĵĉ›´ĉ–°•‚ŒŸċ ´ċˆĞċŒäş†ċŒĞ一ċşĤċ‘ĵ³ċ‡ş•‚Œ‚‹ + /// + /// + /// + /// + /// + protected static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths) + { +#if false + foreach (string str in importedAssets) + { + Debug.Log("@Reimported Asset: " + str); + } + foreach (string str in deletedAssets) + { + Debug.Log("@Deleted Asset: " + str); + } + + for (int i = 0; i < movedAssets.Length; i++) + { + Debug.Log("@Moved Asset: " + movedAssets[i] + " from: " + movedFromAssetPaths[i]); + } +#endif + // ‚˘‚ğƒƒƒˆŒ‚¤ƒ³ƒƒĵƒˆ•‚ŒŸ“¨Ğ‚ˆ‚‹ç·¨é›†ç”¨ƒĦƒƒ‚·ƒĉ›´ĉ–°ċˆ¤ċš + ClothEditorManager.UpdateFromAssetImport(importedAssets); + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Editor/Cloth/ClothAssetPostprocessor.cs.meta b/Assets/MagicaCloth2/Scripts/Editor/Cloth/ClothAssetPostprocessor.cs.meta new file mode 100644 index 00000000..deeafdc8 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/Cloth/ClothAssetPostprocessor.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 62851d07720bcd84f89c596c9a32c8a6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Editor/Cloth/ClothAssetPostprocessor.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Editor/Cloth/ClothEditorManager.cs b/Assets/MagicaCloth2/Scripts/Editor/Cloth/ClothEditorManager.cs new file mode 100644 index 00000000..0ae6a1bf --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/Cloth/ClothEditorManager.cs @@ -0,0 +1,1110 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using Unity.Mathematics; +using UnityEditor; +using UnityEditor.Callbacks; +using UnityEditor.Compilation; +using UnityEditor.PackageManager; +using UnityEditor.SceneManagement; +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// ‚¨ƒ‡‚£‚żç·¨é›†ĉ™‚‚³ƒ³ƒƒĵƒƒ³ƒˆçĦ理 + /// + [InitializeOnLoad] + public class ClothEditorManager + { + /// + /// ‚³ƒ³ƒƒĵƒƒ³ƒˆĉƒ…ċ ħ + /// + class ClothInfo + { + public ResultCode result = ResultCode.Empty; + public bool building; + public GizmoType gizmoType; + public ClothBehaviour component; + public int componentHash; + public VirtualMeshContainer editMeshContainer; + public int nextBuildHash; + public int importCount; + public ClothInitSerializeData editInitSerializeData; + } + + static Dictionary editClothDict = new Dictionary(); + + static List destroyList = new List(); + static List drawList = new List(); + static CancellationTokenSource cancelToken = new CancellationTokenSource(); + + static bool isValid = false; + + static internal Action OnEditMeshBuildComplete; + + //========================================================================================= + static ClothEditorManager() + { + Develop.DebugLog($"ClothEditorManager Initialize!"); + + Dispose(); + + // ‚ı‚ŻƒŞƒ—ƒˆ‚³ƒ³ƒ‘‚¤ƒĞ‚³ƒĵƒĞƒƒƒ‚Ż + CompilationPipeline.compilationStarted -= OnStartCompile; + CompilationPipeline.compilationStarted += OnStartCompile; + + // ‚·ƒĵƒ³ƒ“ƒƒĵĞGUI‚’ĉç”ğ™‚‹Ÿ‚‚³ƒĵƒĞƒƒƒ‚Ż + SceneView.duringSceneGui -= OnSceneGUI; + SceneView.duringSceneGui += OnSceneGUI; + + // ƒ—ƒĴƒƒ–‚ıƒ†ƒĵ‚¸ + PrefabStage.prefabStageClosing -= OnPrefabStageClosing; + PrefabStage.prefabStageClosing += OnPrefabStageClosing; + + // Undo/Redo + Undo.undoRedoPerformed -= OnUndoRedoPerformed; + Undo.undoRedoPerformed += OnUndoRedoPerformed; + + isValid = true; + } + + /// + /// ‚¨ƒ‡‚£‚żċŸèĦŒçŠĥĉ…‹Œċ¤‰ĉ›´•‚ŒŸċ ´ċˆĞċ‘ĵ³ċ‡ş•‚Œ‚‹ + /// + [InitializeOnLoadMethod] + static void PlayModeStateChange() + { + EditorApplication.playModeStateChanged += (mode) => + { + Develop.DebugLog($"PlayModeStateChanged:{mode}"); + + if (mode == UnityEditor.PlayModeStateChange.ExitingEditMode || mode == UnityEditor.PlayModeStateChange.ExitingPlayMode) + { + //Develop.DebugLog($"PlayModeStateChange. Exit Editor mode!"); + Dispose(); + isValid = false; + } + if (mode == UnityEditor.PlayModeStateChange.EnteredEditMode || mode == UnityEditor.PlayModeStateChange.EnteredPlayMode) + { + //Develop.DebugLog($"PlayModeStateChange. Enter Editor mode!"); + isValid = true; + } + }; + } + + /// + /// ‚ı‚ŻƒŞƒ—ƒˆ‚³ƒ³ƒ‘‚¤ƒĞ開ċ§‹ + /// + /// + static void OnStartCompile(object obj) + { + Develop.DebugLog($"start compile."); + Dispose(); + isValid = false; + } + + /// + /// ƒ“ƒĞƒ‰ċŒäş†ĉ™‚ + /// + /// + /// + [PostProcessBuildAttribute(1)] + static void OnPostprocessBuild(BuildTarget target, string pathToBuiltProject) + { + Develop.DebugLog($"build compile."); + isValid = true; + } + + /// + /// ƒ—ƒĴƒƒ–‚ıƒ†ƒĵ‚¸Œé–‰˜‚‹ĉ™‚ + /// + /// + static void OnPrefabStageClosing(PrefabStage pstage) + { + ForceUpdateAllComponents(); + } + + /// + /// Undo/RedoċŸèĦŒĉ™‚ + /// + static void OnUndoRedoPerformed() + { + ForceUpdateAllComponents(); + } + + //========================================================================================= + static bool IsActive(GizmoType gizmoType) + { + return gizmoType.HasFlag(GizmoType.Active); + } + + static bool IsActiveOrSelected(GizmoType gizmoType) + { + return IsActive(gizmoType) || gizmoType.HasFlag(GizmoType.Selected); + } + + static bool IsSelectionHierarchy(GizmoType gizmoType) + { + return IsActiveOrSelected(gizmoType) || gizmoType.HasFlag(GizmoType.InSelectionHierarchy); + } + + /// + /// MagidaCloth‚³ƒ³ƒƒĵƒƒ³ƒˆç™ğ録Š‚ˆ³ç·¨é›†ƒĦƒƒ‚·ƒä½œĉˆ/ĉ›´ĉ–° + /// + /// + public static void RegisterComponent(ClothBehaviour component, GizmoType gizmoType, bool forceUpdate = false) + { + //Develop.DebugLog($"RegisterComponent:{component.name}, isValid:{isValid}"); + if (isValid == false) + return; + if (component == null) + return; + + // ƒš‚¤ƒ³ƒˆä¸­Żç„ĦċŠı + if (ClothPainter.IsPainting()) + return; + + MagicaObjectId id = component.GetMagicaId(); + MagicaCloth cloth = component as MagicaCloth; + + //if (cloth) + // Develop.DebugLog($"Register Cloth:{component.name}, gizmoType:{gizmoType}"); + +#if true + // Unity2023żä½•ĉ•…‹GizmoTypeĉŒ™ċ‹•Œç•°Ş‚Š€ċŸéš›ĞŻé¸ĉŠž•‚ŒĤŞĤ‚‚èĤށŒé¸ĉŠžä¸­ ¨Selectedƒ•ƒİ‚°ŒçĞ‹£Ĥ—†€‚ + // Ÿ‚€Selectedƒ•ƒİ‚°Ğ関—ĤŻ““§ĉ‰‹ċ‹•§ċˆ¤ċš™‚‹“¨Ğ™‚‹€‚ +#if UNITY_6000_3_OR_NEWER + if (Selection.Contains(component.gameObject.GetEntityId())) +#else + if (Selection.Contains(component.gameObject.GetInstanceID())) +#endif + gizmoType |= GizmoType.Selected; + else + gizmoType &= ~GizmoType.Selected; +#endif + + // ‚‚şƒ˘èĦ¨ç¤şċˆ¤ċš + // ċ¸¸ĞèĦ¨ç¤ş + if (cloth && cloth.GizmoSerializeData.IsAlways()) + gizmoType = GizmoType.Active; + + // ‚Żƒ­‚ıĉŒ‡ċš‚³ƒİ‚¤ƒ€ƒĵèĦ¨ç¤ş + if (cloth && cloth.GizmoSerializeData.clothDebugSettings.enable && cloth.GizmoSerializeData.clothDebugSettings.collider && IsSelectionHierarchy(gizmoType)) + { + foreach (var col in cloth.SerializeData.colliderCollisionConstraint.colliderList) + { + RegisterComponent(col, gizmoType); + } + } + + lock (editClothDict) + { + if (editClothDict.ContainsKey(id) == false) + { + //Debug.Log($"ç™ğ録:{component.name}"); + var info = new ClothInfo(); + info.building = false; + info.result = ResultCode.Empty; + info.component = component; + info.editMeshContainer = null; + info.gizmoType = gizmoType; + info.componentHash = 0; + info.nextBuildHash = 0; + info.importCount = 1; + editClothDict.Add(id, info); + } + else + { + editClothDict[id].gizmoType |= gizmoType; + } + } + + // EditMesh作ĉˆ(MagicaCloth‚³ƒ³ƒƒĵƒƒ³ƒˆż) + if (cloth && EditorApplication.isPlaying == false) + { + int hash = component.GetMagicaHashCode(); + //Debug.Log($"Hash:{hash}"); + + lock (editClothDict) + { + if (editClothDict.ContainsKey(id)) + { + var info = editClothDict[id]; + + // ƒƒƒ‚·ƒĞŻ‚¤ƒ³ƒƒĵƒˆċ›žĉ•°‚’äı—痁™‚‹ + hash *= (info.importCount + 1); + + // ƒƒƒ‚·ƒŒç•°Ş‚‹ċ ´ċˆżċ†ĉ§‹ç݉/‚‚—Żċĵ·ċˆĥĉ›´ĉ–° + if (info.componentHash != hash || forceUpdate) + { + // çċœ¨ä½œĉˆä¸­Ş‚‰°ĉĴĦä½œĉˆċ€™è£œ¨—Ĥç™ğ録 + if (info.building) + { + info.nextBuildHash = hash; + } + // †§Ş‘‚Œ°ä½œĉˆ‚’é–‹ċ§‹™‚‹ + else + { + info.componentHash = hash; + info.nextBuildHash = 0; + + if (cloth.isActiveAndEnabled || forceUpdate) + { + // ‚ıƒĴƒƒƒ‰§ä½œĉˆ + info.building = true; + var _ = CreateOrUpdateEditMesh(id, cloth, cancelToken.Token); + } + } + } + } + } + } + } + + public static VirtualMeshContainer GetEditMeshContainer(ClothBehaviour comp) + { + if (isValid == false) + return null; + if (comp == null) + return null; + MagicaObjectId id = comp.GetMagicaId(); + VirtualMeshContainer cmesh = null; + lock (editClothDict) + { + cmesh = editClothDict.ContainsKey(id) ? editClothDict[id].editMeshContainer : null; + } + return cmesh; + } + + /// + /// çċœ¨‚³ƒ³ƒƒĵƒƒ³ƒˆçŠĥĉ…‹‚’èż”™ + /// + /// + /// + public static ResultCode GetResultCode(ClothBehaviour comp) + { + if (comp == null) + return ResultCode.Empty; + MagicaObjectId id = comp.GetMagicaId(); + lock (editClothDict) + { + if (editClothDict.ContainsKey(id)) + return editClothDict[id].result; + else + return ResultCode.Empty; + } + } + + static void Dispose() + { + cancelToken.Cancel(); + cancelToken.Dispose(); + cancelToken = new CancellationTokenSource(); + + destroyList.Clear(); + drawList.Clear(); + lock (editClothDict) + { + foreach (var info in editClothDict.Values) + { + info?.editMeshContainer?.Dispose(); + } + editClothDict.Clear(); + } + } + + /// + /// ‚³ƒ³ƒƒĵƒƒ³ƒˆċ‰Šé™¤ƒ‚§ƒƒ‚Ż + /// + static void DestroyCheck() + { + lock (editClothDict) + { + destroyList.Clear(); + foreach (var kv in editClothDict) + { + if (kv.Value.component == null) + { + destroyList.Add(kv.Key); + } + } + foreach (var id in destroyList) + { + //Debug.Log($"ċ‰Šé™¤"); + editClothDict[id].editMeshContainer?.Dispose(); + editClothDict.Remove(id); + } + destroyList.Clear(); + } + } + + /// + /// ‚˘‚ğƒƒƒˆĉ›´ĉ–°Ğ¨‚‚Ş†ç·¨é›†ç”¨ƒĦƒƒ‚·ƒĉ›´ĉ–° + /// + /// + public static void UpdateFromAssetImport(string[] importedAssets) + { + if (importedAssets == null || importedAssets.Length == 0) + return; + + var importedAssetSet = new HashSet(importedAssets); + + // ‚Żƒ­‚ı‚³ƒ³ƒƒĵƒƒ³ƒˆŒ‚¤ƒ³ƒƒĵƒˆ•‚ŒŸ‚˘‚ğƒƒƒˆ‚’ċ‚ç…§—Ĥ„‚‹ċ ´ċˆŻċ†ĉ§‹ç݉ƒ•ƒİ‚°‚’çĞ‹Ĥ‚‹ + var updateDict = new Dictionary(); + lock (editClothDict) + { + foreach (var cinfo in editClothDict.Values) + { + var cloth = cinfo.component as MagicaCloth; + if (cloth) + { + bool update = false; + var sdata = cloth.SerializeData; + + // source renderes + if (sdata.clothType == ClothProcess.ClothType.MeshCloth) + { + foreach (var ren in sdata.sourceRenderers) + { + if (ren && importedAssetSet.Contains(AssetDatabase.GetAssetPath(ren))) + update = true; + } + } + + // paint maps + if (sdata.clothType == ClothProcess.ClothType.MeshCloth && sdata.paintMode != ClothSerializeData.PaintMode.Manual) + { + foreach (var map in sdata.paintMaps) + { + if (map && importedAssetSet.Contains(AssetDatabase.GetAssetPath(map))) + update = true; + } + } + + if (update) + { + // ċ†ĉ§‹ç݉ƒ•ƒİ‚° + // ‚¤ƒ³ƒƒĵƒˆ‚Ğ‚Ĥƒ³ƒˆ‚’ċ˘—ċŠ •›‚‹“¨§ƒƒƒ‚·ƒċ€¤‚’ċ¤‰ċŒ–•›‚‹ + cinfo.importCount++; + updateDict.Add(cinfo.component, cinfo.gizmoType); + } + } + } + } + + // ċ†ĉ§‹ç݉開ċ§‹ + foreach (var kv in updateDict) + { + RegisterComponent(kv.Key, kv.Value); + } + } + + /// + /// ċĵ·ċˆĥ的Ğ™ıĤ‚³ƒ³ƒƒĵƒƒ³ƒˆĉ›´ĉ–°ƒ•ƒİ‚°‚’çĞ‹Ĥ‚‹ + /// + static void ForceUpdateAllComponents() + { + lock (editClothDict) + { + foreach (var cinfo in editClothDict.Values) + { + var cloth = cinfo.component as MagicaCloth; + if (cloth) + { + // ċ†ĉ§‹ç݉ƒ•ƒİ‚° + // ‚¤ƒ³ƒƒĵƒˆ‚Ğ‚Ĥƒ³ƒˆ‚’ċ˘—ċŠ •›‚‹“¨§ƒƒƒ‚·ƒċ€¤‚’ċ¤‰ċŒ–•›‚‹ + // ĉĴĦ‚‚şƒ˘èĦ¨ç¤ş‚‚—Żƒš‚¤ƒ³ƒˆĉ™‚Ğċ†ĉ§‹ç݉•‚Œ‚‹ + cinfo.importCount++; + } + } + } + } + + //========================================================================================= + /// + /// 編集用ƒĦƒƒ‚·ƒä½œĉˆ/ĉ›´ĉ–° + /// + /// + /// + /// + /// + /// + static async Task CreateOrUpdateEditMesh(MagicaObjectId id, MagicaCloth cloth, CancellationToken ct) + { + // ■ƒĦ‚¤ƒ³‚ıƒĴƒƒƒ‰ + Develop.DebugLog($"Create and update edit meshes: {cloth.name}"); + var sdata = cloth.SerializeData; + var sdata2 = cloth.GetSerializeData2(); + var setupList = new List(); + VirtualMeshContainer editMeshContainer = null; + ClothInitSerializeData editInitSerializeData = new ClothInitSerializeData(); + ResultCode result = new ResultCode(); + + try + { + // ■ƒĦ‚¤ƒ³‚ıƒĴƒƒƒ‰ + if (cloth == null || isValid == false) + { + result.SetError(Define.Result.CreateCloth_InvalidCloth); + throw new MagicaClothProcessingException(); + } + var statusResult = cloth.Process.GenerateStatusCheck(); + result.Merge(statusResult); + if (statusResult.IsError()) + { + throw new MagicaClothProcessingException(); + } + + // ƒĦƒƒ‚·ƒ‚’ĉ§‹ç݉™‚‹Ÿ‚ĉœ€ä½Žé™ƒ‡ƒĵ‚żŒĉƒ£Ĥ„‚‹‹ç˘şèލ + if (sdata.IsValid() == false) + { + result.SetResult(sdata.VerificationResult); + throw new MagicaClothProcessingException(); + } + + // ‚ğƒƒƒˆ‚˘ƒƒƒ—ƒ‡ƒĵ‚żä½œĉˆ + if (sdata.clothType == ClothProcess.ClothType.MeshCloth) + { + foreach (var ren in sdata.sourceRenderers) + { + if (ren) + { + var setup = new RenderSetupData(null, ren); + result.Merge(setup.result); + if (setup.IsFaild()) + { + setup.Dispose(); + throw new MagicaClothProcessingException(); + } + setupList.Add(setup); + } + else + { + result.SetError(Define.Result.CreateCloth_NoRenderer); + throw new MagicaClothProcessingException(); + } + } + } + else if (sdata.clothType == ClothProcess.ClothType.BoneCloth) + { + var setup = new RenderSetupData(null, RenderSetupData.SetupType.BoneCloth, cloth.ClothTransform, sdata.rootBones, null, sdata.connectionMode, cloth.name); + setupList.Add(setup); + } + else if (sdata.clothType == ClothProcess.ClothType.BoneSpring) + { + // BoneSpring§ŻLineĉŽçĥšż + var setup = new RenderSetupData(null, RenderSetupData.SetupType.BoneSpring, cloth.ClothTransform, sdata.rootBones, sdata.colliderCollisionConstraint.collisionBones, RenderSetupData.BoneConnectionMode.Line, cloth.name); + setupList.Add(setup); + } + + if (setupList.Count == 0) + { + result.SetError(Define.Result.CreateCloth_InvalidSetupList); + throw new MagicaClothProcessingException(); + } + + // ‚Żƒ­‚ı‚³ƒ³ƒƒĵƒƒ³ƒˆƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ĉƒ…ċ ħ + var clothTransformRecord = new TransformRecord(cloth.ClothTransform, read: true); + + // ĉ³•ç·šèŞżĉ•´ç”¨ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ  + var normalAdjustmentTransformRecored = new TransformRecord( + sdata.normalAlignmentSetting.adjustmentTransform ? + sdata.normalAlignmentSetting.adjustmentTransform : + cloth.ClothTransform, read: true + ); + + // ċˆĉœŸċŒ–ĉƒ…ċ ħċŽé›† + editInitSerializeData.Serialize( + sdata, + clothTransformRecord, + normalAdjustmentTransformRecored, + setupList + ); + + // ƒš‚¤ƒ³ƒˆƒžƒƒƒ—ƒ‡ƒĵ‚żä½œĉˆïĵˆ“‚ŒŻƒĦ‚¤ƒ³‚ıƒĴƒƒƒ‰§żä½œĉˆċŻèƒ½ïĵ‰ + var paintMapDataList = new List(); + bool usePaintMap = false; + if (sdata.clothType == ClothProcess.ClothType.MeshCloth && sdata.paintMode != ClothSerializeData.PaintMode.Manual) + { + var ret = cloth.Process.GeneratePaintMapDataList(paintMapDataList); + if (ret.IsError()) + { + result.Merge(ret); + throw new MagicaClothProcessingException(); + } + if (paintMapDataList.Count != setupList.Count) + { + result.SetError(Define.Result.CreateCloth_PaintMapCountMismatch); + throw new MagicaClothProcessingException(); + } + usePaintMap = true; + } + + // ‚¨ƒ‡‚£ƒƒƒˆƒĦƒƒ‚·ƒä½œĉˆ + // ƒĦƒƒ‚·ƒŻ‚ğƒ³‚żƒĵçİşé–“§ä½œĉˆ•‚Œ‚‹ + ct.ThrowIfCancellationRequested(); + var editMesh = new VirtualMesh("EditMesh"); + editMeshContainer = new VirtualMeshContainer(editMesh); + if (sdata.clothType == ClothProcess.ClothType.MeshCloth) + { + // MeshCloth§Ż‚Żƒ­‚ıƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ‚’èż½ċŠ —ĤŠ + editMesh.SetTransform(cloth.ClothTransform, null, MagicaObjectId.Invalid, MagicaObjectId.Invalid); + } + editMesh.result.SetProcess(); + + // ‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚ż + // ƒš‚¤ƒ³ƒˆƒžƒƒƒ—ĉŒ‡ċšċ ´ċˆŻçİş§ċˆĉœŸċŒ– + SelectionData selectionData = usePaintMap ? new SelectionData() : sdata2.selectionData.Clone(); + + // ■‚ıƒĴƒƒƒ‰ + await Task.Run(() => + { + try + { + // MeshCloth/BoneCloth§ċ‡Ĥ理Œä¸€éƒ¨ç•°Ş‚‹ + ct.ThrowIfCancellationRequested(); + if (sdata.clothType == ClothProcess.ClothType.MeshCloth) + { + for (int i = 0; i < setupList.Count; i++) + { + var setup = setupList[i]; + + // ƒĴƒ³ƒ€ƒĵƒĦƒƒ‚·ƒä½œĉˆ + using var renderMesh = new VirtualMesh($"[{setup.name}]"); + renderMesh.result.SetProcess(); + + // ‚¤ƒ³ƒƒĵƒˆ + renderMesh.ImportFrom(setup, sdata.GetUvChannel()); + //Debug.Log($"(IMPORT) {renderMesh}"); + if (renderMesh.IsError) + continue; + renderMesh.result.SetSuccess(); + + // MeshCloth§ƒš‚¤ƒ³ƒˆƒ†‚Ż‚ıƒƒ£ĉŒ‡ċšċ ´ċˆŻ‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚ż‚’生ĉˆ™‚‹ + if (usePaintMap) + { + var ret = cloth.Process.GenerateSelectionDataFromPaintMap(clothTransformRecord, renderMesh, paintMapDataList[i], out SelectionData renderSelectionData); + if (ret.IsError()) + { + result.Merge(ret); + throw new MagicaClothProcessingException(); + } + + // ‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚żçµċˆ + selectionData.Merge(renderSelectionData); + } + + // ƒžƒĵ‚¸ + editMesh.AddMesh(renderMesh); + } + //Debug.Log($"(MERGE) {editMesh}"); + + // ƒŞƒ€‚Ż‚·ƒ§ƒ³ + if (editMesh.VertexCount > 1 && sdata.reductionSetting.IsEnabled) + { + editMesh.Reduction(sdata.reductionSetting, ct); + if (editMesh.IsError) + { + result.Merge(editMesh.result); + throw new MagicaClothProcessingException(); + } + + //Debug.Log($"(REDUCTION) {editMesh}"); + } + } + else if (sdata.clothType == ClothProcess.ClothType.BoneCloth || sdata.clothType == ClothProcess.ClothType.BoneSpring) + { + // import + editMesh.ImportFrom(setupList[0], 0); + if (editMesh.IsError) + { + result.Merge(editMesh.result); + throw new MagicaClothProcessingException(); + } + //Debug.Log($"(IMPORT) {editMesh}"); + } + + // ċ…ƒé ‚ç‚ı‹‚‰çµċˆé ‚ç‚ı¸‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı‚’ċˆĉœŸċŒ– + if (editMesh.joinIndices.IsCreated == false) + { + editMesh.joinIndices = new Unity.Collections.NativeArray(editMesh.VertexCount, Unity.Collections.Allocator.Persistent); + JobUtility.SerialNumberRun(editMesh.joinIndices, editMesh.VertexCount); // é€£ç•Ş‚’¤‘‚‹ + } + + // ĉœ€éİċŒ– + ct.ThrowIfCancellationRequested(); + editMesh.Optimization(); + if (editMesh.IsError) + { + result.Merge(editMesh.result); + throw new MagicaClothProcessingException(); + } + //Debug.Log($"(OPTIMIZE) {editMesh}"); + } + catch (OperationCanceledException) + { + throw; + } + catch (MagicaClothProcessingException) + { + throw; + } + catch (Exception exception) + { + Debug.LogException(exception); + result.SetError(Define.Result.CreateCloth_Exception); + throw; + } + }, ct); + + // ■ƒĦ‚¤ƒ³‚ıƒĴƒƒƒ‰ + // ‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚żä½œĉˆ + //  ‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚żŒĉœŞç·¨é›†ċ ´ċˆŻä½œ‚Šç›´™ + ct.ThrowIfCancellationRequested(); + if (cloth == null || isValid == false) + { + result.SetError(Define.Result.CreateCloth_InvalidCloth); + throw new MagicaClothProcessingException(); + } + if (usePaintMap == false) + { + if (sdata2.selectionData == null || sdata2.selectionData.IsValid() == false || sdata2.selectionData.userEdit == false) + { + // ĉ–°èĤä½œĉˆ + selectionData = CreateAutoSelectionData(cloth, sdata, editMesh); + + // ĉ ĵ納 + sdata2.selectionData = selectionData; + } + } + + // ■‚ıƒĴƒƒƒ‰ + await Task.Run(() => + { + try + { + // ‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚ż‹‚‰é ‚ç‚ıċħžĉ€§‚’äğ˜ä¸Ž™‚‹ + ct.ThrowIfCancellationRequested(); + if (selectionData.IsValid()) + { + editMesh.ApplySelectionAttribute(selectionData); + } + + // ProxyMesh¸ċ¤‰ĉ›ïĵˆċħžĉ€§ĉħşċšċŒĞċŸèĦŒïĵ‰ + ct.ThrowIfCancellationRequested(); + editMesh.ConvertProxyMesh(cloth.SerializeData, null, null, normalAdjustmentTransformRecored); + if (editMesh.IsError) + { + result.Merge(editMesh.result); + throw new MagicaClothProcessingException(); + } + //Debug.Log($"(PROXY) {editMesh}"); + +#if false + // pitch/yawċ€‹ċˆċˆĥ限Żv1.0§ŻċŸè£…—Ş„§ä¸€ĉ—Ĥċœĉ­˘ + // 角ċşĤċˆĥ限計ç—用ċ›žèğ˘‚’ä½œĉˆ + ct.ThrowIfCancellationRequested(); + editMesh.CreateAngleCalcLocalRotation(sdata.normalCalculation, sdata.normalCalculationCenter); + if (editMesh.IsError) + throw new InvalidOperationException(); +#endif + + // ċŒäş† + ct.ThrowIfCancellationRequested(); + editMesh.result.SetSuccess(); + } + catch (OperationCanceledException) + { + throw; + } + catch (MagicaClothProcessingException) + { + throw; + } + catch (Exception exception) + { + Debug.LogException(exception); + result.SetError(Define.Result.CreateCloth_Exception); + throw; + } + }, ct); + + // ■ƒĦ‚¤ƒ³‚ıƒĴƒƒƒ‰ + ct.ThrowIfCancellationRequested(); + if (cloth == null || isValid == false) + { + // ‚­ƒ£ƒ³‚ğƒĞĉ‰ħ„Ğ™‚‹ + throw new OperationCanceledException(); + } + + // ĉˆċŠŸ + Develop.DebugLog($"(FINAL PROXY) {editMesh}"); + result.SetSuccess(); + } + catch (MagicaClothProcessingException) + { + if (result.IsNone()) result.SetError(Define.Result.CreateCloth_UnknownError); + result.DebugLog(); + } + catch (OperationCanceledException) + { + Develop.DebugLog($"Editor mesh build canceled!"); + result.SetCancel(); + } + catch (Exception exception) + { + Debug.LogException(exception); + result.SetError(Define.Result.CreateCloth_Exception); + } + finally + { + // çŠĥĉ…‹ċ¤‰ĉ›´ + if (isValid) + { + lock (editClothDict) + { + if (editClothDict.ContainsKey(id)) + { + var info = editClothDict[id]; + info.building = false; + info.result = result; + info.editMeshContainer?.Dispose(); + if (result.IsSuccess()) + { + info.editMeshContainer = editMeshContainer; + editMeshContainer = null; + info.editInitSerializeData = editInitSerializeData; + Develop.DebugLog($"Registration Complete : {cloth.name}"); + + // ċˆĉœŸċŒ–ƒ‡ƒĵ‚żäżċ­˜ + // ““§Żƒ­ƒĵ‚ЃЃƒƒ‚·ƒżĉŻ”èĵƒ¨™‚‹ + ApplyInitData(cloth, global: false); + } + else + { + info.editMeshContainer = null; + info.editInitSerializeData = null; + } + } + } + } + + // dispose + foreach (var setup in setupList) + { + setup?.Dispose(); + } + editMeshContainer?.Dispose(); + + //span.DebugLog(); + + // ċĵ•çĥšċ†ĉ§‹ç݉ċŸèĦŒċˆ¤ċš + if (isValid) + { + lock (editClothDict) + { + if (editClothDict.ContainsKey(id)) + { + var info = editClothDict[id]; + info.building = false; + + if (info.nextBuildHash != 0 && cloth) + { + if (info.nextBuildHash == info.componentHash) + { + info.nextBuildHash = 0; + } + else + { + info.componentHash = info.nextBuildHash; + info.nextBuildHash = 0; + info.building = true; + info.result.Clear(); + + var _ = CreateOrUpdateEditMesh(id, cloth, ct); + } + } + } + } + } + + SceneView.RepaintAll(); + + // ƒ“ƒĞƒ‰ċŒäş†é€šçŸ + OnEditMeshBuildComplete?.Invoke(); + } + } + + /// + /// ċˆĉœŸċŒ–ƒ‡ƒĵ‚ż‚’‚·ƒŞ‚˘ƒİ‚¤‚şċŒ–™‚‹ + /// + /// + /// + public static void ApplyInitData(MagicaCloth cloth, bool global) + { + if (cloth == null) + return; + MagicaObjectId id = cloth.GetMagicaId(); + if (editClothDict.ContainsKey(id) == false) + return; + + var info = editClothDict[id]; + if (info.editInitSerializeData == null) + return; + + // ƒƒƒ‚·ƒĉŻ”èĵƒ + var sdata2 = cloth.GetSerializeData2(); + int oldLocalHash = sdata2.initData?.localHash ?? 0; + bool change = oldLocalHash != info.editInitSerializeData.localHash; + if (global && change == false) + { + int oldGlobalHash = sdata2.initData?.globalHash ?? 0; + change = oldGlobalHash != info.editInitSerializeData.globalHash; + } + if (change == false) + return; // ċ¤‰ĉ›´Ş— + + // ċˆĉœŸċŒ–ƒ‡ƒĵ‚żäżċ­˜ + // UndoċŻèħĦĞŻ—Ş„ + sdata2.initData = info.editInitSerializeData; + EditorUtility.SetDirty(cloth); + Develop.DebugLog($"* Apply initData. [{cloth.name}]"); + } + + /// + /// ‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚ż‚’‚·ƒŞ‚˘ƒİ‚¤‚şċŒ–™‚‹ + /// + /// + /// + public static void ApplySelectionData(MagicaCloth cloth, SelectionData selectionData) + { + if (cloth == null || selectionData == null || selectionData.IsValid() == false) + return; + + if (cloth.GetSerializeData2().selectionData != null && cloth.GetSerializeData2().selectionData.Compare(selectionData)) + return; // ċ¤‰ĉ›´Ş— + + //Debug.Log($"‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚żĉ ĵ納!"); + Undo.RecordObject(cloth, "Paint"); + + // ĉœ€çµ‚çš„Ğ[SerializeReference]‹‚‰[SerializeField]Ğċ¤‰ĉ›´(2022/12/18) + cloth.GetSerializeData2().selectionData = selectionData; + + EditorUtility.SetDirty(cloth); + } + + + /// + /// 編集ƒĦƒƒ‚·ƒ‹‚‰è‡Şċ‹•§‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚ż‚’生ĉˆ™‚‹ïĵˆƒĦ‚¤ƒ³‚ıƒĴƒƒƒ‰żïĵ‰ + /// + /// + /// + /// + /// + public static SelectionData CreateAutoSelectionData(MagicaCloth cloth, ClothSerializeData sdata, VirtualMesh emesh) + { + var selectionData = new SelectionData(emesh, float4x4.identity); + int cnt = selectionData.Count; + if (cnt == 0) + return selectionData; + + // BoneClothŻRoot‚’FixedĞċšç݁™‚‹€‚Œäğċ¤–ŻMove + if (sdata.clothType == ClothProcess.ClothType.BoneCloth || sdata.clothType == ClothProcess.ClothType.BoneSpring) + { + selectionData.Fill(VertexAttribute.Move); + + // BoneCloth§Ż‚ğƒƒƒˆ‚˘ƒƒƒ—ƒ‡ƒĵ‚żrootżċ›şċšĞ設ċš™‚‹ + // BoneSpring§ŻLineĉŽçĥšż¨Ş‚‹ + var connectionMode = sdata.clothType == ClothProcess.ClothType.BoneSpring ? RenderSetupData.BoneConnectionMode.Line : sdata.connectionMode; + var setupType = sdata.clothType == ClothProcess.ClothType.BoneSpring ? RenderSetupData.SetupType.BoneSpring : RenderSetupData.SetupType.BoneCloth; + using var setup = new RenderSetupData(null, setupType, cloth.ClothTransform, sdata.rootBones, null, connectionMode, cloth.name); + foreach (MagicaObjectId id in setup.rootTransformIdList) + { + int rootIndex = setup.GetTransformIndexFromId(id); + selectionData.attributes[rootIndex] = VertexAttribute.Fixed; + } + } + // MeshCloth§Ż™ıĤċ›şċš§ċšç݁™‚‹ + else + { + selectionData.Fill(VertexAttribute.Invalid); + } + + return selectionData; + } + + //========================================================================================= + /// + /// ‚·ƒĵƒ³ƒ“ƒƒĵ¸‚‚şƒ˘ĉç”ğ + /// + /// + static void OnSceneGUI(SceneView sceneView) + { + if (isValid == false) + return; + + // ‚³ƒ³ƒƒĵƒƒ³ƒˆċ‰Šé™¤ƒ‚§ƒƒ‚Ż + DestroyCheck(); + + // ‚³ƒ³ƒƒĵƒƒ³ƒˆ‚‚şƒ˘ĉç”ğ + if (Event.current.type == EventType.Repaint) + { + //Develop.DebugLog($"Repaint. F:{Time.frameCount}"); + + drawList.Clear(); + bool isPainting = ClothPainter.IsPainting(); + bool isPlaying = EditorApplication.isPlaying; + sceneView.camera.transform.GetPositionAndRotation(out var camPos, out Quaternion camRot); + + lock (editClothDict) + { + foreach (var info in editClothDict.Values) + { + if (info == null || info.component == null) + continue; + + if (info.component.isActiveAndEnabled == false) + continue; + + if (info.component.IsGizmoVisible == false) + continue; + + // ƒš‚¤ƒ³ƒˆä¸­ŻèĦ¨ç¤ş—Ş„ + if (isPainting) + continue; + + // 選ĉŠžçŠĥĉ…‹ + bool selected = IsActiveOrSelected(info.gizmoType); + float dist = Vector3.Distance(camPos, info.component.transform.position); + + // Collider + if (info.component is ColliderComponent) + { + // ColliderŻèĤŞé¸ĉŠžĉ™‚Ğ‚‚èĦ¨ç¤ş™‚‹ + if (IsSelectionHierarchy(info.gizmoType) == false) + continue; + if (selected == false && dist >= 20.0f) + continue; + + GizmoUtility.DrawCollider(info.component as ColliderComponent, camRot, selected); + } + // MagicaCloth + else if (info.component is MagicaCloth) + { + // ClothŻ‚˘‚Żƒ†‚£ƒ–‚‚—ŻƒžƒĞƒé¸ĉŠžĉ™‚żèĦ¨ç¤ş + if (IsActiveOrSelected(info.gizmoType) == false) + continue; + + var cloth = info.component as MagicaCloth; + + // Cloth + if (cloth.GizmoSerializeData.clothDebugSettings.enable) + { + if (isPlaying) + ClothEditorUtility.DrawClothRuntime(cloth.Process, cloth.GizmoSerializeData.clothDebugSettings, selected); + else + ClothEditorUtility.DrawClothEditor(info.editMeshContainer, cloth.GizmoSerializeData.clothDebugSettings, cloth.SerializeData, selected, false, false); + } + +#if MC2_DEBUG + // Proxy Mesh + if (cloth.GizmoSerializeData.proxyDebugSettings.enable) + { + if (isPlaying) + VirtualMeshEditorUtility.DrawRuntimeGizmos(cloth.Process, false, cloth.Process.ProxyMeshContainer, cloth.GizmoSerializeData.proxyDebugSettings, selected, true); + else + VirtualMeshEditorUtility.DrawGizmos(info.editMeshContainer, cloth.GizmoSerializeData.proxyDebugSettings, selected, true); + } + + // Mapping Mesh + if (cloth.GizmoSerializeData.mappingDebugSettings.enable) + { + if (isPlaying) + { + var renderMeshInfo = cloth.Process.GetRenderMeshInfo(cloth.GizmoSerializeData.debugMappingIndex); + if (renderMeshInfo != null && renderMeshInfo.renderMeshContainer != null) + VirtualMeshEditorUtility.DrawRuntimeGizmos(cloth.Process, true, renderMeshInfo.renderMeshContainer, cloth.GizmoSerializeData.mappingDebugSettings, selected, true); + } + } +#endif // MC2_DEBUG + } + // WindZone + else if (info.component is MagicaWindZone) + { + GizmoUtility.DrawWindZone(info.component as MagicaWindZone, camRot, selected); + } + } + + // ĉç”ğƒ•ƒİ‚°off + foreach (var info in editClothDict.Values) + { + if (info != null) + { + info.gizmoType = 0; + if (info.component) + info.component.IsGizmoVisible = false; + } + } + } + } + } + + //========================================================================================= + public static async Task InformationLog(StringBuilder allsb) + { + StringBuilder sb = new StringBuilder(); + + sb.AppendLine($"========== System Info =========="); + sb.AppendLine($"Unity Version:{Application.unityVersion}"); + sb.AppendLine($"MagicaCloth Version:{AboutMenu.MagicaClothVersion}"); + sb.AppendLine($"PlayMode:{Application.isPlaying}"); + sb.AppendLine($"CPU Type:{SystemInfo.processorType}"); + sb.AppendLine($"CPU Freq:{SystemInfo.processorFrequency}"); + sb.AppendLine($"CPU Core:{SystemInfo.processorCount}"); + sb.AppendLine($"Device Type:{SystemInfo.deviceType}"); + sb.AppendLine($"OS:{SystemInfo.operatingSystem}"); + sb.AppendLine($"OS Family:{SystemInfo.operatingSystemFamily}"); + + // ‚¤ƒ³‚ıƒˆƒĵƒĞƒ‘ƒƒ‚ħƒĵ‚¸ä¸€èĤ§ + sb.AppendLine($"<< Install Packages >>"); + var listRequest = Client.List(true, false); + int timeout = 5000; // 5s + while (listRequest.IsCompleted == false && timeout > 0) + { + await Task.Delay(50); + timeout -= 50; + } + if (listRequest.IsCompleted) + { + if (listRequest.Status == StatusCode.Success) + { + foreach (var package in listRequest.Result) + { + //Debug.Log($"{package.name} : {package.version}"); + sb.AppendLine($"{package.name} : {package.version}"); + } + } + else + { + sb.AppendLine($"Package request error!"); + Debug.LogWarning($"Package request error!"); + } + } + else + { + sb.AppendLine($"Package request timeout!"); + Debug.LogWarning($"Package request timeout!"); + } + sb.AppendLine(); + + Debug.Log(sb.ToString()); + allsb.Append(sb); + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Editor/Cloth/ClothEditorManager.cs.meta b/Assets/MagicaCloth2/Scripts/Editor/Cloth/ClothEditorManager.cs.meta new file mode 100644 index 00000000..a0d4097d --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/Cloth/ClothEditorManager.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 905d98a228d9c6c4eb4d5e240f30378a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Editor/Cloth/ClothEditorManager.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Editor/Cloth/ClothEditorUtility.cs b/Assets/MagicaCloth2/Scripts/Editor/Cloth/ClothEditorUtility.cs new file mode 100644 index 00000000..5ba13da5 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/Cloth/ClothEditorUtility.cs @@ -0,0 +1,1161 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System.Collections.Generic; +using Unity.Collections; +using Unity.Mathematics; +using UnityEditor; +using UnityEngine; + + +namespace MagicaCloth2 +{ + /// + /// ‚Żƒ­‚ı‚³ƒ³ƒƒĵƒƒ³ƒˆ‚‚şƒ˘èĦ¨ç¤ş + /// + public static class ClothEditorUtility + { + public static readonly Color MovePointColor = new Color(0.8f, 0.8f, 0.8f, 0.8f); + //public static readonly Color MovePointColor = Color.white; + public static readonly Color FixedPointColor = new Color(1.0f, 0.0f, 0.0f, 0.8f); + public static readonly Color InvalidPointColor = new Color(0.0f, 0.0f, 0.0f, 0.8f); + public static readonly Color AngleLimitConeColor = new Color(0.0f, 0.349f, 0.725f, 0.325f); + public static readonly Color AngleLimitWireColor = new Color(0.0f, 0.843f, 1.0f, 0.313f); + public static readonly Color BaseTriangleColor = new Color(204 / 255f, 153 / 255f, 255 / 255f); + public static readonly Color BaseLineColor = new Color(153 / 255f, 204 / 255f, 255 / 255f); + public static readonly Color TriangleColor = new Color(1.0f, 0.0f, 0.8f, 1f); + public static readonly Color LineColor = Color.cyan; + public static readonly Color SkininngLine = Color.yellow; + + /// + /// ‚Żƒ­‚ıƒš‚¤ƒ³ƒˆĉ™‚‚‚şƒ˘èĦ¨ç¤şè¨­ċš + /// + internal static readonly ClothDebugSettings PaintSettings = new ClothDebugSettings() + { + enable = true, + position = false, + collider = false, + //basicShape = true, + animatedShape = true, + }; + + + //========================================================================================= + static List positionBuffer0 = new List(1024); + static List positionBuffer1 = new List(1024); + static List positionBuffer2 = new List(1024); + static List segmentBuffer0 = new List(2048); + static List segmentBuffer1 = new List(2048); + static List segmentBuffer2 = new List(2048); + + //========================================================================================= + /// + /// 編集ĉ™‚‚Żƒ­‚ıƒ‡ƒĵ‚żèĦ¨ç¤şïĵˆ™ıĤHandles‚Żƒİ‚ı§ĉç”ğïĵ‰ + /// + /// + /// + /// 頂ç‚ıƒš‚¤ƒ³ƒˆä¸­Żtrue + public static void DrawClothEditor(VirtualMeshContainer editMeshContainer, ClothDebugSettings drawSettings, ClothSerializeData serializeData, bool selected, bool direction, bool painting) + { + if (editMeshContainer == null || editMeshContainer.shareVirtualMesh == null || editMeshContainer.shareVirtualMesh.IsSuccess == false) + return; + + if (drawSettings.enable == false || serializeData == null) + return; + + // ‚·ƒĵƒ³‚ЃĦƒİ + var scam = SceneView.currentDrawingSceneView != null ? SceneView.currentDrawingSceneView.camera : null; + if (scam == null) + return; + var crot = scam.transform.rotation; + + // ċş§ĉ¨™çİşé–“Ğċˆ‚›‚‹ + var editMesh = editMeshContainer.shareVirtualMesh; + var t = editMeshContainer.GetCenterTransform(); + if (t == null) + return; + + Handles.zTest = drawSettings.ztest ? UnityEngine.Rendering.CompareFunction.LessEqual : UnityEngine.Rendering.CompareFunction.Always; + Handles.lighting = true; + Handles.matrix = t.localToWorldMatrix; + + // ‚·ƒĵƒ³‚ЃĦƒİċ›žèğ˘‚’ƒ­ƒĵ‚ЃĞçİşé–“¸ċ¤‰ĉ›™‚‹ + crot = Quaternion.Inverse(t.rotation) * crot; + + int vcnt = editMesh.VertexCount; + float worldToLocalScale = 1.0f / t.lossyScale.x; + float drawPointSize = drawSettings.GetPointSize() * worldToLocalScale; + float drawLineSize = drawSettings.GetLineSize() * worldToLocalScale; + float3 cdir = crot * Vector3.forward; // ƒ­ƒĵ‚ЃЂЃĦƒİĉ–ıċ‘ + + float colorScale = selected ? 1.0f : 0.5f; + + // position + if (drawSettings.position || drawSettings.animatedPosition) + { + using var pointList = new NativeList(vcnt, Allocator.TempJob); + + for (int i = 0; i < vcnt; i++) + { + if (drawSettings.CheckParticleDrawing(i) == false) + continue; + + var point = new ClothPainter.Point() + { + vindex = i, + }; + pointList.AddNoResize(point); + } + if (pointList.Length > 0) + { + // ‚ЃĦƒİè·é›˘§‚½ƒĵƒˆ + ClothPainter.CalcPointCameraDistance(editMesh.localPositions.GetNativeArray(), 0, t.localToWorldMatrix, scam.transform.position, pointList); + + // ĉç”ğ + int cnt = pointList.Length; + for (int i = 0; i < cnt; i++) + { + var p = pointList[i]; + + var attr = editMesh.attributes[p.vindex]; + + var col = InvalidPointColor; + if (attr.IsFixed()) col = FixedPointColor; + else if (attr.IsMove()) col = MovePointColor; + GizmoUtility.SetColor(col * colorScale, true); + + // radius + float depth = editMesh.vertexDepths[p.vindex]; + var pos = editMesh.localPositions[p.vindex]; + if (attr.IsDisableCollision()) + { + // ‚³ƒŞ‚¸ƒ§ƒ³ç„ĦċŠıŻċ›şċš‚µ‚¤‚şƒŻ‚¤ƒ¤ƒĵƒ•ƒĴƒĵƒ èĦ¨ç¤ş + GizmoUtility.DrawSimpleWireSphere(pos, 0.01f, crot, true); + } + else + { + float radius = serializeData.radius.Evaluate(depth); + radius *= worldToLocalScale; + GizmoUtility.DrawSphere(pos, drawSettings.CheckRadiusDrawing() ? radius : drawPointSize, true); + } + } + } + } + + // animated shape / shape + if (drawSettings.animatedShape || drawSettings.shape) + { + positionBuffer0.Clear(); + segmentBuffer0.Clear(); + for (int i = 0; i < vcnt; i++) + { + positionBuffer0.Add(editMesh.localPositions[i]); + } + + GizmoUtility.SetColor(drawSettings.animatedShape ? BaseTriangleColor : TriangleColor, true); + int tcnt = editMesh.TriangleCount; + for (int i = 0; i < tcnt; i++) + { + if (drawSettings.CheckTriangleDrawing(i) == false) + continue; + + int3 tri = editMesh.triangles[i]; + + // attribute + //if (drawSettings.animatedShape == false) + //{ + // var attr0 = editMesh.attributes[tri.x]; + // var attr1 = editMesh.attributes[tri.y]; + // var attr2 = editMesh.attributes[tri.y]; + // if (attr0.IsInvalid() || attr1.IsInvalid() || attr2.IsInvalid()) + // continue; + //} + + // ĉ–ıċ‘ĉ€§ + if (direction) + { + var tn = MathUtility.TriangleNormal(editMesh.localPositions[tri.x], editMesh.localPositions[tri.y], editMesh.localPositions[tri.z]); + if (math.dot(tn, cdir) >= 0.0f) + continue; + } + + segmentBuffer0.Add(tri.x); + segmentBuffer0.Add(tri.y); + segmentBuffer0.Add(tri.y); + segmentBuffer0.Add(tri.z); + segmentBuffer0.Add(tri.z); + segmentBuffer0.Add(tri.x); + } + Handles.DrawLines(positionBuffer0.ToArray(), segmentBuffer0.ToArray()); + + segmentBuffer0.Clear(); + GizmoUtility.SetColor((drawSettings.animatedShape ? BaseLineColor : LineColor) * colorScale, true); + int lcnt = editMesh.LineCount; + for (int i = 0; i < lcnt; i++) + { + int2 line = editMesh.lines[i]; + + // attribute + //if (drawSettings.animatedShape == false) + //{ + // var attr0 = editMesh.attributes[line.x]; + // var attr1 = editMesh.attributes[line.y]; + // if (attr0.IsInvalid() || attr1.IsInvalid()) + // continue; + //} + + segmentBuffer0.Add(line.x); + segmentBuffer0.Add(line.y); + } + Handles.DrawLines(positionBuffer0.ToArray(), segmentBuffer0.ToArray()); + } + + // base line + if (drawSettings.baseLine && editMesh.BaseLineCount > 0) + { + GizmoUtility.SetColor(new Color(1.0f, 0.27f, 0.0f) * colorScale, true); + int bcnt = editMesh.BaseLineCount; + for (int i = 0; i < bcnt; i++) + { + int dstart = editMesh.baseLineStartDataIndices[i]; + int dcnt = editMesh.baseLineDataCounts[i]; + for (int j = 1; j < dcnt; j++) + { + int vindex = editMesh.baseLineData[dstart + j]; + int pindex = editMesh.vertexParentIndices[vindex]; + if (pindex >= 0) + { + var pos = editMesh.localPositions[vindex]; + var ppos = editMesh.localPositions[pindex]; + GizmoUtility.DrawLine(pos, ppos, true); + } + } + } + } + + // axis + if (drawSettings.axis != ClothDebugSettings.DebugAxis.None || drawSettings.animatedAxis != ClothDebugSettings.DebugAxis.None) + { + positionBuffer0.Clear(); + positionBuffer1.Clear(); + positionBuffer2.Clear(); + segmentBuffer0.Clear(); + segmentBuffer1.Clear(); + segmentBuffer2.Clear(); + + for (int i = 0; i < vcnt; i++) + { + if (drawSettings.CheckParticleDrawing(i) == false) + continue; + + // attribute + //if (drawSettings.animatedAxis == ClothDebugSettings.DebugAxis.None) + //{ + // var attr = editMesh.attributes[i]; + // if (attr.IsInvalid()) + // continue; + //} + + var pos = editMesh.localPositions[i]; + var rot = MathUtility.ToRotation(editMesh.localNormals[i], editMesh.localTangents[i]); + + // ċŸşĉş–èğ¸ċ¤‰ĉ›ç”¨ƒ­ƒĵ‚ЃĞċ›žèğ˘ + float len = drawLineSize; + + // ċŸşĉş–èğ¸ + bool xaxis = false, yaxis = false, zaxis = false; + if (drawSettings.axis == ClothDebugSettings.DebugAxis.Normal || drawSettings.animatedAxis == ClothDebugSettings.DebugAxis.Normal) + { + switch (serializeData.normalAxis) + { + case ClothNormalAxis.Right: + case ClothNormalAxis.InverseRight: + xaxis = true; + break; + case ClothNormalAxis.Up: + case ClothNormalAxis.InverseUp: + yaxis = true; + break; + case ClothNormalAxis.Forward: + case ClothNormalAxis.InverseForward: + zaxis = true; + break; + } + } + if (drawSettings.axis == ClothDebugSettings.DebugAxis.All || drawSettings.animatedAxis == ClothDebugSettings.DebugAxis.All) + { + xaxis = yaxis = zaxis = true; + } + + if (xaxis) + { + int index = positionBuffer0.Count; + positionBuffer0.Add(pos); + positionBuffer0.Add(pos + MathUtility.ToBinormal(rot) * len); + segmentBuffer0.Add(index); + segmentBuffer0.Add(index + 1); + } + if (yaxis) + { + int index = positionBuffer1.Count; + positionBuffer1.Add(pos); + positionBuffer1.Add(pos + MathUtility.ToNormal(rot) * len); + segmentBuffer1.Add(index); + segmentBuffer1.Add(index + 1); + } + if (zaxis) + { + int index = positionBuffer2.Count; + positionBuffer2.Add(pos); + positionBuffer2.Add(pos + MathUtility.ToTangent(rot) * len); + segmentBuffer2.Add(index); + segmentBuffer2.Add(index + 1); + } + } + + if (positionBuffer0.Count > 0) + { + Handles.color = Color.red * colorScale; + Handles.DrawLines(positionBuffer0.ToArray(), segmentBuffer0.ToArray()); + } + if (positionBuffer1.Count > 0) + { + Handles.color = Color.green * colorScale; + Handles.DrawLines(positionBuffer1.ToArray(), segmentBuffer1.ToArray()); + } + if (positionBuffer2.Count > 0) + { + Handles.color = Color.blue * colorScale; + Handles.DrawLines(positionBuffer2.ToArray(), segmentBuffer2.ToArray()); + } + } + + // depth + if (drawSettings.depth) + { + for (int i = 0; i < vcnt; i++) + { + if (drawSettings.CheckParticleDrawing(i) == false) + continue; + + var pos = editMesh.localPositions[i]; + var depth = editMesh.vertexDepths[i]; + if (depth > 0.0f) + Handles.Label(pos, $"{depth:0.##}"); + } + } +#if MC2_DEBUG + // number + else if (drawSettings.particleNumber || drawSettings.localNumber) + { + for (int i = 0; i < vcnt; i++) + { + if (drawSettings.CheckParticleDrawing(i) == false) + continue; + + var pos = editMesh.localPositions[i]; + Handles.Label(pos, i.ToString()); + } + } + // attribute + else if (drawSettings.attribute) + { + for (int i = 0; i < vcnt; i++) + { + if (drawSettings.CheckParticleDrawing(i) == false) + continue; + + var pos = editMesh.localPositions[i]; + var attr = editMesh.attributes[i]; + Handles.Label(pos, $"0x{attr.Value:X2}"); + } + } + // triangle number + else if (drawSettings.triangleNumber) + { + int tcnt = editMesh.TriangleCount; + for (int i = 0; i < tcnt; i++) + { + if (drawSettings.CheckTriangleDrawing(i) == false) + continue; + + int3 tri = editMesh.triangles[i]; + var pos1 = editMesh.localPositions[tri.x]; + var pos2 = editMesh.localPositions[tri.y]; + var pos3 = editMesh.localPositions[tri.z]; + var cen = MathUtility.TriangleCenter(pos1, pos2, pos3); + Handles.Label(cen, i.ToString()); + } + } +#endif + + // inertia center + if (painting == false && editMesh.CenterFixedPointCount > 0 && drawSettings.inertiaCenter) + { + float3 pos = 0; + int ccnt = editMesh.CenterFixedPointCount; + for (int i = 0; i < ccnt; i++) + { + pos += editMesh.localPositions[editMesh.centerFixedList[i]]; + } + pos /= ccnt; + GizmoUtility.SetColor(Color.magenta * colorScale, true); + GizmoUtility.DrawSphere(pos, drawSettings.GetInertiaCenterRadius() * worldToLocalScale, true); + } + + Handles.matrix = Matrix4x4.identity; + crot = scam.transform.rotation; + + // custom skinning bone + if (painting == false && serializeData.customSkinningSetting.enable && drawSettings.customSkinningBone) + { + Handles.color = SkininngLine * colorScale; + var boneList = serializeData.customSkinningSetting.skinningBones; +#if MC2_CUSTOM_SKINNING_V1 + for (int i = 0; i < boneList.Count - 1; i++) + { + var bone1 = boneList[i]; + if (bone1 == null) + continue; + + for (int j = i + 1; j < boneList.Count; j++) + { + var bone2 = boneList[j]; + if (bone2 == null) + continue; + + if (bone1.parent == bone2 || bone2.parent == bone1) + { + Handles.DrawLine(bone1.position, bone2.position); + } + } + } +#else + // V2 + for (int i = 0; i < boneList.Count; i++) + { + var bone1 = boneList[i]; + if (bone1 == null) + continue; + + GizmoUtility.DrawWireSphere(bone1.position, quaternion.identity, drawSettings.GetCustomSkinningRadius(), crot, true); + } +#endif + } + } + + /// + /// ċŸèĦŒĉ™‚‚Żƒ­‚ıƒ‡ƒĵ‚żèĦ¨ç¤şïĵˆ™ıĤHandles‚Żƒİ‚ı§ĉç”ğïĵ‰ + /// + /// + /// + public static void DrawClothRuntime(ClothProcess cprocess, ClothDebugSettings drawSettings, bool selected) + { + if (cprocess == null || cprocess.IsValid() == false) + return; + if (drawSettings.enable == false) + return; + if (MagicaManager.Team == null) + return; + if (MagicaManager.Team.ContainsTeamData(cprocess.TeamId) == false) + return; + + // ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒ + var proxyMesh = cprocess.ProxyMeshContainer?.shareVirtualMesh; + if (proxyMesh == null || proxyMesh.IsSuccess == false) + return; + + // ‚·ƒĵƒ³‚ЃĦƒİ + var scam = SceneView.currentDrawingSceneView != null ? SceneView.currentDrawingSceneView.camera : null; + if (scam == null) + return; + var crot = scam.transform.rotation; + + // ƒƒĵƒ ƒ‡ƒĵ‚ż + var tdata = MagicaManager.Team.GetTeamDataRef(cprocess.TeamId); + var cdata = MagicaManager.Team.centerDataArray[cprocess.TeamId]; + int pcnt = tdata.ParticleCount; + int pstart = tdata.particleChunk.startIndex; + int vstart = tdata.proxyCommonChunk.startIndex; + float drawPointSize = drawSettings.GetPointSize(); + float drawLineSize = drawSettings.GetLineSize(); + + // ċş§ĉ¨™çİşé–“Ğċˆ‚›‚‹ + var t = cprocess.cloth.ClothTransform; + if (t == null) + return; + + Handles.zTest = drawSettings.ztest ? UnityEngine.Rendering.CompareFunction.LessEqual : UnityEngine.Rendering.CompareFunction.Always; + Handles.matrix = Matrix4x4.identity; + float colorScale = selected ? 1 : 0.5f; + + var sim = MagicaManager.Simulation; + var vm = MagicaManager.VMesh; + + // ċş§ĉ¨™ċ‚ç…§ċ…ˆ + var positionArray = drawSettings.IsReferOldPos() ? sim.oldPosArray : sim.dispPosArray; + + // position + if (drawSettings.position) + { + using var pointList = new NativeList(pcnt, Allocator.TempJob); + + for (int i = 0; i < pcnt; i++) + { + if (drawSettings.CheckParticleDrawing(i) == false) + continue; + + var point = new ClothPainter.Point() + { + vindex = i, + }; + pointList.AddNoResize(point); + } + if (pointList.Length > 0) + { + // ‚ЃĦƒİè·é›˘§‚½ƒĵƒˆ + ClothPainter.CalcPointCameraDistance(positionArray.GetNativeArray(), pstart, float4x4.identity, scam.transform.position, pointList); + + // ĉç”ğ + int cnt = pointList.Length; + for (int i = 0; i < cnt; i++) + { + var p = pointList[i]; + + int pindex = pstart + p.vindex; + int cvindex = tdata.proxyCommonChunk.startIndex + p.vindex; + + var attr = vm.attributes[cvindex]; + + // ç„ĦċŠıċħžĉ€§ŻèĦ¨ç¤ş—Ş„ + if (attr.IsInvalid()) + continue; + + var col = InvalidPointColor; + if (attr.IsFixed()) col = FixedPointColor; + else if (attr.IsMove()) col = MovePointColor; + GizmoUtility.SetColor(col * colorScale, true); + + // radius + float depth = vm.vertexDepths[cvindex]; + var pos = positionArray[pindex]; + if (attr.IsDisableCollision()) + { + // ‚³ƒŞ‚¸ƒ§ƒ³ç„ĦċŠıŻċ›şċš‚µ‚¤‚şƒŻ‚¤ƒ¤ƒĵƒ•ƒĴƒĵƒ èĦ¨ç¤ş + GizmoUtility.DrawSimpleWireSphere(pos, 0.01f, crot, true); + } + else + { + float radius = cprocess.parameters.radiusCurveData.MC2EvaluateCurve(depth); + radius *= tdata.scaleRatio; + GizmoUtility.DrawSphere(pos, drawSettings.CheckRadiusDrawing() ? radius : drawPointSize, true); + } + } + } + } + + // rotation axis / area + if (drawSettings.axis != ClothDebugSettings.DebugAxis.None) + { + positionBuffer0.Clear(); + positionBuffer1.Clear(); + positionBuffer2.Clear(); + segmentBuffer0.Clear(); + segmentBuffer1.Clear(); + segmentBuffer2.Clear(); + + for (int i = 0; i < pcnt; i++) + { + if (drawSettings.CheckParticleDrawing(i) == false) + continue; + + int pindex = pstart + i; + int cvindex = tdata.proxyCommonChunk.startIndex + i; + + // attribute + if (vm.attributes[cvindex].IsInvalid()) + continue; + + var pos = positionArray[pindex]; + var rot = vm.rotations[cvindex]; // 計ç—ĉ¸ˆżċ‰ƒ•ƒĴƒĵƒ ĉœ€çµ‚ċ§żċ‹˘ + + float len = drawLineSize; + + // ċŸşĉş–èğ¸ + bool xaxis = false, yaxis = false, zaxis = false; + if (drawSettings.axis == ClothDebugSettings.DebugAxis.Normal) + { + switch (cprocess.parameters.normalAxis) + { + case ClothNormalAxis.Right: + case ClothNormalAxis.InverseRight: + xaxis = true; + break; + case ClothNormalAxis.Up: + case ClothNormalAxis.InverseUp: + yaxis = true; + break; + case ClothNormalAxis.Forward: + case ClothNormalAxis.InverseForward: + zaxis = true; + break; + } + } + if (drawSettings.axis == ClothDebugSettings.DebugAxis.All) + { + xaxis = yaxis = zaxis = true; + } + + if (xaxis) + { + int index = positionBuffer0.Count; + positionBuffer0.Add(pos); + positionBuffer0.Add(pos + MathUtility.ToBinormal(rot) * len); + segmentBuffer0.Add(index); + segmentBuffer0.Add(index + 1); + } + if (yaxis) + { + int index = positionBuffer1.Count; + positionBuffer1.Add(pos); + positionBuffer1.Add(pos + MathUtility.ToNormal(rot) * len); + segmentBuffer1.Add(index); + segmentBuffer1.Add(index + 1); + } + if (zaxis) + { + int index = positionBuffer2.Count; + positionBuffer2.Add(pos); + positionBuffer2.Add(pos + MathUtility.ToTangent(rot) * len); + segmentBuffer2.Add(index); + segmentBuffer2.Add(index + 1); + } + } + + if (positionBuffer0.Count > 0) + { + Handles.color = Color.red * colorScale; + Handles.DrawLines(positionBuffer0.ToArray(), segmentBuffer0.ToArray()); + } + if (positionBuffer1.Count > 0) + { + Handles.color = Color.green * colorScale; + Handles.DrawLines(positionBuffer1.ToArray(), segmentBuffer1.ToArray()); + } + if (positionBuffer2.Count > 0) + { + Handles.color = Color.blue * colorScale; + Handles.DrawLines(positionBuffer2.ToArray(), segmentBuffer2.ToArray()); + } + } + +#if MC2_DEBUG + // collision normal + if (drawSettings.collisionNormal) + { + GizmoUtility.SetColor(Color.yellow * colorScale, true); + for (int i = 0; i < pcnt; i++) + { + if (drawSettings.CheckParticleDrawing(i) == false) + continue; + + int pindex = pstart + i; + var pos = positionArray[pindex]; + float3 cn = sim.collisionNormalArray[pindex]; + if (math.lengthsq(cn) > 1e-06f) + { + GizmoUtility.DrawLine(pos, pos + cn * drawPointSize, true); + } + } + } +#endif + + // animated shape + if (drawSettings.animatedShape) + { + positionBuffer0.Clear(); + segmentBuffer0.Clear(); + for (int i = 0; i < pcnt; i++) + { + positionBuffer0.Add(sim.basePosArray[pstart + i]); + //positionBuffer0.Add(sim.stepBasicPositionBuffer[pstart + i]); + } + + GizmoUtility.SetColor(BaseTriangleColor, true); + int tcnt = tdata.proxyTriangleChunk.dataLength; + for (int i = 0; i < tcnt; i++) + { + if (drawSettings.CheckTriangleDrawing(i) == false) + continue; + + int tindex = tdata.proxyTriangleChunk.startIndex + i; + int3 tri = vm.triangles[tindex]; + + //int3 vtri = tri + tdata.proxyCommonChunk.startIndex; + //if (vm.attributes[vtri.x].IsInvalid() || vm.attributes[vtri.y].IsInvalid() || vm.attributes[vtri.z].IsInvalid()) + // continue; + + segmentBuffer0.Add(tri.x); + segmentBuffer0.Add(tri.y); + segmentBuffer0.Add(tri.y); + segmentBuffer0.Add(tri.z); + segmentBuffer0.Add(tri.z); + segmentBuffer0.Add(tri.x); + } + Handles.DrawLines(positionBuffer0.ToArray(), segmentBuffer0.ToArray()); + + segmentBuffer0.Clear(); + GizmoUtility.SetColor(BaseLineColor * colorScale, true); + int lcnt = proxyMesh.LineCount; + for (int i = 0; i < lcnt; i++) + { + int2 line = proxyMesh.lines[i]; + segmentBuffer0.Add(line.x); + segmentBuffer0.Add(line.y); + } + Handles.DrawLines(positionBuffer0.ToArray(), segmentBuffer0.ToArray()); + } + + // shape + if (drawSettings.shape) + { + positionBuffer0.Clear(); + segmentBuffer0.Clear(); + for (int i = 0; i < pcnt; i++) + { + positionBuffer0.Add(positionArray[pstart + i]); + } + + GizmoUtility.SetColor(TriangleColor * colorScale, true); + int tcnt = tdata.proxyTriangleChunk.dataLength; + for (int i = 0; i < tcnt; i++) + { + if (drawSettings.CheckTriangleDrawing(i) == false) + continue; + + int tindex = tdata.proxyTriangleChunk.startIndex + i; + int3 tri = vm.triangles[tindex]; + +#if true + int3 vtri = tri + tdata.proxyCommonChunk.startIndex; + if (vm.attributes[vtri.x].IsInvalid() || vm.attributes[vtri.y].IsInvalid() || vm.attributes[vtri.z].IsInvalid()) + continue; +#endif + + segmentBuffer0.Add(tri.x); + segmentBuffer0.Add(tri.y); + segmentBuffer0.Add(tri.y); + segmentBuffer0.Add(tri.z); + segmentBuffer0.Add(tri.z); + segmentBuffer0.Add(tri.x); + } + Handles.DrawLines(positionBuffer0.ToArray(), segmentBuffer0.ToArray()); + + segmentBuffer0.Clear(); + GizmoUtility.SetColor(LineColor * colorScale, true); + int lcnt = proxyMesh.LineCount; + for (int i = 0; i < lcnt; i++) + { + int2 line = proxyMesh.lines[i]; + +#if true + int2 vline = line + tdata.proxyCommonChunk.startIndex; + if (vm.attributes[vline.x].IsInvalid() || vm.attributes[vline.y].IsInvalid()) + continue; +#endif + + segmentBuffer0.Add(line.x); + segmentBuffer0.Add(line.y); + } + Handles.DrawLines(positionBuffer0.ToArray(), segmentBuffer0.ToArray()); + } + + // base line + if (drawSettings.baseLine && proxyMesh.BaseLineCount > 0) + { + GizmoUtility.SetColor(new Color(1.0f, 0.27f, 0.0f) * colorScale, true); + int bcnt = proxyMesh.BaseLineCount; + for (int i = 0; i < bcnt; i++) + { + int dstart = proxyMesh.baseLineStartDataIndices[i]; + int dcnt = proxyMesh.baseLineDataCounts[i]; + for (int j = 1; j < dcnt; j++) + { + int vindex = proxyMesh.baseLineData[dstart + j]; + int pindex = proxyMesh.vertexParentIndices[vindex]; + if (pindex >= 0) + { + var pos = positionArray[pstart + vindex]; + var ppos = positionArray[pstart + pindex]; + GizmoUtility.DrawLine(pos, ppos, true); + } + } + } + } + + // animated position + if (drawSettings.animatedPosition) + { + for (int i = 0; i < pcnt; i++) + { + if (drawSettings.CheckParticleDrawing(i) == false) + continue; + + int pindex = tdata.particleChunk.startIndex + i; + + //int cvindex = tdata.proxyCommonChunk.startIndex + i; + //var attr = vm.attributes[cvindex]; + //if (attr.IsInvalid()) + // continue; + + var pos = sim.basePosArray[pindex]; + //var pos = sim.stepBasicPositionBuffer[pindex]; + GizmoUtility.SetColor(Color.cyan * colorScale, true); + GizmoUtility.DrawSphere(pos, drawPointSize, true); + } + } + + // animated axis + if (drawSettings.animatedAxis != ClothDebugSettings.DebugAxis.None) + { + float size = drawLineSize; + + positionBuffer0.Clear(); + positionBuffer1.Clear(); + positionBuffer2.Clear(); + segmentBuffer0.Clear(); + segmentBuffer1.Clear(); + segmentBuffer2.Clear(); + + for (int i = 0; i < pcnt; i++) + { + if (drawSettings.CheckParticleDrawing(i) == false) + continue; + + int pindex = tdata.particleChunk.startIndex + i; + int cvindex = tdata.proxyCommonChunk.startIndex + i; + + //var attr = vm.attributes[cvindex]; + //if (attr.IsInvalid()) + // continue; + + var pos = sim.basePosArray[pindex]; + var rot = sim.baseRotArray[pindex]; + //var pos = sim.stepBasicPositionBuffer[pindex]; + //var rot = sim.stepBasicRotationBuffer[pindex]; + + // ċŸşĉş–èğ¸ + bool xaxis = false, yaxis = false, zaxis = false; + if (drawSettings.animatedAxis == ClothDebugSettings.DebugAxis.Normal) + { + switch (cprocess.parameters.normalAxis) + { + case ClothNormalAxis.Right: + case ClothNormalAxis.InverseRight: + xaxis = true; + break; + case ClothNormalAxis.Up: + case ClothNormalAxis.InverseUp: + yaxis = true; + break; + case ClothNormalAxis.Forward: + case ClothNormalAxis.InverseForward: + zaxis = true; + break; + } + } + if (drawSettings.animatedAxis == ClothDebugSettings.DebugAxis.All) + { + xaxis = yaxis = zaxis = true; + } + + if (xaxis) + { + int index = positionBuffer0.Count; + positionBuffer0.Add(pos); + positionBuffer0.Add(pos + MathUtility.ToBinormal(rot) * size); + segmentBuffer0.Add(index); + segmentBuffer0.Add(index + 1); + } + if (yaxis) + { + int index = positionBuffer1.Count; + positionBuffer1.Add(pos); + positionBuffer1.Add(pos + MathUtility.ToNormal(rot) * size); + segmentBuffer1.Add(index); + segmentBuffer1.Add(index + 1); + } + if (zaxis) + { + int index = positionBuffer2.Count; + positionBuffer2.Add(pos); + positionBuffer2.Add(pos + MathUtility.ToTangent(rot) * size); + segmentBuffer2.Add(index); + segmentBuffer2.Add(index + 1); + } + } + + if (positionBuffer0.Count > 0) + { + Handles.color = Color.red * colorScale; + Handles.DrawLines(positionBuffer0.ToArray(), segmentBuffer0.ToArray()); + } + if (positionBuffer1.Count > 0) + { + Handles.color = Color.green * colorScale; + Handles.DrawLines(positionBuffer1.ToArray(), segmentBuffer1.ToArray()); + } + if (positionBuffer2.Count > 0) + { + Handles.color = Color.blue * colorScale; + Handles.DrawLines(positionBuffer2.ToArray(), segmentBuffer2.ToArray()); + } + } + +#if false + // distance constraint + //for (int k = 0; k < DistanceConstraint.TypeCount; k++) + { + //bool drawFlag = false; + //switch (k) + //{ + // case DistanceConstraint.Type_Vertical: drawFlag = drawSettings.verticalDistanceConstraint; break; + // case DistanceConstraint.Type_Horizontal: drawFlag = drawSettings.horizontalDistanceConstraint; break; + //} + //if (drawFlag == false) + // continue; + + var distanceConstraint = sim.distanceConstraint; + //var nData = distanceConstraint.nativeData[k]; + + var sc = tdata.distanceStartChunk; + var dc = tdata.distanceDataChunk; + if (sc.IsValid) + { + //var col = Color.black; + //switch (k) + //{ + // case DistanceConstraint.Type_Vertical: + // col = Color.yellow; + // break; + // case DistanceConstraint.Type_Horizontal: + // col = Color.red; + // break; + //} + //GizmoUtility.SetColor(col * colorScale, true); + + positionBuffer0.Clear(); + segmentBuffer0.Clear(); + for (int i = 0; i < pcnt; i++) + { + positionBuffer0.Add(positionArray[pstart + i]); + } + + for (int i = 0; i < pcnt; i++) + { + if (drawSettings.CheckParticleDrawing(i) == false) + continue; + + int cindex = sc.startIndex + i; + var pack = distanceConstraint.indexArray[cindex]; + DataUtility.Unpack10_22(pack, out int dcnt, out int dstart); + if (dcnt > 0) + { + for (int j = 0; j < dcnt; j++) + { + int targetIndex = distanceConstraint.dataArray[dc.startIndex + dstart + j]; + segmentBuffer0.Add(i); + segmentBuffer0.Add(targetIndex); + } + } + } + Handles.DrawLines(positionBuffer0.ToArray(), segmentBuffer0.ToArray()); + } + } +#endif + + // depth + if (drawSettings.depth) + { + for (int i = 0; i < pcnt; i++) + { + if (drawSettings.CheckParticleDrawing(i) == false) + continue; + + int pindex = tdata.particleChunk.startIndex + i; + int cvindex = tdata.proxyCommonChunk.startIndex + i; + + if (vm.attributes[cvindex].IsInvalid()) + continue; + + var pos = positionArray[pindex]; + var depth = vm.vertexDepths[cvindex]; + Handles.Label(pos, $"{depth:0.##}"); + } + } +#if MC2_DEBUG + // number + else if (drawSettings.particleNumber || drawSettings.localNumber) + { + for (int i = 0; i < pcnt; i++) + { + //if (drawSettings.CheckParticleDrawing(i) == false) + // continue; + + int pindex = tdata.particleChunk.startIndex + i; + var pos = positionArray[pindex]; + if (drawSettings.particleNumber && drawSettings.CheckParticleDrawing(pindex)) + Handles.Label(pos, pindex.ToString()); + else if (drawSettings.localNumber && drawSettings.CheckParticleDrawing(i)) + Handles.Label(pos, i.ToString()); + } + } + // attribute + else if (drawSettings.attribute) + { + for (int i = 0; i < pcnt; i++) + { + if (drawSettings.CheckParticleDrawing(i) == false) + continue; + + int pindex = tdata.particleChunk.startIndex + i; + int cvindex = tdata.proxyCommonChunk.startIndex + i; + + var pos = positionArray[pindex]; + var attr = vm.attributes[cvindex]; + Handles.Label(pos, $"0x{attr.Value:X2}"); + } + } + // friction + else if (drawSettings.friction) + { + for (int i = 0; i < pcnt; i++) + { + if (drawSettings.CheckParticleDrawing(i) == false) + continue; + + int pindex = tdata.particleChunk.startIndex + i; + int cvindex = tdata.proxyCommonChunk.startIndex + i; + + var pos = positionArray[pindex]; + var friction = sim.frictionArray[pindex]; + if (friction > 1e-06f) + Handles.Label(pos, $"{friction:0.##}"); + } + } + // static friction + else if (drawSettings.staticFriction) + { + for (int i = 0; i < pcnt; i++) + { + if (drawSettings.CheckParticleDrawing(i) == false) + continue; + + int pindex = tdata.particleChunk.startIndex + i; + int cvindex = tdata.proxyCommonChunk.startIndex + i; + + var pos = positionArray[pindex]; + var friction = sim.staticFrictionArray[pindex]; + if (friction > 1e-06f) + Handles.Label(pos, $"{friction:0.##}"); + } + } + // triangle number + else if (drawSettings.triangleNumber) + { + int tcnt = tdata.proxyTriangleChunk.dataLength; + for (int i = 0; i < tcnt; i++) + { + if (drawSettings.CheckTriangleDrawing(i) == false) + continue; + + int tindex = tdata.proxyTriangleChunk.startIndex + i; + int3 tri = vm.triangles[tindex]; + var pos1 = positionArray[pstart + tri.x]; + var pos2 = positionArray[pstart + tri.y]; + var pos3 = positionArray[pstart + tri.z]; + var cen = MathUtility.TriangleCenter(pos1, pos2, pos3); + Handles.Label(cen, i.ToString()); + } + } + // base line pos + if (drawSettings.baseLinePos) + { + var col = new Color(1.0f, 0.7f, 0.3f); + for (int i = 0; i < pcnt; i++) + { + if (drawSettings.CheckParticleDrawing(i) == false) + continue; + + int pindex = tdata.particleChunk.startIndex + i; + + var pos = sim.stepBasicPositionBuffer[pindex]; + GizmoUtility.SetColor(col * colorScale, true); + GizmoUtility.DrawSphere(pos, drawPointSize, true); + } + } +#endif + + // çİşé–“‚’ĉˆğ™ + Handles.matrix = Matrix4x4.identity; + crot = scam.transform.rotation; + + // äğ下ŻƒŻƒĵƒĞƒ‰ + // custom skinning bone + if (cprocess.cloth.SerializeData.customSkinningSetting.enable && drawSettings.customSkinningBone) + { + Handles.color = SkininngLine * colorScale; + var boneList = cprocess.cloth.SerializeData.customSkinningSetting.skinningBones; +#if MC2_CUSTOM_SKINNING_V1 + for (int i = 0; i < boneList.Count - 1; i++) + { + var bone1 = boneList[i]; + if (bone1 == null) + continue; + for (int j = i + 1; j < boneList.Count; j++) + { + var bone2 = boneList[j]; + if (bone2 == null) + continue; + + if (bone1.parent == bone2 || bone2.parent == bone1) + { + Handles.DrawLine(bone1.position, bone2.position); + } + } + } +#else + // V2 + for (int i = 0; i < boneList.Count; i++) + { + var bone1 = boneList[i]; + if (bone1 == null) + continue; + + GizmoUtility.DrawWireSphere(bone1.position, quaternion.identity, drawSettings.GetCustomSkinningRadius(), crot, true); + } +#endif + } + + + // inertia center + if (drawSettings.inertiaCenter) + { + var pos = cdata.nowWorldPosition; + var rot = cdata.nowWorldRotation; + GizmoUtility.SetColor(Color.magenta * colorScale, true); + GizmoUtility.DrawSphere(pos, drawSettings.GetInertiaCenterRadius(), true); + GizmoUtility.DrawCross(pos, rot, drawSettings.GetInertiaCenterRadius() * 2.0f, true); + } + +#if MC2_DEBUG + // cell cube + //if (drawSettings.cellCube) + //{ + // GizmoUtility.SetColor(Color.black * colorScale, true); + // GizmoUtility.DrawWireCube(tdata.cubeWorldCenter, Quaternion.identity, Vector3.one * tdata.cubeSize, true); + //} +#endif + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Editor/Cloth/ClothEditorUtility.cs.meta b/Assets/MagicaCloth2/Scripts/Editor/Cloth/ClothEditorUtility.cs.meta new file mode 100644 index 00000000..a97360ac --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/Cloth/ClothEditorUtility.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: f11b17a94f5361246b6c56a0fb52570e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Editor/Cloth/ClothEditorUtility.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Editor/Cloth/ClothInspectorUtility.cs b/Assets/MagicaCloth2/Scripts/Editor/Cloth/ClothInspectorUtility.cs new file mode 100644 index 00000000..79965c79 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/Cloth/ClothInspectorUtility.cs @@ -0,0 +1,76 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using UnityEditor; +using UnityEngine; + +namespace MagicaCloth2 +{ + public static class ClothInspectorUtility + { + //=============================================================================== + /// + /// ĉŠ˜‚ЁŸŸżċˆĥċĦ + /// + /// ĉŠ˜‚ЁŸŸżäżċ­˜‚­ƒĵ + /// + /// ċ†…ċıĉç”ğ‚˘‚Ż‚·ƒ§ƒ³ + /// ĉœ‰ċŠıƒ•ƒİ‚°‚˘‚Ż‚·ƒ§ƒ³(null=ç„ĦċŠı) + /// çċœ¨ĉœ‰ċŠıƒ•ƒİ‚° + public static void Foldout( + string foldKey, + string title = null, + System.Action drawAct = null, + System.Action enableAct = null, + bool enable = false, + bool warning = false + ) + { + var style = new GUIStyle("ShurikenModuleTitle"); + style.font = new GUIStyle(EditorStyles.label).font; + style.border = new RectOffset(15, 7, 4, 4); + style.fixedHeight = 22; + style.contentOffset = new Vector2(20f, -2f); + + var rect = GUILayoutUtility.GetRect(16f, 22f, style); + + GUI.backgroundColor = warning ? Color.yellow : Color.white; + GUI.Box(rect, title, style); + GUI.backgroundColor = Color.white; + + var e = Event.current; + bool foldOut = EditorPrefs.GetBool(foldKey); + + if (enableAct == null) + { + if (e.type == EventType.Repaint) + { + var toggleRect = new Rect(rect.x + 4f, rect.y + 2f, 13f, 13f); + EditorStyles.foldout.Draw(toggleRect, false, false, foldOut, false); + } + } + else + { + // ĉœ‰ċŠıƒ‚§ƒƒ‚Ż + var toggleRect = new Rect(rect.x + 4f, rect.y + 4f, 13f, 13f); + bool sw = GUI.Toggle(toggleRect, enable, string.Empty, new GUIStyle("ShurikenCheckMark")); + if (sw != enable) + { + enableAct(sw); + } + } + + if (e.type == EventType.MouseDown && rect.Contains(e.mousePosition)) + { + foldOut = !foldOut; + EditorPrefs.SetBool(foldKey, foldOut); + e.Use(); + } + + if (foldOut && drawAct != null) + { + drawAct(); + } + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Editor/Cloth/ClothInspectorUtility.cs.meta b/Assets/MagicaCloth2/Scripts/Editor/Cloth/ClothInspectorUtility.cs.meta new file mode 100644 index 00000000..5a52e2cd --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/Cloth/ClothInspectorUtility.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 434cdfa441f5efc49954b9ba7d8bb241 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Editor/Cloth/ClothInspectorUtility.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Editor/Cloth/ClothPainter.cs b/Assets/MagicaCloth2/Scripts/Editor/Cloth/ClothPainter.cs new file mode 100644 index 00000000..84015af1 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/Cloth/ClothPainter.cs @@ -0,0 +1,949 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System; +using Unity.Burst; +using Unity.Collections; +using Unity.Jobs; +using Unity.Mathematics; +using UnityEditor; +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// 頂ç‚ıƒš‚¤ƒ³ƒˆ‚Ĥ‚¤ƒ³ƒ‰‚Ĥ + /// + [InitializeOnLoad] + public class ClothPainter + { + public enum PaintMode + { + None, + + /// + /// Move/Fixed/Ignore/Invalid + /// + Attribute, + + /// + /// Max Distance/Backstop + /// + Motion, + } + + static PaintMode paintMode = PaintMode.None; + + /// + /// 編集ċŻèħĦ‚Żƒ­‚ı‚³ƒ³ƒƒĵƒƒ³ƒˆ + /// + static MagicaCloth cloth = null; + + /// + /// 編集ċŻèħĦ‚Żƒ­‚ıEditor‚Żƒİ‚ı + /// + static MagicaClothEditor clothEditor = null; + + /// + /// 編集ċŻèħĦ‚¨ƒ‡‚£ƒƒƒˆƒĦƒƒ‚·ƒ + /// + static VirtualMeshContainer editMeshContainer = null; + + /// + /// 編集ċŻèħĦ‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚ż + /// + static SelectionData selectionData = null; + + /// + /// 編集開ċ§‹ĉ™‚‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚żïĵˆ‚³ƒ”ƒĵïĵ‰ + /// + static SelectionData initSelectionData = null; + + internal const int WindowWidth = 200; + internal const int WindowHeight = 200; + + //========================================================================================= + const int PointFlag_Selecting = 1; // 選ĉŠžä¸­ + + internal struct Point : IComparable + { + public int vindex; + public float distance; + public BitField32 flag; + + public int CompareTo(Point other) + { + if (distance != other.distance) + return distance < other.distance ? 1 : -1; + else if (vindex != other.vindex) + return vindex < other.vindex ? 1 : -1; + else + return 0; + } + } + static NativeList dispPointList; + static NativeArray pointWorldPositions; + static VirtualMeshRaycastHit rayhit = default; + static bool oldShowAll = false; + static bool forceUpdate = false; + + //========================================================================================= + static ClothPainter() + { + // ‚·ƒĵƒ³ƒ“ƒƒĵĞGUI‚’ĉç”ğ™‚‹Ÿ‚‚³ƒĵƒĞƒƒƒ‚Ż + SceneView.duringSceneGui += OnGUI; + } + + /// + /// ƒš‚¤ƒ³ƒˆé–‹ċ§‹ + /// + /// + public static void EnterPaint(PaintMode mode, MagicaClothEditor editor, MagicaCloth clothComponent, VirtualMeshContainer cmesh, SelectionData sdata) + { + Develop.DebugLog($"EnterPaint"); + + paintMode = mode; + cloth = clothComponent; + clothEditor = editor; + editMeshContainer = cmesh; + selectionData = sdata; + initSelectionData = sdata.Clone(); + rayhit = default; + forceUpdate = true; + + // ƒ‚¤ƒ³ƒˆƒƒƒƒ•‚Ħ + dispPointList = new NativeList(cmesh.shareVirtualMesh.VertexCount, Allocator.Persistent); + pointWorldPositions = new NativeArray(cmesh.shareVirtualMesh.VertexCount, Allocator.Persistent); + + // UndoRedo‚³ƒĵƒĞƒƒƒ‚Ż + Undo.undoRedoPerformed += UndoRedoCallback; + } + + /// + /// ƒš‚¤ƒ³ƒˆçµ‚了 + /// + public static void ExitPaint() + { + Develop.DebugLog($"ExitPaint"); + + cloth = null; + clothEditor = null; + editMeshContainer = null; + selectionData = null; + initSelectionData = null; + rayhit = default; + + if (dispPointList.IsCreated) + dispPointList.Dispose(); + if (pointWorldPositions.IsCreated) + pointWorldPositions.Dispose(); + + // UndoRedo‚³ƒĵƒĞƒƒƒ‚Ż + Undo.undoRedoPerformed -= UndoRedoCallback; + } + + /// + /// Undo/RedoċŸèĦŒċŒ‚³ƒĵƒĞƒƒƒ‚Ż + /// + static void UndoRedoCallback() + { + //Develop.DebugLog($"Undo Redo!"); + + if (EditorApplication.isPlaying) + return; + + if (cloth == null || editMeshContainer == null || selectionData == null || editMeshContainer.shareVirtualMesh.IsSuccess == false) + return; + + // ‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚ż‚’ċ–‚Šç›´™ + selectionData = clothEditor.GetSelectionData(cloth, editMeshContainer.shareVirtualMesh); + + forceUpdate = true; + } + + //========================================================================================= + /// + /// ĉŒ‡ċš‚Żƒ­‚ı‚³ƒ³ƒƒĵƒƒ³ƒˆ‚’編集中‹İ†‹ + /// + /// + /// + public static bool HasEditCloth(MagicaCloth clothComponent) + { + return cloth == clothComponent; + } + + /// + /// 編集中‹İ†‹ + /// + /// + public static bool IsPainting() + { + return cloth != null; + } + + //========================================================================================= + static void OnGUI(SceneView sceneView) + { + if (EditorApplication.isPlaying) + return; + + // ‚˘‚Żƒ†‚£ƒ–‚·ƒĵƒ³ƒ“ƒƒĵċˆ¤ċš + if (SceneView.lastActiveSceneView != sceneView) + return; + + if (cloth == null || editMeshContainer == null || editMeshContainer.shareVirtualMesh == null || selectionData == null) + return; + if (editMeshContainer.shareVirtualMesh.IsSuccess == false || selectionData.IsValid() == false) + return; + + var windata = ScriptableSingleton.instance; + + // ‚·ƒĵƒ³ƒ“ƒƒĵ‚ЃĦƒİ + Camera cam = SceneView.currentDrawingSceneView.camera; + Ray ray = HandleUtility.GUIPointToWorldRay(Event.current.mousePosition); + Vector3 spos = ray.origin; + Vector3 epos = spos + ray.direction * 1000.0f; + + // 透過‚Ѓĵ‚½ƒĞ用 + float rayAngle = Vector3.Angle(cam.transform.forward, ray.direction); + float nearPlaneDistance = cam.orthographic ? cam.nearClipPlane : cam.nearClipPlane / math.cos(math.radians(rayAngle)); + float nearPlaneVSize = cam.orthographic ? cam.orthographicSize : math.tan(math.radians(cam.fieldOfView * 0.5f)) * cam.nearClipPlane * 2; + float brushSizeThrough = nearPlaneVSize * windata.brushSizeThrough; + + // ‚Ѓĵ‚½ƒĞviewportƒ‚¤ƒ³ƒˆ + var sp = HandleUtility.GUIPointToScreenPixelCoordinate(Event.current.mousePosition); + var cursorViewpos = cam.ScreenToViewportPoint(sp); + cursorViewpos = math.remap(new float3(0), new float3(1), new float3(-1), new float3(1), cursorViewpos); // ċ°„ċ½ħèĦŒċˆ—(-1 ~ +1)Ğċ¤‰ĉ› + + // ‚ЃĦƒİċş§ĉ¨™‚’ƒ­ƒĵ‚ЃĞçİşé–“Ğċ¤‰ĉ›™‚‹ + var t = cloth.ClothTransform; // ‚³ƒ³ƒƒĵƒƒ³ƒˆçİşé–“ + + bool repaint = false; + bool updatePoint = false; + + // ƒ‚¤ƒ³ƒˆ‚µ‚¤‚ş + float pointSize = windata.drawPointSize; + + bool showAll = windata.backFaceCulling == false; + + // ƒž‚Ĥ‚ıç§ğċ‹•中Żċ¸¸ĞƒĦƒƒ‚·ƒ¨äş¤ċ·ċˆ¤ċš + if (Event.current.type == EventType.MouseMove || Event.current.type == EventType.MouseDrag || oldShowAll != showAll || forceUpdate) + { + oldShowAll = showAll; + forceUpdate = false; + updatePoint = true; + } + + // ƒž‚Ĥ‚ı選ĉŠž + if (Event.current.type == EventType.MouseDown && Event.current.button == 0 && !Event.current.alt) + { + // ƒš‚¤ƒ³ƒˆéİ用 + ApplyPaint(windata, dispPointList); + + // ‚·ƒĵƒ³ƒ“ƒƒĵ‚¨ƒŞ‚˘é¸ĉŠž‚’ċ‡ş•Ş„Ÿ‚Ğ€¨‚Ё‚ˆš“†™‚‹‚‰—„ + int controlId = GUIUtility.GetControlID(FocusType.Passive); + GUIUtility.hotControl = controlId; + Event.current.Use(); // ? + } + if (Event.current.type == EventType.MouseDrag && Event.current.button == 0 && !Event.current.alt) + { + // ƒš‚¤ƒ³ƒˆéİ用 + ApplyPaint(windata, dispPointList); + + Event.current.Use(); + } + if (Event.current.type == EventType.MouseUp && Event.current.button == 0 && !Event.current.alt) + { + // ƒš‚¤ƒ³ƒˆçµĉžœ‚’éİ用™‚‹ + ApplySelectionData(); + + // ƒž‚Ĥ‚ıƒœ‚żƒ³UP§‚³ƒ³ƒˆƒ­ƒĵƒĞƒ­ƒƒ‚Ż‚’解除™‚‹‚‰—„ + GUIUtility.hotControl = 0; + Event.current.Use(); // ? + } + + // Handlesĉç”ğŻGUIċ‰§Ş‘‚Œ°Ş‚‰Ş„.理ç”ħŻä¸ĉ˜Ž + if (Event.current.type == EventType.Repaint) + { + // ƒ‡‚£‚ı‚݁ĉç”ğ + if (windata.through) + { + // 透過ƒ˘ƒĵƒ‰ + Handles.matrix = Matrix4x4.identity; + Handles.zTest = UnityEngine.Rendering.CompareFunction.Always; + var dpos = spos + ray.direction * nearPlaneDistance; + var dnor = cam.transform.forward; + Handles.color = new Color(0.6f, 0.2f, 1.0f, 0.3f); + Handles.DrawSolidDisc(dpos, dnor, brushSizeThrough); + } + else if (rayhit.IsValid()) + { + Handles.matrix = Matrix4x4.identity; + Handles.zTest = UnityEngine.Rendering.CompareFunction.Always; + var dpos = t.TransformPoint(rayhit.position); + var dnor = t.TransformDirection(rayhit.normal); + Handles.color = new Color(0.3f, 0.5f, 1.0f, 0.4f); + Handles.DrawSolidDisc(dpos, dnor, windata.brushSize); + } + + // ƒ‚¤ƒ³ƒˆèĦ¨ç¤ş + Handles.lighting = true; + //Handles.zTest = showAll ? UnityEngine.Rendering.CompareFunction.Always : UnityEngine.Rendering.CompareFunction.LessEqual; + //Handles.zTest = UnityEngine.Rendering.CompareFunction.Always; + Handles.zTest = windata.zTest ? UnityEngine.Rendering.CompareFunction.LessEqual : UnityEngine.Rendering.CompareFunction.Always; + Handles.matrix = Matrix4x4.identity; + int cnt = dispPointList.Length; + for (int i = 0; i < cnt; i++) + { + var point = dispPointList[i]; + + Color col = Color.black; + var attr = selectionData.attributes[point.vindex]; + switch (paintMode) + { + case PaintMode.Attribute: + if (attr.IsMove()) col = Color.green; + else if (attr.IsFixed()) col = Color.red; + //else if (attr.IsIgnore()) col = Color.blue; + else col = Color.gray; + break; + case PaintMode.Motion: + if (attr.IsMotion()) col = Color.cyan; + else col = Color.gray; + break; + } + + // 選ĉŠžä¸­ + if (point.flag.IsSet(PointFlag_Selecting)) + { + col = Color.yellow; + } + + var pos = pointWorldPositions[point.vindex]; + Handles.color = col; + Handles.SphereHandleCap(0, pos, Quaternion.identity, windata.drawPointSize, EventType.Repaint); + } + + // ƒš‚¤ƒ³ƒˆä¸­‚‚şƒ˘èĦ¨ç¤ş + if (windata.showShape) + ClothEditorUtility.DrawClothEditor(editMeshContainer, ClothEditorUtility.PaintSettings, cloth.SerializeData, true, windata.backFaceCulling, true); + } + + // GUI + //sceneView.BeginWindows(); + string title = string.Empty; + switch (paintMode) + { + case PaintMode.Attribute: + title = "Movement attribute paint"; + break; + case PaintMode.Motion: + title = "Max Distance/Backstop paint"; + break; + } + var rect = GUILayout.Window(71903439, windata.windowRect, DoWindow, title); + //Debug.Log(windata.windowRect); + // ‚Ĥ‚¤ƒ³ƒ‰‚Ĥ‚’SceneViewé ˜ċŸŸċ†…Ğ‚Żƒİƒ³ƒ—™‚‹ + // sceneView.position§rectŒċ–‚Œ‚‹ + rect.x = Mathf.Clamp(rect.x, 0, Mathf.Max(sceneView.position.width - rect.width, 0)); + rect.y = Mathf.Clamp(rect.y, 0, Mathf.Max(sceneView.position.height - rect.height - 25, 0)); + rect.width = WindowWidth; + rect.height = WindowHeight; + windata.windowRect = rect; + //sceneView.EndWindows(); + + // ƒ‚¤ƒ³ƒˆƒ‡ƒĵ‚żĉ›´ĉ–° + if (updatePoint) + { + UpdatePoint( + windata.through, + t, cam, ray, showAll, + windata.through ? windata.brushSizeThrough : windata.brushSize, + windata.through ? cursorViewpos : t.TransformPoint(rayhit.position), + windata.drawPointSize + ); + repaint = true; + } + + // ç”ğ面ƒŞƒ•ƒĴƒƒ‚·ƒ + if (repaint) + sceneView.Repaint(); + } + + /// + /// ƒ‚¤ƒ³ƒˆƒ‡ƒĵ‚ż‚’ĉ›´ĉ–°™‚‹ + /// + /// + /// + /// + /// + /// + static void UpdatePoint(bool through, Transform ct, Camera cam, Ray ray, bool showAll, float brushSize, float3 brushPos, float pointSize) + { + // èĦ¨ç¤şé ‚ç‚ı選ċˆ + CreateDispPointList(through, ct, cam, showAll, brushSize, brushPos).Complete(); + + // ‚µƒĵƒ•‚§ƒĵ‚ı交ċ·ċˆ¤ċš + //rayhit = editMesh.IntersectRayMesh(ray.origin, ray.direction, showAll, pointSize); + rayhit = editMeshContainer.shareVirtualMesh.IntersectRayMesh(ray.origin, ray.direction, showAll, pointSize); + } + + static JobHandle CreateDispPointList( + bool through, Transform ct, Camera cam, + bool showAll, float brushSize, float3 brushPosition, JobHandle jobHandle = default + ) + { + dispPointList.Clear(); + + var editMesh = editMeshContainer.shareVirtualMesh; + int vcnt = editMesh.VertexCount; + if (vcnt == 0) + return jobHandle; + + // ƒ­ƒĵ‚ЃЂЃĦƒİ + var localCameraDirection = ct.InverseTransformDirection(cam.transform.forward); + + // 頂ç‚ıƒŻƒĵƒĞƒ‰ċ¤‰ĉ›¨èĦ¨ç¤şé ‚ç‚ıé¸ċˆ + var job = new CreateDispPointListJob() + { + through = through, + LtoW = ct.localToWorldMatrix, + showAll = showAll, + + cameraPosition = cam.transform.position, + cameraDirection = localCameraDirection, + + cameraProjectionMatrix = cam.projectionMatrix, + worldToCameraMatrix = cam.worldToCameraMatrix, + cameraAspectRatio = cam.aspect, + + useBrush = through || rayhit.IsValid(), + brushPosition = brushPosition, + brushSize = brushSize, + + localPositions = editMesh.localPositions.GetNativeArray(), + localNormals = editMesh.localNormals.GetNativeArray(), + vertexToTriangles = editMesh.vertexToTriangles, + + pointWorldPositions = pointWorldPositions, + dispPointList = dispPointList.AsParallelWriter(), + }; + jobHandle = job.Schedule(vcnt, 16, jobHandle); + + // è·é›˘‚½ƒĵƒˆ + var job2 = new SortDispPointJob() + { + dispPointList = dispPointList, + }; + jobHandle = job2.Schedule(jobHandle); + + return jobHandle; + } + + [BurstCompile] + struct CreateDispPointListJob : IJobParallelFor + { + public bool through; + public float4x4 LtoW; + public bool showAll; + + public float3 cameraPosition; + public float3 cameraDirection; + public float4x4 cameraProjectionMatrix; + public float4x4 worldToCameraMatrix; + public float cameraAspectRatio; + + public bool useBrush; + public float3 brushPosition; + public float brushSize; + + [Unity.Collections.ReadOnly] + public NativeArray localPositions; + [Unity.Collections.ReadOnly] + public NativeArray localNormals; + [Unity.Collections.ReadOnly] + public NativeArray> vertexToTriangles; + + [Unity.Collections.WriteOnly] + public NativeArray pointWorldPositions; + [Unity.Collections.WriteOnly] + public NativeList.ParallelWriter dispPointList; + + public void Execute(int vindex) + { + // ƒŻƒĵƒĞƒ‰ċş§ĉ¨™ + var lpos = localPositions[vindex]; + var wpos = math.transform(LtoW, lpos); + pointWorldPositions[vindex] = wpos; + + // ‚ЃĦƒİè·é›˘ + float dist = math.distance(cameraPosition, wpos); + + // èĦ¨ç¤şé¸ċˆ + bool show; + if (showAll) + { + show = true; + } + else + { + // 頂ç‚ıŒƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĞċħž•Ş„ċ ´ċˆŻç„ĦĉĦäğĥ§èĦ¨ç¤ş™‚‹ + if (vertexToTriangles[vindex].Length == 0) + show = true; + else + { + // ƒˆƒİ‚¤‚˘ƒ³‚°ƒĞĞċħž™‚‹é ‚ç‚ıŻĉ³•ç·šŒç”ğ面Ğċ‘„Ĥ„‚‹‚‚żèĦ¨ç¤ş + show = math.dot(cameraDirection, localNormals[vindex]) < 0.0f; + } + } + + if (show) + { + var flag = new BitField32(); + + // ƒ–ƒİ‚·çŻ„ċ›²ċ†…Ğċ­˜ċœ¨™‚‹‹ċˆ¤ċš + if (useBrush) + { + if (through) + { + // 透過ƒ˘ƒĵƒ‰ + // ċ°„ċ½ħċ¤‰ĉ› + var cpos = math.mul(worldToCameraMatrix, new float4(wpos, 1)); + var vpos = math.mul(cameraProjectionMatrix, new float4(cpos.xyz, 1)); + vpos /= vpos.w; // w§ċ‰²‚‹ċż…èĤ‚‚Š + + // ƒ–ƒİ‚·Ż‚˘‚ıƒš‚ŻƒˆĉŻ”‚’考ĉ…—Ÿĉ•ċ††§ċˆ¤ċš™‚‹ċż…èĤ‚‚Š + // brushPositionŻviewportċş§ĉ¨™‚’ĉŒ‡™ + float2 v = vpos.xy - brushPosition.xy; + v.x *= cameraAspectRatio; + var bdist = math.length(v); + if (bdist <= brushSize) + flag.SetBits(PointFlag_Selecting, true); + } + else + { + // ‚µƒĵƒ•‚§‚ı選ĉŠžƒ˘ƒĵƒ‰ + var bdist = math.distance(brushPosition, wpos); + if (bdist <= brushSize) + flag.SetBits(PointFlag_Selecting, true); + } + } + + dispPointList.AddNoResize(new Point() { vindex = vindex, distance = dist, flag = flag }); + } + } + } + + [BurstCompile] + struct SortDispPointJob : IJob + { + public NativeList dispPointList; + + public void Execute() + { + if (dispPointList.Length > 1) + dispPointList.Sort(); + } + } + + /// + /// ĉ¸Ħ•‚ŒŸpointList‚’‚ЃĦƒİ‹‚‰è·é›˘é™é †Ğ‚½ƒĵƒˆ—Ĥèż”™ + /// + /// + /// + /// position‚’ƒŻƒĵƒĞƒ‰ċş§ĉ¨™ċ¤‰ĉ›™‚‹ƒžƒˆƒŞƒƒ‚Ż‚ı + /// ‚ЃĦƒİƒŻƒĵƒĞƒ‰ċş§ĉ¨™ + /// + internal static void CalcPointCameraDistance(NativeArray positions, int positonOffset, float4x4 LtoW, float3 camPos, NativeList pointList) + { + // ƒ‚¤ƒ³ƒˆ‚ЃĦƒİ‹‚‰è·é›˘‚’ĉħ‚‚‚‹ + int cnt = pointList.Length; + if (cnt <= 1) + return; + + var job = new CalcCameraDistanceJob() + { + LtoW = LtoW, + cameraPosition = camPos, + positions = positions, + pointList = pointList, + positionOffset = positonOffset, + }; + job.Run(cnt); + + // è·é›˘‚½ƒĵƒˆ + var job2 = new SortDispPointJob() + { + dispPointList = pointList, + }; + job2.Run(); + } + + + [BurstCompile] + struct CalcCameraDistanceJob : IJobParallelFor + { + public float4x4 LtoW; + + public float3 cameraPosition; + + [Unity.Collections.ReadOnly] + public NativeArray positions; + + [NativeDisableParallelForRestriction] + public NativeList pointList; + public int positionOffset; + + public void Execute(int index) + { + var point = pointList[index]; + + // ƒŻƒĵƒĞƒ‰ċş§ĉ¨™ + var lpos = positions[positionOffset + point.vindex]; + var wpos = math.transform(LtoW, lpos); + + // ‚ЃĦƒİè·é›˘ + float dist = math.distance(cameraPosition, wpos); + point.distance = dist; + + pointList[index] = point; + } + } + + /// + /// 選ĉŠžä¸­ƒ‚¤ƒ³ƒˆĞċħžĉ€§‚’äğ˜ä¸Ž™‚‹ + /// + /// + static void ApplyPaint(ClothPainterWindowData windata, NativeList applyPointList) + { + int cnt = applyPointList.Length; + for (int i = 0; i < cnt; i++) + { + var point = applyPointList[i]; + if (point.flag.IsSet(PointFlag_Selecting) == false) + continue; + + var attr = selectionData.attributes[point.vindex]; + bool change = false; + + switch (paintMode) + { + case PaintMode.Attribute: + // ç§ğċ‹•/ċ›şċš + if (windata.editAttribute == 0 && attr.IsMove() == false) + { + attr.SetFlag(VertexAttribute.Flag_Move, true); + attr.SetFlag(VertexAttribute.Flag_Fixed, false); + //attr.SetFlag(VertexAttribute.Flag_Ignore, false); + change = true; + } + else if (windata.editAttribute == 1 && attr.IsFixed() == false) + { + attr.SetFlag(VertexAttribute.Flag_Move, false); + attr.SetFlag(VertexAttribute.Flag_Fixed, true); + //attr.SetFlag(VertexAttribute.Flag_Ignore, false); + change = true; + } + //else if (windata.editAttribute == 2 && attr.IsIgnore() == false) + //{ + // attr.SetFlag(VertexAttribute.Flag_Move, false); + // attr.SetFlag(VertexAttribute.Flag_Fixed, false); + // attr.SetFlag(VertexAttribute.Flag_Ignore, true); + // change = true; + //} + else if (windata.editAttribute == 3 && attr.IsInvalid() == false) + { + attr.SetFlag(VertexAttribute.Flag_Move, false); + attr.SetFlag(VertexAttribute.Flag_Fixed, false); + //attr.SetFlag(VertexAttribute.Flag_Ignore, false); + change = true; + } + + break; + case PaintMode.Motion: + // MaxDistance/Backstop + if (windata.editMotion == 0 && attr.IsMotion() == false) + { + attr.SetFlag(VertexAttribute.Flag_InvalidMotion, false); + change = true; + } + else if (windata.editMotion == 1 && attr.IsMotion()) + { + attr.SetFlag(VertexAttribute.Flag_InvalidMotion, true); + change = true; + } + break; + } + + if (change) + selectionData.attributes[point.vindex] = attr; + } + } + + /// + /// ‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚ż‚’‚·ƒŞ‚˘ƒİ‚¤‚ş™‚‹ + /// + static void ApplySelectionData() + { + // ‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚żƒ‡ƒĵ‚ż‚’‚·ƒŞ‚˘ƒİ‚¤‚şċŒ–™‚‹ + selectionData.userEdit = true; // ƒĤƒĵ‚ĥƒĵ編集ƒ•ƒİ‚°‚’çĞ‹Ĥ‚‹ + if (clothEditor != null) + clothEditor.ApplyClothPainter(selectionData); + + // Undo/RedoçŠĥĉ…‹‚’ċˆ‡‚Šĉ›żˆ‚‹Ÿ‚‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚ż‚Żƒ­ƒĵƒ³‚’作ĉˆ—Ĥċˆ‡‚Šĉ›żˆ‚‹ + selectionData = selectionData.Clone(); + } + + /// + /// ċĦ—‚Ё¤ĥ— + /// + /// + static void Fill(ClothPainterWindowData windata) + { + // ċĦ—‚Ё¤ĥ—用ƒ‚¤ƒ³ƒˆƒ‡ƒĵ‚ż‚’作ĉˆ™‚‹ + //int vcnt = editMesh.VertexCount; + int vcnt = editMeshContainer.shareVirtualMesh.VertexCount; + using var fillDispPointList = new NativeList(vcnt, Allocator.TempJob); + BitField32 flag = new(); + flag.SetBits(PointFlag_Selecting, true); + for (int i = 0; i < vcnt; i++) + { + var p = new Point() + { + vindex = i, + distance = 0, + flag = flag, + }; + fillDispPointList.Add(p); + } + + // ‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚ż¸ċĉ˜  + ApplyPaint(windata, fillDispPointList); + + // ‚·ƒŞ‚˘ƒİ‚¤‚ş + ApplySelectionData(); + } + + + static void DoWindow(int unusedWindowID) + { + var windata = ScriptableSingleton.instance; + + //Debug.Log(windata.windowRect); + + //float lineHight = EditorGUIUtility.singleLineHeight; + + // ƒ‚¤ƒ³ƒˆ‚µ‚¤‚ş‚ıƒİ‚¤ƒ€ƒĵ + const float sliderLableWidth = 80; + const float sliderWidth = 180; + using (var h = new EditorGUILayout.HorizontalScope()) + { + EditorGUILayout.LabelField("Point Size", GUILayout.Width(sliderLableWidth)); + windata.drawPointSize = EditorGUILayout.Slider(GUIContent.none, windata.drawPointSize, 0.001f, 0.1f, GUILayout.Width(sliderWidth)); + } + + // ƒ–ƒİ‚·‚µ‚¤‚ş‚ıƒİ‚¤ƒ€ƒĵ + using (var h = new EditorGUILayout.HorizontalScope()) + { + if (windata.through) + { + EditorGUILayout.LabelField("Brush Size T", GUILayout.Width(sliderLableWidth)); + windata.brushSizeThrough = EditorGUILayout.Slider(GUIContent.none, windata.brushSizeThrough, 0.01f, 0.3f, GUILayout.Width(sliderWidth)); + } + else + { + EditorGUILayout.LabelField("Brush Size", GUILayout.Width(sliderLableWidth)); + windata.brushSize = EditorGUILayout.Slider(GUIContent.none, windata.brushSize, 0.001f, 0.2f, GUILayout.Width(sliderWidth)); + } + } + + EditorGUILayout.Space(); + + const float toggleLableWidth = 80; + const float toggleButtonWidth = 30; + using (var h = new EditorGUILayout.HorizontalScope()) + { + // ċ½˘çŠĥèĦ¨ç¤ş + EditorGUILayout.LabelField("Shape", GUILayout.Width(toggleLableWidth)); + windata.showShape = EditorGUILayout.Toggle(GUIContent.none, windata.showShape, GUILayout.Width(toggleButtonWidth)); + + // ċ…¨èĦ¨ç¤ş + EditorGUILayout.LabelField("Culling", GUILayout.Width(toggleLableWidth)); + windata.backFaceCulling = EditorGUILayout.Toggle(GUIContent.none, windata.backFaceCulling, GUILayout.Width(toggleButtonWidth)); + } + + using (var h = new EditorGUILayout.HorizontalScope()) + { + // Zƒ†‚ıƒˆ + EditorGUILayout.LabelField("Z-Test", GUILayout.Width(toggleLableWidth)); + windata.zTest = EditorGUILayout.Toggle(GUIContent.none, windata.zTest, GUILayout.Width(toggleButtonWidth)); + + // 透過 + EditorGUILayout.LabelField("Through", GUILayout.Width(toggleLableWidth)); + windata.through = EditorGUILayout.Toggle(GUIContent.none, windata.through, GUILayout.Width(toggleButtonWidth)); + } + + // ċħžĉ€§ƒœ‚żƒ³ + EditorGUILayout.Space(); + EditorGUILayout.LabelField("Paint Attribute"); + Color bcol = GUI.backgroundColor; + using (new EditorGUILayout.HorizontalScope()) + { + if (paintMode == PaintMode.Attribute) + { + // Move/Fixed + int nowAttr = windata.editAttribute; + for (int i = 0; i < 4; i++) + { + // !çċœ¨IgnoreŻ‚ރŸƒƒƒˆ + if (i == 2) + continue; + + Color col = Color.black; + string title = string.Empty; + switch (i) + { + case 0: // move + col = Color.green; + title = "Move"; + break; + case 1: // fixed + col = Color.red; + title = "Fixed"; + break; + case 2: // ignore + col = Color.blue; + title = "Ignore"; + break; + case 3: // invalid + col = Color.gray; + title = "Invalid"; + break; + } + GUI.backgroundColor = i == nowAttr ? col : Color.gray; + bool ret = GUILayout.Toggle(i == nowAttr, title, EditorStyles.miniButton); + if (ret) + { + nowAttr = i; + } + } + windata.editAttribute = nowAttr; + } + else if (paintMode == PaintMode.Motion) + { + // MaxDistance/Backstop + int nowAttr = windata.editMotion; + for (int i = 0; i < 2; i++) + { + // ‚Ѓ݃ĵ + var col = i == 0 ? Color.cyan : Color.red; + GUI.backgroundColor = i == nowAttr ? col : Color.gray; + bool ret = GUILayout.Toggle(i == nowAttr, i == 0 ? "Valid" : "Invalid", EditorStyles.miniButton); + if (ret) + { + nowAttr = i; + } + } + windata.editMotion = nowAttr; + } + } + GUI.backgroundColor = bcol; + + // éİ用/‚­ƒ£ƒ³‚ğƒĞƒœ‚żƒ³ + EditorGUILayout.Space(); + using (new EditorGUILayout.HorizontalScope()) + { + // ċĦ—‚Ё¤ĥ—ƒœ‚żƒ³ + if (GUILayout.Button("Fill", GUILayout.Width(70))) + { + Fill(windata); + } + + GUILayout.FlexibleSpace(); + + // ƒš‚¤ƒ³ƒˆçµ‚了ƒœ‚żƒ³ + if (GUILayout.Button("Exit")) + { + // ċˆĉœŸċŒ–ƒ‡ƒĵ‚żäżċ­˜ç˘şèލ + ClothEditorManager.ApplyInitData(cloth, global: true); + + // ƒš‚¤ƒ³ƒˆçµ‚了ƒ•ƒİ‚° + cloth = null; + + // “ç·¨é›†Ğ‚ˆ‚Š‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚żĞċ¤‰ĉ›´Œ‚£Ÿċ ´ċˆŻProxyMesh‚’ƒŞƒ“ƒĞƒ‰™‚‹ + if (initSelectionData.Compare(selectionData) == false) + { + Develop.DebugLog($"Change selection data!"); + if (clothEditor != null) + clothEditor.UpdateEditMesh(); + } + + ExitPaint(); + } + EditorGUILayout.Space(); + } + + GUI.DragWindow(); + } + } + + //============================================================================================= + /// + /// ƒš‚¤ƒ³ƒˆ‚Ĥ‚¤ƒ³ƒ‰‚ĤäżĉŒƒ‡ƒĵ‚ż + /// ScriptableSingleton‚’ċˆİ用™‚‹“¨Ğ‚ˆ‚Š‚¨ƒ‡‚£‚żçµ‚了ĉ™‚§ƒ‡ƒĵ‚ż‚’保ĉŒ§‚‹ + /// + public class ClothPainterWindowData : ScriptableSingleton + { + /// + /// ‚Ĥ‚¤ƒ³ƒ‰‚Ĥä½ç½¨‚µ‚¤‚ş + /// + public Rect windowRect = new Rect(100, 100, ClothPainter.WindowWidth, ClothPainter.WindowHeight); + + /// + /// èĦ¨ç¤şƒ‚¤ƒ³ƒˆ‚µ‚¤‚ş + /// + public float drawPointSize = 0.02f; + + /// + /// ƒ–ƒİ‚·‚µ‚¤‚ş + /// + public float brushSize = 0.05f; + + /// + /// ƒ–ƒİ‚·‚µ‚¤‚şïĵˆé€éŽƒ˘ƒĵƒ‰ĉ™‚ïĵ‰ + /// ‚·ƒĵƒ³‚ЃĦƒİċž‚ç›´‚µ‚¤‚ş(%) + /// + public float brushSizeThrough = 0.1f; + + /// + /// è£é˘‚Ѓރ³‚° + /// + public bool backFaceCulling = true; + + /// + /// ċ½˘çŠĥ‚’èĦ¨ç¤ş + /// + public bool showShape = true; + + /// + /// Zƒ†‚ıƒˆ + /// + public bool zTest = false; + + /// + /// 透過ƒ˘ƒĵƒ‰ + /// + public bool through = false; + + /// + /// çċœ¨‚˘‚Żƒ†‚£ƒ–Şƒ‚¤ƒ³ƒˆċħžĉ€§(0=Move/1=Fixed/2=Ignore/3=Invalid) + /// VertexAttribute¨Żç•°Ş‚‹§ĉ³¨ĉ„ïĵ + /// + public int editAttribute = 0; + + /// + /// çċœ¨‚˘‚Żƒ†‚£ƒ–Şƒ˘ƒĵ‚·ƒ§ƒ³ċˆĥ約(0=Valid, 1=Invalid) + /// + public int editMotion = 0; + } +} diff --git a/Assets/MagicaCloth2/Scripts/Editor/Cloth/ClothPainter.cs.meta b/Assets/MagicaCloth2/Scripts/Editor/Cloth/ClothPainter.cs.meta new file mode 100644 index 00000000..d070b7cf --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/Cloth/ClothPainter.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 3d9ac74274185454f8b6f05bc4f2825e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Editor/Cloth/ClothPainter.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Editor/Cloth/ClothPresetUtility.cs b/Assets/MagicaCloth2/Scripts/Editor/Cloth/ClothPresetUtility.cs new file mode 100644 index 00000000..72aaa673 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/Cloth/ClothPresetUtility.cs @@ -0,0 +1,232 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System.Collections.Generic; +using System.IO; +using UnityEditor; +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// ƒ—ƒŞ‚ğƒƒƒˆĞ関™‚‹ƒĤƒĵƒ†‚£ƒŞƒ†‚£ + /// + public static class ClothPresetUtility + { + const string prefix = "MC2_Preset"; + const string configName = "MC2 preset folder"; + + public static void DrawPresetButton(MagicaCloth cloth, ClothSerializeData sdata) + { + bool save = false; + bool load = false; + using (var horizontalScope = new GUILayout.HorizontalScope()) + { + EditorGUILayout.LabelField("Parameters", EditorStyles.boldLabel); + + GUI.backgroundColor = Color.green; + if (EditorGUILayout.DropdownButton(new GUIContent("Preset"), FocusType.Keyboard, GUILayout.Width(70), GUILayout.Height(16))) + { + CreatePresetPopupMenu(cloth, sdata); + GUI.backgroundColor = Color.white; + //GUIUtility.ExitGUI(); + } + GUI.backgroundColor = Color.white; + + if (GUILayout.Button("Save", GUILayout.Width(40), GUILayout.Height(16))) + { + //SavePreset(sdata); + //GUIUtility.ExitGUI(); + save = true; + } + if (GUILayout.Button("Load", GUILayout.Width(40), GUILayout.Height(16))) + { + //LoadPreset(cloth, sdata); + //GUIUtility.ExitGUI(); + load = true; + } + } + if (save) + SavePreset(sdata); + if (load) + LoadPreset(cloth, sdata); + } + + static string GetComponentTypeName(ClothSerializeData sdata) + { + //if (sdata.clothType == ClothProcess.ClothType.BoneCloth) + // return prefix + "BoneCloth"; + //else if (sdata.clothType == ClothProcess.ClothType.MeshCloth) + // return prefix + "MeshCloth"; + //return prefix; + + return prefix; + } + + + class PresetInfo + { + public string presetPath; + public string presetName; + public TextAsset text; + } + + private static void CreatePresetPopupMenu(MagicaCloth cloth, ClothSerializeData sdata) + { + var guidArray = AssetDatabase.FindAssets($"{prefix} t:{nameof(TextAsset)}"); + if (guidArray == null) + return; + + Dictionary> dict = new Dictionary>(); + foreach (var guid in guidArray) + { + var filePath = AssetDatabase.GUIDToAssetPath(guid); + + // jsonç˘şèŞ + if (filePath.EndsWith(".json") == false) + continue; + + var text = AssetDatabase.LoadAssetAtPath(filePath); + if (text) + { + var info = new PresetInfo(); + info.presetPath = filePath; + var fname = Path.GetFileNameWithoutExtension(filePath); + fname = fname.Replace(prefix, ""); + if (fname.StartsWith("_")) + fname = fname.Remove(0, 1); // é ­_Żċ‰Šé™¤™‚‹ + info.presetName = fname; + info.text = text; + + // ƒ‡‚£ƒĴ‚ŻƒˆƒŞ”¨Ğ記録™‚‹ + var dirName = Path.GetDirectoryName(filePath); + if (dict.ContainsKey(dirName) == false) + { + dict.Add(dirName, new List()); + } + dict[dirName].Add(info); + } + } + + // ƒƒƒƒ—‚˘ƒƒƒ—ƒĦƒ‹ƒƒĵä½œĉˆ + // ƒ‡‚£ƒĴ‚ŻƒˆƒŞ”¨Ğ‚ğƒ‘ƒĴƒĵ‚ż§ċˆ†‘ĤèĦ¨ç¤ş™‚‹ + var menu = new GenericMenu(); + int line = 0; + foreach (var kv in dict) + { + if (line > 0) + { + menu.AddSeparator(""); + } + foreach (var info in kv.Value) + { + var textAsset = info.text; + var presetName = info.presetName; + var presetPath = info.presetPath; + menu.AddItem(new GUIContent(presetName), false, () => + { + // load + Develop.Log("Load preset file:" + presetPath); + if (sdata.ImportJson(textAsset.text)) + Develop.Log("Completed."); + else + Develop.LogError("Preset load error!"); + + LoadPresetFinish(cloth); + }); + } + line++; + } + menu.ShowAsContext(); + } + + /// + /// ƒ—ƒŞ‚ğƒƒƒˆƒ•‚Ħ‚¤ƒĞ保ċ­˜ + /// + /// + private static void SavePreset(ClothSerializeData sdata) + { + // ƒ•‚݃Ѓ€‚’èŞ­żèĵż + string folder = EditorUserSettings.GetConfigValue(configName); + + // ĉŽé ­èޞ + string presetTypeName = GetComponentTypeName(sdata); + + // 保ċ­˜ƒ€‚¤‚˘ƒ­‚° + string path = EditorUtility.SaveFilePanelInProject( + "Save Preset", + $"{presetTypeName}_(name)", + "json", + "Enter a name for the preset json.", + folder + ); + if (string.IsNullOrEmpty(path)) + return; + + // ƒ•‚݃Ѓ€‚’記録 + folder = Path.GetDirectoryName(path); + EditorUserSettings.SetConfigValue(configName, folder); + + Develop.Log("Save preset file:" + path); + + // export json + string json = sdata.ExportJson(); + + // save + File.WriteAllText(path, json); + + AssetDatabase.Refresh(); + + Develop.Log("Completed."); + } + + /// + /// ƒ—ƒŞ‚ğƒƒƒˆƒ•‚Ħ‚¤ƒĞèŞ­żèĵż + /// + /// + private static void LoadPreset(MagicaCloth cloth, ClothSerializeData sdata) + { + // ƒ•‚݃Ѓ€‚’èŞ­żèĵż + string folder = EditorUserSettings.GetConfigValue(configName); + + // èŞ­żèĵżƒ€‚¤‚˘ƒ­‚° + string path = EditorUtility.OpenFilePanel("Load Preset", folder, "json"); + if (string.IsNullOrEmpty(path)) + return; + + // ƒ•‚݃Ѓ€‚’記録 + folder = Path.GetDirectoryName(path); + EditorUserSettings.SetConfigValue(configName, folder); + + // import json + Develop.Log("Load preset file:" + path); + string json = File.ReadAllText(path); + + // load + if (sdata.ImportJson(json)) + Develop.Log("Completed."); + else + Develop.LogError("Preset load error!"); + + LoadPresetFinish(cloth); + } + + /// + /// ƒ—ƒŞ‚ğƒƒƒˆƒ•‚Ħ‚¤ƒĞèŞ­żèĵżċŒċ‡Ĥ理 + /// + /// + private static void LoadPresetFinish(MagicaCloth cloth) + { + if (EditorApplication.isPlaying) + { + // ƒ‘ƒİƒĦƒĵ‚żĉ›´ĉ–°é€šçŸ + cloth.SetParameterChange(); + } + else + { + // ‚·ƒŞ‚˘ƒİ‚¤‚şċ¤‰ĉ›´é€šçŸ + EditorUtility.SetDirty(cloth); + } + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Editor/Cloth/ClothPresetUtility.cs.meta b/Assets/MagicaCloth2/Scripts/Editor/Cloth/ClothPresetUtility.cs.meta new file mode 100644 index 00000000..dbc034a9 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/Cloth/ClothPresetUtility.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 92b2c2c365167f34e90c74c01638b1eb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Editor/Cloth/ClothPresetUtility.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaCapsuleColliderEditor.cs b/Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaCapsuleColliderEditor.cs new file mode 100644 index 00000000..488c8256 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaCapsuleColliderEditor.cs @@ -0,0 +1,118 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using UnityEditor; +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// CapsuleCollider‚¨ƒ‡‚£‚żĉ‹Ħċĵµ + /// + [CustomEditor(typeof(MagicaCapsuleCollider))] + [CanEditMultipleObjects] + public class MagicaCapsuleColliderEditor : MagicaEditorBase + { + public override void OnInspectorGUI() + { + var scr = target as MagicaCapsuleCollider; + const string undoName = "CapsuleCollider"; + + serializedObject.Update(); + Undo.RecordObject(scr, undoName); + + // separation + var separationValue = serializedObject.FindProperty("radiusSeparation"); + + // direction + var directionValue = serializedObject.FindProperty("direction"); + EditorGUILayout.PropertyField(directionValue); + + // reverse direction + EditorGUILayout.PropertyField(serializedObject.FindProperty("reverseDirection")); + + // aligned on center + var alignedOnCenterValue = serializedObject.FindProperty("alignedOnCenter"); + EditorGUILayout.PropertyField(alignedOnCenterValue); + + var sizeValue = serializedObject.FindProperty("size"); + var size = sizeValue.vector3Value; + + // ƒžƒĞƒé¸ĉŠžĉ™‚Ğ¤„Ĥ + // CapsuleCollider§ŻEditorGUI.showMixedValueŻè¨­ċš—Ş„ + // EditorGUI.showMixedValue‚’設ċš™‚‹¨ç•°Ş‚‹ċ€¤ċ ´ċˆŻ€Œƒĵ€§èĦ¨è¨˜•‚Œ‚‹‚ˆ†ĞŞ‚‹Œ€ + // ‚Ѓ—‚ğƒĞ‚³ƒİ‚¤ƒ€ƒĵ§Żïĵ‘¤Vector3Ğïĵ“¤ç•°Ş‚‹‚ıƒİ‚¤ƒ€ƒĵ‚’ċ‰²‚Šċ½“ĤĤ„‚‹Ÿ‚€ + // ċ„‚ıƒİ‚¤ƒ€ƒĵċ€¤ŒċŒ˜ċ ´ċˆ§‚‚€Œƒĵ€èĦ¨è¨˜ĞŞ£Ĥ—† + // †Ş‚‰Ş„‚ˆ†Ğ‚˘‚Żƒ†‚£ƒ–Ş‚³ƒ³ƒƒĵƒƒ³ƒˆĉ•°ċ€¤ż‚’èĦ¨ç¤ş™‚‹‚ˆ†Ğ€showMixedValueŻċ¸¸ĞfalseĞ—ĤŠ + + // length + using (var check = new EditorGUI.ChangeCheckScope()) + { + var newSize = EditorGUILayout.Slider("Length", size.z, 0.0f, 2.0f); + ApplyMultiSelection(check.changed, undoName, x => x.SetSizeZ(newSize)); + } + + // radius + float lineHight = EditorGUIUtility.singleLineHeight; + + // start + { + Rect r = EditorGUILayout.GetControlRect(); + + // ƒİƒ™ƒĞ‚’ĉç”ğ + var positionA = EditorGUI.PrefixLabel(r, GUIUtility.GetControlID(FocusType.Passive), new GUIContent(scr.radiusSeparation ? "Start Radius" : "Radius")); + + // çŸİċ½˘‚’è¨ˆç— + float w = positionA.width; + var buttonRect = new Rect(positionA.x + w - 30, r.y, 30, lineHight); + var sliderRect = new Rect(positionA.x, r.y, Mathf.Max(w - 35, 0), lineHight); + + // Slider + using (var check = new EditorGUI.ChangeCheckScope()) + { + var newSize = EditorGUI.Slider(sliderRect, size.x, 0.001f, 0.5f); + ApplyMultiSelection(check.changed, undoName, x => x.SetSizeX(newSize)); + } + + // ċˆ†ċ‰²ƒœ‚żƒ³ + if (GUI.Button(buttonRect, scr.radiusSeparation ? "X" : "S")) + { + // ċˆ‡‚Šĉ›żˆ + separationValue.boolValue = !separationValue.boolValue; + } + } + + // end + if (separationValue.boolValue) + { + Rect r = EditorGUILayout.GetControlRect(); + + // ƒİƒ™ƒĞ‚’ĉç”ğ + var positionA = EditorGUI.PrefixLabel(r, GUIUtility.GetControlID(FocusType.Passive), new GUIContent("End Radius")); + + // çŸİċ½˘‚’è¨ˆç— + float w = positionA.width; + var sliderRect = new Rect(positionA.x, r.y, Mathf.Max(w - 35, 0), lineHight); + + // Slider + using (var check = new EditorGUI.ChangeCheckScope()) + { + var newSize = EditorGUI.Slider(sliderRect, size.y, 0.001f, 0.5f); + ApplyMultiSelection(check.changed, undoName, x => x.SetSizeY(newSize)); + } + } + + // center + EditorGUILayout.PropertyField(serializedObject.FindProperty("center")); + + // Symmetry + EditorGUILayout.Space(); + var symmetryModeProperty = serializedObject.FindProperty("symmetryMode"); + EditorGUILayout.PropertyField(symmetryModeProperty); + if (symmetryModeProperty.enumValueIndex >= (int)ColliderSymmetryMode.AutomaticTarget) + EditorGUILayout.PropertyField(serializedObject.FindProperty("symmetryTarget")); + + serializedObject.ApplyModifiedProperties(); + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaCapsuleColliderEditor.cs.meta b/Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaCapsuleColliderEditor.cs.meta new file mode 100644 index 00000000..b53a0f5d --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaCapsuleColliderEditor.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 89239f89e837c394ca8ebe2515680a5e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaCapsuleColliderEditor.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaClothEditor.cs b/Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaClothEditor.cs new file mode 100644 index 00000000..6a0e6ec4 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaClothEditor.cs @@ -0,0 +1,951 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using UnityEditor; +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// MagicaCloth‚³ƒ³ƒƒĵƒƒ³ƒˆ‚¨ƒ‡‚£‚żĉ‹Ħċĵµ + /// + [CustomEditor(typeof(MagicaCloth))] + [CanEditMultipleObjects] + public class MagicaClothEditor : MagicaEditorBase + { + + protected void OnEnable() + { + //Debug.Log("MagicaClothEditor.OnEnable"); + ClothEditorManager.OnEditMeshBuildComplete += OnEditMeshBuildComplete; + } + + protected void OnDisable() + { + //Debug.Log("MagicaClothEditor.OnDisable"); + ClothEditorManager.OnEditMeshBuildComplete -= OnEditMeshBuildComplete; + ClothPainter.ExitPaint(); + } + + //========================================================================================= + int oldAcitve = -1; + + //========================================================================================= + /// + /// 編集用‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚ż‚’ċ–ċ—™‚‹ + /// + /// + /// + /// + public SelectionData GetSelectionData(MagicaCloth cloth, VirtualMesh editMesh) + { + // ™§Ğ‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚żŒċ­˜ċœ¨—€‹¤ƒĤƒĵ‚ĥƒĵ編集ƒ‡ƒĵ‚żŞ‚‰°‚³ƒ³ƒƒĵƒˆ™‚‹ + var selectionData = ClothEditorManager.CreateAutoSelectionData(cloth, cloth.SerializeData, editMesh); + if (cloth.GetSerializeData2().selectionData != null && cloth.GetSerializeData2().selectionData.userEdit) + { + //Debug.Log($"‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚ż‚³ƒ³ƒƒĵƒˆ!"); + selectionData.ConvertFrom(cloth.GetSerializeData2().selectionData); + selectionData.userEdit = true; + } + + return selectionData; + } + + /// + /// ‚¨ƒ‡‚£ƒƒƒˆƒĦƒƒ‚·ƒĉ§‹ç݉ċŒäş†é€šçŸïĵˆĉˆċĤċ•‚šïĵ‰ + /// + void OnEditMeshBuildComplete() + { + //Debug.Log($"MagicaClothInspector. OnEditMeshBuildComplete."); + Repaint(); + } + + /// + /// ‚¤ƒ³‚ıƒš‚Ż‚żƒĵGUI + /// + public override void OnInspectorGUI() + { + var cloth = target as MagicaCloth; + + // çŠĥĉ…‹ + DispVersion(); + DispStatus(); + DispProxyMesh(); + + // 設ċš + serializedObject.Update(); + Undo.RecordObject(cloth, "MagicaCloth2"); + EditorGUILayout.Space(); + ClothMainInspector(); + EditorGUILayout.Space(); + EditorGUILayout.Space(); + EditorGUILayout.Space(); + EditorGUILayout.Space(); + EditorGUILayout.Space(); + ClothParameterInspector(); + EditorGUILayout.Space(); + EditorGUILayout.Space(); + GizmoInspector(); + EditorGUILayout.Space(); + ClothPreBuildInspector(); + serializedObject.ApplyModifiedProperties(); + + //DrawDefaultInspector(); + + // ‚˘‚Żƒ†‚£ƒ–Œċ¤‰ĉ›´•‚ŒŸċ ´ċˆŻç·¨é›†ƒĦƒƒ‚·ƒ‚’ċ†ĉ§‹ç݉™‚‹ + int nowActive = cloth.isActiveAndEnabled ? 1 : 0; + if (nowActive != oldAcitve) + { + oldAcitve = nowActive; + + // Ÿ —‚³ƒ³ƒƒĵƒƒ³ƒˆŒProjectƒ“ƒƒĵ§é¸ĉŠž•‚ŒĤ„‚‹ċ ´ċˆŻċ†ĉ§‹ç݉—Ş„ + // HierarchyŠ‚ˆ³ƒ—ƒĴƒƒ–ƒ˘ƒĵƒ‰Ż“‚ŒĞèݲċ½“—Ş„ +#if UNITY_6000_3_OR_NEWER + bool inProject = AssetDatabase.Contains(cloth.gameObject.GetEntityId()); +#else + bool inProject = AssetDatabase.Contains(cloth.gameObject.GetInstanceID()); +#endif + if (inProject == false) + { + //Develop.Log($"[{cloth.name}] rebuild. active:{nowActive}, inProject:{inProject}"); + ClothEditorManager.RegisterComponent(cloth, nowActive > 0 ? GizmoType.Active : 0, true); + } + } + } + + /// + /// ‚Żƒ­‚ıƒš‚¤ƒ³ƒˆéİ用 + /// + /// + internal void ApplyClothPainter(SelectionData selectionData) + { + if (selectionData == null || selectionData.IsValid() == false) + return; + + var cloth = target as MagicaCloth; + + // ‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚żĉ ĵ納 + ClothEditorManager.ApplySelectionData(cloth, selectionData); + } + + /// + /// ‚Żƒ­‚ıƒš‚¤ƒ³ƒˆċ¤‰ĉ›´Ğ‚ˆ‚‹ç·¨é›†ƒĦƒƒ‚·ƒċ†ĉ§‹ç݉ + /// + internal void UpdateEditMesh() + { + var cloth = target as MagicaCloth; + + // 編集用ƒĦƒƒ‚·ƒċ†ĉ§‹ç݉ + ClothEditorManager.RegisterComponent(cloth, GizmoType.Active, true); // ċĵ·ċˆĥĉ›´ĉ–° + } + + //========================================================================================= + void DispVersion() + { + EditorGUILayout.LabelField($"Version {AboutMenu.MagicaClothVersion}"); + } + + void DispStatus() + { + var cloth = target as MagicaCloth; + + if (EditorApplication.isPlaying) + { + StaticStringBuilder.Clear(); + StaticStringBuilder.AppendLine("[State]"); + StaticStringBuilder.Append(cloth.Process.IsState(ClothProcess.State_UsePreBuild) ? "Pre-Build Construction" : "Runtime Construction"); + DispClothStatus(StaticStringBuilder.ToString(), cloth.Process.Result, true); + } + else + { + var result = ClothEditorManager.GetResultCode(cloth); + var preBuildData = cloth.GetSerializeData2().preBuildData; + if (preBuildData.enabled) + { + // pre-build + if (result.IsError() == false) + result = preBuildData.DataValidate(); + DispClothStatus("[Pre-Build Construction]", result, false); + } + else + { + // runtime + DispClothStatus("[Runtime Construction]", result, true); + } + } + } + + void DispClothStatus(string title, ResultCode result, bool dispWarning) + { + StaticStringBuilder.Clear(); + StaticStringBuilder.AppendLine(title); + + // normal / error + MessageType mtype = MessageType.Info; + if (result.IsError()) + mtype = MessageType.Error; + var infoMessage = result.GetResultInformation(); + if (infoMessage != null) + { + StaticStringBuilder.AppendLine(result.GetResultString()); + StaticStringBuilder.AppendLine(infoMessage); + } + else + { + StaticStringBuilder.AppendLine(result.GetResultString()); + } + EditorGUILayout.HelpBox(StaticStringBuilder.ToString(), mtype); + + // warning + if (dispWarning && result.IsWarning()) + { + mtype = MessageType.Warning; + infoMessage = result.GetWarningInformation(); + if (infoMessage != null) + EditorGUILayout.HelpBox($"{result.GetWarningString()}\n{infoMessage}", mtype); + else + EditorGUILayout.HelpBox(result.GetWarningString(), mtype); + } + } + + void DispProxyMesh() + { + var cloth = target as MagicaCloth; + + VirtualMeshContainer cmesh; + if (EditorApplication.isPlaying) + { + cmesh = cloth.Process?.ProxyMeshContainer; + } + else + { + cmesh = ClothEditorManager.GetEditMeshContainer(cloth); + } + if (cmesh == null || cmesh.shareVirtualMesh == null) + return; + + var vmesh = cmesh.shareVirtualMesh; + + StaticStringBuilder.Clear(); + + // ċˆĉœŸċŒ–ƒ‡ƒĵ‚ż + StaticStringBuilder.AppendLine("[Init Data]"); + int initVersion = cloth.GetSerializeData2().initData?.initVersion ?? 0; + if (initVersion > 0) + { + StaticStringBuilder.Append($"v{initVersion}: "); + } + if (EditorApplication.isPlaying) + { + StaticStringBuilder.Append($"{cloth.Process.InitDataResult.GetResultString()}"); + } + else + { + StaticStringBuilder.Append($"{cloth.GetSerializeData2().initData.HasData()}"); + } + + // ProxyƒĦƒƒ‚·ƒ + StaticStringBuilder.AppendLine(); + if (EditorApplication.isPlaying) + StaticStringBuilder.AppendLine("[Proxy Mesh]"); + else + StaticStringBuilder.AppendLine("[Edit Mesh]"); + if (EditorApplication.isPlaying) + { + StaticStringBuilder.AppendLine($"Camera Visible: {!cloth.Process.IsCameraCullingInvisible()}"); + StaticStringBuilder.AppendLine($"Distance Visible: {!cloth.Process.IsDistanceCullingInvisible()}"); + } + StaticStringBuilder.AppendLine($"Vertex: {vmesh.VertexCount}"); + StaticStringBuilder.AppendLine($"Edge: {vmesh.EdgeCount}"); + StaticStringBuilder.AppendLine($"Triangle: {vmesh.TriangleCount}"); + StaticStringBuilder.AppendLine($"SkinBoneCount: {vmesh.SkinBoneCount}"); + StaticStringBuilder.Append($"TransformCount: {cmesh.GetTransformCount()}"); + + + EditorGUILayout.HelpBox(StaticStringBuilder.ToString(), MessageType.Info); + } + + + void ClothMainInspector() + { + var cloth = target as MagicaCloth; + var clothType = cloth.SerializeData.clothType; + bool isBoneSpring = clothType == ClothProcess.ClothType.BoneSpring; + + bool runtime = EditorApplication.isPlaying; + + // ċŒĉœŸçŠĥĉ…‹ + bool sync = EditorApplication.isPlaying && cloth.SyncPartnerCloth != null; + + EditorGUILayout.LabelField("Main", EditorStyles.boldLabel); + + // Cloth + { + var clothTypeProperty = serializedObject.FindProperty("serializeData.clothType"); + + using (new EditorGUI.DisabledScope(runtime)) + { + EditorGUILayout.PropertyField(clothTypeProperty, new GUIContent("Cloth Type")); + } + + var paintMode = serializedObject.FindProperty("serializeData.paintMode"); + + using (new EditorGUI.IndentLevelScope()) + { + if (clothType == ClothProcess.ClothType.BoneCloth) + { + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.rootBones")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.connectionMode")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.rootRotation")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.rotationalInterpolation")); + } + else if (clothType == ClothProcess.ClothType.BoneSpring) + { + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.rootBones")); + // BoneSpring§ŻĉŽçĥšƒ˘ƒĵƒ‰ŻĉŒ‡ċš•›Ş„€‚ċ†…部§ŻLine§ċ›şċš•‚Œ‚‹€‚ + using (new EditorGUILayout.HorizontalScope()) + { + EditorGUILayout.LabelField("ConnectionMode"); + EditorGUILayout.LabelField("[Line]"); + } + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.rootRotation")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.rotationalInterpolation")); + } + else if (clothType == ClothProcess.ClothType.MeshCloth) + { + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.sourceRenderers")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.meshWriteMode")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.reductionSetting")); + } + + EditorGUILayout.Space(); + if (sync == false) + { + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.updateMode")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.disableMode")); + } + else + { + // ċŒĉœŸä¸­Żĉ“ä½œä¸ċŻ + using (new EditorGUI.DisabledScope(true)) + { + using (new EditorGUILayout.HorizontalScope()) + { + EditorGUILayout.LabelField("Update Mode"); + EditorGUILayout.LabelField("(Synchronizing)"); + } + using (new EditorGUILayout.HorizontalScope()) + { + EditorGUILayout.LabelField("Disable Mode"); + EditorGUILayout.LabelField("(Synchronizing)"); + } + } + } + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.animationPoseRatio")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.blendWeight")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.normalAxis")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.normalAlignmentSetting.alignmentMode"), new GUIContent("Normal Alignment")); + if (cloth.SerializeData.normalAlignmentSetting.alignmentMode == NormalAlignmentSettings.AlignmentMode.Transform) + { + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.normalAlignmentSetting.adjustmentTransform")); + } + + if (clothType == ClothProcess.ClothType.MeshCloth) + { + EditorGUILayout.Space(); + EditorGUILayout.PropertyField(paintMode); + if (paintMode.enumValueIndex != 0) + { + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.paintMaps")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.paintMapUvChannel")); + } + } + } + + // ƒš‚¤ƒ³ƒˆƒœ‚żƒ³ + if (paintMode.enumValueIndex == 0) + { + EditorGUILayout.Space(); + PaintButton(ClothPainter.PaintMode.Attribute); + } + else + EditorGUILayout.Space(); + } + + // Custom Skinning + if (isBoneSpring == false) + { + Foldout("Custom Skinning", serializedObject.FindProperty("serializeData.customSkinningSetting.enable"), null, () => + { + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.customSkinningSetting.skinningBones")); + }); + } + + // Culling + Foldout("Culling", null, () => + { + if (sync == false) + { + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.cullingSettings.cameraCullingMode")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.cullingSettings.cameraCullingMethod")); + if (cloth.SerializeData.cullingSettings.cameraCullingMethod == CullingSettings.CameraCullingMethod.ManualRenderer) + { + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.cullingSettings.cameraCullingRenderers")); + } + EditorGUILayout.Space(); + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.cullingSettings.distanceCullingLength")); + using (new EditorGUI.DisabledScope(cloth.SerializeData.cullingSettings.distanceCullingLength.use == false)) + { + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.cullingSettings.distanceCullingFadeRatio")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.cullingSettings.distanceCullingReferenceObject")); + EditorGUILayout.HelpBox("If Reference Object is [None], the main camera is referred.", MessageType.None); + } + } + else + { + // ċŒĉœŸä¸­Żĉ“ä½œä¸ċŻ + using (new EditorGUI.DisabledScope(true)) + { + using (new EditorGUILayout.HorizontalScope()) + { + EditorGUILayout.LabelField("Camera Culling Mode"); + EditorGUILayout.LabelField("(Synchronizing)"); + } + using (new EditorGUILayout.HorizontalScope()) + { + EditorGUILayout.LabelField("Camera Culling Method"); + EditorGUILayout.LabelField("(Synchronizing)"); + } + using (new EditorGUILayout.HorizontalScope()) + { + EditorGUILayout.LabelField("Distance Culling Length"); + EditorGUILayout.LabelField("(Synchronizing)"); + } + using (new EditorGUILayout.HorizontalScope()) + { + EditorGUILayout.LabelField("Distance Culling Fade Ratio"); + EditorGUILayout.LabelField("(Synchronizing)"); + } + using (new EditorGUILayout.HorizontalScope()) + { + EditorGUILayout.LabelField("Distance Culling Reference Object"); + EditorGUILayout.LabelField("(Synchronizing)"); + } + } + } + }); + } + + void ClothPreBuildInspector() + { + var cloth = target as MagicaCloth; + + bool generation = false; + + using (new EditorGUI.DisabledScope(EditorApplication.isPlaying)) + { + Foldout("Pre-Build", serializedObject.FindProperty("serializeData2.preBuildData.enabled"), null, () => + { + // information + var preBuildData = cloth.GetSerializeData2().preBuildData; + if (preBuildData.UsePreBuild()) + { + DispClothStatus("[Pre-Build Construction]", preBuildData.DataValidate(), false); + } + + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData2.preBuildData.buildId"), new GUIContent("Build ID")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData2.preBuildData.preBuildScriptableObject"), new GUIContent("Write Object")); + using (var horizontalScope = new GUILayout.HorizontalScope()) + { + EditorGUILayout.Space(); + GUI.backgroundColor = Color.red; + if (GUILayout.Button("Create PreBuild Data")) + { + generation = true; + } + GUI.backgroundColor = Color.white; + EditorGUILayout.Space(); + } + }); + } + + if (generation) + { + // PreBuildƒ‡ƒĵ‚żĉ§‹ç݉ċŸèĦŒ + Develop.Log($"Start PreBuild data creation."); + var preBuildResult = PreBuildDataCreation.CreatePreBuildData(cloth); + Develop.Log($"PreBuild data creation completed. [{cloth.GetSerializeData2().preBuildData.buildId}] : {preBuildResult.GetResultString()}"); + } + } + + void ClothParameterInspector() + { + var cloth = target as MagicaCloth; + var clothType = cloth.SerializeData.clothType; + bool isBoneSpring = clothType == ClothProcess.ClothType.BoneSpring; + + // ċŒĉœŸçŠĥĉ…‹ + bool sync = EditorApplication.isPlaying && cloth.SyncPartnerCloth != null; + + ClothPresetUtility.DrawPresetButton(cloth, cloth.SerializeData); + + // Force + Foldout("Force", null, () => + { + if (isBoneSpring == false) + { + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.gravity"), new GUIContent("Gravity")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.gravityDirection")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.gravityFalloff")); + } + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.damping")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.stablizationTimeAfterReset"), new GUIContent("Stablization Time")); + }); + + // Spring + if (isBoneSpring) + { + Foldout("Spring", serializedObject.FindProperty("serializeData.springConstraint.useSpring"), null, () => + { + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.springConstraint.springPower")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.springConstraint.limitDistance")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.springConstraint.normalLimitRatio")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.springConstraint.springNoise")); + }); + } + + // Angle Restoration + Foldout("Angle Restoration", serializedObject.FindProperty("serializeData.angleRestorationConstraint.useAngleRestoration"), null, () => + { + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.angleRestorationConstraint.stiffness")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.angleRestorationConstraint.velocityAttenuation")); + if (isBoneSpring == false) + { + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.angleRestorationConstraint.gravityFalloff")); + } + } + ); + + // Angle Limit + Foldout("Angle Limit", serializedObject.FindProperty("serializeData.angleLimitConstraint.useAngleLimit"), null, () => + { + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.angleLimitConstraint.limitAngle")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.angleLimitConstraint.stiffness")); + } + ); + + // Shape + // BoneSpring§Ż™ıĤċšĉ•°Ş§éš è”½™‚‹ + if (isBoneSpring == false) + { + Foldout("Shape Restoration", null, () => + { + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.distanceConstraint.stiffness"), new GUIContent("Distance Stiffness")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.tetherConstraint.distanceCompression"), new GUIContent("Tether Compression")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.triangleBendingConstraint.stiffness"), new GUIContent("Triangle Bending Stiffness")); + }); + } + + // Inertia + Foldout("Inertia", null, () => + { + if (sync == false) + { + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.inertiaConstraint.anchor")); + if (cloth.SerializeData.inertiaConstraint.anchor != null) + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.inertiaConstraint.anchorInertia")); + EditorGUILayout.Space(); + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.inertiaConstraint.worldInertia")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.inertiaConstraint.movementInertiaSmoothing"), new GUIContent("World Inertia Smoothing")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.inertiaConstraint.movementSpeedLimit"), new GUIContent("World Movement Speed Limit")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.inertiaConstraint.rotationSpeedLimit"), new GUIContent("World Rotation Speed Limit")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.inertiaConstraint.teleportMode")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.inertiaConstraint.teleportDistance")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.inertiaConstraint.teleportRotation")); + } + else + { + // ċŒĉœŸä¸­Żĉ“ä½œä¸ċŻ + using (new EditorGUI.DisabledScope(true)) + { + using (new EditorGUILayout.HorizontalScope()) + { + EditorGUILayout.LabelField("Anchor"); + EditorGUILayout.LabelField("(Synchronizing)"); + } + using (new EditorGUILayout.HorizontalScope()) + { + EditorGUILayout.LabelField("Anchor Inertia"); + EditorGUILayout.LabelField("(Synchronizing)"); + } + EditorGUILayout.Space(); + using (new EditorGUILayout.HorizontalScope()) + { + EditorGUILayout.LabelField("World Inertia"); + EditorGUILayout.LabelField("(Synchronizing)"); + } + using (new EditorGUILayout.HorizontalScope()) + { + EditorGUILayout.LabelField("World Inertia Smoothing"); + EditorGUILayout.LabelField("(Synchronizing)"); + } + using (new EditorGUILayout.HorizontalScope()) + { + EditorGUILayout.LabelField("World Movement Speed Limit"); + EditorGUILayout.LabelField("(Synchronizing)"); + } + using (new EditorGUILayout.HorizontalScope()) + { + EditorGUILayout.LabelField("World Rotation Speed Limit"); + EditorGUILayout.LabelField("(Synchronizing)"); + } + + using (new EditorGUILayout.HorizontalScope()) + { + EditorGUILayout.LabelField("Teleport Mode"); + EditorGUILayout.LabelField("(Synchronizing)"); + } + using (new EditorGUILayout.HorizontalScope()) + { + EditorGUILayout.LabelField("Teleport Distance"); + EditorGUILayout.LabelField("(Synchronizing)"); + } + using (new EditorGUILayout.HorizontalScope()) + { + EditorGUILayout.LabelField("Teleport Rotation"); + EditorGUILayout.LabelField("(Synchronizing)"); + } + } + } + EditorGUILayout.Space(); + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.inertiaConstraint.localInertia"), new GUIContent("Local Inertia")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.inertiaConstraint.localMovementSpeedLimit")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.inertiaConstraint.localRotationSpeedLimit")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.inertiaConstraint.depthInertia"), new GUIContent("Local Depth Inertia")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.inertiaConstraint.centrifualAcceleration")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.inertiaConstraint.particleSpeedLimit")); + }); + + // Motion + if (isBoneSpring == false) + { + Foldout("Movement Limit", null, () => + { + var useMaxDistance = serializedObject.FindProperty("serializeData.motionConstraint.useMaxDistance"); + var useBackstop = serializedObject.FindProperty("serializeData.motionConstraint.useBackstop"); + EditorGUILayout.PropertyField(useMaxDistance); + using (new EditorGUI.DisabledScope(!useMaxDistance.boolValue)) + { + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.motionConstraint.maxDistance")); + } + EditorGUILayout.PropertyField(useBackstop); + using (new EditorGUI.DisabledScope(!useBackstop.boolValue)) + { + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.motionConstraint.backstopRadius")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.motionConstraint.backstopDistance")); + } + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.motionConstraint.stiffness")); + + var paintMode = serializedObject.FindProperty("serializeData.paintMode"); + if (paintMode.enumValueIndex == 0) + PaintButton(ClothPainter.PaintMode.Motion); + } + ); + } + + // Collider Collision + Foldout("Collider Collision", null, () => + { + if (isBoneSpring) + { + using (new EditorGUILayout.HorizontalScope()) + { + EditorGUILayout.LabelField("Mode"); + EditorGUILayout.LabelField("[Point]"); + } + } + else + { + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.colliderCollisionConstraint.mode")); + } + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.radius")); + if (clothType == ClothProcess.ClothType.BoneSpring) + { + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.colliderCollisionConstraint.limitDistance")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.colliderCollisionConstraint.collisionBones")); + } + else + { + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.colliderCollisionConstraint.friction")); + } + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.colliderCollisionConstraint.colliderList")); + } + ); + + // Self Collision + if (isBoneSpring == false) + { + Foldout("Self Collision", "Self Collision (Beta2)", () => + { + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.selfCollisionConstraint.selfMode")); + var syncMode = serializedObject.FindProperty("serializeData.selfCollisionConstraint.syncMode"); + EditorGUILayout.PropertyField(syncMode); + if (syncMode.enumValueIndex != 0) + { + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.selfCollisionConstraint.syncPartner")); + } + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.selfCollisionConstraint.surfaceThickness")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.selfCollisionConstraint.clothMass")); + } + ); + } + + // Wind + Foldout("Wind", null, () => + { + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.wind.influence")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.wind.frequency")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.wind.turbulence")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.wind.blend"), new GUIContent("Noise Blend")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.wind.synchronization")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.wind.depthWeight")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("serializeData.wind.movingWind")); + }); + } + + /// + /// ċ„ƒ—ƒ­ƒ‘ƒ†‚£è¨­ċšçŻ„ċ›².ƒ‡ƒ•‚݃ЃˆŻ(0.0 ~ 1.0) + /// + /// + /// + public static Vector2 GetPropertyMinMax(string propertyName) + { + var minmax = new Vector2(0.0f, 1.0f); + + switch (propertyName) + { + case "radius": + minmax.Set(0.001f, 0.5f); + break; + case "limitAngle": + minmax.Set(0.0f, 180.0f); + break; + case "maxDistance": + minmax.Set(0.0f, 5.0f); + break; + case "surfaceThickness": + minmax.Set(Define.System.SelfCollisionThicknessMin, Define.System.SelfCollisionThicknessMax); + break; + case "movementSpeedLimit": + case "localMovementSpeedLimit": + minmax.Set(0.0f, Define.System.MaxMovementSpeedLimit); + break; + case "rotationSpeedLimit": + case "localRotationSpeedLimit": + minmax.Set(0.0f, Define.System.MaxRotationSpeedLimit); + break; + case "particleSpeedLimit": + minmax.Set(0.0f, Define.System.MaxParticleSpeedLimit); + break; + case "distanceCullingLength": + minmax.Set(0.0f, Define.System.DistanceCullingMaxLength); + break; + } + + return minmax; + } + + void GizmoInspector() + { +#if MC2_DEBUG + EditorGUILayout.PropertyField(serializedObject.FindProperty("gizmoSerializeData")); +#else + FoldOut("Gizmos", null, () => + { + EditorGUILayout.PropertyField(serializedObject.FindProperty("gizmoSerializeData.always")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("gizmoSerializeData.clothDebugSettings.enable")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("gizmoSerializeData.clothDebugSettings.ztest")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("gizmoSerializeData.clothDebugSettings.position")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("gizmoSerializeData.clothDebugSettings.axis")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("gizmoSerializeData.clothDebugSettings.shape")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("gizmoSerializeData.clothDebugSettings.baseLine")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("gizmoSerializeData.clothDebugSettings.depth")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("gizmoSerializeData.clothDebugSettings.collider")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("gizmoSerializeData.clothDebugSettings.animatedPosition")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("gizmoSerializeData.clothDebugSettings.animatedAxis")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("gizmoSerializeData.clothDebugSettings.animatedShape")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("gizmoSerializeData.clothDebugSettings.inertiaCenter")); + //EditorGUILayout.PropertyField(serializedObject.FindProperty("gizmoSerializeData.clothDebugSettings.basicPosition")); + //EditorGUILayout.PropertyField(serializedObject.FindProperty("gizmoSerializeData.clothDebugSettings.basicAxis")); + //EditorGUILayout.PropertyField(serializedObject.FindProperty("gizmoSerializeData.clothDebugSettings.basicShape")); + }); +#endif + } + + //========================================================================================= + /// + /// ĉŠ˜‚ЁŸŸżċˆĥċĦ + /// + /// ĉŠ˜‚ЁŸŸżäżċ­˜‚­ƒĵ + /// + /// ċ†…ċıĉç”ğ‚˘‚Ż‚·ƒ§ƒ³ + /// ĉœ‰ċŠıƒ•ƒİ‚°‚˘‚Ż‚·ƒ§ƒ³(null=ç„ĦċŠı) + /// çċœ¨ĉœ‰ċŠıƒ•ƒİ‚° + public void Foldout( + string foldKey, + string title = null, + System.Action drawAct = null, + System.Action enableAct = null, + bool enable = true + ) + { + var style = new GUIStyle("ShurikenModuleTitle"); + style.font = new GUIStyle(EditorStyles.label).font; + style.border = new RectOffset(15, 7, 4, 4); + style.fixedHeight = 22; + style.contentOffset = new Vector2(20f, -2f); + + var rect = GUILayoutUtility.GetRect(16f, 22f, style); + + GUI.backgroundColor = Color.white; + GUI.Box(rect, title ?? foldKey, style); + + var e = Event.current; + bool foldOut = EditorPrefs.GetBool(foldKey); + + if (enableAct == null) + { + if (e.type == EventType.Repaint) + { + var arrowRect = new Rect(rect.x + 4f, rect.y + 2f, 13f, 13f); + EditorStyles.foldout.Draw(arrowRect, false, false, foldOut, false); + } + } + else + { + // ĉœ‰ċŠıƒ‚§ƒƒ‚Ż + var toggleRect = new Rect(rect.x + 4f, rect.y + 4f, 13f, 13f); + bool sw = GUI.Toggle(toggleRect, enable, string.Empty, new GUIStyle("ShurikenCheckMark")); + if (sw != enable) + { + enableAct(sw); + } + } + + if (e.type == EventType.MouseDown && rect.Contains(e.mousePosition)) + { + foldOut = !foldOut; + EditorPrefs.SetBool(foldKey, foldOut); + e.Use(); + } + + if (foldOut && drawAct != null) + { + using (new EditorGUI.IndentLevelScope()) + { + using (new EditorGUI.DisabledScope(!enable)) + { + drawAct(); + } + } + } + } + + /// + /// ĉŠ˜‚ЁŸŸżċˆĥċĦïĵˆBoolƒ—ƒ­ƒ‘ƒ†‚£Ğ‚ˆ‚‹ƒ‚§ƒƒ‚݁‚‚Šïĵ‰ + /// + /// + /// + /// + /// + public void Foldout( + string foldKey, + SerializedProperty boolProperty, + string title = null, + System.Action drawAct = null + ) + { + Foldout( + foldKey, title, drawAct, + (sw) => boolProperty.boolValue = sw, + boolProperty.boolValue + ); + } + + void FoldOut(string key, string title = null, System.Action drawAct = null) + { + bool foldOut1 = EditorPrefs.GetBool(key); + bool foldOut2 = EditorGUILayout.Foldout(foldOut1, title ?? key); + if (foldOut2) + { + using (new EditorGUI.IndentLevelScope()) + { + drawAct?.Invoke(); + } + } + if (foldOut1 != foldOut2) + { + EditorPrefs.SetBool(key, foldOut2); + } + } + + void PaintButton(ClothPainter.PaintMode paintMode) + { + if (EditorApplication.isPlaying) + return; + + var cloth = target as MagicaCloth; + + using (new EditorGUILayout.HorizontalScope()) + { + switch (paintMode) + { + case ClothPainter.PaintMode.Attribute: + GUI.backgroundColor = new Color(0.5f, 1.0f, 0.5f); + break; + case ClothPainter.PaintMode.Motion: + GUI.backgroundColor = new Color(0.0f, 1.0f, 1.0f); + break; + } + + EditorGUILayout.Space(); + + bool edit = ClothPainter.HasEditCloth(cloth); + //var icon = edit ? EditorGUIUtility.IconContent("winbtn_win_close") : EditorGUIUtility.IconContent("d_editicon.sml"); + //var icon = EditorGUIUtility.IconContent("d_Grid.PaintTool");// è‰Ż„ + var icon = EditorGUIUtility.IconContent("d_editicon.sml"); + if (GUILayout.Button(icon, GUILayout.Width(40))) + { + if (edit == false) + { + // ĉœ€ĉ–°ç·¨é›†ƒĦƒƒ‚·ƒ‹‚‰‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚ż‚’生ĉˆ™‚‹ + var editMeshContainer = ClothEditorManager.GetEditMeshContainer(cloth); + if (editMeshContainer != null && editMeshContainer.shareVirtualMesh != null) + { + // ™§Ğ‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚żŒċ­˜ċœ¨—€‹¤ƒĤƒĵ‚ĥƒĵ編集ƒ‡ƒĵ‚żŞ‚‰°‚³ƒ³ƒƒĵƒˆ™‚‹ + var selectionData = GetSelectionData(cloth, editMeshContainer.shareVirtualMesh); + + // ‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚żĞƒĦƒƒ‚·ƒĉœ€ċ¤§ĉŽçĥšè·é›˘‚’記録™‚‹ + selectionData.maxConnectionDistance = editMeshContainer.shareVirtualMesh.maxVertexDistance.Value; + + // ƒš‚¤ƒ³ƒˆé–‹ċ§‹ + ClothPainter.EnterPaint(paintMode, this, cloth, editMeshContainer, selectionData); + SceneView.RepaintAll(); + } + } + else + { + // ċˆĉœŸċŒ–ƒ‡ƒĵ‚żäżċ­˜ç˘şèލ + ClothEditorManager.ApplyInitData(cloth, global: true); + + ClothPainter.ExitPaint(); + SceneView.RepaintAll(); + } + } + EditorGUILayout.Space(); + GUI.backgroundColor = Color.white; + } + EditorGUILayout.Space(10); + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaClothEditor.cs.meta b/Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaClothEditor.cs.meta new file mode 100644 index 00000000..a7017b9f --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaClothEditor.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: a43a416802744754899e8dc139f244c7 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaClothEditor.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaEditorBase.cs b/Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaEditorBase.cs new file mode 100644 index 00000000..f8d7ece3 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaEditorBase.cs @@ -0,0 +1,40 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2024 MagicaSoft. +// https://magicasoft.jp +using System; +using UnityEditor; + +namespace MagicaCloth2 +{ + /// + /// ‚¤ƒ³‚ıƒš‚Ż‚żƒĵĉ‹Ħċĵµƒ™ƒĵ‚ı‚Żƒİ‚ı + /// + public class MagicaEditorBase : Editor + { + /// + /// ƒžƒĞƒé¸ĉŠžç·¨é›†éİ用 + /// + /// + /// + /// + protected void ApplyMultiSelection(bool changed, string undoName, Action act) where T : ClothBehaviour + { + if (changed) + { + foreach (var obj in targets) + { + var tscr = obj as T; + + // Undo + Undo.RecordObject(tscr, undoName); + + act(tscr); + EditorUtility.SetDirty(tscr); + + // OnValidate()ĉ‰‹ċ‹•ċ‘ĵ³ċ‡ş— + tscr.GetType().GetMethod("OnValidate", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance)?.Invoke(tscr, null); + } + } + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaEditorBase.cs.meta b/Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaEditorBase.cs.meta new file mode 100644 index 00000000..7be2ad8d --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaEditorBase.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 3126cd1eb42b4af4aa38cea3c3836c3e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaEditorBase.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaPlaneColliderEditor.cs b/Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaPlaneColliderEditor.cs new file mode 100644 index 00000000..f801a448 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaPlaneColliderEditor.cs @@ -0,0 +1,35 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using UnityEditor; + +namespace MagicaCloth2 +{ + /// + /// PlaneCollider‚¤ƒ³‚ıƒš‚Ż‚żƒĵĉ‹Ħċĵµ + /// + [CustomEditor(typeof(MagicaPlaneCollider))] + [CanEditMultipleObjects] + public class MagicaPlaneColliderEditor : MagicaEditorBase + { + public override void OnInspectorGUI() + { + var scr = target as MagicaPlaneCollider; + + serializedObject.Update(); + Undo.RecordObject(scr, "PlaneCollider"); + + // center + EditorGUILayout.PropertyField(serializedObject.FindProperty("center")); + + // Symmetry + EditorGUILayout.Space(); + var symmetryModeProperty = serializedObject.FindProperty("symmetryMode"); + EditorGUILayout.PropertyField(symmetryModeProperty); + if (symmetryModeProperty.enumValueIndex >= (int)ColliderSymmetryMode.AutomaticTarget) + EditorGUILayout.PropertyField(serializedObject.FindProperty("symmetryTarget")); + + serializedObject.ApplyModifiedProperties(); + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaPlaneColliderEditor.cs.meta b/Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaPlaneColliderEditor.cs.meta new file mode 100644 index 00000000..0c9d4f6d --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaPlaneColliderEditor.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 7c2eaf60c91e70a4198cb71bbaf68678 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaPlaneColliderEditor.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaSettingsEditor.cs b/Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaSettingsEditor.cs new file mode 100644 index 00000000..b6e7d4e5 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaSettingsEditor.cs @@ -0,0 +1,37 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using UnityEditor; + +namespace MagicaCloth2 +{ + [CustomEditor(typeof(MagicaSettings))] + [CanEditMultipleObjects] + public class MagicaSettingsEditor : MagicaEditorBase + { + //========================================================================================= + /// + /// ‚¤ƒ³‚ıƒš‚Ż‚żƒĵGUI + /// + public override void OnInspectorGUI() + { + var comp = target as MagicaSettings; + + serializedObject.Update(); + Undo.RecordObject(comp, "MagicaSettings"); + SettingsInspector(); + serializedObject.ApplyModifiedProperties(); + } + + void SettingsInspector() + { + EditorGUILayout.PropertyField(serializedObject.FindProperty("refreshMode")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("simulationFrequency")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("maxSimulationCountPerFrame")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("initializationLocation")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("updateLocation")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("monitorPlayerLoop")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("splitProxyMeshVertexCount")); + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaSettingsEditor.cs.meta b/Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaSettingsEditor.cs.meta new file mode 100644 index 00000000..dd89b2dc --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaSettingsEditor.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 53b8f563506b5fa4691d2d29c3d3c185 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaSettingsEditor.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaSphereColliderEditor.cs b/Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaSphereColliderEditor.cs new file mode 100644 index 00000000..f684c4a2 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaSphereColliderEditor.cs @@ -0,0 +1,50 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using UnityEditor; + +namespace MagicaCloth2 +{ + /// + /// SphereCollider‚¤ƒ³‚ıƒš‚Ż‚żƒĵĉ‹Ħċĵµ + /// + [CustomEditor(typeof(MagicaSphereCollider))] + [CanEditMultipleObjects] + public class MagicaSphereColliderEditor : MagicaEditorBase + { + public override void OnInspectorGUI() + { + var scr = target as MagicaSphereCollider; + const string undoName = "SphereCollider"; + + serializedObject.Update(); + Undo.RecordObject(scr, undoName); + + using (var check = new EditorGUI.ChangeCheckScope()) + { + + // radius + var sizeValue = serializedObject.FindProperty("size"); + + //EditorGUI.showMixedValue = sizeValue.hasMultipleDifferentValues; + var size = sizeValue.vector3Value; + float newSize = EditorGUILayout.Slider("Radius", size.x, 0.001f, 0.5f); + //EditorGUI.showMixedValue = false; + + ApplyMultiSelection(check.changed, undoName, x => x.SetSize(newSize)); + } + + // center + EditorGUILayout.PropertyField(serializedObject.FindProperty("center")); + + // Symmetry + EditorGUILayout.Space(); + var symmetryModeProperty = serializedObject.FindProperty("symmetryMode"); + EditorGUILayout.PropertyField(symmetryModeProperty); + if (symmetryModeProperty.enumValueIndex >= (int)ColliderSymmetryMode.AutomaticTarget) + EditorGUILayout.PropertyField(serializedObject.FindProperty("symmetryTarget")); + + serializedObject.ApplyModifiedProperties(); + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaSphereColliderEditor.cs.meta b/Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaSphereColliderEditor.cs.meta new file mode 100644 index 00000000..7d39c52a --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaSphereColliderEditor.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: d26018c2091e9054ea0bf517157ca1c6 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaSphereColliderEditor.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaWindZoneEditor.cs b/Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaWindZoneEditor.cs new file mode 100644 index 00000000..d579eefd --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaWindZoneEditor.cs @@ -0,0 +1,77 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using UnityEditor; +using UnityEngine; + +namespace MagicaCloth2 +{ + [CustomEditor(typeof(MagicaWindZone))] + [CanEditMultipleObjects] + public class MagicaWindZoneEditor : MagicaEditorBase + { + //========================================================================================= + /// + /// ‚¤ƒ³‚ıƒš‚Ż‚żƒĵGUI + /// + public override void OnInspectorGUI() + { + var wind = target as MagicaWindZone; + + serializedObject.Update(); + Undo.RecordObject(wind, "MagicaWindZone"); + + WindInspector(); + + serializedObject.ApplyModifiedProperties(); + } + + void WindInspector() + { + var wind = target as MagicaWindZone; + + var modeProperty = serializedObject.FindProperty("mode"); + EditorGUILayout.PropertyField(modeProperty); + + //var mode = (MagicaWindZone.Mode)modeProperty.enumValueIndex; + if (wind.mode == MagicaWindZone.Mode.SphereDirection || wind.mode == MagicaWindZone.Mode.SphereRadial) + { + var radiusProperty = serializedObject.FindProperty("radius"); + var radius = radiusProperty.floatValue; + float nr = EditorGUILayout.FloatField(new GUIContent("Radius"), radius); + nr = Mathf.Max(nr, 0.0f); + if (radius != nr) + { + radiusProperty.floatValue = nr; + } + } + else if (wind.mode == MagicaWindZone.Mode.BoxDirection) + { + var sizeProperty = serializedObject.FindProperty("size"); + var size = sizeProperty.vector3Value; + var ns = EditorGUILayout.Vector3Field(new GUIContent("Box Size"), size); + ns = Vector3.Max(ns, Vector3.zero); + if (size != ns) + { + sizeProperty.vector3Value = ns; + } + } + + EditorGUILayout.Space(); + + EditorGUILayout.PropertyField(serializedObject.FindProperty("main")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("turbulence")); + + if (wind.IsDirection()) + { + EditorGUILayout.PropertyField(serializedObject.FindProperty("directionAngleX")); + EditorGUILayout.PropertyField(serializedObject.FindProperty("directionAngleY")); + } + else + { + EditorGUILayout.CurveField(serializedObject.FindProperty("attenuation"), Color.green, new Rect(0, 0, 1, 1)); + } + EditorGUILayout.PropertyField(serializedObject.FindProperty("isAddition")); + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaWindZoneEditor.cs.meta b/Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaWindZoneEditor.cs.meta new file mode 100644 index 00000000..684b0d73 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaWindZoneEditor.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 56e75137613813345a058b4bb6748854 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Editor/Cloth/MagicaWindZoneEditor.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Editor/Cloth/VirtualMeshEditorUtility.cs b/Assets/MagicaCloth2/Scripts/Editor/Cloth/VirtualMeshEditorUtility.cs new file mode 100644 index 00000000..e9c06c7e --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/Cloth/VirtualMeshEditorUtility.cs @@ -0,0 +1,538 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +#if MC2_DEBUG +using System.Collections.Generic; +using Unity.Collections; +using Unity.Mathematics; +using UnityEditor; +using UnityEngine; +#endif + +namespace MagicaCloth2 +{ +#if MC2_DEBUG + public static partial class VirtualMeshEditorUtility + { + //========================================================================================= + static List positionBuffer0 = new List(1024); + static List positionBuffer1 = new List(1024); + static List positionBuffer2 = new List(1024); + static List segmentBuffer0 = new List(2048); + static List segmentBuffer1 = new List(2048); + static List segmentBuffer2 = new List(2048); + + //========================================================================================= + + /// + /// VirtualMeshƒ‡ƒƒƒ‚°èĦ¨ç¤şïĵˆç·¨é›†ç”¨ïĵ‰ + /// + /// + /// + public static void DrawGizmos(VirtualMeshContainer cmesh, VirtualMeshDebugSettings debugSettings, bool selected, bool useHandles) + { + if (debugSettings.enable == false) + return; + if (cmesh == null || cmesh.shareVirtualMesh == null || cmesh.shareVirtualMesh.IsSuccess == false || cmesh.shareVirtualMesh.VertexCount == 0) + return; + + var vmesh = cmesh.shareVirtualMesh; + var t = cmesh.GetCenterTransform(); + if (t == null) + return; + + using NativeArray dummyRotations = new NativeArray(0, Allocator.TempJob); + DrawGizmosInternal( + useHandles, + true, + selected, + cmesh, + debugSettings, + t, + 0, + vmesh.attributes.GetNativeArray(), + vmesh.localPositions.GetNativeArray(), + dummyRotations, + vmesh.localNormals.GetNativeArray(), + vmesh.localTangents.GetNativeArray(), + 0, + vmesh.boneWeights.GetNativeArray(), + vmesh.skinBoneTransformIndices.GetNativeArray(), + vmesh.uv.GetNativeArray() + ); + } + + + /// + /// Proxy/MappingƒĦƒƒ‚·ƒƒ‡ƒƒƒ‚°èĦ¨ç¤şïĵˆƒİƒ³‚ż‚¤ƒ ç”¨ïĵ‰ + /// + /// + /// + /// + public static void DrawRuntimeGizmos(ClothProcess cprocess, bool isMapping, VirtualMeshContainer cmesh, VirtualMeshDebugSettings debugSettings, bool selected, bool useHandles) + { + if (cprocess == null || cprocess.IsValid() == false) + return; + if (debugSettings.enable == false) + return; + if (MagicaManager.Team == null) + return; + if (MagicaManager.Team.ContainsTeamData(cprocess.TeamId) == false) + return; + + if (cmesh == null || cmesh.shareVirtualMesh == null || cmesh.shareVirtualMesh.IsSuccess == false) + return; + + var t = cmesh.GetCenterTransform(); + if (t == null) + return; + + // ƒƒĵƒ ƒ‡ƒĵ‚ż + ref var tdata = ref MagicaManager.Team.GetTeamDataRef(cprocess.TeamId); + + var tm = MagicaManager.Team; + var vm = MagicaManager.VMesh; + + // ƒĦƒƒ‚·ƒ‚ż‚¤ƒ—Ğ‚ˆ‚Šċ‚ç…§™‚‹ƒ‡ƒĵ‚ż‚’ċˆ‡‚Šĉ›żˆ‚‹ + var vmesh = cmesh.shareVirtualMesh; + var attributes = vmesh.IsMapping ? vm.mappingAttributes : vm.attributes; + var positions = vmesh.IsMapping ? vm.mappingPositions : vm.positions; + var rotations = vmesh.IsMapping ? null : vm.rotations; + int boneWeightOffset = vmesh.IsMapping ? 0 : tdata.proxySkinBoneChunk.startIndex + tdata.proxyTransformChunk.startIndex; + var boneWeights = vmesh.IsMapping ? vm.mappingBoneWeights : vm.boneWeights; + var skinBoneTransformIndices = vmesh.IsMapping ? vm.skinBoneTransformIndices : vm.skinBoneTransformIndices; + var uvs = vmesh.IsMapping ? null : vmesh.uv; + int vstart = vmesh.IsMapping ? tm.mappingDataArray[vmesh.mappingId].mappingCommonChunk.startIndex : tdata.proxyCommonChunk.startIndex; + + using NativeArray dummyRotations = new NativeArray(0, Allocator.TempJob); + using NativeArray dummyUvs = new NativeArray(0, Allocator.TempJob); + + DrawGizmosInternal( + useHandles, + isMapping ? true : false, + selected, + cmesh, + debugSettings, + t, + vstart, + attributes.GetNativeArray(), + positions.GetNativeArray(), + rotations != null ? rotations.GetNativeArray() : dummyRotations, + vmesh.localNormals.GetNativeArray(), + vmesh.localTangents.GetNativeArray(), + boneWeightOffset, + boneWeights.GetNativeArray(), + skinBoneTransformIndices.GetNativeArray(), + uvs != null ? uvs.GetNativeArray() : dummyUvs + ); + } + + static void DrawGizmosInternal( + bool useHandles, + bool isLocal, + bool selected, + VirtualMeshContainer cmesh, + VirtualMeshDebugSettings debugSettings, + Transform center, + int vstart, + NativeArray attributes, + NativeArray positions, + NativeArray rotations, + NativeArray normals, + NativeArray tangents, + int boneWeightOffset, + NativeArray boneWeights, + NativeArray skinBoneTransformIndices, + NativeArray uvs + ) + { + // ċş§ĉ¨™çİşé–“Ğċˆ‚›‚‹ + if (isLocal) + { + Handles.matrix = center.localToWorldMatrix; + if (useHandles == false) + Gizmos.matrix = center.localToWorldMatrix; + } + else + { + Handles.matrix = Matrix4x4.identity; + Gizmos.matrix = Matrix4x4.identity; + } + + // ‚·ƒĵƒ³‚ЃĦƒİ + var scam = SceneView.currentDrawingSceneView?.camera; + if (scam == null) + return; + quaternion camRot = scam.transform.rotation; + //quaternion invCamRot = math.inverse(camRot); + var vmesh = cmesh.shareVirtualMesh; + int vcnt = vmesh.VertexCount; + + // èĦ¨ç¤ş‚ı‚ħƒĵƒĞèŞżĉ•´ + var scl = isLocal ? 1.0f / (center.lossyScale.magnitude / 1.7305f) : 1.0f; + var drawPointSize = debugSettings.pointSize * scl; + float drawAxisSize = debugSettings.lineSize * scl; + + bool hasRotation = rotations.IsCreated && rotations.Length > 0; + bool hasUv = uvs.IsCreated && uvs.Length > 0; + float colorScale = selected ? 1 : 0.5f; + + // position + if (debugSettings.position) + { + for (int i = 0; i < vcnt; i++) + { + if (i < debugSettings.vertexMinIndex || i > debugSettings.vertexMaxIndex) + continue; + + var pos = positions[vstart + i]; + var attr = attributes[vstart + i]; + var col = Color.black; + if (attr.IsFixed()) col = Color.red; + if (attr.IsMove()) col = Color.green; + GizmoUtility.SetColor(col * colorScale, useHandles); + + GizmoUtility.DrawSphere(pos, drawPointSize, useHandles); + } + } + + // rotation axis + if (debugSettings.axis && hasRotation) + { + positionBuffer0.Clear(); + positionBuffer1.Clear(); + positionBuffer2.Clear(); + segmentBuffer0.Clear(); + segmentBuffer1.Clear(); + segmentBuffer2.Clear(); + + for (int i = 0; i < vcnt; i++) + { + if (i < debugSettings.vertexMinIndex || i > debugSettings.vertexMaxIndex) + continue; + + var pos = positions[vstart + i]; + var y = hasRotation ? MathUtility.ToNormal(rotations[vstart + i]) : normals[vstart + i]; + var z = hasRotation ? MathUtility.ToTangent(rotations[vstart + i]) : tangents[vstart + i]; + var x = math.cross(y, z); + + positionBuffer0.Add(pos); + positionBuffer0.Add(pos + x * drawAxisSize); + segmentBuffer0.Add(i * 2); + segmentBuffer0.Add(i * 2 + 1); + + positionBuffer1.Add(pos); + positionBuffer1.Add(pos + y * drawAxisSize); + segmentBuffer1.Add(i * 2); + segmentBuffer1.Add(i * 2 + 1); + + positionBuffer2.Add(pos); + positionBuffer2.Add(pos + z * drawAxisSize); + segmentBuffer2.Add(i * 2); + segmentBuffer2.Add(i * 2 + 1); + } + + // x + Handles.color = Color.red * colorScale; + Handles.DrawLines(positionBuffer0.ToArray(), segmentBuffer0.ToArray()); + // y + Handles.color = Color.green * colorScale; + Handles.DrawLines(positionBuffer1.ToArray(), segmentBuffer1.ToArray()); + // z + Handles.color = Color.blue * colorScale; + Handles.DrawLines(positionBuffer2.ToArray(), segmentBuffer2.ToArray()); + } + + // bone weight + if (debugSettings.boneWeight) + { + for (int i = 0; i < vcnt; i++) + { + if (i < debugSettings.vertexMinIndex || i > debugSettings.vertexMaxIndex) + continue; + var pos = positions[vstart + i]; + var bw = boneWeights[vstart + i]; + bw.boneIndices += boneWeightOffset; // ‚°ƒ­ƒĵƒƒĞ‚¤ƒ³ƒ‡ƒƒ‚Ż‚ıĞċ¤‰ĉ› + bw.boneIndices.x = skinBoneTransformIndices[bw.boneIndices.x]; + bw.boneIndices.y = skinBoneTransformIndices[bw.boneIndices.y]; + bw.boneIndices.z = skinBoneTransformIndices[bw.boneIndices.z]; + bw.boneIndices.w = skinBoneTransformIndices[bw.boneIndices.w]; + Handles.Label(pos, $"[{bw.boneIndices.x},{bw.boneIndices.y},{bw.boneIndices.z},{bw.boneIndices.w}] w({bw.weights.x:0.###}, {bw.weights.y:0.###}, {bw.weights.z:0.###}, {bw.weights.w:0.###})"); + } + } + // number + else if (debugSettings.indexNumber) + { + for (int i = 0; i < vcnt; i++) + { + if (i < debugSettings.vertexMinIndex || i > debugSettings.vertexMaxIndex) + continue; + var pos = positions[vstart + i]; + Handles.Label(pos, i.ToString()); + } + } + // uv + else if (debugSettings.uv) + { + if (vmesh.IsProxy) + { + // ƒ—ƒ­‚­‚·ż + for (int i = 0; i < vcnt; i++) + { + if (i < debugSettings.vertexMinIndex || i > debugSettings.vertexMaxIndex) + continue; + var pos = positions[vstart + i]; + var uv = vmesh.uv[i]; + Handles.Label(pos, $"({uv.x:0.####}, {uv.y:0.####})"); + } + } + } + // depth + else if (debugSettings.depth) + { + if (vmesh.IsProxy) + { + if (vmesh.vertexDepths.IsCreated) + { + for (int i = 0; i < vcnt; i++) + { + if (i < debugSettings.vertexMinIndex || i > debugSettings.vertexMaxIndex) + continue; + var pos = positions[vstart + i]; + var depth = vmesh.vertexDepths[i]; + Handles.Label(pos, $"{depth:0.##}"); + } + } + } + } + // root index + else if (debugSettings.rootIndex) + { + if (vmesh.IsProxy) + { + if (vmesh.vertexRootIndices.IsCreated) + { + for (int i = 0; i < vcnt; i++) + { + if (i < debugSettings.vertexMinIndex || i > debugSettings.vertexMaxIndex) + continue; + var pos = positions[vstart + i]; + int rootIndex = vmesh.vertexRootIndices[i]; + if (rootIndex >= 0) + Handles.Label(pos, $"{rootIndex}"); + } + } + } + } + // parent index + else if (debugSettings.parentIndex) + { + if (vmesh.IsProxy) + { + if (vmesh.vertexParentIndices.IsCreated) + { + for (int i = 0; i < vcnt; i++) + { + if (i < debugSettings.vertexMinIndex || i > debugSettings.vertexMaxIndex) + continue; + var pos = positions[vstart + i]; + int parentIndex = vmesh.vertexParentIndices[i]; + //if (parentIndex < 0) + Handles.Label(pos, $"{parentIndex}"); + } + } + } + } + + // triangls + if (debugSettings.triangle) + { + positionBuffer0.Clear(); + segmentBuffer0.Clear(); + + switch (vmesh.meshType) + { + case VirtualMesh.MeshType.NormalMesh: + GizmoUtility.SetColor(Color.magenta * colorScale, useHandles); + break; + case VirtualMesh.MeshType.NormalBoneMesh: + GizmoUtility.SetColor(Color.magenta * colorScale, useHandles); + break; + case VirtualMesh.MeshType.ProxyMesh: + GizmoUtility.SetColor(new Color(0.8666f, 0.627f, 0.8666f) * colorScale, useHandles); + break; + case VirtualMesh.MeshType.ProxyBoneMesh: + GizmoUtility.SetColor(new Color(0.8666f, 0.627f, 0.8666f) * colorScale, useHandles); + break; + case VirtualMesh.MeshType.Mapping: + GizmoUtility.SetColor(new Color(0.851f, 0.644f, 0.125f) * colorScale, useHandles); + break; + } + for (int i = 0; i < vmesh.TriangleCount; i++) + { + if (i < debugSettings.triangleMinIndex || i > debugSettings.triangleMaxIndex) + continue; + int3 tri = vmesh.triangles[i]; + var pos1 = positions[vstart + tri.x]; + var pos2 = positions[vstart + tri.y]; + var pos3 = positions[vstart + tri.z]; + int index = positionBuffer0.Count; + positionBuffer0.Add(pos1); + positionBuffer0.Add(pos2); + positionBuffer0.Add(pos3); + segmentBuffer0.Add(index); + segmentBuffer0.Add(index + 1); + segmentBuffer0.Add(index + 1); + segmentBuffer0.Add(index + 2); + segmentBuffer0.Add(index + 2); + segmentBuffer0.Add(index); + } + Handles.DrawLines(positionBuffer0.ToArray(), segmentBuffer0.ToArray()); + } + + // line + if (debugSettings.line) + { + positionBuffer0.Clear(); + segmentBuffer0.Clear(); + + GizmoUtility.SetColor(Color.cyan * colorScale, useHandles); + for (int i = 0; i < vmesh.LineCount; i++) + { + int2 line = vmesh.lines[i]; + var pos1 = positions[vstart + line.x]; + var pos2 = positions[vstart + line.y]; + positionBuffer0.Add(pos1); + positionBuffer0.Add(pos2); + segmentBuffer0.Add(i * 2); + segmentBuffer0.Add(i * 2 + 1); + } + Handles.DrawLines(positionBuffer0.ToArray(), segmentBuffer0.ToArray()); + } + + // edge number + if (debugSettings.edgeNumber) + { + int ecnt = vmesh.EdgeCount; + for (int i = 0; i < ecnt; i++) + { + if (i < debugSettings.edgeMinIndex || i > debugSettings.edgeMaxIndex) + continue; + int2 edge = vmesh.edges[i]; + var pos1 = positions[vstart + edge.x]; + var pos2 = positions[vstart + edge.y]; + var c = (pos1 + pos2) * 0.5f; + Handles.Label(c, i.ToString()); + } + } + + // triangle normal + if (debugSettings.triangleNormal || debugSettings.triangleNumber || debugSettings.triangleTangent) + { + positionBuffer0.Clear(); + segmentBuffer0.Clear(); + positionBuffer1.Clear(); + segmentBuffer1.Clear(); + + Color colF = Color.yellow; + Color colB = new Color(1.0f, 0.3f, 0.3f, 1.0f); + for (int i = 0; i < vmesh.TriangleCount; i++) + { + if (i < debugSettings.triangleMinIndex || i > debugSettings.triangleMaxIndex) + continue; + int3 tri = vmesh.triangles[i]; + var pos1 = positions[vstart + tri.x]; + var pos2 = positions[vstart + tri.y]; + var pos3 = positions[vstart + tri.z]; + var n = MathUtility.TriangleNormal(pos1, pos2, pos3); + var c = MathUtility.TriangleCenter(pos1, pos2, pos3); + if (debugSettings.triangleNormal) + { + //var dir = math.mul(invCamRot, n); + //GizmoUtility.SetColor((dir.z < 0.0f ? colF : colB) * colorScale, useHandles); + //GizmoUtility.DrawLine(c, c + n * drawAxisSize, useHandles); + positionBuffer0.Add(c); + positionBuffer0.Add(c + n * drawAxisSize); + segmentBuffer0.Add(i * 2); + segmentBuffer0.Add(i * 2 + 1); + } + if (debugSettings.triangleTangent && hasUv) + { + var uv1 = uvs[vstart + tri.x]; + var uv2 = uvs[vstart + tri.y]; + var uv3 = uvs[vstart + tri.z]; + var tn = MathUtility.TriangleTangent(pos1, pos2, pos3, uv1, uv2, uv3); + positionBuffer1.Add(c); + positionBuffer1.Add(c + tn * drawAxisSize); + segmentBuffer1.Add(i * 2); + segmentBuffer1.Add(i * 2 + 1); + } + if (debugSettings.triangleNumber) + Handles.Label(c, i.ToString()); + } + + if (debugSettings.triangleNormal) + { + GizmoUtility.SetColor(colF * colorScale, useHandles); + Handles.DrawLines(positionBuffer0.ToArray(), segmentBuffer0.ToArray()); + } + if (debugSettings.triangleTangent && hasUv) + { + GizmoUtility.SetColor(colB * colorScale, useHandles); + Handles.DrawLines(positionBuffer1.ToArray(), segmentBuffer1.ToArray()); + } + } + + // base line + if (vmesh.IsProxy) + { + // ƒ—ƒ­‚­‚·ż + if (debugSettings.baseLine && vmesh.BaseLineCount > 0) + { + GizmoUtility.SetColor(new Color(1.0f, 0.27f, 0.0f) * colorScale, useHandles); + positionBuffer0.Clear(); + segmentBuffer0.Clear(); + + for (int i = 0; i < vcnt; i++) + { + int pindex = vmesh.vertexParentIndices[i]; + if (pindex >= 0) + { + var pos = positions[vstart + i]; + var ppos = positions[vstart + pindex]; + //GizmoUtility.DrawLine(pos, ppos, useHandles); + positionBuffer0.Add(pos); + positionBuffer0.Add(ppos); + segmentBuffer0.Add(i * 2); + segmentBuffer0.Add(i * 2 + 1); + } + } + Handles.DrawLines(positionBuffer0.ToArray(), segmentBuffer0.ToArray()); + } + } + + // çİşé–“‚’ĉˆğ™ + Handles.matrix = Matrix4x4.identity; + if (useHandles == false) + Gizmos.matrix = Matrix4x4.identity; + + // bone name + if (debugSettings.boneName) + { + //int cnt = vmesh.transformData.Count; + int cnt = cmesh.GetTransformCount(); + for (int i = 0; i < cnt; i++) + { + //var t = vmesh.transformData.GetTransformFromIndex(i); + var t = cmesh.GetTransformFromIndex(i); + if (t) + { + var pos = t.position; + Handles.Label(pos, $"[{i}] {t.name}"); + } + } + } + } + } +#endif // MC_DEBUG +} diff --git a/Assets/MagicaCloth2/Scripts/Editor/Cloth/VirtualMeshEditorUtility.cs.meta b/Assets/MagicaCloth2/Scripts/Editor/Cloth/VirtualMeshEditorUtility.cs.meta new file mode 100644 index 00000000..ef05183f --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/Cloth/VirtualMeshEditorUtility.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 2e052cf3e2e3eca4f9c71f84cb7712ab +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Editor/Cloth/VirtualMeshEditorUtility.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Editor/EditorExtension.meta b/Assets/MagicaCloth2/Scripts/Editor/EditorExtension.meta new file mode 100644 index 00000000..ff4c5c50 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/EditorExtension.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f7c6c164b13cbbe43afc71f44eaac1e2 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Scripts/Editor/EditorExtension/AboutMenu.cs b/Assets/MagicaCloth2/Scripts/Editor/EditorExtension/AboutMenu.cs new file mode 100644 index 00000000..8145c04c --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/EditorExtension/AboutMenu.cs @@ -0,0 +1,96 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using UnityEditor; +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// Aboutƒ€‚¤‚˘ƒ­‚° + /// + public class AboutMenu : EditorWindow + { + [SerializeField] + private Texture2D image = null; + + public const string MagicaClothVersion = "2.18.1"; + + public static AboutMenu AboutWindow { get; set; } + private const float windowWidth = 300; + private const float windowHeight = 220; + + private const string webUrl = "https://magicasoft.jp/en/magica-cloth-2-2/"; + + //========================================================================================= + [MenuItem("Tools/Magica Cloth2/About", false)] + static void InitWindow() + { + if (AboutWindow) + return; + AboutWindow = CreateInstance(); + AboutWindow.position = new Rect(Screen.width / 2, Screen.height / 2, windowWidth, windowHeight); + AboutWindow.minSize = new Vector2(windowWidth, windowHeight); + AboutWindow.maxSize = new Vector2(windowWidth, windowHeight); + AboutWindow.titleContent.text = "About Magica Cloth 2"; + AboutWindow.ShowUtility(); + } + + protected void OnGUI() + { + EditorGUILayout.Space(); + EditorGUILayout.Space(); + EditorGUILayout.Space(); + + GUIStyle myStyle = new GUIStyle(); + myStyle.alignment = TextAnchor.MiddleCenter; + myStyle.fontSize = 20; + myStyle.normal.textColor = Color.white; + + GUILayout.Box(image, myStyle); + + EditorGUILayout.Space(); + + EditorGUILayout.LabelField("Magica Cloth 2", myStyle); + + EditorGUILayout.Space(5); + myStyle.fontSize = 16; + EditorGUILayout.LabelField($"version {MagicaClothVersion}", myStyle); + + EditorGUILayout.Space(); + EditorGUILayout.Space(); + EditorGUILayout.Space(); + myStyle.fontSize = 12; + EditorGUILayout.LabelField("Copyright Âİ Magica Soft", myStyle); + EditorGUILayout.LabelField("All Rights Reserved", myStyle); + + //EditorGUILayout.LabelField(webUrl, myStyle); + + EditorGUILayout.Space(); + EditorGUILayout.Space(); + + using (var h = new EditorGUILayout.HorizontalScope()) + { + EditorGUILayout.Space(); + if (GUILayout.Button("Website")) + { + Application.OpenURL(webUrl); + } + + EditorGUILayout.Space(); + + if (GUILayout.Button("Close")) + { + Close(); + } + + EditorGUILayout.Space(); + } + } + + protected void OnInspectorUpdate() + { + Repaint(); + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Editor/EditorExtension/AboutMenu.cs.meta b/Assets/MagicaCloth2/Scripts/Editor/EditorExtension/AboutMenu.cs.meta new file mode 100644 index 00000000..c482a2db --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/EditorExtension/AboutMenu.cs.meta @@ -0,0 +1,20 @@ +fileFormatVersion: 2 +guid: 059c4023f8428864e994f30573930854 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: + - m_ViewDataDictionary: {instanceID: 0} + - image: {fileID: 2800000, guid: cf7e3400035e987478c3a19e57b4cf75, type: 3} + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Editor/EditorExtension/AboutMenu.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Editor/EditorExtension/CheckSliderSerializeDataDrawer.cs b/Assets/MagicaCloth2/Scripts/Editor/EditorExtension/CheckSliderSerializeDataDrawer.cs new file mode 100644 index 00000000..60209a51 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/EditorExtension/CheckSliderSerializeDataDrawer.cs @@ -0,0 +1,60 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using UnityEditor; +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// CheckSliderSerializeDataƒ—ƒ­ƒ‘ƒ†‚£‚Ğ‚ı‚żƒ GUIĉç”ğ + /// + [CustomPropertyDrawer(typeof(CheckSliderSerializeData))] + public class CheckSliderSerializeDataDrawer : PropertyDrawer + { + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + // ‚µ‚¤‚ş + float lineHight = EditorGUIUtility.singleLineHeight; + float y = position.y; + + EditorGUI.BeginProperty(position, label, property); + + // ƒ—ƒ­ƒ‘ƒ†‚£ + var useProperty = property.FindPropertyRelative("use"); + var valueProperty = property.FindPropertyRelative("value"); + + // ƒİƒ™ƒĞ‚’ĉç”ğ + Rect positionA; + using (new EditorGUI.DisabledScope(!useProperty.boolValue)) + { + positionA = EditorGUI.PrefixLabel(position, GUIUtility.GetControlID(FocusType.Passive), label); + } + + // ċ­ƒ•‚£ƒĵƒĞƒ‰‚’‚¤ƒ³ƒ‡ƒ³ƒˆ—Ş„ + var indent = EditorGUI.indentLevel; + EditorGUI.indentLevel = 0; + + // 設ċšċ€¤çŻ„ċ›²€‚ƒ—ƒ­ƒ‘ƒ†‚£ċ‹‚‰ċˆ¤ċš™‚‹ + var minmax = MagicaClothEditor.GetPropertyMinMax(property.name); + + // çŸİċ½˘‚’è¨ˆç— + float w = positionA.width; + const float toggleSize = 20; + var buttonRect = new Rect(positionA.x, y, toggleSize, lineHight); + var sliderRect = new Rect(positionA.x + toggleSize, y, Mathf.Max(w - toggleSize, 0), lineHight); + + // GUIContent.none ‚’‚Œž‚ŒĞĉ¸Ħ™¨€ƒİƒ™ƒĞŞ—Ğĉç”ğ•‚Œ™ + EditorGUI.PropertyField(buttonRect, useProperty, GUIContent.none); + using (new EditorGUI.DisabledScope(!useProperty.boolValue)) + { + EditorGUI.Slider(sliderRect, valueProperty, minmax.x, minmax.y, GUIContent.none); + } + + // ‚¤ƒ³ƒ‡ƒ³ƒˆ‚’ċ…ƒé€š‚ЁĞĉˆğ—™ + EditorGUI.indentLevel = indent; + + EditorGUI.EndProperty(); + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Editor/EditorExtension/CheckSliderSerializeDataDrawer.cs.meta b/Assets/MagicaCloth2/Scripts/Editor/EditorExtension/CheckSliderSerializeDataDrawer.cs.meta new file mode 100644 index 00000000..00a84283 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/EditorExtension/CheckSliderSerializeDataDrawer.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: b3fa2fcfdd75dbb48b7566213e81bb9a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Editor/EditorExtension/CheckSliderSerializeDataDrawer.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Editor/EditorExtension/CurveSerializeDataDrawer.cs b/Assets/MagicaCloth2/Scripts/Editor/EditorExtension/CurveSerializeDataDrawer.cs new file mode 100644 index 00000000..7bbdb198 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/EditorExtension/CurveSerializeDataDrawer.cs @@ -0,0 +1,80 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using UnityEditor; +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// CurveSerializeDataƒ—ƒ­ƒ‘ƒ†‚£‚Ğ‚ı‚żƒ GUIĉç”ğ + /// + [CustomPropertyDrawer(typeof(CurveSerializeData))] + public class CurveSerializeDataDrawer : PropertyDrawer + { + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + // ‚µ‚¤‚ş + float lineHight = EditorGUIUtility.singleLineHeight; + float y = position.y; + + EditorGUI.BeginProperty(position, label, property); + + // ƒİƒ™ƒĞ‚’ĉç”ğ + var positionA = EditorGUI.PrefixLabel(position, GUIUtility.GetControlID(FocusType.Passive), label); + + // ċ­ƒ•‚£ƒĵƒĞƒ‰‚’‚¤ƒ³ƒ‡ƒ³ƒˆ—Ş„ + var indent = EditorGUI.indentLevel; + EditorGUI.indentLevel = 0; + + // ƒ—ƒ­ƒ‘ƒ†‚£ + var useProperty = property.FindPropertyRelative("useCurve"); + var valueProperty = property.FindPropertyRelative("value"); + bool useCurve = useProperty.boolValue; + + // 設ċšċ€¤çŻ„ċ›²€‚ƒ—ƒ­ƒ‘ƒ†‚£ċ‹‚‰ċˆ¤ċš™‚‹ + //var minmax = ClothSerializeData.GetMinMax(property.name); + var minmax = MagicaClothEditor.GetPropertyMinMax(property.name); + + // çŸİċ½˘‚’è¨ˆç— + float w = positionA.width; + var buttonRect = new Rect(positionA.x + w - 30, y, 30, lineHight); + var sliderRect = new Rect(positionA.x, y, Mathf.Max(w - 35, 0), lineHight); + + // GUIContent.none ‚’‚Œž‚ŒĞĉ¸Ħ™¨€ƒİƒ™ƒĞŞ—Ğĉç”ğ•‚Œ™ + EditorGUI.Slider(sliderRect, valueProperty, minmax.x, minmax.y, GUIContent.none); + if (GUI.Button(buttonRect, useProperty.boolValue ? "X" : "C")) + { + // ‚Ѓĵƒ–ċˆ‡‚Šĉ›żˆ + useProperty.boolValue = !useProperty.boolValue; + } + + // ‚Ѓĵƒ– + if (useCurve) + { + // ‚Ѓĵƒ–ƒ—ƒ­ƒ‘ƒ†‚£ + var curveProperty = property.FindPropertyRelative("curve"); + y += lineHight + 3; + //var curveRect = new Rect(positionA.x - 15, y, w + 15, lineHight); + var curveRect = new Rect(positionA.x, y, w, lineHight); + EditorGUI.CurveField(curveRect, curveProperty, Color.green, new Rect(0, 0, 1, 1), GUIContent.none); + } + + // ‚¤ƒ³ƒ‡ƒ³ƒˆ‚’ċ…ƒé€š‚ЁĞĉˆğ—™ + EditorGUI.indentLevel = indent; + + EditorGUI.EndProperty(); + } + + public override float GetPropertyHeight(SerializedProperty property, GUIContent label) + { + float h = EditorGUIUtility.singleLineHeight; + + var useProperty = property.FindPropertyRelative("useCurve"); + if (useProperty.boolValue) + h += (h + 3 + 2); + + return h; + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Editor/EditorExtension/CurveSerializeDataDrawer.cs.meta b/Assets/MagicaCloth2/Scripts/Editor/EditorExtension/CurveSerializeDataDrawer.cs.meta new file mode 100644 index 00000000..489c3f37 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/EditorExtension/CurveSerializeDataDrawer.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: a43f33abae2910246b917331abff6706 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Editor/EditorExtension/CurveSerializeDataDrawer.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Editor/EditorExtension/DrawIconInHierarchy.cs b/Assets/MagicaCloth2/Scripts/Editor/EditorExtension/DrawIconInHierarchy.cs new file mode 100644 index 00000000..6cf496ba --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/EditorExtension/DrawIconInHierarchy.cs @@ -0,0 +1,75 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using UnityEditor; +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// ƒ’‚¨ƒİƒĞ‚­ƒĵ¸‚˘‚¤‚³ƒ³èĦ¨ç¤ş + /// + [InitializeOnLoad] + public class DrawIconInHierarchy + { + const int iconSize = 16; + + static DrawIconInHierarchy() + { +#if UNITY_6000_4_OR_NEWER + EditorApplication.hierarchyWindowItemByEntityIdOnGUI += DrawIcon; +#else + EditorApplication.hierarchyWindowItemOnGUI += DrawIcon; +#endif + } + + //static void DrawIcon(int instanceId, Rect rect) +#if UNITY_6000_4_OR_NEWER + static void DrawIcon(EntityId instanceId, Rect rect) +#else + static void DrawIcon(int instanceId, Rect rect) +#endif + { + rect.width = iconSize; +#if UNITY_6000_3_OR_NEWER + GameObject obj = UnityEditor.EditorUtility.EntityIdToObject(instanceId) as GameObject; +#else + GameObject obj = UnityEditor.EditorUtility.InstanceIDToObject(instanceId) as GameObject; +#endif + if (obj == null) + return; + rect.x += EditorStyles.label.CalcSize(obj.name).x; + rect.y += -1; + rect.x += iconSize + 4; + + foreach (var component in obj.GetComponents()) + { + if (component is MagicaSphereCollider + || component is MagicaCapsuleCollider + || component is MagicaPlaneCollider + || component is MagicaCloth + || component is MagicaWindZone + || component is MagicaSettings + ) + { + var icon = AssetPreview.GetMiniThumbnail(component); + GUI.Label(rect, icon); + rect.x += iconSize; + } + } + } + } + + /// + /// ƒ†‚­‚ıƒˆ‚µ‚¤‚ş‚’ċ–ċ— + /// + public static class GUIStyleExtensions + { + public static Vector2 CalcSize(this GUIStyle self, string text) + { + var content = new GUIContent(text); + var size = self.CalcSize(content); + return size; + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Editor/EditorExtension/DrawIconInHierarchy.cs.meta b/Assets/MagicaCloth2/Scripts/Editor/EditorExtension/DrawIconInHierarchy.cs.meta new file mode 100644 index 00000000..4b4ec45e --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/EditorExtension/DrawIconInHierarchy.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 3c7a0c2cbd41e2a4b93ab9b238dfcf08 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Editor/EditorExtension/DrawIconInHierarchy.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Editor/EditorExtension/MenuItemScript.cs b/Assets/MagicaCloth2/Scripts/Editor/EditorExtension/MenuItemScript.cs new file mode 100644 index 00000000..10fa83d2 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/EditorExtension/MenuItemScript.cs @@ -0,0 +1,222 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using System; +using System.IO; +using System.Text; +using UnityEditor; +using UnityEngine; + +namespace MagicaCloth2 +{ + public class MenuItemScript + { + //========================================================================================= + [MenuItem("GameObject/Create Other/Magica Cloth2/Magica Cloth", priority = 200)] + static void AddMagicaCloth() + { + var obj = AddObject("Magica Cloth", false, false); + var comp = obj.AddComponent(); + Selection.activeGameObject = obj; + } + + [MenuItem("GameObject/Create Other/Magica Cloth2/Magica Sphere Collider", priority = 200)] + static void AddSphereCollider() + { + var obj = AddObject("Magica Sphere Collider", true, true); + var comp = obj.AddComponent(); + //comp.size = new Vector3(0.1f, 0.1f, 0.1f); + comp.SetSize(new Vector3(0.1f, 0.1f, 0.1f)); + Selection.activeGameObject = obj; + } + + [MenuItem("GameObject/Create Other/Magica Cloth2/Magica Capsule Collider", priority = 200)] + static void AddCapsuleCollider() + { + var obj = AddObject("Magica Capsule Collider", true, true); + var comp = obj.AddComponent(); + //comp.size = new Vector3(0.05f, 0.05f, 0.3f); + comp.SetSize(new Vector3(0.05f, 0.05f, 0.3f)); + comp.direction = MagicaCapsuleCollider.Direction.Y; + comp.radiusSeparation = false; + Selection.activeGameObject = obj; + } + + [MenuItem("GameObject/Create Other/Magica Cloth2/Magica Plane Collider", priority = 200)] + static void AddPlaneCollider() + { + var obj = AddObject("Magica Plane Collider", true, true); + var comp = obj.AddComponent(); + Selection.activeGameObject = obj; + } + + [MenuItem("GameObject/Create Other/Magica Cloth2/Magica Wind Zone", priority = 200)] + static void AddWindZone() + { + var obj = AddObject("Magica Wind Zone", false, true); + var comp = obj.AddComponent(); + Selection.activeGameObject = obj; + } + + [MenuItem("GameObject/Create Other/Magica Cloth2/Magica Settings", priority = 200)] + static void AddSettings() + { + var obj = AddObject("Magica Settings", false, true); + var comp = obj.AddComponent(); + Selection.activeGameObject = obj; + } + + /// + /// ƒ’‚¨ƒİƒĞ‚­ƒĵĞ‚ރ–‚¸‚§‚Żƒˆ‚’ïĵ‘¤èż½ċŠ ™‚‹ + /// + /// + /// + static GameObject AddObject(string objName, bool addParentName, bool autoScale = false) + { + var parent = Selection.activeGameObject; + + GameObject obj = new GameObject(addParentName && parent ? objName + " (" + parent.name + ")" : objName); + if (parent) + { + obj.transform.parent = parent.transform; + } + obj.transform.SetLocalPositionAndRotation(Vector3.zero, Quaternion.identity); + + if (autoScale && parent) + { + var scl = parent.transform.lossyScale; + obj.transform.localScale = new Vector3(1.0f / scl.x, 1.0f / scl.y, 1.0f / scl.z); + } + else + obj.transform.localScale = Vector3.one; + + return obj; + } + + //========================================================================================= + [MenuItem("Tools/Magica Cloth2/Manager information", false)] + static async void DispClothManagerInfo() + { + StringBuilder allsb = new StringBuilder(); + + await ClothEditorManager.InformationLog(allsb); + + var timeManager = MagicaManager.Time; + if (timeManager == null) + { + Debug.LogWarning("Time Manager is null!"); + } + else + { + timeManager.InformationLog(allsb); + } + + var teamManager = MagicaManager.Team; + if (teamManager == null) + { + Debug.LogWarning("Team Manager is null!"); + } + else + { + teamManager.InformationLog(allsb); + } + + var vmeshManager = MagicaManager.VMesh; + if (vmeshManager == null) + { + Debug.LogWarning("VMesh Manager is null!"); + } + else + { + vmeshManager.InformationLog(allsb); + } + + var transformManager = MagicaManager.Bone; + if (transformManager == null) + { + Debug.LogWarning("Transform Manager is null!"); + } + else + { + transformManager.InformationLog(allsb); + } + + var simulationManager = MagicaManager.Simulation; + if (simulationManager == null) + { + Debug.LogWarning("Simulation Manager is null!"); + } + else + { + simulationManager.InformationLog(allsb); + } + + var colliderManager = MagicaManager.Collider; + if (colliderManager == null) + { + Debug.LogWarning("Collider Manager is null!"); + } + else + { + colliderManager.InformationLog(allsb); + } + + var windManager = MagicaManager.Wind; + if (windManager == null) + { + Debug.LogWarning("Wind Manager is null!"); + } + else + { + windManager.InformationLog(allsb); + } + + var renderManager = MagicaManager.Render; + if (renderManager == null) + { + Debug.LogWarning("Renderer Manager is null!"); + } + else + { + renderManager.InformationLog(allsb); + } + + var preBuildManager = MagicaManager.PreBuild; + if (preBuildManager == null) + { + Debug.LogWarning("PreBuild Manager is null!"); + } + else + { + preBuildManager.InformationLog(allsb); + } + + // file + DateTime dt = DateTime.Now; + var filename = dt.ToString("yyyy-MM-dd-HHmm-ss"); + StreamWriter sw = new StreamWriter($"./MagicaCloth2_SysInfo_{filename}.txt", false); + sw.WriteLine(allsb.ToString()); + sw.Flush(); + sw.Close(); + } + + //========================================================================================= + // ‚¤ƒ³‚ıƒš‚Ż‚żƒĵ‚³ƒ³ƒ†‚­‚ıƒˆƒĦƒ‹ƒƒĵ + [MenuItem("CONTEXT/MagicaCloth/Rebuild InitData")] + private static void SampleMenu(MenuCommand menuCommand) + { + // ċˆĉœŸċŒ–ƒ‡ƒĵ‚ż‚’‚ŻƒŞ‚˘—Ĥċ†ĉ§‹ç݉™‚‹ + var cloth = menuCommand.context as MagicaCloth; + if (cloth) + { + cloth.GetSerializeData2().initData.Clear(); + EditorUtility.SetDirty(cloth); + + // 編集用ƒĦƒƒ‚·ƒċ†ĉ§‹ç݉ + ClothEditorManager.RegisterComponent(cloth, GizmoType.Active, true); // ċĵ·ċˆĥĉ›´ĉ–° + + Develop.Log($"[{cloth.name}] Initialization data rebuilt."); + } + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Editor/EditorExtension/MenuItemScript.cs.meta b/Assets/MagicaCloth2/Scripts/Editor/EditorExtension/MenuItemScript.cs.meta new file mode 100644 index 00000000..655d50c4 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/EditorExtension/MenuItemScript.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 160a2e4af5a88d34695643fc38100749 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Editor/EditorExtension/MenuItemScript.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Editor/EditorExtension/SharePreBuildDataDrawer.cs b/Assets/MagicaCloth2/Scripts/Editor/EditorExtension/SharePreBuildDataDrawer.cs new file mode 100644 index 00000000..8812fcb0 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/EditorExtension/SharePreBuildDataDrawer.cs @@ -0,0 +1,76 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2024 MagicaSoft. +// https://magicasoft.jp +using UnityEditor; +using UnityEngine; + +namespace MagicaCloth2 +{ + [CustomPropertyDrawer(typeof(SharePreBuildData))] + public class SharePreBuildDataDrawer : PropertyDrawer + { + public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) + { + EditorGUI.BeginProperty(position, label, property); + + // ‚µ‚¤‚ş + float lineHight = EditorGUIUtility.singleLineHeight; + + // ċ­ƒ•‚£ƒĵƒĞƒ‰‚’‚¤ƒ³ƒ‡ƒ³ƒˆ—Ş„ + var indent = EditorGUI.indentLevel; + EditorGUI.indentLevel = 0; + + var buildIdProperty = property.FindPropertyRelative("buildId"); + var versionProperty = property.FindPropertyRelative("version"); + var resultProperty = property.FindPropertyRelative("buildResult.result"); + + // ƒ†‚­‚ıƒˆċı…èŞżĉ•´ + EditorGUIUtility.labelWidth = position.width; + + // build Id + string buildId = string.IsNullOrEmpty(buildIdProperty.stringValue) ? "(Empty)" : buildIdProperty.stringValue; + EditorGUI.PrefixLabel(position, GUIUtility.GetControlID(FocusType.Passive), new GUIContent(buildId)); + position.y += lineHight; + + // ‚¤ƒ³ƒ‡ƒ³ƒˆïĵ‹ïĵ‘ + EditorGUI.indentLevel = indent + 1; + + // result + Define.Result ret = (Define.Result)resultProperty.enumValueIndex; + var result = new ResultCode(ret); + if (result.IsFaild() == false) + { + // ƒƒĵ‚¸ƒ§ƒ³ç˘şèލ + if (versionProperty.intValue != Define.System.LatestPreBuildVersion) + result.SetError(Define.Result.PreBuildData_VersionMismatch); + } + + // result text + var backColor = GUI.color; + if (result.IsSuccess()) + { + GUI.color = Color.green; + EditorGUI.PrefixLabel(position, GUIUtility.GetControlID(FocusType.Passive), new GUIContent($"{result.Result}")); + } + else + { + GUI.color = Color.red; + EditorGUI.PrefixLabel(position, GUIUtility.GetControlID(FocusType.Passive), new GUIContent($"Error: {result.Result}")); + } + GUI.color = backColor; + + // ‚¤ƒ³ƒ‡ƒ³ƒˆ‚’ċ…ƒé€š‚ЁĞĉˆğ—™ + EditorGUI.indentLevel = indent; + + EditorGUI.EndProperty(); + } + + public override float GetPropertyHeight(SerializedProperty property, GUIContent label) + { + float h = EditorGUIUtility.singleLineHeight; + h *= 2; + + return h; + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Editor/EditorExtension/SharePreBuildDataDrawer.cs.meta b/Assets/MagicaCloth2/Scripts/Editor/EditorExtension/SharePreBuildDataDrawer.cs.meta new file mode 100644 index 00000000..c5290e18 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/EditorExtension/SharePreBuildDataDrawer.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: c6706416db7bdd14cb7ed3f5195d6498 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Editor/EditorExtension/SharePreBuildDataDrawer.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Editor/Gizmos.meta b/Assets/MagicaCloth2/Scripts/Editor/Gizmos.meta new file mode 100644 index 00000000..c422cca1 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/Gizmos.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: babc161c3f4373948b6d24be361d41e2 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Scripts/Editor/Gizmos/GizmoUtility.cs b/Assets/MagicaCloth2/Scripts/Editor/Gizmos/GizmoUtility.cs new file mode 100644 index 00000000..4acc4bb5 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/Gizmos/GizmoUtility.cs @@ -0,0 +1,693 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using Unity.Mathematics; +using UnityEditor; +using UnityEngine; + +namespace MagicaCloth2 +{ + public static class GizmoUtility + { + // ‚‚şƒ˘‚Ѓ݃ĵċšçİ + public static readonly Color ColorCollider = new Color(0.0f, 1.0f, 0.0f); + public static readonly Color ColorSymmetryCollider = new Color(0.0f, 1.0f, 1.0f); + public static readonly Color ColorNonSelectedCollider = new Color(0.5f, 0.3f, 0.0f); + public static readonly Color ColorSkinningBone = new Color(1.0f, 0.5f, 0.0f); + public static readonly Color ColorWindZone = new Color(1f, 1f, 1f); + public static readonly Color ColorWindArrow = new Color(1f, 1f, 0f); + + public static readonly Quaternion FlipZ = Quaternion.AngleAxis(180.0f, Vector3.up); + + //========================================================================================= + public static void SetColor(Color col, bool useHandles) + { + if (useHandles) + Handles.color = col; + else + Gizmos.color = col; + } + + public static void DrawSphere(Vector3 pos, float radius, bool useHandles) + { + if (useHandles) + { + // ‚½ƒŞƒƒƒ‰çƒ‚µ‚¤‚şĉŒ‡ċšŻċŠċ„§ŻŞç›´ċ„Ş§ïĵ’ċ€™‚‹ + Handles.SphereHandleCap(0, pos, Quaternion.identity, radius * 2, EventType.Repaint); + } + else + Gizmos.DrawSphere(pos, radius); + } + + public static void DrawWireSphere(Vector3 pos, Quaternion rot, float radius, Quaternion camRot, bool useHandles) + { + if (useHandles) + { + Handles.CircleHandleCap(0, pos, camRot, radius, EventType.Repaint); + Handles.CircleHandleCap(0, pos, rot, radius, EventType.Repaint); + Handles.CircleHandleCap(0, pos, rot * Quaternion.Euler(90, 0, 0), radius, EventType.Repaint); + Handles.CircleHandleCap(0, pos, rot * Quaternion.Euler(0, 90, 0), radius, EventType.Repaint); + } + else + Gizmos.DrawWireSphere(pos, radius); + } + + public static void DrawSimpleWireSphere(Vector3 pos, float radius, Quaternion camRot, bool useHandles) + { + if (useHandles) + { + Handles.CircleHandleCap(0, pos, camRot, radius, EventType.Repaint); + //Handles.CircleHandleCap(0, pos, rot, radius, EventType.Repaint); + //Handles.CircleHandleCap(0, pos, rot * Quaternion.Euler(90, 0, 0), radius, EventType.Repaint); + //Handles.CircleHandleCap(0, pos, rot * Quaternion.Euler(0, 90, 0), radius, EventType.Repaint); + } + else + Gizmos.DrawWireSphere(pos, radius); + } + + public static void DrawLine(Vector3 from, Vector3 to, bool useHandles) + { + if (useHandles) + Handles.DrawLine(from, to); + else + Gizmos.DrawLine(from, to); + } + + public static void DrawWireCapsule(Vector3 pos, Quaternion rot, Vector3 dir, Vector3 up, float sradius, float eradius, float len, bool alignedCenter, Quaternion camRot, bool useHandles) + { + if (useHandles) + { + //float slen = len * 0.5f; + //float elen = len * 0.5f; + float slen = alignedCenter ? len * 0.5f : 0.0f; + float elen = alignedCenter ? len * 0.5f : (len - sradius); + slen = Mathf.Max(slen - sradius, 0.0f); + elen = Mathf.Max(elen - eradius, 0.0f); + Vector3 sl = dir * slen; + Vector3 el = -dir * elen; + + var spos = pos + rot * sl; + var epos = pos + rot * el; + + DrawWireSphere(spos, rot, sradius, camRot, true); + DrawWireSphere(epos, rot, eradius, camRot, true); + + for (int i = 0; i < 360; i += 45) + { + var q = Quaternion.AngleAxis(i, dir); + var up1 = q * (up * sradius); + var up2 = q * (up * eradius); + Handles.DrawLine(spos + up1, epos + up2); + } + } + else + { + + } + } + //public static void DrawWireCapsule(Vector3 spos, Vector3 epos, Quaternion rot, float sradius, float eradius, Quaternion camRot, bool useHandles) + //{ + // if (useHandles) + // { + // DrawWireSphere(spos, rot, sradius, camRot, true); + // DrawWireSphere(epos, rot, eradius, camRot, true); + + // var ps = spos + camRot * Vector3.up * sradius; + // var es = epos + camRot * Vector3.up * eradius; + // Handles.DrawLine(ps, es); + // } + // else + // { + + // } + //} + + /// + /// ƒŻ‚¤ƒ¤ƒĵƒœƒƒ‚Ż‚ı‚’ĉç”ğ™‚‹ + /// + /// + /// + /// + /// + public static void DrawWireCube(Vector3 pos, Quaternion rot, Vector3 size, bool useHandles) + { + if (useHandles) + { + Handles.DrawWireCube(pos, size); // 何ĉ•…‹‚Ѓ݃ĵŒċĉ˜ —Ş„ïĵƒ‚°£½„ + } + else + { + Gizmos.DrawWireCube(pos, size); + } + } + + public static void DrawCross(Vector3 pos, Quaternion rot, float size, bool useHandles) + { + if (useHandles) + { + Handles.color = Color.red; + Handles.DrawLine(pos, pos + rot * Vector3.right * size); + Handles.color = Color.green; + Handles.DrawLine(pos, pos + rot * Vector3.up * size); + Handles.color = Color.blue; + Handles.DrawLine(pos, pos + rot * Vector3.forward * size); + } + else + { + Gizmos.color = Color.red; + Gizmos.DrawLine(pos, pos + rot * Vector3.right * size); + Gizmos.color = Color.green; + Gizmos.DrawLine(pos, pos + rot * Vector3.up * size); + Gizmos.color = Color.blue; + Gizmos.DrawLine(pos, pos + rot * Vector3.forward * size); + } + } + + //========================================================================================= + public static void DrawCollider(ColliderComponent collider, Quaternion camRot, bool selected) + { + if (collider == null) + return; + + Handles.color = selected ? ColorCollider : ColorCollider * 0.5f; + + // Main + var ct = collider.transform; + //var cpos = ct.TransformPoint(collider.center); + float3 cpos = ct.position; + quaternion crot = ct.rotation; + float3 cscl = ct.lossyScale; + // ƒž‚¤ƒŠ‚ı‚ı‚ħƒĵƒĞ + float3 sclSign = math.sign(cscl); + // ‚ރ•‚ğƒƒƒˆ + cpos += math.mul(crot, collider.center * sclSign) * cscl * sclSign; + // ‚ЃĦƒİċ›žèğ˘‚’‚³ƒİ‚¤ƒ€ƒĵƒ­ƒĵ‚ЃĞċ›žèğ˘Ğċ¤‰ĉ› + var camRotN = Quaternion.Inverse(crot) * camRot; + DrawColliderInternal(collider, camRotN, cpos, crot, cscl, 1.0f); + + // Symmetry + // ċŸèĦŒĉ™‚¨ċŒ˜è¨ˆç—‚’—ĤèĦ¨ç¤ş + ColliderSymmetryMode? smode = ColliderSymmetryMode.None; + Transform symmetryParent = null; + if (EditorApplication.isPlaying) + { + smode = collider.ActiveSymmetryMode; + symmetryParent = collider.ActiveSymmetryTarget; + } + if (smode.HasValue == false || smode == ColliderSymmetryMode.None) + smode = collider.CalcSymmetryMode(out symmetryParent); + if (smode != ColliderSymmetryMode.None && symmetryParent) + { + float3 lpos = ct.localPosition; + //float3 lerot = ct.localEulerAngles; + float3 lerot = MathUtility.ToEuler(ct.localRotation); + float3 lscl = ct.localScale; + float3 center = collider.center; + switch (smode) + { + case ColliderSymmetryMode.X_Symmetry: + lpos.x = -lpos.x; + center.x = -center.x; + lerot.y = -lerot.y; + lerot.z = -lerot.z; + break; + case ColliderSymmetryMode.Y_Symmetry: + lpos.y = -lpos.y; + center.y = -center.y; + lerot.x = -lerot.x; + lerot.z = -lerot.z; + break; + case ColliderSymmetryMode.Z_Symmetry: + lpos.z = -lpos.z; + center.z = -center.z; + lerot.x = -lerot.x; + lerot.y = -lerot.y; + break; + case ColliderSymmetryMode.XYZ_Symmetry: + lpos = -lpos; + center = -center; + break; + default: + return; + } + + // ĉ–ıċ‘ĉ€§ + float direction = 1.0f; + if (collider is MagicaCapsuleCollider) + { + var ccol = collider as MagicaCapsuleCollider; + if (smode == ColliderSymmetryMode.X_Symmetry && ccol.direction == MagicaCapsuleCollider.Direction.X) + direction = -1.0f; + else if (smode == ColliderSymmetryMode.Y_Symmetry && ccol.direction == MagicaCapsuleCollider.Direction.Y) + direction = -1.0f; + else if (smode == ColliderSymmetryMode.Z_Symmetry && ccol.direction == MagicaCapsuleCollider.Direction.Z) + direction = -1.0f; + else if (smode == ColliderSymmetryMode.XYZ_Symmetry) + direction = -1.0f; + } + else if (collider is MagicaPlaneCollider) + { + switch (smode) + { + case ColliderSymmetryMode.Y_Symmetry: + case ColliderSymmetryMode.XYZ_Symmetry: + direction = -1.0f; + break; + } + } + + // ‚·ƒ³ƒĦƒˆƒŞƒĵèĤŞ + float3 ppos = symmetryParent.position; + quaternion prot = symmetryParent.rotation; + float3 pscl = symmetryParent.lossyScale; + + // ƒž‚¤ƒŠ‚ı‚ı‚ħƒĵƒĞ + sclSign = math.sign(pscl); + float3 sclEulerSign = 1; + if (pscl.x < 0 || pscl.y < 0 || pscl.z < 0) + sclEulerSign = sclSign * -1; + + // ‚·ƒ³ƒĦƒˆƒŞƒĵ‚³ƒİ‚¤ƒ€ƒĵċ§żċ‹˘ + float3 wpos = MathUtility.TransformPoint(lpos, ppos, prot, pscl); + quaternion wrot = math.mul(prot, quaternion.Euler(math.radians(lerot * sclEulerSign))); + float3 wscl = pscl * lscl; + wpos += math.mul(wrot, center * sclSign) * wscl * sclSign; + + // ‚ЃĦƒİċ›žèğ˘‚’‚³ƒİ‚¤ƒ€ƒĵƒ­ƒĵ‚ЃĞċ›žèğ˘Ğċ¤‰ĉ› + var camRotS = Quaternion.Inverse(wrot) * camRot; + + Handles.color = selected ? ColorSymmetryCollider : ColorSymmetryCollider * 0.5f; + DrawColliderInternal(collider, camRotS, wpos, wrot, wscl, direction); + } + } + + static void DrawColliderInternal(ColliderComponent collider, Quaternion camRot, Vector3 cpos, Quaternion crot, Vector3 cscl, float direction) + { + var size = collider.GetSize(); + Handles.matrix = Matrix4x4.TRS(cpos, crot, cscl); + if (collider is MagicaSphereCollider) + { + DrawWireSphere(Vector3.zero, Quaternion.identity, size.x, camRot, true); + } + else if (collider is MagicaPlaneCollider) + { + DrawWireCube(Vector3.zero, Quaternion.identity, new Vector3(1.0f, 0.0f, 1.0f) * 1.0f, true); + DrawLine(Vector3.zero, 0.25f * direction * Vector3.up, true); + } + else if (collider is MagicaCapsuleCollider) + { + var c = collider as MagicaCapsuleCollider; + var ldir = c.GetLocalDir() * direction; + var lup = c.GetLocalUp(); + DrawWireCapsule(Vector3.zero, Quaternion.identity, ldir, lup, size.x, size.y, size.z, c.alignedOnCenter, camRot, true); + } + } + + /// + /// ƒŻ‚¤ƒ¤ƒĵ‚Ѓ—‚ğƒĞ‚’ĉç”ğ™‚‹ + /// UnityCapsuleCollider¨ċŒ˜ + /// + /// ċŸşĉş–ċş§ĉ¨™ + /// ċŸşĉş–ċ›žèğ˘ + /// ‚Ѓ—‚ğƒĞĉ–ıċ‘ + /// ‚Ѓ—‚ğƒĞä¸Šĉ–ıċ‘ + /// ‚Ѓ—‚ğƒĞé•·• + /// ċ§‹ç‚ıċŠċ„ + /// 終ç‚ıċŠċ„ + public static void DrawWireCapsule( + Vector3 pos, Quaternion rot, Vector3 scl, + Vector3 ldir, Vector3 lup, + float length, float startRadius, float endRadius, + bool resetMatrix = true + ) + { + Gizmos.matrix = Matrix4x4.TRS(pos, rot, scl); + float slen = length * 0.5f; + float elen = length * 0.5f; + slen = Mathf.Max(slen - startRadius, 0.0f); + elen = Mathf.Max(elen - endRadius, 0.0f); + var sl = ldir * slen; + var el = -ldir * elen; + Gizmos.DrawWireSphere(sl, startRadius); + Gizmos.DrawWireSphere(el, endRadius); + + for (int i = 0; i < 360; i += 45) + { + var q = Quaternion.AngleAxis(i, ldir); + var up1 = q * (lup * startRadius); + var up2 = q * (lup * endRadius); + Gizmos.DrawLine(sl + up1, el + up2); + } + + // 45ċşĤš‚‰—Ĥ‚‚†ïĵ‘ċ›žçƒ‚’ĉ + Gizmos.matrix = Matrix4x4.TRS(pos, rot * Quaternion.AngleAxis(45, ldir), scl); + Gizmos.DrawWireSphere(sl, startRadius); + Gizmos.DrawWireSphere(el, endRadius); + + if (resetMatrix) + Gizmos.matrix = Matrix4x4.identity; + } + + /// + /// ƒŻ‚¤ƒ¤ƒĵ球‚’ĉç”ğ™‚‹ + /// UnitySphereCollider¨ċŒ˜ + /// + /// ċŸşĉş–ċş§ĉ¨™ + /// ċŸşĉş–ċ›žèğ˘ + /// ċŠċ„ + /// + public static void DrawWireSphere( + Vector3 pos, Quaternion rot, Vector3 scl, float radius, + bool drawSphere, bool drawAxis, + bool resetMatrix = true) + { + //Gizmos.matrix = Matrix4x4.TRS(pos, rot, Vector3.one); + Gizmos.matrix = Matrix4x4.TRS(pos, rot, scl); + + // 球 + if (drawSphere) + Gizmos.DrawWireSphere(Vector3.zero, radius); + + // èğ¸ + if (drawAxis) + { + const float axisRadius = 0.03f; + Gizmos.color = Color.red; + Gizmos.DrawLine(Vector3.zero, Vector3.right * axisRadius); + Gizmos.color = Color.green; + Gizmos.DrawLine(Vector3.zero, Vector3.up * axisRadius); + Gizmos.color = Color.blue; + Gizmos.DrawLine(Vector3.zero, Vector3.forward * axisRadius); + } + + // 45ċşĤš‚‰—Ĥ‚‚†ïĵ‘ċ›žçƒ‚’ĉ + //Gizmos.matrix = Matrix4x4.TRS(pos, rot * Quaternion.AngleAxis(45, Vector3.up), Vector3.one); + //Gizmos.DrawWireSphere(Vector3.zero, radius); + + if (resetMatrix) + Gizmos.matrix = Matrix4x4.identity; + } + +#if false + /// + /// ƒŻ‚¤ƒ¤ƒĵƒœƒƒ‚Ż‚ı‚’ĉç”ğ™‚‹ + /// + /// + /// + /// + /// + public static void DrawWireCube(Vector3 pos, Quaternion rot, Vector3 size, bool resetMatrix = true) + { + Gizmos.matrix = Matrix4x4.TRS(pos, rot, Vector3.one); + Gizmos.DrawWireCube(Vector3.zero, size); + if (resetMatrix) + Gizmos.matrix = Matrix4x4.identity; + } +#endif + + public static void DrawWireCone(Vector3 pos, Quaternion rot, float length, float radius, int div = 8) + { + Gizmos.matrix = Matrix4x4.TRS(pos, rot, Vector3.one); + var epos = Vector3.forward * length; + Vector3 oldpos = epos; + for (int i = 0; i < div; i++) + { + float t = (float)i / (float)div; + var q = Quaternion.AngleAxis(t * 360.0f, Vector3.forward); + var x = q * Vector3.right * radius; + Gizmos.DrawLine(Vector3.zero, epos + x); + Gizmos.DrawLine(epos, epos + x); + + if (i > 0) + Gizmos.DrawLine(oldpos, epos + x); + + oldpos = epos + x; + } + + Gizmos.DrawLine(oldpos, epos + Vector3.right * radius); + + + Gizmos.matrix = Matrix4x4.identity; + } + + /// + /// ƒŻ‚¤ƒ¤ƒĵ矢ċ°‚’ĉç”ğ™‚‹ + /// + /// + /// + /// + /// ċċ­—ĉç”ğ + public static void DrawWireArrow(Vector3 pos, Quaternion rot, Vector3 size, bool cross = false) + { + //Gizmos.matrix = Matrix4x4.TRS(pos, rot, size); + Handles.matrix = Matrix4x4.TRS(pos, rot, size); + + Vector3[] points = new Vector3[] + { + new Vector3(0.0f, 0.0f, -1.0f), + new Vector3(0.0f, 0.5f, -1.0f), + new Vector3(0.0f, 0.5f, 0.0f), + new Vector3(0.0f, 1.0f, 0.0f), + new Vector3(0.0f, 0.0f, 1.0f), + }; + + float addAngle = cross ? 90.0f : 180.0f; + int loop = cross ? 4 : 2; + + for (int j = 0; j < loop; j++) + { + for (int i = 0; i < points.Length - 1; i++) + { + //Gizmos.DrawLine(points[i], points[i + 1]); + Handles.DrawLine(points[i], points[i + 1]); + } + + rot = rot * Quaternion.AngleAxis(addAngle, Vector3.forward); + //Gizmos.matrix = Matrix4x4.TRS(pos, rot, size); + Handles.matrix = Matrix4x4.TRS(pos, rot, size); + } + + //Gizmos.matrix = Matrix4x4.identity; + Handles.matrix = Matrix4x4.identity; + } + + /// + /// XYZè𸂒ĉç”ğ™‚‹ + /// + /// + /// + /// + /// + public static void DrawAxis(Vector3 pos, Quaternion rot, float size, bool resetMatrix = true) + { + Gizmos.matrix = Matrix4x4.TRS(pos, rot, Vector3.one); + Gizmos.color = Color.red; + Gizmos.DrawRay(Vector3.zero, Vector3.right * size); + Gizmos.color = Color.green; + Gizmos.DrawRay(Vector3.zero, Vector3.up * size); + Gizmos.color = Color.blue; + Gizmos.DrawRay(Vector3.zero, Vector3.forward * size); + if (resetMatrix) + Gizmos.matrix = Matrix4x4.identity; + } + + /// + /// ƒœƒĵƒ³ċ½˘çŠĥ‚’ĉç”ğ™‚‹ + /// + /// + /// + /// + public static void DrawBone(Vector3 pos, Vector3 tpos, float size) + { + var v = tpos - pos; + var rot = Quaternion.FromToRotation(Vector3.forward, v); + + Gizmos.matrix = Matrix4x4.TRS(pos, rot, Vector3.one); + Gizmos.color = ColorSkinningBone; + + Gizmos.DrawWireSphere(Vector3.zero, size); + + //Gizmos.DrawLine(Vector3.zero, Vector3.forward * v.magnitude); + float bsize = size * 0.8f; + float zoff = size; + var gpos = Vector3.forward * v.magnitude; + var p0 = new Vector3(bsize, bsize, zoff); + var p1 = new Vector3(bsize, -bsize, zoff); + var p2 = new Vector3(-bsize, -bsize, zoff); + var p3 = new Vector3(-bsize, bsize, zoff); + + Gizmos.DrawLine(p0, gpos); + Gizmos.DrawLine(p1, gpos); + Gizmos.DrawLine(p2, gpos); + Gizmos.DrawLine(p3, gpos); + + Gizmos.DrawLine(p0, p1); + Gizmos.DrawLine(p1, p2); + Gizmos.DrawLine(p2, p3); + Gizmos.DrawLine(p3, p0); + + Gizmos.matrix = Matrix4x4.identity; + } + + //========================================================================================= + /// + /// HandlesĞ‚ˆ‚‹‚³ƒĵƒ³ĉç”ğ + /// + /// + /// + /// + /// 角ċşĤ(deg) + /// + /// + /// + public static void ConeHandle( + Vector3 pos, Quaternion rot, float size, float angle, + Color coneColor, Color wireColor, float wireThickness = 1.0f, + int controllId = 0 + ) + { + // ƒ‡ƒ•‚݃Ѓˆ‚³ƒĵƒ³ĉç”ğŻè§’ċşĤ‚„ç›´ċ„Œĉħş£Ĥ„‚‹§ĉç”ğ角ċşĤĞ‚ˆ‚Ё‚Œ‚’‚ı‚ħƒĵƒŞƒ³‚°•›‚‹ + // ‚µ‚¤‚şïĵ‘‚ރނ¸ƒŠƒĞ‚³ƒĵƒ³ĉƒ…ċ ħ + // ċş•面ċŠċ„0.4, 直ċ„0.8 + // éИ•1.2ïĵˆä¸­ċżƒ‹‚‰ċş•面§0.5, 中ċżƒ‹‚‰ċ§‹ç‚ı§0.7) + // 角ċşĤ18.434948ċşĤ + + //float size = scr.size; + float rad = Mathf.Deg2Rad * angle; + float z = Mathf.Cos(rad); + float xy = Mathf.Sin(rad); + + // 角ċşĤ18.434948ċ€çއ + const float cosBaseScl = 1.0f / 0.94868329f; + const float sinBaseScl = 1.0f / 0.31622775f; + z *= cosBaseScl; + xy *= sinBaseScl; + //Debug.Log(z); + + float zoffset = size * 0.7f; + + //readonly Quaternion flipQ = Quaternion.AngleAxis(180.0f, Vector3.up); + + //Handles.matrix = Matrix4x4.TRS(Vector3.zero, rot, new Vector3(xy, xy, z)); + Handles.matrix = Matrix4x4.TRS(pos, rot * FlipZ, new Vector3(xy, xy, z)); + //var pos = transform.position; + + // cone + Handles.color = coneColor; + Vector3 offset = new Vector3(0.0f, 0.0f, -zoffset); + Handles.ConeHandleCap( + controllId, + //pos + offset, + offset, + Quaternion.identity, + size, + EventType.Repaint + ); + + // wire dist + Handles.color = wireColor; + Handles.DrawWireDisc( + //pos + new Vector3(0.0f, 0.0f, -size * 1.2f), + new Vector3(0.0f, 0.0f, -size * 1.2f), + Vector3.forward, + size * (0.4f / 1.0f), + wireThickness + ); + + // wire + //Handles.color = scr.wireColor; + //var spos = pos; + const int div = 6; + const float angStep = 360.0f / div; + for (int i = 0; i < div; i++) + { + float ang = Mathf.Deg2Rad * i * angStep; + float x = Mathf.Sin(ang); + float y = Mathf.Cos(ang); + x *= size * (0.4f / 1.0f); + y *= size * (0.4f / 1.0f); + //Handles.DrawLine(spos, new Vector3(x, y, -size * 1.2f), wireThickness); + Handles.DrawLine(Vector3.zero, new Vector3(x, y, -size * 1.2f), wireThickness); + } + + Handles.matrix = Matrix4x4.identity; + } + + /// + /// ĉ‰‡‚’ĉç”ğ™‚‹ + /// + /// + /// + /// + /// + /// + /// + /// + /// + public static void ArcHandle( + Vector3 pos, Quaternion rot, float angle, float size, float wireThickness, + Color arcColor1, Color arcColor2, Color wireColor + ) + { + var up = rot * Vector3.up; + var right = rot * Vector3.right; + var forward = rot * Vector3.forward; + + Handles.color = arcColor1; + Handles.DrawSolidArc(pos, up, forward, angle, size); + Handles.DrawSolidArc(pos, -up, forward, angle, size); + + Handles.color = arcColor2; + Handles.DrawSolidArc(pos, right, forward, angle, size); + Handles.DrawSolidArc(pos, -right, forward, angle, size); + + Handles.color = wireColor; + Handles.DrawLine(pos, pos + forward * size, wireThickness); + + } + + //========================================================================================= + public static void DrawWindZone(MagicaWindZone windZone, Quaternion camRot, bool selected) + { + if (windZone == null) + return; + + // ‚ƒĵƒ³ + Handles.matrix = windZone.transform.localToWorldMatrix; + Handles.color = selected ? ColorWindZone : ColorWindZone * 0.5f; + + switch (windZone.mode) + { + case MagicaWindZone.Mode.GlobalDirection: + break; + case MagicaWindZone.Mode.BoxDirection: + DrawWireCube(Vector3.zero, Quaternion.identity, windZone.size, true); + break; + case MagicaWindZone.Mode.SphereDirection: + case MagicaWindZone.Mode.SphereRadial: + // ‚ЃĦƒİċ›žèğ˘‚’‚³ƒİ‚¤ƒ€ƒĵƒ­ƒĵ‚ЃĞċ›žèğ˘Ğċ¤‰ĉ› + camRot = Quaternion.Inverse(windZone.transform.rotation) * camRot; + DrawWireSphere(Vector3.zero, Quaternion.identity, windZone.radius, camRot, true); + break; + } + + // ĉ–ıċ‘ + Handles.color = selected ? ColorWindArrow : ColorWindArrow * 0.5f; + var pos = windZone.transform.position; + const float gsize = 0.5f; + if (windZone.IsDirection()) + { + var rot = MathUtility.AxisQuaternion(windZone.GetWindDirection()); + DrawWireArrow(pos, rot, new Vector3(gsize, gsize, gsize * 2), true); + } + else if (windZone.IsRadial()) + { + DrawLine(new Vector3(0, -gsize, 0), new Vector3(0, gsize, 0), true); + DrawLine(new Vector3(-gsize, 0, 0), new Vector3(gsize, 0, 0), true); + DrawLine(new Vector3(0, 0, -gsize), new Vector3(0, 0, gsize), true); + } + + Handles.matrix = Matrix4x4.identity; + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Editor/Gizmos/GizmoUtility.cs.meta b/Assets/MagicaCloth2/Scripts/Editor/Gizmos/GizmoUtility.cs.meta new file mode 100644 index 00000000..0a285dfc --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/Gizmos/GizmoUtility.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: d09127cc59c08ae44aeeee33f206f227 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Editor/Gizmos/GizmoUtility.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Editor/Gizmos/MagicaCapsuleColliderGizmoDrawer.cs b/Assets/MagicaCloth2/Scripts/Editor/Gizmos/MagicaCapsuleColliderGizmoDrawer.cs new file mode 100644 index 00000000..89cb51ea --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/Gizmos/MagicaCapsuleColliderGizmoDrawer.cs @@ -0,0 +1,19 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using UnityEditor; + +namespace MagicaCloth2 +{ + /// + /// MagicaCapsuleCollider‚‚şƒ˘èĦ¨ç¤ş + /// + public class MagicaCapsuleColliderGizmoDrawer + { + [DrawGizmo(GizmoType.Active | GizmoType.NonSelected | GizmoType.InSelectionHierarchy)] + static void DrawGizmo(MagicaCapsuleCollider scr, GizmoType gizmoType) + { + ClothEditorManager.RegisterComponent(scr, gizmoType); + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Editor/Gizmos/MagicaCapsuleColliderGizmoDrawer.cs.meta b/Assets/MagicaCloth2/Scripts/Editor/Gizmos/MagicaCapsuleColliderGizmoDrawer.cs.meta new file mode 100644 index 00000000..9266767d --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/Gizmos/MagicaCapsuleColliderGizmoDrawer.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 7b1758b936826f64fbd4ccf459e1b4dd +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Editor/Gizmos/MagicaCapsuleColliderGizmoDrawer.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Editor/Gizmos/MagicaClothGizmoDrawer.cs b/Assets/MagicaCloth2/Scripts/Editor/Gizmos/MagicaClothGizmoDrawer.cs new file mode 100644 index 00000000..1ccedb28 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/Gizmos/MagicaClothGizmoDrawer.cs @@ -0,0 +1,19 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using UnityEditor; + +namespace MagicaCloth2 +{ + /// + /// MagicaCloth‚³ƒ³ƒƒĵƒƒ³ƒˆ‚‚şƒ˘èĦ¨ç¤ş + /// + public class MagicaClothGizmoDrawer + { + [DrawGizmo(GizmoType.Active | GizmoType.NonSelected | GizmoType.InSelectionHierarchy)] + static void DrawGizmo(MagicaCloth cloth, GizmoType gizmoType) + { + ClothEditorManager.RegisterComponent(cloth, gizmoType); + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Editor/Gizmos/MagicaClothGizmoDrawer.cs.meta b/Assets/MagicaCloth2/Scripts/Editor/Gizmos/MagicaClothGizmoDrawer.cs.meta new file mode 100644 index 00000000..b1627295 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/Gizmos/MagicaClothGizmoDrawer.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 74bd6289c38f5474b8b019772117a679 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Editor/Gizmos/MagicaClothGizmoDrawer.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Editor/Gizmos/MagicaPlaneColliderGizmoDrawer.cs b/Assets/MagicaCloth2/Scripts/Editor/Gizmos/MagicaPlaneColliderGizmoDrawer.cs new file mode 100644 index 00000000..5be19274 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/Gizmos/MagicaPlaneColliderGizmoDrawer.cs @@ -0,0 +1,19 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using UnityEditor; + +namespace MagicaCloth2 +{ + /// + /// MagicaPlaneCollider‚‚şƒ˘èĦ¨ç¤ş + /// + public class MagicaPlaneColliderGizmoDrawer + { + [DrawGizmo(GizmoType.Active | GizmoType.NonSelected | GizmoType.InSelectionHierarchy)] + static void DrawGizmo(MagicaPlaneCollider scr, GizmoType gizmoType) + { + ClothEditorManager.RegisterComponent(scr, gizmoType); + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Editor/Gizmos/MagicaPlaneColliderGizmoDrawer.cs.meta b/Assets/MagicaCloth2/Scripts/Editor/Gizmos/MagicaPlaneColliderGizmoDrawer.cs.meta new file mode 100644 index 00000000..92c74226 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/Gizmos/MagicaPlaneColliderGizmoDrawer.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 4ca64167845464543866cbfb4e1bfede +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Editor/Gizmos/MagicaPlaneColliderGizmoDrawer.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Editor/Gizmos/MagicaSphereColliderGizmoDrawer.cs b/Assets/MagicaCloth2/Scripts/Editor/Gizmos/MagicaSphereColliderGizmoDrawer.cs new file mode 100644 index 00000000..db7ea69a --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/Gizmos/MagicaSphereColliderGizmoDrawer.cs @@ -0,0 +1,19 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using UnityEditor; + +namespace MagicaCloth2 +{ + /// + /// MagicaSphereCollider‚‚şƒ˘èĦ¨ç¤ş + /// + public class MagicaSphereColliderGizmoDrawer + { + [DrawGizmo(GizmoType.Active | GizmoType.NonSelected | GizmoType.InSelectionHierarchy)] + static void DrawGizmo(MagicaSphereCollider scr, GizmoType gizmoType) + { + ClothEditorManager.RegisterComponent(scr, gizmoType); + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Editor/Gizmos/MagicaSphereColliderGizmoDrawer.cs.meta b/Assets/MagicaCloth2/Scripts/Editor/Gizmos/MagicaSphereColliderGizmoDrawer.cs.meta new file mode 100644 index 00000000..83a8386a --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/Gizmos/MagicaSphereColliderGizmoDrawer.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 0200526b5666bc94bb5b3f16765a1b96 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Editor/Gizmos/MagicaSphereColliderGizmoDrawer.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Editor/Gizmos/MagicaWindZoneGizmoDrawer.cs b/Assets/MagicaCloth2/Scripts/Editor/Gizmos/MagicaWindZoneGizmoDrawer.cs new file mode 100644 index 00000000..12bd93f7 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/Gizmos/MagicaWindZoneGizmoDrawer.cs @@ -0,0 +1,16 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using UnityEditor; + +namespace MagicaCloth2 +{ + public class MagicaWindZoneGizmoDrawer + { + [DrawGizmo(GizmoType.Active | GizmoType.NonSelected | GizmoType.InSelectionHierarchy)] + static void DrawGizmo(MagicaWindZone scr, GizmoType gizmoType) + { + ClothEditorManager.RegisterComponent(scr, gizmoType); + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Editor/Gizmos/MagicaWindZoneGizmoDrawer.cs.meta b/Assets/MagicaCloth2/Scripts/Editor/Gizmos/MagicaWindZoneGizmoDrawer.cs.meta new file mode 100644 index 00000000..a17bd052 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/Gizmos/MagicaWindZoneGizmoDrawer.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 4ad4eda344968ea4ab9b9f512b8c7278 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Editor/Gizmos/MagicaWindZoneGizmoDrawer.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Editor/MagicaCloth2.Editor.asmdef b/Assets/MagicaCloth2/Scripts/Editor/MagicaCloth2.Editor.asmdef new file mode 100644 index 00000000..7b3f9332 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/MagicaCloth2.Editor.asmdef @@ -0,0 +1,35 @@ +{ + "name": "MagicaClothV2.Editor", + "rootNamespace": "", + "references": [ + "Unity.Mathematics", + "Unity.Collections", + "Unity.Burst", + "MagicaClothV2" + ], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [ + "MC2_BURST", + "MC2_COLLECTIONS" + ], + "versionDefines": [ + { + "name": "com.unity.burst", + "expression": "1.8.1", + "define": "MC2_BURST" + }, + { + "name": "com.unity.collections", + "expression": "1.4.0", + "define": "MC2_COLLECTIONS" + } + ], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Assets/MagicaCloth2/Scripts/Editor/MagicaCloth2.Editor.asmdef.meta b/Assets/MagicaCloth2/Scripts/Editor/MagicaCloth2.Editor.asmdef.meta new file mode 100644 index 00000000..bfdde843 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/MagicaCloth2.Editor.asmdef.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 4c01641db757d0e4f85a4358c823601a +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Editor/MagicaCloth2.Editor.asmdef + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Editor/PreBuild.meta b/Assets/MagicaCloth2/Scripts/Editor/PreBuild.meta new file mode 100644 index 00000000..bbbd80b8 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/PreBuild.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d09f86fb6833fb048935d02b3254e292 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Scripts/Editor/PreBuild/PreBuildDataCreation.cs b/Assets/MagicaCloth2/Scripts/Editor/PreBuild/PreBuildDataCreation.cs new file mode 100644 index 00000000..9f14b404 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/PreBuild/PreBuildDataCreation.cs @@ -0,0 +1,514 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2024 MagicaSoft. +// https://magicasoft.jp +using System; +using System.Collections.Generic; +using Unity.Mathematics; +using UnityEditor; +using UnityEngine; + +namespace MagicaCloth2 +{ + /// + /// PreBuildDataä½œĉˆ + /// + public static class PreBuildDataCreation + { + /// + /// PreBuildData‚’作ĉˆ—‚˘‚ğƒƒƒˆ¨—Ĥ保ċ­˜™‚‹. + /// Create PreBuildData and save it as an asset. + /// + /// + /// Show save dialog if ScriptableObject does not exist. + /// + public static ResultCode CreatePreBuildData(MagicaCloth cloth, bool useNewSaveDialog = true) + { + var sdata = cloth.SerializeData; + var preBuildData = cloth.GetSerializeData2().preBuildData; + string buildId = preBuildData.buildId; + + // ƒ“ƒĞƒ‰IDŒċ­˜ċœ¨—Ş„ċ ´ċˆŻ““§ĉ–°èĤä½œĉˆ™‚‹ + if (string.IsNullOrEmpty(buildId)) + { + buildId = PreBuildSerializeData.GenerateBuildID(); + } + + // ‚ı‚ŻƒŞƒ—‚żƒ–ƒĞ‚ރ–‚¸‚§‚Żƒˆ¸äżċ­˜ + if (preBuildData.preBuildScriptableObject == null && useNewSaveDialog) + { + string assetName = $"MagicaPreBuild_{buildId}"; + + // 保ċ­˜ƒ•‚݃Ѓ€èŞ­żèĵż + const string StateKey = "MagicaCloth2_PreBuild_Folder"; + string path = SessionState.GetString(StateKey, "Assets/"); + + string assetPath = EditorUtility.SaveFilePanelInProject("Saving MagicaCloth pre-build data", assetName, "asset", "MagicaCloth pre-build data name", path); + //Debug.Log($"AssetPath:{assetPath}"); + if (string.IsNullOrEmpty(assetPath)) + return new ResultCode(Define.Result.Cancel); + + // 保ċ­˜ƒ•‚݃Ѓ€ĉ›¸èĵż + SessionState.SetString(StateKey, System.IO.Path.GetDirectoryName(assetPath)); + + var sobj = ScriptableObject.CreateInstance(); + AssetDatabase.CreateAsset(sobj, assetPath); + AssetDatabase.Refresh(); + + preBuildData.preBuildScriptableObject = sobj; + } + + var preBuildScriptableObject = preBuildData.preBuildScriptableObject; + if (preBuildScriptableObject == null) + return new ResultCode(Define.Result.PreBuild_InvalidPreBuildData); + + // ĉ§‹ç݉ + var sharePreBuildData = new SharePreBuildData(); + var uniquePreBuildData = new UniquePreBuildData(); + if (sdata.IsValid()) + { + MakePreBuildData(cloth, buildId, sharePreBuildData, uniquePreBuildData); + } + else + { + sharePreBuildData.buildResult.SetError(Define.Result.PreBuildData_InvalidClothData); + } + + // ƒ‡ƒĵ‚ż‚·ƒŞ‚˘ƒİ‚¤‚ş + preBuildData.buildId = buildId; + preBuildScriptableObject.AddPreBuildData(sharePreBuildData); + preBuildData.uniquePreBuildData = uniquePreBuildData; + + EditorUtility.SetDirty(preBuildScriptableObject); + EditorUtility.SetDirty(cloth); + AssetDatabase.Refresh(); + + return sharePreBuildData.buildResult; + } + + static void MakePreBuildData(MagicaCloth cloth, string buildId, SharePreBuildData sharePreBuildData, UniquePreBuildData uniquePreBuildData) + { + //Debug.Log($"MakePreBuildData().start"); + //var span = new TimeSpan("PreBuild"); + + sharePreBuildData.version = Define.System.LatestPreBuildVersion; + sharePreBuildData.buildId = buildId; + sharePreBuildData.buildResult.SetProcess(); + uniquePreBuildData.version = Define.System.LatestPreBuildVersion; + uniquePreBuildData.buildResult.SetProcess(); + + var setupDataList = new List(); + VirtualMesh proxyMesh = null; + var renderMeshList = new List(); + + try + { + var sdata = cloth.SerializeData; + var sdata2 = cloth.GetSerializeData2(); + var clothType = sdata.clothType; + + //======================== Initialize ============================ + // ‚Żƒ­‚ı‚’生ĉˆ™‚‹Ÿ‚ĉœ€ä½Žé™ĉƒ…ċ ħŒĉƒ£Ĥ„‚‹‹ƒ‚§ƒƒ‚݁™‚‹ + if (sdata.IsValid() == false) + { + sharePreBuildData.buildResult.SetResult(sdata.VerificationResult); + throw new MagicaClothProcessingException(); + } + + // ċˆĉœŸƒˆƒİƒ³‚ıƒ•‚݃ĵƒ çŠĥĉ…‹ + var clothTransformRecord = new TransformRecord(cloth.ClothTransform, read: true); + + // ĉ³•ç·šèŞżĉ•´ç”¨ƒˆƒİƒ³‚ıƒ•‚݃ĵƒ  + var normalAdjustmentTransformRecord = new TransformRecord( + sdata.normalAlignmentSetting.adjustmentTransform ? + sdata.normalAlignmentSetting.adjustmentTransform : + cloth.ClothTransform, read: true); + + // ‚ğƒƒƒˆ‚˘ƒƒƒ—ĉƒ…ċ ħċˆĉœŸċŒ– + if (clothType == ClothProcess.ClothType.MeshCloth) + { + foreach (var ren in sdata.sourceRenderers) + { + if (ren) + { + var setupData = new RenderSetupData(null, ren); + if (setupData.IsFaild()) + { + sharePreBuildData.buildResult.Merge(setupData.result); + throw new MagicaClothProcessingException(); + } + setupDataList.Add(setupData); + + // ‚ğƒƒƒˆ‚˘ƒƒƒ—ĉƒ…ċ ħ‚·ƒŞ‚˘ƒİ‚¤‚ş + sharePreBuildData.renderSetupDataList.Add(setupData.ShareSerialize()); + uniquePreBuildData.renderSetupDataList.Add(setupData.UniqueSerialize()); + } + } + } + else if (clothType == ClothProcess.ClothType.BoneCloth || clothType == ClothProcess.ClothType.BoneSpring) + { + var setupData = new RenderSetupData( + null, + clothType == ClothProcess.ClothType.BoneCloth ? RenderSetupData.SetupType.BoneCloth : RenderSetupData.SetupType.BoneSpring, + clothTransformRecord.transform, + sdata.rootBones, + clothType == ClothProcess.ClothType.BoneCloth ? null : sdata.colliderCollisionConstraint.collisionBones, + clothType == ClothProcess.ClothType.BoneCloth ? sdata.connectionMode : RenderSetupData.BoneConnectionMode.Line, + cloth.name + ); + if (setupData.IsFaild()) + { + sharePreBuildData.buildResult.Merge(setupData.result); + throw new MagicaClothProcessingException(); + } + setupDataList.Add(setupData); + } + + // ‚Ğ‚ı‚żƒ ‚ı‚­ƒ‹ƒ³‚°ƒœƒĵƒ³ĉƒ…ċ ħ + List customSkinningBoneRecords = new List(); + int bcnt = sdata.customSkinningSetting.skinningBones.Count; + for (int i = 0; i < bcnt; i++) + { + customSkinningBoneRecords.Add(new TransformRecord(sdata.customSkinningSetting.skinningBones[i], read: true)); + } + + //======================== Proxy/Mapping Mesh ============================ + // ƒš‚¤ƒ³ƒˆƒžƒƒƒ—ĉƒ…ċ ħ + bool usePaintMap = false; + var paintMapDataList = new List(); + if (clothType == ClothProcess.ClothType.MeshCloth && sdata.paintMode != ClothSerializeData.PaintMode.Manual) + { + var ret = cloth.Process.GeneratePaintMapDataList(paintMapDataList); + Develop.DebugLog($"Generate paint map data list. {ret.GetResultString()}"); + if (ret.IsError()) + { + sharePreBuildData.buildResult.Merge(ret); + throw new MagicaClothProcessingException(); + } + //if (paintMapDataList.Count != renderHandleList.Count) + if (paintMapDataList.Count != setupDataList.Count) + { + sharePreBuildData.buildResult.SetError(Define.Result.CreateCloth_PaintMapCountMismatch); + throw new MagicaClothProcessingException(); + } + usePaintMap = true; + } + + // ‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚ż + SelectionData selectionData = usePaintMap ? new SelectionData() : sdata2.selectionData.Clone(); + bool isValidSelection = selectionData?.IsValid() ?? false; + + // ƒ—ƒ­‚­‚·ƒĦƒƒ‚·ƒä½œĉˆ + proxyMesh = new VirtualMesh("Proxy"); + proxyMesh.result.SetProcess(); + if (clothType == ClothProcess.ClothType.MeshCloth) + { + + // MeshCloth§Ż‚Żƒ­‚ıƒˆƒİƒ³‚ıƒ•‚݃ĵƒ ‚’èż½ċŠ —ĤŠ + proxyMesh.SetTransform(clothTransformRecord); + + if (setupDataList.Count == 0) + { + sharePreBuildData.buildResult.SetError(Define.Result.ClothProcess_InvalidRenderHandleList); + throw new MagicaClothProcessingException(); + } + + // render mesh import + selection + merge + for (int i = 0; i < setupDataList.Count; i++) + { + VirtualMesh renderMesh = null; + try + { + // ƒĴƒ³ƒ€ƒĵƒĦƒƒ‚·ƒä½œĉˆ + var renderSetupData = setupDataList[i]; + renderMesh = new VirtualMesh($"[{renderSetupData.name}]"); + renderMesh.result.SetProcess(); + + // import ------------------------------------------------- + renderMesh.ImportFrom(renderSetupData, sdata.GetUvChannel()); + if (renderMesh.IsError) + { + sharePreBuildData.buildResult.Merge(renderMesh.result); + throw new MagicaClothProcessingException(); + } + Develop.DebugLog($"(IMPORT) {renderMesh}"); + + // selection ---------------------------------------------- + // MeshCloth§ƒš‚¤ƒ³ƒˆƒ†‚Ż‚ıƒƒ£ĉŒ‡ċšċ ´ċˆŻ‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚ż‚’生ĉˆ™‚‹ + SelectionData renderSelectionData = selectionData; + if (usePaintMap) + { + // ‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚żç”Ÿĉˆ + var ret = cloth.Process.GenerateSelectionDataFromPaintMap(clothTransformRecord, renderMesh, paintMapDataList[i], out renderSelectionData); + Develop.DebugLog($"Generate selection from paint map. {ret.GetResultString()}"); + if (ret.IsError()) + { + sharePreBuildData.buildResult.Merge(ret); + throw new MagicaClothProcessingException(); + } + + // ‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚żçµċˆ + selectionData.Merge(renderSelectionData); + } + isValidSelection = selectionData?.IsValid() ?? false; + + // ƒĦƒƒ‚·ƒċˆ‡‚Šċ–‚Š + if (renderSelectionData?.IsValid() ?? false) + { + // 余白 + float mergin = renderMesh.CalcSelectionMergin(sdata.reductionSetting); + mergin = math.max(mergin, Define.System.MinimumGridSize); + + // ‚ğƒĴ‚Ż‚·ƒ§ƒ³ĉƒ…ċ ħ‹‚‰ċˆ‡‚Šċ–‚ЁċŸèĦŒ + // ƒš‚¤ƒ³ƒˆƒžƒƒƒ—ċ ´ċˆŻƒĴƒ³ƒ€ƒİƒĵ”¨‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚ż§ċˆ‡‚Šċ–‚Š + renderMesh.SelectionMesh(renderSelectionData, clothTransformRecord.localToWorldMatrix, mergin); + if (renderMesh.IsError) + { + sharePreBuildData.buildResult.Merge(renderMesh.result); + throw new MagicaClothProcessingException(); + } + Develop.DebugLog($"(SELECTION) {renderMesh}"); + } + + // ƒĴƒ³ƒ€ƒĵƒĦƒƒ‚·ƒä½œĉˆċŒäş† + renderMesh.result.SetSuccess(); + + // merge -------------------------------------------------- + proxyMesh.AddMesh(renderMesh); + + // ƒĴƒ³ƒ€ƒĵƒĦƒƒ‚·ƒĉƒ…ċ ħ‚’記録 + renderMeshList.Add(renderMesh); + renderMesh = null; + } + catch (MagicaClothProcessingException) + { + throw; + } + catch (Exception exception) + { + Debug.LogException(exception); + sharePreBuildData.buildResult.SetError(Define.Result.ClothProcess_Exception); + throw; + } + finally + { + // “ĉ™‚ç‚ı§ä½œĉ­ç”¨renderMeshŒċ­˜ċœ¨™‚‹ċ ´ċˆŻä¸­ĉ–­•‚ŒĤ„‚‹§é–‹ĉ”™‚‹ + renderMesh?.Dispose(); + } + } + Develop.DebugLog($"(MERGE) {proxyMesh}"); + + // ƒŞƒ€‚Ż‚·ƒ§ƒ³ + if (proxyMesh.VertexCount > 1) + { + if (sdata.reductionSetting.IsEnabled) + { + proxyMesh.Reduction(sdata.reductionSetting, System.Threading.CancellationToken.None); + if (proxyMesh.IsError) + { + sharePreBuildData.buildResult.Merge(proxyMesh.result); + throw new MagicaClothProcessingException(); + } + + Develop.DebugLog($"(REDUCTION) {proxyMesh}"); + } + } + } + else if (clothType == ClothProcess.ClothType.BoneCloth || clothType == ClothProcess.ClothType.BoneSpring) + { + // import + var boneClothSetupData = setupDataList[0]; + proxyMesh.ImportFrom(boneClothSetupData, 0); + if (proxyMesh.IsError) + { + sharePreBuildData.buildResult.Merge(proxyMesh.result); + throw new MagicaClothProcessingException(); + } + Develop.DebugLog($"(IMPORT) {proxyMesh}"); + + // ‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚żŒċ­˜ċœ¨—Ş„ċ ´ċˆŻç°Ħĉ˜“作ĉˆ™‚‹ + if (isValidSelection == false) + { + selectionData = new SelectionData(proxyMesh, float4x4.identity); + if (selectionData.Count > 0) + { + // š™ıĤç§ğċ‹•設ċš + selectionData.Fill(VertexAttribute.Move); + + // ĉĴĦĞƒĞƒĵƒˆżċ›şċš + foreach (MagicaObjectId id in boneClothSetupData.rootTransformIdList) + { + int rootIndex = boneClothSetupData.GetTransformIndexFromId(id); + selectionData.attributes[rootIndex] = VertexAttribute.Fixed; + } + isValidSelection = selectionData.IsValid(); + } + } + } + + // ċ…ƒé ‚ç‚ı‹‚‰çµċˆé ‚ç‚ı¸‚¤ƒ³ƒ‡ƒƒ‚Ż‚ı‚’ċˆĉœŸċŒ– + if (proxyMesh.joinIndices.IsCreated == false) + { + proxyMesh.joinIndices = new Unity.Collections.NativeArray(proxyMesh.VertexCount, Unity.Collections.Allocator.Persistent); + JobUtility.SerialNumberRun(proxyMesh.joinIndices, proxyMesh.VertexCount); // é€£ç•Ş‚’¤‘‚‹ + } + + // optimization + proxyMesh.Optimization(); + if (proxyMesh.IsError) + { + sharePreBuildData.buildResult.Merge(proxyMesh.result); + throw new MagicaClothProcessingException(); + } + Develop.DebugLog($"(OPTIMIZE) {proxyMesh}"); + + // attribute + if (isValidSelection) + { + // ‚ğƒĴ‚Ż‚·ƒ§ƒ³ƒ‡ƒĵ‚ż‹‚‰é ‚ç‚ıċħžĉ€§‚’äğ˜ä¸Ž™‚‹ + proxyMesh.ApplySelectionAttribute(selectionData); + if (proxyMesh.IsError) + { + sharePreBuildData.buildResult.Merge(proxyMesh.result); + throw new MagicaClothProcessingException(); + } + } + + // proxy meshïĵˆċħžĉ€§ĉħşċšċŒĞċŸèĦŒïĵ‰ + proxyMesh.ConvertProxyMesh(sdata, clothTransformRecord, customSkinningBoneRecords, normalAdjustmentTransformRecord); + if (proxyMesh.IsError) + { + sharePreBuildData.buildResult.Merge(proxyMesh.result); + throw new MagicaClothProcessingException(); + } + Develop.DebugLog($"(PROXY) {proxyMesh}"); + + // ProxyMeshĉœ€çµ‚ƒ‚§ƒƒ‚Ż + if (proxyMesh.VertexCount > Define.System.MaxProxyMeshVertexCount) + { + sharePreBuildData.buildResult.SetError(Define.Result.ProxyMesh_Over32767Vertices); + throw new MagicaClothProcessingException(); + } + if (proxyMesh.EdgeCount > Define.System.MaxProxyMeshEdgeCount) + { + sharePreBuildData.buildResult.SetError(Define.Result.ProxyMesh_Over32767Edges); + throw new MagicaClothProcessingException(); + } + if (proxyMesh.TriangleCount > Define.System.MaxProxyMeshTriangleCount) + { + sharePreBuildData.buildResult.SetError(Define.Result.ProxyMesh_Over32767Triangles); + throw new MagicaClothProcessingException(); + } + + // finish + if (proxyMesh.IsError) + { + sharePreBuildData.buildResult.Merge(proxyMesh.result); + throw new MagicaClothProcessingException(); + } + proxyMesh.result.SetSuccess(); + Develop.DebugLog("CreateProxyMesh finish!"); + + // Mapping(MeshClothż) + if (clothType == ClothProcess.ClothType.MeshCloth) + { + foreach (VirtualMesh renderMesh in renderMeshList) + { + renderMesh.Mapping(proxyMesh); + if (renderMesh.IsError) + { + sharePreBuildData.buildResult.Merge(renderMesh.result); + throw new MagicaClothProcessingException(); + } + Develop.DebugLog($"(MAPPING) {renderMesh}"); + } + } + + // ======================= Cloth Data =============================== + // ‚Żƒ­‚ıƒ‡ƒĵ‚żä½œĉˆ + var parameters = cloth.SerializeData.GetClothParameters(); + var distanceConstraintData = DistanceConstraint.CreateData(proxyMesh, parameters); + if (distanceConstraintData != null) + { + if (distanceConstraintData.result.IsSuccess()) + { + sharePreBuildData.distanceConstraintData = distanceConstraintData; + } + else + { + sharePreBuildData.buildResult.Merge(distanceConstraintData.result); + throw new MagicaClothProcessingException(); + } + } + var bendingConstraintData = TriangleBendingConstraint.CreateData(proxyMesh, parameters); + if (bendingConstraintData != null) + { + if (bendingConstraintData.result.IsSuccess()) + { + sharePreBuildData.bendingConstraintData = bendingConstraintData; + } + else + { + sharePreBuildData.buildResult.Merge(bendingConstraintData.result); + throw new MagicaClothProcessingException(); + } + } + var inertiaConstraintData = InertiaConstraint.CreateData(proxyMesh, parameters); + if (inertiaConstraintData != null) + { + if (inertiaConstraintData.result.IsSuccess()) + { + sharePreBuildData.inertiaConstraintData = inertiaConstraintData; + } + else + { + sharePreBuildData.buildResult.Merge(inertiaConstraintData.result); + throw new MagicaClothProcessingException(); + } + } + + // ======================= Serialize =============================== + sharePreBuildData.buildScale = clothTransformRecord.scale; + sharePreBuildData.proxyMesh = proxyMesh.ShareSerialize(); + uniquePreBuildData.proxyMesh = proxyMesh.UniqueSerialize(); + foreach (VirtualMesh renderMesh in renderMeshList) + { + sharePreBuildData.renderMeshList.Add(renderMesh.ShareSerialize()); + uniquePreBuildData.renderMeshList.Add(renderMesh.UniqueSerialize()); + } + + // ĉˆċŠŸ + sharePreBuildData.buildResult.SetSuccess(); + + Develop.DebugLog(sharePreBuildData); + } + catch (MagicaClothProcessingException) + { + if (sharePreBuildData.buildResult.IsError() == false) + sharePreBuildData.buildResult.SetError(Define.Result.PreBuildData_MagicaClothException); + sharePreBuildData.buildResult.DebugLog(); + } + catch (Exception exception) + { + Debug.LogException(exception); + sharePreBuildData.buildResult.SetError(Define.Result.PreBuildData_UnknownError); + } + finally + { + setupDataList.ForEach(x => x.Dispose()); + setupDataList.Clear(); + + renderMeshList.ForEach(x => x?.Dispose()); + renderMeshList.Clear(); + + proxyMesh?.Dispose(); + proxyMesh = null; + + // ċ†…部ĉƒ…ċ ħŻċ¤–部ĉƒ…ċ ħçµĉžœ‚’‚³ƒ”ƒĵ + uniquePreBuildData.buildResult = sharePreBuildData.buildResult; + } + + //Debug.Log(span); + //Debug.Log($"MakePreBuildData().end"); + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Editor/PreBuild/PreBuildDataCreation.cs.meta b/Assets/MagicaCloth2/Scripts/Editor/PreBuild/PreBuildDataCreation.cs.meta new file mode 100644 index 00000000..80d8253b --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/PreBuild/PreBuildDataCreation.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: d37ab6d9c5e31034a9503a7cedd96ee3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Editor/PreBuild/PreBuildDataCreation.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Editor/UnityPackageImporter.meta b/Assets/MagicaCloth2/Scripts/Editor/UnityPackageImporter.meta new file mode 100644 index 00000000..9f660c40 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/UnityPackageImporter.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b220f0001485e184bb3dd8e27c9854b0 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Scripts/Editor/UnityPackageImporter/Burst.meta b/Assets/MagicaCloth2/Scripts/Editor/UnityPackageImporter/Burst.meta new file mode 100644 index 00000000..ff8866d9 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/UnityPackageImporter/Burst.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 232f688d5a1b6c04e91d6dca950b394e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Scripts/Editor/UnityPackageImporter/Burst/MagicaCloth2UPMImporterBurst.asmdef b/Assets/MagicaCloth2/Scripts/Editor/UnityPackageImporter/Burst/MagicaCloth2UPMImporterBurst.asmdef new file mode 100644 index 00000000..ef00e6f6 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/UnityPackageImporter/Burst/MagicaCloth2UPMImporterBurst.asmdef @@ -0,0 +1,24 @@ +{ + "name": "MagicaClothV2UPMImporterBurst", + "rootNamespace": "", + "references": [], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [ + "!MC2_BURST" + ], + "versionDefines": [ + { + "name": "com.unity.burst", + "expression": "1.8.1", + "define": "MC2_BURST" + } + ], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Assets/MagicaCloth2/Scripts/Editor/UnityPackageImporter/Burst/MagicaCloth2UPMImporterBurst.asmdef.meta b/Assets/MagicaCloth2/Scripts/Editor/UnityPackageImporter/Burst/MagicaCloth2UPMImporterBurst.asmdef.meta new file mode 100644 index 00000000..776f5d1e --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/UnityPackageImporter/Burst/MagicaCloth2UPMImporterBurst.asmdef.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 3a07ec506f9f4a6488a05f2691638ef3 +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Editor/UnityPackageImporter/Burst/MagicaCloth2UPMImporterBurst.asmdef + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Editor/UnityPackageImporter/Burst/UnityPackageImporter.cs b/Assets/MagicaCloth2/Scripts/Editor/UnityPackageImporter/Burst/UnityPackageImporter.cs new file mode 100644 index 00000000..a20ea8b9 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/UnityPackageImporter/Burst/UnityPackageImporter.cs @@ -0,0 +1,33 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using UnityEditor; +using UnityEditor.PackageManager; +using UnityEngine; + +namespace MagicaCloth2UPMImporterBurst +{ + /// + /// ċż…èĤŞUnityPackageè‡Şċ‹•‚¤ƒ³‚ıƒˆƒĵƒĞ + /// + [InitializeOnLoad] + public static class UnityPackageImporter + { + static UnityPackageImporter() + { + Install("com.unity.burst"); + Install("com.unity.mathematics"); + Install("com.unity.collections"); + //Install("com.unity.burst@1.4.11"); + } + + public static bool Install(string id) + { + Debug.Log($"Install...{id}"); + var request = Client.Add(id); + while (!request.IsCompleted) { }; + if (request.Error != null) Debug.LogError(request.Error.message); + return request.Error == null; + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Editor/UnityPackageImporter/Burst/UnityPackageImporter.cs.meta b/Assets/MagicaCloth2/Scripts/Editor/UnityPackageImporter/Burst/UnityPackageImporter.cs.meta new file mode 100644 index 00000000..a6c71b82 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/UnityPackageImporter/Burst/UnityPackageImporter.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 0303ccf5b5b37f24783c499f80d88363 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Editor/UnityPackageImporter/Burst/UnityPackageImporter.cs + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Editor/UnityPackageImporter/Collections.meta b/Assets/MagicaCloth2/Scripts/Editor/UnityPackageImporter/Collections.meta new file mode 100644 index 00000000..ff400120 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/UnityPackageImporter/Collections.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 22dca49adfb21a644b1bed79da0080a7 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MagicaCloth2/Scripts/Editor/UnityPackageImporter/Collections/MagicaCloth2UPMImporterCollections.asmdef b/Assets/MagicaCloth2/Scripts/Editor/UnityPackageImporter/Collections/MagicaCloth2UPMImporterCollections.asmdef new file mode 100644 index 00000000..17ab9263 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/UnityPackageImporter/Collections/MagicaCloth2UPMImporterCollections.asmdef @@ -0,0 +1,24 @@ +{ + "name": "MagicaClothV2UPMImporterCollections", + "rootNamespace": "", + "references": [], + "includePlatforms": [ + "Editor" + ], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [ + "!MC2_COLLECTIONS" + ], + "versionDefines": [ + { + "name": "com.unity.collections", + "expression": "1.4.0", + "define": "MC2_COLLECTIONS" + } + ], + "noEngineReferences": false +} \ No newline at end of file diff --git a/Assets/MagicaCloth2/Scripts/Editor/UnityPackageImporter/Collections/MagicaCloth2UPMImporterCollections.asmdef.meta b/Assets/MagicaCloth2/Scripts/Editor/UnityPackageImporter/Collections/MagicaCloth2UPMImporterCollections.asmdef.meta new file mode 100644 index 00000000..06e203d0 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/UnityPackageImporter/Collections/MagicaCloth2UPMImporterCollections.asmdef.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: 084a8eed0c5e5a84fa6a7cd543c50d8a +AssemblyDefinitionImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Editor/UnityPackageImporter/Collections/MagicaCloth2UPMImporterCollections.asmdef + uploadId: 893596 diff --git a/Assets/MagicaCloth2/Scripts/Editor/UnityPackageImporter/Collections/UnityPackageImporter.cs b/Assets/MagicaCloth2/Scripts/Editor/UnityPackageImporter/Collections/UnityPackageImporter.cs new file mode 100644 index 00000000..46647f10 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/UnityPackageImporter/Collections/UnityPackageImporter.cs @@ -0,0 +1,33 @@ +ïğż// Magica Cloth 2. +// Copyright (c) 2023 MagicaSoft. +// https://magicasoft.jp +using UnityEditor; +using UnityEditor.PackageManager; +using UnityEngine; + +namespace MagicaCloth2UPMImporterCollections +{ + /// + /// ċż…èĤŞUnityPackageè‡Şċ‹•‚¤ƒ³‚ıƒˆƒĵƒĞ + /// + [InitializeOnLoad] + public static class UnityPackageImporter + { + static UnityPackageImporter() + { + Install("com.unity.burst"); + Install("com.unity.mathematics"); + Install("com.unity.collections"); + //Install("com.unity.burst@1.4.11"); + } + + public static bool Install(string id) + { + Debug.Log($"Install...{id}"); + var request = Client.Add(id); + while (!request.IsCompleted) { }; + if (request.Error != null) Debug.LogError(request.Error.message); + return request.Error == null; + } + } +} diff --git a/Assets/MagicaCloth2/Scripts/Editor/UnityPackageImporter/Collections/UnityPackageImporter.cs.meta b/Assets/MagicaCloth2/Scripts/Editor/UnityPackageImporter/Collections/UnityPackageImporter.cs.meta new file mode 100644 index 00000000..da5c21c3 --- /dev/null +++ b/Assets/MagicaCloth2/Scripts/Editor/UnityPackageImporter/Collections/UnityPackageImporter.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: c49cd9494a8e6374eb04a10242c258e3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 242307 + packageName: Magica Cloth 2 + packageVersion: 2.18.1 + assetPath: Assets/MagicaCloth2/Scripts/Editor/UnityPackageImporter/Collections/UnityPackageImporter.cs + uploadId: 893596 diff --git a/Assets/RealToon.meta b/Assets/RealToon.meta new file mode 100644 index 00000000..9bf2c085 --- /dev/null +++ b/Assets/RealToon.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c076ba9779423dd40a2b7f9fdcff7225 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/RealToon/Editor.meta b/Assets/RealToon/Editor.meta new file mode 100644 index 00000000..f0ec7e84 --- /dev/null +++ b/Assets/RealToon/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4127e4d2098195744bb1333dc5e818ca +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/RealToon/Editor/RT_Welcome.cs b/Assets/RealToon/Editor/RT_Welcome.cs new file mode 100644 index 00000000..1bbabb7e --- /dev/null +++ b/Assets/RealToon/Editor/RT_Welcome.cs @@ -0,0 +1,584 @@ +ïğż//MJQStudioWorks + +using UnityEditor; +using System.IO; +using UnityEngine; +using UnityEngine.Rendering; +using UnityEditor.PackageManager; +using System.Linq; + + +namespace RealToon.Editor.Welcome +{ + + [InitializeOnLoad] + public class RTWelcome : EditorWindow + { + + #region Variables + + static float WinHig = 300; + static EditorWindow EdiWin; + static string CurrRP; + static string CurrRPDisp; + static string CurrRPVer; + static string CurrRPFullVer; + static char UniVerRev; + static string UniVer; + static string UniVerFull = null; + static string VRC_LV_Stat; + + #pragma warning disable CS0414 + static bool VRC_LV_CHK; + static bool SRP_CHK_AVAI; + #pragma warning restore CS0414 + + static Object RT_Pack; + static string RT_pac_name; + static Object RP_ReMe; + static Object RP_Qui_ReMe; + static Object RP_Exam; + static Vector2 scroll; + static Vector2 scroll2; + static Vector2 scroll3; + static string rt_welcome_settings = "Assets/RealToon/Editor/RTW.sett"; + static string[] RP_Info = { "Built-In Render Pipeline (BiRP)", + "Universal Render Pipeline (URP)", + "High Definition Render Pipeline (HDRP)" }; + + #endregion + + #region RT_Welcome + static RTWelcome() + { + if (File.Exists(rt_welcome_settings)) + { + if (File.ReadAllText(rt_welcome_settings) == "0") + { + if (File.Exists(rt_welcome_settings)) + { + EditorApplication.delayCall += Ini; + } + } + } + } + #endregion + + #region ini + + [MenuItem("Window/RealToon/Welcome Screen")] + static void Ini() + { + EdiWin = GetWindow(true); + EdiWin.titleContent = new GUIContent("Welcome RealToon Shader User"); + WinHig = 800; + EdiWin.minSize = new Vector2(658, WinHig); + EdiWin.maxSize = new Vector2(658, WinHig); + + } + #endregion + + #region check_srp_ver + static void check_srp_ver() + { + var request = Client.List(); + + while (!request.IsCompleted) { } + + if (request.Status == StatusCode.Success) + { + foreach (var package in request.Result) + { + if (package.name == "com.unity.render-pipelines.universal") + { + CurrRPVer = package.version.Substring(0, 2); + CurrRPFullVer = package.version; + CurrRP = package.displayName; + SRP_CHK_AVAI = true; + return; + } + else if (package.name == "com.unity.render-pipelines.high-definition") + { + CurrRPVer = package.version.Substring(0, 2); + CurrRPFullVer = package.version; + CurrRP = package.displayName; + SRP_CHK_AVAI = true; + return; + } + } + } + else if (request.Status >= StatusCode.Failure) + { + UnityEngine.Debug.LogWarning("URP and HDRP Packages are not available or present in your project."); + SRP_CHK_AVAI = false; + } + } + #endregion + + #region check_vrc_lv + static void check_vrc_lv() + { + if (GraphicsSettings.currentRenderPipeline == null) + { + if (Directory.Exists("Assets/VRC Light Volumes") || Directory.Exists("Packages/red.sim.lightvolumes")) + { + VRC_LV_CHK = true; + VRC_LV_Stat = "Is present"; + } + else + { + VRC_LV_CHK = false; + VRC_LV_Stat = "Not Present"; + } + + if (Directory.Exists("Assets/VRCLightVolumes")) + { + VRC_LV_CHK = false; + VRC_LV_Stat = "It Is Present\nBut the folder name should be\n'VRC Light Volumes' not 'VRCLightVolumes'."; + } + } + else + { + VRC_LV_CHK = false; + VRC_LV_Stat = "BiRP Only"; + } + } + #endregion + + #region rt_pac_set + static void rt_pac_set() + { + if (GraphicsSettings.currentRenderPipeline != null) + { + if (CurrRP == "Universal Render Pipeline" || CurrRP == "Universal RP") + { + if (int.Parse(CurrRPVer) == 12 || int.Parse(CurrRPVer) == 13) + { + RT_pac_name = "RealToon URP (URP 15 and 16)"; + } + if (int.Parse(CurrRPVer) == 14) + { + RT_pac_name = "RealToon URP (URP 14)"; + } + if (int.Parse(CurrRPVer) == 15 || int.Parse(CurrRPVer) == 16) + { + RT_pac_name = "RealToon URP (URP 15 and 16)"; + } + + if (UniVerFull.Substring(0, 6) == "6000.0") + { + RT_pac_name = "RealToon URP (Unity 6.0)"; + } + else if (UniVerFull.Substring(0, 6) == "6000.1") + { + RT_pac_name = "RealToon URP (Unity 6.1)"; + } + else if (UniVerFull.Substring(0, 6) == "6000.2") + { + RT_pac_name = "RealToon URP (Unity 6.2)"; + } + else if (UniVerFull.Substring(0, 6) == "6000.3" || UniVerFull.Substring(0, 6) == "6000.4") + { + RT_pac_name = "RealToon URP (Unity 6.3 and 6.4)"; + } + else if (UniVerFull.Substring(0, 6) == "6000.5" || (int.Parse(UniVerFull.Substring(0, 1)) == 6 && int.Parse(UniVerFull.Substring(5, 1)) >= 5) ) + { + RT_pac_name = "RealToon URP (Unity 6.5 To Later)"; + } + else if ( (int.Parse(UniVerFull.Substring(0, 1)) == 6 && int.Parse(UniVerFull.Substring(5, 1)) >= 5 && ( (UniVerRev.ToString() == "a") || (UniVerRev.ToString() == "b") ) ) ) + { + RT_pac_name = "RealToon URP (Unity 6.5 To Later)"; + } + + var ids_reme = AssetDatabase.FindAssets("Please read before you unpack or import", new[] { "Assets/RealToon/RealToon Shader Packages/SRP (LWRP - URP - HDRP)/URP" }); + if (ids_reme.Length == 1) + { + RP_ReMe = AssetDatabase.LoadMainAssetAtPath(AssetDatabase.GUIDToAssetPath(ids_reme[0])); + } + else + { + Debug.Log("Couldn't find ReadMe's"); + } + + var ids_examp = AssetDatabase.FindAssets("RealToon URP (Simple Example)", new[] { "Assets/RealToon/RealToon Examples/SRP/URP" }); + if (ids_examp.Length == 1) + { + RP_Exam = AssetDatabase.LoadMainAssetAtPath(AssetDatabase.GUIDToAssetPath(ids_examp[0])); + } + else + { + Debug.Log("Couldn't find Example's"); + } + + } + else if (CurrRP == "High Definition Render Pipeline" || CurrRP == "High Definition RP") + { + + if (int.Parse(CurrRPVer) == 12 || int.Parse(CurrRPVer) == 13) + { + RT_pac_name = "RealToon HDRP (HDRP 12 and 13)"; + } + else if (int.Parse(CurrRPVer) == 16) + { + RT_pac_name = "RealToon HDRP (HDRP 16)"; + } + else if (int.Parse(CurrRPVer) == 14 || int.Parse(CurrRPVer) == 15) + { + RT_pac_name = "RealToon HDRP (HDRP 14 and 15)"; + } + + if (UniVerFull.Substring(0, 6) == "6000.0") + { + RT_pac_name = "RealToon HDRP (Unity 6.0)"; + } + else if (UniVerFull.Substring(0, 6) == "6000.1" || UniVerFull.Substring(0, 6) == "6000.2" || UniVerFull.Substring(0, 6) == "6000.3") + { + RT_pac_name = "RealToon HDRP (Unity 6.1 To 6.4)"; + } + else if (UniVerFull.Substring(0, 6) == "6000.5" || (int.Parse(UniVerFull.Substring(0, 1)) == 6 && int.Parse(UniVerFull.Substring(5, 1)) >= 5)) + { + RT_pac_name = "RealToon HDRP (Unity 6.5 To Later)"; + } + else if ((int.Parse(UniVerFull.Substring(0, 1)) == 6 && int.Parse(UniVerFull.Substring(5, 1)) >= 5 && ((UniVerRev.ToString() == "a") || (UniVerRev.ToString() == "b")))) + { + RT_pac_name = "RealToon HDRP (Unity 6.5 To Later)"; + } + + var ids_reme = AssetDatabase.FindAssets("Please read before you unpack or import", new[] { "Assets/RealToon/RealToon Shader Packages/SRP (LWRP - URP - HDRP)/HDRP" }); + if (ids_reme.Length == 1) + { + RP_ReMe = AssetDatabase.LoadMainAssetAtPath(AssetDatabase.GUIDToAssetPath(ids_reme[0])); + } + else + { + Debug.Log("Couldn't find ReadMe's"); + } + + var ids_qui_reme = AssetDatabase.FindAssets("RealToon HDRP (Quick Guide)", new[] { "Assets/RealToon/RealToon Shader Packages/SRP (LWRP - URP - HDRP)/HDRP" }); + if (ids_qui_reme.Length == 1) + { + RP_Qui_ReMe = AssetDatabase.LoadMainAssetAtPath(AssetDatabase.GUIDToAssetPath(ids_qui_reme[0])); + } + else + { + Debug.Log("Couldn't find Quick ReadMe's"); + } + + var ids_examp = AssetDatabase.FindAssets("RealToon HDRP (Simple Example)", new[] { "Assets/RealToon/RealToon Examples/SRP/HDRP" }); + if (ids_examp.Length == 1) + { + RP_Exam = AssetDatabase.LoadMainAssetAtPath(AssetDatabase.GUIDToAssetPath(ids_examp[0])); + } + else + { + Debug.Log("Couldn't find Example's"); + } + } + } + else + { + if (int.Parse(Application.unityVersion.Substring(0, 4)) >= 2019) + { + RT_pac_name = "RealToon Built-In RP [3D] (Unity 2019 and Later)"; + } + else if (int.Parse(Application.unityVersion.Substring(0, 4)) < 2019) + { + RT_pac_name = "RealToon Built-In RP [3D] (Unity 2018 and below) (FV)"; + } + + var ids_examp = AssetDatabase.FindAssets("RealToon Built-In RP [3D] (Example)", new[] { "Assets/RealToon/RealToon Examples/Built-In RP [3D]" }); + if (ids_examp.Length == 1) + { + RP_Exam = AssetDatabase.LoadMainAssetAtPath(AssetDatabase.GUIDToAssetPath(ids_examp[0])); + } + else + { + Debug.Log("Couldn't find Example's"); + } + } + + var ids = AssetDatabase.FindAssets(RT_pac_name); + + if (ids.Length == 1) + { + RT_Pack = AssetDatabase.LoadMainAssetAtPath(AssetDatabase.GUIDToAssetPath(ids[0])); + } + else + { + RT_pac_name = "Package Not Found In Your Project"; + Debug.Log("Couldn't find packages"); + } + } + #endregion + + #region Process & UI + void OnGUI() + { + Texture2D t = EditorGUIUtility.Load("Assets/RealToon/Editor/RT_GUI_Img.png") as Texture2D; + Rect rect = new Rect(233, 0, t.width + 70, t.height + 70); + GUI.DrawTexture(rect, t, ScaleMode.ScaleToFit); + + EditorGUILayout.Space(76); + + EditorGUILayout.BeginVertical(); + + EditorGUILayout.BeginVertical(); + + if (GraphicsSettings.currentRenderPipeline != null) + { + if (CurrRP == "Universal Render Pipeline" || CurrRP == "Universal RP") + { + CurrRPDisp = RP_Info[1] + " v" + CurrRPFullVer; + } + else if (CurrRP == "High Definition Render Pipeline" || CurrRP == "High Definition RP") + { + CurrRPDisp = RP_Info[2] + " v" + CurrRPFullVer; + } + } + else + { + CurrRPDisp = RP_Info[0] + CurrRPFullVer; + } + + + GUIStyle centeredtext = GUI.skin.GetStyle("Label"); + centeredtext.alignment = TextAnchor.MiddleCenter; + centeredtext.fontSize = 18; + centeredtext.fontStyle = FontStyle.Bold; + EditorGUILayout.LabelField("A PRO Anime/Toon Shader", centeredtext); + + EditorGUILayout.EndVertical(); + + EditorGUILayout.Space(19); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + EditorGUILayout.BeginHorizontal(); + + EditorGUILayout.Space(22); + + EditorGUILayout.BeginVertical("TextArea", GUILayout.Height(310)); + + EditorGUILayout.LabelField("Introduction:"); + + scroll = EditorGUILayout.BeginScrollView(scroll, GUILayout.Height(285)); + + EditorGUILayout.Space(4); + + GUILayout.TextArea( + "*Thank you for purchasing RealToon Shader, before you start using RealToon, please read first the 'ReadMe - Important - Guide.txt' text file for setups and infos.\n\n" + + + "*All shaders packages are in the folder 'RealToon Shader Packages', just unpack the 'RealToon Shader' that correspond to your projects render pipeline.\n" + + "You can also just click the package on the Welcome Screen, To access the Welcome Screen just go to 'Window > RealToon > Welcome Screen'.\n\n" + + + "*If you are a VRoid user, read the 'For VRoid-VRM users.txt' text file.\n\n" + + + "*For video tutorials and user guide, see the bottom part of RealToon Inspector panel.\n\n" + + + "*If you need some help/support, just send an email including the invoice number.\n" + + "See the 'User Guide.pdf' file for the links and email support.\n\n" + + + "*PlayStation support is currently for URP and HDRP only.\n\n" + + + "Note:\nDon't move the 'RealToon' folder to other folder, it should stay in the root folder 'Asset'."); + + EditorGUILayout.EndScrollView(); + + EditorGUILayout.EndVertical(); + + EditorGUILayout.Space(22); + + EditorGUILayout.EndHorizontal(); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + EditorGUILayout.BeginHorizontal(); + + EditorGUILayout.Space(20); + + EditorGUILayout.BeginVertical("TextArea", GUILayout.Height(220)); + + EditorGUILayout.LabelField("Project Info:"); + + scroll2 = EditorGUILayout.BeginScrollView(scroll2, GUILayout.Height(240)); + + EditorGUILayout.Space(4); + + GUIStyle Pro_info = GUI.skin.GetStyle("Label"); + Pro_info.alignment = TextAnchor.MiddleLeft; + Pro_info.fontSize = 12; + + GUILayout.Label("Rendering Pipeline: \n" + CurrRPDisp, Pro_info); + + EditorGUILayout.Space(10); + + GUILayout.Label("Unity Version: \n" + UniVerFull, Pro_info); + + EditorGUILayout.Space(10); + + if (GraphicsSettings.currentRenderPipeline == null) + { + GUILayout.Label("VRC Light Volumes (VRC Users Only): \n" + VRC_LV_Stat, Pro_info); + } + + EditorGUILayout.EndScrollView(); + + EditorGUILayout.EndVertical(); + + EditorGUILayout.Space(30); + + EditorGUILayout.BeginVertical("TextArea", GUILayout.Height(220)); + + EditorGUILayout.LabelField("Suitable Packages, ReadMe & Examples:"); + + scroll3 = EditorGUILayout.BeginScrollView(scroll3, GUILayout.Height(240)); + + GUIStyle Pro_info2 = GUI.skin.GetStyle("Label"); + Pro_info2.fontSize = 12; + Pro_info2.fontStyle = FontStyle.Bold; + + EditorGUILayout.LabelField("Packages: ", Pro_info2); + + if(GUILayout.Button(RT_pac_name)) + { + if(RT_pac_name != "Package Not Found In Your Project") + { + Debug.LogWarning("Now opening RealToon Shader package: " + RT_Pack.name); + AssetDatabase.OpenAsset(RT_Pack); + } + } + + EditorGUILayout.Space(10); + + EditorGUILayout.LabelField("Examples: ", Pro_info2); + + if (GraphicsSettings.currentRenderPipeline != null) + { + if (CurrRP == "Universal Render Pipeline" || CurrRP == "Universal RP") + { + if(GUILayout.Button("RealToon URP Example")) + { + AssetDatabase.OpenAsset(RP_Exam); + } + } + else if (CurrRP == "High Definition Render Pipeline" || CurrRP == "High Definition RP") + { + if(GUILayout.Button("RealToon HDRP Example")) + { + AssetDatabase.OpenAsset(RP_Exam); + } + } + } + else + { + if(GUILayout.Button("RealToon Built-In RP/BiRP Example")) + { + AssetDatabase.OpenAsset(RP_Exam); + } + } + + EditorGUILayout.Space(10); + + EditorGUILayout.LabelField("ReadMe: ", Pro_info2); + + if (GraphicsSettings.currentRenderPipeline != null) + { + if (CurrRP == "Universal Render Pipeline" || CurrRP == "Universal RP") + { + if(GUILayout.Button("Read Me First (URP)")) + { + AssetDatabase.OpenAsset(RP_ReMe); + } + } + else if (CurrRP == "High Definition Render Pipeline" || CurrRP == "High Definition RP") + { + if(GUILayout.Button("Read Me First (HDRP)")) + { + AssetDatabase.OpenAsset(RP_ReMe); + } + + if(GUILayout.Button("Quick Guide (HDRP)")) + { + AssetDatabase.OpenAsset(RP_Qui_ReMe); + } + } + } + + if(GUILayout.Button("ReadMe for Manual Unpacking & Info")) + { + Application.OpenURL(Application.dataPath + "/RealToon/ReadMe - Important - Guide.txt"); + } + + if(GUILayout.Button("VRoid-VRM users Read Me")) + { + Application.OpenURL(Application.dataPath + "/RealToon/For VRoid-VRM users.txt"); + } + + if(GUILayout.Button("What's New")) + { + Application.OpenURL(Application.dataPath + "/RealToon/What's New.txt"); + } + + EditorGUILayout.EndScrollView(); + + EditorGUILayout.EndVertical(); + + EditorGUILayout.Space(20); + + EditorGUILayout.EndHorizontal(); + + EditorGUILayout.Space(5); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + EditorGUILayout.BeginHorizontal(); + + if (GUILayout.Button("User Guide")) + { + Application.OpenURL(Application.dataPath + "/RealToon/RealToon (User Guide).pdf"); + } + if (GUILayout.Button("Video Tutorials")) + { + Application.OpenURL("www.youtube.com/playlist?list=PL0M1m9smMVPJ4qEkJnZObqJE5mU9uz6SY"); + } + if (GUILayout.Button("Contact/Support")) + { + Application.OpenURL("www.mjqstudioworks.weebly.com/contact.html"); + } + if (GUILayout.Button("Website")) + { + Application.OpenURL("www.mjqstudioworks.weebly.com"); + } + if (GUILayout.Button("Check Updates")) + { + Application.OpenURL("https://mjqstudioworks.weebly.com/realtoonshaderupdates.html"); + } + + EditorGUILayout.EndHorizontal(); + + EditorGUILayout.EndVertical(); + + } + private void OnEnable() + { + UniVer = Application.unityVersion.Substring(0, 4); + UniVerFull = Application.unityVersion; + string[] UniVerPar = Application.unityVersion.Split('.'); + UniVerRev = UniVerPar[2].FirstOrDefault(char.IsLetter); + check_srp_ver(); + check_vrc_lv(); + rt_pac_set(); + } + + private void OnDestroy() + { + if (File.Exists(rt_welcome_settings) && File.ReadAllText(rt_welcome_settings) == "0") + { + File.WriteAllText(rt_welcome_settings, "1"); + AssetDatabase.Refresh(); + } + } + #endregion + } + +} \ No newline at end of file diff --git a/Assets/RealToon/Editor/RT_Welcome.cs.meta b/Assets/RealToon/Editor/RT_Welcome.cs.meta new file mode 100644 index 00000000..e206685e --- /dev/null +++ b/Assets/RealToon/Editor/RT_Welcome.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 3eddd3adb3383a342a543d148d492447 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 65518 + packageName: RealToon (Pro Anime/Toon Shader) + packageVersion: 5.0.15 + assetPath: Assets/RealToon/Editor/RT_Welcome.cs + uploadId: 889742 diff --git a/Assets/RealToon/Editor/RealToonShaderCache.cs b/Assets/RealToon/Editor/RealToonShaderCache.cs new file mode 100644 index 00000000..eabcb9af --- /dev/null +++ b/Assets/RealToon/Editor/RealToonShaderCache.cs @@ -0,0 +1,129 @@ +//RealToon Shader Cache +//İMJQStudioWorks + + +using UnityEngine; +using UnityEditor; +using System.IO; + +namespace RealToon.Tools +{ + public class RealToonShaderCache : EditorWindow + { + + #region Variables + + static float WinHig = 300; + static EditorWindow EdiWin; + static int countsha = 0; + + static string shaderCachePath = Directory.GetParent(Application.dataPath).ToString() + "/Library/ShaderCache/shader"; + + static string infospace = null; + + static string[] rt_shaders = + { "D_Default" + , "D_Fade_Transparency" + , "D_Refraction" + , "L_Default" + , "L_Fade_Transparency" + , "T_Default" + , "T_Fade_Transparency" + , "T_Refraction" + , "D_Default_URP" + , "D_Default_HDRP" + , "RealToon_Sobel_Outline_FX" + , "DeNorSobOutline"}; + + #endregion + + [MenuItem("Window/RealToon/RealToon Shader Cache")] + static void Init() + { + EdiWin = GetWindow(true); + EdiWin.titleContent = new GUIContent("RealToon Shader Cache"); + WinHig = 200; + EdiWin.minSize = new Vector2(440, WinHig); + EdiWin.maxSize = new Vector2(440, WinHig); + + CountRTCache(); + infospace = "There are " + countsha + " RealToon Shaders & Effects cached."; + + } + + void OnGUI() + { + + var lblcenstyle = new GUIStyle(GUI.skin.label) { alignment = TextAnchor.MiddleCenter }; + + GUILayout.Space(10); + EditorGUILayout.BeginVertical(); + + GUILayout.Label(infospace, lblcenstyle); + + CountRTCache(); + infospace = "There are " + countsha + " RealToon Shaders cached."; + + GUILayout.Space(10); + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + if (GUILayout.Button("Reduce/Clean Cached RealToon Shader")) + { + + foreach (string rt_sha in rt_shaders) + { + string[] direc = Directory.GetDirectories(@shaderCachePath, rt_sha + "*"); + + foreach (string dir in direc) + { + if (direc.Length == 1) + { + Debug.Log("RealToon Shader Cache: " + rt_sha + " Shader Cache removed."); + Directory.Delete(dir.ToString(), true); + } + } + + + if (direc.Length == 0) + { + Debug.LogWarning("RealToon Shader Cache: " + rt_sha + " Shader already removed or not present."); + } + + } + + } + + if (GUILayout.Button("Re-import RealToon Shader")) + { + AssetDatabase.ImportAsset("Assets/RealToon", ImportAssetOptions.ImportRecursive); + } + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + GUILayout.Label("Note:"); + GUILayout.Label("*This will reduce or clear cached RealToon Shaders.\n" + + "*Useful for after update RealToon Shader or Re-import RealToon Shader.\n" + + "*'Re-import RealToon Shader', will cache RealToon Shaders again."); + + EditorGUILayout.EndVertical(); + + } + + static void CountRTCache() + { + countsha = 0; + foreach (string rt_sha in rt_shaders) + { + string[] direc = Directory.GetDirectories(@shaderCachePath, rt_sha + "*"); + + foreach (string dir in direc) + { + ++countsha; + } + } + + } + + } + +} \ No newline at end of file diff --git a/Assets/RealToon/Editor/RealToonShaderCache.cs.meta b/Assets/RealToon/Editor/RealToonShaderCache.cs.meta new file mode 100644 index 00000000..ae9063d7 --- /dev/null +++ b/Assets/RealToon/Editor/RealToonShaderCache.cs.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: b57f4820f70afb6469f99f2a6e73e607 +AssetOrigin: + serializedVersion: 1 + productId: 65518 + packageName: RealToon (Pro Anime/Toon Shader) + packageVersion: 5.0.15 + assetPath: Assets/RealToon/Editor/RealToonShaderCache.cs + uploadId: 889742 diff --git a/Assets/RealToon/Editor/RealToonShaderGUI_URP_SRP.cs b/Assets/RealToon/Editor/RealToonShaderGUI_URP_SRP.cs new file mode 100644 index 00000000..8c6c654f --- /dev/null +++ b/Assets/RealToon/Editor/RealToonShaderGUI_URP_SRP.cs @@ -0,0 +1,4216 @@ +//RealToonGUI URP +//MJQStudioWorks +//Âİ2026 + +#if UNITY_EDITOR + +using System; +using UnityEditor; +using UnityEditor.Rendering; +using UnityEngine; + +namespace RealToon.GUIInspector +{ + + public class RealToonShaderGUI_URP_SRP : ShaderGUI + { + + #region foldout bools variable + + static bool ShowTextureColor; + static bool ShowNormalMap; + static bool ShowTransparency; + static bool ShowMatCap; + static bool ShowCutout; + static bool ShowColorAdjustment; + static bool ShowOutline; + static bool ShowSelfLit; + static bool ShowGloss; + static bool ShowShadow; + static bool ShowLighting; + static bool ShowReflection; + static bool ShowRimLight; + static bool ShowSeeThrough; + static bool NearFadeDithering; + static bool Triplanar; + static bool ShowPerspecAdju; + static bool ShowSmeEff; + static bool ShowTessellation; + static bool ShowDisableEnable; + static bool ShowSettings; + //static bool ShowFReflection; //remove later + //static bool ShowLightmapping; //remove later + //static bool ShowDepth; //remove later + + static bool ShowUI = true; + + string LightBlendString = "Anime/Cartoon"; + static string ShowUIString = "Hide Settings"; + + + #endregion + + #region Variables + +string realtoon_version = "5.0.15"; +string shader_type = "Default"; +string srp_mode = "URP"; +bool del_skw = false; +static bool aruskw = false; + +static bool UseSSOL = true; +static string UseSSOLStat = "Use Screen Space Outline"; +static string OLType = "Traditional"; + +static bool remoout = true; +static string remooutstat = "Remove Outline"; + +static bool twofourfive_target = false; +static string twofourfive_target_string = "Change shader compilation target to 4.5"; + +static bool dots_lbs_cd = false; +static string dots_lbs_cd_string = "DOTS|HR - Use Compute Deformation"; + +static bool add_st = true; +static string add_st_string = "Add 'See Through' feature"; + +static bool tess_supp = false; +static string tess_supp_string = "Enable Tessellation"; + + static int MatRenQue = 0; + + Texture2D t = (Texture2D)AssetDatabase.LoadAssetAtPath("Assets/RealToon/Editor/RT_GUI_Img.png", typeof(Texture2D)); + + #endregion + + #region Material Properties Variables + + MaterialProperty _Culling = null; + MaterialProperty _TRANSMODE = null; + MaterialProperty _UVSet = null; + + MaterialProperty _MainTex = null; + MaterialProperty _TexturePatternStyle = null; + MaterialProperty _MainColor = null; + MaterialProperty _MaiColPo = null; + MaterialProperty _MVCOL = null; + MaterialProperty _MCIALO = null; + + MaterialProperty _MCapIntensity = null; + MaterialProperty _MCap = null; + MaterialProperty _SPECMODE = null; + MaterialProperty _SPECIN = null; + MaterialProperty _MCapMask = null; + + MaterialProperty _Cutout = null; + MaterialProperty _UseSecondaryCutout = null; + MaterialProperty _SecondaryCutout = null; + MaterialProperty _AlphaBaseCutout = null; + MaterialProperty _N_F_SCO = null; + MaterialProperty _AlpToCov = null; + MaterialProperty _AAS = null; + MaterialProperty _N_F_COEDGL = null; + MaterialProperty _Glow_Color = null; + MaterialProperty _Glow_Edge_Width = null; + + MaterialProperty _Opacity = null; + MaterialProperty _TransparentThreshold = null; + MaterialProperty _MaskTransparency = null; + MaterialProperty _BleModSour = null; + MaterialProperty _BleModDest = null; + + MaterialProperty _SimTrans = null; + MaterialProperty _TransAffSha = null; + + MaterialProperty _NormalMap = null; + MaterialProperty _NormalMapIntensity = null; + + MaterialProperty _Saturation = null; + + MaterialProperty _OutlineWidth = null; + MaterialProperty _OutlineWidthControl = null; + MaterialProperty _OutlineExtrudeMethod = null; + MaterialProperty _OutlineOffset = null; + MaterialProperty _OutResi = null; + MaterialProperty _OutlineZPostionInCamera = null; + MaterialProperty _DoubleSidedOutline = null; + MaterialProperty _OutlineColor = null; + MaterialProperty _MixMainTexToOutline = null; + MaterialProperty _NoisyOutlineIntensity = null; + MaterialProperty _DynamicNoisyOutline = null; + MaterialProperty _LightAffectOutlineColor = null; + MaterialProperty _OutlineWidthAffectedByViewDistance = null; + MaterialProperty _FarDistanceMaxWidth = null; + MaterialProperty _VertexColorBlueAffectOutlineWitdh = null; + MaterialProperty _OutStenPass = null; + MaterialProperty _OutZWrite = null; + MaterialProperty _OutZTest = null; + + MaterialProperty _N_F_MSSOLTFO = null; + MaterialProperty _DepthThreshold = null; + + MaterialProperty _SelfLitIntensity = null; + MaterialProperty _SelfLitColor = null; + MaterialProperty _SelfLitPower = null; + MaterialProperty _TEXMCOLINT = null; + MaterialProperty _SelfLitHighContrast = null; + MaterialProperty _N_F_SLMM = null; + MaterialProperty _MaskSelfLit = null; + + MaterialProperty _GlossIntensity = null; + MaterialProperty _Glossiness = null; + MaterialProperty _GlossSoftness = null; + MaterialProperty _GlossColor = null; + MaterialProperty _GlossColorPower = null; + MaterialProperty _MaskGloss = null; + + MaterialProperty _GlossTexture = null; + MaterialProperty _GlossTextureSoftness = null; + MaterialProperty _PSGLOTEX = null; + MaterialProperty _GlossTextureRotate = null; + MaterialProperty _GlossTextureFollowObjectRotation = null; + MaterialProperty _N_F_ANIS = null; + MaterialProperty _NoisTexInten = null; + MaterialProperty _StraWidt = null; + MaterialProperty _NoiTexAffStraWidt; + MaterialProperty _ShifAnis = null; + MaterialProperty _GlossTextureFollowLight = null; + + MaterialProperty _OverallShadowColor = null; + MaterialProperty _OverallShadowColorPower = null; + MaterialProperty _SelfShadowShadowTAtViewDirection = null; + + MaterialProperty _ReduSha = null; + MaterialProperty _ShadowHardness = null; + + MaterialProperty _HighlightColor = null; + MaterialProperty _HighlightColorPower = null; + + MaterialProperty _SelfShadowRealtimeShadowIntensity = null; + MaterialProperty _SelfShadowThreshold = null; + MaterialProperty _VertexColorGreenControlSelfShadowThreshold = null; + MaterialProperty _SelfShadowHardness = null; + MaterialProperty _SelfShadowRealTimeShadowColor = null; + MaterialProperty _SelfShadowRealTimeShadowColorPower = null; + MaterialProperty _LigIgnoYNorDir = null; + MaterialProperty _SelfShadowAffectedByLightShadowStrength = null; + + MaterialProperty _SmoothObjectNormal = null; + MaterialProperty _VertexColorRedControlSmoothObjectNormal = null; + //MaterialProperty _XYZPosition = null; + MaterialProperty _ShowNormal = null; + + MaterialProperty _ShadowColorTexture = null; + MaterialProperty _ShadowColorTexturePower = null; + + MaterialProperty _ShadowTIntensity = null; + MaterialProperty _ShadowT = null; + MaterialProperty _ShadowTLightThreshold = null; + MaterialProperty _ShadowTShadowThreshold = null; + MaterialProperty _ShadowTColor = null; + MaterialProperty _ShadowTColorPower = null; + MaterialProperty _ShadowTHardness = null; + MaterialProperty _STIL = null; + MaterialProperty _N_F_STIS = null; + MaterialProperty _N_F_STIAL = null; + MaterialProperty _ShowInAmbientLightShadowIntensity = null; + MaterialProperty _ShowInAmbientLightShadowThreshold = null; + MaterialProperty _LightFalloffAffectShadowT = null; + MaterialProperty _N_F_STSDFM = null; + + MaterialProperty _PTexture = null; + MaterialProperty _PTCol = null; + MaterialProperty _PTexturePower = null; + + MaterialProperty _RELG = null; + MaterialProperty _EnvironmentalLightingIntensity = null; + + MaterialProperty _GIFlatShade = null; + MaterialProperty _GIShadeThreshold = null; + MaterialProperty _LightAffectShadow = null; + MaterialProperty _LightIntensity = null; + + MaterialProperty _UseTLB = null; + MaterialProperty _N_F_EAL = null; + + MaterialProperty _DirectionalLightIntensity = null; + MaterialProperty _PointSpotlightIntensity = null; + MaterialProperty _LightFalloffSoftness = null; + + MaterialProperty _N_F_LLI = null; + MaterialProperty _LLI_Min = null; + MaterialProperty _LLI_Max = null; + + MaterialProperty _CustomLightDirectionIntensity = null; + MaterialProperty _CustomLightDirectionFollowObjectRotation = null; + MaterialProperty _CustomLightDirection = null; + + MaterialProperty _ReflectionIntensity = null; + MaterialProperty _Smoothness = null; + MaterialProperty _RefMetallic = null; + MaterialProperty _MaskReflection = null; + MaterialProperty _FReflection = null; + + MaterialProperty _RimLigInt = null; + MaterialProperty _RimLightUnfill = null; + MaterialProperty _RimLightColor = null; + MaterialProperty _RimLightColorPower = null; + MaterialProperty _RimLightSoftness = null; + MaterialProperty _RimLigPosi = null; + MaterialProperty _RimLightInLight = null; + MaterialProperty _LightAffectRimLightColor = null; + MaterialProperty _N_F_RLIS = null; + + MaterialProperty _MinFadDistance = null; + MaterialProperty _MaxFadDistance = null; + + MaterialProperty _TriPlaTile = null; + MaterialProperty _TriPlaBlend = null; + + MaterialProperty _PresAdju = null; + MaterialProperty _ClipAdju = null; + MaterialProperty _PASize = null; + MaterialProperty _PASmooTrans = null; + MaterialProperty _PADist = null; + + MaterialProperty _TessellationSmoothness = null; + MaterialProperty _TessellationTransition = null; + MaterialProperty _TessellationNear = null; + MaterialProperty _TessellationFar = null; + MaterialProperty _NorMapAsDis = null; + + //MaterialProperty _NoiseSize = null; + //MaterialProperty _TrailSize = null; + + //MaterialProperty _TessellationSmoothness = null; + //MaterialProperty _TessellationTransition = null; + //MaterialProperty _TessellationNear = null; + //MaterialProperty _TessellationFar = null; + + MaterialProperty _RefVal = null; + MaterialProperty _Oper = null; + MaterialProperty _Compa = null; + + MaterialProperty _N_F_ESSAO = null; + MaterialProperty _SSAOColor = null; + + MaterialProperty _N_F_MC = null; + MaterialProperty _N_F_NM = null; + MaterialProperty _N_F_CO = null; + MaterialProperty _N_F_O = null; + MaterialProperty _N_F_CA = null; + MaterialProperty _N_F_SL = null; + MaterialProperty _N_F_GLO = null; + MaterialProperty _N_F_GLOT = null; + MaterialProperty _N_F_SS = null; + MaterialProperty _N_F_SON = null; + MaterialProperty _N_F_SCT = null; + MaterialProperty _N_F_ST = null; + MaterialProperty _N_F_PT = null; + MaterialProperty _N_F_CLD = null; + MaterialProperty _N_F_R = null; + MaterialProperty _N_F_FR = null; + MaterialProperty _N_F_RL = null; + MaterialProperty _N_F_HDLS = null; + MaterialProperty _N_F_HPSS = null; + MaterialProperty _N_F_DCS = null; + MaterialProperty _N_F_NLASOBF = null; + MaterialProperty _N_F_RDC = null; + MaterialProperty _N_F_DDMD = null; + MaterialProperty _N_F_NFD = null; + MaterialProperty _N_F_TP = null; + MaterialProperty _N_F_PA = null; + MaterialProperty _N_F_SE = null; + + MaterialProperty _ObjePosiZCS = null; + MaterialProperty _ZWrite = null; + MaterialProperty _ZTest = null; + MaterialProperty _N_F_OFLMB = null; + + MaterialProperty _RQSO = null; + + #endregion + + #region List of Toggle Keywords + + enum SFKW + { + N_F_USETLB_ON, + N_F_STIS_ON, + N_F_STIAL_ON, + N_F_EAL_ON, + N_F_MC_ON, + N_F_NM_ON, + N_F_CO_ON, + N_F_O_ON, + N_F_CA_ON, + N_F_SL_ON, + N_F_GLO_ON, + N_F_GLOT_ON, + N_F_SS_ON, + N_F_SON_ON, + N_F_SCT_ON, + N_F_ST_ON, + N_F_PT_ON, + N_F_RELGI_ON, + N_F_CLD_ON, + N_F_R_ON, + N_F_FR_ON, + N_F_RL_ON, + N_F_HDLS_ON, + N_F_HPSS_ON, + N_F_DCS_ON, + N_F_NLASOBF_ON, + N_F_DNO_ON, + N_F_TRANS_ON, + N_F_TRANSAFFSHA_ON, + N_F_OFLMB_ON, + N_F_ESSAO_ON, + N_F_RDC_ON, + N_F_COEDGL_ON, + N_F_DDMD_ON, + N_F_SIMTRANS_ON, + N_F_NFD_ON, + N_F_TP_ON, + N_F_PA_ON, + N_F_SE_ON, + N_F_SCO_ON, + N_F_STSDFM_ON, + N_F_ATC_ON, + N_F_ANIS_ON, + N_F_LLI_ON, + N_F_SLMM_ON, + N_F_RLIS_ON, + N_F_TESS_ON, + _UVSET_UV0, + _UVSET_UV1 + } + + #endregion + + #region TOTIPS + + string[] TOTIPS = + { + + //Culling [0] + "Controls which sides of polygons should be culled (not drawn).\n\n\nBack: Don’t render polygons that are facing away from the viewer.\n\nFront: Don’t render polygons that are facing towards the viewer, Used for turning objects inside-out.\n\nOff: Disables culling - all faces are drawn, This also called Double Sided." , + + //Texture [1] + "Main or base texture." , + + //Texture Pattern Style [2] + "Turn the 'Main/Base Texture' into pattern style." , + + //Main Color [3] + "Main or base color." , + + //Mix Vertex Color [4] + "Mix or show vertex color." , + + //Main Color in Ambient Light Only [5] + "Put the 'Main/Base Color' into ambient light." , + + //Highlight Color [6] + "Highlight color." , + + //Highlight Color Power [7] + "'Highlight Color' power or intensity." , + + //Main Color Power [8] + "'Main Color' power or intensity." , + + //Blend - Source [9] [Transparent Mode] + "Blending source.\n\n-Default Value: ScrAlpha" , + + //Blend - Destination [10] [Transparent Mode] + "Blending Destination.\n\n-Default Value: OneMinusScrAlpha" , + + //Transparent Mode [11] + "Setting the current mode from Opaque to Transparent.\n\nThis will allow you to use 'Fade Transparency' and 'Cutout' feature.", + + //Intensity [12] [MatCap] + "MatCap intensity." , + + //MatCap [13] [MatCap] + "MatCap texture." , + + //Specualar Mode [14] [MatCap] + "Turn MatCap into specular." , + + //Specular Power [15] [MatCap] + "Specular intensity or power." , + + //Mask MatCap [16] [MatCap] + "Mask MatCap.\n\nUse a Black and White texture map.\nWhite means visible matcap while Black is not." , + + //Cutout [17] + "Cutout value or threshold." , + + //Alpha Base Cutout [18] + "It will use the alpha/transparent channel of the 'Main/Base Texture' to cutout." , + + //Use Secondary Cutout Only [19] + "Use only the 'Secondary Cutout' to do the cutout." , + + //Secondary Cutout [20] + "Secondary texture cutout.\n\nUse a Black and White texture map.\nWhite means not cut out while Black is cutout." , + + //Opacity [21] + "Adjust the Transparency - Opacity of the object" , + + //Transparent Threshold [22] + "'Main/Base Texture' transparency threshold." , + + //Mask Transparency [23] + "Mask Transparency.\n\nWhite means opaque while Black means transparent." , + + //Normal Map [24] + "Normal Map." , + + //Normal Map Intensity [25] + "'Normal Map' intensity." , + + //Saturation [26] [Color Adjustment] + "Color saturation of the object." , + + //Width [27] [Outline] + "Outline main width." , + + //Width Control [28] [Outline] + "Controls the 'Outline Width' using texture Map.\n\nUse a Black and White texture map.\nWhite means 1 while Black means 0.\nThis will not work if the Outline main width value is 0." , + + //Outline Extrude Method [29] [Outline] + "Outline Extrude Methods.\n\nNormal - The outline extrusion will be based on normal direction.\n\nOrigin - The outline extrusion will be based on the center of the object." , + + //Outline Offset [30] [Outline] + "Outline XYZ position." , + + //Double Sided Outline [31] [Outline] + "Show the front side of the outline.\n\nUseful for plane object.\n'Outline Z Position In Camera' option is needed to be adjust to show the object." , + + //Color [32] [Outline] [Outline] + "Outline color." , + + //Mix Main Texture To Outline [33] [Outline] + "Mix 'Main/Base Texture' to oultine." , + + //Noisy Outline Intensity [34] [Outline] + "The power/intensity of the outline distortion or noise." , + + //Dynamic Noisy Outline [35] [Outline] + "Moving noisy or distort outline." , + + //Light Affect Outline Color [36] [Outline] + "Light (Brightness and Color) affect Outline color." , + + //Outline Width Affected By View Distance [37] [Outline] + "'Outline Width' affected by view distance." , + + //Far Distance Max Width [38] [Outline] + "The maximum 'Outline Width' limit when moving far from the object." , + + //Vertex Color Blue Affect Outline Width [39] [Outline] + "'Vertex Color Blue will affect the Outline Width.\n\nThis will not work if the Outline main width value is 0." , + + //Intensity [40] [SelfLit] + "How visible or strong the 'Self Lit' is." , + + //Color [41] [SelfLit] + "Self Lit color" , + + //Power [42] [SelfLit] + "'Self Lit Color' power or intensity." , + + //Texture and Main Color Intensity [43] [SelfLit] + "'Main/Base Texture' and 'Main/Base Color' intensity.\n\nAdjust this if the 'Main/Base Texture' and 'Main/Base Color' is too strong or too bright for Self Lit." , + + //High Contrast [44] [SelfLit] + "Turn Self Lit into high contrast colors and mix 'Base/Main Texture' twice." , + + //Mask Self Lit [45] [SelfLit] + "Mask Self Lit.\n\nUse a Black and White texture map.\nWhite means visible Self Lit while Black is not." , + + //Gloss Intensity [46] [Gloss] + "How visible or strong the 'Gloss' is." , + + //Glossiness [47] [Gloss] + "Glossiness." , + + //Softness [48] [Gloss] + "How soft the 'Gloss' is." , + + //Color [49] [Gloss] + "Gloss color" , + + //Power [50] [Gloss] + "'Gloss Color' power or intensity." , + + //Mask Gloss [51] [Gloss] + "Mask Gloss.\n\nWhite means visible Gloss while black is not." , + + //Gloss Texture [52] [Gloss Texture] + "A Black and White texture map to be used as gloss.\n\nWhite means gloss while Black is not." , + + //Softness [53] [Gloss Texture] + "The softness of the 'Gloss Texture'." , + + //Pattern Style [54] [Gloss Texture] + "Turn 'Gloss Texture' into pattern style." , + + //Rotate [55] [Gloss Texture] + "Rotate 'Gloss Texture'." , + + //Follow Object Rotation [56] [Gloss Texture] + "'Gloss Texture' will follow the object local rotation." , + + //Follow Light [57] [Gloss Texture] + "'Gloss Texture' will follow the light direction or position." , + + //Overall Shadow Color [58] + "Overall shadow color.\n\nThis will affect Realtime Shadow, Self Shadow/Shade and ShadowT." , + + //Overall Shadow Color Power [59] + "'Overall shadow Color' power or intensity." , + + //Self Shadow & ShadowT At View Direction [60] + "'Self Shadow' and 'ShadowT' follow your view or camera view direction." , + + //Reduce Shadow (Point Light) [61] + "The amount of reduce self cast shadow.\n\nThis option will only take effect when there's a Point Light." , + + //Refresh Settings [62] + "This will refresh and re-apply the settings properly.\n\nClick this if there are some problem, after you update, after material reset or re-import RealToon.", + + //Reduce Shadow [63] + "The amount of reduce self cast shadow.\n\nThis option will only take effect when there's a 'Directional Light', 'Point' or 'Spot Light'." , + + //Shadow Hardness [64] [RealTime Shadow] + "Real time shadow hardness" , + + //Threshold [65] [Self Shadow] + "The amount of 'Self Shadow/Shade' on the object." , + + //Vertex Color Green Control Self Shadow Threshold [66] + "Controls 'Self Shadow Threshold' by using vertex color Green." , + + //Hardness [67] [Self Shadow] + "'Self Shadow/Shade' hardness." , + + //Self Shadow & Real Time Shadow Color [68] + "'Self Shadow and Real Time Shadow Color'.\n\nBefore you set/change this, Set 'Overall Shadow Color' to White." , + + //Self Shadow & Real Time Shadow Color Power [69] + "'Self Shadow and Real Time Shadow Color' power or intensity." , + + //Self Shadow Affected By Light Shadow Strength [70] + "Light shadow strength will affect self shadow visibility." , + + //Smooth Object Normal [71] + "The amount of smooth object normal." , + + //Vertex Color Red Control Smooth Object Normal [72] + "'Vertex color Red controls the amount of smooth object normal." , + + //XYZ Position [73] [Smooth Object Normal] + "Normal's XYZ positions." , + + //Affect Shadow [74] + "Transparency affect shadow." , + + //Show Normal [75] [Smooth Object Normal] + "Show the normal of the object." , + + //Shadow Color Texture [76] + "A texture to color shadow.\n\nThis includes (RealTime Shadow, Self Shadow/Shade and ShadowT.\nYou can also use your 'Main/Base Texture' and adjust 'Power' to make it dark." , + + //Power [77] [Shadow Color Texture] + "How strong or dark the 'Shadow Color Texture'." , + + //Intensity [78] [ShadowT] + "How visitble or strong the 'ShadowT' is." , + + //ShadowT [79] + "ShadowT or Shadow Texture, shadows in texture form.\n\nUse Black or Gray and White Flat, Gradient and Smooth texture map.\nGray and White affected by light while Black is not.\n\nFor more info and how to use and make ShadowT texture maps, see 'Video Tutorials' and 'User Guide.pdf' at the bottom of this RealToon inspector.", + + //Light Threshold [80] [ShadowT] + "The amount of light." , + + //Shadow Threshold [81] [ShadowT] + "The amount of ShadowT." , + + //Hardness [82] [ShadowT] + "'ShadowT' hardness." , + + //Show In Shadow [83] [ShadowT] + "Show 'ShadowT' in shadow.\n\nThis will only be visible if realtime shadow and self shadow/shade color is not Black." , + + //Show In Ambient Light [84] [ShadowT] + "Show 'ShadowT' in Ambient Light.\n\nThis will only be visible if there's an Ambient Light present or GI." , + + //Show In Ambient Light & Shadow Intensity [85] [ShadowT] + "'ShadowT' intensity or visibility in shadow and ambient light." , + + //Show In Ambient Light & Shadow Threshold [86] [ShadowT] + "'ShadowT' threshold in Ambient Light and shadow." , + + //Light Falloff Affect ShadowT [87] + "'Point light' and 'Spot Light' light falloff affect 'ShadowT'." , + + //PTexture [88] + "A Black and White texture to be used as pattern for shadow.\n\nBlack means pattern while White is nothing.\nThis will not be visible if the shadow color is Black." , + + //Power [89] [PTexture] + "How strong or dark the pattern is." , + + //Receive Environmental Ligthing and GI [90] [Lighting] + "Turn on or off receive 'Environmental Ligthing' or 'GI'." , + + //Environmental Ligthing Intensity [91] [Lighting] + "Ambient Light, GI or Environmental Ligthing intensity on the object." , + + //GI Flat Shade [92] [Lighting] + "Turn GI or SH lighting shade into flat shade." , + + //GI Shade Threshold [93] [Lighting] + "The amount of GI Shade on the object." , + + //Light affect Shadow [94] [Lighting] + "Light intensity, color and light falloff affect shadows.\n\nThis will affect (RealTime shadow, Self Shadow and ShadowT)." , + + //Directional Light Intensity [95] [Lighting] + "Directional Light intensity received on the object." , + + //Point and Spot Light Intensity [96] [Lighting] + "Point and Spot light intensity received on the object." , + + //Light Falloff Softness [97] [Lighting] + "How soft is the point and spot light light falloff." , + + //Intensity [98] [Custom Light Direction] + "The amount of custom light direction." , + + //Custom Light Direction [99] [Custom Light Direction] + "XYZ light direction." , + + //Follow Object Rotation [100] [Custom Light Direction] + "'Custom Light Direction' follow object rotation." , + + //Intensity [101] [Reflection] + "The amount reflection visibility." , + + //Roughness [102] [Reflection] + "'Reflection' roughness." , + + //Metallic [103] [Reflection] + "The amount of reflection metallic look." , + + //Mask Reflection [104] + "Mask Reflection.\n\nWhite means visible relfection while Black means reflection not visible." , + + //FReflection [105] + "A texture or image to be used as reflection." , + + //Unfill [106] [Rim Light] + "Unfill the 'Rim Light' on the object." , + + //Softness [107] [Rim Light] + "'Rim Light' softness." , + + //Light Affect Rim Light [108] [Rim Light] + "Light (Brightness and Color) affect 'Rim Light'." , + + //Color [109] [Rim Light] + "'Rim Light' color." , + + //Color Power [110] [Rim Light] + "'Rim Light Color' power or intensity." , + + //Rim Light In Light [111] + "'Rim Light' will be visible in light only." , + + //ID [112] [See Through] + "ID or reference value.\n\n-Default Value: 0" , + + //Set A [113] [See Through] + "'A' The see through object while 'B' is the object to be seen through 'A'.\n\n-Default Value: A" , + + //Set B [114] [See Through] + "'A' The see through object while 'B' is the object to be seen through 'A'.\n\n-Default Value: None" , + + //No Light and Shadow On Backface [115] + "No light and shadow will be visible on a back of a plane/flat object or face.\n\nThis will only be take effect or visible if 'Culling' is turned 'Off' or 'Front'." , + + //Change Shader Compilation Target To 2.0/4.5. [116] + "This will change the Shader Compilation Target of the RealToon Shader file to '2.0' or '4.5'.\n\n*If the shader compilation target is changed to 4.5, the shader will support DOTS/DOTS Hybrid Renderer, GPU Resident and Tessellation.", + + //Hide Directional Light Shadow [117] + "Hide received 'Directional Light' shadows on the object." , + + //Hide Point & Spot Light Shadow [118] + "Hide received 'Point and Spot Light' shadows on the object." , + + //Disable Cast Shadow [119] + "Disable object cast shadow." , + + //ZWrite [120] + "Turn on or off ZWrite.\n\n*Does not affect outline, there is a dedicated ZWrite option for outline, it is under the 'Outline' category." , + + //Automatic Remove Unused Shader Keywords [121] + "Remove unused shader keywords automatically in all materials with Realtoon Shader. This will take effect once this enabled and when the RealToon Inspector shown. Disable this if you experience too slow Inspector.\n\n(Warning: This will also remove stored previous shaders shader keywords.)", + + //Color[122] [PTexture] + "'PTexture' color." , + + //Outline Z Position In Camera [123] [Outline] + "Adjust the outline Z position in camera space." , + + //RealTime Shadow Intensity [124] [RealTime Shadow] + "Adjust the realtime shadow intensity." , + + //Rim Light Intensity [125] [RimLight] + "'Rim Light' intensity.", + + //Self Shadow & RealTime Shadow Intensity [126] + "Adjust the 'Self Shadow' and realtime shadow intensity." , + + //Self Shadow Color [127] [Shadow] + "'Self Shadow' color." , + + //Self Shadow Color Power [128] [Shadow] + "'Self Shadow' color power or intensity." , + + //Color [129] [ShadowT] + "'ShadowT' color." , + + //Color Power [130] [ShadowT] + "'ShadowT' color power or intensity.", + + //Ignore Light [131] [ShadowT] + "'ShadowT' ignore direction light or light position.", + + //Light Intensity [132] [Lighting] + "How strong is the Light in the shadow.", + + //Enable Additional Lights [133] [Lighting] + "Enable additional lights like Point and Spot lights.", + + //Use Traditional Light Blend [134] [Lighting] + "Use traditional light blend.\n\nIf enabled light blending will be in add mode, if not enabled the light blending will based on high or maximum light intensity and the blending will be similar to Anime or Cartoon.", + + //Remove Outline/Add Outline (On Shader) [135] + "This will remove the Outline feature completely on the shader file or Add back the Outline feature on the shader file.\n\nThis is not per material.", + + //Video Tutorials [136] + "RealToon's video tutorial playlist.", + + //RealToon (User Guide).pdf [137] + "RealToon's user guide or documentation.", + + //Hide/Show UI [138] + "This will hide or show RealToon's Inspector UI.\n\nThis is global and not per material.", + + //Depth Threshold [139] [outline] + "This will adjust the depth based outline threshold.", + + //Mix Outline To The Shader Output [140] [outline] + "This will mix the outline to the shader output", + + //Optimize for [Light Mode:Baked] [141] + "If enabled, it will disable all realtime features on the shader and optimize it for [Light Mode:Baked].\n\nDisable or uncheck this for [Light Mode: RealTime or Mixed] use.", + + //Use Screen Space Outline/Use Traditional Outline [142] [outline] + "This will enable you to use 'Screen Space Outline' or 'Traditional Outline'.\n\n'Depth Texture' needs to be turn 'On' if you use the 'Screen Space Outline'.\n\nThis is not per material.", + + //Use Linear Blend Skinning/Compute Deformation [143] + "This will enable you to use 'Linear Blend Skinning' or 'Compute Deformation'.\n\nThis will modify the RealToon shader file.\nCurrently it does not support Tessellation.", + + //Light Ignore Y Normal Direcion [144] + "Light will ignore Object Normal Y direction.", + + //Enable Screen Space Ambient Occlusion [145] + "Enable SSAO or Screen Space Ambient Occlusion." , + + //Ambient Occlusion Color [146] + "Ambient Occlusion color or tint.", + + //Receive Decal [147] + "The object will Receive Decal.", + + //Glow Color [148] + "Glow edge color.", + + //Glow Edge Width [149] + "The width of the glow.", + + //Simple Transparency Mode[150] + "Common simple transparency.\nOnly 'Opacity', 'Blend Modes' and 'Affect Shadow' are available.\n\n'Transparent Threshold' and 'Mask Transparency' not available on this mode.", + + //Disable DOTS Mesh Deformation[151] + "Disable DOTS Mesh Deformation: 'Linear Blend Skinning and Compute Deformation'.\n\n*For Static Objects, enabled this.", + + //Near Fade Dithering - Min Distance[152] + "The minimum near distance.", + + //Near Fade Dithering - Max Distance[153] + "The maximum near distance.", + + //Soft Cutout [154] + "Dithering/Dot style cutout.\n\nFor a soft edge cutout.", + + //Tile (Triplanar) [155] + "Tiling scale of the texture.", + + //Blend (Triplanar) [156] + "Blending of the triplanar texture.", + + //Perspective (Perspective Adjustment) [157] + "This will change the perspective of an object to 2D or 3D or FOV stretch look.\nFor 2d toon/anime look, set it to 0.5 or 0.", + + //Clip (Perspective Adjustment) [158] + "This will change the clipping on the object.\nChange this if the object is overlapping front or back.\nHigher value will slice the object.", + + //Close-Up Size (Perspective Adjustment) [159] + "This will adjust the size of the object when the camera is closer.", + + //Close-Up Size Smooth Transition (Perspective Adjustment) [160] + "How smooth the transition of the sizing.", + + //Close-Up Size Distance (Perspective Adjustment) [161] + "Distance transition from the camera to the object.", + + //SDF Mode (ShadowT) [162] + "SDF Style Shadowing.\nNote: This only affect 3D Space X & Z axis.", + + //Add/Remove 'See Through' feature [163] + "This will add or remove 'See Through' feature on the RealToon Shader.\n\nUse this if you don't need the 'See Through' feature.\n\nThis will modify the RealToon shader file.", + + //Anti-Aliasing (Cutout) [164] + "Anti-Aliasing/MSAA affects cutout.\n\n*This is Alpha To Coverage and it will only work if Forward/Forward+ Path Rendering is use.\n*If you turn off Cutout feature, this will revert to disable/off.", + + //Anisotropic Mode (Gloss Texture) [165] + "Setting the Gloss Texture to Anisotropic Mode.\n\nNote: This will use Gloss Texture texture input as noise.", + + //Noise Texture Intensity (Gloss Texture) [166] + "How strong the Noise Texture distortion.", + + //Width (Gloss Texture) [167] + "Width of the Anisotropic.", + + //Shift (Gloss Texture) [168] + "Shift the Anisotropic to Up or Down.", + + //Noise Texture Affect Width (Gloss Texture) [169] + "Noise Texture affect Anisotropic Width.\n\nNote: White means 1 while Black is 0.", + + //Stencil: Pass (Outline) [170] + "Use for fixing outline overlapping issues to other assets, objects and UI.", + + //Limit Light Intensity [171] + "This will limit the light intensity.\nMinimum and maximum light intensity.", + + //Minimum (Limit Light Intensity) [172] + "Minimum Light Intensity value.", + + //Maximum (Limit Light Intensity) [173] + "Maximum Light Intensity value.", + + //Anti-Aliasing Softness (Anti-Aliasing Affects Cutout) (Cutout) [174] + "How soft the Anti-Aliasing.", + + //Map Mode (SelfLit) [175] + "Use SelfLit Mask as SelfLit Map/Emission Map", + + //SelfLit Map (SelfLit) [176] + "A SelfLit Map/Emission Map.\nYou can use Grayscale/alpha or RGB/Colored Map.", + + //Outline Resize (Outline) [177] + "Resizing the outline XYZ.", + + //Object Position Z (CS) [178] + "Adjust object position z axis in clip space.\n\n*Can also use it to move the object infront or back.\n*Can also be use for adjusting 'Prespective Adjustment - Clip'.", + + //Rimlight In Shadow (Rimlight) [179] + "Rim Light in shadow only.", + + //Position (Rimlight) [180] + "Rim Light position.", + + //Render Order [181] + "This will change the object's Render Order, infront or behind.\nThis will affect the Render Queue.\n\n*Mostly useful when using Transparent Mode or if the ZWrite is Off.", + + //ZTest [182] + "Determines whether a pixel should be rendered based on its distance from the camera compared to what is already drawn in the depth buffer (Z-buffer).\n\n*Does not affect outline, there is a dedicated ZTest option for outline, it is under the 'Outline' category", + + //ZTest (Outline) [183] + "Determines whether a pixel should be rendered based on its distance from the camera compared to what is already drawn in the depth buffer (Z-buffer).\n\n*This only affect Outline.", + + //ZWrite (Outline) [184] + "Turn off or on.\n\n*This only affect Outline.", + + //UV Set [185] + "UV Set/UV Channel.\n\n*This affect all texture/map slots.", + + //Enable/Disable Tessellation [186] + "This will Enable/Disable 'Tessellation' feature on the RealToon Shader.\n\nThis will modify the RealToon shader file.", + + //Smoothness (Tessellation) [187] + "Smooth tessellated faces.", + + //Tessellation Transition (Tessellation) [188] + "Transition distance between Near and Far.\n\n*0 means mostly near tessellation value while 1 means mostly far tessellation value.", + + //Tessellation Near (Tessellation) [189] + "The amount of Tessellation when Near.", + + //Tessellation Far (Tessellation) [190] + "The amount of Tessellation when Far.", + + //Normal Map As Displacement (Tessellation) [191] + "Normal Map as a displacement.\n\n*You need to enable Normal Map feature.", + + }; + + #endregion + + #region TOTIPS for EnDisFeatures + + string[] TOTIPSEDF = + { + //MatCap [0] + "MatCap or Material Capture.", + + //Normal Map [1] + "Normal Map.", + + //Outline [2] + "Outline.", + + //Cutout [3] + "Cutout.", + + //Color Adjustment [4] + "Adjust the color of the object.", + + //SelfLit [5] + "Own light or Emission.", + + //Gloss [6] + "Gloss.", + + //Gloss Texture [7] + "Gloss in texture form.\n\nUse a Black and White texture map.\nWhite means gloss while Black is not.", + + //Self Shadow [8] + "Self Shadow or Shade.", + + //Smooth Object Normal [9] + "Smooth object normal or ignore object normal.", + + //Shadow Color Texture [10] + "Color shadow using texture.", + + //ShadowT [11] + "ShadowT or Shadow Texture, shadows in texture form.\n\nUse Black or Gray and White Flat, Gradient and Smooth texture map.\nGray and White affected by light while Black is not.\n\nFor more info and how to use and make ShadowT texture maps, see 'Video Tutorials' and 'User Guide.pdf' at the bottom of this RealToon inspector.", + + //PTexture [12] + "PTexture or Pattern Texture.\n\nA Black and White texture to be used as pattern for shadow.\n\nBlack means pattern while White is nothing.\nThis will not be visible if the shadow color is Black.", + + //Custom Light Direction [13] + "Custom light direction.", + + //Reflection [14] + "Reflection.", + + //FReflection [15] + "FReflection or Fake Reflection.\n\nUse any texture or image as reflection.", + + //Rim Light [16] + "Rim light or fresnel effect.", + + //Near Fade Dithering [17] + "Object fades when the camera near.", + + //Triplanar [18] + "For a uniform texture scale and tiles.\n\nUseful for static objects and environment.", + + //Perspective Adjustment [19] + "This will adjust the perspective of your object to look 2D Toon/Anime or Default 3D.", + + //Smear Effect [20] + "Trail lines or Line noise effect when an object move fast, like the Anime/Cartoon." + + }; + + #endregion + + public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] properties) + { + //This Material + Material targetMat = materialEditor.target as Material; + + //Settings + materialEditor.SetDefaultGUIWidths(); + + if (MatRenQue == 0) + { + MatRenQue = targetMat.renderQueue; + } + + //Content + + //Will remove soon if no use anymore + #region Shader Name Switch + + //switch (targetMat.shader.name) + //{ + //case "Universal Render Pipeline/RealToon/Version 5/Default/Default": + // shader_name = "default_d"; + // shader_type = "URP - Default"; + // break; + //case "Universal Render Pipeline/RealToon/Version 5/Default/Fade Transparency": + // shader_name = "default_ft"; + // shader_type = "URP - Fade Transperancy"; + // break; + //case "RealToon/Version 5/Default/Refraction": //Temporarily Removed + //shader_name = "default_ref"; //Temporarily Removed + //shader_type = "Refraction"; + //break; + //case "RealToon/Version 5/Tessellation/Default": //Temporarily Removed + //shader_name = "tessellation_d"; //Temporarily Removed + //shader_type = "Tessellation - Default"; //Temporarily Removed + //break; //Temporarily Removed + //case "RealToon/Version 5/Tessellation/Fade Transparency": //Temporarily Removed + //shader_name = "tessellation_ft"; //Temporarily Removed + //shader_type = "Tessellation - Fade Transparency"; //Temporarily Removed + //break; //Temporarily Removed + //case "RealToon/Version 5/Tessellation/Refraction": //Temporarily Removed + //shader_name = "tessellation_ref"; //Temporarily Removed + //shader_type = "Tessellation - Refraction"; //Temporarily Removed + //break; //Temporarily Removed + //default: + // shader_name = string.Empty; + // shader_type = string.Empty; + // break; + //} + + + #endregion + + #region Material Properties + + _UVSet = ShaderGUI.FindProperty("_UVSet", properties); + _UseTLB = ShaderGUI.FindProperty("_UseTLB", properties); + _Culling = ShaderGUI.FindProperty("_Culling", properties); + _TRANSMODE = ShaderGUI.FindProperty("_TRANSMODE", properties); + + _MainTex = ShaderGUI.FindProperty("_MainTex", properties); + _TexturePatternStyle = ShaderGUI.FindProperty("_TexturePatternStyle", properties); + + _MainColor = ShaderGUI.FindProperty("_MainColor", properties); + _MaiColPo = ShaderGUI.FindProperty("_MaiColPo", properties); + + _MVCOL = ShaderGUI.FindProperty("_MVCOL", properties); + _MCIALO = ShaderGUI.FindProperty("_MCIALO", properties); + + _MCapIntensity = ShaderGUI.FindProperty("_MCapIntensity", properties); + _MCap = ShaderGUI.FindProperty("_MCap", properties); + _SPECMODE = ShaderGUI.FindProperty("_SPECMODE", properties); + _SPECIN = ShaderGUI.FindProperty("_SPECIN", properties); + _MCapMask = ShaderGUI.FindProperty("_MCapMask", properties); + + _Cutout = ShaderGUI.FindProperty("_Cutout", properties); + _UseSecondaryCutout = ShaderGUI.FindProperty("_UseSecondaryCutout", properties); + _SecondaryCutout = ShaderGUI.FindProperty("_SecondaryCutout", properties); + _AlphaBaseCutout = ShaderGUI.FindProperty("_AlphaBaseCutout", properties); + _AAS = ShaderGUI.FindProperty("_AAS", properties); + _N_F_SCO = ShaderGUI.FindProperty("_N_F_SCO", properties); + _AlpToCov = ShaderGUI.FindProperty("_AlpToCov", properties); + + _N_F_COEDGL = ShaderGUI.FindProperty("_N_F_COEDGL", properties); + _Glow_Color = ShaderGUI.FindProperty("_Glow_Color", properties); + _Glow_Edge_Width = ShaderGUI.FindProperty("_Glow_Edge_Width", properties); + + _Opacity = ShaderGUI.FindProperty("_Opacity", properties); + _TransparentThreshold = ShaderGUI.FindProperty("_TransparentThreshold", properties); + _MaskTransparency = ShaderGUI.FindProperty("_MaskTransparency", properties); + _BleModSour = ShaderGUI.FindProperty("_BleModSour", properties); + _BleModDest = ShaderGUI.FindProperty("_BleModDest", properties); + + _SimTrans = ShaderGUI.FindProperty("_SimTrans", properties); + _TransAffSha = ShaderGUI.FindProperty("_TransAffSha", properties); + + _NormalMap = ShaderGUI.FindProperty("_NormalMap", properties); + _NormalMapIntensity = ShaderGUI.FindProperty("_NormalMapIntensity", properties); + + _Saturation = ShaderGUI.FindProperty("_Saturation", properties); + + _OutlineWidth = ShaderGUI.FindProperty("_OutlineWidth", properties); + _OutlineWidthControl = ShaderGUI.FindProperty("_OutlineWidthControl", properties); + _OutlineExtrudeMethod = ShaderGUI.FindProperty("_OutlineExtrudeMethod", properties); + _OutlineOffset = ShaderGUI.FindProperty("_OutlineOffset", properties); + _OutResi = ShaderGUI.FindProperty("_OutResi", properties); + _OutlineZPostionInCamera = ShaderGUI.FindProperty("_OutlineZPostionInCamera", properties); + _DoubleSidedOutline = ShaderGUI.FindProperty("_DoubleSidedOutline", properties); + _OutlineColor = ShaderGUI.FindProperty("_OutlineColor", properties); + _MixMainTexToOutline = ShaderGUI.FindProperty("_MixMainTexToOutline", properties); + _NoisyOutlineIntensity = ShaderGUI.FindProperty("_NoisyOutlineIntensity", properties); + _DynamicNoisyOutline = ShaderGUI.FindProperty("_DynamicNoisyOutline", properties); + _LightAffectOutlineColor = ShaderGUI.FindProperty("_LightAffectOutlineColor", properties); + _OutlineWidthAffectedByViewDistance = ShaderGUI.FindProperty("_OutlineWidthAffectedByViewDistance", properties); + _FarDistanceMaxWidth = ShaderGUI.FindProperty("_FarDistanceMaxWidth", properties); + _VertexColorBlueAffectOutlineWitdh = ShaderGUI.FindProperty("_VertexColorBlueAffectOutlineWitdh", properties); + _OutStenPass = ShaderGUI.FindProperty("_OutStenPass", properties); + _OutZWrite = ShaderGUI.FindProperty("_OutZWrite", properties); + _OutZTest = ShaderGUI.FindProperty("_OutZTest", properties); + + _DepthThreshold = ShaderGUI.FindProperty("_DepthThreshold", properties); + _N_F_MSSOLTFO = ShaderGUI.FindProperty("_N_F_MSSOLTFO", properties); + + _SelfLitIntensity = ShaderGUI.FindProperty("_SelfLitIntensity", properties); + _SelfLitColor = ShaderGUI.FindProperty("_SelfLitColor", properties); + _SelfLitPower = ShaderGUI.FindProperty("_SelfLitPower", properties); + _TEXMCOLINT = ShaderGUI.FindProperty("_TEXMCOLINT", properties); + _SelfLitHighContrast = ShaderGUI.FindProperty("_SelfLitHighContrast", properties); + _N_F_SLMM = ShaderGUI.FindProperty("_N_F_SLMM", properties); + _MaskSelfLit = ShaderGUI.FindProperty("_MaskSelfLit", properties); + + _GlossIntensity = ShaderGUI.FindProperty("_GlossIntensity", properties); + _Glossiness = ShaderGUI.FindProperty("_Glossiness", properties); + _GlossSoftness = ShaderGUI.FindProperty("_GlossSoftness", properties); + _GlossColor = ShaderGUI.FindProperty("_GlossColor", properties); + _GlossColorPower = ShaderGUI.FindProperty("_GlossColorPower", properties); + _MaskGloss = ShaderGUI.FindProperty("_MaskGloss", properties); + + _GlossTexture = ShaderGUI.FindProperty("_GlossTexture", properties); + _GlossTextureSoftness = ShaderGUI.FindProperty("_GlossTextureSoftness", properties); + _PSGLOTEX = ShaderGUI.FindProperty("_PSGLOTEX", properties); + _GlossTextureRotate = ShaderGUI.FindProperty("_GlossTextureRotate", properties); + _GlossTextureFollowObjectRotation = ShaderGUI.FindProperty("_GlossTextureFollowObjectRotation", properties); + _N_F_ANIS = ShaderGUI.FindProperty("_N_F_ANIS", properties); + _NoisTexInten = ShaderGUI.FindProperty("_NoisTexInten", properties); + _StraWidt = ShaderGUI.FindProperty("_StraWidt", properties); + _NoiTexAffStraWidt = ShaderGUI.FindProperty("_NoiTexAffStraWidt", properties); + _ShifAnis = ShaderGUI.FindProperty("_ShifAnis", properties); + _GlossTextureFollowLight = ShaderGUI.FindProperty("_GlossTextureFollowLight", properties); + + _OverallShadowColor = ShaderGUI.FindProperty("_OverallShadowColor", properties); + _OverallShadowColorPower = ShaderGUI.FindProperty("_OverallShadowColorPower", properties); + _SelfShadowShadowTAtViewDirection = ShaderGUI.FindProperty("_SelfShadowShadowTAtViewDirection", properties); + + _HighlightColor = ShaderGUI.FindProperty("_HighlightColor", properties); + _HighlightColorPower = ShaderGUI.FindProperty("_HighlightColorPower", properties); + + _SelfShadowThreshold = ShaderGUI.FindProperty("_SelfShadowThreshold", properties); + _VertexColorGreenControlSelfShadowThreshold = ShaderGUI.FindProperty("_VertexColorGreenControlSelfShadowThreshold", properties); + _SelfShadowHardness = ShaderGUI.FindProperty("_SelfShadowHardness", properties); + + _SelfShadowRealtimeShadowIntensity = ShaderGUI.FindProperty("_SelfShadowRealtimeShadowIntensity", properties); + + _SelfShadowRealTimeShadowColor = ShaderGUI.FindProperty("_SelfShadowRealTimeShadowColor", properties); + _SelfShadowRealTimeShadowColorPower = ShaderGUI.FindProperty("_SelfShadowRealTimeShadowColorPower", properties); + + _LigIgnoYNorDir = ShaderGUI.FindProperty("_LigIgnoYNorDir", properties); + _SelfShadowAffectedByLightShadowStrength = ShaderGUI.FindProperty("_SelfShadowAffectedByLightShadowStrength", properties); + + _SmoothObjectNormal = ShaderGUI.FindProperty("_SmoothObjectNormal", properties); + _VertexColorRedControlSmoothObjectNormal = ShaderGUI.FindProperty("_VertexColorRedControlSmoothObjectNormal", properties); + //_XYZPosition = ShaderGUI.FindProperty("_XYZPosition", properties); + _ShowNormal = ShaderGUI.FindProperty("_ShowNormal", properties); + + _ShadowColorTexture = ShaderGUI.FindProperty("_ShadowColorTexture", properties); + _ShadowColorTexturePower = ShaderGUI.FindProperty("_ShadowColorTexturePower", properties); + + _ShadowTIntensity = ShaderGUI.FindProperty("_ShadowTIntensity", properties); + _ShadowT = ShaderGUI.FindProperty("_ShadowT", properties); + _ShadowTLightThreshold = ShaderGUI.FindProperty("_ShadowTLightThreshold", properties); + _ShadowTShadowThreshold = ShaderGUI.FindProperty("_ShadowTShadowThreshold", properties); + _ShadowTColor = ShaderGUI.FindProperty("_ShadowTColor", properties); + _ShadowTColorPower = ShaderGUI.FindProperty("_ShadowTColorPower", properties); + _ShadowTHardness = ShaderGUI.FindProperty("_ShadowTHardness", properties); + _STIL = ShaderGUI.FindProperty("_STIL", properties); + _N_F_STIS = ShaderGUI.FindProperty("_N_F_STIS", properties); + _N_F_STIAL = ShaderGUI.FindProperty("_N_F_STIAL", properties); + _ShowInAmbientLightShadowIntensity = ShaderGUI.FindProperty("_ShowInAmbientLightShadowIntensity", properties); + _ShowInAmbientLightShadowThreshold = ShaderGUI.FindProperty("_ShowInAmbientLightShadowThreshold", properties); + + _LightFalloffAffectShadowT = ShaderGUI.FindProperty("_LightFalloffAffectShadowT", properties); + + _N_F_STSDFM = ShaderGUI.FindProperty("_N_F_STSDFM", properties); + + _PTexture = ShaderGUI.FindProperty("_PTexture", properties); + _PTCol = ShaderGUI.FindProperty("_PTCol", properties); + _PTexturePower = ShaderGUI.FindProperty("_PTexturePower", properties); + + _EnvironmentalLightingIntensity = ShaderGUI.FindProperty("_EnvironmentalLightingIntensity", properties); + _RELG = ShaderGUI.FindProperty("_RELG", properties); + + _GIFlatShade = ShaderGUI.FindProperty("_GIFlatShade", properties); + _GIShadeThreshold = ShaderGUI.FindProperty("_GIShadeThreshold", properties); + _LightAffectShadow = ShaderGUI.FindProperty("_LightAffectShadow", properties); + _LightIntensity = ShaderGUI.FindProperty("_LightIntensity", properties); + + _N_F_EAL = ShaderGUI.FindProperty("_N_F_EAL", properties); + + _DirectionalLightIntensity = ShaderGUI.FindProperty("_DirectionalLightIntensity", properties); + _PointSpotlightIntensity = ShaderGUI.FindProperty("_PointSpotlightIntensity", properties); + _LightFalloffSoftness = ShaderGUI.FindProperty("_LightFalloffSoftness", properties); + + _N_F_LLI = ShaderGUI.FindProperty("_N_F_LLI", properties); + _LLI_Min = ShaderGUI.FindProperty("_LLI_Min", properties); + _LLI_Max = ShaderGUI.FindProperty("_LLI_Max", properties); + + _ReduSha = ShaderGUI.FindProperty("_ReduSha", properties); + _ShadowHardness = ShaderGUI.FindProperty("_ShadowHardness", properties); + + _CustomLightDirectionIntensity = ShaderGUI.FindProperty("_CustomLightDirectionIntensity", properties); + _CustomLightDirectionFollowObjectRotation = ShaderGUI.FindProperty("_CustomLightDirectionFollowObjectRotation", properties); + _CustomLightDirection = ShaderGUI.FindProperty("_CustomLightDirection", properties); + + _ReflectionIntensity = ShaderGUI.FindProperty("_ReflectionIntensity", properties); + _Smoothness = ShaderGUI.FindProperty("_Smoothness", properties); + _RefMetallic = ShaderGUI.FindProperty("_RefMetallic", properties); + _MaskReflection = ShaderGUI.FindProperty("_MaskReflection", properties); + _FReflection = ShaderGUI.FindProperty("_FReflection", properties); + + _RimLigInt = ShaderGUI.FindProperty("_RimLigInt", properties); + _RimLightUnfill = ShaderGUI.FindProperty("_RimLightUnfill", properties); + _RimLightColor = ShaderGUI.FindProperty("_RimLightColor", properties); + _RimLightColorPower = ShaderGUI.FindProperty("_RimLightColorPower", properties); + _RimLightSoftness = ShaderGUI.FindProperty("_RimLightSoftness", properties); + _RimLigPosi = ShaderGUI.FindProperty("_RimLigPosi", properties); + _RimLightInLight = ShaderGUI.FindProperty("_RimLightInLight", properties); + _LightAffectRimLightColor = ShaderGUI.FindProperty("_LightAffectRimLightColor", properties); + _N_F_RLIS = ShaderGUI.FindProperty("_N_F_RLIS", properties); + + _MinFadDistance = ShaderGUI.FindProperty("_MinFadDistance", properties); + _MaxFadDistance = ShaderGUI.FindProperty("_MaxFadDistance", properties); + + _TriPlaTile = ShaderGUI.FindProperty("_TriPlaTile", properties); + _TriPlaBlend = ShaderGUI.FindProperty("_TriPlaBlend", properties); + + _PresAdju = ShaderGUI.FindProperty("_PresAdju", properties); + _ClipAdju = ShaderGUI.FindProperty("_ClipAdju", properties); + _PASize = ShaderGUI.FindProperty("_PASize", properties); + _PASmooTrans = ShaderGUI.FindProperty("_PASmooTrans", properties); + _PADist = ShaderGUI.FindProperty("_PADist", properties); + + _TessellationSmoothness = ShaderGUI.FindProperty("_TessellationSmoothness", properties); + _TessellationTransition = ShaderGUI.FindProperty("_TessellationTransition", properties); + _TessellationNear = ShaderGUI.FindProperty("_TessellationNear", properties); + _TessellationFar = ShaderGUI.FindProperty("_TessellationFar", properties); + _NorMapAsDis = ShaderGUI.FindProperty("_NorMapAsDis", properties); + + _SSAOColor = ShaderGUI.FindProperty("_SSAOColor", properties); + + _RefVal = ShaderGUI.FindProperty("_RefVal", properties); + _Oper = ShaderGUI.FindProperty("_Oper", properties); + _Compa = ShaderGUI.FindProperty("_Compa", properties); + + _N_F_MC = ShaderGUI.FindProperty("_N_F_MC", properties); + _N_F_NM = ShaderGUI.FindProperty("_N_F_NM", properties); + _N_F_CO = ShaderGUI.FindProperty("_N_F_CO", properties); + _N_F_O = ShaderGUI.FindProperty("_N_F_O", properties); + _N_F_CA = ShaderGUI.FindProperty("_N_F_CA", properties); + _N_F_SL = ShaderGUI.FindProperty("_N_F_SL", properties); + _N_F_GLO = ShaderGUI.FindProperty("_N_F_GLO", properties); + _N_F_GLOT = ShaderGUI.FindProperty("_N_F_GLOT", properties); + _N_F_SS = ShaderGUI.FindProperty("_N_F_SS", properties); + _N_F_SON = ShaderGUI.FindProperty("_N_F_SON", properties); + _N_F_SCT = ShaderGUI.FindProperty("_N_F_SCT", properties); + _N_F_ST = ShaderGUI.FindProperty("_N_F_ST", properties); + _N_F_PT = ShaderGUI.FindProperty("_N_F_PT", properties); + _N_F_CLD = ShaderGUI.FindProperty("_N_F_CLD", properties); + _N_F_R = ShaderGUI.FindProperty("_N_F_R", properties); + _N_F_FR = ShaderGUI.FindProperty("_N_F_FR", properties); + _N_F_RL = ShaderGUI.FindProperty("_N_F_RL", properties); + _N_F_NFD = ShaderGUI.FindProperty("_N_F_NFD", properties); + _N_F_TP = ShaderGUI.FindProperty("_N_F_TP", properties); + _N_F_PA = ShaderGUI.FindProperty("_N_F_PA", properties); + _N_F_SE = ShaderGUI.FindProperty("_N_F_SE", properties); + + _N_F_HDLS = ShaderGUI.FindProperty("_N_F_HDLS", properties); + _N_F_HPSS = ShaderGUI.FindProperty("_N_F_HPSS", properties); + + _N_F_DCS = ShaderGUI.FindProperty("_N_F_DCS", properties); + + _N_F_HDLS = ShaderGUI.FindProperty("_N_F_HDLS", properties); + _N_F_HPSS = ShaderGUI.FindProperty("_N_F_HPSS", properties); + _N_F_DCS = ShaderGUI.FindProperty("_N_F_DCS", properties); + + _N_F_NLASOBF = ShaderGUI.FindProperty("_N_F_NLASOBF", properties); + _N_F_OFLMB = ShaderGUI.FindProperty("_N_F_OFLMB", properties); + _N_F_ESSAO = ShaderGUI.FindProperty("_N_F_ESSAO", properties); + _N_F_RDC = ShaderGUI.FindProperty("_N_F_RDC", properties); + _N_F_DDMD = ShaderGUI.FindProperty("_N_F_DDMD", properties); + + _ObjePosiZCS = ShaderGUI.FindProperty("_ObjePosiZCS", properties); + _ZWrite = ShaderGUI.FindProperty("_ZWrite", properties); + _ZTest = ShaderGUI.FindProperty("_ZTest", properties); + + _RQSO = ShaderGUI.FindProperty("_RQSO", properties); + + #endregion + + + //UI + + #region UI + + //Header + Rect r_header = EditorGUILayout.BeginVertical("HelpBox"); + + Rect rect = new Rect(36, 11, t.width, t.height); + GUI.DrawTexture(rect, t, ScaleMode.ScaleToFit); + GUILayout.Space(32); + + EditorGUILayout.LabelField("(" + realtoon_version + " - " + srp_mode + " - " + shader_type + ")", EditorStyles.boldLabel); + + EditorGUILayout.EndVertical(); + + + if (ShowUI == true) + { + + GUILayout.Space(20); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + //Light Blend + + #region Light Blend + + Rect r_lightblend = EditorGUILayout.BeginVertical("HelpBox"); + EditorGUILayout.LabelField("Light Blend Style: " + LightBlendString); + EditorGUILayout.EndVertical(); + + switch ((int)_UseTLB.floatValue) + { + case 0: + LightBlendString = "Anime/Cartoon"; + break; + case 1: + LightBlendString = "Traditional"; + break; + default: + break; + } + + #endregion + + //Double Sided + + #region Culling + + Rect r_culling = EditorGUILayout.BeginVertical("HelpBox"); + materialEditor.ShaderProperty(_Culling, new GUIContent(_Culling.displayName, TOTIPS[0])); + EditorGUILayout.EndVertical(); + + #endregion + + //UV Set + + #region UV Set + + Rect r_uvset = EditorGUILayout.BeginVertical("HelpBox"); + materialEditor.ShaderProperty(_UVSet, new GUIContent(_UVSet.displayName, TOTIPS[185])); + EditorGUILayout.EndVertical(); + + #endregion + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + //Transparent Mode + + #region Transparent Mode + + Rect r_renderqueue = EditorGUILayout.BeginVertical("HelpBox"); + + EditorGUI.BeginChangeCheck(); + + materialEditor.ShaderProperty(_TRANSMODE, new GUIContent(_TRANSMODE.displayName, TOTIPS[11])); + + if (EditorGUI.EndChangeCheck()) + { + foreach (Material m in materialEditor.targets) + { + switch (_TRANSMODE.floatValue) + { + case 0: + + m.renderQueue = -1; + MatRenQue = 2000; + m.SetOverrideTag("RenderType", "Opaque"); + m.SetInt("_BleModSour", 1); + m.SetInt("_BleModDest", 0); + shader_type = "Default"; + break; + + case 1: + + m.SetInt("_BleModSour", 5); + m.SetInt("_BleModDest", 10); + + if (m.IsKeywordEnabled("N_F_CO_ON") || m.GetFloat("_N_F_CO") == 1.0f) + { + m.renderQueue = 2450; + MatRenQue = m.renderQueue; + m.SetOverrideTag("RenderType", "TransparentCutout"); + } + else + { + m.renderQueue = 3000; + MatRenQue = m.renderQueue; + m.SetOverrideTag("RenderType", "Transparent"); + } + + shader_type = "Fade Transperancy"; + break; + + default: + break; + } + + } + + materialEditor.PropertiesChanged(); + + } + + EditorGUILayout.EndVertical(); + + #endregion + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + GUILayout.Space(20); + + //Texture - Color + + #region Texture - Color + + Rect r_texturecolor = EditorGUILayout.BeginVertical("Button"); + + ShowTextureColor = EditorGUILayout.Foldout(ShowTextureColor, "(Texture - Color)", true, EditorStyles.foldout); + + if (ShowTextureColor) + { + + GUILayout.Space(10); + + materialEditor.ShaderProperty(_MainTex, new GUIContent(_MainTex.displayName, TOTIPS[1])); + + EditorGUI.BeginDisabledGroup(_MainTex.textureValue == null); + materialEditor.ShaderProperty(_TexturePatternStyle, new GUIContent(_TexturePatternStyle.displayName, TOTIPS[2])); + EditorGUI.EndDisabledGroup(); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + materialEditor.ShaderProperty(_MainColor, new GUIContent(_MainColor.displayName, TOTIPS[3])); + materialEditor.ShaderProperty(_MaiColPo, new GUIContent(_MaiColPo.displayName, TOTIPS[8])); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + materialEditor.ShaderProperty(_MVCOL, new GUIContent(_MVCOL.displayName, TOTIPS[4])); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + materialEditor.ShaderProperty(_MCIALO, new GUIContent(_MCIALO.displayName, TOTIPS[5])); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + materialEditor.ShaderProperty(_HighlightColor, new GUIContent(_HighlightColor.displayName, TOTIPS[6])); + materialEditor.ShaderProperty(_HighlightColorPower, new GUIContent(_HighlightColorPower.displayName, TOTIPS[7])); + + GUILayout.Space(10); + + } + + EditorGUILayout.EndVertical(); + + #endregion + + //MatCap + + #region MatCap + + if (_N_F_MC.floatValue == 1) + { + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + Rect r_matcap = EditorGUILayout.BeginVertical("Button"); + ShowMatCap = EditorGUILayout.Foldout(ShowMatCap, "(MatCap)", true, EditorStyles.foldout); + + if (ShowMatCap) + { + + GUILayout.Space(10); + + materialEditor.ShaderProperty(_MCapIntensity, new GUIContent(_MCapIntensity.displayName, TOTIPS[13])); + materialEditor.ShaderProperty(_MCap, _MCap.displayName); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + materialEditor.ShaderProperty(_SPECMODE, new GUIContent(_SPECMODE.displayName, TOTIPS[14])); + EditorGUI.BeginDisabledGroup(_SPECMODE.floatValue == 0); + materialEditor.ShaderProperty(_SPECIN, new GUIContent(_SPECIN.displayName, TOTIPS[15])); + EditorGUI.EndDisabledGroup(); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + materialEditor.ShaderProperty(_MCapMask, new GUIContent(_MCapMask.displayName, TOTIPS[16])); + + GUILayout.Space(10); + + } + + EditorGUILayout.EndVertical(); + } + + #endregion + + //Cutout + + #region Cutout + + if (_TRANSMODE.floatValue == 1) + { + if (_N_F_CO.floatValue == 1) + { + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + EditorGUI.BeginDisabledGroup(_N_F_CO.floatValue == 0); + + Rect r_cutout = EditorGUILayout.BeginVertical("Button"); + ShowCutout = EditorGUILayout.Foldout(ShowCutout, "(Cutout)", true, EditorStyles.foldout); + + if (ShowCutout) + { + + GUILayout.Space(10); + + materialEditor.ShaderProperty(_Cutout, new GUIContent(_Cutout.displayName, TOTIPS[17])); + materialEditor.ShaderProperty(_AlphaBaseCutout, new GUIContent(_AlphaBaseCutout.displayName, TOTIPS[18])); + materialEditor.ShaderProperty(_N_F_SCO, new GUIContent(_N_F_SCO.displayName, TOTIPS[154])); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + materialEditor.ShaderProperty(_AlpToCov, new GUIContent(_AlpToCov.displayName, TOTIPS[164])); + + EditorGUI.BeginDisabledGroup(_AlpToCov.floatValue == 0.0f); + materialEditor.ShaderProperty(_AAS, new GUIContent(_AAS.displayName, TOTIPS[174])); + EditorGUI.EndDisabledGroup(); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + materialEditor.ShaderProperty(_UseSecondaryCutout, new GUIContent(_UseSecondaryCutout.displayName, TOTIPS[19])); + materialEditor.ShaderProperty(_SecondaryCutout, new GUIContent(_SecondaryCutout.displayName, TOTIPS[20])); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + materialEditor.ShaderProperty(_N_F_COEDGL, _N_F_COEDGL.displayName); + EditorGUI.BeginDisabledGroup(_N_F_COEDGL.floatValue == 0.0f); + materialEditor.ShaderProperty(_Glow_Color, new GUIContent(_Glow_Color.displayName, TOTIPS[148])); + materialEditor.ShaderProperty(_Glow_Edge_Width, new GUIContent(_Glow_Edge_Width.displayName, TOTIPS[149])); + EditorGUI.EndDisabledGroup(); + + GUILayout.Space(10); + + } + + EditorGUILayout.EndVertical(); + + EditorGUI.EndDisabledGroup(); + } + } + + #endregion + + //Transperancy + + #region Transperancy + + if (_TRANSMODE.floatValue == 1) + { + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + EditorGUI.BeginDisabledGroup(_N_F_CO.floatValue == 1); + + Rect r_transparency = EditorGUILayout.BeginVertical("Button"); + ShowTransparency = EditorGUILayout.Foldout(ShowTransparency, "(Transparency)", true, EditorStyles.foldout); + + if (ShowTransparency) + { + + GUILayout.Space(10); + materialEditor.ShaderProperty(_SimTrans, new GUIContent(_SimTrans.displayName, TOTIPS[150])); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + materialEditor.ShaderProperty(_Opacity, new GUIContent(_Opacity.displayName, TOTIPS[21])); + + EditorGUI.BeginDisabledGroup(_SimTrans.floatValue == 1); + materialEditor.ShaderProperty(_TransparentThreshold, new GUIContent(_TransparentThreshold.displayName, TOTIPS[22])); + EditorGUI.EndDisabledGroup(); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + materialEditor.ShaderProperty(_BleModSour, new GUIContent(_BleModSour.displayName, TOTIPS[9])); + materialEditor.ShaderProperty(_BleModDest, new GUIContent(_BleModDest.displayName, TOTIPS[10])); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + materialEditor.ShaderProperty(_TransAffSha, new GUIContent(_TransAffSha.displayName, TOTIPS[74])); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + EditorGUI.BeginDisabledGroup(_SimTrans.floatValue == 1); + materialEditor.ShaderProperty(_MaskTransparency, new GUIContent(_MaskTransparency.displayName, TOTIPS[23])); + EditorGUI.EndDisabledGroup(); + + GUILayout.Space(10); + + } + + EditorGUI.EndDisabledGroup(); + + EditorGUILayout.EndVertical(); + } + + #endregion + + //Normal Map + + #region Normal Map + + if (_N_F_NM.floatValue == 1) + { + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + Rect r_normalmap = EditorGUILayout.BeginVertical("Button"); + ShowNormalMap = EditorGUILayout.Foldout(ShowNormalMap, "(Normal Map)", true, EditorStyles.foldout); + + if (ShowNormalMap) + { + GUILayout.Space(10); + + materialEditor.ShaderProperty(_NormalMap, new GUIContent(_NormalMap.displayName, TOTIPS[24])); + + EditorGUI.BeginDisabledGroup(_NormalMap.textureValue == null); + materialEditor.ShaderProperty(_NormalMapIntensity, new GUIContent(_NormalMapIntensity.displayName, TOTIPS[25])); + EditorGUI.EndDisabledGroup(); + + GUILayout.Space(10); + + } + + EditorGUILayout.EndVertical(); + + } + #endregion + + //Color Adjustment + + #region Color Adjustment + + if (_N_F_CA.floatValue == 1) + { + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + Rect r_cadjustment = EditorGUILayout.BeginVertical("Button"); + ShowColorAdjustment = EditorGUILayout.Foldout(ShowColorAdjustment, "Color Adjustment", true, EditorStyles.foldout); + + if (ShowColorAdjustment) + { + + GUILayout.Space(10); + + materialEditor.ShaderProperty(_Saturation, new GUIContent(_Saturation.displayName, TOTIPS[26])); + + GUILayout.Space(10); + + } + + EditorGUILayout.EndVertical(); ; + + } + + #endregion + + //Outline + + #region Outline + + if (remoout == true) + { + + if (_N_F_O.floatValue == 1) + { + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + Rect r_outline = EditorGUILayout.BeginVertical("Button"); + ShowOutline = EditorGUILayout.Foldout(ShowOutline, "(Outline - " + OLType + ")", true, EditorStyles.foldout); + + + if (ShowOutline) + { + + GUILayout.Space(10); + + EditorGUI.BeginDisabledGroup(_TRANSMODE.floatValue == 1 && _N_F_CO.floatValue == 0 && UseSSOL == false); + materialEditor.ShaderProperty(_OutlineWidth, new GUIContent(_OutlineWidth.displayName, TOTIPS[8])); + EditorGUI.EndDisabledGroup(); + + if (UseSSOL == true) + { + + materialEditor.ShaderProperty(_OutlineWidthControl, new GUIContent(_OutlineWidthControl.displayName, TOTIPS[28])); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + materialEditor.ShaderProperty(_OutlineExtrudeMethod, new GUIContent(_OutlineExtrudeMethod.displayName, TOTIPS[29])); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + materialEditor.ShaderProperty(_OutlineOffset, new GUIContent(_OutlineOffset.displayName, TOTIPS[30])); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + materialEditor.ShaderProperty(_OutResi, new GUIContent(_OutResi.displayName, TOTIPS[177])); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + materialEditor.ShaderProperty(_OutlineZPostionInCamera, new GUIContent(_OutlineZPostionInCamera.displayName, TOTIPS[123])); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + materialEditor.ShaderProperty(_DoubleSidedOutline, new GUIContent(_DoubleSidedOutline.displayName, TOTIPS[31])); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + materialEditor.ShaderProperty(_OutlineColor, new GUIContent(_OutlineColor.displayName, TOTIPS[32])); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + materialEditor.ShaderProperty(_MixMainTexToOutline, new GUIContent(_MixMainTexToOutline.displayName, TOTIPS[33])); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + materialEditor.ShaderProperty(_NoisyOutlineIntensity, new GUIContent(_NoisyOutlineIntensity.displayName, TOTIPS[34])); + materialEditor.ShaderProperty(_DynamicNoisyOutline, new GUIContent(_DynamicNoisyOutline.displayName, TOTIPS[35])); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + materialEditor.ShaderProperty(_LightAffectOutlineColor, new GUIContent(_LightAffectOutlineColor.displayName, TOTIPS[36])); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + materialEditor.ShaderProperty(_OutlineWidthAffectedByViewDistance, new GUIContent(_OutlineWidthAffectedByViewDistance.displayName, TOTIPS[37])); + EditorGUI.BeginDisabledGroup(_OutlineWidthAffectedByViewDistance.floatValue == 0); + materialEditor.ShaderProperty(_FarDistanceMaxWidth, new GUIContent(_FarDistanceMaxWidth.displayName, TOTIPS[38])); + EditorGUI.EndDisabledGroup(); + + GUILayout.Space(10); + + materialEditor.ShaderProperty(_VertexColorBlueAffectOutlineWitdh, new GUIContent(_VertexColorBlueAffectOutlineWitdh.displayName, TOTIPS[39])); + + } + else + { + EditorGUI.BeginDisabledGroup(_TRANSMODE.floatValue == 1 && _N_F_CO.floatValue == 0); + materialEditor.ShaderProperty(_OutlineColor, new GUIContent(_OutlineColor.displayName, TOTIPS[28])); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + materialEditor.ShaderProperty(_N_F_MSSOLTFO, new GUIContent(_N_F_MSSOLTFO.displayName, TOTIPS[140])); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + materialEditor.ShaderProperty(_DepthThreshold, new GUIContent(_DepthThreshold.displayName, TOTIPS[122])); + EditorGUI.EndDisabledGroup(); + + } + + if (add_st == true) + { + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + materialEditor.ShaderProperty(_OutStenPass, new GUIContent(_OutStenPass.displayName, TOTIPS[170])); + } + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + materialEditor.ShaderProperty(_OutZWrite, new GUIContent(_OutZWrite.displayName, TOTIPS[184])); + materialEditor.ShaderProperty(_OutZTest, new GUIContent(_OutZTest.displayName, TOTIPS[183])); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + if (GUILayout.Button(new GUIContent(UseSSOLStat, TOTIPS[142]), "Button")) + { + USSOL_OR_TOL(); + } + + GUILayout.Space(10); + + } + + EditorGUILayout.EndVertical(); + + } + + } + + #endregion + + //Self Lit + + #region SelfLit + + if (_N_F_SL.floatValue == 1) + { + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + Rect r_selflit = EditorGUILayout.BeginVertical("Button"); + ShowSelfLit = EditorGUILayout.Foldout(ShowSelfLit, "(Self Lit)", true, EditorStyles.foldout); + + if (ShowSelfLit) + { + + GUILayout.Space(10); + + materialEditor.ShaderProperty(_SelfLitIntensity, new GUIContent(_SelfLitIntensity.displayName, TOTIPS[40])); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + materialEditor.ShaderProperty(_SelfLitColor, new GUIContent(_SelfLitColor.displayName, TOTIPS[41])); + materialEditor.ShaderProperty(_SelfLitPower, new GUIContent(_SelfLitPower.displayName, TOTIPS[42])); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + materialEditor.ShaderProperty(_TEXMCOLINT, new GUIContent(_TEXMCOLINT.displayName, TOTIPS[43])); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + EditorGUI.BeginDisabledGroup(_N_F_SLMM.floatValue == 1); + materialEditor.ShaderProperty(_SelfLitHighContrast, new GUIContent(_SelfLitHighContrast.displayName, TOTIPS[44])); + EditorGUI.EndDisabledGroup(); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + materialEditor.ShaderProperty(_N_F_SLMM, new GUIContent(_N_F_SLMM.displayName, TOTIPS[175])); + + GUILayout.Space(1); + + if (_N_F_SLMM.floatValue == 1) + { + materialEditor.ShaderProperty(_MaskSelfLit, new GUIContent("Self Lit Map", TOTIPS[176])); + } + else + { + materialEditor.ShaderProperty(_MaskSelfLit, new GUIContent(_MaskSelfLit.displayName, TOTIPS[45])); + } + + GUILayout.Space(10); + + } + + EditorGUILayout.EndVertical(); + + } + #endregion + + //Gloss + + #region Gloss + + if (_N_F_OFLMB.floatValue == 0) + { + + if (_N_F_GLO.floatValue == 1) + { + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + Rect r_gloss = EditorGUILayout.BeginVertical("Button"); + ShowGloss = EditorGUILayout.Foldout(ShowGloss, "(Gloss)", true, EditorStyles.foldout); + + if (ShowGloss) + { + + GUILayout.Space(10); + + materialEditor.ShaderProperty(_GlossIntensity, new GUIContent(_GlossIntensity.displayName, TOTIPS[46])); + + EditorGUI.BeginDisabledGroup(_N_F_GLOT.floatValue == 1); + materialEditor.ShaderProperty(_Glossiness, new GUIContent(_Glossiness.displayName, TOTIPS[47])); + EditorGUI.EndDisabledGroup(); + + materialEditor.ShaderProperty(_GlossSoftness, new GUIContent(_GlossSoftness.displayName, TOTIPS[48])); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + materialEditor.ShaderProperty(_GlossColor, new GUIContent(_GlossColor.displayName, TOTIPS[49])); + materialEditor.ShaderProperty(_GlossColorPower, new GUIContent(_GlossColorPower.displayName, TOTIPS[50])); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); ; + + materialEditor.ShaderProperty(_MaskGloss, new GUIContent(_MaskGloss.displayName, TOTIPS[51])); + + GUILayout.Space(10); + + //Gloss Texture + + #region Gloss Texture + + if (_N_F_GLOT.floatValue == 1) + { + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + Rect r_glosstexture = EditorGUILayout.BeginVertical("Button"); + GUILayout.Label("Gloss Texture", EditorStyles.boldLabel); + EditorGUILayout.EndVertical(); + + if (_N_F_GLOT.floatValue == 1) + { + + GUILayout.Space(10); + + materialEditor.ShaderProperty(_GlossTexture, new GUIContent(_GlossTexture.displayName, TOTIPS[52])); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + materialEditor.ShaderProperty(_N_F_ANIS, new GUIContent(_N_F_ANIS.displayName, TOTIPS[165])); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + + if (_N_F_ANIS.floatValue == 1) + { + + materialEditor.ShaderProperty(_NoisTexInten, new GUIContent(_NoisTexInten.displayName, TOTIPS[166])); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + materialEditor.ShaderProperty(_StraWidt, new GUIContent(_StraWidt.displayName, TOTIPS[167])); + materialEditor.ShaderProperty(_NoiTexAffStraWidt, new GUIContent(_NoiTexAffStraWidt.displayName, TOTIPS[169])); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + materialEditor.ShaderProperty(_ShifAnis, new GUIContent(_ShifAnis.displayName, TOTIPS[168])); + materialEditor.ShaderProperty(_GlossTextureFollowLight, new GUIContent(_GlossTextureFollowLight.displayName, TOTIPS[57])); + + } + else if (_N_F_ANIS.floatValue == 0) + { + + EditorGUI.BeginDisabledGroup(_GlossTexture.textureValue == null); + materialEditor.ShaderProperty(_GlossTextureSoftness, new GUIContent(_GlossTextureSoftness.displayName, TOTIPS[53])); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + materialEditor.ShaderProperty(_PSGLOTEX, new GUIContent(_PSGLOTEX.displayName, TOTIPS[54])); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + EditorGUI.BeginDisabledGroup(_PSGLOTEX.floatValue == 1); + materialEditor.ShaderProperty(_GlossTextureRotate, new GUIContent(_GlossTextureRotate.displayName, TOTIPS[55])); + materialEditor.ShaderProperty(_GlossTextureFollowObjectRotation, new GUIContent(_GlossTextureFollowObjectRotation.displayName, TOTIPS[56])); + materialEditor.ShaderProperty(_GlossTextureFollowLight, new GUIContent(_GlossTextureFollowLight.displayName, TOTIPS[57])); + EditorGUI.EndDisabledGroup(); + + EditorGUI.EndDisabledGroup(); + } + + } + + GUILayout.Space(10); + + } + #endregion + + } + + EditorGUILayout.EndVertical(); + + } + + } + + #endregion + + //Shadow + + #region Shadow + + if (_N_F_OFLMB.floatValue == 0) + { + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + Rect r_shadow = EditorGUILayout.BeginVertical("Button"); + ShowShadow = EditorGUILayout.Foldout(ShowShadow, "(Shadow)", true, EditorStyles.foldout); + + if (ShowShadow) + { + + GUILayout.Space(10); + + materialEditor.ShaderProperty(_OverallShadowColor, new GUIContent(_OverallShadowColor.displayName, TOTIPS[58])); + materialEditor.ShaderProperty(_OverallShadowColorPower, new GUIContent(_OverallShadowColorPower.displayName, TOTIPS[59])); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + materialEditor.ShaderProperty(_SelfShadowShadowTAtViewDirection, new GUIContent(_SelfShadowShadowTAtViewDirection.displayName, TOTIPS[60])); + materialEditor.ShaderProperty(_LigIgnoYNorDir, new GUIContent(_LigIgnoYNorDir.displayName, TOTIPS[144])); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + materialEditor.ShaderProperty(_ReduSha, new GUIContent(_ReduSha.displayName, TOTIPS[63])); + + if (_N_F_HDLS.floatValue == 0 || _N_F_HPSS.floatValue == 0) + { + GUILayout.Space(10); + materialEditor.ShaderProperty(_ShadowHardness, new GUIContent(_ShadowHardness.displayName, TOTIPS[64])); + } + + switch ((int)_N_F_SS.floatValue) + { + case 0: + materialEditor.ShaderProperty(_SelfShadowRealtimeShadowIntensity, new GUIContent("Realtime Shadow Intensity", TOTIPS[124])); + break; + case 1: + materialEditor.ShaderProperty(_SelfShadowRealtimeShadowIntensity, new GUIContent(_SelfShadowRealtimeShadowIntensity.displayName, TOTIPS[126])); + break; + default: + break; + } + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + materialEditor.ShaderProperty(_N_F_ESSAO, new GUIContent(_N_F_ESSAO.displayName, TOTIPS[145])); + EditorGUI.BeginDisabledGroup(_N_F_ESSAO.floatValue == 0.0f); + materialEditor.ShaderProperty(_SSAOColor, new GUIContent(_SSAOColor.displayName, TOTIPS[146])); + EditorGUI.EndDisabledGroup(); + + + //Self Shadow + + #region Self Shadow + + if (_N_F_SS.floatValue == 1) + { + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + Rect r_selfshadow = EditorGUILayout.BeginVertical("Button"); + GUILayout.Label("Self Shadow", EditorStyles.boldLabel); + EditorGUILayout.EndVertical(); + + if (_N_F_SS.floatValue == 1) + { + + GUILayout.Space(10); + + materialEditor.ShaderProperty(_SelfShadowThreshold, new GUIContent(_SelfShadowThreshold.displayName, TOTIPS[65])); + + materialEditor.ShaderProperty(_VertexColorGreenControlSelfShadowThreshold, new GUIContent(_VertexColorGreenControlSelfShadowThreshold.displayName, TOTIPS[66])); + + materialEditor.ShaderProperty(_SelfShadowHardness, new GUIContent(_SelfShadowHardness.displayName, TOTIPS[67])); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + materialEditor.ShaderProperty(_SelfShadowRealTimeShadowColor, new GUIContent(_SelfShadowRealTimeShadowColor.displayName, TOTIPS[68])); + materialEditor.ShaderProperty(_SelfShadowRealTimeShadowColorPower, new GUIContent(_SelfShadowRealTimeShadowColorPower.displayName, TOTIPS[69])); + + GUILayout.Space(10); + materialEditor.ShaderProperty(_SelfShadowAffectedByLightShadowStrength, new GUIContent(_SelfShadowAffectedByLightShadowStrength.displayName, TOTIPS[70])); + + } + + GUILayout.Space(10); + + } + #endregion + + //Smooth Object Normal + + #region Smooth Object Normal + + if (_N_F_SON.floatValue == 1) + { + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + Rect r_smoothobjectnormal = EditorGUILayout.BeginVertical("Button"); + GUILayout.Label("Smooth Object Normal", EditorStyles.boldLabel); + EditorGUILayout.EndVertical(); + + if (_N_F_SON.floatValue == 1) + { + + GUILayout.Space(10); + + materialEditor.ShaderProperty(_SmoothObjectNormal, new GUIContent(_SmoothObjectNormal.displayName, TOTIPS[71])); + + materialEditor.ShaderProperty(_VertexColorRedControlSmoothObjectNormal, new GUIContent(_VertexColorRedControlSmoothObjectNormal.displayName, TOTIPS[72])); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + //materialEditor.ShaderProperty(_XYZPosition, new GUIContent(_XYZPosition.displayName, TOTIPS[73])); + + materialEditor.ShaderProperty(_ShowNormal, new GUIContent(_ShowNormal.displayName, TOTIPS[75])); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + EditorGUI.BeginDisabledGroup(true); + EditorGUILayout.TextArea("Add the 'Smooth Object Normal - Helper' component to your object for this to work.\n\nTo Add:\nClick your object then click 'Add Component'\nthen 'RealToon>Tool>Smooth Object Normal - Helper.", EditorStyles.label, GUILayout.ExpandWidth(true)); + EditorGUI.EndDisabledGroup(); + + } + + GUILayout.Space(10); + + } + + #endregion + + //Shadow Color Texture + + #region Shadow Color Texture + + if (_N_F_SCT.floatValue == 1) + { + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + Rect r_shadowcolortexture = EditorGUILayout.BeginVertical("Button"); + GUILayout.Label("Shadow Color Texture", EditorStyles.boldLabel); + EditorGUILayout.EndVertical(); + + if (_N_F_SCT.floatValue == 1) + { + + GUILayout.Space(10); + + materialEditor.ShaderProperty(_ShadowColorTexture, new GUIContent(_ShadowColorTexture.displayName, TOTIPS[76])); + materialEditor.ShaderProperty(_ShadowColorTexturePower, new GUIContent(_ShadowColorTexturePower.displayName, TOTIPS[77])); + } + + GUILayout.Space(10); + + } + + #endregion + + //ShadowT + + #region ShadowT + + if (_N_F_ST.floatValue == 1) + { + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + Rect r_shadowt = EditorGUILayout.BeginVertical("Button"); + GUILayout.Label("ShadowT", EditorStyles.boldLabel); + EditorGUILayout.EndVertical(); + + if (_N_F_ST.floatValue == 1) + { + GUILayout.Space(10); + + materialEditor.ShaderProperty(_ShadowTIntensity, new GUIContent(_ShadowTIntensity.displayName, TOTIPS[78])); + materialEditor.ShaderProperty(_ShadowT, new GUIContent(_ShadowT.displayName, TOTIPS[79])); + materialEditor.ShaderProperty(_ShadowTLightThreshold, new GUIContent(_ShadowTLightThreshold.displayName, TOTIPS[80])); + + if (_N_F_STSDFM.floatValue == 0) + { + materialEditor.ShaderProperty(_ShadowTShadowThreshold, new GUIContent(_ShadowTShadowThreshold.displayName, TOTIPS[81])); + } + + materialEditor.ShaderProperty(_ShadowTHardness, new GUIContent(_ShadowTHardness.displayName, TOTIPS[82])); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + materialEditor.ShaderProperty(_ShadowTColor, new GUIContent(_ShadowTColor.displayName, TOTIPS[129])); + materialEditor.ShaderProperty(_ShadowTColorPower, new GUIContent(_ShadowTColorPower.displayName, TOTIPS[130])); + + if (_N_F_STSDFM.floatValue == 0) + { + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + materialEditor.ShaderProperty(_STIL, new GUIContent(_STIL.displayName, TOTIPS[131])); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + materialEditor.ShaderProperty(_N_F_STIS, new GUIContent(_N_F_STIS.displayName, TOTIPS[83])); + materialEditor.ShaderProperty(_N_F_STIAL, new GUIContent(_N_F_STIAL.displayName, TOTIPS[84])); + + EditorGUI.BeginDisabledGroup(_N_F_STIAL.floatValue == 0 && _N_F_STIS.floatValue == 0); + materialEditor.ShaderProperty(_ShowInAmbientLightShadowIntensity, new GUIContent(_ShowInAmbientLightShadowIntensity.displayName, TOTIPS[85])); + EditorGUI.EndDisabledGroup(); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + materialEditor.ShaderProperty(_ShowInAmbientLightShadowThreshold, new GUIContent(_ShowInAmbientLightShadowThreshold.displayName, TOTIPS[86])); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + materialEditor.ShaderProperty(_LightFalloffAffectShadowT, new GUIContent(_LightFalloffAffectShadowT.displayName, TOTIPS[87])); + } + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + materialEditor.ShaderProperty(_N_F_STSDFM, new GUIContent(_N_F_STSDFM.displayName, TOTIPS[162])); + + if (_N_F_STSDFM.floatValue == 1) + { + GUILayout.Space(10); + + EditorGUI.BeginDisabledGroup(true); + EditorGUILayout.TextArea("Add the 'ShadowT SDF Mode - Helper' component to your object for this to work.\n\nTo Add:\nClick your object then click 'Add Component'\nthen 'RealToon>Tool>ShadowT SDF Mode - Helper.", EditorStyles.label, GUILayout.ExpandWidth(true)); + EditorGUI.EndDisabledGroup(); + } + + } + + GUILayout.Space(10); + + } + + #endregion + + //Shadow PTexture + + #region PTexture + + if (_N_F_PT.floatValue == 1) + { + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + Rect r_ptexture = EditorGUILayout.BeginVertical("Button"); + GUILayout.Label("PTexture", EditorStyles.boldLabel); + EditorGUILayout.EndVertical(); + + GUILayout.Space(10); + + if (_N_F_PT.floatValue == 1) + { + materialEditor.ShaderProperty(_PTexture, new GUIContent(_PTexture.displayName, TOTIPS[88])); + materialEditor.ShaderProperty(_PTexturePower, new GUIContent(_PTexturePower.displayName, TOTIPS[89])); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + materialEditor.ShaderProperty(_PTCol, new GUIContent(_PTCol.displayName, TOTIPS[122])); + } + + GUILayout.Space(10); + + } + + #endregion + + } + + EditorGUILayout.EndVertical(); + + } + + #endregion + + //Lighting + + #region Lighting + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + Rect r_lighting = EditorGUILayout.BeginVertical("Button"); + ShowLighting = EditorGUILayout.Foldout(ShowLighting, "(Lighting)", true, EditorStyles.foldout); + + if (ShowLighting) + { + + GUILayout.Space(10); + + materialEditor.ShaderProperty(_RELG, new GUIContent(_RELG.displayName, TOTIPS[90])); + EditorGUI.BeginDisabledGroup(_RELG.floatValue == 0); + materialEditor.ShaderProperty(_EnvironmentalLightingIntensity, new GUIContent(_EnvironmentalLightingIntensity.displayName, TOTIPS[91])); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + materialEditor.ShaderProperty(_GIFlatShade, new GUIContent(_GIFlatShade.displayName, TOTIPS[92])); + materialEditor.ShaderProperty(_GIShadeThreshold, new GUIContent(_GIShadeThreshold.displayName, TOTIPS[93])); + EditorGUI.EndDisabledGroup(); + + if (_N_F_OFLMB.floatValue == 0) + { + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + materialEditor.ShaderProperty(_LightAffectShadow, new GUIContent(_LightAffectShadow.displayName, TOTIPS[94])); + EditorGUI.BeginDisabledGroup(_LightAffectShadow.floatValue == 0); + materialEditor.ShaderProperty(_LightIntensity, new GUIContent(_LightIntensity.displayName, TOTIPS[132])); + EditorGUI.EndDisabledGroup(); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + materialEditor.ShaderProperty(_UseTLB, new GUIContent(_UseTLB.displayName, TOTIPS[134])); + materialEditor.ShaderProperty(_N_F_EAL, new GUIContent(_N_F_EAL.displayName, TOTIPS[133])); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + materialEditor.ShaderProperty(_DirectionalLightIntensity, new GUIContent(_DirectionalLightIntensity.displayName, TOTIPS[95])); + EditorGUI.BeginDisabledGroup(_N_F_EAL.floatValue == 0); + materialEditor.ShaderProperty(_PointSpotlightIntensity, new GUIContent(_PointSpotlightIntensity.displayName, TOTIPS[96])); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + materialEditor.ShaderProperty(_LightFalloffSoftness, new GUIContent(_LightFalloffSoftness.displayName, TOTIPS[97])); + EditorGUI.EndDisabledGroup(); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + materialEditor.ShaderProperty(_N_F_LLI, new GUIContent(_N_F_LLI.displayName, TOTIPS[171])); + EditorGUI.BeginDisabledGroup(_N_F_LLI.floatValue == 0); + materialEditor.ShaderProperty(_LLI_Min, new GUIContent(_LLI_Min.displayName, TOTIPS[172])); + materialEditor.ShaderProperty(_LLI_Max, new GUIContent(_LLI_Max.displayName, TOTIPS[173])); + EditorGUI.EndDisabledGroup(); + + GUILayout.Space(10); + + //Custom Light Direction + + #region Custom Light Direction + + if (_N_F_CLD.floatValue == 1) + { + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + EditorGUI.BeginDisabledGroup(_N_F_CLD.floatValue == 0); + + Rect r_customlightdirection = EditorGUILayout.BeginVertical("Button"); + GUILayout.Label("Custom Light Direction", EditorStyles.boldLabel); + EditorGUILayout.EndVertical(); + + if (_N_F_CLD.floatValue == 1) + { + + GUILayout.Space(10); + + materialEditor.ShaderProperty(_CustomLightDirectionIntensity, new GUIContent(_CustomLightDirectionIntensity.displayName, TOTIPS[98])); + materialEditor.ShaderProperty(_CustomLightDirection, new GUIContent(_CustomLightDirection.displayName, TOTIPS[99])); + materialEditor.ShaderProperty(_CustomLightDirectionFollowObjectRotation, new GUIContent(_CustomLightDirectionFollowObjectRotation.displayName, TOTIPS[100])); + + } + + EditorGUI.EndDisabledGroup(); + + GUILayout.Space(10); + + } + + #endregion + + } + + GUILayout.Space(10); + } + + EditorGUILayout.EndVertical(); + + #endregion + + //Reflection + + #region Reflection + + if (_N_F_R.floatValue == 1) + { + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + Rect r_reflection = EditorGUILayout.BeginVertical("Button"); + ShowReflection = EditorGUILayout.Foldout(ShowReflection, "(Reflection)", true, EditorStyles.foldout); + + if (ShowReflection) + { + + GUILayout.Space(10); + + materialEditor.ShaderProperty(_ReflectionIntensity, new GUIContent(_ReflectionIntensity.displayName, TOTIPS[101])); + materialEditor.ShaderProperty(_Smoothness, new GUIContent(_Smoothness.displayName, TOTIPS[102])); + materialEditor.ShaderProperty(_RefMetallic, new GUIContent(_RefMetallic.displayName, TOTIPS[103])); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + materialEditor.ShaderProperty(_MaskReflection, new GUIContent(_MaskReflection.displayName, TOTIPS[104])); + + GUILayout.Space(10); + + //FReflection + + #region FReflection + + if (_N_F_FR.floatValue == 1) + { + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + EditorGUI.BeginDisabledGroup(_N_F_FR.floatValue == 0); + + Rect r_freflection = EditorGUILayout.BeginVertical("Button"); + GUILayout.Label("FReflection", EditorStyles.boldLabel); + EditorGUILayout.EndVertical(); + + materialEditor.ShaderProperty(_FReflection, new GUIContent(_FReflection.displayName, TOTIPS[105])); + + EditorGUI.EndDisabledGroup(); + + GUILayout.Space(10); + } + + } + + #endregion + + EditorGUILayout.EndVertical(); + } + + #endregion + + // Rim Light + + #region Rim Light + + if (_N_F_RL.floatValue == 1) + { + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + Rect r_rimlight = EditorGUILayout.BeginVertical("Button"); + ShowRimLight = EditorGUILayout.Foldout(ShowRimLight, "(Rim Light)", true, EditorStyles.foldout); + + if (ShowRimLight) + { + + GUILayout.Space(10); + + materialEditor.ShaderProperty(_RimLigInt, new GUIContent(_RimLigInt.displayName, TOTIPS[125])); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + materialEditor.ShaderProperty(_RimLightUnfill, new GUIContent(_RimLightUnfill.displayName, TOTIPS[106])); + materialEditor.ShaderProperty(_RimLightSoftness, new GUIContent(_RimLightSoftness.displayName, TOTIPS[107])); + materialEditor.ShaderProperty(_RimLigPosi, new GUIContent(_RimLigPosi.displayName, TOTIPS[180])); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + EditorGUI.BeginDisabledGroup(_RimLightInLight.floatValue == 1); + materialEditor.ShaderProperty(_LightAffectRimLightColor, new GUIContent(_LightAffectRimLightColor.displayName, TOTIPS[108])); + EditorGUI.EndDisabledGroup(); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + materialEditor.ShaderProperty(_RimLightColor, new GUIContent(_RimLightColor.displayName, TOTIPS[109])); + materialEditor.ShaderProperty(_RimLightColorPower, new GUIContent(_RimLightColorPower.displayName, TOTIPS[110])); + + EditorGUI.BeginDisabledGroup(_N_F_RLIS.floatValue == 1); + if (_N_F_OFLMB.floatValue == 0) + { + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + materialEditor.ShaderProperty(_RimLightInLight, new GUIContent(_RimLightInLight.displayName, TOTIPS[111])); + } + EditorGUI.EndDisabledGroup(); + + materialEditor.ShaderProperty(_N_F_RLIS, new GUIContent(_N_F_RLIS.displayName, TOTIPS[179])); + if (_N_F_RLIS.floatValue == 1.0) + { + targetMat.SetFloat("_RimLightInLight", 0.0f); + } + + GUILayout.Space(10); + + } + + EditorGUILayout.EndVertical(); + + } + + #endregion + + //Near Fade Dithering + + #region Near Fade Dithering + + if (_N_F_NFD.floatValue == 1) + { + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + Rect r_nerfaddithe = EditorGUILayout.BeginVertical("Button"); + NearFadeDithering = EditorGUILayout.Foldout(NearFadeDithering, "(Near Fade Dithering)", true, EditorStyles.foldout); + + if (NearFadeDithering) + { + + GUILayout.Space(10); + + materialEditor.ShaderProperty(_MinFadDistance, new GUIContent(_MinFadDistance.displayName, TOTIPS[152])); + materialEditor.ShaderProperty(_MaxFadDistance, new GUIContent(_MaxFadDistance.displayName, TOTIPS[153])); + + GUILayout.Space(10); + + } + + EditorGUILayout.EndVertical(); + + } + + #endregion + + //Triplanar + + #region Triplanar + + if (_N_F_TP.floatValue == 1) + { + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + Rect r_tripla = EditorGUILayout.BeginVertical("Button"); + Triplanar = EditorGUILayout.Foldout(Triplanar, "(Triplanar)", true, EditorStyles.foldout); + + if (Triplanar) + { + + GUILayout.Space(10); + + materialEditor.ShaderProperty(_TriPlaTile, new GUIContent(_TriPlaTile.displayName, TOTIPS[155])); + materialEditor.ShaderProperty(_TriPlaBlend, new GUIContent(_TriPlaBlend.displayName, TOTIPS[156])); + + GUILayout.Space(10); + + } + + EditorGUILayout.EndVertical(); + + } + + #endregion + + //Perspective Adjustment + + #region Perspective Adjustment + + if (_N_F_PA.floatValue == 1) + { + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + Rect r_perspecadju = EditorGUILayout.BeginVertical("Button"); + ShowPerspecAdju = EditorGUILayout.Foldout(ShowPerspecAdju, "(Perspective Adjustment)", true, EditorStyles.foldout); + + if (ShowPerspecAdju) + { + + GUILayout.Space(10); + + materialEditor.ShaderProperty(_PresAdju, new GUIContent(_PresAdju.displayName, TOTIPS[157])); + materialEditor.ShaderProperty(_ClipAdju, new GUIContent(_ClipAdju.displayName, TOTIPS[158])); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + materialEditor.ShaderProperty(_PASize, new GUIContent(_PASize.displayName, TOTIPS[159])); + materialEditor.ShaderProperty(_PASmooTrans, new GUIContent(_PASmooTrans.displayName, TOTIPS[160])); + materialEditor.ShaderProperty(_PADist, new GUIContent(_PADist.displayName, TOTIPS[161])); + + GUILayout.Space(10); + + } + + EditorGUILayout.EndVertical(); + + } + + #endregion + + //Smear Effect + + #region Smear Effect + + if (_N_F_SE.floatValue == 1) + { + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + Rect r_perspecadju = EditorGUILayout.BeginVertical("Button"); + ShowSmeEff = EditorGUILayout.Foldout(ShowSmeEff, "(Smear Effect)", true, EditorStyles.foldout); + + if (ShowSmeEff) + { + + EditorGUI.BeginDisabledGroup(true); + EditorGUILayout.TextArea("Add the 'Smear Effect [Helper]' component to your object for this to work.\nAdjustable options are on the 'Smear Effect [Helper]' component.\n\nTo Add:\nClick your object then click 'Add Component'\nthen 'RealToon>Tool>Smear Effect [Helper].", EditorStyles.label, GUILayout.ExpandWidth(true)); + EditorGUI.EndDisabledGroup(); + + GUILayout.Space(10); + + } + + EditorGUILayout.EndVertical(); + + } + + #endregion + + //Tessellation + + #region Tessellation + + if (tess_supp == true) + { + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + Rect r_tessellation = EditorGUILayout.BeginVertical("Button"); + ShowTessellation = EditorGUILayout.Foldout(ShowTessellation, "(Tessellation)", true, EditorStyles.foldout); + + if (ShowTessellation) + { + + GUILayout.Space(10); + + materialEditor.ShaderProperty(_TessellationSmoothness, new GUIContent(_TessellationSmoothness.displayName, TOTIPS[187])); + + GUILayout.Space(10); + + materialEditor.ShaderProperty(_TessellationTransition, new GUIContent(_TessellationTransition.displayName, TOTIPS[188])); + materialEditor.ShaderProperty(_TessellationNear, new GUIContent(_TessellationNear.displayName, TOTIPS[189])); + materialEditor.ShaderProperty(_TessellationFar, new GUIContent(_TessellationFar.displayName, TOTIPS[190])); + + GUILayout.Space(10); + + EditorGUI.BeginDisabledGroup(_N_F_NM.floatValue == 0); + materialEditor.ShaderProperty(_NorMapAsDis, new GUIContent(_NorMapAsDis.displayName, TOTIPS[191])); + EditorGUI.EndDisabledGroup(); + + GUILayout.Space(10); + } + + EditorGUILayout.EndVertical(); + + } + + #endregion + + //See Through + + #region See Through + + if (add_st == false) + { + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + Rect r_seethrough = EditorGUILayout.BeginVertical("Button"); + ShowSeeThrough = EditorGUILayout.Foldout(ShowSeeThrough, "(See Through)", true, EditorStyles.foldout); + + if (ShowSeeThrough) + { + + GUILayout.Space(10); + + materialEditor.ShaderProperty(_RefVal, new GUIContent(_RefVal.displayName, TOTIPS[112])); + materialEditor.ShaderProperty(_Oper, new GUIContent(_Oper.displayName, TOTIPS[113])); + materialEditor.ShaderProperty(_Compa, new GUIContent(_Compa.displayName, TOTIPS[114])); + + GUILayout.Space(10); + + } + + EditorGUILayout.EndVertical(); + + GUILayout.Space(20); + } + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + #endregion + + GUILayout.Space(20); + + //Disable/Enable Features + + #region Disable/Enable Features + + Rect r_disableenablefeature = EditorGUILayout.BeginVertical("Button"); + ShowDisableEnable = EditorGUILayout.Foldout(ShowDisableEnable, "(Disable/Enable Features)", true, EditorStyles.foldout); + + if (ShowDisableEnable) + { + GUILayout.Space(10); + + Rect r_mc = EditorGUILayout.BeginVertical("HelpBox"); + materialEditor.ShaderProperty(_N_F_MC, new GUIContent(_N_F_MC.displayName, TOTIPSEDF[0])); + EditorGUILayout.EndVertical(); + + Rect r_nm = EditorGUILayout.BeginVertical("HelpBox"); + materialEditor.ShaderProperty(_N_F_NM, new GUIContent(_N_F_NM.displayName, TOTIPSEDF[1])); + EditorGUILayout.EndVertical(); + + if (remoout == true) + { + Rect r_ou = EditorGUILayout.BeginVertical("HelpBox"); + + EditorGUI.BeginChangeCheck(); + + materialEditor.ShaderProperty(_N_F_O, new GUIContent(_N_F_O.displayName, TOTIPSEDF[2])); + + if (EditorGUI.EndChangeCheck()) + { + int f_deo_int = (int)_N_F_O.floatValue; + foreach (Material m in materialEditor.targets) + { + switch (f_deo_int) + { + case 0: + m.SetShaderPassEnabled("SRPDefaultUnlit", false); + break; + case 1: + m.SetShaderPassEnabled("SRPDefaultUnlit", true); + break; + default: + break; + } + } + + } + + EditorGUILayout.EndVertical(); + } + + EditorGUI.BeginDisabledGroup(_TRANSMODE.floatValue == 0); + + Rect r_co = EditorGUILayout.BeginVertical("HelpBox"); + + EditorGUI.BeginChangeCheck(); + + materialEditor.ShaderProperty(_N_F_CO, new GUIContent(_N_F_CO.displayName, TOTIPSEDF[3])); + + if (EditorGUI.EndChangeCheck()) + { + int f_co_int = (int)_N_F_CO.floatValue; + foreach (Material m in materialEditor.targets) + { + switch (f_co_int) + { + case 0: + + m.renderQueue = 3000; + MatRenQue = m.renderQueue; + m.SetOverrideTag("RenderType", "Transparent"); + + m.DisableKeyword("N_F_ATC_ON"); + m.SetFloat("_AlpToCov", 0.0f); + + break; + + case 1: + + m.renderQueue = 2450; + MatRenQue = m.renderQueue; + m.SetOverrideTag("RenderType", "TransparentCutout"); + break; + + default: + break; + } + } + } + + EditorGUILayout.EndVertical(); + + EditorGUI.EndDisabledGroup(); + + Rect r_ca = EditorGUILayout.BeginVertical("HelpBox"); + materialEditor.ShaderProperty(_N_F_CA, new GUIContent(_N_F_CA.displayName, TOTIPSEDF[4])); + EditorGUILayout.EndVertical(); + + + EditorGUI.BeginChangeCheck(); + + Rect r_sl = EditorGUILayout.BeginVertical("HelpBox"); + materialEditor.ShaderProperty(_N_F_SL, new GUIContent(_N_F_SL.displayName, TOTIPSEDF[5])); + EditorGUILayout.EndVertical(); + + if (EditorGUI.EndChangeCheck()) + { + int f_sl_int = (int)_N_F_SL.floatValue; + foreach (Material m in materialEditor.targets) + { + switch (f_sl_int) + { + case 0: + m.globalIlluminationFlags = MaterialGlobalIlluminationFlags.None; + break; + case 1: + m.globalIlluminationFlags = MaterialGlobalIlluminationFlags.BakedEmissive; + break; + default: + break; + } + } + + } + + + if (_N_F_OFLMB.floatValue == 0) + { + Rect r_o = EditorGUILayout.BeginVertical("HelpBox"); + materialEditor.ShaderProperty(_N_F_GLO, new GUIContent(_N_F_GLO.displayName, TOTIPSEDF[6])); + EditorGUILayout.EndVertical(); + + Rect r_glot = EditorGUILayout.BeginVertical("HelpBox"); + materialEditor.ShaderProperty(_N_F_GLOT, new GUIContent(_N_F_GLOT.displayName, TOTIPSEDF[7])); + EditorGUILayout.EndVertical(); + } + + + if (_N_F_OFLMB.floatValue == 0) + { + Rect r_ss = EditorGUILayout.BeginVertical("HelpBox"); + materialEditor.ShaderProperty(_N_F_SS, new GUIContent(_N_F_SS.displayName, TOTIPSEDF[8])); + EditorGUILayout.EndVertical(); + } + + + if (_N_F_OFLMB.floatValue == 0) + { + Rect r_son = EditorGUILayout.BeginVertical("HelpBox"); + materialEditor.ShaderProperty(_N_F_SON, new GUIContent(_N_F_SON.displayName, TOTIPSEDF[9])); + EditorGUILayout.EndVertical(); + } + + + if (_N_F_OFLMB.floatValue == 0) + { + Rect r_sct = EditorGUILayout.BeginVertical("HelpBox"); + materialEditor.ShaderProperty(_N_F_SCT, new GUIContent(_N_F_SCT.displayName, TOTIPSEDF[10])); + EditorGUILayout.EndVertical(); + } + + + if (_N_F_OFLMB.floatValue == 0) + { + Rect r_st = EditorGUILayout.BeginVertical("HelpBox"); + materialEditor.ShaderProperty(_N_F_ST, new GUIContent(_N_F_ST.displayName, TOTIPSEDF[11])); + EditorGUILayout.EndVertical(); + } + + + if (_N_F_OFLMB.floatValue == 0) + { + Rect r_pt = EditorGUILayout.BeginVertical("HelpBox"); + materialEditor.ShaderProperty(_N_F_PT, new GUIContent(_N_F_PT.displayName, TOTIPSEDF[12])); + EditorGUILayout.EndVertical(); + } + + + if (_N_F_OFLMB.floatValue == 0) + { + Rect r_cld = EditorGUILayout.BeginVertical("HelpBox"); + materialEditor.ShaderProperty(_N_F_CLD, new GUIContent(_N_F_CLD.displayName, TOTIPSEDF[13])); + EditorGUILayout.EndVertical(); + } + + + Rect r_r = EditorGUILayout.BeginVertical("HelpBox"); + materialEditor.ShaderProperty(_N_F_R, new GUIContent(_N_F_R.displayName, TOTIPSEDF[14])); + EditorGUILayout.EndVertical(); + + Rect r_fr = EditorGUILayout.BeginVertical("HelpBox"); + materialEditor.ShaderProperty(_N_F_FR, new GUIContent(_N_F_FR.displayName, TOTIPSEDF[15])); + EditorGUILayout.EndVertical(); + + Rect r_rl = EditorGUILayout.BeginVertical("HelpBox"); + materialEditor.ShaderProperty(_N_F_RL, new GUIContent(_N_F_RL.displayName, TOTIPSEDF[16])); + EditorGUILayout.EndVertical(); + + Rect r_nfd = EditorGUILayout.BeginVertical("HelpBox"); + materialEditor.ShaderProperty(_N_F_NFD, new GUIContent(_N_F_NFD.displayName, TOTIPSEDF[17])); + EditorGUILayout.EndVertical(); + + Rect r_tp = EditorGUILayout.BeginVertical("HelpBox"); + materialEditor.ShaderProperty(_N_F_TP, new GUIContent(_N_F_TP.displayName, TOTIPSEDF[18])); + EditorGUILayout.EndVertical(); + + Rect r_pa = EditorGUILayout.BeginVertical("HelpBox"); + materialEditor.ShaderProperty(_N_F_PA, new GUIContent(_N_F_PA.displayName, TOTIPSEDF[19])); + EditorGUILayout.EndVertical(); + + Rect r_se = EditorGUILayout.BeginVertical("HelpBox"); + materialEditor.ShaderProperty(_N_F_SE, new GUIContent(_N_F_SE.displayName, TOTIPSEDF[20])); + EditorGUILayout.EndVertical(); + + GUILayout.Space(10); + } + + EditorGUILayout.EndVertical(); + + #endregion + + //Settings + + #region Settings + + GUILayout.Space(5); + + Rect r_showsettings = EditorGUILayout.BeginVertical("Button"); + ShowSettings = EditorGUILayout.Foldout(ShowSettings, "(Settings)", true, EditorStyles.foldout); + + if (ShowSettings) + { + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + if (_N_F_OFLMB.floatValue == 0) + { + materialEditor.ShaderProperty(_N_F_HDLS, new GUIContent(_N_F_HDLS.displayName, TOTIPS[117])); + materialEditor.ShaderProperty(_N_F_HPSS, new GUIContent(_N_F_HPSS.displayName, TOTIPS[118])); + + EditorGUI.BeginChangeCheck(); + + materialEditor.ShaderProperty(_N_F_DCS, new GUIContent(_N_F_DCS.displayName, TOTIPS[119])); + + if (EditorGUI.EndChangeCheck()) + { + int f_hcs_int = (int)_N_F_DCS.floatValue; + foreach (Material m in materialEditor.targets) + { + switch (f_hcs_int) + { + case 0: + m.SetShaderPassEnabled("ShadowCaster", true); + break; + case 1: + m.SetShaderPassEnabled("ShadowCaster", false); + break; + default: + break; + } + } + + } + + materialEditor.ShaderProperty(_N_F_NLASOBF, new GUIContent(_N_F_NLASOBF.displayName, TOTIPS[115])); + + } + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + materialEditor.ShaderProperty(_ZWrite, new GUIContent(_ZWrite.displayName, TOTIPS[120])); + + GUILayout.Space(4); + + materialEditor.ShaderProperty(_ZTest, new GUIContent(_ZTest.displayName, TOTIPS[182])); + + GUILayout.Space(5); + + EditorGUI.BeginChangeCheck(); + materialEditor.RenderQueueField(); + if (EditorGUI.EndChangeCheck()) + { + MatRenQue = targetMat.renderQueue; + targetMat.SetFloat("_RQSO", 0); + } + + EditorGUI.BeginChangeCheck(); + materialEditor.IntShaderProperty(_RQSO, new GUIContent("Render Order", TOTIPS[181])); + if (EditorGUI.EndChangeCheck()) + { + if (targetMat.renderQueue != 0) + { + targetMat.renderQueue = MatRenQue + (int)_RQSO.floatValue; + } + + if ((int)_RQSO.floatValue == 0) + { + targetMat.renderQueue = MatRenQue; + } + } + + GUILayout.Space(4); + + materialEditor.ShaderProperty(_ObjePosiZCS, new GUIContent(_ObjePosiZCS.displayName, TOTIPS[178])); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + materialEditor.EnableInstancingField(); + + EditorGUI.BeginDisabledGroup(tess_supp == true); + materialEditor.ShaderProperty(_N_F_DDMD, new GUIContent(_N_F_DDMD.displayName, TOTIPS[151])); + EditorGUI.EndDisabledGroup(); + + materialEditor.ShaderProperty(_N_F_RDC, new GUIContent(_N_F_RDC.displayName, TOTIPS[147])); + materialEditor.ShaderProperty(_N_F_OFLMB, new GUIContent(_N_F_OFLMB.displayName, TOTIPS[141])); + aruskw = EditorGUILayout.Toggle(new GUIContent("Automatic Remove Unused Shader Keywords (Global)", TOTIPS[121]), aruskw); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + if (GUILayout.Button(new GUIContent(twofourfive_target_string, TOTIPS[116]), "Button")) + { + if (tess_supp == false) + { + TWOFORFIVE(); + } + else + { + TWOFORFIVE(); + TESS_SUPP(); + } + } + + GUILayout.Space(5); + + EditorGUI.BeginDisabledGroup(tess_supp == true); + if (twofourfive_target == true) + { + if (GUILayout.Button(new GUIContent(dots_lbs_cd_string, TOTIPS[143]), "Button")) + { + DOTSLBSCD(); + } + } + EditorGUI.EndDisabledGroup(); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + if (twofourfive_target == true) + { + if (GUILayout.Button(new GUIContent(tess_supp_string, TOTIPS[186]), "Button")) + { + TESS_SUPP(); + } + } + + GUILayout.Space(5); + + if (GUILayout.Button(new GUIContent(add_st_string, TOTIPS[163]), "Button")) + { + ADD_ST(); + } + + GUILayout.Space(10); + + } + + EditorGUILayout.EndVertical(); + + #endregion + + GUILayout.Space(20); + + } + + #region Automatic Remove UorOSKW + if (aruskw == true) + { + foreach (Material m1 in materialEditor.targets) + { + for (int x = 0; x < m1.shaderKeywords.Length; x++) + { + if (m1.shaderKeywords[x] != String.Empty) + { + for (int y = 0; y < Enum.GetValues(typeof(SFKW)).Length; y++) + { + if (m1.shaderKeywords[x] == Enum.GetValues(typeof(SFKW)).GetValue(y).ToString()) + { + del_skw = false; + break; + } + else + { + del_skw = true; + } + } + + if (del_skw == true) + { + m1.DisableKeyword(m1.shaderKeywords[x]); + del_skw = false; + } + + } + else + { + break; + } + } + } + } + #endregion + + //Footbar + #region Footbar + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + Rect r_footbar = EditorGUILayout.BeginHorizontal(); + + if (GUILayout.Button(new GUIContent("[" + remooutstat + " (On Shader)]", TOTIPS[135]), "Toolbar")) + { + REMO_OUTL(); + } + + GUILayout.Space(5); + + if (GUILayout.Button(new GUIContent("[Refresh Settings]", TOTIPS[62]), "Toolbar")) + { + foreach (Material m in materialEditor.targets) + { + CheckingPropKeyWord(m); + } + + Check_RE_OL(); + + Debug.Log("You clicked [Refresh Settings]: RealToon on the material has been refresh and re-apply the settings properly."); + + } + + GUILayout.Space(5); + + if (GUILayout.Button(new GUIContent("[Video Tutorials]", TOTIPS[136]), "Toolbar")) + { + Application.OpenURL("www.youtube.com/playlist?list=PL0M1m9smMVPJ4qEkJnZObqJE5mU9uz6SY"); + } + + GUILayout.Space(5); + + if (GUILayout.Button(new GUIContent("[RealToon (User Guide).pdf]", TOTIPS[137]), "Toolbar")) + { + Application.OpenURL(Application.dataPath + "/RealToon/RealToon (User Guide).pdf"); + } + + GUILayout.Space(5); + + if (GUILayout.Button(new GUIContent("[" + ShowUIString + "(Global)]", TOTIPS[138]), "Toolbar")) + { + if (ShowUI == false) + { + ShowUI = true; + ShowUIString = "Hide UI"; + } + else + { + ShowUI = false; + ShowUIString = "Show UI"; + } + } + + EditorGUILayout.EndHorizontal(); + + #endregion + + #endregion + + } + + // + #region Checking + + public override void AssignNewShaderToMaterial(Material material, Shader oldShader, Shader newShader) + { + base.AssignNewShaderToMaterial(material, oldShader, newShader); + + if (oldShader.name != "Universal Render Pipeline/RealToon/Version 5/Default/Default") + { + + if (oldShader.name == "HDRP/RealToon/Version 5/Default") + { + material.SetFloat("_MaiColPo", material.GetFloat("_MaiColPo") + 0.65f); + } + + } + + CheckingPropKeyWord(material); + } + + #region CheckingPropKeyWord + + void CheckingPropKeyWord(Material material) + { + + if (material.IsKeywordEnabled("N_F_TRANS_ON") || material.GetFloat("_TRANSMODE") == 1.0f) + { + + if (material.IsKeywordEnabled("N_F_CO_ON") || material.GetFloat("_N_F_CO") == 1.0f) + { + + material.renderQueue = 2450; + material.SetOverrideTag("RenderType", "TransparentCutout"); + + } + else if (material.IsKeywordEnabled("N_F_TRANS_ON") || material.GetFloat("_TRANSMODE") == 1.0f) + { + material.renderQueue = 3000; + + material.EnableKeyword("N_F_TRANS_ON"); + material.SetFloat("_TRANSMODE", 1.0f); + material.SetOverrideTag("RenderType", "Transparent"); + } + + shader_type = "Transparency"; + } + else if (!material.IsKeywordEnabled("N_F_TRANS_ON") || material.GetFloat("_TRANSMODE") == 0.0f) + { + material.DisableKeyword("N_F_TRANS_ON"); + material.SetFloat("_TRANSMODE", 0.0f); + + shader_type = "Default"; + } + + if ((material.IsKeywordEnabled("N_F_TRANSAFFSHA_ON") || material.GetFloat("_TransAffSha") == 1.0f)) + { + material.EnableKeyword("N_F_TRANSAFFSHA_ON"); + material.SetFloat("_TransAffSha", 1.0f); + } + else if ((!material.IsKeywordEnabled("N_F_TRANSAFFSHA_ON") || material.GetFloat("_TransAffSha") == 0.0f)) + { + material.DisableKeyword("N_F_TRANSAFFSHA_ON"); + material.SetFloat("_TransAffSha", 0.0f); + } + + if ((material.IsKeywordEnabled("N_F_ATC_ON") || material.GetFloat("_AlpToCov") == 1.0f)) + { + material.EnableKeyword("N_F_ATC_ON"); + material.SetFloat("_AlpToCov", 1.0f); + } + else if ((!material.IsKeywordEnabled("N_F_ATC_ON") || material.GetFloat("_AlpToCov") == 0.0f)) + { + material.DisableKeyword("N_F_ATC_ON"); + material.SetFloat("_AlpToCov", 0.0f); + } + + if ((material.IsKeywordEnabled("N_F_OFLMB_ON") || material.GetFloat("_N_F_OFLMB") == 1.0f)) + { + material.EnableKeyword("N_F_OFLMB_ON"); + material.SetFloat("_N_F_OFLMB", 1.0f); + } + else if ((!material.IsKeywordEnabled("N_F_OFLMB_ON") || material.GetFloat("_N_F_OFLMB") == 0.0f)) + { + material.DisableKeyword("N_F_OFLMB_ON"); + material.SetFloat("_N_F_OFLMB", 0.0f); + } + + if ((material.IsKeywordEnabled("N_F_SIMTRANS_ON") || material.GetFloat("_SimTrans") == 1.0f)) + { + material.EnableKeyword("N_F_SIMTRANS_ON"); + material.SetFloat("_SimTrans", 1.0f); + } + else if ((!material.IsKeywordEnabled("N_F_SIMTRANS_ON") || material.GetFloat("_SimTrans") == 0.0f)) + { + material.DisableKeyword("N_F_SIMTRANS_ON"); + material.SetFloat("_SimTrans", 0.0f); + } + + if ((material.IsKeywordEnabled("N_F_DDMD_ON") || material.GetFloat("_N_F_DDMD") == 1.0f)) + { + material.EnableKeyword("N_F_DDMD_ON"); + material.SetFloat("_N_F_DDMD", 1.0f); + } + else if ((!material.IsKeywordEnabled("N_F_DDMD_ON") || material.GetFloat("_N_F_DDMD") == 0.0f)) + { + material.DisableKeyword("N_F_DDMD_ON"); + material.SetFloat("_N_F_DDMD", 0.0f); + } + + //====================================================================================================== + + if ((material.IsKeywordEnabled("N_F_DNO_ON") || material.GetFloat("_DynamicNoisyOutline") == 1.0f)) + { + material.EnableKeyword("N_F_DNO_ON"); + material.SetFloat("_DynamicNoisyOutline", 1.0f); + } + else if ((!material.IsKeywordEnabled("N_F_DNO_ON") || material.GetFloat("_DynamicNoisyOutline") == 0.0f)) + { + material.DisableKeyword("N_F_DNO_ON"); + material.SetFloat("_DynamicNoisyOutline", 0.0f); + } + + //====================================================================================================== + + if ((material.IsKeywordEnabled("N_F_COEDGL_ON") || material.GetFloat("_N_F_COEDGL") == 1.0f)) + { + material.EnableKeyword("N_F_COEDGL_ON"); + material.SetFloat("_N_F_COEDGL", 1.0f); + } + else if ((!material.IsKeywordEnabled("N_F_COEDGL_ON") || material.GetFloat("_N_F_COEDGL") == 0.0f)) + { + material.DisableKeyword("N_F_COEDGL_ON"); + material.SetFloat("_N_F_COEDGL", 0.0f); + } + + if ((material.IsKeywordEnabled("N_F_MC_ON") || material.GetFloat("_N_F_MC") == 1.0f)) + { + material.EnableKeyword("N_F_MC_ON"); + material.SetFloat("_N_F_MC", 1.0f); + } + else if ((!material.IsKeywordEnabled("N_F_MC_ON") || material.GetFloat("_N_F_MC") == 0.0f)) + { + material.DisableKeyword("N_F_MC_ON"); + material.SetFloat("_N_F_MC", 0.0f); + } + + if ((material.IsKeywordEnabled("N_F_NM_ON") || material.GetFloat("_N_F_NM") == 1.0f)) + { + material.EnableKeyword("N_F_NM_ON"); + material.SetFloat("_N_F_NM", 1.0f); + } + else if ((!material.IsKeywordEnabled("N_F_NM_ON") || material.GetFloat("_N_F_NM") == 0.0f)) + { + material.DisableKeyword("N_F_NM_ON"); + material.SetFloat("_N_F_NM", 0.0f); + } + + if ((material.IsKeywordEnabled("N_F_CO_ON") || material.GetFloat("_N_F_CO") == 1.0f)) + { + material.EnableKeyword("N_F_CO_ON"); + material.SetFloat("_N_F_CO", 1.0f); + } + else if ((!material.IsKeywordEnabled("N_F_CO_ON") || material.GetFloat("_N_F_CO") == 0.0f)) + { + material.DisableKeyword("N_F_CO_ON"); + material.SetFloat("_N_F_CO", 0.0f); + } + + if ((material.IsKeywordEnabled("N_F_SCO_ON") || material.GetFloat("_N_F_SCO") == 1.0f)) + { + material.EnableKeyword("N_F_SCO_ON"); + material.SetFloat("_N_F_SCO", 1.0f); + } + else if ((!material.IsKeywordEnabled("N_F_SCO_ON") || material.GetFloat("_N_F_SCO") == 0.0f)) + { + material.DisableKeyword("N_F_SCO_ON"); + material.SetFloat("_N_F_SCO", 0.0f); + } + + if ((material.IsKeywordEnabled("N_F_O_ON") || material.GetFloat("_N_F_O") == 1.0f)) + { + material.EnableKeyword("N_F_O_ON"); + material.SetShaderPassEnabled("SRPDefaultUnlit", true); + material.SetFloat("_N_F_O", 1.0f); + } + else if ((!material.IsKeywordEnabled("N_F_O_ON") || material.GetFloat("_N_F_O") == 0.0f)) + { + material.DisableKeyword("N_F_O_ON"); + material.SetShaderPassEnabled("SRPDefaultUnlit", false); + material.SetFloat("_N_F_O", 0.0f); + } + + if ((material.IsKeywordEnabled("N_F_CA_ON") || material.GetFloat("_N_F_CA") == 1.0f)) + { + material.EnableKeyword("N_F_CA_ON"); + material.SetFloat("_N_F_CA", 1.0f); + } + else if ((!material.IsKeywordEnabled("N_F_CA_ON") || material.GetFloat("_N_F_CA") == 0.0f)) + { + material.DisableKeyword("N_F_CA_ON"); + material.SetFloat("_N_F_CA", 0.0f); + } + + if ((material.IsKeywordEnabled("N_F_SL_ON") || material.GetFloat("_N_F_SL") == 1.0f)) + { + material.EnableKeyword("N_F_SL_ON"); + material.SetFloat("_N_F_SL", 1.0f); + material.globalIlluminationFlags = MaterialGlobalIlluminationFlags.BakedEmissive; + } + else if ((!material.IsKeywordEnabled("N_F_SL_ON") || material.GetFloat("_N_F_SL") == 0.0f)) + { + material.DisableKeyword("N_F_SL_ON"); + material.SetFloat("_N_F_SL", 0.0f); + material.globalIlluminationFlags = MaterialGlobalIlluminationFlags.None; + } + + if ((material.IsKeywordEnabled("N_F_SLMM_ON") || material.GetFloat("_N_F_SLMM") == 1.0f)) + { + material.EnableKeyword("N_F_SLMM_ON"); + material.SetFloat("_N_F_SLMM", 1.0f); + } + else if ((!material.IsKeywordEnabled("N_F_SLMM_ON") || material.GetFloat("_N_F_SLMM") == 0.0f)) + { + material.DisableKeyword("N_F_SLMM_ON"); + material.SetFloat("_N_F_SLMM", 0.0f); + } + + if ((material.IsKeywordEnabled("N_F_GLO_ON") || material.GetFloat("_N_F_GLO") == 1.0f)) + { + material.EnableKeyword("N_F_GLO_ON"); + material.SetFloat("_N_F_GLO", 1.0f); + } + else if ((!material.IsKeywordEnabled("N_F_GLO_ON") || material.GetFloat("_N_F_GLO") == 0.0f)) + { + material.DisableKeyword("N_F_GLO_ON"); + material.SetFloat("_N_F_GLO", 0.0f); + } + + if ((material.IsKeywordEnabled("N_F_GLOT_ON") || material.GetFloat("_N_F_GLOT") == 1.0f)) + { + material.EnableKeyword("N_F_GLOT_ON"); + material.SetFloat("_N_F_GLOT", 1.0f); + } + else if ((!material.IsKeywordEnabled("N_F_GLOT_ON") || material.GetFloat("_N_F_GLOT") == 0.0f)) + { + material.DisableKeyword("N_F_GLOT_ON"); + material.SetFloat("_N_F_GLOT", 0.0f); + } + + if ((material.IsKeywordEnabled("N_F_SS_ON") || material.GetFloat("_N_F_SS") == 1.0f)) + { + material.EnableKeyword("N_F_SS_ON"); + material.SetFloat("_N_F_SS", 1.0f); + } + else if ((!material.IsKeywordEnabled("N_F_SS_ON") || material.GetFloat("_N_F_SS") == 0.0f)) + { + material.DisableKeyword("N_F_SS_ON"); + material.SetFloat("_N_F_SS", 0.0f); + } + + if ((material.IsKeywordEnabled("N_F_SON_ON") || material.GetFloat("_N_F_SON") == 1.0f)) + { + material.EnableKeyword("N_F_SON_ON"); + material.SetFloat("_N_F_SON", 1.0f); + } + else if ((!material.IsKeywordEnabled("N_F_SON_ON") || material.GetFloat("_N_F_SON") == 0.0f)) + { + material.DisableKeyword("N_F_SON_ON"); + material.SetFloat("_N_F_SON", 0.0f); + } + + if ((material.IsKeywordEnabled("N_F_SCT_ON") || material.GetFloat("_N_F_SCT") == 1.0f)) + { + material.EnableKeyword("N_F_SCT_ON"); + material.SetFloat("_N_F_SCT", 1.0f); + } + else if ((!material.IsKeywordEnabled("N_F_SCT_ON") || material.GetFloat("_N_F_SCT") == 0.0f)) + { + material.DisableKeyword("N_F_SCT_ON"); + material.SetFloat("_N_F_SCT", 0.0f); + } + + if ((material.IsKeywordEnabled("N_F_ST_ON") || material.GetFloat("_N_F_ST") == 1.0f)) + { + material.EnableKeyword("N_F_ST_ON"); + material.SetFloat("_N_F_ST", 1.0f); + } + else if ((!material.IsKeywordEnabled("N_F_ST_ON") || material.GetFloat("_N_F_ST") == 0.0f)) + { + material.DisableKeyword("N_F_ST_ON"); + material.SetFloat("_N_F_ST", 0.0f); + } + + if ((material.IsKeywordEnabled("N_F_PT_ON") || material.GetFloat("_N_F_PT") == 1.0f)) + { + material.EnableKeyword("N_F_PT_ON"); + material.SetFloat("_N_F_PT", 1.0f); + } + else if ((!material.IsKeywordEnabled("N_F_PT_ON") || material.GetFloat("_N_F_PT") == 0.0f)) + { + material.DisableKeyword("N_F_PT_ON"); + material.SetFloat("_N_F_PT", 0.0f); + } + + if ((material.IsKeywordEnabled("N_F_CLD_ON") || material.GetFloat("_N_F_CLD") == 1.0f)) + { + material.EnableKeyword("N_F_CLD_ON"); + material.SetFloat("_N_F_CLD", 1.0f); + } + else if ((!material.IsKeywordEnabled("N_F_CLD_ON") || material.GetFloat("_N_F_CLD") == 0.0f)) + { + material.DisableKeyword("N_F_CLD_ON"); + material.SetFloat("_N_F_CLD", 0.0f); + } + + if ((material.IsKeywordEnabled("N_F_R_ON") || material.GetFloat("_N_F_R") == 1.0f)) + { + material.EnableKeyword("N_F_R_ON"); + material.SetFloat("_N_F_R", 1.0f); + } + else if ((!material.IsKeywordEnabled("N_F_R_ON") || material.GetFloat("_N_F_R") == 0.0f)) + { + material.DisableKeyword("N_F_R_ON"); + material.SetFloat("_N_F_R", 0.0f); + } + + if ((material.IsKeywordEnabled("N_F_FR_ON") || material.GetFloat("_N_F_FR") == 1.0f)) + { + material.EnableKeyword("N_F_FR_ON"); + material.SetFloat("_N_F_FR", 1.0f); + } + else if ((!material.IsKeywordEnabled("N_F_FR_ON") || material.GetFloat("_N_F_FR") == 0.0f)) + { + material.DisableKeyword("N_F_FR_ON"); + material.SetFloat("_N_F_FR", 0.0f); + } + + if ((material.IsKeywordEnabled("N_F_RL_ON") || material.GetFloat("_N_F_RL") == 1.0f)) + { + material.EnableKeyword("N_F_RL_ON"); + material.SetFloat("_N_F_RL", 1.0f); + } + else if ((!material.IsKeywordEnabled("N_F_RL_ON") || material.GetFloat("_N_F_RL") == 0.0f)) + { + material.DisableKeyword("N_F_RL_ON"); + material.SetFloat("_N_F_RL", 0.0f); + } + + if ((material.IsKeywordEnabled("N_F_NFD_ON") || material.GetFloat("_N_F_NFD") == 1.0f)) + { + material.EnableKeyword("N_F_NFD_ON"); + material.SetFloat("_N_F_NFD", 1.0f); + } + else if ((!material.IsKeywordEnabled("N_F_NFD_ON") || material.GetFloat("_N_F_NFD") == 0.0f)) + { + material.DisableKeyword("N_F_NFD_ON"); + material.SetFloat("_N_F_NFD", 0.0f); + } + + if ((material.IsKeywordEnabled("N_F_TP_ON") || material.GetFloat("_N_F_TP") == 1.0f)) + { + material.EnableKeyword("N_F_TP_ON"); + material.SetFloat("_N_F_TP", 1.0f); + } + else if ((!material.IsKeywordEnabled("N_F_TP_ON") || material.GetFloat("_N_F_TP") == 0.0f)) + { + material.DisableKeyword("N_F_TP_ON"); + material.SetFloat("_N_F_TP", 0.0f); + } + + if ((material.IsKeywordEnabled("N_F_STSDFM_ON") || material.GetFloat("_N_F_STSDFM") == 1.0f)) + { + material.EnableKeyword("N_F_STSDFM_ON"); + material.SetFloat("_N_F_STSDFM", 1.0f); + } + else if ((!material.IsKeywordEnabled("N_F_STSDFM_ON") || material.GetFloat("_N_F_STSDFM") == 0.0f)) + { + material.DisableKeyword("N_F_STSDFM_ON"); + material.SetFloat("_N_F_STSDFM", 0.0f); + } + + //====================================================================================================== + + if ((material.IsKeywordEnabled("N_F_ANIS_ON") || material.GetFloat("_N_F_ANIS") == 1.0f)) + { + material.EnableKeyword("N_F_ANIS_ON"); + material.SetFloat("_N_F_ANIS", 1.0f); + } + else if ((!material.IsKeywordEnabled("N_F_ANIS_ON") || material.GetFloat("_N_F_ANIS") == 0.0f)) + { + material.DisableKeyword("N_F_ANIS_ON"); + material.SetFloat("_N_F_ANIS", 0.0f); + } + + if ((material.IsKeywordEnabled("N_F_ESSAO_ON") || material.GetFloat("_N_F_ESSAO") == 1.0f)) + { + material.EnableKeyword("N_F_ESSAO_ON"); + material.SetFloat("_N_F_ESSAO", 1.0f); + } + else if ((!material.IsKeywordEnabled("N_F_ESSAO_ON") || material.GetFloat("_N_F_ESSAO") == 0.0f)) + { + material.DisableKeyword("N_F_ESSAO_ON"); + material.SetFloat("_N_F_ESSAO", 0.0f); + } + + if ((material.IsKeywordEnabled("N_F_RELGI_ON") || material.GetFloat("_RELG") == 1.0f)) + { + material.EnableKeyword("N_F_RELGI_ON"); + material.SetFloat("_RELG", 1.0f); + } + else if ((!material.IsKeywordEnabled("N_F_RELGI_ON") || material.GetFloat("_RELG") == 0.0f)) + { + material.DisableKeyword("N_F_RELGI_ON"); + material.SetFloat("_RELG", 0.0f); + } + + if ((material.IsKeywordEnabled("N_F_USETLB_ON") || material.GetFloat("_UseTLB") == 1.0f)) + { + material.EnableKeyword("N_F_USETLB_ON"); + material.SetFloat("_UseTLB", 1.0f); + } + else if ((!material.IsKeywordEnabled("N_F_USETLB_ON") || material.GetFloat("_UseTLB") == 0.0f)) + { + material.DisableKeyword("N_F_USETLB_ON"); + material.SetFloat("_UseTLB", 0.0f); + } + + if ((material.IsKeywordEnabled("N_F_EAL_ON") || material.GetFloat("_N_F_EAL") == 1.0f)) + { + material.EnableKeyword("N_F_EAL_ON"); + material.SetFloat("_N_F_EAL", 1.0f); + } + else if ((!material.IsKeywordEnabled("N_F_EAL_ON") || material.GetFloat("_N_F_EAL") == 0.0f)) + { + material.DisableKeyword("N_F_EAL_ON"); + material.SetFloat("_N_F_EAL", 0.0f); + } + + if ((material.IsKeywordEnabled("N_F_LLI_ON") || material.GetFloat("_N_F_LLI") == 1.0f)) + { + material.EnableKeyword("N_F_LLI_ON"); + material.SetFloat("_N_F_LLI", 1.0f); + } + else if ((!material.IsKeywordEnabled("N_F_LLI_ON") || material.GetFloat("_N_F_LLI") == 0.0f)) + { + material.DisableKeyword("N_F_LLI_ON"); + material.SetFloat("_N_F_LLI", 0.0f); + } + + if ((material.IsKeywordEnabled("N_F_HDLS_ON") || material.GetFloat("_N_F_HDLS") == 1.0f)) + { + material.EnableKeyword("N_F_HDLS_ON"); + material.SetFloat("_N_F_HDLS", 1.0f); + } + else if ((!material.IsKeywordEnabled("N_F_HDLS_ON") || material.GetFloat("_N_F_HDLS") == 0.0f)) + { + material.DisableKeyword("N_F_HDLS_ON"); + material.SetFloat("_N_F_HDLS", 0.0f); + } + + if ((material.IsKeywordEnabled("N_F_HPSS_ON") || material.GetFloat("_N_F_HPSS") == 1.0f)) + { + material.EnableKeyword("N_F_HPSS_ON"); + material.SetFloat("_N_F_HPSS", 1.0f); + } + else if ((!material.IsKeywordEnabled("N_F_HPSS_ON") || material.GetFloat("_N_F_HPSS") == 0.0f)) + { + material.DisableKeyword("N_F_HPSS_ON"); + material.SetFloat("_N_F_HPSS", 0.0f); + } + + if ((material.IsKeywordEnabled("N_F_DCS_ON") || material.GetFloat("_N_F_DCS") == 1.0f)) + { + material.EnableKeyword("N_F_DCS_ON"); + material.SetShaderPassEnabled("ShadowCaster", false); + material.SetFloat("_N_F_DCS", 1.0f); + } + else if ((!material.IsKeywordEnabled("N_F_DCS_ON") || material.GetFloat("_N_F_DCS") == 0.0f)) + { + material.DisableKeyword("N_F_DCS_ON"); + material.SetShaderPassEnabled("ShadowCaster", true); + material.SetFloat("_N_F_DCS", 0.0f); + } + + if ((material.IsKeywordEnabled("N_F_RDC_ON") || material.GetFloat("_N_F_RDC") == 1.0f)) + { + material.EnableKeyword("N_F_RDC_ON"); + material.SetFloat("_N_F_RDC", 1.0f); + } + else if ((!material.IsKeywordEnabled("N_F_RDC_ON") || material.GetFloat("_N_F_RDC") == 0.0f)) + { + material.DisableKeyword("N_F_RDC_ON"); + material.SetFloat("_N_F_RDC", 0.0f); + } + + if ((material.IsKeywordEnabled("N_F_NLASOBF_ON") || material.GetFloat("_N_F_NLASOBF") == 1.0f)) + { + material.EnableKeyword("_N_F_NLASOBF"); + material.SetFloat("_N_F_NLASOBF", 1.0f); + } + else if ((!material.IsKeywordEnabled("N_F_NLASOBF_ON") || material.GetFloat("_N_F_NLASOBF") == 0.0f)) + { + material.DisableKeyword("N_F_NLASOBF_ON"); + material.SetFloat("_N_F_NLASOBF", 0.0f); + } + + #endregion + + } + + #endregion + + #region ChanLi + static void ChanLi(string searchTXT, string TXTChange, string fileName) + { + + if (System.IO.File.Exists(fileName)) + { + string[] arrLine = System.IO.File.ReadAllLines(fileName); + + for (int i = 0; i < arrLine.Length; ++i) + { + if (arrLine[i] == searchTXT) + { + arrLine[i] = TXTChange; + System.IO.File.WriteAllLines(fileName, arrLine); + break; + } + } + + } + else + { + Debug.Log("Can't enable do 'Use Screen Space Outline' or 'Use Traditional Outline' because '" + fileName + "' Does not exist or file not found."); + } + + } + #endregion + + #region ReaLi + static bool ReaLi(string searchTXT, string fileName) + { + + if (System.IO.File.Exists(fileName)) + { + string[] arrLine = System.IO.File.ReadAllLines(fileName); + + for (int i = 0; i < arrLine.Length; ++i) + { + if (arrLine[i] == searchTXT) + { + return true; + } + } + + } + else + { + Debug.Log("Can't read a line because '" + fileName + "' Does not exist or file not found."); + } + + return false; + + } + + #endregion + + #region Check_RE_OL + void Check_RE_OL() + { + if (ReaLi("//OL_RE", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader")) + { + remoout = true; + REMO_OUTL(); + } + else + { + remoout = false; + REMO_OUTL(); + } + } + #endregion + + #region REMO_OUTL + void REMO_OUTL() + { + if (remoout == true) + { + ChanLi("Tags{" + (char)34 + "LightMode" + (char)34 + "=" + (char)34 + "SRPDefaultUnlit" + (char)34 + "}", "Tags{" + (char)34 + "LightMode" + (char)34 + "=" + (char)34 + "remove" + (char)34 + "}", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("Cull [_DoubleSidedOutline]//OL_RCUL", "//Cull [_DoubleSidedOutline]//OL_RCUL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + + ChanLi("#ifdef UNITY_COLORSPACE_GAMMA//SSOL", "//#ifdef UNITY_COLORSPACE_GAMMA//SSOL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("_OutlineColor=float4(LinearToGamma22(_OutlineColor.rgb),_OutlineColor.a);//SSOL", "//_OutlineColor=float4(LinearToGamma22(_OutlineColor.rgb),_OutlineColor.a);//SSOL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("#endif//SSOL", "//#endif//SSOL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + + ChanLi("#if N_F_O_ON//SSOL", "//#if N_F_O_ON//SSOL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("float3 SSOLi=(float3)EdgDet(sceneUVs.xy);//SSOL", "//float3 SSOLi=(float3)EdgDet(sceneUVs.xy);//SSOL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("#if N_F_O_MOTTSO_ON//SSOL", "//#if N_F_O_MOTTSO_ON//SSOL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("float3 Init_FO=((RTD_CA*RTD_SON_CHE_1))*lerp((float3)1.0,_OutlineColor.rgb,SSOLi);//SSOL", "//float3 Init_FO=((RTD_CA*RTD_SON_CHE_1))*lerp((float3)1.0,_OutlineColor.rgb,SSOLi);//SSOL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("#else//SSOL", "//#else//SSOL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("float3 Init_FO=lerp((RTD_CA*RTD_SON_CHE_1),_OutlineColor.rgb,SSOLi);//SSOL", "//float3 Init_FO=lerp((RTD_CA*RTD_SON_CHE_1),_OutlineColor.rgb,SSOLi);//SSOL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("#endif//SSOL", "//#endif//SSOL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("#else//SSOL", "//#else//SSOL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + + ChanLi("#endif//SSOL", "//#endif//SSOL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + + ChanLi("//OL_NRE", "//OL_RE", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + + ChanLi("//SSOL_U", "//SSOL_NU", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + + //============================ + //============================ + + ChanLi("static bool remoout = true;", "static bool remoout = false;", "Assets/RealToon/Editor/RealToonShaderGUI_URP_SRP.cs"); + ChanLi("static string remooutstat = " + (char)34 + "Remove Outline" + (char)34 + ";", "static string remooutstat = " + (char)34 + "Add Outline" + (char)34 + ";", "Assets/RealToon/Editor/RealToonShaderGUI_URP_SRP.cs"); + + AssetDatabase.ImportAsset("Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + AssetDatabase.ImportAsset("Assets/RealToon/Editor/RealToonShaderGUI_URP_SRP.cs"); + Debug.Log("Outline feature removed on RealToon URP shader."); + } + else if (remoout == false) + { + ChanLi("Tags{" + (char)34 + "LightMode" + (char)34 + "=" + (char)34 + "remove" + (char)34 + "}", "Tags{" + (char)34 + "LightMode" + (char)34 + "=" + (char)34 + "SRPDefaultUnlit" + (char)34 + "}", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("//Cull [_DoubleSidedOutline]//OL_RCUL", "Cull [_DoubleSidedOutline]//OL_RCUL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + + ChanLi("//OL_RE", "//OL_NRE", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + + Check_SSOL_TOL(); + + //============================ + //============================ + + ChanLi("static bool remoout = false;", "static bool remoout = true;", "Assets/RealToon/Editor/RealToonShaderGUI_URP_SRP.cs"); + ChanLi("static string remooutstat = " + (char)34 + "Add Outline" + (char)34 + ";", "static string remooutstat = " + (char)34 + "Remove Outline" + (char)34 + ";", "Assets/RealToon/Editor/RealToonShaderGUI_URP_SRP.cs"); + + AssetDatabase.ImportAsset("Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + AssetDatabase.ImportAsset("Assets/RealToon/Editor/RealToonShaderGUI_URP_SRP.cs"); + Debug.Log("Outline feature added on RealToon URP shader."); + } + } + #endregion + + #region Check_SSOL_TOL + void Check_SSOL_TOL() + { + if (ReaLi("//SSOL_U", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader")) + { + UseSSOL = true; + USSOL_OR_TOL(); + } + else + { + UseSSOL = false; + USSOL_OR_TOL(); + } + } + #endregion + + #region USSOL_OR_TOL + void USSOL_OR_TOL() + { + if (UseSSOL == true) + { + ChanLi("Tags{" + (char)34 + "LightMode" + (char)34 + "=" + (char)34 + "SRPDefaultUnlit" + (char)34 + "}", "Tags{" + (char)34 + "LightMode" + (char)34 + "=" + (char)34 + "remove" + (char)34 + "}", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("Cull [_DoubleSidedOutline]//OL_RCUL", "//Cull [_DoubleSidedOutline]//OL_RCUL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + + ChanLi("//#ifdef UNITY_COLORSPACE_GAMMA//SSOL", "#ifdef UNITY_COLORSPACE_GAMMA//SSOL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("//_OutlineColor=float4(LinearToGamma22(_OutlineColor.rgb),_OutlineColor.a);//SSOL", "_OutlineColor=float4(LinearToGamma22(_OutlineColor.rgb),_OutlineColor.a);//SSOL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("//#endif//SSOL", "#endif//SSOL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + + ChanLi("//#if N_F_O_ON//SSOL", "#if N_F_O_ON//SSOL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("//float3 SSOLi=(float3)EdgDet(sceneUVs.xy);//SSOL", "float3 SSOLi=(float3)EdgDet(sceneUVs.xy);//SSOL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("//#if N_F_O_MOTTSO_ON//SSOL", "#if N_F_O_MOTTSO_ON//SSOL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("//float3 Init_FO=((RTD_CA*RTD_SON_CHE_1))*lerp((float3)1.0,_OutlineColor.rgb,SSOLi);//SSOL", "float3 Init_FO=((RTD_CA*RTD_SON_CHE_1))*lerp((float3)1.0,_OutlineColor.rgb,SSOLi);//SSOL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("//#else//SSOL", "#else//SSOL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("//float3 Init_FO=lerp((RTD_CA*RTD_SON_CHE_1),_OutlineColor.rgb,SSOLi);//SSOL", "float3 Init_FO=lerp((RTD_CA*RTD_SON_CHE_1),_OutlineColor.rgb,SSOLi);//SSOL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("//#endif//SSOL", "#endif//SSOL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("//#else//SSOL", "#else//SSOL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + + ChanLi("//#endif//SSOL", "#endif//SSOL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + + ChanLi("//SSOL_NU", "//SSOL_U", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + + //============================ + //============================ + + ChanLi("static bool UseSSOL = true;", "static bool UseSSOL = false;", "Assets/RealToon/Editor/RealToonShaderGUI_URP_SRP.cs"); + ChanLi("static string OLType = " + (char)34 + "Traditional" + (char)34 + ";", "static string OLType = " + (char)34 + "Screen Space" + (char)34 + ";", "Assets/RealToon/Editor/RealToonShaderGUI_URP_SRP.cs"); + ChanLi("static string UseSSOLStat = " + (char)34 + "Use Screen Space Outline" + (char)34 + ";", "static string UseSSOLStat = " + (char)34 + "Use Traditional Outline" + (char)34 + ";", "Assets/RealToon/Editor/RealToonShaderGUI_URP_SRP.cs"); + + AssetDatabase.ImportAsset("Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + AssetDatabase.ImportAsset("Assets/RealToon/Editor/RealToonShaderGUI_URP_SRP.cs"); + Debug.Log("Screen Space Outline is now use."); + } + else if (UseSSOL == false) + { + ChanLi("Tags{" + (char)34 + "LightMode" + (char)34 + "=" + (char)34 + "remove" + (char)34 + "}", "Tags{" + (char)34 + "LightMode" + (char)34 + "=" + (char)34 + "SRPDefaultUnlit" + (char)34 + "}", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("//Cull [_DoubleSidedOutline]//OL_RCUL", "Cull [_DoubleSidedOutline]//OL_RCUL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + + ChanLi("#ifdef UNITY_COLORSPACE_GAMMA//SSOL", "//#ifdef UNITY_COLORSPACE_GAMMA//SSOL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("_OutlineColor=float4(LinearToGamma22(_OutlineColor.rgb),_OutlineColor.a);//SSOL", "//_OutlineColor=float4(LinearToGamma22(_OutlineColor.rgb),_OutlineColor.a);//SSOL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("#endif//SSOL", "//#endif//SSOL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + + ChanLi("#if N_F_O_ON//SSOL", "//#if N_F_O_ON//SSOL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("float3 SSOLi=(float3)EdgDet(sceneUVs.xy);//SSOL", "//float3 SSOLi=(float3)EdgDet(sceneUVs.xy);//SSOL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("#if N_F_O_MOTTSO_ON//SSOL", "//#if N_F_O_MOTTSO_ON//SSOL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("float3 Init_FO=((RTD_CA*RTD_SON_CHE_1))*lerp((float3)1.0,_OutlineColor.rgb,SSOLi);//SSOL", "//float3 Init_FO=((RTD_CA*RTD_SON_CHE_1))*lerp((float3)1.0,_OutlineColor.rgb,SSOLi);//SSOL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("#else//SSOL", "//#else//SSOL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("float3 Init_FO=lerp((RTD_CA*RTD_SON_CHE_1),_OutlineColor.rgb,SSOLi);//SSOL", "//float3 Init_FO=lerp((RTD_CA*RTD_SON_CHE_1),_OutlineColor.rgb,SSOLi);//SSOL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("#endif//SSOL", "//#endif//SSOL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("#else//SSOL", "//#else//SSOL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + + ChanLi("#endif//SSOL", "//#endif//SSOL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + + ChanLi("//SSOL_U", "//SSOL_NU", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + + //============================ + //============================ + + ChanLi("static bool UseSSOL = false;", "static bool UseSSOL = true;", "Assets/RealToon/Editor/RealToonShaderGUI_URP_SRP.cs"); + ChanLi("static string OLType = " + (char)34 + "Screen Space" + (char)34 + ";", "static string OLType = " + (char)34 + "Traditional" + (char)34 + ";", "Assets/RealToon/Editor/RealToonShaderGUI_URP_SRP.cs"); + ChanLi("static string UseSSOLStat = " + (char)34 + "Use Traditional Outline" + (char)34 + ";", "static string UseSSOLStat = " + (char)34 + "Use Screen Space Outline" + (char)34 + ";", "Assets/RealToon/Editor/RealToonShaderGUI_URP_SRP.cs"); + + AssetDatabase.ImportAsset("Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + AssetDatabase.ImportAsset("Assets/RealToon/Editor/RealToonShaderGUI_URP_SRP.cs"); + Debug.Log("Traditional Outline is now use."); + } + } + #endregion + + #region TWOFORFIVE + void TWOFORFIVE() + { + if (twofourfive_target == false) + { + ChanLi("static bool twofourfive_target = false;", "static bool twofourfive_target = true;", "Assets/RealToon/Editor/RealToonShaderGUI_URP_SRP.cs"); + ChanLi("static string twofourfive_target_string = " + (char)34 + "Change shader compilation target to 4.5" + (char)34 + ";", "static string twofourfive_target_string = " + (char)34 + "Change shader compilation target to 2.0" + (char)34 + ";", "Assets/RealToon/Editor/RealToonShaderGUI_URP_SRP.cs"); + + ChanLi("#pragma target 2.0 //targetol", "#pragma target 4.5 //targetol", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("#pragma target 2.0 //targetfl", "#pragma target 4.5 //targetfl", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("#pragma target 2.0 //targetsc", "#pragma target 4.5 //targetsc", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("#pragma target 2.0 //targetdo", "#pragma target 4.5 //targetdo", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("#pragma target 2.0 //targetdn", "#pragma target 4.5 //targetdn", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("#pragma target 2.0 //targetm", "#pragma target 4.5 //targetm", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + + AssetDatabase.ImportAsset("Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + AssetDatabase.ImportAsset("Assets/RealToon/Editor/RealToonShaderGUI_URP_SRP.cs"); + Debug.LogWarning("RealToon shader compilation target has been changed to 4.5, added support for DOTS and Tessellation."); + } + else if (twofourfive_target == true) + { + ChanLi("static bool twofourfive_target = true;", "static bool twofourfive_target = false;", "Assets/RealToon/Editor/RealToonShaderGUI_URP_SRP.cs"); + ChanLi("static string twofourfive_target_string = " + (char)34 + "Change shader compilation target to 2.0" + (char)34 + ";", "static string twofourfive_target_string = " + (char)34 + "Change shader compilation target to 4.5" + (char)34 + ";", "Assets/RealToon/Editor/RealToonShaderGUI_URP_SRP.cs"); + + ChanLi("#pragma target 4.5 //targetol", "#pragma target 2.0 //targetol", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("#pragma target 4.5 //targetfl", "#pragma target 2.0 //targetfl", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("#pragma target 4.5 //targetsc", "#pragma target 2.0 //targetsc", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("#pragma target 4.5 //targetdo", "#pragma target 2.0 //targetdo", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("#pragma target 4.5 //targetdn", "#pragma target 2.0 //targetdn", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("#pragma target 4.5 //targetm", "#pragma target 2.0 //targetm", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + + AssetDatabase.ImportAsset("Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + AssetDatabase.ImportAsset("Assets/RealToon/Editor/RealToonShaderGUI_URP_SRP.cs"); + Debug.LogWarning("RealToon shader compilation target has been changed to 2.0."); + } + } + #endregion + + #region DOTSLBSCD + + void DOTSLBSCD() + { + if (dots_lbs_cd == false) + { + + ChanLi("static bool dots_lbs_cd = false;", "static bool dots_lbs_cd = true;", "Assets/RealToon/Editor/RealToonShaderGUI_URP_SRP.cs"); + ChanLi("static string dots_lbs_cd_string = " + (char)34 + "DOTS|HR - Use Compute Deformation" + (char)34 + ";", "static string dots_lbs_cd_string = " + (char)34 + "DOTS|HR - Use Linear Blend Skinning" + (char)34 + ";", "Assets/RealToon/Editor/RealToonShaderGUI_URP_SRP.cs"); + + + ChanLi("float4 weights : BLENDWEIGHTS;//DOTS_LiBleSki_OL", "//float4 weights : BLENDWEIGHTS;//DOTS_LiBleSki_OL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("uint4 indices : BLENDINDICES;//DOTS_LiBleSki_OL", "//uint4 indices : BLENDINDICES;//DOTS_LiBleSki_OL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("//uint vertexID : SV_VertexID;//DOTS_CompDef_OL", "uint vertexID : SV_VertexID;//DOTS_CompDef_OL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("//DOTS_CompDef(input.vertexID, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_CompDef_OL", "DOTS_CompDef(input.vertexID, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_CompDef_OL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("DOTS_LiBleSki(input.indices, input.weights, input.positionOS.xyz, input.normalOS.xyz, input.tangentOS.xyz, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_LiBleSki_OL", "//DOTS_LiBleSki(input.indices, input.weights, input.positionOS.xyz, input.normalOS.xyz, input.tangentOS.xyz, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_LiBleSki_OL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + + + ChanLi("float4 weights : BLENDWEIGHTS;//DOTS_LiBleSki_FL", "//float4 weights : BLENDWEIGHTS;//DOTS_LiBleSki_FL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("uint4 indices : BLENDINDICES;//DOTS_LiBleSki_FL", "//uint4 indices : BLENDINDICES;//DOTS_LiBleSki_FL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("//uint vertexID : SV_VertexID;//DOTS_CompDef_FL", "uint vertexID : SV_VertexID;//DOTS_CompDef_FL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("//DOTS_CompDef(input.vertexID, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_CompDef_FL", "DOTS_CompDef(input.vertexID, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_CompDef_FL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("DOTS_LiBleSki(input.indices, input.weights, input.positionOS.xyz, input.normalOS.xyz, input.tangentOS.xyz, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_LiBleSki_FL", "//DOTS_LiBleSki(input.indices, input.weights, input.positionOS.xyz, input.normalOS.xyz, input.tangentOS.xyz, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_LiBleSki_FL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + + + ChanLi("float4 weights : BLENDWEIGHTS;//DOTS_LiBleSki_GB", "//float4 weights : BLENDWEIGHTS;//DOTS_LiBleSki_GB", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("uint4 indices : BLENDINDICES;//DOTS_LiBleSki_GB", "//uint4 indices : BLENDINDICES;//DOTS_LiBleSki_GB", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("//uint vertexID : SV_VertexID;//DOTS_CompDef_GB", "uint vertexID : SV_VertexID;//DOTS_CompDef_GB", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("//DOTS_CompDef(input.vertexID, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_CompDef_GB", "DOTS_CompDef(input.vertexID, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_CompDef_GB", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("DOTS_LiBleSki(input.indices, input.weights, input.positionOS.xyz, input.normalOS.xyz, input.tangentOS.xyz, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_LiBleSki_GB", "//DOTS_LiBleSki(input.indices, input.weights, input.positionOS.xyz, input.normalOS.xyz, input.tangentOS.xyz, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_LiBleSki_GB", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + + + ChanLi("float4 weights : BLENDWEIGHTS;//DOTS_LiBleSki_SC", "//float4 weights : BLENDWEIGHTS;//DOTS_LiBleSki_SC", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("uint4 indices : BLENDINDICES;//DOTS_LiBleSki_SC", "//uint4 indices : BLENDINDICES;//DOTS_LiBleSki_SC", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("//uint vertexID : SV_VertexID;//DOTS_CompDef_SC", "uint vertexID : SV_VertexID;//DOTS_CompDef_SC", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("//DOTS_CompDef(input.vertexID, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_CompDef_SC", "DOTS_CompDef(input.vertexID, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_CompDef_SC", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("DOTS_LiBleSki(input.indices, input.weights, input.positionOS.xyz, input.normalOS.xyz, input.tangentOS.xyz, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_LiBleSki_SC", "//DOTS_LiBleSki(input.indices, input.weights, input.positionOS.xyz, input.normalOS.xyz, input.tangentOS.xyz, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_LiBleSki_SC", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + + + ChanLi("float4 weights : BLENDWEIGHTS;//DOTS_LiBleSki_DO", "//float4 weights : BLENDWEIGHTS;//DOTS_LiBleSki_DO", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("uint4 indices : BLENDINDICES;//DOTS_LiBleSki_DO", "//uint4 indices : BLENDINDICES;//DOTS_LiBleSki_DO", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("//uint vertexID : SV_VertexID;//DOTS_CompDef_DO", "uint vertexID : SV_VertexID;//DOTS_CompDef_DO", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("//DOTS_CompDef(input.vertexID, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_CompDef_DO", "DOTS_CompDef(input.vertexID, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_CompDef_DO", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("DOTS_LiBleSki(input.indices, input.weights, input.position.xyz, input.normalOS.xyz, input.tangentOS.xyz, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_LiBleSki_DO", "//DOTS_LiBleSki(input.indices, input.weights, input.position.xyz, input.normalOS.xyz, input.tangentOS.xyz, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_LiBleSki_DO", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + + + ChanLi("float4 weights : BLENDWEIGHTS;//DOTS_LiBleSki_DN", "//float4 weights : BLENDWEIGHTS;//DOTS_LiBleSki_DN", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("uint4 indices : BLENDINDICES;//DOTS_LiBleSki_DN", "//uint4 indices : BLENDINDICES;//DOTS_LiBleSki_DN", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("//uint vertexID : SV_VertexID;//DOTS_CompDef_DN", "uint vertexID : SV_VertexID;//DOTS_CompDef_DN", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("//DOTS_CompDef(input.vertexID, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_CompDef_DN", "DOTS_CompDef(input.vertexID, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_CompDef_DN", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("DOTS_LiBleSki(input.indices, input.weights, input.positionOS.xyz, input.normal.xyz, input.tangentOS.xyz, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_LiBleSki_DN", "//DOTS_LiBleSki(input.indices, input.weights, input.positionOS.xyz, input.normal.xyz, input.tangentOS.xyz, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_LiBleSki_DN", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + + + ChanLi("float4 weights : BLENDWEIGHTS;//DOTS_LiBleSki_MV", "//float4 weights : BLENDWEIGHTS;//DOTS_LiBleSki_MV", "Assets/RealToon/RealToon Shaders/RealToon Core/URP/Pass/RT_URP_MoVecPas.hlsl"); + ChanLi("uint4 indices : BLENDINDICES;//DOTS_LiBleSki_MV", "//uint4 indices : BLENDINDICES;//DOTS_LiBleSki_MV", "Assets/RealToon/RealToon Shaders/RealToon Core/URP/Pass/RT_URP_MoVecPas.hlsl"); + ChanLi("//uint vertexID : SV_VertexID;//DOTS_CompDef_MV", "uint vertexID : SV_VertexID;//DOTS_CompDef_MV", "Assets/RealToon/RealToon Shaders/RealToon Core/URP/Pass/RT_URP_MoVecPas.hlsl"); + ChanLi("//DOTS_CompDef(input.vertexID, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_CompDef_MV", "DOTS_CompDef(input.vertexID, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_CompDef_MV", "Assets/RealToon/RealToon Shaders/RealToon Core/URP/Pass/RT_URP_MoVecPas.hlsl"); + ChanLi("DOTS_LiBleSki(input.indices, input.weights, input.position.xyz, input.normalOS.xyz, input.tangentOS.xyz, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_LiBleSki_MV", "//DOTS_LiBleSki(input.indices, input.weights, input.position.xyz, input.normalOS.xyz, input.tangentOS.xyz, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_LiBleSki_MV", "Assets/RealToon/RealToon Shaders/RealToon Core/URP/Pass/RT_URP_MoVecPas.hlsl"); + + + AssetDatabase.ImportAsset("Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + AssetDatabase.ImportAsset("Assets/RealToon/RealToon Shaders/RealToon Core/URP/Pass/RT_URP_MoVecPas.hlsl"); + AssetDatabase.ImportAsset("Assets/RealToon/Editor/RealToonShaderGUI_URP_SRP.cs"); + Debug.LogWarning("DOTS|HR - Compute Deformation is now use, This will enable you to use BlendShapes and other deformation."); + + } + else if (dots_lbs_cd == true) + { + ChanLi("static bool dots_lbs_cd = true;", "static bool dots_lbs_cd = false;", "Assets/RealToon/Editor/RealToonShaderGUI_URP_SRP.cs"); + ChanLi("static string dots_lbs_cd_string = " + (char)34 + "DOTS|HR - Use Linear Blend Skinning" + (char)34 + ";", "static string dots_lbs_cd_string = " + (char)34 + "DOTS|HR - Use Compute Deformation" + (char)34 + ";", "Assets/RealToon/Editor/RealToonShaderGUI_URP_SRP.cs"); + + + ChanLi("//float4 weights : BLENDWEIGHTS;//DOTS_LiBleSki_OL", "float4 weights : BLENDWEIGHTS;//DOTS_LiBleSki_OL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("//uint4 indices : BLENDINDICES;//DOTS_LiBleSki_OL", "uint4 indices : BLENDINDICES;//DOTS_LiBleSki_OL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("uint vertexID : SV_VertexID;//DOTS_CompDef_OL", "//uint vertexID : SV_VertexID;//DOTS_CompDef_OL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("DOTS_CompDef(input.vertexID, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_CompDef_OL", "//DOTS_CompDef(input.vertexID, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_CompDef_OL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("//DOTS_LiBleSki(input.indices, input.weights, input.positionOS.xyz, input.normalOS.xyz, input.tangentOS.xyz, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_LiBleSki_OL", "DOTS_LiBleSki(input.indices, input.weights, input.positionOS.xyz, input.normalOS.xyz, input.tangentOS.xyz, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_LiBleSki_OL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + + + ChanLi("//float4 weights : BLENDWEIGHTS;//DOTS_LiBleSki_FL", "float4 weights : BLENDWEIGHTS;//DOTS_LiBleSki_FL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("//uint4 indices : BLENDINDICES;//DOTS_LiBleSki_FL", "uint4 indices : BLENDINDICES;//DOTS_LiBleSki_FL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("uint vertexID : SV_VertexID;//DOTS_CompDef_FL", "//uint vertexID : SV_VertexID;//DOTS_CompDef_FL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("DOTS_CompDef(input.vertexID, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_CompDef_FL", "//DOTS_CompDef(input.vertexID, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_CompDef_FL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("//DOTS_LiBleSki(input.indices, input.weights, input.positionOS.xyz, input.normalOS.xyz, input.tangentOS.xyz, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_LiBleSki_FL", "DOTS_LiBleSki(input.indices, input.weights, input.positionOS.xyz, input.normalOS.xyz, input.tangentOS.xyz, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_LiBleSki_FL", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + + + ChanLi("//float4 weights : BLENDWEIGHTS;//DOTS_LiBleSki_GB", "float4 weights : BLENDWEIGHTS;//DOTS_LiBleSki_GB", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("//uint4 indices : BLENDINDICES;//DOTS_LiBleSki_GB", "uint4 indices : BLENDINDICES;//DOTS_LiBleSki_GB", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("uint vertexID : SV_VertexID;//DOTS_CompDef_GB", "//uint vertexID : SV_VertexID;//DOTS_CompDef_GB", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("DOTS_CompDef(input.vertexID, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_CompDef_GB", "//DOTS_CompDef(input.vertexID, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_CompDef_GB", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("//DOTS_LiBleSki(input.indices, input.weights, input.positionOS.xyz, input.normalOS.xyz, input.tangentOS.xyz, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_LiBleSki_GB", "DOTS_LiBleSki(input.indices, input.weights, input.positionOS.xyz, input.normalOS.xyz, input.tangentOS.xyz, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_LiBleSki_GB", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + + + ChanLi("//float4 weights : BLENDWEIGHTS;//DOTS_LiBleSki_SC", "float4 weights : BLENDWEIGHTS;//DOTS_LiBleSki_SC", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("//uint4 indices : BLENDINDICES;//DOTS_LiBleSki_SC", "uint4 indices : BLENDINDICES;//DOTS_LiBleSki_SC", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("uint vertexID : SV_VertexID;//DOTS_CompDef_SC", "//uint vertexID : SV_VertexID;//DOTS_CompDef_SC", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("DOTS_CompDef(input.vertexID, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_CompDef_SC", "//DOTS_CompDef(input.vertexID, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_CompDef_SC", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("//DOTS_LiBleSki(input.indices, input.weights, input.positionOS.xyz, input.normalOS.xyz, input.tangentOS.xyz, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_LiBleSki_SC", "DOTS_LiBleSki(input.indices, input.weights, input.positionOS.xyz, input.normalOS.xyz, input.tangentOS.xyz, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_LiBleSki_SC", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + + + ChanLi("//float4 weights : BLENDWEIGHTS;//DOTS_LiBleSki_DO", "float4 weights : BLENDWEIGHTS;//DOTS_LiBleSki_DO", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("//uint4 indices : BLENDINDICES;//DOTS_LiBleSki_DO", "uint4 indices : BLENDINDICES;//DOTS_LiBleSki_DO", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("uint vertexID : SV_VertexID;//DOTS_CompDef_DO", "//uint vertexID : SV_VertexID;//DOTS_CompDef_DO", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("DOTS_CompDef(input.vertexID, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_CompDef_DO", "//DOTS_CompDef(input.vertexID, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_CompDef_DO", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("//DOTS_LiBleSki(input.indices, input.weights, input.position.xyz, input.normalOS.xyz, input.tangentOS.xyz, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_LiBleSki_DO", "DOTS_LiBleSki(input.indices, input.weights, input.position.xyz, input.normalOS.xyz, input.tangentOS.xyz, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_LiBleSki_DO", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + + + ChanLi("//float4 weights : BLENDWEIGHTS;//DOTS_LiBleSki_DN", "float4 weights : BLENDWEIGHTS;//DOTS_LiBleSki_DN", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("//uint4 indices : BLENDINDICES;//DOTS_LiBleSki_DN", "uint4 indices : BLENDINDICES;//DOTS_LiBleSki_DN", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("uint vertexID : SV_VertexID;//DOTS_CompDef_DN", "//uint vertexID : SV_VertexID;//DOTS_CompDef_DN", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("DOTS_CompDef(input.vertexID, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_CompDef_DN", "//DOTS_CompDef(input.vertexID, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_CompDef_DN", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("//DOTS_LiBleSki(input.indices, input.weights, input.positionOS.xyz, input.normal.xyz, input.tangentOS.xyz, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_LiBleSki_DN", "DOTS_LiBleSki(input.indices, input.weights, input.positionOS.xyz, input.normal.xyz, input.tangentOS.xyz, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_LiBleSki_DN", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + + + ChanLi("//float4 weights : BLENDWEIGHTS;//DOTS_LiBleSki_MV", "float4 weights : BLENDWEIGHTS;//DOTS_LiBleSki_MV", "Assets/RealToon/RealToon Shaders/RealToon Core/URP/Pass/RT_URP_MoVecPas.hlsl"); + ChanLi("//uint4 indices : BLENDINDICES;//DOTS_LiBleSki_MV", "uint4 indices : BLENDINDICES;//DOTS_LiBleSki_MV", "Assets/RealToon/RealToon Shaders/RealToon Core/URP/Pass/RT_URP_MoVecPas.hlsl"); + ChanLi("uint vertexID : SV_VertexID;//DOTS_CompDef_MV", "//uint vertexID : SV_VertexID;//DOTS_CompDef_MV", "Assets/RealToon/RealToon Shaders/RealToon Core/URP/Pass/RT_URP_MoVecPas.hlsl"); + ChanLi("DOTS_CompDef(input.vertexID, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_CompDef_MV", "//DOTS_CompDef(input.vertexID, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_CompDef_MV", "Assets/RealToon/RealToon Shaders/RealToon Core/URP/Pass/RT_URP_MoVecPas.hlsl"); + ChanLi("//DOTS_LiBleSki(input.indices, input.weights, input.position.xyz, input.normalOS.xyz, input.tangentOS.xyz, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_LiBleSki_MV", "DOTS_LiBleSki(input.indices, input.weights, input.position.xyz, input.normalOS.xyz, input.tangentOS.xyz, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_LiBleSki_MV", "Assets/RealToon/RealToon Shaders/RealToon Core/URP/Pass/RT_URP_MoVecPas.hlsl"); + + + AssetDatabase.ImportAsset("Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + AssetDatabase.ImportAsset("Assets/RealToon/RealToon Shaders/RealToon Core/URP/Pass/RT_URP_MoVecPas.hlsl"); + AssetDatabase.ImportAsset("Assets/RealToon/Editor/RealToonShaderGUI_URP_SRP.cs"); + Debug.LogWarning("DOTS|HR - Linear Blending Skinning is now use."); + } + } + + #endregion + + #region ADD_ST + void ADD_ST() + { + if (add_st == true) + { + ChanLi("static bool add_st = true;", "static bool add_st = false;", "Assets/RealToon/Editor/RealToonShaderGUI_URP_SRP.cs"); + ChanLi("static string add_st_string = " + (char)34 + "Add 'See Through' feature" + (char)34 + ";", "static string add_st_string = " + (char)34 + "Remove 'See Through' feature" + (char)34 + ";", "Assets/RealToon/Editor/RealToonShaderGUI_URP_SRP.cs"); + + ChanLi("/*//O_ST", "//O_ST/*", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("/*//F_ST", "//F_ST/*", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("/*//G_ST", "//G_ST/*", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("Pass [_OutStenPass]//O_PI", "//Pass [_OutStenPass]//O_PI", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + + AssetDatabase.ImportAsset("Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + AssetDatabase.ImportAsset("Assets/RealToon/Editor/RealToonShaderGUI_URP_SRP.cs"); + Debug.LogWarning("'See Through feature' has been added."); + } + else if (add_st == false) + { + ChanLi("static bool add_st = false;", "static bool add_st = true;", "Assets/RealToon/Editor/RealToonShaderGUI_URP_SRP.cs"); + ChanLi("static string add_st_string = " + (char)34 + "Remove 'See Through' feature" + (char)34 + ";", "static string add_st_string = " + (char)34 + "Add 'See Through' feature" + (char)34 + ";", "Assets/RealToon/Editor/RealToonShaderGUI_URP_SRP.cs"); + ChanLi("//Pass [_OutStenPass]//O_PI", "Pass [_OutStenPass]//O_PI", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + + ChanLi("//O_ST/*", "/*//O_ST", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("//F_ST/*", "/*//F_ST", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("//G_ST/*", "/*//G_ST", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + + AssetDatabase.ImportAsset("Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + AssetDatabase.ImportAsset("Assets/RealToon/Editor/RealToonShaderGUI_URP_SRP.cs"); + Debug.LogWarning("'See Through feature' has been remove."); + } + } + #endregion + + #region TESS_SUPP + void TESS_SUPP() + { + if (tess_supp == false) + { + ChanLi("static bool tess_supp = false;", "static bool tess_supp = true;", "Assets/RealToon/Editor/RealToonShaderGUI_URP_SRP.cs"); + ChanLi("static string tess_supp_string = " + (char)34 + "Enable Tessellation" + (char)34 + ";", "static string tess_supp_string = " + (char)34 + "Disable Tessellation" + (char)34 + ";", "Assets/RealToon/Editor/RealToonShaderGUI_URP_SRP.cs"); + + ChanLi("//#define N_F_TESS_ON//FPT", "#define N_F_TESS_ON//FPT", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("/*//Tess_FP_1", "//Tess_FP_1/*", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("Varyings LitPassVertex(Attributes input)//FPV", "Varyings PostProcessVertex(Attributes input)//FPV", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("/*//Tess_FP_2", "//Tess_FP_2/*", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + + ChanLi("//#define N_F_TESS_ON//SCT", "#define N_F_TESS_ON//SCT", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("/*//Tess_SCP_1", "//Tess_SCP_1/*", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("Varyings ShadowPassVertex(Attributes input)//SCP", "Varyings PostProcessVertex(Attributes input)//SCP", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("/*//Tess_SCP_2", "//Tess_SCP_2/*", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + + ChanLi("//#define N_F_TESS_ON//GBT", "#define N_F_TESS_ON//GBT//", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("/*//Tess_GBP_1", "//Tess_GBP_1/*", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("Varyings LitPassVertex(Attributes input)//GBP", "Varyings PostProcessVertex(Attributes input)//GBP", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("/*//Tess_GBP_2", "//Tess_GBP_2/*", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + + ChanLi("//#define N_F_TESS_ON//DOPT", "#define N_F_TESS_ON//DOPT", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("/*//Tess_DOP_1", "//Tess_DOP_1/*", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("Varyings DepthOnlyVertex(Attributes input)//DOP", "Varyings PostProcessVertex(Attributes input)//DOP", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("/*//Tess_DOP_2", "//Tess_DOP_2/*", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + + ChanLi("//#define N_F_TESS_ON//DNT", "#define N_F_TESS_ON//DNT", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("/*//Tess_DNP_1", "//Tess_DNP_1/*", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("Varyings DepthNormalsVertex(Attributes input)//DNP", "Varyings PostProcessVertex(Attributes input)//DNP", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("/*//Tess_DNP_2", "//Tess_DNP_2/*", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + + ChanLi("//#define N_F_TESS_ON//OT", "#define N_F_TESS_ON//OT", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("/*//Tess_OP_1", "//Tess_OP_1/*", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("Varyings LitPassVertex(Attributes input)//OP", "Varyings PostProcessVertex(Attributes input)//OP", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("/*//Tess_OP_2", "//Tess_OP_2/*", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + + ChanLi("#if N_F_NM_ON//NMKW", "//#if N_F_NM_ON//NMKW", "Assets/RealToon/RealToon Shaders/RealToon Core/URP/RT_URP_PROP.hlsl"); + ChanLi("#endif//NMKW_END", "//#endif//NMKW_END", "Assets/RealToon/RealToon Shaders/RealToon Core/URP/RT_URP_PROP.hlsl"); + + AssetDatabase.ImportAsset("Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + AssetDatabase.ImportAsset("Assets/RealToon/Editor/RealToonShaderGUI_URP_SRP.cs"); + Debug.LogWarning("'Tessellation' has been enabled."); + } + else if (tess_supp == true) + { + ChanLi("static bool tess_supp = true;", "static bool tess_supp = false;", "Assets/RealToon/Editor/RealToonShaderGUI_URP_SRP.cs"); + ChanLi("static string tess_supp_string = " + (char)34 + "Disable Tessellation" + (char)34 + ";", "static string tess_supp_string = " + (char)34 + "Enable Tessellation" + (char)34 + ";", "Assets/RealToon/Editor/RealToonShaderGUI_URP_SRP.cs"); + + ChanLi("#define N_F_TESS_ON//FPT", "//#define N_F_TESS_ON//FPT", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("//Tess_FP_1/*", "/*//Tess_FP_1", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("Varyings PostProcessVertex(Attributes input)//FPV", "Varyings LitPassVertex(Attributes input)//FPV", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("//Tess_FP_2/*", "/*//Tess_FP_2", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + + ChanLi("#define N_F_TESS_ON//SCT", "//#define N_F_TESS_ON//SCT", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("//Tess_SCP_1/*", "/*//Tess_SCP_1", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("Varyings PostProcessVertex(Attributes input)//SCP", "Varyings ShadowPassVertex(Attributes input)//SCP", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("//Tess_SCP_2/*", "/*//Tess_SCP_2", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + + ChanLi("#define N_F_TESS_ON//GBT", "//#define N_F_TESS_ON//GBT", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("//Tess_GBP_1/*", "/*//Tess_GBP_1", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("Varyings PostProcessVertex(Attributes input)//GBP", "Varyings LitPassVertex(Attributes input)//GBP", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("//Tess_GBP_2/*", "/*//Tess_GBP_2", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + + ChanLi("#define N_F_TESS_ON//DOPT", "//#define N_F_TESS_ON//DOPT", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("//Tess_DOP_1/*", "/*//Tess_DOP_1", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("Varyings PostProcessVertex(Attributes input)//DOP", "Varyings DepthOnlyVertex(Attributes input)//DOP", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("//Tess_DOP_2/*", "/*//Tess_DOP_2", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + + ChanLi("#define N_F_TESS_ON//DNT", "//#define N_F_TESS_ON//DNT", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("//Tess_DNP_1/*", "/*//Tess_DNP_1", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("Varyings PostProcessVertex(Attributes input)//DNP", "Varyings DepthNormalsVertex(Attributes input)//DNP", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("//Tess_DNP_2/*", "/*//Tess_DNP_2", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + + ChanLi("#define N_F_TESS_ON//OT", "//#define N_F_TESS_ON//OT", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("//Tess_OP_1/*", "/*//Tess_OP_1", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("Varyings PostProcessVertex(Attributes input)//OP", "Varyings LitPassVertex(Attributes input)//OP", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + ChanLi("//Tess_OP_2/*", "/*//Tess_OP_2", "Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + + ChanLi("//#if N_F_NM_ON//NMKW", "#if N_F_NM_ON//NMKW", "Assets/RealToon/RealToon Shaders/RealToon Core/URP/RT_URP_PROP.hlsl"); + ChanLi("//#endif//NMKW_END", "#endif//NMKW_END", "Assets/RealToon/RealToon Shaders/RealToon Core/URP/RT_URP_PROP.hlsl"); + + AssetDatabase.ImportAsset("Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader"); + AssetDatabase.ImportAsset("Assets/RealToon/Editor/RealToonShaderGUI_URP_SRP.cs"); + Debug.LogWarning("'Tessellation' has been disabled."); + } + } + #endregion + } + +} + +#endif \ No newline at end of file diff --git a/Assets/RealToon/Editor/RealToonShaderGUI_URP_SRP.cs.meta b/Assets/RealToon/Editor/RealToonShaderGUI_URP_SRP.cs.meta new file mode 100644 index 00000000..e542e6fe --- /dev/null +++ b/Assets/RealToon/Editor/RealToonShaderGUI_URP_SRP.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e44691c063f9e5943b99e9a918b7647a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/RealToon/Editor/RealToon_Settings_Options.cs b/Assets/RealToon/Editor/RealToon_Settings_Options.cs new file mode 100644 index 00000000..870bcf4d --- /dev/null +++ b/Assets/RealToon/Editor/RealToon_Settings_Options.cs @@ -0,0 +1,37 @@ +//RealToonGUI +//MJQStudioWorks +//İ2025 + +using UnityEngine; +using UnityEditor; +using System; + +namespace RealToon.SettingsOptions +{ + + internal class RTToggleOption : MaterialPropertyDrawer + { + + public override void OnGUI(Rect position, MaterialProperty prop, GUIContent label, MaterialEditor editor) + { + + bool value = (prop.floatValue != 0.0f); + + EditorGUI.BeginChangeCheck(); + EditorGUI.showMixedValue = prop.hasMixedValue; + + value = EditorGUI.Toggle(position, label, value); + + EditorGUI.showMixedValue = false; + if (EditorGUI.EndChangeCheck()) + { + + prop.floatValue = value ? 1.0f : 0.0f; + + } + + } + + } + +} \ No newline at end of file diff --git a/Assets/RealToon/Editor/RealToon_Settings_Options.cs.meta b/Assets/RealToon/Editor/RealToon_Settings_Options.cs.meta new file mode 100644 index 00000000..04cd1cd1 --- /dev/null +++ b/Assets/RealToon/Editor/RealToon_Settings_Options.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 1cd58e2ff61cd5e459c58cecf73d687b \ No newline at end of file diff --git a/Assets/RealToon/Editor/SwapShaderToRealToon.cs b/Assets/RealToon/Editor/SwapShaderToRealToon.cs new file mode 100644 index 00000000..04ce85be --- /dev/null +++ b/Assets/RealToon/Editor/SwapShaderToRealToon.cs @@ -0,0 +1,1848 @@ +//Swap Shader To RealToon +//İMJQStudioWorks + +using UnityEngine; +using UnityEditor; + +namespace RealToon.Tools +{ + public class SwapShaderToRealToon : EditorWindow + { + #region Variables + + private string ShaderName = string.Empty; + + private Color ShaColor = Color.white; + private Color ShaEmiColor = Color.black; + private Color VRMShadeColor = Color.black; + private Color VRMRimColor = Color.black; + private Color VRMOutliColor = Color.black; + private Color ShaSpecCol = Color.black; + private Color RTBiPDefCol = new Color(0.6886792f, 0.6886792f, 0.6886792f); + + private float MatType = 0.0f; + private float ShaNormalScale = 0.0f; + private float CullingMode = 0.0f; + private float VRMOutlineMode = 0.0f; + private float ShaSmooth = 0.0f; + private float ShaAlpClip = 0.0f; + private float ShaMetal = 0.0f; + private float ShaSpecHighEn = 0.0f; + private float ShaRefEn = 0.0f; + private float ShaWorFloMod = 0.0f; + private float ShaMetaRemMinMax = 0.0f; + private float ShaSmoRemMinMax = 0.0f; + private float ShaDoubSid = 0.0f; + private float ShaMatID = 0.0f; + + private Texture ShaMainTex = null; + private Texture ShaNormalMap = null; + private Texture ShaEmiMap = null; + private Texture ShaMetaMap = null; + private Texture ShaSpecMap = null; + private Texture ShaMasMa = null; + private Texture VRMShaOutWid = null; + + private bool Enswap = true; + private bool SKEmi = false; + private bool ForTrasCuto = true; + private bool EnhaHiLighColInt = true; + private bool IncShaCol = true; + private bool IncEmi = false; + private bool EnaGiSha = false; + private bool GiFlaLo = false; + private bool FERL = false; + private bool FUL = false; + private bool UsEmiMapAnColAsGloTex = false; + private bool DisRecSha = false; + private bool LigAffSha = false; + static string InfoString = string.Empty; + private string FromShader = "VRoid|VRM"; + private string UnShaType = string.Empty; + private string ProcMat = "None"; + static string SupShaURP = string.Empty; + static string SupShaHDRP = string.Empty; + static string SupShaBiRP = string.Empty; + static string SupShaVRM = string.Empty; + + private int MatNum = 0; + static float WinHig = 700; + static EditorWindow EdiWin; + static Shader ShaRTURP; + static Shader ShaRTHDRP; + static Shader ShaRTBID; + static Shader ShaRTBIFT; + static Shader ShaVRM; + static Shader ShaVRM10; + static Shader ShaVRM10URP; + private string RTShader = "No RealToon Shader In Your Project"; + + int ToBaInt = 0; + private string[] tobastrings = { "VRoid|VRM", "Unity" }; + + private Vector2 scroll; + + #endregion + + [MenuItem("Window/RealToon/Shader Swap to RealToon")] + static void Init() + { + EdiWin = GetWindow(true); + EdiWin.titleContent = new GUIContent("Swap Shader to RealToon"); + WinHig = 700; + EdiWin.minSize = new Vector2(420, WinHig); + EdiWin.maxSize = new Vector2(420, WinHig); + ShaRTURP = Shader.Find("Universal Render Pipeline/RealToon/Version 5/Default/Default"); + ShaRTHDRP = Shader.Find("HDRP/RealToon/Version 5/Default"); + ShaRTBID = Shader.Find("RealToon/Version 5/Default/Default"); + ShaRTBIFT = Shader.Find("RealToon/Version 5/Default/Fade Transparency"); + ShaVRM = Shader.Find("VRM/MToon"); + ShaVRM10 = Shader.Find("VRM10/MToon10"); + ShaVRM10URP = Shader.Find("VRM10/Universal Render Pipeline/MToon10"); + + SupShaURP = "Supported Unity URP Shaders:\n" + + "*Complex Lit\n" + + "*Lit\n" + + "*Simple Lit\n" + + "*Unlit\n" + + "*Baked Lit\n\n"; + + SupShaHDRP = "Supported Unity HDRP Shaders:\n" + + "*Lit\n" + + "*LitTessellation\n" + + "*Unlit\n\n"; + + SupShaBiRP = "Supported Unity Built-In Shaders:\n" + + "*Standard\n" + + "*Standard (Specular setup)\n" + + "*Unlit/Color\n" + + "*Unlit/Texture\n" + + "*Unlit/Transparent\n" + + "*Unlit/Transparent Cutout\n\n"; + + SupShaVRM = "Supported VRoid|VRM Shaders:\n" + + "*VRM\n" + + "*VRM10\n" + + "*VRM10 [URP]\n\n"; + + InfoString = SupShaVRM; + + //For Future Use + //EditorWindow.GetWindow(typeof(SwapShaderToRealToon)); + //EdiWin.ShowTab(); + } + + void OnGUI() + { + Object[] mat = Selection.GetFiltered(typeof(Material), SelectionMode.Assets); + var lblcenstyle = new GUIStyle(GUI.skin.label) { alignment = TextAnchor.MiddleCenter }; + + #region Checking + + if (ShaRTURP) + { + Enswap = true; + RTShader = "Click To Swap To RealToon (URP) Shader"; + } + else if (ShaRTHDRP) + { + Enswap = true; + RTShader = "Click To Swap To RealToon (HDRP) Shader"; + } + else if (ShaRTBID && ShaRTBIFT) + { + Enswap = true; + RTShader = "Click To Swap To RealToon (Built-In) Shader"; + } + else if (ShaRTURP && ShaRTHDRP && (ShaRTBID && ShaRTBIFT)) + { + Enswap = false; + RTShader = "Use One RealToon Shader For Each Render Pipeline"; + } + else + { + Enswap = false; + RTShader = "No RealToon Built-In/URP/HDRP Shader In Your Project"; + } + + GUILayout.Space(10); + GUILayout.Label("From Shader:"); + EditorGUI.BeginChangeCheck(); + ToBaInt = GUILayout.Toolbar(ToBaInt, tobastrings); + if (EditorGUI.EndChangeCheck()) + { + FromShader = tobastrings[ToBaInt]; + + if (ToBaInt == 1) + { + WinHig = 550; + EdiWin.minSize = new Vector2(420, WinHig); + EdiWin.maxSize = new Vector2(420, WinHig); + + if (Shader.Find("Universal Render Pipeline/Complex Lit") || Shader.Find("Universal Render Pipeline/Lit") || Shader.Find("Universal Render Pipeline/Simple Lit") || Shader.Find("Universal Render Pipeline/Unlit") || Shader.Find("Universal Render Pipeline/Baked Lit")) + { + UnShaType = "(URP)"; + InfoString = SupShaURP; + + } + else if (Shader.Find("HDRP/Lit") || Shader.Find("HDRP/LitTessellation") || Shader.Find("HDRP/Unlit")) + { + UnShaType = "(HDRP)"; + InfoString = SupShaHDRP; + + } + else if (Shader.Find("Standard") || Shader.Find("Standard (Specular setup)") || Shader.Find("Unlit/Color") || Shader.Find("Unlit/Texture") || Shader.Find("Unlit/Transparent") || Shader.Find("Unlit/Transparent Cutout")) + { + UnShaType = "(Built-In)"; + InfoString = SupShaBiRP; + + } + else + { + UnShaType = string.Empty; + } + } + if (ToBaInt == 0) + { + WinHig = 700; + EdiWin.minSize = new Vector2(420, WinHig); + EdiWin.maxSize = new Vector2(420, WinHig); + + UnShaType = string.Empty; + InfoString = SupShaVRM; + } + } + + #endregion + + GUILayout.Space(10); + GUILayout.Label("Selected: " + FromShader + " Shader " + UnShaType, lblcenstyle); + + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + GUILayout.Space(10); + + #region Processing + + EditorGUI.BeginDisabledGroup(Enswap == false); + if (GUILayout.Button(RTShader)) + { + + if (mat.Length == 0) + { + InfoString = "Please Select Materials\n\n"; + } + else + { + InfoString = string.Empty; + MatNum = 0; + + foreach (Material m in mat) + { + ProcMat = m.name; + + if (ToBaInt == 0) + { + if (ShaVRM || ShaVRM10) + { + if (m.shader.name == "VRM/MToon" || m.shader.name == "VRM10/MToon10" || m.shader.name == "VRM10/Universal Render Pipeline/MToon10") + { + ShaderName = m.shader.name; + + if (ShaderName == "VRM10/MToon10" || m.shader.name == "VRM10/Universal Render Pipeline/MToon10") + { + MatType = m.GetFloat("_AlphaMode"); + } + else if (ShaderName == "VRM/MToon") + { + MatType = m.GetFloat("_BlendMode"); + } + + ShaMainTex = m.GetTexture("_MainTex"); + ShaNormalMap = m.GetTexture("_BumpMap"); + VRMShaOutWid = m.GetTexture("_OutlineWidthTex"); + ShaNormalScale = m.GetFloat("_BumpScale"); + ShaColor = m.GetColor("_Color"); + VRMShadeColor = m.GetColor("_ShadeColor"); + + if (ShaderName == "VRM10/MToon10" || m.shader.name == "VRM10/Universal Render Pipeline/MToon10") + { + CullingMode = m.GetFloat("_DoubleSided"); + } + else if (ShaderName == "VRM/MToon") + { + CullingMode = m.GetFloat("_CullMode"); + } + + ShaEmiMap = m.GetTexture("_EmissionMap"); + ShaEmiColor = m.GetColor("_EmissionColor"); + + if (m.HasProperty("_RimColor")) + { + VRMRimColor = m.GetColor("_RimColor"); + } + + VRMOutlineMode = m.GetFloat("_OutlineWidthMode"); + VRMOutliColor = m.GetColor("_OutlineColor"); + + } + else if (m.shader.name != "VRM/MToon" || m.shader.name != "VRM10/MToon10" || m.shader.name == "VRM10/Universal Render Pipeline/MToon10") + { + InfoString += "The selected '" + m.name + "' material, shader is not supported.\n '" + m.shader.name + "'\n\n" + SupShaVRM; + } + + if (ShaderName == "VRM/MToon" || ShaderName == "VRM10/MToon10" || m.shader.name == "VRM10/Universal Render Pipeline/MToon10") + { + + if (ShaRTURP) + { + m.shader = ShaRTURP; + } + else if (ShaRTHDRP) + { + m.shader = ShaRTHDRP; + } + else if (ShaRTBID) + { + m.shader = ShaRTBID; + } + + InfoString += "Processing Material: " + m.name + "\nPrevious Shader: " + ShaderName; + + if (FUL == true) + { + FERL = false; + IncEmi = false; + DisRecSha = false; + LigAffSha = false; + } + + m.SetFloat("_OutlineWidth", 0.12f); + + if (VRMShaOutWid != null) + { + m.SetTexture("_OutlineWidthControl", VRMShaOutWid); + } + + if (ForTrasCuto != true) + { + if (MatType == 2.0f) + { + if (!ShaRTBID) + { + m.SetInt("_BleModSour", 5); + m.SetInt("_BleModDest", 10); + + m.EnableKeyword("N_F_TRANS_ON"); + m.SetFloat("_TRANSMODE", 1.0f); + m.renderQueue = 3000; + m.SetOverrideTag("RenderType", "Transparent"); + + if (ShaRTHDRP) + { + if ((m.IsKeywordEnabled("N_F_R_ON") && (m.IsKeywordEnabled("N_F_ESSR_ON") || m.GetFloat("_N_F_ESSR") == 1.0f)) || ((m.IsKeywordEnabled("N_F_ESSGI_ON") || m.GetFloat("_N_F_ESSGI") == 1.0f))) + { + m.SetInt("_SSRefDeOn", 0); + m.SetInt("_SSRefGBu", 2); + m.SetInt("_SSRefMoVe", 32); + } + + m.SetInt("_ZTeForLiOpa", 4); + } + } + else if (ShaRTBID) + { + m.shader = ShaRTBIFT; + } + + } + else if (MatType == 1.0f) + { + if (!ShaRTBID) + { + m.SetInt("_BleModSour", 5); + m.SetInt("_BleModDest", 10); + + m.EnableKeyword("N_F_TRANS_ON"); + m.SetFloat("_TRANSMODE", 1.0f); + + m.EnableKeyword("N_F_CO_ON"); + m.SetFloat("_N_F_CO", 1.0f); + + m.SetInt("_ZWrite", 1); + + if (ShaRTURP) + { + m.SetFloat("_Cutout", 0.4f); + } + else if (ShaRTHDRP) + { + m.SetFloat("_Cutout", 0.51f); + } + + m.renderQueue = 2450; + m.SetOverrideTag("RenderType", "TransparentCutout"); + + if (ShaRTHDRP) + { + if ((m.IsKeywordEnabled("N_F_R_ON") && (m.IsKeywordEnabled("N_F_ESSR_ON") || m.GetFloat("_N_F_ESSR") == 1.0f)) || ((m.IsKeywordEnabled("N_F_ESSGI_ON") || m.GetFloat("_N_F_ESSGI") == 1.0f))) + { + m.SetInt("_SSRefDeOn", 8); + m.SetInt("_SSRefGBu", 10); + m.SetInt("_SSRefMoVe", 40); + } + + m.SetInt("_ZTeForLiOpa", 3); + } + + } + else if (ShaRTBID) + { + m.shader = ShaRTBID; + m.EnableKeyword("N_F_CO_ON"); + m.SetFloat("_N_F_CO", 1.0f); + m.SetFloat("_Cutout", 0.4f); + + } + } + + } + else if (ForTrasCuto == true) + { + if (MatType == 1.0f || MatType == 2.0f) + { + if (!ShaRTBID) + { + m.SetInt("_BleModSour", 5); + m.SetInt("_BleModDest", 10); + + m.EnableKeyword("N_F_TRANS_ON"); + m.SetFloat("_TRANSMODE", 1.0f); + + m.EnableKeyword("N_F_CO_ON"); + m.SetFloat("_N_F_CO", 1.0f); + + m.SetInt("_ZWrite", 1); + + if (ShaRTURP) + { + m.SetFloat("_Cutout", 0.4f); + } + else if (ShaRTHDRP) + { + m.SetFloat("_Cutout", 0.51f); + } + + m.renderQueue = 2450; + m.SetOverrideTag("RenderType", "TransparentCutout"); + + if (ShaRTHDRP) + { + if ((m.IsKeywordEnabled("N_F_R_ON") && (m.IsKeywordEnabled("N_F_ESSR_ON") || m.GetFloat("_N_F_ESSR") == 1.0f)) || ((m.IsKeywordEnabled("N_F_ESSGI_ON") || m.GetFloat("_N_F_ESSGI") == 1.0f))) + { + m.SetInt("_SSRefDeOn", 8); + m.SetInt("_SSRefGBu", 10); + m.SetInt("_SSRefMoVe", 40); + } + + m.SetInt("_ZTeForLiOpa", 3); + } + + } + else if (ShaRTBID) + { + m.shader = ShaRTBID; + m.EnableKeyword("N_F_CO_ON"); + m.SetFloat("_N_F_CO", 1.0f); + m.SetFloat("_Cutout", 0.4f); + + } + } + } + + if (ShaRTURP) + { + if (EnhaHiLighColInt == true) + { + m.SetFloat("_HighlightColorPower", 0.7f); + m.SetFloat("_OverallShadowColorPower", 0.7f); + } + } + else if (ShaRTHDRP) + { + if (EnhaHiLighColInt == true) + { + m.SetFloat("_HighlightColorPower", 1.7f); + } + } + else if (ShaRTBID) + { + if (PlayerSettings.colorSpace != ColorSpace.Gamma) + { + if (EnhaHiLighColInt == true) + { + if (m.GetColor("_MainColor") == RTBiPDefCol) + { + m.SetColor("_MainColor", new Color(1.0f, 1.0f, 1.0f)); + m.SetFloat("_HighlightColorPower", 0.8f); + } + else + { + m.SetFloat("_HighlightColorPower", 0.8f); + } + } + } + } + + if (ShaNormalMap != null) + { + m.EnableKeyword("N_F_NM_ON"); + m.SetFloat("_N_F_NM", 1.0f); + m.SetTexture("_NormalMap", ShaNormalMap); + m.SetFloat("_NormalMapIntensity", ShaNormalScale); + } + + if (!ShaRTBID) + { + if (ShaColor != Color.white) + { + m.SetColor("_MainColor", ShaColor * ShaColor); + } + if (VRMShadeColor != Color.black) + { + m.SetColor("_OverallShadowColor", VRMShadeColor * VRMShadeColor); + if (IncShaCol == false) + { + m.SetColor("_OverallShadowColor", new Color(0.4f, 0.4f, 0.4f)); + } + } + } + else if (ShaRTBID) + { + if (ShaColor != Color.white) + { + if (PlayerSettings.colorSpace == ColorSpace.Gamma) + { + m.SetColor("_MainColor", ShaColor * RTBiPDefCol); + } + else + { + m.SetColor("_MainColor", ShaColor); + } + } + + if (VRMShadeColor != Color.black && IncShaCol == true) + { + if (PlayerSettings.colorSpace == ColorSpace.Gamma) + { + m.SetColor("_OverallShadowColor", VRMShadeColor * RTBiPDefCol); + } + else + { + m.SetColor("_OverallShadowColor", VRMShadeColor); + } + } + else if (IncShaCol == false) + { + m.SetColor("_OverallShadowColor", new Color(0.4f, 0.4f, 0.4f)); + } + + if ((ShaColor == Color.white) && EnhaHiLighColInt == false) + { + m.SetColor("_MainColor", RTBiPDefCol); + } + } + + if (!ShaRTBID) + { + if (ShaderName == "VRM10/MToon10" || m.shader.name == "VRM10/Universal Render Pipeline/MToon10") + { + if (CullingMode != 0.0f) + { + if (CullingMode == 1.0) + { + m.SetFloat("_Culling", 0); + } + } + } + else if (ShaderName == "VRM/MToon") + { + if (CullingMode != 2.0f) + { + m.SetFloat("_Culling", CullingMode); + } + } + } + else if (ShaRTBID) + { + if (ShaderName == "VRM10/MToon10" || m.shader.name == "VRM10/Universal Render Pipeline/MToon10") + { + if (CullingMode == 1.0) + { + m.SetFloat("_Culling", 0); + } + else if (CullingMode == 0.0) + { + m.SetFloat("_Culling", 2); + } + } + else if (ShaderName == "VRM/MToon") + { + if (CullingMode == 2.0f || CullingMode == 1.0f) + { + m.SetFloat("_DoubleSided", 2); + } + else if (CullingMode == 0.0f) + { + m.SetFloat("_DoubleSided", 0); + } + } + } + + if (IncEmi == true) + { + if (ShaEmiMap != null || ShaEmiColor != Color.black) + { + m.EnableKeyword("N_F_SL_ON"); + m.SetFloat("_N_F_SL", 1.0f); + m.SetFloat("_SelfLitIntensity", 1.0f); + m.SetFloat("_SelfLitHighContrast", 0.0F); + m.SetFloat("_SelfLitPower", 20.0f); + m.SetTexture("_MaskSelfLit", ShaEmiMap); + if (!ShaRTBID) + { + m.SetColor("_SelfLitColor", ShaEmiColor * ShaEmiColor); + } + else if (ShaRTBID) + { + if (PlayerSettings.colorSpace == ColorSpace.Gamma) + { + m.SetColor("_SelfLitColor", ShaEmiColor * RTBiPDefCol); + } + else + { + m.SetColor("_SelfLitColor", ShaEmiColor); + } + } + } + } + + if (FERL == false) + { + if ((VRMRimColor != Color.black && m.HasProperty("_RimColor")) || m.HasProperty("_RimColor")) + { + m.EnableKeyword("N_F_RL_ON"); + m.SetFloat("_N_F_RL", 1.0f); + if (!ShaRTBID) + { + m.SetColor("_RimLightColor", VRMRimColor * VRMRimColor); + } + else if (ShaRTBID) + { + if (PlayerSettings.colorSpace == ColorSpace.Gamma) + { + m.SetColor("_RimLightColor", VRMRimColor * RTBiPDefCol); + } + else + { + m.SetColor("_RimLightColor", VRMRimColor); + } + } + } + } + else if (FERL == true) + { + m.EnableKeyword("N_F_RL_ON"); + m.SetFloat("_N_F_RL", 1.0f); + m.SetFloat("_RimLightSoftness", 0.0f); + m.SetFloat("_RimLightUnfill", 2.3f); + + if (ShaRTHDRP || ShaRTURP) + { + m.SetFloat("_RimLigInt", 0.2f); + } + + m.SetColor("_RimLightColor", new Color(1.0f, 1.0f, 1.0f)); + + } + + if (VRMOutlineMode == 1 || VRMOutlineMode == 2) + { + if (!ShaRTBID) + { + m.SetColor("_OutlineColor", VRMOutliColor * VRMOutliColor); + } + else if (ShaRTBID) + { + if (PlayerSettings.colorSpace == ColorSpace.Gamma) + { + m.SetColor("_OutlineColor", VRMOutliColor * RTBiPDefCol); + } + else + { + m.SetColor("_OutlineColor", VRMOutliColor); + } + } + } + + if (UsEmiMapAnColAsGloTex == true) + { + if (ShaEmiMap != null) + { + m.EnableKeyword("N_F_GLO_ON"); + m.SetFloat("_N_F_GLO", 1.0f); + m.EnableKeyword("N_F_GLOT_ON"); + m.SetFloat("_N_F_GLOT", 1.0f); + m.SetTexture("_GlossTexture", ShaEmiMap); + m.SetTextureOffset("_GlossTexture", new Vector2(0.0f, 0.28f)); + + if (ShaRTHDRP) + { + m.SetFloat("_GlossIntensity", 0.35f); + } + else if (ShaRTURP) + { + m.SetFloat("_GlossIntensity", 0.055f); + } + + if (ShaRTBID) + { + m.SetFloat("_GlossColorPower", 100.0f); + } + + if (ShaEmiColor != Color.black) + { + if (!ShaRTBID) + { + m.SetColor("_GlossColor", ShaEmiColor * ShaEmiColor); + } + else + { + if (PlayerSettings.colorSpace == ColorSpace.Gamma) + { + m.SetColor("_GlossColor", ShaEmiColor * RTBiPDefCol); + } + else + { + m.SetColor("_GlossColor", ShaEmiColor); + } + } + } + } + + } + + if (EnaGiSha == true) + { + m.SetFloat("_GIShadeThreshold", 1.0f); + } + + if (EnaGiSha == true && GiFlaLo == true) + { + m.SetFloat("_GIFlatShade", 1.0f); + } + + m.SetFloat("_OutlineWidth", 0.12f); + + if (FUL == true) + { + if (ShaRTBID) + { + m.EnableKeyword("N_F_SL_ON"); + m.SetFloat("_N_F_SL", 1.0f); + + if (m.GetColor("_MainColor") == new Color(0.6886792f, 0.6886792f, 0.6886792f)) + { + m.SetFloat("_SelfLitPower", 3); + } + else + { + m.SetFloat("_SelfLitPower", 0.2f); + } + + m.SetFloat("_SelfLitIntensity", 1.0f); + m.SetFloat("_SelfLitHighContrast", 0.0f); + + m.DisableKeyword("N_F_SS_ON"); + m.SetFloat("_N_F_SS", 0.0f); + + m.DisableKeyword("N_F_RELGI_ON"); + m.SetFloat("_RELG", 0.0f); + + m.DisableKeyword("N_F_RL_ON"); + m.SetFloat("_N_F_RL", 0.0f); + + m.DisableKeyword("N_F_NM_ON"); + m.SetFloat("_N_F_NM", 0.0f); + + if (m.HasProperty("_N_F_HDLS") && m.HasProperty("_N_F_HPSS")) + { + m.EnableKeyword("N_F_HDLS_ON"); + m.SetFloat("_N_F_HDLS", 1.0f); + + m.EnableKeyword("N_F_HPSS_ON"); + m.SetFloat("_N_F_HPSS", 1.0f); + } + } + + if (ShaRTURP) + { + m.EnableKeyword("N_F_SL_ON"); + m.SetFloat("_N_F_SL", 1.0f); + m.SetFloat("_SelfLitPower", 0.3f); + m.SetFloat("_SelfLitIntensity", 1.0f); + m.SetFloat("_SelfLitHighContrast", 0.0f); + + m.DisableKeyword("N_F_SS_ON"); + m.SetFloat("_N_F_SS", 0.0f); + + m.DisableKeyword("N_F_RELGI_ON"); + m.SetFloat("_RELG", 0.0f); + + m.DisableKeyword("N_F_EAL_ON"); + m.SetFloat("_N_F_EAL", 0.0f); + + m.EnableKeyword("N_F_USETLB_ON"); + m.SetFloat("_UseTLB", 1.0f); + + m.DisableKeyword("N_F_NM_ON"); + m.SetFloat("_N_F_NM", 0.0f); + + m.EnableKeyword("N_F_HDLS_ON"); + m.SetFloat("_N_F_HDLS", 1.0f); + + m.EnableKeyword("N_F_HPSS_ON"); + m.SetFloat("_N_F_HPSS", 1.0f); + } + + if (ShaRTHDRP) + { + m.EnableKeyword("N_F_SL_ON"); + m.SetFloat("_N_F_SL", 1.0f); + m.SetFloat("_SelfLitPower", 6.5f); + m.SetFloat("_SelfLitIntensity", 1.0f); + m.SetFloat("_SelfLitHighContrast", 0.0f); + + m.DisableKeyword("N_F_SS_ON"); + m.SetFloat("_N_F_SS", 0.0f); + + m.DisableKeyword("N_F_RELGI_ON"); + m.SetFloat("_RELG", 0.0f); + + m.DisableKeyword("N_F_PAL_ON"); + m.SetFloat("_N_F_PAL", 0.0f); + + m.EnableKeyword("N_F_USETLB_ON"); + m.SetFloat("_UseTLB", 1.0f); + + m.DisableKeyword("N_F_NM_ON"); + m.SetFloat("_N_F_NM", 0.0f); + + m.EnableKeyword("N_F_HDLS_ON"); + m.SetFloat("_N_F_HDLS", 1.0f); + + m.EnableKeyword("N_F_HPSAS_ON"); + m.SetFloat("_N_F_HPSAS", 1.0f); + } + } + + if (ShaRTBID) + { + if (LigAffSha == true) + { + m.SetFloat("_LightAffectShadow", 1.0f); + } + + if (m.HasProperty("_N_F_HDLS") && m.HasProperty("_N_F_HPSS")) + { + if (DisRecSha == true) + { + m.EnableKeyword("N_F_HDLS_ON"); + m.SetFloat("_N_F_HDLS", 1.0f); + + m.EnableKeyword("N_F_HPSS_ON"); + m.SetFloat("_N_F_HPSS", 1.0f); + } + } + } + + if (ShaRTURP) + { + if (LigAffSha == true) + { + m.SetFloat("_LightAffectShadow", 1.0f); + } + + if (DisRecSha == true) + { + m.EnableKeyword("N_F_HDLS_ON"); + m.SetFloat("_N_F_HDLS", 1.0f); + + m.EnableKeyword("N_F_HPSS_ON"); + m.SetFloat("_N_F_HPSAS", 1.0f); + } + } + + if (ShaRTHDRP) + { + if (LigAffSha == true) + { + m.SetFloat("_LightAffectShadow", 1.0f); + } + + if (DisRecSha == true) + { + m.EnableKeyword("N_F_HDLS_ON"); + m.SetFloat("_N_F_HDLS", 1.0f); + + m.EnableKeyword("N_F_HPSAS_ON"); + m.SetFloat("_N_F_HPSAS", 1.0f); + } + } + + ShaderName = string.Empty; + InfoString += "\n[Done]\n\n"; + + } + } + else if (!ShaVRM || !ShaVRM10) + { + InfoString = "Can't proceed, No VRoid|VRM shaders in your project"; + } + + } + else if (ToBaInt == 1) + { + + if (UnShaType == "(URP)") + { + + if (m.shader.name == "Universal Render Pipeline/Complex Lit" || m.shader.name == "Universal Render Pipeline/Lit" || m.shader.name == "Universal Render Pipeline/Simple Lit") + { + ShaderName = m.shader.name; + ShaMainTex = m.GetTexture("_BaseMap"); + ShaColor = m.GetColor("_BaseColor"); + ShaNormalMap = m.GetTexture("_BumpMap"); + ShaNormalScale = m.GetFloat("_BumpScale"); + ShaEmiColor = m.GetColor("_EmissionColor"); + ShaEmiMap = m.GetTexture("_EmissionMap"); + ShaSmooth = m.GetFloat("_Smoothness"); + MatType = m.GetFloat("_Surface"); + CullingMode = m.GetFloat("_Cull"); + ShaAlpClip = m.GetFloat("_AlphaClip"); + SKEmi = m.IsKeywordEnabled("_EMISSION"); + ShaSpecHighEn = m.GetFloat("_SpecularHighlights"); + + if (m.HasProperty("_EnvironmentReflections")) + { + ShaRefEn = m.GetFloat("_EnvironmentReflections"); + } + + if (m.HasProperty("_SpecColor")) + { + ShaSpecCol = m.GetColor("_SpecColor"); + } + + if (m.HasProperty("_WorkflowMode")) + { + ShaWorFloMod = m.GetFloat("_WorkflowMode"); + } + + if (m.HasProperty("_Metallic")) + { + ShaMetal = m.GetFloat("_Metallic"); + } + + if (m.HasProperty("_MetallicGlossMap")) + { + ShaMetaMap = m.GetTexture("_MetallicGlossMap"); + } + + if (m.HasProperty("_SpecGlossMap")) + { + ShaSpecMap = m.GetTexture("_SpecGlossMap"); + } + } + else if (m.shader.name == "Universal Render Pipeline/Unlit") + { + ShaderName = m.shader.name; + ShaMainTex = m.GetTexture("_BaseMap"); + ShaColor = m.GetColor("_BaseColor"); + MatType = m.GetFloat("_Surface"); + CullingMode = m.GetFloat("_Cull"); + ShaAlpClip = m.GetFloat("_AlphaClip"); + } + else if (m.shader.name == "Universal Render Pipeline/Baked Lit") + { + ShaderName = m.shader.name; + ShaMainTex = m.GetTexture("_BaseMap"); + ShaColor = m.GetColor("_BaseColor"); + ShaNormalMap = m.GetTexture("_BumpMap"); + MatType = m.GetFloat("_Surface"); + CullingMode = m.GetFloat("_Cull"); + ShaAlpClip = m.GetFloat("_AlphaClip"); + } + else if (m.shader.name != "Universal Render Pipeline/Complex Lit" || m.shader.name != "Universal Render Pipeline/Lit" || m.shader.name != "Universal Render Pipeline/Simple Lit" || m.shader.name != "Universal Render Pipeline/Unlit" || m.shader.name != "Universal Render Pipeline/Baked Lit") + { + InfoString += "The selected '" + m.name + "' material, shader is not supported.\n '" + m.shader.name + "'\n\n" + SupShaURP; + } + + if (m.shader.name == "Universal Render Pipeline/Complex Lit" || m.shader.name == "Universal Render Pipeline/Lit" || m.shader.name == "Universal Render Pipeline/Simple Lit" || m.shader.name == "Universal Render Pipeline/Unlit" || m.shader.name == "Universal Render Pipeline/Baked Lit") + { + if (ShaRTURP) + { + m.shader = ShaRTURP; + } + + InfoString += "Processing Material: " + m.name + "\nPrevious Shader: " + ShaderName; + + if (ShaMainTex != null) + { + m.SetTexture("_MainTex", ShaMainTex); + } + + if (ShaderName != "Universal Render Pipeline/Unlit" || ShaderName != "Universal Render Pipeline/Baked Lit") + { + m.SetColor("_OverallShadowColor", new Color(0.2f, 0.2f, 0.2f)); + } + + m.SetFloat("_OutlineWidth", 0.12f); + + if (MatType == 1.0f) + { + m.SetInt("_BleModSour", 5); + m.SetInt("_BleModDest", 10); + + m.EnableKeyword("N_F_TRANS_ON"); + m.SetFloat("_TRANSMODE", 1.0f); + m.renderQueue = 3000; + m.SetOverrideTag("RenderType", "Transparent"); + m.SetFloat("_Opacity", ShaColor.a); + + } + + if (ShaAlpClip == 1.0f) + { + m.SetInt("_BleModSour", 5); + m.SetInt("_BleModDest", 10); + + m.EnableKeyword("N_F_TRANS_ON"); + m.SetFloat("_TRANSMODE", 1.0f); + + m.EnableKeyword("N_F_CO_ON"); + m.SetFloat("_N_F_CO", 1.0f); + m.SetFloat("_Cutout", 0.4f); + m.renderQueue = 2450; + m.SetOverrideTag("RenderType", "TransparentCutout"); + } + + if (ShaderName != "Universal Render Pipeline/Unlit") + { + if (ShaNormalMap != null) + { + m.EnableKeyword("N_F_NM_ON"); + m.SetFloat("_N_F_NM", 1.0f); + m.SetTexture("_NormalMap", ShaNormalMap); + m.SetFloat("_NormalMapIntensity", ShaNormalScale); + } + + } + + if (ShaColor != Color.white) + { + m.SetColor("_MainColor", ShaColor * ShaColor); + } + + if (CullingMode == 2.0f) + { + m.SetFloat("_Culling", 2.0f); + } + else if (CullingMode == 1.0f) + { + m.SetFloat("_Culling", 1.0f); + } + else if (CullingMode == 0.0) + { + m.SetFloat("_Culling", 0.0f); + } + + if (ShaderName != "Universal Render Pipeline/Unlit" || ShaderName != "Universal Render Pipeline/Baked Lit") + { + if (SKEmi) + { + m.EnableKeyword("N_F_SL_ON"); + m.SetFloat("_N_F_SL", 1.0f); + m.EnableKeyword("N_F_SLMM_ON"); + m.SetFloat("_N_F_SLMM", 1.0f); + m.SetFloat("_SelfLitPower", 10.0f); + m.SetFloat("_SelfLitIntensity", 1.0f); + m.SetTexture("_MaskSelfLit", ShaEmiMap); + m.SetColor("_SelfLitColor", ShaEmiColor * ShaEmiColor); + } + } + + if (ShaderName != "Universal Render Pipeline/Unlit" || ShaderName != "Universal Render Pipeline/Baked Lit") + { + if (ShaSpecHighEn == 1 || ShaSpecHighEn == 0 && ShaderName == "Universal Render Pipeline/Simple Lit") + { + if (ShaSmooth >= 0.5) + { + m.EnableKeyword("N_F_GLO_ON"); + m.SetFloat("_N_F_GLO", 1.0f); + m.SetFloat("_Glossiness", 0.6f); + } + + if ((ShaWorFloMod == 0 && ShaderName != "Universal Render Pipeline/Simple Lit") || ShaderName == "Universal Render Pipeline/Simple Lit") + { + if (ShaSpecMap != null) + { + m.SetTexture("_MaskGloss", ShaSpecMap); + } + else + { + m.SetColor("_GlossColor", ShaSpecCol * ShaSpecCol); + } + } + else if ((ShaWorFloMod == 1 && ShaderName != "Universal Render Pipeline/Simple Lit")) + { + if (ShaMetaMap != null) + { + m.SetTexture("_MaskGloss", ShaMetaMap); + } + } + } + } + + if (ShaderName != "Universal Render Pipeline/Unlit" || ShaderName != "Universal Render Pipeline/Baked Lit") + { + if (ShaWorFloMod == 1 && ShaderName != "Universal Render Pipeline/Simple Lit") + { + if (ShaRefEn == 1.0f) + { + if (ShaMetal != 0.0f && ShaMetaMap == null) + { + m.EnableKeyword("N_F_R_ON"); + m.SetFloat("_N_F_R", 1.0f); + m.SetFloat("_ReflectionIntensity", ShaMetal); + m.SetFloat("_ReflectionRoughtness", 1.0f - ShaSmooth); + m.SetFloat("_RefMetallic", 0.65f); + } + else if (ShaMetaMap != null) + { + m.EnableKeyword("N_F_R_ON"); + m.SetFloat("_N_F_R", 1.0f); + m.SetFloat("_ReflectionIntensity", 1f); + m.SetFloat("_ReflectionRoughtness", 1.0f - ShaSmooth); + m.SetTexture("_MaskReflection", ShaMetaMap); + m.SetFloat("_RefMetallic", 0.65f); + } + } + } + + } + + if (ShaderName == "Universal Render Pipeline/Baked Lit") + { + m.EnableKeyword("N_F_OFLMB_ON"); + m.SetFloat("_N_F_OFLMB", 1.0f); + + m.DisableKeyword("N_F_EAL_ON"); + m.SetFloat("_N_F_EAL", 0.0f); + + m.EnableKeyword("N_F_USETLB_ON"); + m.SetFloat("_UseTLB", 1.0f); + + m.EnableKeyword("N_F_HDLS_ON"); + m.SetFloat("_N_F_HDLS", 1.0f); + + m.EnableKeyword("N_F_HPSS_ON"); + m.SetFloat("_N_F_HPSS", 1.0f); + + m.DisableKeyword("N_F_SS_ON"); + m.SetFloat("_N_F_SS", 0.0f); + + m.SetFloat("_GIShadeThreshold", 1.0f); + } + + if (ShaderName == "Universal Render Pipeline/Unlit") + { + m.EnableKeyword("N_F_SL_ON"); + m.SetFloat("_N_F_SL", 1.0f); + m.SetFloat("_SelfLitPower", 0.3f); + m.SetFloat("_SelfLitIntensity", 1.0f); + + m.DisableKeyword("N_F_SS_ON"); + m.SetFloat("_N_F_SS", 0.0f); + + m.DisableKeyword("N_F_RELGI_ON"); + m.SetFloat("_RELG", 0.0f); + + m.DisableKeyword("N_F_EAL_ON"); + m.SetFloat("_N_F_EAL", 0.0f); + + m.EnableKeyword("N_F_USETLB_ON"); + m.SetFloat("_UseTLB", 1.0f); + + m.EnableKeyword("N_F_HDLS_ON"); + m.SetFloat("_N_F_HDLS", 1.0f); + + m.EnableKeyword("N_F_HPSS_ON"); + m.SetFloat("_N_F_HPSS", 1.0f); + } + + if (LigAffSha == true) + { + m.SetFloat("_LightAffectShadow", 1.0f); + } + + ShaderName = string.Empty; + InfoString += "\n[Done]\n\n"; + } + + } + + if (UnShaType == "(HDRP)") + { + + if (m.shader.name == "HDRP/Lit" || m.shader.name == "HDRP/LitTessellation") + { + ShaderName = m.shader.name; + ShaMainTex = m.GetTexture("_BaseColorMap"); + ShaColor = m.GetColor("_BaseColor"); + ShaNormalMap = m.GetTexture("_NormalMap"); + ShaNormalScale = m.GetFloat("_NormalScale"); + ShaEmiColor = m.GetColor("_EmissiveColor"); + ShaEmiMap = m.GetTexture("_EmissiveColorMap"); + ShaSmooth = m.GetFloat("_Smoothness"); + MatType = m.GetFloat("_SurfaceType"); + CullingMode = m.GetFloat("_CullMode"); + ShaAlpClip = m.GetFloat("_AlphaCutoffEnable"); + ShaMasMa = m.GetTexture("_MaskMap"); + ShaMetal = m.GetFloat("_Metallic"); + ShaMetaRemMinMax = Mathf.Clamp01(m.GetFloat("_MetallicRemapMin") + m.GetFloat("_MetallicRemapMax")); + ShaSmoRemMinMax = m.GetFloat("_SmoothnessRemapMin") + m.GetFloat("_SmoothnessRemapMax"); + ShaDoubSid = m.GetFloat("_DoubleSidedEnable"); + ShaMatID = m.GetFloat("_MaterialID"); + ShaSpecMap = m.GetTexture("_SpecularColorMap"); + ShaSpecCol = m.GetColor("_SpecularColor"); + } + else if (m.shader.name == "HDRP/Unlit") + { + ShaderName = m.shader.name; + ShaMainTex = m.GetTexture("_MainTex"); + ShaColor = m.GetColor("_Color"); + MatType = m.GetFloat("_SurfaceType"); + CullingMode = m.GetFloat("_CullMode"); + ShaAlpClip = m.GetFloat("_AlphaCutoffEnable"); + ShaDoubSid = m.GetFloat("_DoubleSidedEnable"); + } + else if (m.shader.name != "HDRP/Lit" || m.shader.name != "HDRP/LitTessellation" || m.shader.name != "HDRP/Unlit") + { + InfoString += "The selected '" + m.name + "' material, shader is not supported.\n '" + m.shader.name + "'\n\n" + SupShaHDRP; + } + + if (m.shader.name == "HDRP/Lit" || m.shader.name == "HDRP/LitTessellation" || m.shader.name == "HDRP/Unlit") + { + if (ShaRTHDRP) + { + m.shader = ShaRTHDRP; + } + + InfoString += "Processing Material: " + m.name + "\nPrevious Shader: " + ShaderName; + + if (ShaMainTex != null) + { + m.SetTexture("_MainTex", ShaMainTex); + } + + if (ShaderName != "HDRP/Unlit") + { + m.SetColor("_OverallShadowColor", new Color(0.2f, 0.2f, 0.2f)); + } + + m.SetFloat("_OutlineWidth", 0.12f); + + if (MatType == 1.0f) + { + m.SetInt("_BleModSour", 5); + m.SetInt("_BleModDest", 10); + + m.EnableKeyword("N_F_TRANS_ON"); + m.SetFloat("_TRANSMODE", 1.0f); + + m.renderQueue = 3000; + m.SetOverrideTag("RenderType", "Transparent"); + + m.SetFloat("_Opacity", ShaColor.a); + + if ((m.IsKeywordEnabled("N_F_R_ON") && (m.IsKeywordEnabled("N_F_ESSR_ON") || m.GetFloat("_N_F_ESSR") == 1.0f)) || ((m.IsKeywordEnabled("N_F_ESSGI_ON") || m.GetFloat("_N_F_ESSGI") == 1.0f))) + { + m.SetInt("_SSRefDeOn", 0); + m.SetInt("_SSRefGBu", 2); + m.SetInt("_SSRefMoVe", 32); + } + + m.SetInt("_ZTeForLiOpa", 4); + } + + if (ShaAlpClip == 1.0f) + { + m.SetInt("_BleModSour", 5); + m.SetInt("_BleModDest", 10); + + m.EnableKeyword("N_F_TRANS_ON"); + m.SetFloat("_TRANSMODE", 1.0f); + + m.EnableKeyword("N_F_CO_ON"); + m.SetFloat("_N_F_CO", 1.0f); + m.SetFloat("_Cutout", 0.51f); + m.renderQueue = 2450; + + m.SetOverrideTag("RenderType", "TransparentCutout"); + + if ((m.IsKeywordEnabled("N_F_R_ON") && (m.IsKeywordEnabled("N_F_ESSR_ON") || m.GetFloat("_N_F_ESSR") == 1.0f)) || ((m.IsKeywordEnabled("N_F_ESSGI_ON") || m.GetFloat("_N_F_ESSGI") == 1.0f))) + { + m.SetInt("_SSRefDeOn", 8); + m.SetInt("_SSRefGBu", 10); + m.SetInt("_SSRefMoVe", 40); + } + + m.SetInt("_ZTeForLiOpa", 3); + } + + if (ShaderName != "HDRP/Unlit") + { + if (ShaNormalMap != null) + { + m.EnableKeyword("N_F_NM_ON"); + m.SetFloat("_N_F_NM", 1.0f); + m.SetTexture("_NormalMap", ShaNormalMap); + m.SetFloat("_NormalMapIntensity", ShaNormalScale); + } + } + + if (ShaColor != Color.white) + { + m.SetColor("_MainColor", ShaColor * ShaColor); + } + + if (ShaDoubSid == 1.0f) + { + m.SetFloat("_Culling", 0); + } + else if (ShaDoubSid == 0.0f) + { + if (CullingMode != 2.0f) + { + m.SetFloat("_Culling", CullingMode); + } + } + + if (ShaderName != "HDRP/Unlit") + { + if (ShaEmiColor != Color.black) + { + m.EnableKeyword("N_F_SL_ON"); + m.SetFloat("_N_F_SL", 1.0f); + m.EnableKeyword("N_F_SLMM_ON"); + m.SetFloat("_N_F_SLMM", 1.0f); + m.SetFloat("_SelfLitPower", 50.0f); + m.SetFloat("_SelfLitIntensity", 1.0f); + + if (ShaEmiMap != null) + { + m.SetTexture("_MaskSelfLit", ShaEmiMap); + } + + m.SetColor("_SelfLitColor", ShaEmiColor * ShaEmiColor); + } + } + + if (ShaderName != "HDRP/Unlit") + { + if (ShaSmooth >= 0.5) + { + m.EnableKeyword("N_F_GLO_ON"); + m.SetFloat("_N_F_GLO", 1.0f); + m.SetFloat("_Glossiness", 0.6f); + } + else + { + m.DisableKeyword("N_F_GLO_ON"); + m.SetFloat("_N_F_GLO", 0.0f); + } + } + + if (ShaderName != "HDRP/Unlit") + { + + if (ShaMatID == 4.0f) + { + if (ShaSpecMap != null) + { + m.SetTexture("_MaskGloss", ShaSpecMap); + } + + m.SetColor("_GlossColor", ShaSpecCol * ShaSpecCol); + } + + if (ShaMasMa != null) + { + m.SetTexture("_MaskGloss", ShaMasMa); + } + + } + + if (ShaderName != "HDRP/Unlit") + { + if (ShaMetal != 0.0f && ShaMasMa == null) + { + m.EnableKeyword("N_F_R_ON"); + m.SetFloat("_N_F_R", 1.0f); + m.SetFloat("_ReflectionIntensity", ShaMetal); + m.SetFloat("_ReflectionRoughtness", ShaSmooth); + m.SetFloat("_RefMetallic", 0.65f); + + if ((m.IsKeywordEnabled("N_F_R_ON") && m.IsKeywordEnabled("N_F_ESSR_ON")) || m.IsKeywordEnabled("N_F_ESSGI_ON")) + { + + m.SetInt("_SSRefDeOn", 8); + m.SetInt("_SSRefGBu", 10); + m.SetInt("_SSRefMoVe", 40); + + } + else if (!m.IsKeywordEnabled("N_F_R_ON")) + { + m.SetInt("_SSRefDeOn", 0); + m.SetInt("_SSRefGBu", 2); + m.SetInt("_SSRefMoVe", 32); + } + + if (m.IsKeywordEnabled("N_F_TRANS_ON") && !m.IsKeywordEnabled("N_F_CO_ON")) + { + m.SetInt("_SSRefDeOn", 0); + m.SetInt("_SSRefGBu", 2); + m.SetInt("_SSRefMoVe", 32); + } + + } + else if (ShaMasMa != null) + { + ShaSmooth = ShaSmoRemMinMax; + m.EnableKeyword("N_F_R_ON"); + m.SetFloat("_N_F_R", 1.0f); + m.SetFloat("_ReflectionIntensity", ShaMetaRemMinMax); + m.SetFloat("_ReflectionRoughtness", ShaSmooth); + m.SetTexture("_MaskReflection", ShaMasMa); + m.SetFloat("_RefMetallic", 0.65f); + + if ((m.IsKeywordEnabled("N_F_R_ON") && m.IsKeywordEnabled("N_F_ESSR_ON")) || m.IsKeywordEnabled("N_F_ESSGI_ON")) + { + + m.SetInt("_SSRefDeOn", 8); + m.SetInt("_SSRefGBu", 10); + m.SetInt("_SSRefMoVe", 40); + + } + else if (!m.IsKeywordEnabled("N_F_R_ON")) + { + m.SetInt("_SSRefDeOn", 0); + m.SetInt("_SSRefGBu", 2); + m.SetInt("_SSRefMoVe", 32); + } + + if (m.IsKeywordEnabled("N_F_TRANS_ON") && !m.IsKeywordEnabled("N_F_CO_ON")) + { + m.SetInt("_SSRefDeOn", 0); + m.SetInt("_SSRefGBu", 2); + m.SetInt("_SSRefMoVe", 32); + } + } + } + + if (ShaderName == "HDRP/Unlit") + { + m.EnableKeyword("N_F_SL_ON"); + m.SetFloat("_N_F_SL", 1.0f); + m.SetFloat("_SelfLitPower", 6.5f); + m.SetFloat("_SelfLitIntensity", 1.0f); + m.SetFloat("_SelfLitHighContrast", 0.0f); + + m.DisableKeyword("N_F_SS_ON"); + m.SetFloat("_N_F_SS", 0.0f); + + m.DisableKeyword("N_F_RELGI_ON"); + m.SetFloat("_RELG", 0.0f); + + m.DisableKeyword("N_F_PAL_ON"); + m.SetFloat("_N_F_PAL", 0.0f); + + m.EnableKeyword("N_F_USETLB_ON"); + m.SetFloat("_UseTLB", 1.0f); + + m.EnableKeyword("N_F_HDLS_ON"); + m.SetFloat("_N_F_HDLS", 1.0f); + + m.EnableKeyword("N_F_HPSAS_ON"); + m.SetFloat("_N_F_HPSAS", 1.0f); + } + + if (LigAffSha == true) + { + m.SetFloat("_LightAffectShadow", 1.0f); + } + + ShaderName = string.Empty; + InfoString += "\n[Done]\n\n"; + } + + } + + if (UnShaType == "(Built-In)") + { + + if (m.shader.name == "Standard" || m.shader.name == "Standard (Specular setup)") + { + ShaderName = m.shader.name; + ShaMainTex = m.GetTexture("_MainTex"); + ShaColor = m.GetColor("_Color"); + ShaNormalMap = m.GetTexture("_BumpMap"); + ShaNormalScale = m.GetFloat("_BumpScale"); + ShaEmiColor = m.GetColor("_EmissionColor"); + ShaEmiMap = m.GetTexture("_EmissionMap"); + ShaSmooth = m.GetFloat("_Glossiness"); + MatType = m.GetFloat("_Mode"); + SKEmi = m.IsKeywordEnabled("_EMISSION"); + ShaSpecHighEn = m.GetFloat("_SpecularHighlights"); + ShaRefEn = m.GetFloat("_GlossyReflections"); + + if (m.HasProperty("_SpecGlossMap")) + { + ShaSpecMap = m.GetTexture("_SpecGlossMap"); + } + + if (m.HasProperty("_Metallic")) + { + ShaMetal = m.GetFloat("_Metallic"); + } + + if (m.HasProperty("_MetallicGlossMap")) + { + ShaMetaMap = m.GetTexture("_MetallicGlossMap"); + } + + if (m.HasProperty("_SpecColor")) + { + ShaSpecCol = m.GetColor("_SpecColor"); + } + } + else if (m.shader.name == "Unlit/Color" || m.shader.name == "Unlit/Texture" || m.shader.name == "Unlit/Transparent" || m.shader.name == "Unlit/Transparent Cutout") + { + ShaderName = m.shader.name; + + if (m.HasProperty("_MainTex")) + { + ShaMainTex = m.GetTexture("_MainTex"); + } + + if (m.shader.name == "Unlit/Color") + { + ShaColor = m.GetColor("_Color"); + } + } + else if (m.shader.name != "Standard" || m.shader.name != "Standard (Specular setup)" || m.shader.name != "Unlit/Color" || m.shader.name != "Unlit/Texture" || m.shader.name != "Unlit/Transparent" || m.shader.name != "Unlit/Transparent Cutout") + { + InfoString += "The selected '" + m.name + "' material, shader is not supported.\n '" + m.shader.name + "'\n\n" + SupShaBiRP; + } + + if (m.shader.name == "Standard" || m.shader.name == "Standard (Specular setup)" || m.shader.name == "Unlit/Color" || m.shader.name == "Unlit/Texture" || m.shader.name == "Unlit/Transparent" || m.shader.name == "Unlit/Transparent Cutout") + { + InfoString += "Processing Material: " + m.name + "\nPrevious Shader: " + ShaderName; + } + + if (m.shader.name == "Standard" || m.shader.name == "Standard (Specular setup)") + { + + if (MatType == 0.0f || MatType == 1.0f) + { + m.shader = ShaRTBID; + } + else if (MatType == 2.0f || MatType == 3.0f) + { + m.shader = ShaRTBIFT; + m.SetFloat("_Opacity", ShaColor.a); + } + + m.SetFloat("_OutlineWidth", 0.2f); + + if (MatType == 1.0f) + { + m.EnableKeyword("N_F_CO_ON"); + m.SetFloat("_N_F_CO", 1.0f); + m.SetFloat("_Cutout", 0.4f); + } + + if (ShaMainTex != null) + { + m.SetTexture("_MainTex", ShaMainTex); + } + + m.SetColor("_OverallShadowColor", new Color(0.2f, 0.2f, 0.2f)); + + if (ShaNormalMap != null) + { + m.EnableKeyword("N_F_NM_ON"); + m.SetFloat("_N_F_NM", 1.0f); + m.SetTexture("_NormalMap", ShaNormalMap); + m.SetFloat("_NormalMapIntensity", ShaNormalScale); + } + + if (ShaColor != Color.white) + { + m.SetColor("_MainColor", ShaColor); + } + + if (SKEmi) + { + m.EnableKeyword("N_F_SL_ON"); + m.SetFloat("_N_F_SL", 1.0f); + m.EnableKeyword("N_F_SLMM_ON"); + m.SetFloat("_N_F_SLMM", 1.0f); + m.SetFloat("_SelfLitPower", 10.0f); + m.SetFloat("_SelfLitIntensity", 1.0f); + m.SetTexture("_MaskSelfLit", ShaEmiMap); + m.SetColor("_SelfLitColor", ShaEmiColor); + } + + if (ShaSpecHighEn == 1.0f) + { + if (ShaSmooth >= 0.5) + { + m.EnableKeyword("N_F_GLO_ON"); + m.SetFloat("_N_F_GLO", 1.0f); + m.SetFloat("_Glossiness", 0.6f); + } + else + { + m.DisableKeyword("N_F_GLO_ON"); + m.SetFloat("_N_F_GLO", 0.0f); + } + } + + if (ShaderName == "Standard (Specular setup)") + { + if (ShaSpecMap != null) + { + m.SetTexture("_MaskGloss", ShaSpecMap); + } + else + { + if (ShaSpecHighEn == 1.0f) + { + m.SetColor("_GlossColor", ShaSpecCol * ShaSpecCol); + } + } + } + + if (ShaderName == "Standard") + { + if (ShaRefEn == 1.0f) + { + if (ShaMetal != 0.0f && ShaMetaMap == null) + { + m.EnableKeyword("N_F_R_ON"); + m.SetFloat("_N_F_R", 1.0f); + m.SetFloat("_ReflectionIntensity", ShaMetal); + m.SetFloat("_ReflectionRoughtness", 1.0f - ShaSmooth); + m.SetFloat("_RefMetallic", 0.65f); + } + else if (ShaMetaMap != null) + { + m.EnableKeyword("N_F_R_ON"); + m.SetFloat("_N_F_R", 1.0f); + m.SetFloat("_ReflectionIntensity", 1f); + m.SetFloat("_ReflectionRoughtness", 1.0f - ShaSmooth); + m.SetTexture("_MaskReflection", ShaMetaMap); + m.SetFloat("_RefMetallic", 0.65f); + } + } + } + + ShaderName = string.Empty; + InfoString += "\n[Done]\n\n"; + + } + + if (m.shader.name == "Unlit/Color" || m.shader.name == "Unlit/Texture" || m.shader.name == "Unlit/Transparent" || m.shader.name == "Unlit/Transparent Cutout") + { + + if (m.shader.name == "Unlit/Color" || m.shader.name == "Unlit/Texture" || m.shader.name == "Unlit/Transparent Cutout") + { + m.shader = ShaRTBID; + } + else if (m.shader.name == "Unlit/Transparent") + { + m.shader = ShaRTBIFT; + } + + m.EnableKeyword("N_F_SL_ON"); + m.SetFloat("_N_F_SL", 1.0f); + m.SetFloat("_SelfLitPower", 10); + m.SetFloat("_SelfLitIntensity", 1.0f); + + m.DisableKeyword("N_F_SS_ON"); + m.SetFloat("_N_F_SS", 0.0f); + + m.DisableKeyword("N_F_RELGI_ON"); + m.SetFloat("_RELG", 0.0f); + + if (m.shader.name != "Unlit/Transparent") + { + m.EnableKeyword("N_F_HDLS_ON"); + m.SetFloat("_N_F_HDLS", 1.0f); + + m.EnableKeyword("N_F_HPSS_ON"); + m.SetFloat("_N_F_HPSS", 1.0f); + } + + if (m.shader.name != "Unlit/Texture" || m.shader.name != "Unlit/Transparent" || m.shader.name != "Unlit/Transparent Cutout") + { + m.SetColor("_MainColor", ShaColor); + } + + if (m.shader.name == "Unlit/Texture" || m.shader.name == "Unlit/Transparent" || m.shader.name == "Unlit/Transparent Cutout") + { + if (ShaMainTex != null) + { + m.SetTexture("_MainTex", ShaMainTex); + } + } + + if (m.shader.name == "Unlit/Transparent Cutout") + { + m.EnableKeyword("N_F_CO_ON"); + m.SetFloat("_N_F_CO", 1.0f); + m.SetFloat("_Cutout", 0.4f); + } + + if (LigAffSha == true) + { + m.SetFloat("_LightAffectShadow", 1.0f); + } + + ShaderName = string.Empty; + InfoString += "\n[Done]\n\n"; + + } + + } + + } + + MatNum++; + } + + } + + } + EditorGUI.EndDisabledGroup(); + #endregion + + EditorGUILayout.BeginHorizontal(); + GUILayout.FlexibleSpace(); + GUILayout.Label("Material: " + "[" + MatNum + ": " + ProcMat + "]"); + GUILayout.FlexibleSpace(); + EditorGUILayout.EndHorizontal(); + + #region Other Settings + + if (ToBaInt == 0) + { + GUILayout.Space(10); + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + EditorGUILayout.BeginHorizontal(); + + EditorGUILayout.BeginVertical(); + + FUL = GUILayout.Toggle(FUL, new GUIContent("Force Unlit", "This will disable all lighting and shadows,\nOnly Main Texture and Main Color are set.")); + ForTrasCuto = GUILayout.Toggle(ForTrasCuto, "Force Transparent Material to Cutout"); + + EditorGUI.BeginDisabledGroup(FUL == true); + + EditorGUI.BeginDisabledGroup(ShaRTBID && PlayerSettings.colorSpace == ColorSpace.Gamma); + EnhaHiLighColInt = GUILayout.Toggle(EnhaHiLighColInt, new GUIContent("Enhance Light Highlight Color Intensity", "Not available if project color space is Gamma.")); + EditorGUI.EndDisabledGroup(); + + IncShaCol = GUILayout.Toggle(IncShaCol, "Include Shade/Shadow Color"); + LigAffSha = GUILayout.Toggle(LigAffSha, new GUIContent("Light Affect Shadows", "Light's intensity and color will affect shadows.\nIf not enabled, The light will not affect the shadow and it will prevent overexpose shadow color when there are more lights on the scene and high intensity light value.")); + DisRecSha = GUILayout.Toggle(DisRecSha, new GUIContent("Disable Received Shadows", "This will disable received shadows from other objects including received self cast shadows.")); + + EditorGUI.BeginDisabledGroup(UsEmiMapAnColAsGloTex == true); + IncEmi = GUILayout.Toggle(IncEmi, "Include Emission"); + EditorGUI.EndDisabledGroup(); + + EditorGUI.BeginDisabledGroup(IncEmi == true); + UsEmiMapAnColAsGloTex = GUILayout.Toggle(UsEmiMapAnColAsGloTex, new GUIContent("Use Emission Map And Color As Gloss", "Mostly useful for hair materials.\nThis will use the VRoid Emission map as a gloss and use the selected Emission color.")); + EditorGUI.EndDisabledGroup(); + + FERL = GUILayout.Toggle(FERL, "Force Enable Rim Light And Use White Color"); + + EditorGUILayout.BeginHorizontal(); + EnaGiSha = GUILayout.Toggle(EnaGiSha, "Enable Global Illumination Shade"); + + EditorGUI.BeginDisabledGroup(EnaGiSha == false); + GiFlaLo = GUILayout.Toggle(GiFlaLo, new GUIContent("Global Illumination Flat Shade", "This will make the Global Illumination shade into flat/cel shade.")); + EditorGUI.EndDisabledGroup(); + + EditorGUILayout.EndHorizontal(); + + EditorGUI.EndDisabledGroup(); + + EditorGUILayout.EndVertical(); + + EditorGUILayout.EndHorizontal(); + } + else if (ToBaInt == 1) + { + GUILayout.Space(10); + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + EditorGUILayout.BeginHorizontal(); + GUILayout.Space(135); + LigAffSha = GUILayout.Toggle(LigAffSha, new GUIContent("Light Affect Shadows", "Light's intensity and color will affect shadows.\nIf not enabled, The light will not affect the shadow,\nthis will also prevent overexpose shadow color when there are more lights on the scene.")); + EditorGUILayout.EndHorizontal(); + } + + #endregion + + #region Info + + GUILayout.Space(10); + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + GUILayout.Label("Info:"); + + EditorGUILayout.BeginVertical("TextArea", GUILayout.Height(90)); + scroll = EditorGUILayout.BeginScrollView(scroll, GUILayout.Height(120)); + GUILayout.TextArea(InfoString); + EditorGUILayout.EndScrollView(); + EditorGUILayout.EndVertical(); + + GUILayout.Space(10); + GUILayout.Label(mat.Length.ToString() + " Selected Materials."); + + GUILayout.Space(10); + EditorGUILayout.LabelField("", GUI.skin.horizontalSlider); + + GUILayout.Label("Note:"); + GUILayout.Label("*This tool supports RealToon Built-In, URP and HDRP shaders.\n" + + "*Supported Unity Shader to swap are Built-In, URP and HDRP shaders.\n" + + "*Read the included documentation/user guide for more info.\n" + + "*After the swap, click the 'Refresh Settings' on the RealToon Inspector.\n" + + " -This will refresh and re-apply the settings properly. (URP/HDRP)"); + + #endregion + } + + } + +} diff --git a/Assets/RealToon/Editor/SwapShaderToRealToon.cs.meta b/Assets/RealToon/Editor/SwapShaderToRealToon.cs.meta new file mode 100644 index 00000000..72638f87 --- /dev/null +++ b/Assets/RealToon/Editor/SwapShaderToRealToon.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: b5506465586dd18499b022aff98e6ac8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 65518 + packageName: RealToon (Pro Anime/Toon Shader) + packageVersion: 5.0.15 + assetPath: Assets/RealToon/Editor/SwapShaderToRealToon.cs + uploadId: 889742 diff --git a/Assets/RealToon/RealToon Shaders.meta b/Assets/RealToon/RealToon Shaders.meta new file mode 100644 index 00000000..dfd33c8d --- /dev/null +++ b/Assets/RealToon/RealToon Shaders.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5567ed13b0ed8f046b81c52a4a05ad8f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/RealToon/RealToon Shaders/RealToon Core.meta b/Assets/RealToon/RealToon Shaders/RealToon Core.meta new file mode 100644 index 00000000..38af2c06 --- /dev/null +++ b/Assets/RealToon/RealToon Shaders/RealToon Core.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0c64e66eb1c702f49813ad06fb0a6acb +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/RealToon/RealToon Shaders/RealToon Core/URP.meta b/Assets/RealToon/RealToon Shaders/RealToon Core/URP.meta new file mode 100644 index 00000000..70b9709e --- /dev/null +++ b/Assets/RealToon/RealToon Shaders/RealToon Core/URP.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ae8be2263fbf94b48ba7f555b52bb048 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/RealToon/RealToon Shaders/RealToon Core/URP/Pass.meta b/Assets/RealToon/RealToon Shaders/RealToon Core/URP/Pass.meta new file mode 100644 index 00000000..04a0862a --- /dev/null +++ b/Assets/RealToon/RealToon Shaders/RealToon Core/URP/Pass.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 86e3c4b5127e1aa418aa3fe97bc9017e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/RealToon/RealToon Shaders/RealToon Core/URP/Pass/RT_URP_MoVecPas.hlsl b/Assets/RealToon/RealToon Shaders/RealToon Core/URP/Pass/RT_URP_MoVecPas.hlsl new file mode 100644 index 00000000..a43f2a69 --- /dev/null +++ b/Assets/RealToon/RealToon Shaders/RealToon Core/URP/Pass/RT_URP_MoVecPas.hlsl @@ -0,0 +1,148 @@ +//RealToon URP - MoVecPas +//MJQStudioWorks + +//========================= + +struct Attributes +{ + float4 position : POSITION; + float3 normalOS : NORMAL; + float4 tangentOS : TANGENT; + float2 uv : TEXCOORD0; + float2 uv1 : TEXCOORD1; + float3 positionOld : TEXCOORD4; + #if _ADD_PRECOMPUTED_VELOCITY + float3 alembicMotionVector : TEXCOORD5; + #endif + + #ifndef N_F_DDMD_ON +float4 weights : BLENDWEIGHTS;//DOTS_LiBleSki_MV +uint4 indices : BLENDINDICES;//DOTS_LiBleSki_MV +//uint vertexID : SV_VertexID;//DOTS_CompDef_MV + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID +}; + +struct Varyings +{ + float4 positionCS : SV_POSITION; + float4 positionCSNoJitter : POSITION_CS_NO_JITTER; + float4 previousPositionCSNoJitter : PREV_POSITION_CS_NO_JITTER; + float2 uv : TEXCOORD0; + float3 positionWS : TEXCOORD1; + float3 normalWS : TEXCOORD2; + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO +}; + +Varyings vert(Attributes input) +{ + Varyings output = (Varyings)0; + + UNITY_SETUP_INSTANCE_ID(input); + UNITY_TRANSFER_INSTANCE_ID(input, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + + #if defined(UNITY_DOTS_INSTANCING_ENABLED) + + #ifdef N_F_DDMD_ON + + float4 _LBS_CD_Position = input.position; + float3 _LBS_CD_Normal = input.normalOS; + //float4 _LBS_CD_Tangent = input.tangentOS; //not currently needed + + #else + + float4 _LBS_CD_Position = 0; + float3 _LBS_CD_Normal = 0; + float4 _LBS_CD_Tangent = 0; + +DOTS_LiBleSki(input.indices, input.weights, input.position.xyz, input.normalOS.xyz, input.tangentOS.xyz, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_LiBleSki_MV +//DOTS_CompDef(input.vertexID, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_CompDef_MV + _LBS_CD_Position.w = 1.0; + + #endif + + #else + float4 _LBS_CD_Position = input.position; + float3 _LBS_CD_Normal = input.normalOS; + //float4 _LBS_CD_Tangent = input.tangentOS; //not currently needed + #endif + + + const VertexPositionInputs vertexInput = GetVertexPositionInputs(_LBS_CD_Position.xyz); + + //RT_SE + #if N_F_SE_ON + input.position = RT_SE(vertexInput.positionWS, input.position); + _LBS_CD_Position = input.position; + #endif + //== + + + //RT_PA + #if N_F_PA_ON + output.positionCS = mul(RT_PA(-vertexInput.positionVS.z), float4(_LBS_CD_Position.xyz,1.0) ) + (float4(0,0,_ObjePosiZCS,0.0) * 0.0001); + #else + output.positionCS = vertexInput.positionCS + (float4(0, 0, _ObjePosiZCS, 0.0) * 0.0001); + #endif + //== + + + #if _UVSET_UV0 + output.uv = TRANSFORM_TEX(input.uv, _MainTex); + #elif _UVSET_UV1 + output.uv = TRANSFORM_TEX(input.uv1, _MainTex); + #endif + + output.positionWS = TransformObjectToWorld(_LBS_CD_Position.xyz); + output.normalWS = TransformObjectToWorldDir(_LBS_CD_Normal); + output.positionCSNoJitter = mul(_NonJitteredViewProjMatrix, mul(UNITY_MATRIX_M, _LBS_CD_Position)); + + float4 prevPos = (unity_MotionVectorsParams.x == 1) ? float4(input.positionOld, 1) : _LBS_CD_Position; + #if _ADD_PRECOMPUTED_VELOCITY + prevPos = prevPos - float4(input.alembicMotionVector, 0); + #endif + + output.previousPositionCSNoJitter = mul(_PrevViewProjMatrix, mul(UNITY_PREV_MATRIX_M, prevPos)); + + ApplyMotionVectorZBias(output.positionCS); + + return output; +} + +float4 frag(Varyings input) : SV_Target +{ + UNITY_SETUP_INSTANCE_ID(input); + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input); + + #if N_F_TP_ON + half4 _MainTex_var = RT_Tripl_Default(_MainTex, sampler_MainTex, input.positionWS, input.normalWS); + #else + half4 _MainTex_var = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, TRANSFORM_TEX(input.uv, _MainTex)); + #endif + + + //RT_CO + RT_CO(input.uv, _MainTex_var, _MainTex_var.a, input.positionWS, input.normalWS, input.positionCS.xy); + //== + + + //RT_NFD + #if N_F_NFD_ON + RT_NFD(input.positionCS.xy); + #endif + //== + + + #if defined(LOD_FADE_CROSSFADE) + LODFadeCrossFade(input.positionCS); + #endif + + return float4(CalcNdcMotionVectorFromCsPositions(input.positionCSNoJitter, input.previousPositionCSNoJitter), 0, 0); +} + +// \ No newline at end of file diff --git a/Assets/RealToon/RealToon Shaders/RealToon Core/URP/Pass/RT_URP_MoVecPas.hlsl.meta b/Assets/RealToon/RealToon Shaders/RealToon Core/URP/Pass/RT_URP_MoVecPas.hlsl.meta new file mode 100644 index 00000000..318580db --- /dev/null +++ b/Assets/RealToon/RealToon Shaders/RealToon Core/URP/Pass/RT_URP_MoVecPas.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 13d5ac7414ba40c4a95664ea1aa48e50 +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/RealToon/RealToon Shaders/RealToon Core/URP/RT_URP_Core.hlsl b/Assets/RealToon/RealToon Shaders/RealToon Core/URP/RT_URP_Core.hlsl new file mode 100644 index 00000000..41c6931b --- /dev/null +++ b/Assets/RealToon/RealToon Shaders/RealToon Core/URP/RT_URP_Core.hlsl @@ -0,0 +1,1560 @@ +//RealToon URP - Core +//MJQStudioWorks + +//========================= + +#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" +#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareDepthTexture.hlsl" +#include "Assets/RealToon/RealToon Shaders/RealToon Core/URP/RT_URP_PROP.hlsl" + +half RTD_LVLC_F(float3 Light_Color_f3) +{ + #ifdef SHADER_API_MOBILE + + return saturate(dot(Light_Color_f3.rgb, float3(0.3, 0.59, 0.11))); + + #else + + float4 node_3149_k = float4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); + float4 node_3149_p = lerp(float4(float4(Light_Color_f3.rgb, 0.0).zy, node_3149_k.wz), float4(float4(Light_Color_f3.rgb, 0.0).yz, node_3149_k.xy), step(float4(Light_Color_f3.rgb, 0.0).z, float4(Light_Color_f3.rgb, 0.0).y)); + float4 node_3149_q = lerp(float4(node_3149_p.xyw, float4(Light_Color_f3.rgb, 0.0).x), float4(float4(Light_Color_f3.rgb, 0.0).x, node_3149_p.yzx), step(node_3149_p.x, float4(Light_Color_f3.rgb, 0.0).x)); + float node_3149_d = node_3149_q.x - min(node_3149_q.w, node_3149_q.y); + float node_3149_e = 1.0e-10; + half3 node_3149 = float3(abs(node_3149_q.z + (node_3149_q.w - node_3149_q.y) / (6.0 * node_3149_d + node_3149_e)), node_3149_d / (node_3149_q.x + node_3149_e), node_3149_q.x); + + return saturate(node_3149.b); + + #endif +} + +half3 AL_GI(float3 N) +{ + + return SampleSH(N); + +} + +float2 PixPos(float2 positionCS) +{ + #if UNITY_UV_STARTS_AT_TOP + return float2(positionCS.x, (_ProjectionParams.x < 0) ? (_ScreenParams.y - positionCS.y) : positionCS.y); + #else + return float2(positionCS.x, (_ProjectionParams.x > 0) ? (_ScreenParams.y - positionCS.y) : positionCS.y); + #endif +} + +//RT_Tripl_Default +half4 RT_Tripl_Default(TEXTURE2D_PARAM(tex, samp), float3 positionWS, float3 normalWS) +{ + float3 UV = positionWS * _TriPlaTile; + + float3 Blend = pow(abs(normalWS), _TriPlaBlend); + Blend /= dot(Blend, 1.0); + + float4 X = SAMPLE_TEXTURE2D_LOD(tex, samp, UV.zy, 0.0); + float4 Y = SAMPLE_TEXTURE2D_LOD(tex, samp, UV.xz, 0.0); + float4 Z = SAMPLE_TEXTURE2D_LOD(tex, samp, UV.xy, 0.0); + + return X * Blend.x + Y * Blend.y + Z * Blend.z; +} + +//Dither_Setup +void Dither_Float(float In, float4 ScreenPosition, out float Out) +{ + float2 uv = ScreenPosition.xy * _ScreenParams.xy; + float DITHER_THRESHOLDS[16] = + { + 1.0 / 17.0, 9.0 / 17.0, 3.0 / 17.0, 11.0 / 17.0, + 13.0 / 17.0, 5.0 / 17.0, 15.0 / 17.0, 7.0 / 17.0, + 4.0 / 17.0, 12.0 / 17.0, 2.0 / 17.0, 10.0 / 17.0, + 16.0 / 17.0, 8.0 / 17.0, 14.0 / 17.0, 6.0 / 17.0, + }; + uint index = (uint(uv.x) % 4) * 4 + uint(uv.y) % 4; + + Out = In - DITHER_THRESHOLDS[index]; +} + +//Dither_Out +float RT_Dither_Out(float2 positionCS) +{ + float2 PixelPositions = PixPos(positionCS); + + float2 NDCPositions; + NDCPositions = PixelPositions.xy / _ScreenParams.xy; + NDCPositions.y = 1.0f - NDCPositions.y; + + float dither_out; + Dither_Float(1, float4(NDCPositions.xy, 0, 0), dither_out); + return dither_out; +} + +//RT_ViewVecWorl +float3 RT_ViewVecWorl(float3 WorldSpacePosition) +{ + float3 sub = _WorldSpaceCameraPos.xyz - GetAbsolutePositionWS(WorldSpacePosition); + if (!IsPerspectiveProjection()) + { + sub = GetViewForwardDir() * dot(sub, GetViewForwardDir()); + } + + return sub; +} + +//RT_Anis_Shift +float3 RTShifTan(float3 bitangentWS, float3 normalDirection, float NoiTex) +{ + float3 ShifTan = bitangentWS + NoiTex * normalDirection; + return normalize(ShifTan); +} + +//RT_Anis_Stra +float StraSpec(float3 bitangentWS, float3 viewDirection, float3 halfDirection, float StraPow) +{ + float3 H = lerp(viewDirection, halfDirection, _GlossTextureFollowLight); + float dotTH = dot(bitangentWS, H); + float sinTH = sqrt(1 - dotTH * dotTH); + float dirAtten = smoothstep(-1, 0, dotTH); + return dirAtten * pow(sinTH, StraPow); +} + +//========================= + + +//EdgDet/SSOL +float EdgDet(float2 uv) +{ + + float2 _ScreenSize = (1.0) / float2(1920, 1080); + + float halfScaleFloor = floor(_OutlineWidth * 0.5); + float halfScaleCeil = ceil(_OutlineWidth * 0.5); + + float2 bottomLeftUV = uv - float2(_ScreenSize.x, _ScreenSize.y) * halfScaleFloor; + float2 topRightUV = uv + float2(_ScreenSize.x, _ScreenSize.y) * halfScaleCeil; + float2 bottomRightUV = uv + float2(_ScreenSize.x * halfScaleCeil, -_ScreenSize.y * halfScaleFloor); + float2 topLeftUV = uv + float2(-_ScreenSize.x * halfScaleFloor, _ScreenSize.y * halfScaleCeil); + + float depth0 = SampleSceneDepth(bottomLeftUV); + float depth1 = SampleSceneDepth(topRightUV); + float depth2 = SampleSceneDepth(bottomRightUV); + float depth3 = SampleSceneDepth(topLeftUV); + + float depthDerivative0 = depth1 - depth0; + float depthDerivative1 = depth3 - depth2; + + float edgeDepth = sqrt(pow(depthDerivative0, 2.0) + pow(depthDerivative1, 2.0)) * 100; + edgeDepth = (edgeDepth > (depth0 * (_DepthThreshold * 0.01)) ? 1 : 0) - Linear01Depth(SampleSceneDepth(uv), _ZBufferParams); //cc + + #if N_F_CO_ON + return edgeDepth; + #elif !N_F_CO_ON && N_F_TRANS_ON + return 0.0; + #else + return edgeDepth; + #endif + +} + +//DOTS_LinBlenSki +uniform ByteAddressBuffer _SkinMatrices; + +float3x4 LoadSkinMatrix(uint index) +{ + uint offset = index * 48; + float4 p1 = asfloat(_SkinMatrices.Load4(offset + 0 * 16)); + float4 p2 = asfloat(_SkinMatrices.Load4(offset + 1 * 16)); + float4 p3 = asfloat(_SkinMatrices.Load4(offset + 2 * 16)); + return float3x4(p1.x, p1.w, p2.z, p3.y, p1.y, p2.x, p2.w, p3.z, p1.z, p2.y, p3.x, p3.w); +} + +void DOTS_LiBleSki(uint4 indices, float4 weights, float3 positionIn, float3 normalIn, float3 tangentIn, out float3 positionOut, out float3 normalOut, out float3 tangentOut) +{ + positionOut = 0; + normalOut = 0; + tangentOut = 0; + + for (int i = 0; i < 4; ++i) + { + uint skinMatrixIndex = indices[i] + asint(UNITY_ACCESS_HYBRID_INSTANCED_PROP(_SkinMatrixIndex, float)); + float3x4 skinMatrix = LoadSkinMatrix(skinMatrixIndex); + float3 vtransformed = mul(skinMatrix, float4(positionIn, 1)); + float3 ntransformed = mul(skinMatrix, float4(normalIn, 0)); + float3 ttransformed = mul(skinMatrix, float4(tangentIn, 0)); + + positionOut += vtransformed * weights[i]; + normalOut += ntransformed * weights[i]; + tangentOut += ttransformed * weights[i]; + } +} + +//DOTS_Compdef +struct DeformedVertexData +{ + float3 Position; + float3 Normal; + float3 Tangent; +}; + +uniform StructuredBuffer _DeformedMeshData : register(t1); + +void DOTS_CompDef(uint vertexID, out float3 positionOut, out float3 normalOut, out float3 tangentOut) +{ + const DeformedVertexData vertexData = _DeformedMeshData[asuint(UNITY_ACCESS_HYBRID_INSTANCED_PROP(_ComputeMeshIndex, float)) + vertexID]; + positionOut = vertexData.Position; + normalOut = vertexData.Normal; + tangentOut = vertexData.Tangent; +} + +//RT NM +float3 RT_NM(float2 uv, float3 positionWS, float3x3 tangentTransform, float3 normalWS) +{ + #if N_F_NM_ON + + #if N_F_TP_ON + + float3 UV = positionWS * _TriPlaTile; + + float3 Blend = pow(abs(normalWS), _TriPlaBlend); + Blend /= dot(Blend, 1.0); + + float3 X = UnpackNormal(SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, UV.zy)); + float3 Y = UnpackNormal(SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, UV.xz)); + float3 Z = UnpackNormal(SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, UV.xy)); + + float3 _NormalMap_var = X * Blend.x + Y * Blend.y + Z * Blend.z; + + #else + + float3 _NormalMap_var = UnpackNormal( SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap , TRANSFORM_TEX(uv, _NormalMap) ) ); + + #endif + + float3 normalLocal = lerp(float3(0.0,0.0,1.0),_NormalMap_var ,_NormalMapIntensity); + return normalLocal; + + #else + + return float3(0.0,0.0,1.0); + + #endif +} +// + +//RT_MCAP +half3 RT_MCAP(float2 uv, float3 normalDirection) +{ + #if N_F_MC_ON + + half2 MUV = (mul(UNITY_MATRIX_V, float4(normalDirection, 0.0)).xyz.rgb.rg * 0.5 + 0.5); + half4 _MatCap_var = SAMPLE_TEXTURE2D(_MCap, sampler_MCap, TRANSFORM_TEX(MUV, _MCap)); + half4 _MCapMask_var = SAMPLE_TEXTURE2D(_MCapMask, sampler_MCapMask, TRANSFORM_TEX(uv, _MCapMask)); + + half3 RT_SPECMO_OO; + if (!_SPECMODE) + { + RT_SPECMO_OO = (float3)1.0; + } + else + { + RT_SPECMO_OO = (float3)0.0; + } + + float3 MCapOutP = lerp(RT_SPECMO_OO, lerp(RT_SPECMO_OO, _MatCap_var.rgb, _MCapIntensity), _MCapMask_var.rgb); + + return MCapOutP; + + #else + + return (half3)1.0; + + #endif +} +// + +//RT_MCAP_SUB1 +half3 RT_MCAP_SUB1(half3 MCapOutP, half4 _MainTex_var, half3 _RTD_MVCOL, out half3 RTD_TEX_COL) +{ + #if N_F_MC_ON + + half3 RT_SPECMO_OO; + if (!_SPECMODE) + { + RT_SPECMO_OO = (_MainColor.rgb * _MaiColPo) * MCapOutP; + } + else + { + RT_SPECMO_OO = (_MainColor.rgb * _MaiColPo) + (MCapOutP * _SPECIN); + } + + half3 RT_SPECMO_OO_2; + if (!_SPECMODE) + { + RT_SPECMO_OO_2 = MCapOutP; + } + else + { + RT_SPECMO_OO_2 = MCapOutP * _SPECIN; + } + + half3 SPECMode_Sel; + if (!_MCIALO) + { + SPECMode_Sel = RT_SPECMO_OO; + } + else + { + SPECMode_Sel = RT_SPECMO_OO_2; + } + + RTD_TEX_COL = _MainTex_var.rgb * SPECMode_Sel * _RTD_MVCOL; + + half3 RTD_MCIALO_IL = RTD_TEX_COL; + + return RTD_MCIALO_IL; + + #else + + RTD_TEX_COL = _MainTex_var.rgb * (_MainColor.rgb * _MaiColPo) * MCapOutP * _RTD_MVCOL; + + half3 RTD_MCIALO_IL; + if (!_MCIALO) + { + RTD_MCIALO_IL = RTD_TEX_COL; + } + else + { + RTD_MCIALO_IL = _MainTex_var.rgb * MCapOutP * _RTD_MVCOL; + } + + return RTD_MCIALO_IL; + + #endif +} +// + +//RT TRANS CO +void RT_TRANS_CO(float2 uv, half4 _MainTex_var, out half _MainTex_var_a, out half RTD_TRAN_OPA_Sli, half RTD_CO, float3 positionWS, float3 normalDirection, float2 positionCS, inout half3 GLO_OUT) +{ + + RTD_TRAN_OPA_Sli = 1.0; + GLO_OUT = (half3)0.0; + _MainTex_var_a = 1.0; + + #if N_F_TRANS_ON + + #if N_F_CO_ON + + #if N_F_TP_ON + half4 _SecondaryCutout_var = RT_Tripl_Default(_SecondaryCutout, sampler_SecondaryCutout, positionWS, normalDirection); + #else + half4 _SecondaryCutout_var = SAMPLE_TEXTURE2D(_SecondaryCutout, sampler_SecondaryCutout ,TRANSFORM_TEX(uv,_SecondaryCutout)); + #endif + + half RT_USSECCUT_OO; + if (!_UseSecondaryCutout) + { + RT_USSECCUT_OO = _MainTex_var.r * _SecondaryCutout_var.r; + } + else + { + RT_USSECCUT_OO = _SecondaryCutout_var.r; + } + + half RT_USSECCUT_OO_2; + if (!_UseSecondaryCutout) + { + RT_USSECCUT_OO_2 = _MainTex_var.a * _SecondaryCutout_var.r; + } + else + { + RT_USSECCUT_OO_2 = _SecondaryCutout_var.a; + } + + half RTD_CO_ON = (half)lerp((RT_USSECCUT_OO + lerp(0.5, (-1.0), _Cutout)), saturate(((1.0 - _Cutout) > 0.5 ? (1.0 - (1.0 - 2.0 * ((1.0 - _Cutout) - 0.5)) * ( 1.0 - RT_USSECCUT_OO_2)) : (2.0 * (1.0 - _Cutout) * RT_USSECCUT_OO_2))), _AlphaBaseCutout); + RTD_CO = RTD_CO_ON; + + //GLOW + #if N_F_COEDGL_ON + half _Glow_Edge_Width_Val = (1.0 - _Glow_Edge_Width); + half _Glow_Edge_Width_Add_Input_Value = (_Glow_Edge_Width_Val + RTD_CO); + half _Remapping = (_Glow_Edge_Width_Add_Input_Value * 8.0 + -4.0); + half _Pre_Output = (1.0 - saturate(_Remapping)); + half3 _Final_Output = (_Pre_Output * lerp(0.0, _Glow_Color.rgb, saturate(_Cutout * 200.0)) ); + GLO_OUT = _Final_Output; + #endif + + #if N_F_ATC_ON + + #if N_F_SCO_ON + _MainTex_var_a = saturate( ( -( RT_Dither_Out(positionCS) - RTD_CO ) - _Cutout) / max(fwidth(-( RT_Dither_Out(positionCS) - RTD_CO )), 0.0001) + 0.5 ); + #else + _MainTex_var_a = saturate( (RTD_CO - _Cutout) / max(fwidth(RTD_CO), _AAS) + 0.5 ); + #endif + + #else + + #if N_F_SCO_ON + clip( -( RT_Dither_Out(positionCS) - RTD_CO )); + #else + clip(RTD_CO - 0.5); + #endif + + #endif + + #else + + #if N_F_TP_ON + half4 _MaskTransparency_var = RT_Tripl_Default(_MaskTransparency, sampler_MaskTransparency, GetAbsolutePositionWS(positionWS), normalDirection); + #else + half4 _MaskTransparency_var = SAMPLE_TEXTURE2D(_MaskTransparency, sampler_MaskTransparency ,TRANSFORM_TEX(uv,_MaskTransparency)); + #endif + + //Backup (Old) + //half RTD_TRAN_MAS = (smoothstep(clamp(-20.0, 1.0, _TransparentThreshold), 1.0, _MainTex_var.a) * _MaskTransparency_var.r); + //RTD_TRAN_OPA_Sli = lerp(RTD_TRAN_MAS, smoothstep(clamp(-20.0, 1.0, _TransparentThreshold), 1.0, _MainTex_var.a), _Opacity); + + #if N_F_SIMTRANS_ON + RTD_TRAN_OPA_Sli = _MainTex_var.a * _Opacity; //Early Added + #else + RTD_TRAN_OPA_Sli = lerp(smoothstep(clamp(-20.0, 1.0, _TransparentThreshold), 1.0, _MainTex_var.a) * _Opacity, 1.0, _MaskTransparency_var.r); + #endif + + #endif + + #endif + +} +// + +//RT_CO +void RT_CO(float2 uv, half4 _MainTex_var, out half _MainTex_var_a, float3 positionWS, float3 normalDirection, float2 positionCS) +{ + + _MainTex_var_a = 1.0; + + #if N_F_TRANS_ON + + #if N_F_CO_ON + + #if N_F_TP_ON + half4 _SecondaryCutout_var = RT_Tripl_Default(_SecondaryCutout, sampler_SecondaryCutout, GetAbsolutePositionWS(positionWS), normalDirection); + #else + half4 _SecondaryCutout_var = SAMPLE_TEXTURE2D(_SecondaryCutout, sampler_SecondaryCutout ,TRANSFORM_TEX(uv,_SecondaryCutout)); + #endif + + half RT_USSECCUT_OO; + if (!_UseSecondaryCutout) + { + RT_USSECCUT_OO = _MainTex_var.r * _SecondaryCutout_var.r; + } + else + { + RT_USSECCUT_OO = _SecondaryCutout_var.r; + } + + half RT_USSECCUT_OO_2; + if (!_UseSecondaryCutout) + { + RT_USSECCUT_OO_2 = _MainTex_var.a * _SecondaryCutout_var.r; + } + else + { + RT_USSECCUT_OO_2 = _SecondaryCutout_var.a; + } + + half RTD_CO_ON = (half)lerp(( RT_USSECCUT_OO + lerp(0.5, (-1.0), _Cutout)), saturate(((1.0 - _Cutout) > 0.5 ? (1.0 - (1.0 - 2.0 * ((1.0 - _Cutout) - 0.5)) * (1.0 - RT_USSECCUT_OO_2 )) : (2.0 * (1.0 - _Cutout) * RT_USSECCUT_OO_2 ))), _AlphaBaseCutout); + + #if N_F_ATC_ON + + #if N_F_SCO_ON + _MainTex_var_a = saturate( ( -( RT_Dither_Out(positionCS) - RTD_CO_ON ) - _Cutout) / max(fwidth(-( RT_Dither_Out(positionCS) - RTD_CO_ON )), 0.0001) + 0.5 ); + #else + _MainTex_var_a = saturate( (RTD_CO_ON - _Cutout) / max(fwidth(RTD_CO_ON), 0.0001) + 0.5 ); + #endif + + #else + + #if N_F_SCO_ON + clip( -( RT_Dither_Out(positionCS) - RTD_CO_ON )); + #else + clip(RTD_CO_ON - 0.5); + #endif + + #endif + + #endif + + #endif +} +// + +//RT SON +float3 RT_SON(float4 vertexColor, float3 calNorm, float3 normalDirection, out float3 RTD_SON_CHE_1) +{ + + RTD_SON_CHE_1 = float3(1.0, 1.0, 1.0); + + #if N_F_SON_ON + + float RTD_SON_VCBCSON_OO; + if (!_VertexColorRedControlSmoothObjectNormal) + { + RTD_SON_VCBCSON_OO = _SmoothObjectNormal; + } + else + { + RTD_SON_VCBCSON_OO = _SmoothObjectNormal * (1.0 - vertexColor.r); + } + + float3 RTD_SON_ON_OTHERS = lerp(normalDirection, -normalize(_XYZPosition.xyz - calNorm), RTD_SON_VCBCSON_OO); + + float3 RTD_SNorm_OO; + if (!_ShowNormal) + { + RTD_SNorm_OO = (float3)1.0; + } + else + { + RTD_SNorm_OO = smoothstep(0.0, 0.01, RTD_SON_ON_OTHERS); + } + + RTD_SON_CHE_1 = RTD_SNorm_OO; + float3 RTD_SON = RTD_SON_ON_OTHERS; + return RTD_SON; + + #else + + float3 RTD_SON = normalDirection; + return RTD_SON; + + #endif + +} +// + +//RT_RELGI +float3 RT_RELGI( float3 RTD_SON ) +{ + + #if N_F_RELGI_ON + + half3 RTD_GI_ST_Sli = (RTD_SON*_GIShadeThreshold); + + half3 RTD_GI_FS_OO; + if (!_GIFlatShade) + { + RTD_GI_FS_OO = RTD_GI_ST_Sli; + } + else + { + RTD_GI_FS_OO = half3(smoothstep(0.0, 0.01, RTD_SON.r * _GIShadeThreshold), 0.0, smoothstep(0.0, 0.01, RTD_SON.b * _GIShadeThreshold)); + //RTD_GI_FS_OO = half3(smoothstep(float2(0.0, 0.0), float2(0.01, 0.01), (RTD_SON.rb * _GIShadeThreshold)), 0.0); //Old + } + + + return RTD_GI_FS_OO; + + #else + + half3 RTD_GI_FS_OO = RTD_SON; + + return RTD_GI_FS_OO; + + #endif + +} + +//RT_SCT +half3 RT_SCT(float2 uv, float3 positionWS, float3 normalDirection, half3 RTD_MCIALO_IL) +{ + + #ifndef N_F_OFLMB_ON + + #if N_F_SCT_ON + + #if N_F_TP_ON + half4 _ShadowColorTexture_var = RT_Tripl_Default(_ShadowColorTexture, sampler_ShadowColorTexture, positionWS, normalDirection); + #else + half4 _ShadowColorTexture_var = SAMPLE_TEXTURE2D(_ShadowColorTexture, sampler_ShadowColorTexture ,TRANSFORM_TEX(uv,_ShadowColorTexture)); + #endif + + half3 RTD_SCT_ON = lerp(_ShadowColorTexture_var.rgb,(_ShadowColorTexture_var.rgb*_ShadowColorTexture_var.rgb),_ShadowColorTexturePower); + + half3 RT_MCIALO_OO; + if (!_MCIALO) + { + RT_MCIALO_OO = (_MainColor.rgb * _MaiColPo); + } + else + { + RT_MCIALO_OO = (half3)1.0; + } + + half3 RTD_SCT = RTD_SCT_ON * RT_MCIALO_OO; + return RTD_SCT; + + #else + + half3 RTD_SCT = RTD_MCIALO_IL; + return RTD_SCT; + + #endif + + #else + + half3 RTD_SCT = RTD_MCIALO_IL; + return RTD_SCT; + + #endif + +} +// + +//RT_PT +half RT_PT( float2 RTD_VD_Cal , out half3 RTD_PT_COL ) +{ + + RTD_PT_COL = half3(1.0,1.0,1.0); + + #ifndef N_F_OFLMB_ON + + #if N_F_PT_ON + + half4 _PTexture_var = SAMPLE_TEXTURE2D(_PTexture, sampler_PTexture ,TRANSFORM_TEX(RTD_VD_Cal,_PTexture)); + half RTD_PT_ON = lerp((1.0 - _PTexturePower),1.0,_PTexture_var.r); + RTD_PT_COL = _PTCol.rgb; + + half RTD_PT = RTD_PT_ON; + + return RTD_PT; + + #else + + half RTD_PT = 1.0; + + return RTD_PT; + + #endif + + #else + + half RTD_PT = 1.0; + + return RTD_PT; + + #endif +} +// + +//RT_CLD +float3 RT_CLD( float3 lightDirection ) +{ + + #ifndef N_F_OFLMB_ON + + #if N_F_CLD_ON + + float3 RTD_CLD_CLDFOR_OO; + if (!_CustomLightDirectionFollowObjectRotation) + { + RTD_CLD_CLDFOR_OO = _CustomLightDirection.xyz; + } + else + { + RTD_CLD_CLDFOR_OO = mul(unity_ObjectToWorld, float4(_CustomLightDirection.xyz, 0.0)).xyz; + } + + float3 RTD_CLD_CLDI_Sli = lerp(lightDirection,RTD_CLD_CLDFOR_OO,_CustomLightDirectionIntensity); + float3 RTD_CLD = RTD_CLD_CLDI_Sli; + + return RTD_CLD; + + #else + + float3 RTD_CLD = lightDirection; + + return RTD_CLD; + + #endif + + #else + + float3 RTD_CLD = lightDirection; + + return RTD_CLD; + + #endif + +} +// + +//RT_GLO +void RT_GLO(float2 uv, float2 RTD_VD_Cal, float3 halfDirection, float3 bitangentWS, float3 normalDirection, float3 viewDirection, float3 positionWS, out half RTD_GLO, out half3 RTD_GLO_COL) +{ + + #ifndef N_F_OFLMB_ON + + #if N_F_GLO_ON + + #if USE_CLUSTER_LIGHT_LOOP + #if N_F_TP_ON + half4 _MaskGloss_var = RT_Tripl_Default(_MaskGloss, sampler_MaskGloss, positionWS, normalDirection); + #else + half4 _MaskGloss_var = SAMPLE_TEXTURE2D_LOD(_MaskGloss, sampler_MaskGloss, TRANSFORM_TEX(uv, _MaskGloss), 0.0); + #endif + #else + #if N_F_TP_ON + half4 _MaskGloss_var = RT_Tripl_Default(_MaskGloss, sampler_MaskGloss, positionWS, normalDirection); + #else + half4 _MaskGloss_var = SAMPLE_TEXTURE2D(_MaskGloss, sampler_MaskGloss, TRANSFORM_TEX(uv, _MaskGloss)); + #endif + #endif + + + // + #if UNITY_COLORSPACE_GAMMA + _GlossColor = float4(LinearToGamma22(_GlossColor.rgb), _GlossColor.a); + #endif + + RTD_GLO_COL = (_GlossColor.rgb*_GlossColorPower); + // + + + #if N_F_GLOT_ON + + #if N_F_ANIS_ON + + half4 _GlossTexture_var = SAMPLE_TEXTURE2D_LOD(_GlossTexture, sampler_GlossTexture, TRANSFORM_TEX(uv, _GlossTexture), 0.0); // Will removed this soon: SAMPLE_TEXTURE2D(_GlossTexture, sampler_GlossTexture , TRANSFORM_TEX(uv,_GlossTexture) ); + + half RTD_ANIS_SHIF = ( _GlossTexture_var.r -_ShifAnis ); + half RTD_ANIS = StraSpec( RTShifTan( bitangentWS , normalDirection , lerp(0.0, RTD_ANIS_SHIF ,_NoisTexInten * 0.1) ), viewDirection, halfDirection , ((_StraWidt * 200) * 0.1) * lerp(1.0,(1.0 - _GlossTexture_var.r ),_NoiTexAffStraWidt) ); + half RTD_ANIS_SOF = smoothstep( 0.1, lerp(0.1,1.0, _GlossSoftness) , RTD_ANIS); + half RTD_GT_ON = RTD_ANIS_SOF; + + #else + + float _5992_ang = _GlossTextureRotate; + float _5992_spd = 1.0; + float _5992_cos = cos(_5992_spd*_5992_ang); + float _5992_sin = sin(_5992_spd*_5992_ang); + float2 _5992_piv = float2(0.5,0.5); + + half3 RefGlo = reflect( lerp(viewDirection,halfDirection,_GlossTextureFollowLight) ,normalDirection); + + half3 RTD_GT_FOR_OO; + if (!_GlossTextureFollowObjectRotation) + { + RTD_GT_FOR_OO = RefGlo; + } + else + { + RTD_GT_FOR_OO = mul(GetWorldToObjectMatrix(), float4(RefGlo, 0.0)).xyz; + } + + half2 glot_rot_cal = (mul(float2((-1* RTD_GT_FOR_OO.r), RTD_GT_FOR_OO.g)-_5992_piv,float2x2( _5992_cos, -_5992_sin, _5992_sin, _5992_cos))+_5992_piv); + half2 glot_rot_out = (glot_rot_cal*0.5+0.5); + + half2 PSGLOTEX_Sel; + if (!_PSGLOTEX) + { + PSGLOTEX_Sel = glot_rot_out; + } + else + { + PSGLOTEX_Sel = RTD_VD_Cal; + } + + half4 _GlossTexture_var = SAMPLE_TEXTURE2D_LOD(_GlossTexture, sampler_GlossTexture, TRANSFORM_TEX(PSGLOTEX_Sel, _GlossTexture), _GlossTextureSoftness); + half RTD_GT_ON = _GlossTexture_var.r; + + #endif + + half3 RTD_GT = RTD_GT_ON; + + #else + + half RTD_GLO_MAIN_Sof_Sli = lerp( 0.1 , 1.0 ,_GlossSoftness); + half RTD_NDOTH = saturate(dot(halfDirection, normalDirection)); + half RTD_GLO_MAIN = smoothstep( 0.1, RTD_GLO_MAIN_Sof_Sli, pow(RTD_NDOTH,exp2(lerp(-2.0,15.0,_Glossiness))) ); + + half3 RTD_GT = RTD_GLO_MAIN; + + #endif + + half RTD_GLO_I_Sli = lerp(0.0, (half)RTD_GT,_GlossIntensity); + + half RTD_GLO_MAS = lerp( 0.0, RTD_GLO_I_Sli ,_MaskGloss_var.r); + RTD_GLO = RTD_GLO_MAS; + + #else + + RTD_GLO_COL = (half3)1.0; + RTD_GLO = 0.0; + + #endif + + #else + + RTD_GLO_COL = (half3)1.0; + RTD_GLO = 0.0; + + #endif + +} +// + +//RT_RL +half RT_RL(float3 viewDirection , float3 normalDirection , half3 lightColor, out half3 RTD_RL_LARL_OO , out half RTD_RL_MAIN) +{ + + RTD_RL_MAIN = 0.0; + + #if N_F_RL_ON + + // + #if UNITY_COLORSPACE_GAMMA + _RimLightColor = float4(LinearToGamma22(_RimLightColor.rgb), _RimLightColor.a); + #endif + + half3 RT_LARLC_OO; + if (!_LightAffectRimLightColor) + { + RT_LARLC_OO = _RimLightColor.rgb; + } + else + { + RT_LARLC_OO = lerp(half3(0.0, 0.0, 0.0), _RimLightColor.rgb, lightColor); + } + + RTD_RL_LARL_OO = RT_LARLC_OO * _RimLightColorPower; + // + + + half RTD_RL_S_Sli = lerp(1.70,0.29,_RimLightSoftness); + RTD_RL_MAIN = lerp(0.0, 1.0 ,smoothstep( 1.71, RTD_RL_S_Sli, pow(abs( 1.0-max(0,dot(normalDirection, float3(viewDirection.x + (1.0 - _RimLigPosi.x),viewDirection.y + (1.0 - _RimLigPosi.y),viewDirection.z + (1.0 - _RimLigPosi.z)) ) ) ), (1.0 - _RimLightUnfill) ) ) ); + + half RTD_RL_IL_OO = lerp( 0.0, RTD_RL_MAIN, _RimLigInt); + + half RTD_RL_CHE_1 = RTD_RL_IL_OO; + + return RTD_RL_CHE_1; + + #else + + RTD_RL_LARL_OO = (half3)1.0; + + half RTD_RL_CHE_1 = 0.0; + + return RTD_RL_CHE_1; + + #endif + +} +// + +//RT_ST +half RT_ST ( float2 uv, float3 positionWS, float3 normalDirection, half RTD_NDOTL, half attenuation, float3 DirLig, half RTD_LVLC, half3 RTD_PT_COL, half3 lightColint, half3 RTD_SCT, half3 RTD_OSC, half RTD_PT , out half3 RTD_SHAT_COL , out half RTD_STIAL , out half RTD_ST_IS , out half3 RTD_ST_LAF) +{ + + RTD_ST_LAF = (half3) 1.0; + RTD_STIAL = 1.0; + RTD_ST_IS = 1.0; + + #ifndef N_F_OFLMB_ON + + #if N_F_ST_ON + + #if N_F_STSDFM_ON + float3 HF = _ObjectForward; + float2 HF_RB = float2(HF[0],HF[2]); + float2 HF_RB_Norma = normalize(HF_RB); + + float2 DirLig_RB = float2(DirLig[0],DirLig[2] *_ShadowTLightThreshold*0.01); + float2 DirLig_RB_Norma = normalize(DirLig_RB); + + float DirLig_HF_Dot = dot(HF_RB_Norma,DirLig_RB_Norma); + float Ste_DirLig_HF_Dot = step(float(0),DirLig_HF_Dot); + + float3 HR = _ObjectRight; + float2 HR_RB = float2(HR[0],HR[2]); + float2 HR_RB_Norma = normalize(HR_RB); + + float DirLig_HR_Dot = dot(HR_RB_Norma,DirLig_RB_Norma); + half Comp_DirLig_HR_Dot = DirLig_HR_Dot > half(0) ? 1 : 0; + + float2 UV_Mod_R = float2( (1 - uv.r) , uv.g); + half2 Bran_uv = Comp_DirLig_HR_Dot ? UV_Mod_R : uv; + #else + half2 Bran_uv = uv; + #endif + + + #if USE_CLUSTER_LIGHT_LOOP + #if N_F_TP_ON + float4 _ShadowT_var = RT_Tripl_Default(_ShadowT, sampler_ShadowT, positionWS, normalDirection); + #else + float4 _ShadowT_var = SAMPLE_TEXTURE2D_LOD(_ShadowT, sampler_ShadowT, TRANSFORM_TEX(Bran_uv, _ShadowT), 0.0); + #endif + #else + #if N_F_TP_ON + float4 _ShadowT_var = RT_Tripl_Default(_ShadowT, sampler_ShadowT, positionWS, normalDirection); + #else + float4 _ShadowT_var = SAMPLE_TEXTURE2D(_ShadowT, sampler_ShadowT , TRANSFORM_TEX(Bran_uv,_ShadowT)); + #endif + #endif + + + // + #if UNITY_COLORSPACE_GAMMA + _ShadowTColor = float4(LinearToGamma22(_ShadowTColor.rgb), _ShadowTColor.a); + #endif + + RTD_SHAT_COL = lerp( RTD_PT_COL, (_ShadowTColor.rgb*_ShadowTColorPower) * RTD_SCT * RTD_OSC, RTD_PT); + // + + + if (!_LightAffectShadow) + { + RTD_ST_LAF = RTD_SHAT_COL * RTD_LVLC; + } + else + { + RTD_ST_LAF = RTD_SHAT_COL * lightColint; + } + + + #if !defined(N_F_STSDFM_ON) + half RTD_ST_H_Sli = lerp(0.0,0.22,_ShadowTHardness); + half RTD_ST_IS_ON = (half)smoothstep( RTD_ST_H_Sli, 0.22, (_ShowInAmbientLightShadowThreshold*_ShadowT_var.rgb) ); + + #if N_F_STIAL_ON + half RTD_ST_ALI_Sli = lerp(1.0,RTD_ST_IS_ON,_ShowInAmbientLightShadowIntensity); + half RTD_STIAL_ON = (half)lerp(RTD_ST_ALI_Sli,half3(1.0,1.0,1.0),clamp((RTD_LVLC*8.0),0.0,1.0)); + + RTD_STIAL = RTD_STIAL_ON; + #else + RTD_STIAL = 1.0; + #endif + + #if N_F_STIS_ON + RTD_ST_IS = lerp(1.0,RTD_ST_IS_ON,_ShowInAmbientLightShadowIntensity); + #else + RTD_ST_IS = 1.0; + #endif + + + half RT_LFOAST_OO; + if (!_TexturePatternStyle) + { + RT_LFOAST_OO = RTD_NDOTL; + } + else + { + RT_LFOAST_OO = attenuation * RTD_NDOTL; + } + + + half RTD_ST_LFAST_OO; + if (!_STIL) + { + RTD_ST_LFAST_OO = RT_LFOAST_OO; + } + else + { + RTD_ST_LFAST_OO = 1.0; + } + + + half RTD_ST_In_Sli = lerp( 1.0 ,smoothstep( RTD_ST_H_Sli, 0.22, ((_ShadowT_var.r*(1.0 - _ShadowTShadowThreshold))*(RTD_ST_LFAST_OO *_ShadowTLightThreshold*0.01)) ),_ShadowTIntensity); + #endif + + #if N_F_STSDFM_ON + float Pi_Cons = 3.141593; + float DirLig_HR_Dot_acos = acos(DirLig_HR_Dot); + float acos_pi_div = DirLig_HR_Dot_acos/Pi_Cons; + float acos_pi_div_mul_val = acos_pi_div * 2; + + float RoundMinuOn = 1 - acos_pi_div_mul_val; + float RoundRev = -1 * RoundMinuOn; + float Bran_Sphe = Comp_DirLig_HR_Dot ? RoundMinuOn : RoundRev; + + half SmooLo_SDF = lerp(_ShadowT_var.r, float(1), (1 - _ShadowTHardness) ); + half SmooSte = smoothstep(_ShadowT_var.r, SmooLo_SDF, Bran_Sphe * distance(DirLig_RB_Norma,HF_RB_Norma) ); + half SmooSte_mi_one = 1 - SmooSte.r; + + half SDF_Final = Ste_DirLig_HF_Dot * SmooSte_mi_one; + half RTD_ST_In_Sli = lerp( 1.0 , SDF_Final ,_ShadowTIntensity); + #endif + + float RTD_ST_ON = RTD_ST_In_Sli; + float RTD_ST = RTD_ST_ON; + return RTD_ST; + + #else + + half RTD_ST = 1.0; + RTD_SHAT_COL = (half3)1.0; + RTD_ST_LAF = (half3) 1.0; + RTD_STIAL = 1.0; + RTD_ST_IS = 1.0; + + return RTD_ST; + + #endif + + #else + + half RTD_ST = 1.0; + RTD_SHAT_COL = (half3)1.0; + RTD_ST_LAF = (half3)1.0; + RTD_STIAL = 1.0; + RTD_ST_IS = 1.0; + + return RTD_ST; + + #endif +} +// + +//RT_SS +half RT_SS( float4 vertexColor , float3 RTD_NDOTL , half attenuation , float dim_val ) +{ + + #ifndef N_F_OFLMB_ON + + #if N_F_SS_ON + + half RTD_SS_SSH_Sil = lerp(0.3,1.0,_SelfShadowHardness); + half RTD_SS_SSTH_Sli = lerp(-1.0, 1.0, _SelfShadowThreshold); + + half RTD_SS_VCGCSSS_OO; + if (!_VertexColorGreenControlSelfShadowThreshold) + { + RTD_SS_VCGCSSS_OO = RTD_SS_SSTH_Sli; + } + else + { + RTD_SS_VCGCSSS_OO = RTD_SS_SSTH_Sli * (1.0 - vertexColor.g); + } + + half RTD_SS_SST = smoothstep( RTD_SS_SSH_Sil, 1.0, ((float)RTD_NDOTL * lerp(7.0, RTD_SS_VCGCSSS_OO ,RTD_SS_SSTH_Sli)) ); + half RTD_SS_SSABLSS_OO = lerp( RTD_SS_SST, lerp(RTD_SS_SST,1.0, (1.0 - dim_val) ), _SelfShadowAffectedByLightShadowStrength ); + half RTD_SS_ON = lerp(1.0,(RTD_SS_SSABLSS_OO*attenuation),_SelfShadowRealtimeShadowIntensity); + + half RTD_SS = RTD_SS_ON; + + return RTD_SS; + + #else + + half RTD_SS_OFF = lerp(1.0,attenuation,_SelfShadowRealtimeShadowIntensity); + + half RTD_SS = RTD_SS_OFF; + + return RTD_SS; + + #endif + + #else + + half RTD_SS_OFF = lerp(1.0, attenuation, _SelfShadowRealtimeShadowIntensity); + + half RTD_SS = RTD_SS_OFF; + + return RTD_SS; + + #endif + +} +// + +//RT_RELGI_SUB1 +half3 RT_RELGI_SUB1(float2 uv, float2 uvDynLigma, half3 RTD_GI_FS_OO, half3 RTD_SHAT_COL, half3 RTD_MCIALO, half RTD_STIAL, Light mainLight, float3 normalDirection, float3 positionWS, float3 viewDirection, float2 positionCS) // +{ + half3 RTD_SL_OFF_OTHERS = float3(1.0, 1.0, 1.0); + half3 RTD_B_GI_AND_AL_GI = half3(1.0, 1.0, 1.0); + + #if N_F_RELGI_ON + + #if defined(LIGHTMAP_ON) + + #if defined(_SCREEN_SPACE_IRRADIANCE) + half3 baked_GI = SAMPLE_GI(_ScreenSpaceIrradiance, positionCS.xy); + #elif defined(DYNAMICLIGHTMAP_ON) + half3 baked_GI = SampleLightmap(uv, uvDynLigma, lerp(float3(0.0, 0.0, 0.0), float3(1.0, 1.0, 1.0), RTD_GI_FS_OO) ); + #elif !defined(DYNAMICLIGHTMAP_ON) + half3 baked_GI = SampleLightmap(uv, lerp(float3(0.0, 0.0, 0.0), float3(1.0, 1.0, 1.0), RTD_GI_FS_OO) ); + #endif + + MixRealtimeAndBakedGI(mainLight, normalDirection, baked_GI, half4(0, 0, 0, 0)); + RTD_B_GI_AND_AL_GI = baked_GI * 2; + + //MixRealtimeAndBakedGI(mainLight, normalDirection, baked_GI , half4(0, 0, 0, 0)); + //#elif ( defined(LIGHTMAP_ON) & defined(_MIXED_LIGHTING_SUBTRACTIVE) ) || (!defined(LIGHTMAP_ON)) + //half3 RTD_B_GI_AND_AL_GI = float3(0.0, 0.0, 0.0); + + #else + + #if defined(PROBE_VOLUMES_L1) || defined(PROBE_VOLUMES_L2) + + EvaluateAdaptiveProbeVolume(GetAbsolutePositionWS(positionWS), lerp(float3(0.0, 0.0, 0.0), float3(1.0, 1.0, 1.0), RTD_GI_FS_OO), viewDirection, positionCS, RTD_B_GI_AND_AL_GI); + + #else + + RTD_B_GI_AND_AL_GI = (AL_GI(lerp(float3(0.0, 0.0, 0.0), float3(1.0, 1.0, 1.0), RTD_GI_FS_OO))); + + #endif + + #endif + + + + RTD_SL_OFF_OTHERS = lerp(RTD_SHAT_COL, RTD_MCIALO, RTD_STIAL) * (RTD_B_GI_AND_AL_GI * ((_EnvironmentalLightingIntensity))); + + + return RTD_SL_OFF_OTHERS; + + #else + + RTD_SL_OFF_OTHERS = half3(0.0,0.0,0.0); + + return RTD_SL_OFF_OTHERS; + + #endif + +} +// + +//RT_R +half3 RT_R( float2 uv, float3 viewReflectDirection, float3 viewDirection, float3 normalDirection, half3 RTD_TEX_COL, half3 RTD_R_OFF_OTHERS, float3 positionWS ) +{ + + #if N_F_R_ON + + #if !USE_CLUSTER_LIGHT_LOOP + half3 RTD_FR_OFF_OTHERS = GlossyEnvironmentReflection(viewReflectDirection, positionWS, _Smoothness, 1.0); + #else + half3 RTD_FR_OFF_OTHERS = GlossyEnvironmentReflection(viewReflectDirection, positionWS, _Smoothness, 1.0, float2(0.0f, 0.0f)); + #endif + + #if N_F_FR_ON + + half2 ref_cal = reflect(viewDirection,normalDirection).rg; + half2 ref_cal_out = (float2(ref_cal.r,(-1.0*ref_cal.g))*0.5+0.5); + half4 _FReflection_var = SAMPLE_TEXTURE2D_LOD(_FReflection, sampler_FReflection, TRANSFORM_TEX(ref_cal_out, _FReflection), _Smoothness); + half3 RTD_FR_ON = _FReflection_var.rgb; + + half3 RTD_FR = RTD_FR_ON; + + #else + + half3 RTD_FR = RTD_FR_OFF_OTHERS; + + #endif + + #if USE_CLUSTER_LIGHT_LOOP + #if N_F_TP_ON + half4 _MaskReflection_var = RT_Tripl_Default(_MaskReflection, sampler_MaskReflection, positionWS, normalDirection); + #else + half4 _MaskReflection_var = SAMPLE_TEXTURE2D_LOD(_MaskReflection, sampler_MaskReflection, TRANSFORM_TEX(uv, _MaskReflection), 0.0); + #endif + #else + #if N_F_TP_ON + half4 _MaskReflection_var = RT_Tripl_Default(_MaskReflection, sampler_MaskReflection, positionWS, normalDirection); + #else + half4 _MaskReflection_var = SAMPLE_TEXTURE2D(_MaskReflection, sampler_MaskReflection , TRANSFORM_TEX(uv, _MaskReflection)); + #endif + #endif + + half3 RTD_R_MET_Sli = lerp((half3)1.0,(9.0 * (RTD_TEX_COL - (9.0 * 0.005) ) ) , _RefMetallic); + half3 RTD_R_MAS = lerp(RTD_R_OFF_OTHERS, (RTD_FR * RTD_R_MET_Sli) ,_MaskReflection_var.r); + half3 RTD_R_ON = lerp(RTD_R_OFF_OTHERS, RTD_R_MAS ,_ReflectionIntensity); + + half3 RTD_R = RTD_R_ON; + + return RTD_R; + + #else + + half3 RTD_R = RTD_R_OFF_OTHERS; + + return RTD_R; + + #endif + +} +// + +//RT_SL +half3 RT_SL( float2 uv, float3 positionWS, float3 normalDirection, half3 RTD_SL_OFF_OTHERS, half3 RTD_TEX_COL, half3 RTD_R, out half3 RTD_SL_CHE_1 ) +{ + + #if N_F_SL_ON + + #if N_F_TP_ON + half4 _MaskSelfLit_var = RT_Tripl_Default(_MaskSelfLit, sampler_MaskSelfLit, positionWS, normalDirection); + #else + half4 _MaskSelfLit_var = SAMPLE_TEXTURE2D_LOD(_MaskSelfLit, sampler_MaskSelfLit, TRANSFORM_TEX(uv, _MaskSelfLit), 0.0); + #endif + + + // + #if UNITY_COLORSPACE_GAMMA + _SelfLitColor = float4(LinearToGamma22(_SelfLitColor.rgb), _SelfLitColor.a); + #endif + // + + + #if N_F_SLMM_ON + half3 RTD_SL_MAS = lerp(RTD_SL_OFF_OTHERS,(_SelfLitColor.rgb*_SelfLitPower),_MaskSelfLit_var.rgb); + half3 RTD_R_SEL = lerp(RTD_R,lerp(RTD_R,RTD_TEX_COL*_TEXMCOLINT,_MaskSelfLit_var.rgb),_SelfLitIntensity); + #else + + half3 RTD_SL_HC_OO; + if (!_SelfLitHighContrast) + { + RTD_SL_HC_OO = (half3)1.0; + } + else + { + RTD_SL_HC_OO = RTD_TEX_COL; + } + + half3 RTD_SL_MAS = lerp(RTD_SL_OFF_OTHERS,((_SelfLitColor.rgb * RTD_TEX_COL * RTD_SL_HC_OO)*_SelfLitPower),_MaskSelfLit_var.r); + half3 RTD_R_SEL = lerp(RTD_R,lerp(RTD_R,RTD_TEX_COL*_TEXMCOLINT,_MaskSelfLit_var.r),_SelfLitIntensity); + #endif + + + half3 RTD_SL_ON = lerp(RTD_SL_OFF_OTHERS,RTD_SL_MAS,_SelfLitIntensity); + + half3 RTD_SL = RTD_SL_ON; + RTD_SL_CHE_1 = RTD_R_SEL; + + return RTD_SL; + + #else + + half3 RTD_SL = RTD_SL_OFF_OTHERS; + RTD_SL_CHE_1 = RTD_R; + + return RTD_SL; + + #endif + +} +// + +//RT_RL_SUB1 +half3 RT_RL_SUB1(half3 RTD_SL_CHE_1 , half3 RTD_RL_LARL_OO , half3 RTD_RL_MAIN) +{ + + #if N_F_RL_ON + + #ifndef N_F_OFLMB_ON + + half3 RT_RLIL_OO; + #ifdef N_F_RLIS_ON + RT_RLIL_OO = RTD_SL_CHE_1; + #else + if (!_RimLightInLight) + { + RT_RLIL_OO = lerp(RTD_SL_CHE_1, RTD_RL_LARL_OO, RTD_RL_MAIN); + } + else + { + RT_RLIL_OO = RTD_SL_CHE_1; + } + #endif + + half3 RTD_RL_ON = lerp(RTD_SL_CHE_1, RT_RLIL_OO, _RimLigInt); + + #else + + half3 RTD_RL_ON = lerp(RTD_SL_CHE_1, lerp(RTD_SL_CHE_1, RTD_RL_LARL_OO, RTD_RL_MAIN), _RimLigInt); + + #endif + + half3 RTD_RL = RTD_RL_ON; + + return RTD_RL; + + #else + + half3 RTD_RL = RTD_SL_CHE_1; + + return RTD_RL; + + #endif + +} +// + +//RT_CA +half3 RT_CA( half3 color ) +{ + + #if N_F_CA_ON + + half3 RTD_CA_ON = lerp(color,dot(color,half3(0.3,0.59,0.11)),(1.0 - _Saturation)); + half3 RTD_CA = RTD_CA_ON; + + return RTD_CA; + + #else + + half3 RTD_CA = color; + + return RTD_CA; + + #endif + +} +// + +//RT_DC +void RT_DC(float4 positionCS, inout half4 _MainTex_var, inout half3 normalWS) +{ + half3 specular = 0; + half metallic = 0; + half occlusion = 0; + half smoothness = 0; + ApplyDecal(positionCS, _MainTex_var.rgb, specular, normalWS, metallic, occlusion, smoothness); +} +// + +//RT_SSAO +half3 RT_SSAO(float4 positionCS) +{ + float3 RT_SSAmOc = 1.0; + + #if defined(_SCREEN_SPACE_OCCLUSION) && !defined(N_F_TRANS_ON) + float2 normalizedScreenSpaceUV = GetNormalizedScreenSpaceUV(positionCS); + AmbientOcclusionFactor aoFactor = GetScreenSpaceAmbientOcclusion(normalizedScreenSpaceUV); + RT_SSAmOc = lerp(_SSAOColor.rgb, 1.0, aoFactor.directAmbientOcclusion); + #endif + + #if N_F_ESSAO_ON + return RT_SSAmOc; + #else + return 1.0; + #endif + +} +// + +//RT_NFD +void RT_NFD(float2 positionCS) +{ + float distanceFromCamera = distance(GetAbsolutePositionWS(UNITY_MATRIX_M._m03_m13_m23), _WorldSpaceCameraPos); + clip(-(RT_Dither_Out(positionCS) - saturate((distanceFromCamera - _MinFadDistance) / _MaxFadDistance))); +} + +//RT_PA +float4x4 RT_PA(float Dep) +{ + float Neg = Dep - float(1.0) * (_PADist * 0.1); + float limit = smoothstep(((1 - _PASmooTrans) * 0.1), 1, clamp(Neg, (1 - _PASize), float(1.0))); + + float4x4 VPM_Mul = mul(GetWorldToHClipMatrix(), GetObjectToWorldMatrix()); + float4x4 VPM_Mod = float4x4(VPM_Mul[0][0], VPM_Mul[0][1], VPM_Mul[0][2], VPM_Mul[0][3], VPM_Mul[1][0], VPM_Mul[1][1], VPM_Mul[1][2], VPM_Mul[1][3], VPM_Mul[2][0] * (_ClipAdju * 5), VPM_Mul[2][1] * (_ClipAdju * 5), VPM_Mul[2][2] * (_ClipAdju * 5), VPM_Mul[2][3], VPM_Mul[3][0] * _PresAdju, VPM_Mul[3][1], VPM_Mul[3][2] * _PresAdju, VPM_Mul[3][3] * limit); + return VPM_Mod; +} +// + +//RT_SE +float haS(float n) { return frac(sin(n) * 43758.5453); } +float4 RT_SE(float3 positionWS, float4 positionOS) +{ + float4 WSPos = float4(positionWS, 1.0); + float3 WSOff = _ObjPosi.xyz - _PrevPosition.xyz; + float3 OSOff = WSPos.xyz - _ObjPosi.xyz; + float3 NoiSi = WSPos.xyz * _NoiseSize; + float3 p = floor(NoiSi); + float3 f = frac(NoiSi); + float n = p.x + p.y * 57.0 + 113.0 * p.z; + + f = f * f * (3.0 - 2.0 * f); + float Noi = lerp(lerp(lerp(haS(n + 0.0), haS(n + 1.0), f.x), lerp(haS(n + 57.0), haS(n + 58.0), f.x), f.y), lerp(lerp(haS(n + 113.0), haS(n + 114.0), f.x), lerp(haS(n + 170.0), haS(n + 171.0), f.x), f.y), f.z); + float DirDotComp = dot(normalize(WSOff), normalize(OSOff)); + float3 NoiSizAdj = (float3)_TrailSize; + + WSOff = clamp(WSOff, NoiSizAdj * -1, NoiSizAdj); + WSOff *= -clamp(DirDotComp, -1, 0) * lerp(1, 0, step(length(WSOff), 0)); + WSPos.xyz += -WSOff.xyz * lerp(1, Noi, step(0, _NoiseSize)); + return mul(GetWorldToObjectMatrix(), WSPos); +} +// + +//=========================== +//RT_ADD_LI Function +//=========================== + +//RT_ADD_LI +float3 RT_ADD_LI(Light light, float3 bitangentWS, float3 viewDirection, float3 viewReflectDirection, float3 positionWS, half3 ss_col, half3 RTD_TEX_COL, half3 _MC_MCP, half4 _MainTex_var, half3 MCapOutP, half3 _RTD_MVCOL, half2 RTD_VD_Cal, float3 normalDirection, float3 RTD_SON, half3 RTD_PT_COL, half3 RTD_SCT, half3 RTD_OSC, half RTD_PT, half3 RTD_MCIALO_IL, float2 uv, float4 vertexColor, half isFrontFace, int lightIndex) +{ + + float3 lightDirection = light.direction; + + #if N_F_LLI_ON + half3 PuncLighCol = clamp(light.color.rgb,_LLI_Min,_LLI_Max); + #else + half3 PuncLighCol = light.color.rgb; + #endif + + #if N_F_NLASOBF_ON + half3 lightColor = lerp((half3)0.0,PuncLighCol,isFrontFace); + #else + half3 lightColor = PuncLighCol; + #endif + + #if N_F_HPSS_ON + half attenuation = 1.0; + #else + half dlshmin = lerp( 0.0 , 0.6 ,_ShadowHardness); + half dlshmax = lerp( 1.0 , 0.6 ,_ShadowHardness); + + #if N_F_NLASOBF_ON + half FB_Check = lerp( 1.0 ,light.shadowAttenuation,isFrontFace); + #else + half FB_Check = light.shadowAttenuation; + #endif + half attenuation = smoothstep(dlshmin, dlshmax ,FB_Check); + #endif + + half RTD_LVLC = RTD_LVLC_F(lightColor.rgb); + half lightfos = smoothstep( 0.0 , _LightFalloffSoftness ,light.distanceAttenuation); + half3 lig_col_int = (_LightIntensity * lightColor.rgb); + float3 halfDirection = normalize(viewDirection + lightDirection); + + + //** + half3 RTD_LAS; + if (!_LightAffectShadow) + { + RTD_LAS = ss_col * RTD_LVLC; + } + else + { + RTD_LAS = ss_col * lig_col_int; + } + //** + + + half3 RTD_HL = (_HighlightColor.rgb*_HighlightColorPower+_PointSpotlightIntensity); + + + //** + half3 RTD_MC_SM_TC_OO; + if (!_SPECMODE) + { + RTD_MC_SM_TC_OO = RTD_TEX_COL * _MC_MCP; + } + else + { + RTD_MC_SM_TC_OO = RTD_TEX_COL + _MC_MCP; + } + //** + + + //** + half3 RTD_MCIALO_OO; + if (!_MCIALO) + { + RTD_MCIALO_OO = RTD_TEX_COL; + } + else + { + RTD_MCIALO_OO = lerp(RTD_MC_SM_TC_OO, _MainTex_var.rgb * MCapOutP * _RTD_MVCOL * 0.7, clamp((RTD_LVLC * 1.0), 0.0, 1.0)); + } + //** + + + half3 RTD_MCIALO = RTD_MCIALO_OO; + + + //RT_GLO + half RTD_GLO; + half3 RTD_GLO_COL; + RT_GLO(uv, RTD_VD_Cal, halfDirection, bitangentWS, normalDirection, viewDirection, positionWS, RTD_GLO, RTD_GLO_COL); + half3 RTD_GLO_OTHERS = RTD_GLO; + //== + + + //RT_RL + half3 RTD_RL_LARL_OO; + half RTD_RL_MAIN; + half RTD_RL_CHE_1 = RT_RL(viewDirection, normalDirection, lightColor, RTD_RL_LARL_OO, RTD_RL_MAIN); + //== + + + //RT_CLD + float3 RTD_CLD = RT_CLD(lightDirection); + //== + + + //** + half3 RTD_ST_SS_AVD_OO; + if (!_SelfShadowShadowTAtViewDirection) + { + RTD_ST_SS_AVD_OO = RTD_CLD; + } + else + { + RTD_ST_SS_AVD_OO = viewDirection; + } + //** + + + half RTD_NDOTL = 0.5*dot(RTD_ST_SS_AVD_OO, float3(RTD_SON.x, RTD_SON.y * (1 - _LigIgnoYNorDir), RTD_SON.z))+0.5; + + + //RT_ST + half3 RTD_SHAT_COL; + half RTD_STIAL; + half RTD_ST_IS; + half3 RTD_ST_LAF; + half RTD_ST = RT_ST(uv, positionWS, normalDirection, RTD_NDOTL, lightfos, lightDirection, RTD_LVLC, RTD_PT_COL, lig_col_int, RTD_SCT, RTD_OSC, RTD_PT, RTD_SHAT_COL, RTD_STIAL, RTD_ST_IS, RTD_ST_LAF); + + //== + + + //RT_SS + half RTD_SS = RT_SS(vertexColor, RTD_NDOTL, attenuation, GetAdditionalLightShadowParams(lightIndex).x); + //== + + + half3 RTD_RL_LIG; + half3 RTD_RL_SHA; + #ifdef N_F_RLIS_ON + RTD_RL_LIG = lerp( RTD_MCIALO_IL * RTD_HL , RTD_GLO_COL , RTD_GLO_OTHERS ); + RTD_RL_SHA = lerp (lerp( RTD_ST_LAF, RTD_LAS, RTD_ST_IS),RTD_RL_LARL_OO,RTD_RL_CHE_1 * RTD_LVLC ); + #else + RTD_RL_LIG = lerp( lerp( RTD_MCIALO_IL * RTD_HL , RTD_GLO_COL , RTD_GLO_OTHERS) , RTD_RL_LARL_OO , RTD_RL_CHE_1 ); + RTD_RL_SHA = lerp( RTD_ST_LAF, RTD_LAS, RTD_ST_IS); + #endif + + half3 RTD_R_OFF_OTHERS = lerp( RTD_RL_SHA , lerp( RTD_ST_LAF, RTD_RL_LIG * lightColor.rgb, RTD_ST) , RTD_SS ); + + + //RT_R + half3 RTD_R = RT_R(uv, viewReflectDirection, viewDirection, normalDirection, RTD_TEX_COL, RTD_R_OFF_OTHERS, positionWS); + //== + + + //RT_SL + half3 RTD_SL_CHE_1; + half3 RTD_SL = RT_SL(uv, positionWS, normalDirection, (half3)0.0, RTD_TEX_COL, RTD_R, RTD_SL_CHE_1); + //== + + + //RT_RL_SUB1 + half3 RTD_RL = RT_RL_SUB1(RTD_SL_CHE_1, RTD_RL_LARL_OO, RTD_RL_MAIN); + //== + + + half3 RTD_CA_OFF_OTHERS = (RTD_RL + RTD_SL); + half3 add_light_output = RTD_CA_OFF_OTHERS * lightfos; + + return add_light_output; +} +// \ No newline at end of file diff --git a/Assets/RealToon/RealToon Shaders/RealToon Core/URP/RT_URP_Core.hlsl.meta b/Assets/RealToon/RealToon Shaders/RealToon Core/URP/RT_URP_Core.hlsl.meta new file mode 100644 index 00000000..e787d332 --- /dev/null +++ b/Assets/RealToon/RealToon Shaders/RealToon Core/URP/RT_URP_Core.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 7314c2e030540e5409b59feea5b784ae +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/RealToon/RealToon Shaders/RealToon Core/URP/RT_URP_PROP.hlsl b/Assets/RealToon/RealToon Shaders/RealToon Core/URP/RT_URP_PROP.hlsl new file mode 100644 index 00000000..3aef494e --- /dev/null +++ b/Assets/RealToon/RealToon Shaders/RealToon Core/URP/RT_URP_PROP.hlsl @@ -0,0 +1,1085 @@ +//RealToon URP - RT_URP_PROP +//MJQStudioWorks + +#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" + +//=============================================================================== +//CBUF +//=============================================================================== + +CBUFFER_START(UnityPerMaterial) + + //== Others + uniform float4 _MainTex_ST; + + uniform half4 _MainColor; + uniform half _MaiColPo; + uniform half _MVCOL; + uniform half _MCIALO; + uniform half _TexturePatternStyle; + uniform half4 _HighlightColor; + uniform half _HighlightColorPower; + //== + + + //== N_F_O_ON + uniform float4 _OutlineWidthControl_ST; + uniform half _OutlineWidth; + uniform int _OutlineExtrudeMethod; + uniform half3 _OutlineOffset; + uniform float3 _OutResi; + uniform half _OutlineZPostionInCamera; + uniform half4 _OutlineColor; + uniform half _MixMainTexToOutline; + uniform half _NoisyOutlineIntensity; + uniform half _DynamicNoisyOutline; + uniform half _LightAffectOutlineColor; + uniform half _OutlineWidthAffectedByViewDistance; + uniform half _FarDistanceMaxWidth; + uniform half _VertexColorBlueAffectOutlineWitdh; + //== + + + //== N_F_O_SSOL + uniform float _DepthThreshold; + //== + + + //== N_F_MC_ON + uniform half _MCapIntensity; + + uniform float4 _MCap_ST; + + uniform half _SPECMODE; + uniform half _SPECIN; + + uniform float4 _MCapMask_ST; + //== + + + //== Transparency + uniform float4 _MaskTransparency_ST; + uniform half _Opacity; + uniform half _TransparentThreshold; + //== + + + //== N_F_CO_ON + uniform half _Cutout; + uniform half _AlphaBaseCutout; + uniform half _UseSecondaryCutout; + uniform half _AAS; + uniform half _Glow_Edge_Width; + uniform half4 _Glow_Color; + + uniform float4 _SecondaryCutout_ST; + //== + + + //== N_F_NM_ON + uniform float4 _NormalMap_ST; + + uniform half _NormalMapIntensity; + //== + + + //== N_F_CA_ON + uniform half _Saturation; + //== + + + //== N_F_SL_ON + uniform half _SelfLitIntensity; + uniform half4 _SelfLitColor; + uniform half _SelfLitPower; + uniform half _TEXMCOLINT; + uniform half _SelfLitHighContrast; + + uniform float4 _MaskSelfLit_ST; + //== + + + //== N_F_GLO_ON + uniform half _GlossIntensity; + uniform half _Glossiness; + uniform half _GlossSoftness; + uniform half4 _GlossColor; + uniform half _GlossColorPower; + + uniform float4 _MaskGloss_ST; + //== + + + //== N_F_GLO_ON -> N_F_GLOT_ON + uniform float4 _GlossTexture_ST; + + uniform half _GlossTextureSoftness; + uniform half _PSGLOTEX; + uniform half _GlossTextureRotate; + uniform half _GlossTextureFollowObjectRotation; + uniform half _NoisTexInten; + uniform half _StraWidt; + uniform half _NoiTexAffStraWidt; + uniform half _ShifAnis; + uniform half _GlossTextureFollowLight; + //== + + + //== Others + uniform half4 _OverallShadowColor; + uniform half _OverallShadowColorPower; + + uniform half _SelfShadowShadowTAtViewDirection; + + uniform half _ShadowHardness; + uniform half _SelfShadowRealtimeShadowIntensity; + //== + + + //== N_F_SS_ON + uniform half _SelfShadowThreshold; + uniform half _VertexColorGreenControlSelfShadowThreshold; + uniform half _SelfShadowHardness; + uniform half _LigIgnoYNorDir; + uniform half _SelfShadowAffectedByLightShadowStrength; + //== + + + //== N_F_SS_ON -> Transparency + uniform half _SelfShadowIntensity; + uniform half4 _SelfShadowColor; + uniform half _SelfShadowColorPower; + //== + + + //== Others + uniform half4 _SelfShadowRealTimeShadowColor; + uniform half _SelfShadowRealTimeShadowColorPower; + //== + + + //== N_F_SON_ON + uniform half _SmoothObjectNormal; + uniform half _VertexColorRedControlSmoothObjectNormal; + uniform float4 _XYZPosition; + uniform half _ShowNormal; + //== + + + //== N_F_SCT_ON + uniform float4 _ShadowColorTexture_ST; + + uniform half _ShadowColorTexturePower; + //== + + + //== N_F_ST_ON + uniform half _ShadowTIntensity; + + uniform float4 _ShadowT_ST; + + uniform half _ShadowTLightThreshold; + uniform half _ShadowTShadowThreshold; + uniform half4 _ShadowTColor; + uniform half _ShadowTColorPower; + uniform half _ShadowTHardness; + uniform half _STIL; + uniform half _ShowInAmbientLightShadowIntensity; + uniform half _ShowInAmbientLightShadowThreshold; + uniform half _LightFalloffAffectShadowT; + //== + + + //== N_F_PT_ON + uniform float4 _PTexture_ST; + uniform half4 _PTCol; + uniform half _PTexturePower; + //== + + + //== N_F_RELGI_ON + uniform half _GIFlatShade; + uniform half _GIShadeThreshold; + uniform half _EnvironmentalLightingIntensity; + //== + + + //== Others + uniform half _LightAffectShadow; + uniform half _LightIntensity; + uniform half _DirectionalLightIntensity; + uniform half _PointSpotlightIntensity; + uniform half _LightFalloffSoftness; + uniform half _LLI_Min; + uniform half _LLI_Max; + //== + + + //== N_F_CLD_ON + uniform half _CustomLightDirectionIntensity; + uniform half4 _CustomLightDirection; + uniform half _CustomLightDirectionFollowObjectRotation; + //== + + + //== N_F_R_ON + uniform half _ReflectionIntensity; + uniform half _Smoothness; + uniform half _RefMetallic; + + uniform float4 _MaskReflection_ST; + //== + + + //== N_F_FR_ON + float4 _FReflection_ST; + //== + + + //== N_F_RL_ON + uniform half _RimLigInt; + uniform half _RimLightUnfill; + uniform half _RimLightSoftness; + uniform half3 _RimLigPosi; + uniform half _LightAffectRimLightColor; + uniform half4 _RimLightColor; + uniform half _RimLightColorPower; + uniform half _RimLightInLight; + //== + + + //== N_F_NFD_ON + uniform half _MinFadDistance; + uniform half _MaxFadDistance; + //== + + + //== N_F_TP_ON + uniform float _TriPlaTile; + uniform float _TriPlaBlend; + //== + + + //== N_F_PA_ON + uniform half _PresAdju; + uniform half _ClipAdju; + uniform float _PASize; + uniform float _PASmooTrans; + uniform float _PADist; + //== + + + //== N_F_SE_ON + uniform float _NoiseSize; + uniform float _TrailSize; + + //== + + + //== N_F_TESS_ON + uniform half _TessellationSmoothness; + uniform half _TessellationTransition; + uniform half _TessellationNear; + uniform half _TessellationFar; + uniform half _NorMapAsDis; + //== + + + //== Others + uniform half4 _SSAOColor; + uniform half _ReduSha; + uniform float _ObjePosiZCS; + + uniform sampler3D _DitherMaskLOD; + + float _SkinMatrixIndex; + float _ComputeMeshIndex; + float4 _PrevPosition; + float4 _ObjPosi; + float3 _ObjectForward; + float3 _ObjectRight; + //== + +CBUFFER_END + +//=============================================================================== +//DOTS Instancing +//=============================================================================== +#ifdef UNITY_DOTS_INSTANCING_ENABLED + +UNITY_DOTS_INSTANCING_START(MaterialPropertyMetadata) + + UNITY_DOTS_INSTANCED_PROP(float4, _MainColor) + UNITY_DOTS_INSTANCED_PROP(float, _MaiColPo) + UNITY_DOTS_INSTANCED_PROP(float, _MVCOL) + UNITY_DOTS_INSTANCED_PROP(float, _MCIALO) + UNITY_DOTS_INSTANCED_PROP(float, _TexturePatternStyle) + UNITY_DOTS_INSTANCED_PROP(float4, _HighlightColor) + UNITY_DOTS_INSTANCED_PROP(float, _HighlightColorPower) + + UNITY_DOTS_INSTANCED_PROP(float, _OutlineWidth) + UNITY_DOTS_INSTANCED_PROP(int, _OutlineExtrudeMethod) + UNITY_DOTS_INSTANCED_PROP(float3, _OutlineOffset) + UNITY_DOTS_INSTANCED_PROP(float3, _OutResi) + UNITY_DOTS_INSTANCED_PROP(float, _OutlineZPostionInCamera) + UNITY_DOTS_INSTANCED_PROP(float4, _OutlineColor) + UNITY_DOTS_INSTANCED_PROP(float, _MixMainTexToOutline) + UNITY_DOTS_INSTANCED_PROP(float, _NoisyOutlineIntensity) + UNITY_DOTS_INSTANCED_PROP(float, _DynamicNoisyOutline) + UNITY_DOTS_INSTANCED_PROP(float, _LightAffectOutlineColor) + UNITY_DOTS_INSTANCED_PROP(float, _OutlineWidthAffectedByViewDistance) + UNITY_DOTS_INSTANCED_PROP(float, _FarDistanceMaxWidth) + UNITY_DOTS_INSTANCED_PROP(float, _VertexColorBlueAffectOutlineWitdh) + + UNITY_DOTS_INSTANCED_PROP(float, _DepthThreshold) + + UNITY_DOTS_INSTANCED_PROP(float, _MCapIntensity) + UNITY_DOTS_INSTANCED_PROP(float, _SPECMODE) + UNITY_DOTS_INSTANCED_PROP(float, _SPECIN) + + UNITY_DOTS_INSTANCED_PROP(float, _Opacity) + UNITY_DOTS_INSTANCED_PROP(float, _TransparentThreshold) + + UNITY_DOTS_INSTANCED_PROP(float, _Cutout) + UNITY_DOTS_INSTANCED_PROP(float, _AlphaBaseCutout) + UNITY_DOTS_INSTANCED_PROP(float, _UseSecondaryCutout) + + UNITY_DOTS_INSTANCED_PROP(float, _AAS) + + UNITY_DOTS_INSTANCED_PROP(float4, _Glow_Color) + UNITY_DOTS_INSTANCED_PROP(float, _Glow_Edge_Width) + + UNITY_DOTS_INSTANCED_PROP(float, _NormalMapIntensity) + + UNITY_DOTS_INSTANCED_PROP(float, _Saturation) + + UNITY_DOTS_INSTANCED_PROP(float, _SelfLitIntensity) + UNITY_DOTS_INSTANCED_PROP(float4, _SelfLitColor) + UNITY_DOTS_INSTANCED_PROP(float, _SelfLitPower) + UNITY_DOTS_INSTANCED_PROP(float, _TEXMCOLINT) + UNITY_DOTS_INSTANCED_PROP(float, _SelfLitHighContrast) + + UNITY_DOTS_INSTANCED_PROP(float, _GlossIntensity) + UNITY_DOTS_INSTANCED_PROP(float, _Glossiness) + UNITY_DOTS_INSTANCED_PROP(float, _GlossSoftness) + UNITY_DOTS_INSTANCED_PROP(float4, _GlossColor) + UNITY_DOTS_INSTANCED_PROP(float, _GlossColorPower) + + UNITY_DOTS_INSTANCED_PROP(float, _GlossTextureSoftness) + UNITY_DOTS_INSTANCED_PROP(float, _PSGLOTEX) + UNITY_DOTS_INSTANCED_PROP(float, _GlossTextureRotate) + UNITY_DOTS_INSTANCED_PROP(float, _GlossTextureFollowObjectRotation) + UNITY_DOTS_INSTANCED_PROP(float, _NoisTexInten) + UNITY_DOTS_INSTANCED_PROP(float, _StraWidt) + UNITY_DOTS_INSTANCED_PROP(float, _NoiTexAffStraWidt) + UNITY_DOTS_INSTANCED_PROP(float, _ShifAnis) + UNITY_DOTS_INSTANCED_PROP(float, _GlossTextureFollowLight) + + UNITY_DOTS_INSTANCED_PROP(float4, _OverallShadowColor) + UNITY_DOTS_INSTANCED_PROP(float, _OverallShadowColorPower) + UNITY_DOTS_INSTANCED_PROP(float, _SelfShadowShadowTAtViewDirection) + UNITY_DOTS_INSTANCED_PROP(float, _ShadowHardness) + UNITY_DOTS_INSTANCED_PROP(float, _SelfShadowRealtimeShadowIntensity) + + UNITY_DOTS_INSTANCED_PROP(float, _SelfShadowThreshold) + UNITY_DOTS_INSTANCED_PROP(float, _VertexColorGreenControlSelfShadowThreshold) + UNITY_DOTS_INSTANCED_PROP(float, _SelfShadowHardness) + UNITY_DOTS_INSTANCED_PROP(float, _LigIgnoYNorDir) + UNITY_DOTS_INSTANCED_PROP(float, _SelfShadowAffectedByLightShadowStrength) + + UNITY_DOTS_INSTANCED_PROP(float, _SelfShadowIntensity) + UNITY_DOTS_INSTANCED_PROP(float4, _SelfShadowColor) + UNITY_DOTS_INSTANCED_PROP(float, _SelfShadowColorPower) + + UNITY_DOTS_INSTANCED_PROP(float4, _SelfShadowRealTimeShadowColor) + UNITY_DOTS_INSTANCED_PROP(float, _SelfShadowRealTimeShadowColorPower) + + UNITY_DOTS_INSTANCED_PROP(float, _SmoothObjectNormal) + UNITY_DOTS_INSTANCED_PROP(float, _VertexColorRedControlSmoothObjectNormal) + UNITY_DOTS_INSTANCED_PROP(float4, _XYZPosition) + UNITY_DOTS_INSTANCED_PROP(float, _ShowNormal) + + UNITY_DOTS_INSTANCED_PROP(float, _ShadowColorTexturePower) + + UNITY_DOTS_INSTANCED_PROP(float, _ShadowTIntensity) + UNITY_DOTS_INSTANCED_PROP(float, _ShadowTLightThreshold) + UNITY_DOTS_INSTANCED_PROP(float, _ShadowTShadowThreshold) + UNITY_DOTS_INSTANCED_PROP(float4, _ShadowTColor) + UNITY_DOTS_INSTANCED_PROP(float, _ShadowTColorPower) + UNITY_DOTS_INSTANCED_PROP(float, _ShadowTHardness) + UNITY_DOTS_INSTANCED_PROP(float, _STIL) + UNITY_DOTS_INSTANCED_PROP(float, _ShowInAmbientLightShadowIntensity) + UNITY_DOTS_INSTANCED_PROP(float, _ShowInAmbientLightShadowThreshold) + UNITY_DOTS_INSTANCED_PROP(float, _LightFalloffAffectShadowT) + + UNITY_DOTS_INSTANCED_PROP(float4, _PTCol) + UNITY_DOTS_INSTANCED_PROP(float, _PTexturePower) + + UNITY_DOTS_INSTANCED_PROP(float, _GIFlatShade) + UNITY_DOTS_INSTANCED_PROP(float, _GIShadeThreshold) + UNITY_DOTS_INSTANCED_PROP(float, _EnvironmentalLightingIntensity) + + UNITY_DOTS_INSTANCED_PROP(float, _LightAffectShadow) + UNITY_DOTS_INSTANCED_PROP(float, _LightIntensity) + UNITY_DOTS_INSTANCED_PROP(float, _DirectionalLightIntensity) + UNITY_DOTS_INSTANCED_PROP(float, _PointSpotlightIntensity) + UNITY_DOTS_INSTANCED_PROP(float, _LightFalloffSoftness) + UNITY_DOTS_INSTANCED_PROP(float, _LLI_Min) + UNITY_DOTS_INSTANCED_PROP(float, _LLI_Max) + + UNITY_DOTS_INSTANCED_PROP(float, _CustomLightDirectionIntensity) + UNITY_DOTS_INSTANCED_PROP(float4, _CustomLightDirection) + UNITY_DOTS_INSTANCED_PROP(float, _CustomLightDirectionFollowObjectRotation) + + UNITY_DOTS_INSTANCED_PROP(float, _ReflectionIntensity) + UNITY_DOTS_INSTANCED_PROP(float, _Smoothness) + UNITY_DOTS_INSTANCED_PROP(float, _RefMetallic) + + UNITY_DOTS_INSTANCED_PROP(float, _RimLigInt) + UNITY_DOTS_INSTANCED_PROP(float, _RimLightUnfill) + UNITY_DOTS_INSTANCED_PROP(float, _RimLightSoftness) + UNITY_DOTS_INSTANCED_PROP(float3, _RimLigPosi) + UNITY_DOTS_INSTANCED_PROP(float, _LightAffectRimLightColor) + UNITY_DOTS_INSTANCED_PROP(float4, _RimLightColor) + UNITY_DOTS_INSTANCED_PROP(float, _RimLightColorPower) + UNITY_DOTS_INSTANCED_PROP(float, _RimLightInLight) + + UNITY_DOTS_INSTANCED_PROP(float, _MinFadDistance) + UNITY_DOTS_INSTANCED_PROP(float, _MaxFadDistance) + + UNITY_DOTS_INSTANCED_PROP(float, _TriPlaTile) + UNITY_DOTS_INSTANCED_PROP(float, _TriPlaBlend) + + UNITY_DOTS_INSTANCED_PROP(float, _PresAdju) + UNITY_DOTS_INSTANCED_PROP(float, _ClipAdju) + UNITY_DOTS_INSTANCED_PROP(float, _PASize) + UNITY_DOTS_INSTANCED_PROP(float, _PASmooTrans) + UNITY_DOTS_INSTANCED_PROP(float, _PADist) + + UNITY_DOTS_INSTANCED_PROP(float4, _PrevPosition) + UNITY_DOTS_INSTANCED_PROP(float4, _ObjPosi) + UNITY_DOTS_INSTANCED_PROP(float, _NoiseSize) + UNITY_DOTS_INSTANCED_PROP(float, _TrailSize) + + UNITY_DOTS_INSTANCED_PROP(float, _TessellationSmoothness) + UNITY_DOTS_INSTANCED_PROP(float, _TessellationTransition) + UNITY_DOTS_INSTANCED_PROP(float, _TessellationNear) + UNITY_DOTS_INSTANCED_PROP(float, _TessellationFar) + UNITY_DOTS_INSTANCED_PROP(float, _NorMapAsDis) + + UNITY_DOTS_INSTANCED_PROP(float3, _ObjectForward); + UNITY_DOTS_INSTANCED_PROP(float3, _ObjectRight); + + UNITY_DOTS_INSTANCED_PROP(float4, _SSAOColor) + + UNITY_DOTS_INSTANCED_PROP(float, _ObjePosiZCS) + + UNITY_DOTS_INSTANCED_PROP_OVERRIDE_SUPPORTED(float, _SkinMatrixIndex) + UNITY_DOTS_INSTANCED_PROP_OVERRIDE_SUPPORTED(float, _ComputeMeshIndex) + +UNITY_DOTS_INSTANCING_END(MaterialPropertyMetadata) + + + +static float4 unity_DOTS_Sampled_MainColor; +static float unity_DOTS_Sampled_MaiColPo; +static float unity_DOTS_Sampled_MVCOL; +static float unity_DOTS_Sampled_MCIALO; +static float unity_DOTS_Sampled_TexturePatternStyle; +static float4 unity_DOTS_Sampled_HighlightColor; +static float unity_DOTS_Sampled_HighlightColorPower; + +static float unity_DOTS_Sampled_OutlineWidth; +static int unity_DOTS_Sampled_OutlineExtrudeMethod; +static float3 unity_DOTS_Sampled_OutlineOffset; +static float3 unity_DOTS_Sampled_OutResi; +static float unity_DOTS_Sampled_OutlineZPostionInCamera; +static float4 unity_DOTS_Sampled_OutlineColor; +static float unity_DOTS_Sampled_MixMainTexToOutline; +static float unity_DOTS_Sampled_NoisyOutlineIntensity; +static float unity_DOTS_Sampled_DynamicNoisyOutline; +static float unity_DOTS_Sampled_LightAffectOutlineColor; +static float unity_DOTS_Sampled_OutlineWidthAffectedByViewDistance; +static float unity_DOTS_Sampled_FarDistanceMaxWidth; +static float unity_DOTS_Sampled_VertexColorBlueAffectOutlineWitdh; + +static float unity_DOTS_Sampled_DepthThreshold; + +static float unity_DOTS_Sampled_MCapIntensity; +static float unity_DOTS_Sampled_SPECMODE; +static float unity_DOTS_Sampled_SPECIN; + +static float unity_DOTS_Sampled_Opacity; +static float unity_DOTS_Sampled_TransparentThreshold; + +static float unity_DOTS_Sampled_Cutout; +static float unity_DOTS_Sampled_AlphaBaseCutout; +static float unity_DOTS_Sampled_UseSecondaryCutout; + +static float unity_DOTS_Sampled_AAS; + +static float4 unity_DOTS_Sampled_Glow_Color; +static float unity_DOTS_Sampled_Glow_Edge_Width; + +static float unity_DOTS_Sampled_NormalMapIntensity; + +static float unity_DOTS_Sampled_Saturation; + +static float unity_DOTS_Sampled_SelfLitIntensity; +static float4 unity_DOTS_Sampled_SelfLitColor; +static float unity_DOTS_Sampled_SelfLitPower; +static float unity_DOTS_Sampled_TEXMCOLINT; +static float unity_DOTS_Sampled_SelfLitHighContrast; + +static float unity_DOTS_Sampled_GlossIntensity; +static float unity_DOTS_Sampled_Glossiness; +static float unity_DOTS_Sampled_GlossSoftness; +static float4 unity_DOTS_Sampled_GlossColor; +static float unity_DOTS_Sampled_GlossColorPower; + +static float unity_DOTS_Sampled_GlossTextureSoftness; +static float unity_DOTS_Sampled_PSGLOTEX; +static float unity_DOTS_Sampled_GlossTextureRotate; +static float unity_DOTS_Sampled_GlossTextureFollowObjectRotation; +static float unity_DOTS_Sampled_NoisTexInten; +static float unity_DOTS_Sampled_StraWidt; +static float unity_DOTS_Sampled_NoiTexAffStraWidt; +static float unity_DOTS_Sampled_ShifAnis; +static float unity_DOTS_Sampled_GlossTextureFollowLight; + +static float4 unity_DOTS_Sampled_OverallShadowColor; +static float unity_DOTS_Sampled_OverallShadowColorPower; +static float unity_DOTS_Sampled_SelfShadowShadowTAtViewDirection; +static float unity_DOTS_Sampled_ShadowHardness; +static float unity_DOTS_Sampled_SelfShadowRealtimeShadowIntensity; + +static float unity_DOTS_Sampled_SelfShadowThreshold; +static float unity_DOTS_Sampled_VertexColorGreenControlSelfShadowThreshold; +static float unity_DOTS_Sampled_SelfShadowHardness; +static float unity_DOTS_Sampled_LigIgnoYNorDir; +static float unity_DOTS_Sampled_SelfShadowAffectedByLightShadowStrength; + +static float unity_DOTS_Sampled_SelfShadowIntensity; +static float4 unity_DOTS_Sampled_SelfShadowColor; +static float unity_DOTS_Sampled_SelfShadowColorPower; + +static float4 unity_DOTS_Sampled_SelfShadowRealTimeShadowColor; +static float unity_DOTS_Sampled_SelfShadowRealTimeShadowColorPower; + +static float unity_DOTS_Sampled_SmoothObjectNormal; +static float unity_DOTS_Sampled_VertexColorRedControlSmoothObjectNormal; +static float4 unity_DOTS_Sampled_XYZPosition; +static float unity_DOTS_Sampled_ShowNormal; + +static float unity_DOTS_Sampled_ShadowColorTexturePower; + +static float unity_DOTS_Sampled_ShadowTIntensity; +static float unity_DOTS_Sampled_ShadowTLightThreshold; +static float unity_DOTS_Sampled_ShadowTShadowThreshold; +static float4 unity_DOTS_Sampled_ShadowTColor; +static float unity_DOTS_Sampled_ShadowTColorPower; +static float unity_DOTS_Sampled_ShadowTHardness; +static float unity_DOTS_Sampled_STIL; +static float unity_DOTS_Sampled_ShowInAmbientLightShadowIntensity; +static float unity_DOTS_Sampled_ShowInAmbientLightShadowThreshold; +static float unity_DOTS_Sampled_LightFalloffAffectShadowT; + +static float4 unity_DOTS_Sampled_PTCol; +static float unity_DOTS_Sampled_PTexturePower; + +static float unity_DOTS_Sampled_GIFlatShade; +static float unity_DOTS_Sampled_GIShadeThreshold; +static float unity_DOTS_Sampled_EnvironmentalLightingIntensity; + +static float unity_DOTS_Sampled_LightAffectShadow; +static float unity_DOTS_Sampled_LightIntensity; +static float unity_DOTS_Sampled_DirectionalLightIntensity; +static float unity_DOTS_Sampled_PointSpotlightIntensity; +static float unity_DOTS_Sampled_LightFalloffSoftness; +static float unity_DOTS_Sampled_LLI_Min; +static float unity_DOTS_Sampled_LLI_Max; + +static float unity_DOTS_Sampled_CustomLightDirectionIntensity; +static float4 unity_DOTS_Sampled_CustomLightDirection; +static float unity_DOTS_Sampled_CustomLightDirectionFollowObjectRotation; + +static float unity_DOTS_Sampled_ReflectionIntensity; +static float unity_DOTS_Sampled_Smoothness; +static float unity_DOTS_Sampled_RefMetallic; + +static float unity_DOTS_Sampled_RimLigInt; +static float unity_DOTS_Sampled_RimLightUnfill; +static float unity_DOTS_Sampled_RimLightSoftness; +static float3 unity_DOTS_Sampled_RimLigPosi; +static float unity_DOTS_Sampled_LightAffectRimLightColor; +static float4 unity_DOTS_Sampled_RimLightColor; +static float unity_DOTS_Sampled_RimLightColorPower; +static float unity_DOTS_Sampled_RimLightInLight; + +static float unity_DOTS_Sampled_MinFadDistance; +static float unity_DOTS_Sampled_MaxFadDistance; + +static float unity_DOTS_Sampled_TriPlaTile; +static float unity_DOTS_Sampled_TriPlaBlend; + +static float unity_DOTS_Sampled_PresAdju; +static float unity_DOTS_Sampled_ClipAdju; +static float unity_DOTS_Sampled_PASize; +static float unity_DOTS_Sampled_PASmooTrans; +static float unity_DOTS_Sampled_PADist; + +static float4 unity_DOTS_Sampled_PrevPosition; +static float4 unity_DOTS_Sampled_ObjPosi; +static float unity_DOTS_Sampled_NoiseSize; +static float unity_DOTS_Sampled_TrailSize; + +static float unity_DOTS_Sampled_TessellationSmoothness; +static float unity_DOTS_Sampled_TessellationTransition; +static float unity_DOTS_Sampled_TessellationNear; +static float unity_DOTS_Sampled_TessellationFar; +static float unity_DOTS_Sampled_NorMapAsDis; + +static float3 unity_DOTS_Sampled_ObjectForward; +static float3 unity_DOTS_Sampled_ObjectRight; + +static float4 unity_DOTS_Sampled_SSAOColor; + +static float unity_DOTS_Sampled_ObjePosiZCS; + + +void SetupDOTSLitMaterialPropertyCaches() +{ + unity_DOTS_Sampled_MainColor = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float4, _MainColor); + unity_DOTS_Sampled_MaiColPo = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _MaiColPo); + unity_DOTS_Sampled_MVCOL = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _MVCOL); + unity_DOTS_Sampled_MCIALO = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _MCIALO); + unity_DOTS_Sampled_TexturePatternStyle = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _TexturePatternStyle); + unity_DOTS_Sampled_HighlightColor = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float4, _HighlightColor); + unity_DOTS_Sampled_HighlightColorPower = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _HighlightColorPower); + + unity_DOTS_Sampled_OutlineWidth = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _OutlineWidth); + unity_DOTS_Sampled_OutlineExtrudeMethod = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(int, _OutlineExtrudeMethod); + unity_DOTS_Sampled_OutlineOffset = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float3, _OutlineOffset); + unity_DOTS_Sampled_OutResi = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float3, _OutResi); + unity_DOTS_Sampled_OutlineZPostionInCamera = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _OutlineZPostionInCamera); + unity_DOTS_Sampled_OutlineColor = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float4, _OutlineColor); + unity_DOTS_Sampled_MixMainTexToOutline = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _MixMainTexToOutline); + unity_DOTS_Sampled_NoisyOutlineIntensity = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _NoisyOutlineIntensity); + unity_DOTS_Sampled_DynamicNoisyOutline = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _DynamicNoisyOutline); + unity_DOTS_Sampled_LightAffectOutlineColor = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _LightAffectOutlineColor); + unity_DOTS_Sampled_OutlineWidthAffectedByViewDistance = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _OutlineWidthAffectedByViewDistance); + unity_DOTS_Sampled_FarDistanceMaxWidth = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _FarDistanceMaxWidth); + unity_DOTS_Sampled_VertexColorBlueAffectOutlineWitdh = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _VertexColorBlueAffectOutlineWitdh); + + unity_DOTS_Sampled_DepthThreshold = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _DepthThreshold); + + unity_DOTS_Sampled_MCapIntensity = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _MCapIntensity); + unity_DOTS_Sampled_SPECMODE = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _SPECMODE); + unity_DOTS_Sampled_SPECIN = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _SPECIN); + + unity_DOTS_Sampled_Opacity = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _Opacity); + unity_DOTS_Sampled_TransparentThreshold = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _TransparentThreshold); + + unity_DOTS_Sampled_Cutout = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _Cutout); + unity_DOTS_Sampled_AlphaBaseCutout = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _AlphaBaseCutout); + unity_DOTS_Sampled_UseSecondaryCutout = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _UseSecondaryCutout); + + unity_DOTS_Sampled_AAS = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _AAS); + + unity_DOTS_Sampled_Glow_Color = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float4, _Glow_Color); + unity_DOTS_Sampled_Glow_Edge_Width = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _Glow_Edge_Width); + + unity_DOTS_Sampled_NormalMapIntensity = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _NormalMapIntensity); + + unity_DOTS_Sampled_Saturation = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _Saturation); + + unity_DOTS_Sampled_SelfLitIntensity = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _SelfLitIntensity); + unity_DOTS_Sampled_SelfLitColor = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float4, _SelfLitColor); + unity_DOTS_Sampled_SelfLitPower = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _SelfLitPower); + unity_DOTS_Sampled_TEXMCOLINT = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _TEXMCOLINT); + unity_DOTS_Sampled_SelfLitHighContrast = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _SelfLitHighContrast); + + unity_DOTS_Sampled_GlossIntensity = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _GlossIntensity); + unity_DOTS_Sampled_Glossiness = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _Glossiness); + unity_DOTS_Sampled_GlossSoftness = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _GlossSoftness); + unity_DOTS_Sampled_GlossColor = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float4, _GlossColor); + unity_DOTS_Sampled_GlossColorPower = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _GlossColorPower); + + unity_DOTS_Sampled_GlossTextureSoftness = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _GlossTextureSoftness); + unity_DOTS_Sampled_PSGLOTEX = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _PSGLOTEX); + unity_DOTS_Sampled_GlossTextureRotate = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _GlossTextureRotate); + unity_DOTS_Sampled_GlossTextureFollowObjectRotation = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _GlossTextureFollowObjectRotation); + unity_DOTS_Sampled_NoisTexInten = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _NoisTexInten); + unity_DOTS_Sampled_StraWidt = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _StraWidt); + unity_DOTS_Sampled_NoiTexAffStraWidt = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _NoiTexAffStraWidt); + unity_DOTS_Sampled_ShifAnis = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _ShifAnis); + unity_DOTS_Sampled_GlossTextureFollowLight = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _GlossTextureFollowLight); + + unity_DOTS_Sampled_OverallShadowColor = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float4, _OverallShadowColor); + unity_DOTS_Sampled_OverallShadowColorPower = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _OverallShadowColorPower); + unity_DOTS_Sampled_SelfShadowShadowTAtViewDirection = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _SelfShadowShadowTAtViewDirection); + unity_DOTS_Sampled_ShadowHardness = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _ShadowHardness); + unity_DOTS_Sampled_SelfShadowRealtimeShadowIntensity = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _SelfShadowRealtimeShadowIntensity); + + unity_DOTS_Sampled_SelfShadowThreshold = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _SelfShadowThreshold); + unity_DOTS_Sampled_VertexColorGreenControlSelfShadowThreshold = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _VertexColorGreenControlSelfShadowThreshold); + unity_DOTS_Sampled_SelfShadowHardness = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _SelfShadowHardness); + unity_DOTS_Sampled_LigIgnoYNorDir = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _LigIgnoYNorDir); + unity_DOTS_Sampled_SelfShadowAffectedByLightShadowStrength = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _SelfShadowAffectedByLightShadowStrength); + + unity_DOTS_Sampled_SelfShadowIntensity = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _SelfShadowIntensity); + unity_DOTS_Sampled_SelfShadowColor = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float4, _SelfShadowColor); + unity_DOTS_Sampled_SelfShadowColorPower = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _SelfShadowColorPower); + + unity_DOTS_Sampled_SelfShadowRealTimeShadowColor = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float4, _SelfShadowRealTimeShadowColor); + unity_DOTS_Sampled_SelfShadowRealTimeShadowColorPower = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _SelfShadowRealTimeShadowColorPower); + + unity_DOTS_Sampled_SmoothObjectNormal = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _SmoothObjectNormal); + unity_DOTS_Sampled_VertexColorRedControlSmoothObjectNormal = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _VertexColorRedControlSmoothObjectNormal); + unity_DOTS_Sampled_XYZPosition = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float4, _XYZPosition); + unity_DOTS_Sampled_ShowNormal = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _ShowNormal); + + unity_DOTS_Sampled_ShadowColorTexturePower = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _ShadowColorTexturePower); + + unity_DOTS_Sampled_ShadowTIntensity = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _ShadowTIntensity); + unity_DOTS_Sampled_ShadowTLightThreshold = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _ShadowTLightThreshold); + unity_DOTS_Sampled_ShadowTShadowThreshold = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _ShadowTShadowThreshold); + unity_DOTS_Sampled_ShadowTColor = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float4, _ShadowTColor); + unity_DOTS_Sampled_ShadowTColorPower = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _ShadowTColorPower); + unity_DOTS_Sampled_ShadowTHardness = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _ShadowTHardness); + unity_DOTS_Sampled_STIL = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _STIL); + unity_DOTS_Sampled_ShowInAmbientLightShadowIntensity = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _ShowInAmbientLightShadowIntensity); + unity_DOTS_Sampled_ShowInAmbientLightShadowThreshold = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _ShowInAmbientLightShadowThreshold); + unity_DOTS_Sampled_LightFalloffAffectShadowT = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _LightFalloffAffectShadowT); + + unity_DOTS_Sampled_PTCol = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float4, _PTCol); + unity_DOTS_Sampled_PTexturePower = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _PTexturePower); + + unity_DOTS_Sampled_GIFlatShade = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _GIFlatShade); + unity_DOTS_Sampled_GIShadeThreshold = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _GIShadeThreshold); + unity_DOTS_Sampled_EnvironmentalLightingIntensity = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _EnvironmentalLightingIntensity); + + unity_DOTS_Sampled_LightAffectShadow = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _LightAffectShadow); + unity_DOTS_Sampled_LightIntensity = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _LightIntensity); + unity_DOTS_Sampled_DirectionalLightIntensity = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _DirectionalLightIntensity); + unity_DOTS_Sampled_PointSpotlightIntensity = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _PointSpotlightIntensity); + unity_DOTS_Sampled_LightFalloffSoftness = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _LightFalloffSoftness); + unity_DOTS_Sampled_LLI_Min = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _LLI_Min); + unity_DOTS_Sampled_LLI_Max = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _LLI_Max); + + unity_DOTS_Sampled_CustomLightDirectionIntensity = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _CustomLightDirectionIntensity); + unity_DOTS_Sampled_CustomLightDirection = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float4, _CustomLightDirection); + unity_DOTS_Sampled_CustomLightDirectionFollowObjectRotation = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _CustomLightDirectionFollowObjectRotation); + + unity_DOTS_Sampled_ReflectionIntensity = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _ReflectionIntensity); + unity_DOTS_Sampled_Smoothness = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _Smoothness); + unity_DOTS_Sampled_RefMetallic = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _RefMetallic); + + unity_DOTS_Sampled_RimLigInt = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _RimLigInt); + unity_DOTS_Sampled_RimLightUnfill = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _RimLightUnfill); + unity_DOTS_Sampled_RimLightSoftness = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _RimLightSoftness); + unity_DOTS_Sampled_RimLigPosi = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float3, _RimLigPosi); + unity_DOTS_Sampled_LightAffectRimLightColor = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _LightAffectRimLightColor); + unity_DOTS_Sampled_RimLightColor = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float4, _RimLightColor); + unity_DOTS_Sampled_RimLightColorPower = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _RimLightColorPower); + unity_DOTS_Sampled_RimLightInLight = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _RimLightInLight); + + unity_DOTS_Sampled_MinFadDistance = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _MinFadDistance); + unity_DOTS_Sampled_MaxFadDistance = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _MaxFadDistance); + + unity_DOTS_Sampled_MinFadDistance = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _MinFadDistance); + unity_DOTS_Sampled_MaxFadDistance = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _MaxFadDistance); + + unity_DOTS_Sampled_TriPlaTile = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _TriPlaTile); + unity_DOTS_Sampled_TriPlaBlend = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _TriPlaBlend); + + unity_DOTS_Sampled_PresAdju = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _PresAdju); + unity_DOTS_Sampled_ClipAdju = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _ClipAdju); + unity_DOTS_Sampled_PASize = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _PASize); + unity_DOTS_Sampled_PASmooTrans = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _PASmooTrans); + unity_DOTS_Sampled_PADist = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _PADist); + + unity_DOTS_Sampled_PrevPosition = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float4, _PrevPosition); + unity_DOTS_Sampled_ObjPosi = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float4, _ObjPosi); + unity_DOTS_Sampled_NoiseSize = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _NoiseSize); + unity_DOTS_Sampled_TrailSize = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _TrailSize); + + unity_DOTS_Sampled_TessellationSmoothness = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _TessellationSmoothness); + unity_DOTS_Sampled_TessellationTransition = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _TessellationTransition); + unity_DOTS_Sampled_TessellationNear = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _TessellationNear); + unity_DOTS_Sampled_TessellationFar = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _TessellationFar); + unity_DOTS_Sampled_NorMapAsDis = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _NorMapAsDis); + + unity_DOTS_Sampled_ObjectForward = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float3, _ObjectForward); + unity_DOTS_Sampled_ObjectRight = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float3, _ObjectRight); + + unity_DOTS_Sampled_SSAOColor = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float4, _SSAOColor); + + unity_DOTS_Sampled_ObjePosiZCS = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _ObjePosiZCS); + +} + + + +#undef UNITY_SETUP_DOTS_MATERIAL_PROPERTY_CACHES +#define UNITY_SETUP_DOTS_MATERIAL_PROPERTY_CACHES() SetupDOTSLitMaterialPropertyCaches() + +#define _MainColor unity_DOTS_Sampled_MainColor +#define _MaiColPo unity_DOTS_Sampled_MaiColPo +#define _MVCOL unity_DOTS_Sampled_MVCOL +#define _MCIALO unity_DOTS_Sampled_MCIALO +#define _TexturePatternStyle unity_DOTS_Sampled_TexturePatternStyle +#define _HighlightColor unity_DOTS_Sampled_HighlightColor +#define _HighlightColorPower unity_DOTS_Sampled_HighlightColorPower + +#define _OutlineWidth unity_DOTS_Sampled_OutlineWidth +#define _OutlineExtrudeMethod unity_DOTS_Sampled_OutlineExtrudeMethod +#define _OutlineOffset unity_DOTS_Sampled_OutlineOffset +#define _OutResi unity_DOTS_Sampled_OutResi +#define _OutlineZPostionInCamera unity_DOTS_Sampled_OutlineZPostionInCamera +#define _OutlineColor unity_DOTS_Sampled_OutlineColor +#define _MixMainTexToOutline unity_DOTS_Sampled_MixMainTexToOutline +#define _NoisyOutlineIntensity unity_DOTS_Sampled_NoisyOutlineIntensity +#define _DynamicNoisyOutline unity_DOTS_Sampled_DynamicNoisyOutline +#define _LightAffectOutlineColor unity_DOTS_Sampled_LightAffectOutlineColor +#define _OutlineWidthAffectedByViewDistance unity_DOTS_Sampled_OutlineWidthAffectedByViewDistance +#define _FarDistanceMaxWidth unity_DOTS_Sampled_FarDistanceMaxWidth +#define _VertexColorBlueAffectOutlineWitdh unity_DOTS_Sampled_VertexColorBlueAffectOutlineWitdh + +#define _DepthThreshold unity_DOTS_Sampled_DepthThreshold + +#define _MCapIntensity unity_DOTS_Sampled_MCapIntensity +#define _SPECMODE unity_DOTS_Sampled_SPECMODE +#define _SPECIN unity_DOTS_Sampled_SPECIN + +#define _Opacity unity_DOTS_Sampled_Opacity +#define _TransparentThreshold unity_DOTS_Sampled_TransparentThreshold + +#define _Cutout unity_DOTS_Sampled_Cutout +#define _AlphaBaseCutout unity_DOTS_Sampled_AlphaBaseCutout +#define _UseSecondaryCutout unity_DOTS_Sampled_UseSecondaryCutout + +#define _AAS unity_DOTS_Sampled_AAS + +#define _Glow_Color unity_DOTS_Sampled_Glow_Color +#define _Glow_Edge_Width unity_DOTS_Sampled_Glow_Edge_Width + +#define _NormalMapIntensity unity_DOTS_Sampled_NormalMapIntensity + +#define _Saturation unity_DOTS_Sampled_Saturation + +#define _SelfLitIntensity unity_DOTS_Sampled_SelfLitIntensity +#define _SelfLitColor unity_DOTS_Sampled_SelfLitColor +#define _SelfLitPower unity_DOTS_Sampled_SelfLitPower +#define _TEXMCOLINT unity_DOTS_Sampled_TEXMCOLINT +#define _SelfLitHighContrast unity_DOTS_Sampled_SelfLitHighContrast + +#define _GlossIntensity unity_DOTS_Sampled_GlossIntensity +#define _Glossiness unity_DOTS_Sampled_Glossiness +#define _GlossSoftness unity_DOTS_Sampled_GlossSoftness +#define _GlossColor unity_DOTS_Sampled_GlossColor +#define _GlossColorPower unity_DOTS_Sampled_GlossColorPower + +#define _GlossTextureSoftness unity_DOTS_Sampled_GlossTextureSoftness +#define _PSGLOTEX unity_DOTS_Sampled_PSGLOTEX +#define _GlossTextureRotate unity_DOTS_Sampled_GlossTextureRotate +#define _GlossTextureFollowObjectRotation unity_DOTS_Sampled_GlossTextureFollowObjectRotation +#define _NoisTexInten unity_DOTS_Sampled_NoisTexInten +#define _StraWidt unity_DOTS_Sampled_StraWidt +#define _NoiTexAffStraWidt unity_DOTS_Sampled_NoiTexAffStraWidt +#define _ShifAnis unity_DOTS_Sampled_ShifAnis +#define _GlossTextureFollowLight unity_DOTS_Sampled_GlossTextureFollowLight + +#define _OverallShadowColor unity_DOTS_Sampled_OverallShadowColor +#define _OverallShadowColorPower unity_DOTS_Sampled_OverallShadowColorPower +#define _SelfShadowShadowTAtViewDirection unity_DOTS_Sampled_SelfShadowShadowTAtViewDirection +#define _ShadowHardness unity_DOTS_Sampled_ShadowHardness +#define _SelfShadowRealtimeShadowIntensity unity_DOTS_Sampled_SelfShadowRealtimeShadowIntensity + +#define _SelfShadowThreshold unity_DOTS_Sampled_SelfShadowThreshold +#define _VertexColorGreenControlSelfShadowThreshold unity_DOTS_Sampled_VertexColorGreenControlSelfShadowThreshold +#define _SelfShadowHardness unity_DOTS_Sampled_SelfShadowHardness +#define _LigIgnoYNorDir unity_DOTS_Sampled_LigIgnoYNorDir +#define _SelfShadowAffectedByLightShadowStrength unity_DOTS_Sampled_SelfShadowAffectedByLightShadowStrength + +#define _SelfShadowIntensity unity_DOTS_Sampled_SelfShadowIntensity +#define _SelfShadowColor unity_DOTS_Sampled_SelfShadowColor +#define _SelfShadowColorPower unity_DOTS_Sampled_SelfShadowColorPower + +#define _SelfShadowRealTimeShadowColor unity_DOTS_Sampled_SelfShadowRealTimeShadowColor +#define _SelfShadowRealTimeShadowColorPower unity_DOTS_Sampled_SelfShadowRealTimeShadowColorPower + +#define _SmoothObjectNormal unity_DOTS_Sampled_SmoothObjectNormal +#define _VertexColorRedControlSmoothObjectNormal unity_DOTS_Sampled_VertexColorRedControlSmoothObjectNormal +#define _XYZPosition unity_DOTS_Sampled_XYZPosition +#define _ShowNormal unity_DOTS_Sampled_ShowNormal + +#define _ShadowColorTexturePower unity_DOTS_Sampled_ShadowColorTexturePower + +#define _ShadowTIntensity unity_DOTS_Sampled_ShadowTIntensity +#define _ShadowTLightThreshold unity_DOTS_Sampled_ShadowTLightThreshold +#define _ShadowTShadowThreshold unity_DOTS_Sampled_ShadowTShadowThreshold +#define _ShadowTColor unity_DOTS_Sampled_ShadowTColor +#define _ShadowTColorPower unity_DOTS_Sampled_ShadowTColorPower +#define _ShadowTHardness unity_DOTS_Sampled_ShadowTHardness +#define _STIL unity_DOTS_Sampled_STIL +#define _ShowInAmbientLightShadowIntensity unity_DOTS_Sampled_ShowInAmbientLightShadowIntensity +#define _ShowInAmbientLightShadowThreshold unity_DOTS_Sampled_ShowInAmbientLightShadowThreshold +#define _LightFalloffAffectShadowT unity_DOTS_Sampled_LightFalloffAffectShadowT + +#define _PTCol unity_DOTS_Sampled_PTCol +#define _PTexturePower unity_DOTS_Sampled_PTexturePower + +#define _GIFlatShade unity_DOTS_Sampled_GIFlatShade +#define _GIShadeThreshold unity_DOTS_Sampled_GIShadeThreshold +#define _EnvironmentalLightingIntensity unity_DOTS_Sampled_EnvironmentalLightingIntensity + +#define _LightAffectShadow unity_DOTS_Sampled_LightAffectShadow +#define _LightIntensity unity_DOTS_Sampled_LightIntensity +#define _DirectionalLightIntensity unity_DOTS_Sampled_DirectionalLightIntensity +#define _PointSpotlightIntensity unity_DOTS_Sampled_PointSpotlightIntensity +#define _LightFalloffSoftness unity_DOTS_Sampled_LightFalloffSoftness +#define _LLI_Min unity_DOTS_Sampled_LLI_Min +#define _LLI_Max unity_DOTS_Sampled_LLI_Max + +#define _CustomLightDirectionIntensity unity_DOTS_Sampled_CustomLightDirectionIntensity +#define _CustomLightDirection unity_DOTS_Sampled_CustomLightDirection +#define _CustomLightDirectionFollowObjectRotation unity_DOTS_Sampled_CustomLightDirectionFollowObjectRotation + +#define _ReflectionIntensity unity_DOTS_Sampled_ReflectionIntensity +#define _Smoothness unity_DOTS_Sampled_Smoothness +#define _RefMetallic unity_DOTS_Sampled_RefMetallic + +#define _RimLigInt unity_DOTS_Sampled_RimLigInt +#define _RimLightUnfill unity_DOTS_Sampled_RimLightUnfill +#define _RimLightSoftness unity_DOTS_Sampled_RimLightSoftness +#define _RimLigPosi unity_DOTS_Sampled_RimLigPosi +#define _LightAffectRimLightColor unity_DOTS_Sampled_LightAffectRimLightColor +#define _RimLightColor unity_DOTS_Sampled_RimLightColor +#define _RimLightColorPower unity_DOTS_Sampled_RimLightColorPower +#define _RimLightInLight unity_DOTS_Sampled_RimLightInLight + +#define _MinFadDistance unity_DOTS_Sampled_MinFadDistance +#define _MaxFadDistance unity_DOTS_Sampled_MaxFadDistance + +#define _TriPlaTile unity_DOTS_Sampled_TriPlaTile +#define _TriPlaBlend unity_DOTS_Sampled_TriPlaBlend + +#define _PresAdju unity_DOTS_Sampled_PresAdju +#define _ClipAdju unity_DOTS_Sampled_ClipAdju +#define _PASize unity_DOTS_Sampled_PASize +#define _PASmooTrans unity_DOTS_Sampled_PASmooTrans +#define _PADist unity_DOTS_Sampled_PADist + +#define _PrevPosition unity_DOTS_Sampled_PrevPosition +#define _ObjPosi unity_DOTS_Sampled_ObjPosi +#define _NoiseSize unity_DOTS_Sampled_NoiseSize +#define _TrailSize unity_DOTS_Sampled_TrailSize + +#define _TessellationSmoothness unity_DOTS_Sampled_TessellationSmoothness +#define _TessellationTransition unity_DOTS_Sampled_TessellationTransition +#define _TessellationNear unity_DOTS_Sampled_TessellationNear +#define _TessellationFar unity_DOTS_Sampled_TessellationFar +#define _NorMapAsDis unity_DOTS_Sampled_NorMapAsDis + +#define _ObjectForward unity_DOTS_Sampled_ObjectForward +#define _ObjectRight unity_DOTS_Sampled_ObjectRight + +#define _SSAOColor unity_DOTS_Sampled_SSAOColor + +#define _ObjePosiZCS unity_DOTS_Sampled_ObjePosiZCS + +//========= + + + +#define UNITY_ACCESS_HYBRID_INSTANCED_PROP(var, type) UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(type, var) +#elif defined(UNITY_INSTANCING_ENABLED) + +UNITY_INSTANCING_BUFFER_START(DOTSMESDEF) + UNITY_DEFINE_INSTANCED_PROP(float, _SkinMatrixIndex) + UNITY_DEFINE_INSTANCED_PROP(float, _ComputeMeshIndex) +UNITY_INSTANCING_BUFFER_END(DOTSMESDEF) + +#define UNITY_ACCESS_HYBRID_INSTANCED_PROP(var, type) UNITY_ACCESS_INSTANCED_PROP(DOTSMESDEF, var) +#else +#define UNITY_ACCESS_HYBRID_INSTANCED_PROP(var, type) var + +//========= + +#endif + +//=============================================================================== +//Non CBUF +//=============================================================================== + +TEXTURE2D(_MainTex); +SAMPLER(sampler_MainTex); + +TEXTURE2D(_MaskTransparency); +SAMPLER(sampler_MaskTransparency); + +TEXTURE2D(_OutlineWidthControl); +SAMPLER(sampler_OutlineWidthControl); + +#if N_F_MC_ON + TEXTURE2D(_MCap); + SAMPLER(sampler_MCap); + + TEXTURE2D(_MCapMask); + SAMPLER(sampler_MCapMask); +#endif + +#if N_F_CO_ON + TEXTURE2D(_SecondaryCutout); + SAMPLER(sampler_SecondaryCutout); +#endif + +#if N_F_NM_ON//NMKW + TEXTURE2D(_NormalMap); + SAMPLER(sampler_NormalMap); +#endif//NMKW_END + +#if N_F_SL_ON + TEXTURE2D(_MaskSelfLit); + SAMPLER(sampler_MaskSelfLit); +#endif + +#if N_F_GLO_ON + TEXTURE2D(_MaskGloss); + SAMPLER(sampler_MaskGloss); +#endif + +#if N_F_GLO_ON + #if N_F_GLOT_ON + TEXTURE2D(_GlossTexture); + SAMPLER(sampler_GlossTexture); + #endif +#endif + +#if N_F_SCT_ON + TEXTURE2D(_ShadowColorTexture); + SAMPLER(sampler_ShadowColorTexture); +#endif + +#if N_F_ST_ON + TEXTURE2D(_ShadowT); + SAMPLER(sampler_ShadowT); +#endif + +#if N_F_PT_ON + TEXTURE2D(_PTexture); + SAMPLER(sampler_PTexture); +#endif + +#if N_F_R_ON + TEXTURE2D(_MaskReflection); + SAMPLER(sampler_MaskReflection); +#endif + +#if N_F_R_ON + #if N_F_FR_ON + TEXTURE2D(_FReflection); + SAMPLER(sampler_FReflection); + #endif +#endif \ No newline at end of file diff --git a/Assets/RealToon/RealToon Shaders/RealToon Core/URP/RT_URP_PROP.hlsl.meta b/Assets/RealToon/RealToon Shaders/RealToon Core/URP/RT_URP_PROP.hlsl.meta new file mode 100644 index 00000000..782b06fe --- /dev/null +++ b/Assets/RealToon/RealToon Shaders/RealToon Core/URP/RT_URP_PROP.hlsl.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 1a20f2a1310293740b6c544a6fcc743b +ShaderIncludeImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/RealToon/RealToon Shaders/Version 5.meta b/Assets/RealToon/RealToon Shaders/Version 5.meta new file mode 100644 index 00000000..fb60a9f4 --- /dev/null +++ b/Assets/RealToon/RealToon Shaders/Version 5.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8497c11f969648345ad12907c231c4fb +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/RealToon/RealToon Shaders/Version 5/URP.meta b/Assets/RealToon/RealToon Shaders/Version 5/URP.meta new file mode 100644 index 00000000..3d0c5258 --- /dev/null +++ b/Assets/RealToon/RealToon Shaders/Version 5/URP.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b16c77ce949ee0a43928e9c25337dc17 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/RealToon/RealToon Shaders/Version 5/URP/Default.meta b/Assets/RealToon/RealToon Shaders/Version 5/URP/Default.meta new file mode 100644 index 00000000..376325a3 --- /dev/null +++ b/Assets/RealToon/RealToon Shaders/Version 5/URP/Default.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: af6b8ee8c8c38f34c86b4d2433e09c91 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader b/Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader new file mode 100644 index 00000000..b6f1b3d2 --- /dev/null +++ b/Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader @@ -0,0 +1,4184 @@ +//RealToon V5.0.15 (URP) +//MJQStudioWorks +//Âİ2026 + +Shader "Universal Render Pipeline/RealToon/Version 5/Default/Default" +{ + Properties + { + + [Enum(UnityEngine.Rendering.CullMode)] _Culling("Culling", int) = 2 + [KeywordEnum(UV0, UV1)] _UVSet("UV Set", Float) = 0 + + [Toggle(N_F_TRANS_ON)] _TRANSMODE("Transparent Mode", Float) = 0.0 + + _MainTex ("Texture", 2D) = "white" {} + [RTToggleOption] _TexturePatternStyle ("Texture Pattern Style", Float ) = 0.0 + [HDR] _MainColor ("Main Color", Color) = (1.0,1.0,1.0,1.0) + _MaiColPo("Main Color Power", Float) = 0.8 + + [RTToggleOption] _MVCOL ("Mix Vertex Color", Float ) = 0.0 + + [RTToggleOption] _MCIALO ("Main Color In Ambient Light Only", Float ) = 0.0 + + [HDR] _HighlightColor ("Highlight Color", Color) = (1.0,1.0,1.0,1.0) + _HighlightColorPower ("Highlight Color Power", Float ) = 1.0 + + _MCapIntensity ("Intensity", Range(0, 1)) = 1.0 + _MCap ("MatCap", 2D) = "white" {} + [RTToggleOption] _SPECMODE ("Specular Mode", Float ) = 0.0 + _SPECIN ("Specular Power", Float ) = 1 + _MCapMask ("Mask MatCap", 2D) = "white" {} + + _Cutout ("Cutout", Range(0, 1)) = 0.5 + [RTToggleOption] _AlphaBaseCutout ("Alpha Base Cutout", Float ) = 1.0 + [Toggle(N_F_SCO_ON)] _N_F_SCO ("Soft Cutout", Float ) = 0.0 + [Toggle(N_F_ATC_ON)] _AlpToCov("Anti - Aliasing Affect Cutout", int) = 0 + _AAS ("Anti - Aliasing Softness", Range(0.0001, 1)) = 0.0001 + [RTToggleOption] _UseSecondaryCutout ("Use Secondary Cutout Only", Float ) = 0.0 + _SecondaryCutout ("Secondary Cutout", 2D) = "white" {} + + [Toggle(N_F_COEDGL_ON)] _N_F_COEDGL("Enable Glow Edge", Float) = 0.0 + [HDR] _Glow_Color("Glow Color", Color) = (1.0,1.0,1.0,1.0) + _Glow_Edge_Width("Glow Edge Width", Float) = 1.0 + + [Toggle(N_F_SIMTRANS_ON)] _SimTrans("Simple Transparency Mode", Float) = 0.0 + _Opacity("Opacity", Range(0, 1)) = 1.0 + _TransparentThreshold("Transparent Threshold", Float) = 0.0 + + [Enum(UnityEngine.Rendering.BlendMode)] _BleModSour("Blend - Source", int) = 1 + [Enum(UnityEngine.Rendering.BlendMode)] _BleModDest("Blend - Destination", int) = 0 + + _MaskTransparency("Mask Transparency", 2D) = "black" {} + + [Toggle(N_F_TRANSAFFSHA_ON)] _TransAffSha("Affect Shadow", Float) = 1.0 + + _NormalMap ("Normal Map", 2D) = "bump" {} + _NormalMapIntensity ("Normal Map Intensity", Float ) = 1.0 + + _Saturation ("Saturation", Range(0, 2)) = 1.0 + + _OutlineWidth ("Width", Float ) = 0.5 + _OutlineWidthControl ("Width Control", 2D) = "white" {} + + [Enum(Normal,0,Origin,1)] _OutlineExtrudeMethod("Outline Extrude Method", int) = 0 + + _OutlineOffset ("Outline Offset", Vector) = (0,0,0) + _OutResi ("Outline Resize", Vector) = (1,1,1) + _OutlineZPostionInCamera ("Outline Z Position In Camera", Float) = 0.0 + + [Enum(Off,1,On,0)] _DoubleSidedOutline("Double Sided Outline", int) = 1 + + [HDR] _OutlineColor ("Color", Color) = (0.0,0.0,0.0,1.0) + + [RTToggleOption] _MixMainTexToOutline ("Mix Main Texture To Outline", Float ) = 0.0 + + _NoisyOutlineIntensity ("Noisy Outline Intensity", Range(0, 1)) = 0.0 + [Toggle(N_F_DNO_ON)] _DynamicNoisyOutline ("Dynamic Noisy Outline", Float ) = 0.0 + [RTToggleOption] _LightAffectOutlineColor ("Light Affect Outline Color", Float ) = 0.0 + + [RTToggleOption] _OutlineWidthAffectedByViewDistance ("Outline Width Affected By View Distance", Float ) = 0.0 + + [RTToggleOption] _VertexColorBlueAffectOutlineWitdh ("Vertex Color Blue Affect Outline Witdh", Float ) = 0.0 + + _DepthThreshold("Depth Threshold", Float) = 900.0 + + [Toggle(N_F_O_MOTTSO_ON)] _N_F_MSSOLTFO("Mix Outline To The Shader Output", Float) = 0.0 + + [Enum(UnityEngine.Rendering.StencilOp)] _OutStenPass("Stencil: Pass", int) = 0 + [Enum(On, 1, Off, 0)] _OutZWrite("ZWrite", int) = 1 + [Enum(UnityEngine.Rendering.CompareFunction)] _OutZTest("ZTest", int) = 4 + _FarDistanceMaxWidth ("Far Distance Max Width", Float ) = 10.0 + + _SelfLitIntensity ("Intensity", Range(0, 1)) = 0.0 + [HDR] _SelfLitColor ("Color", Color) = (1.0,1.0,1.0,1.0) + _SelfLitPower ("Power", Float ) = 2.0 + _TEXMCOLINT ("Texture and Main Color Intensity", Float ) = 1.0 + [RTToggleOption] _SelfLitHighContrast ("High Contrast", Float ) = 1.0 + [Toggle(N_F_SLMM_ON)] _N_F_SLMM ("Map Mode", Float ) = 0.0 + _MaskSelfLit ("Mask Self Lit", 2D) = "white" {} + + _GlossIntensity ("Gloss Intensity", Range(0, 1)) = 1.0 + _Glossiness ("Glossiness", Range(0, 1)) = 0.6 + _GlossSoftness ("Softness", Range(0, 1)) = 0.0 + [HDR] _GlossColor ("Color", Color) = (1.0,1.0,1.0,1.0) + _GlossColorPower ("Color Power", Float ) = 10.0 + _MaskGloss ("Mask Gloss", 2D) = "white" {} + + _GlossTexture ("Gloss Texture", 2D) = "black" {} + [Toggle(N_F_ANIS_ON)] _N_F_ANIS ("Anisotropic Mode", Float ) = 0.0 + _GlossTextureSoftness ("Softness", Float ) = 0.0 + _PSGLOTEX ("Pattern Style", Float ) = 0.0 + _GlossTextureRotate ("Rotate", Float ) = 0.0 + [RTToggleOption] _GlossTextureFollowObjectRotation ("Follow Object Rotation", Float ) = 0.0 + _NoisTexInten ("Noise Texture Intensity", Range(0, 10)) = 1.0 + _StraWidt ("Width", Float ) = 10.0 + _NoiTexAffStraWidt ("Noise Texture Affect Width", Range(0, 1) ) = 0 + _ShifAnis ("Shift", Float ) = 0.0 + _GlossTextureFollowLight ("Follow Light", Range(0, 1)) = 0.0 + + [HDR] _OverallShadowColor ("Overall Shadow Color", Color) = (0.0,0.0,0.0,1.0) + _OverallShadowColorPower ("Overall Shadow Color Power", Float ) = 1.0 + + _SelfShadowShadowTAtViewDirection ("Self Shadow & ShadowT At View Direction", Float ) = 0.0 + + _ReduSha ("Reduce Shadow", Float ) = 0.5 + + _ShadowHardness ("Shadow Hardness", Range(0, 1)) = 0.0 + + _SelfShadowRealtimeShadowIntensity ("Self Shadow & Realtime Shadow Intensity", Range(0, 1)) = 1.0 + _SelfShadowThreshold ("Threshold", Range(0, 1)) = 0.930 + [RTToggleOption] _VertexColorGreenControlSelfShadowThreshold ("Vertex Color Green Control Self Shadow Threshold", Float ) = 0.0 + _SelfShadowHardness ("Hardness", Range(0, 1)) = 1.0 + [HDR] _SelfShadowRealTimeShadowColor ("Self Shadow & Real Time Shadow Color", Color) = (1.0,1.0,1.0,1.0) + _SelfShadowRealTimeShadowColorPower ("Self Shadow & Real Time Shadow Color Power", Float ) = 1.0 + _LigIgnoYNorDir ("Light Ignore Y Normal Direction", Float) = 0 + [RTToggleOption] _SelfShadowAffectedByLightShadowStrength ("Self Shadow Affected By Light Shadow Strength", Float ) = 0.0 + + _SmoothObjectNormal ("Smooth Object Normal", Range(0, 1)) = 0.0 + [RTToggleOption] _VertexColorRedControlSmoothObjectNormal ("Vertex Color Red Control Smooth Object Normal", Float ) = 0.0 + [HideInInspector] _XYZPosition ("XYZ Position", Vector) = (0.0,0.0,0.0,0.0) + [RTToggleOption] _ShowNormal ("Show Normal", Float ) = 0.0 + + _ShadowColorTexture ("Shadow Color Texture", 2D) = "white" {} + _ShadowColorTexturePower ("Power", Float ) = 0.0 + + _ShadowTIntensity ("ShadowT Intensity", Range(0, 1)) = 1.0 + _ShadowT ("ShadowT", 2D) = "white" {} + _ShadowTLightThreshold ("Light Threshold", Float ) = 50.0 + _ShadowTShadowThreshold ("Shadow Threshold", Float ) = 0.0 + _ShadowTHardness ("Hardness", Range(0, 1)) = 1.0 + [HDR] _ShadowTColor ("Color", Color) = (1.0,1.0,1.0,1.0) + _ShadowTColorPower ("Color Power", Float ) = 1.0 + [Toggle(N_F_STSDFM_ON)] _N_F_STSDFM ("SDF Mode", Float ) = 0.0 + + _STIL ("Ignore Light", Float ) = 0.0 + + [Toggle(N_F_STIS_ON)] _N_F_STIS ("Show In Shadow", Float ) = 0.0 + + [Toggle(N_F_STIAL_ON )] _N_F_STIAL ("Show In Ambient Light", Float ) = 0.0 + _ShowInAmbientLightShadowIntensity ("Show In Ambient Light & Shadow Intensity", Range(0, 1)) = 1.0 + _ShowInAmbientLightShadowThreshold ("Show In Ambient Light & Shadow Threshold", Float ) = 0.4 + + [RTToggleOption] _LightFalloffAffectShadowT ("Light Falloff Affect ShadowT", Float ) = 0.0 + + _PTexture ("PTexture", 2D) = "white" {} + _PTCol("Color", Color) = (0.0, 0.0, 0.0, 1.0) + _PTexturePower ("Power", Float ) = 1.0 + + [Toggle(N_F_RELGI_ON)] _RELG ("Receive Environmental Lighting and GI", Float ) = 1.0 + _EnvironmentalLightingIntensity ("Environmental Lighting Intensity", Float ) = 1.0 + + [RTToggleOption] _GIFlatShade ("GI Flat Shade", Float ) = 0.0 + _GIShadeThreshold ("GI Shade Threshold", Range(0, 1)) = 0.0 + + [RTToggleOption] _LightAffectShadow ("Light Affect Shadow", Float ) = 0.0 + _LightIntensity ("Light Intensity", Float ) = 1.0 + + [Toggle(N_F_USETLB_ON)] _UseTLB ("Use Traditional Light Blend", Float ) = 0.0 + [Toggle(N_F_EAL_ON)] _N_F_EAL ("Enable Additional Lights", Float ) = 1.0 + + _DirectionalLightIntensity ("Directional Light Intensity", Float ) = 0.0 + _PointSpotlightIntensity ("Point and Spot Light Intensity", Float ) = 0.0 + _LightFalloffSoftness ("Light Falloff Softness", Range(0, 1)) = 1.0 + + [Toggle(N_F_LLI_ON)] _N_F_LLI ("Limit Light Intensity", Float ) = 0.0 + _LLI_Min ("Minimum", Float ) = 0.0 + _LLI_Max ("Maximum", Float ) = 1.0 + + _CustomLightDirectionIntensity ("Intensity", Range(0, 1)) = 0.0 + [RTToggleOption] _CustomLightDirectionFollowObjectRotation ("Follow Object Rotation", Float ) = 0.0 + _CustomLightDirection ("Custom Light Direction", Vector) = (0.0,0.0,10.0,0.0) + + _ReflectionIntensity ("Intensity", Range(0, 1)) = 0.0 + _Smoothness ("Roughness", Float ) = 0.0 + _RefMetallic ("Metallic", Range(0, 1) ) = 0.0 + + _MaskReflection ("Mask Reflection", 2D) = "white" {} + + _FReflection ("FReflection", 2D) = "black" {} + + _RimLigInt("Rim Light Intensity", Range(0, 1)) = 1.0 + _RimLightUnfill ("Unfill", Float ) = 1.5 + [HDR] _RimLightColor ("Color", Color) = (1.0,1.0,1.0,1.0) + _RimLightColorPower ("Color Power", Float ) = 10.0 + _RimLightSoftness ("Softness", Range(0, 1)) = 1.0 + _RimLigPosi ("Position", Vector) = (1.0,1.0,1.0) + [RTToggleOption] _RimLightInLight ("Rim Light In Light", Float ) = 1.0 + [RTToggleOption] _LightAffectRimLightColor ("Light Affect Rim Light Color", Float ) = 0.0 + [Toggle(N_F_RLIS_ON)] _N_F_RLIS("Rim Light In Shadow", Float) = 0.0 + + _MinFadDistance("Min Distance", Float) = 0.0 + _MaxFadDistance("Max Distance", Float) = 2.0 + + _TriPlaTile("Tile", Float) = 1.0 + _TriPlaBlend("Blend", Float) = 4.0 + + _PresAdju("Prespective", Float) = 1.0 + _ClipAdju("Clip", Float) = 0.0 + _PASize("Close-Up Size", Float) = 0.5 + _PASmooTrans("Close-Up Size Smooth Transition", Float) = 1 + _PADist("Close-Up Size Distance", Float) = 0 + + [HideInInspector]_NoiseSize("Noise Size", Float) = 100 + [HideInInspector]_TrailSize("Trail Size", Float) = 1.5 + + _TessellationSmoothness ("Smoothness", Range(0, 2)) = 0.5 + _TessellationTransition ("Tessellation Transition", Range(0, 1)) = 0.8 + _TessellationNear ("Tessellation Near", Float ) = 1 + _TessellationFar ("Tessellation Far", Float ) = 1 + [RTToggleOption] _NorMapAsDis ("Normal Map As Displacement", Float ) = 0 + + _RefVal ("ID", int ) = 0 + [Enum(Blank,8,A,0,B,2)] _Oper("Set 1", int) = 0 + [Enum(Blank,8,None,4,A,6,B,7)] _Compa("Set 2", int) = 4 + + [Toggle(N_F_MC_ON)] _N_F_MC ("MatCap", Float ) = 0.0 + [Toggle(N_F_NM_ON)] _N_F_NM ("Normal Map", Float ) = 0.0 + [Toggle(N_F_CO_ON)] _N_F_CO ("Cutout", Float ) = 0.0 + [Toggle(N_F_O_ON)] _N_F_O ("Outline", Float ) = 1.0 + [Toggle(N_F_CA_ON)] _N_F_CA ("Color Adjustment", Float ) = 0.0 + [Toggle(N_F_SL_ON)] _N_F_SL ("Self Lit", Float ) = 0.0 + [Toggle(N_F_GLO_ON)] _N_F_GLO ("Gloss", Float ) = 0.0 + [Toggle(N_F_GLOT_ON)] _N_F_GLOT ("Gloss Texture", Float ) = 0.0 + [Toggle(N_F_SS_ON)] _N_F_SS ("Self Shadow", Float ) = 1.0 + [Toggle(N_F_SON_ON)] _N_F_SON ("Smooth Object Normal", Float ) = 0.0 + [Toggle(N_F_SCT_ON)] _N_F_SCT ("Shadow Color Texture", Float ) = 0.0 + [Toggle(N_F_ST_ON)] _N_F_ST ("ShadowT", Float ) = 0.0 + [Toggle(N_F_PT_ON)] _N_F_PT ("PTexture", Float ) = 0.0 + [Toggle(N_F_CLD_ON)] _N_F_CLD ("Custom Light Direction", Float ) = 0.0 + [Toggle(N_F_R_ON)] _N_F_R ("Relfection", Float ) = 0.0 + [Toggle(N_F_FR_ON)] _N_F_FR ("FRelfection", Float ) = 0.0 + [Toggle(N_F_RL_ON)] _N_F_RL ("Rim Light", Float ) = 0.0 + [Toggle(N_F_NFD_ON)] _N_F_NFD ("Near Fade Dithering", Float) = 0.0 + [Toggle(N_F_TP_ON)] _N_F_TP ("Triplanar", Float ) = 0.0 + [Toggle(N_F_PA_ON)] _N_F_PA ("Perspective Adjustment", Float ) = 0.0 + [Toggle(N_F_SE_ON)] _N_F_SE ("Smear Effect", Float ) = 0.0 + + [Toggle(N_F_HDLS_ON)] _N_F_HDLS ("Hide Directional Light Shadow", Float ) = 0.0 + [Toggle(N_F_HPSS_ON)] _N_F_HPSS ("Hide Point & Spot Light Shadow", Float ) = 0.0 + + [Toggle(N_F_DCS_ON)] _N_F_DCS ("Disable Cast Shadow", Float ) = 0.0 + [Toggle(N_F_NLASOBF_ON)] _N_F_NLASOBF ("No Light and Shadow On BackFace", Float ) = 0.0 + + [Toggle(N_F_ESSAO_ON)] _N_F_ESSAO("Enable Screen Space Ambient Occlusion", Float) = 0.0 + [HDR] _SSAOColor("Ambient Occlusion Color", Color) = (0.0, 0.0, 0.0, 0.0) + + [Toggle(N_F_RDC_ON)] _N_F_RDC("Receive Decal", Float) = 1.0 + [Toggle(N_F_OFLMB_ON)] _N_F_OFLMB("Optimize for [Light Mode: Baked]", Float) = 0.0 + + [Toggle(N_F_DDMD_ON)] _N_F_DDMD("Disable DOTS Mesh Deformation", Float) = 1.0 + + [Enum(On, 1, Off, 0)] _ZWrite("ZWrite", int) = 1 + [Enum(UnityEngine.Rendering.CompareFunction)] _ZTest("ZTest", int) = 4 + + _ObjePosiZCS("Object Position Z (CS)", float) = 0.0 + + //Others + [HideInInspector]_SkinMatrixIndex("Skin Matrix Index Offset", Float) = 0 + [HideInInspector]_ComputeMeshIndex("Compute Mesh Buffer Index Offset", Float) = 0 + [HideInInspector]_PrevPosition("Prev Position", Vector) = (0, 0, 0, 0) + [HideInInspector]_ObjPosi ("Object Position", Vector) = (0, 0, 0, 0) + [HideInInspector]_ObjectForward("Object Forward", Vector) = (0, 0, 0, 0) + [HideInInspector]_ObjectRight("Object Right", Vector) = (0, 0, 0, 0) + [HideInInspector] _RQSO ("Render Order",Range(0, 5000)) = 0 + + + } + +SubShader +{ + + Tags + { + "Queue" = "Geometry" + "RenderType" = "Opaque" + "RenderPipeline" = "UniversalPipeline" + "UniversalMaterialType" = "Lit" + "IgnoreProjector" = "True" + } + LOD 300 + + Pass + { + + Name "ForwardLit" + Tags{"LightMode" = "UniversalForward"} + + Cull [_Culling] + Blend [_BleModSour] [_BleModDest] + ZWrite[_ZWrite] + ZTest [_ZTest] + + AlphaToMask[_AlpToCov] + +/*//F_ST + Stencil { + Ref[_RefVal] + Comp [_Compa] + Pass [_Oper] + Fail [_Oper] + } +//F_ST_En*/ + + HLSLPROGRAM + + #pragma only_renderers d3d9 d3d11 vulkan glcore gles3 gles metal webgpu xboxone ps4 xboxseries playstation switch switch2 +#pragma target 2.0 //targetfl + + #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN + #pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS + #pragma multi_compile _ EVALUATE_SH_MIXED EVALUATE_SH_VERTEX + #pragma multi_compile_fragment _ _ADDITIONAL_LIGHT_SHADOWS + #pragma multi_compile_fragment _ _REFLECTION_PROBE_BLENDING + #pragma multi_compile_fragment _ _REFLECTION_PROBE_BOX_PROJECTION + #pragma multi_compile_fragment _ _REFLECTION_PROBE_ATLAS + #pragma multi_compile_fragment _ _SHADOWS_SOFT _SHADOWS_SOFT_LOW _SHADOWS_SOFT_MEDIUM _SHADOWS_SOFT_HIGH + #pragma multi_compile_fragment _ _SCREEN_SPACE_OCCLUSION + #pragma multi_compile_fragment _ _SCREEN_SPACE_IRRADIANCE + #pragma multi_compile_fragment _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 + #pragma multi_compile_fragment _ _LIGHT_COOKIES + #pragma multi_compile _ _LIGHT_LAYERS + #pragma multi_compile _ _CLUSTER_LIGHT_LOOP + + #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl" + #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/RenderingLayers.hlsl" + #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ProbeVolumeVariants.hlsl" + + #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING + #pragma multi_compile _ SHADOWS_SHADOWMASK + #pragma multi_compile _ DIRLIGHTMAP_COMBINED + #pragma multi_compile _ LIGHTMAP_ON + #pragma multi_compile_fragment _ LIGHTMAP_BICUBIC_SAMPLING + #pragma multi_compile_fragment _ REFLECTION_PROBE_ROTATION + #pragma multi_compile _ DYNAMICLIGHTMAP_ON + #pragma multi_compile _ USE_LEGACY_LIGHTMAPS + #pragma multi_compile _ LOD_FADE_CROSSFADE + + #pragma multi_compile_fog + #pragma multi_compile_instancing + #pragma instancing_options renderinglayer + + #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl" + + #pragma vertex LitPassVertex + #pragma fragment LitPassFragment + +/*//Tess_FP_1 + #pragma require tessellation + #pragma hull hull + #pragma domain domain +//TessTess_FP_1_End*/ + + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" + + #pragma shader_feature_local_fragment N_F_USETLB_ON + #pragma shader_feature_local_fragment N_F_TRANS_ON + #pragma shader_feature_local_fragment N_F_SIMTRANS_ON + #pragma shader_feature_local N_F_DDMD_ON + + #pragma shader_feature_local_fragment N_F_O_ON + #pragma shader_feature_local_fragment N_F_O_MOTTSO_ON + #pragma shader_feature_local_fragment N_F_MC_ON + #pragma shader_feature_local_fragment N_F_NM_ON + #pragma shader_feature_local_fragment N_F_CO_ON + #pragma shader_feature_local_fragment N_F_SL_ON + #pragma shader_feature_local_fragment N_F_CA_ON + #pragma shader_feature_local_fragment N_F_GLO_ON + #pragma shader_feature_local_fragment N_F_GLOT_ON + #pragma shader_feature_local_fragment N_F_SS_ON + #pragma shader_feature_local_fragment N_F_SCT_ON + #pragma shader_feature_local_fragment N_F_ST_ON + #pragma shader_feature_local_fragment N_F_STIS_ON + #pragma shader_feature_local_fragment N_F_STIAL_ON + #pragma shader_feature_local N_F_SON_ON + #pragma shader_feature_local_fragment N_F_PT_ON + #pragma shader_feature_local_fragment N_F_RELGI_ON + #pragma shader_feature_local_fragment N_F_CLD_ON + #pragma shader_feature_local_fragment N_F_R_ON + #pragma shader_feature_local_fragment N_F_FR_ON + #pragma shader_feature_local_fragment N_F_RL_ON + #pragma shader_feature_local_fragment N_F_RLIS_ON + #pragma shader_feature_local_fragment N_F_HDLS_ON + #pragma shader_feature_local_fragment N_F_HPSS_ON + #pragma shader_feature_local_fragment N_F_EAL_ON + #pragma shader_feature_local_fragment N_F_NLASOBF_ON + #pragma shader_feature_local_fragment N_F_OFLMB_ON + #pragma shader_feature_local_fragment N_F_ESSAO_ON + #pragma shader_feature_local_fragment N_F_RDC_ON + #pragma shader_feature_local_fragment N_F_COEDGL_ON + #pragma shader_feature_local_fragment N_F_NFD_ON + #pragma shader_feature_local_fragment N_F_TP_ON + #pragma shader_feature_local N_F_PA_ON + #pragma shader_feature_local N_F_SE_ON + #pragma shader_feature_local_fragment N_F_SCO_ON + #pragma shader_feature_local_fragment N_F_STSDFM_ON + #pragma shader_feature_local_fragment N_F_ATC_ON + #pragma shader_feature_local_fragment N_F_ANIS_ON + #pragma shader_feature_local_fragment N_F_LLI_ON + #pragma shader_feature_local_fragment N_F_SLMM_ON + #pragma shader_feature_local _UVSET_UV0 _UVSET_UV1 + + #include "Assets/RealToon/RealToon Shaders/RealToon Core/URP/RT_URP_Core.hlsl" + + #if defined(LOD_FADE_CROSSFADE) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/LODCrossFade.hlsl" + #endif + +//#define N_F_TESS_ON//FPT + #define _EMISSION + + struct Attributes + { + + float4 positionOS : POSITION; + float3 normalOS : NORMAL; + float4 tangentOS : TANGENT; + float2 uv : TEXCOORD0; + float2 staticLightmapUV : TEXCOORD1; + float2 dynamicLightmapUV : TEXCOORD2; + float4 vertexColor : COLOR; + + #if defined(UNITY_DOTS_INSTANCING_ENABLED) + + #ifndef N_F_DDMD_ON +float4 weights : BLENDWEIGHTS;//DOTS_LiBleSki_FL +uint4 indices : BLENDINDICES;//DOTS_LiBleSki_FL +//uint vertexID : SV_VertexID;//DOTS_CompDef_FL + #endif + + #endif + + UNITY_VERTEX_INPUT_INSTANCE_ID + + }; + + struct Varyings + { + + float2 uv : TEXCOORD0; + float4 positionWSAndFogFactor : TEXCOORD1; + float3 normalWS : TEXCOORD2; + float3 tangentWS : TEXCOORD3; + float3 bitangentWS : TEXCOORD4; + float4 posWorld : TEXCOORD5; + + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + float4 shadowCoord : TEXCOORD6; + #endif + + float4 projPos : TEXCOORD7; + + float2 staticLightmapUV : TEXCOORD8; + #ifdef DYNAMICLIGHTMAP_ON + float2 dynamicLightmapUV : TEXCOORD9; + #endif + + float3 smoNorm : TEXCOORD10; + float4 vertexColor : COLOR; + float4 positionCS : SV_POSITION; + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + + }; + +Varyings LitPassVertex(Attributes input)//FPV + { + + Varyings output = (Varyings)0; + + UNITY_SETUP_INSTANCE_ID (input); + UNITY_TRANSFER_INSTANCE_ID(input, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + #if defined(UNITY_DOTS_INSTANCING_ENABLED) + + #if !defined (N_F_TESS_ON) + + #if N_F_DDMD_ON + + float4 _LBS_CD_Position = input.positionOS; + float3 _LBS_CD_Normal = input.normalOS; + float4 _LBS_CD_Tangent = input.tangentOS; + + #else + + float4 _LBS_CD_Position = 0; + float3 _LBS_CD_Normal = 0; + float4 _LBS_CD_Tangent = 0; + +DOTS_LiBleSki(input.indices, input.weights, input.positionOS.xyz, input.normalOS.xyz, input.tangentOS.xyz, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_LiBleSki_FL +//DOTS_CompDef(input.vertexID, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_CompDef_FL + + #endif + + #else + + float4 _LBS_CD_Position = input.positionOS; + float3 _LBS_CD_Normal = input.normalOS; + float4 _LBS_CD_Tangent = input.tangentOS; + + #endif + + #else + + float4 _LBS_CD_Position = input.positionOS; + float3 _LBS_CD_Normal = input.normalOS; + float4 _LBS_CD_Tangent = input.tangentOS; + + #endif + + VertexPositionInputs vertexInput = GetVertexPositionInputs(_LBS_CD_Position.xyz); + VertexNormalInputs vertexNormalInput = GetVertexNormalInputs(_LBS_CD_Normal, _LBS_CD_Tangent); + + + //RT_SE + #if N_F_SE_ON + input.positionOS = RT_SE(vertexInput.positionWS, input.positionOS); + _LBS_CD_Position = input.positionOS; + #endif + //== + + + //RT_PA + #if N_F_PA_ON + output.positionCS = mul(RT_PA(-vertexInput.positionVS.z), float4(_LBS_CD_Position.xyz,1.0) ) + (float4(0,0,_ObjePosiZCS,0.0)* 0.0001); + #else + output.positionCS = vertexInput.positionCS + (float4(0,0,_ObjePosiZCS,0.0) * 0.0001); + #endif + // + + #if _UVSET_UV0 + output.uv = input.uv; + #elif _UVSET_UV1 + output.uv = input.staticLightmapUV; + #endif + + output.vertexColor = input.vertexColor; + + output.normalWS = vertexNormalInput.normalWS; + output.tangentWS = vertexNormalInput.tangentWS; + output.bitangentWS = vertexNormalInput.bitangentWS; + + float fogFactor = ComputeFogFactor(vertexInput.positionCS.z); + output.positionWSAndFogFactor = float4(vertexInput.positionWS, fogFactor); + + output.posWorld = float4(vertexInput.positionWS, 1.0); + output.projPos = ComputeScreenPos (output.positionCS); + + OUTPUT_LIGHTMAP_UV(input.staticLightmapUV, unity_LightmapST, output.staticLightmapUV); + #ifdef DYNAMICLIGHTMAP_ON + output.dynamicLightmapUV = input.dynamicLightmapUV.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + #endif + + //RT_SON + #if N_F_SON_ON + output.smoNorm = GetAbsolutePositionWS(vertexInput.positionWS); + #endif + //== + + +#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + + output.shadowCoord = GetShadowCoord(vertexInput); +#endif + + return output; + } + +/*//Tess_FP_2 + struct TessVertex + { + + float4 positionOS : INTERNALTESSPOS; + float3 normalOS : NORMAL; + float4 tangentOS : TANGENT; + float2 uv : TEXCOORD0; + float4 vertexColor : COLOR; + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + + }; + + struct OutputPatchConstant + { + + float edge[3] : SV_TessFactor; + float inside : SV_InsideTessFactor; + + }; + + TessVertex LitPassVertex(Attributes v) + { + TessVertex o = (TessVertex)0; + UNITY_SETUP_INSTANCE_ID(v); + UNITY_TRANSFER_INSTANCE_ID(v, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + o.positionOS = v.positionOS; + o.normalOS = v.normalOS; + o.tangentOS = v.tangentOS; + o.uv = v.uv; + o.vertexColor = v.vertexColor; + return o; + } + + float Tessellation(TessVertex v) + { + + UNITY_SETUP_INSTANCE_ID(v); + half RTD_TES_TRANS_Sli = (1.0 - _TessellationTransition); + half RTD_TES = lerp(_TessellationNear,_TessellationFar,saturate( ( distance(mul(GetObjectToWorldMatrix(), v.positionOS).xyz,_WorldSpaceCameraPos) * RTD_TES_TRANS_Sli ) ) ); + + return RTD_TES; + + } + + float4 Tessellation(TessVertex v, TessVertex v1, TessVertex v2) + { + + float tv = Tessellation(v); + float tv1 = Tessellation(v1); + float tv2 = Tessellation(v2); + return float4( tv1+tv2, tv2+tv, tv+tv1, tv+tv1+tv2 ) / float4(2,2,2,3); + + } + + OutputPatchConstant hullconst (InputPatch v) + { + + OutputPatchConstant o = (OutputPatchConstant)0; + UNITY_SETUP_INSTANCE_ID(v[0]); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + float4 ts = Tessellation( v[0], v[1], v[2] ); + o.edge[0] = ts.x; + o.edge[1] = ts.y; + o.edge[2] = ts.z; + o.inside = ts.w; + return o; + + } + + [domain("tri")] + [partitioning("fractional_odd")] + [outputtopology("triangle_cw")] + [patchconstantfunc("hullconst")] + [outputcontrolpoints(3)] + + TessVertex hull (InputPatch v, uint id : SV_OutputControlPointID) + { + return v[id]; + } + + [domain("tri")] + Varyings domain (OutputPatchConstant tessFactors, const OutputPatch vi, float3 bary : SV_DomainLocation) + { + + Attributes v = (Attributes)0; + UNITY_SETUP_INSTANCE_ID(vi[0]); + UNITY_TRANSFER_INSTANCE_ID(vi[0], v); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(v); + + v.positionOS = vi[0].positionOS*bary.x + vi[1].positionOS*bary.y + vi[2].positionOS*bary.z; + + float3 pp[3]; + for (int i = 0; i < 3; ++i) + { + pp[i] = v.positionOS.xyz - vi[i].normalOS * (dot(v.positionOS.xyz, vi[i].normalOS) - dot(vi[i].positionOS.xyz, vi[i].normalOS)); + } + + v.positionOS.xyz = _TessellationSmoothness * (pp[0] * bary.x + pp[1] * bary.y + pp[2] * bary.z) + (1.0f - _TessellationSmoothness) * v.positionOS.xyz; + v.normalOS = normalize( (vi[0]. normalOS * bary.x + vi[1].normalOS * bary.y + vi[2].normalOS * bary.z) ); + v.tangentOS = vi[0].tangentOS*bary.x + vi[1].tangentOS*bary.y + vi[2].tangentOS*bary.z; + v.uv = vi[0].uv*bary.x + vi[1].uv*bary.y + vi[2].uv*bary.z; + v.vertexColor = vi[0].vertexColor*bary.x + vi[1].vertexColor*bary.y + vi[2].vertexColor*bary.z; + + if (_NorMapAsDis == 1) + { + float2 uv = TRANSFORM_TEX(v.uv, _NormalMap); + float norma_disp = dot(float3(0.299, 0.587, 0), normalize(UnpackNormal(SAMPLE_TEXTURE2D_LOD(_NormalMap, sampler_NormalMap, uv, 0))) ) ; + v.positionOS.xyz += v.normalOS * (norma_disp * (_NormalMapIntensity * 0.01) ); + } + + Varyings o = PostProcessVertex(v); + return o; + + } +//Tess_FP_2_End*/ + + void LitPassFragment(Varyings input + , out half4 outColor : SV_Target0 + , float facing : VFACE + #ifdef _WRITE_RENDERING_LAYERS + , out uint outRenderingLayers : SV_Target1 + #endif + ) + { + + UNITY_SETUP_INSTANCE_ID (input); + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input); + + #if defined(DYNAMICLIGHTMAP_ON) + float2 RTD_SHA_MAS_UV = input.dynamicLightmapUV; + float2 RTD_DYN_LIGMAP_UV = input.dynamicLightmapUV; + #else + float2 RTD_SHA_MAS_UV = input.staticLightmapUV; + float2 RTD_DYN_LIGMAP_UV = float2(0.0,0.0); + #endif + + //========= + + float4 shadow_mask = SAMPLE_SHADOWMASK(RTD_SHA_MAS_UV); + + #if defined(SHADOWS_SHADOWMASK) && defined(LIGHTMAP_ON) + half4 shadowMask = shadow_mask; + #elif !defined (LIGHTMAP_ON) + half4 shadowMask = unity_ProbesOcclusion; + #else + half4 shadowMask = half4(1.0, 1.0, 1.0, 1.0); + #endif + + //========== + + half3 color = (half3)0.0; + float3 A_L_O = (float3)0.0; + + half isFrontFace = ( facing >= 0 ? 1 : 0 ); + float4 objPos = mul ( GetObjectToWorldMatrix(), float4(0.0,0.0,0.0,1.0) ); + float2 sceneUVs = (input.projPos.xy / input.projPos.w); + half RTD_OB_VP_CAL = distance(objPos.rgb, _WorldSpaceCameraPos); + half2 RTD_VD_Cal = (float2((sceneUVs.x * 2.0 - 1.0) * (_ScreenParams.r / _ScreenParams.g), sceneUVs.y * 2.0 - 1.0).rg * RTD_OB_VP_CAL); + + float3 positionWS = input.positionWSAndFogFactor.xyz; + input.normalWS = normalize(input.normalWS); + float3x3 tangentTransform = float3x3( input.tangentWS, input.bitangentWS, input.normalWS); + + + //RT_NM + float3 normalLocal = RT_NM(input.uv, positionWS, tangentTransform, input.normalWS); + //== + + + float3 viewDirection = normalize(_WorldSpaceCameraPos.xyz - input.posWorld.xyz); + float3 normalDirection = normalize(mul( normalLocal, tangentTransform )); + float3 viewReflectDirection = reflect( -viewDirection, normalDirection ); + + + //** + half2 RTD_TC_TP_OO; + if (!_TexturePatternStyle) + { + RTD_TC_TP_OO = input.uv; + } + else + { + RTD_TC_TP_OO = RTD_VD_Cal; + } + //** + + + #if N_F_TP_ON + half4 _MainTex_var = RT_Tripl_Default(_MainTex, sampler_MainTex, positionWS, normalDirection); + #else + half4 _MainTex_var = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, TRANSFORM_TEX(RTD_TC_TP_OO, _MainTex)); + #endif + + #if defined(N_F_RDC_ON) + #if defined(_DBUFFER) && (!defined(N_F_TRANS_ON) || defined(N_F_CO_ON)) + RT_DC(input.positionCS, _MainTex_var, normalDirection); //cc + #endif + #endif + + #ifdef LOD_FADE_CROSSFADE + LODFadeCrossFade(input.positionCS); + #endif + + + //** + half3 _RTD_MVCOL; + if (!_MVCOL) + { + _RTD_MVCOL = (half3)1.0; + } + else + { + _RTD_MVCOL = input.vertexColor.rgb; + } + + uint meshRenderingLayers = GetMeshRenderingLayer(); + //** + + + // + #ifdef UNITY_COLORSPACE_GAMMA + _OverallShadowColor = float4(LinearToGamma22(_OverallShadowColor.rgb), _OverallShadowColor.a); + #endif + + #ifndef N_F_OFLMB_ON + half3 RTD_OSC = (_OverallShadowColor.rgb*_OverallShadowColorPower); + #else + half3 RTD_OSC = (half3)0.0; + #endif + // + + + + //RT_MCAP + half3 MCapOutP = RT_MCAP(input.uv, normalDirection); + //== + + + // + #ifdef UNITY_COLORSPACE_GAMMA + _MainColor = float4(LinearToGamma22(_MainColor.rgb),_MainColor.a); + #endif + // + + + half3 _MC_MCP = (_MainColor.rgb * _MaiColPo); + + + //RT_SSAO + half3 SSAmOc = RT_SSAO(input.positionCS); + //== + + + //RT_MCAP_SUB1 + half3 RTD_TEX_COL; + half3 RTD_MCIALO_IL = RT_MCAP_SUB1(MCapOutP, _MainTex_var, _RTD_MVCOL, RTD_TEX_COL); + //== + + + //RT_TRANS_CO + half RTD_TRAN_OPA_Sli; + half RTD_CO; + half3 GLO_OUT = (half3)0.0; + RT_TRANS_CO(input.uv, _MainTex_var, _MainTex_var.a, RTD_TRAN_OPA_Sli, RTD_CO, positionWS, normalDirection, input.positionCS.xy, GLO_OUT); + //== + + + //RT_SON + float3 RTD_SON_CHE_1; + float3 RTD_SON = RT_SON(input.vertexColor, input.smoNorm, normalDirection, RTD_SON_CHE_1); + //== + + + //RT_RELGI + float3 RTD_GI_FS_OO = RT_RELGI(RTD_SON); + //== + + + //RT_SCT + half3 RTD_SCT = RT_SCT(input.uv, positionWS, normalDirection, RTD_MCIALO_IL); + //== + + + //RT_PT + half3 RTD_PT_COL; + half RTD_PT = RT_PT(RTD_VD_Cal, RTD_PT_COL); + //== + + + // + #ifdef UNITY_COLORSPACE_GAMMA + _SelfShadowRealTimeShadowColor = float4(LinearToGamma22(_SelfShadowRealTimeShadowColor.rgb), _SelfShadowRealTimeShadowColor.a); + #endif + + #ifndef N_F_OFLMB_ON + half3 ss_col = lerp( RTD_PT_COL, (_SelfShadowRealTimeShadowColor.rgb * _SelfShadowRealTimeShadowColorPower) * RTD_OSC * RTD_SCT, RTD_PT); + #else + half3 ss_col = (half3)0.0; + #endif + // + + + //========/ + //========/ + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + Light mainLight = GetMainLight(input.shadowCoord, positionWS, shadowMask); + #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) + Light mainLight = GetMainLight(TransformWorldToShadowCoord(positionWS), positionWS, shadowMask); + #else + Light mainLight = GetMainLight(); + #endif + + half3 mainliCol = 0.0; + half mainliSAtt = 0.0; + float3 mainliDir = float3(0.0,0.0,0.0); + + #ifdef _LIGHT_LAYERS + if (IsMatchingLightLayer(mainLight.layerMask, meshRenderingLayers)) + #endif + { + + #if N_F_LLI_ON + mainliCol = clamp(mainLight.color.rgb,_LLI_Min,_LLI_Max); + #else + mainliCol = mainLight.color.rgb; + #endif + + mainliSAtt = mainLight.shadowAttenuation; + mainliDir = mainLight.direction; + } + //========/ + //========/ + + + #ifndef N_F_OFLMB_ON + #if N_F_NLASOBF_ON + half3 lightColor = lerp( (float3)0.0 , mainliCol,isFrontFace); + #else + half3 lightColor = mainliCol; + #endif + #else + half3 lightColor = (half3)0.0; + #endif + + + + #ifndef N_F_OFLMB_ON + #if N_F_HDLS_ON + half attenuation = 1.0; + #else + half dlshmin = lerp( 0.0, 0.6 ,_ShadowHardness); + half dlshmax = lerp( 1.0, 0.6 ,_ShadowHardness); + + #if N_F_NLASOBF_ON + half FB_Check = lerp( 1.0 , mainliSAtt ,isFrontFace); + #else + half FB_Check = mainliSAtt; + #endif + + half attenuation = smoothstep(dlshmin,dlshmax,FB_Check); + #endif + #else + half attenuation = 1.0; + #endif + + + + #ifndef N_F_OFLMB_ON + float3 lightDirection = mainliDir; + float3 halfDirection = normalize(viewDirection + lightDirection); + #else + float3 lightDirection = (float3)0.0; + float3 halfDirection = (float3)0.0; + #endif + + + + //RT_CLD + float3 RTD_CLD = RT_CLD(lightDirection); + //== + + + #ifndef N_F_OFLMB_ON + + + //** + half3 RTD_ST_SS_AVD_OO; + if (!_SelfShadowShadowTAtViewDirection) + { + RTD_ST_SS_AVD_OO = RTD_CLD; + } + else + { + RTD_ST_SS_AVD_OO = viewDirection; + } + //** + + + half RTD_NDOTL = 0.5 * dot(RTD_ST_SS_AVD_OO, float3(RTD_SON.x, RTD_SON.y * (1-_LigIgnoYNorDir), RTD_SON.z)) + 0.5; + half RTD_LVLC = RTD_LVLC_F(lightColor.rgb); + half3 lig_col_int = (_LightIntensity * lightColor.rgb); + + + //** + half3 RTD_LAS; + if (!_LightAffectShadow) + { + RTD_LAS = ss_col * RTD_LVLC; + } + else + { + RTD_LAS = ss_col * lig_col_int; + } + //** + + + #else + half3 RTD_ST_SS_AVD_OO = (half3)0.0; + half RTD_NDOTL = 0.0; + half RTD_LVLC = 0.0; + half3 lig_col_int = (half3)0.0; + half3 RTD_LAS = (half3)0.0; + #endif + + + // + #ifdef UNITY_COLORSPACE_GAMMA + _HighlightColor = float4(LinearToGamma22(_HighlightColor.rgb), _HighlightColor.a); + #endif + + #ifndef _N_F_OFLMB + half3 RTD_HL = (_HighlightColor.rgb*_HighlightColorPower+_DirectionalLightIntensity); + #else + half3 RTD_HL = (half3)0.0; + #endif + // + + + //** + half3 RTD_MC_SM_TC_OO; + if (!_SPECMODE) + { + RTD_MC_SM_TC_OO = RTD_TEX_COL * _MC_MCP; + } + else + { + RTD_MC_SM_TC_OO = RTD_TEX_COL + _MC_MCP; + } + //** + + + //** + half3 RTD_MCIALO_OO; + if (!_MCIALO) + { + RTD_MCIALO_OO = RTD_TEX_COL; + } + else + { + RTD_MCIALO_OO = lerp(RTD_MC_SM_TC_OO, _MainTex_var.rgb * MCapOutP * _RTD_MVCOL * 0.7, clamp((RTD_LVLC * 1.0), 0.0, 1.0)); + } + //** + + + half3 RTD_MCIALO = RTD_MCIALO_OO; + + + //RT_GLO + half RTD_GLO; + half3 RTD_GLO_COL; + RT_GLO(input.uv, RTD_VD_Cal, halfDirection, input.bitangentWS, normalDirection, viewDirection, positionWS, RTD_GLO, RTD_GLO_COL); + half3 RTD_GLO_OTHERS = RTD_GLO; + //** + + + //RT_RL + half3 RTD_RL_LARL_OO; + half RTD_RL_MAIN; + half RTD_RL_CHE_1 = RT_RL(viewDirection, normalDirection, lightColor, RTD_RL_LARL_OO, RTD_RL_MAIN); + //** + + + //RT_ST + half3 RTD_SHAT_COL; + half RTD_STIAL; + half RTD_ST_IS; + half3 RTD_ST_LAF; + half RTD_ST = RT_ST(input.uv, positionWS, normalDirection, RTD_NDOTL, attenuation, lightDirection, RTD_LVLC, RTD_PT_COL, lig_col_int, RTD_SCT, RTD_OSC, RTD_PT, RTD_SHAT_COL, RTD_STIAL, RTD_ST_IS, RTD_ST_LAF); + //** + + + //RT_SS + half RTD_SS = RT_SS(input.vertexColor, RTD_NDOTL, attenuation, _MainLightShadowData.x); + //** + + + //RT_RELGI_SUB1 + half ref_int_val; + half3 RTD_SL_OFF_OTHERS = RT_RELGI_SUB1(input.staticLightmapUV, RTD_DYN_LIGMAP_UV, RTD_GI_FS_OO, RTD_SHAT_COL, RTD_MCIALO, RTD_STIAL, mainLight, normalDirection, positionWS, viewDirection, input.positionCS.xy ); + //== + + + half3 RTD_RL_LIG; + half3 RTD_RL_SHA; + #ifdef N_F_RLIS_ON + RTD_RL_LIG = lerp( RTD_MCIALO_IL * RTD_HL , RTD_GLO_COL , RTD_GLO_OTHERS ); + RTD_RL_SHA = lerp (lerp( RTD_ST_LAF, RTD_LAS, RTD_ST_IS),RTD_RL_LARL_OO,RTD_RL_CHE_1 * RTD_LVLC ); + #else + RTD_RL_LIG = lerp( lerp( RTD_MCIALO_IL * RTD_HL , RTD_GLO_COL , RTD_GLO_OTHERS) , RTD_RL_LARL_OO , RTD_RL_CHE_1 ); + RTD_RL_SHA = lerp( RTD_ST_LAF, RTD_LAS, RTD_ST_IS); + #endif + + #ifndef N_F_OFLMB_ON + half3 RTD_R_OFF_OTHERS = lerp( RTD_RL_SHA , lerp( RTD_ST_LAF, RTD_RL_LIG * lightColor.rgb, RTD_ST) , RTD_SS ) ; + #else + half3 RTD_R_OFF_OTHERS = (half3)0.0; + #endif + + + //RT_R + half3 RTD_R = RT_R(input.uv, viewReflectDirection, viewDirection, normalDirection, RTD_TEX_COL, RTD_R_OFF_OTHERS, positionWS); + //== + + + //RT_SL + half3 RTD_SL_CHE_1; + half3 RTD_SL = RT_SL(input.uv, positionWS, normalDirection, RTD_SL_OFF_OTHERS, RTD_TEX_COL, RTD_R, RTD_SL_CHE_1); + //== + + + //RT_RL_SUB1 + half3 RTD_RL = RT_RL_SUB1(RTD_SL_CHE_1, RTD_RL_LARL_OO, RTD_RL_MAIN); + //== + + + half3 RTD_CA_OFF_OTHERS = (RTD_RL + RTD_SL); + half3 main_light_output = RTD_CA_OFF_OTHERS; + + + //========/ + //========/ + #ifndef N_F_OFLMB_ON + + #if defined(_ADDITIONAL_LIGHTS) + + #if N_F_EAL_ON + + uint pixelLightCount = GetAdditionalLightsCount(); + + #if USE_CLUSTER_LIGHT_LOOP + + InputData inputData = (InputData)0; + inputData.positionWS = positionWS; + inputData.normalizedScreenSpaceUV = GetNormalizedScreenSpaceUV(input.positionCS); + + [loop] for (uint lightIndex = 0; lightIndex < min(URP_FP_DIRECTIONAL_LIGHTS_COUNT, MAX_VISIBLE_LIGHTS); lightIndex++) + { + + CLUSTER_LIGHT_LOOP_SUBTRACTIVE_LIGHT_CHECK + + Light light = GetAdditionalLight(lightIndex, input.posWorld.xyz, shadowMask); + + #ifdef _LIGHT_LAYERS + if (IsMatchingLightLayer(light.layerMask, meshRenderingLayers)) + #endif + { + #if N_F_USETLB_ON + A_L_O += RT_ADD_LI(light, input.bitangentWS, viewDirection, viewReflectDirection, positionWS, ss_col, RTD_TEX_COL, _MC_MCP, _MainTex_var, MCapOutP, _RTD_MVCOL, RTD_VD_Cal, normalDirection, RTD_SON, RTD_PT_COL, RTD_SCT, RTD_OSC, RTD_PT, RTD_MCIALO_IL, input.uv, input.vertexColor, isFrontFace, lightIndex); + #else + A_L_O = max(RT_ADD_LI(light, input.bitangentWS, viewDirection, viewReflectDirection, positionWS, ss_col, RTD_TEX_COL, _MC_MCP, _MainTex_var, MCapOutP, _RTD_MVCOL, RTD_VD_Cal, normalDirection, RTD_SON, RTD_PT_COL, RTD_SCT, RTD_OSC, RTD_PT, RTD_MCIALO_IL, input.uv, input.vertexColor, isFrontFace, lightIndex),A_L_O); + #endif + } + } + + #endif + + LIGHT_LOOP_BEGIN(pixelLightCount) + + Light light = GetAdditionalLight(lightIndex, input.posWorld.xyz, shadowMask); + + #ifdef _LIGHT_LAYERS + if (IsMatchingLightLayer(light.layerMask, meshRenderingLayers)) + #endif + { + #if N_F_USETLB_ON + A_L_O += RT_ADD_LI(light, input.bitangentWS, viewDirection, viewReflectDirection, positionWS, ss_col, RTD_TEX_COL, _MC_MCP, _MainTex_var, MCapOutP, _RTD_MVCOL, RTD_VD_Cal, normalDirection, RTD_SON, RTD_PT_COL, RTD_SCT, RTD_OSC, RTD_PT, RTD_MCIALO_IL, input.uv, input.vertexColor, isFrontFace, lightIndex); + #else + A_L_O = max(RT_ADD_LI(light, input.bitangentWS, viewDirection, viewReflectDirection, positionWS, ss_col, RTD_TEX_COL, _MC_MCP, _MainTex_var, MCapOutP, _RTD_MVCOL, RTD_VD_Cal, normalDirection, RTD_SON, RTD_PT_COL, RTD_SCT, RTD_OSC, RTD_PT, RTD_MCIALO_IL, input.uv, input.vertexColor, isFrontFace, lightIndex),A_L_O); + #endif + } + + LIGHT_LOOP_END + + #endif + + #endif + + #endif + //========/ + //========/ + + + #ifndef N_F_OFLMB_ON + #if N_F_USETLB_ON + color = main_light_output + A_L_O; + #else + color = max (main_light_output,A_L_O); + #endif + #else + color = main_light_output; + #endif + + + #if N_F_TRANS_ON + float Trans_Val = 1.0; + #ifndef N_F_CO_ON + Trans_Val = RTD_TRAN_OPA_Sli; + #else + #if N_F_ATC_ON + Trans_Val = _MainTex_var.a; + #else + Trans_Val = 1.0; + #endif + #endif + #else + float Trans_Val = 1.0; + #endif + + //RT_CA + float3 RTD_CA = RT_CA(color * SSAmOc + GLO_OUT); + //== + +//SSOL_NU +//SSOL +//#ifdef UNITY_COLORSPACE_GAMMA//SSOL +//_OutlineColor=float4(LinearToGamma22(_OutlineColor.rgb),_OutlineColor.a);//SSOL +//#endif//SSOL +//#if N_F_O_ON//SSOL +//float3 SSOLi=(float3)EdgDet(sceneUVs.xy);//SSOL +//#if N_F_O_MOTTSO_ON//SSOL +//float3 Init_FO=((RTD_CA*RTD_SON_CHE_1))*lerp((float3)1.0,_OutlineColor.rgb,SSOLi);//SSOL +//#else//SSOL +//float3 Init_FO=lerp((RTD_CA*RTD_SON_CHE_1),_OutlineColor.rgb,SSOLi);//SSOL +//#endif//SSOL +//#else//SSOL +float3 Init_FO=RTD_CA*RTD_SON_CHE_1; +//#endif//SSOL + + + //RT_NFD + #if N_F_NFD_ON + RT_NFD(input.positionCS.xy); + #endif + //== + + + float fogFactor = input.positionWSAndFogFactor.w; + + color = MixFog(Init_FO, fogFactor); + outColor = half4( color , Trans_Val); + + #ifdef _WRITE_RENDERING_LAYERS + outRenderingLayers = EncodeMeshRenderingLayer(); + #endif + + } + + ENDHLSL + + } + + Pass + { + Name "ShadowCaster" + Tags{"LightMode" = "ShadowCaster"} + + Cull [_Culling] + ZWrite On + ZTest LEqual + ColorMask 0 + + HLSLPROGRAM + #pragma only_renderers d3d9 d3d11 vulkan glcore gles3 gles metal webgpu xboxone ps4 xboxseries playstation switch switch2 +#pragma target 2.0 //targetsc + + #pragma multi_compile_instancing + + #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl" + + #pragma multi_compile_vertex _ _CASTING_PUNCTUAL_LIGHT_SHADOW + #pragma multi_compile_fragment _ LOD_FADE_CROSSFADE + + #pragma vertex ShadowPassVertex + #pragma fragment ShadowPassFragment + +/*//Tess_SCP_1 + #pragma require tessellation + #pragma hull hull + #pragma domain domain +//TessTess_SCP_1_End*/ + + #pragma shader_feature_local_fragment N_F_TRANS_ON + #pragma shader_feature_local_fragment N_F_SIMTRANS_ON + #pragma shader_feature_local N_F_DDMD_ON + + #pragma shader_feature_local_fragment N_F_TRANSAFFSHA_ON + #pragma shader_feature_local_fragment N_F_CO_ON + #pragma shader_feature_local_fragment N_F_NFD_ON + #pragma shader_feature_local_fragment N_F_TP_ON + #pragma shader_feature_local_fragment N_F_SCO_ON + #pragma shader_feature_local_vertex N_F_SE_ON + #pragma shader_feature_local _UVSET_UV0 _UVSET_UV1 + + #include "Assets/RealToon/RealToon Shaders/RealToon Core/URP/RT_URP_Core.hlsl" + + #if defined(LOD_FADE_CROSSFADE) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/LODCrossFade.hlsl" + #endif + +//#define N_F_TESS_ON//SCT + + float3 _LightDirection; + float3 _LightPosition; + + struct Attributes + { + + float4 positionOS : POSITION; + float3 normalOS : NORMAL; + float2 texcoord : TEXCOORD0; + float2 uv1 : TEXCOORD1; + #if defined(UNITY_DOTS_INSTANCING_ENABLED) + + #ifndef N_F_DDMD_ON + float4 tangentOS : TANGENT; +float4 weights : BLENDWEIGHTS;//DOTS_LiBleSki_SC +uint4 indices : BLENDINDICES;//DOTS_LiBleSki_SC +//uint vertexID : SV_VertexID;//DOTS_CompDef_SC + #endif + + #endif + UNITY_VERTEX_INPUT_INSTANCE_ID + + }; + + struct Varyings + { + + float2 uv : TEXCOORD0; + float4 projPos : TEXCOORD1; + float3 normalWS : TEXCOORD2; + float3 positionWS : TEXCOORD3; + float4 positionCS : SV_POSITION; + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + + }; + + float4 GetShadowPositionHClip(Attributes input, float3 positionWS, float3 normalWS) + { + + #if _CASTING_PUNCTUAL_LIGHT_SHADOW + float3 lightDirectionWS = normalize(_LightPosition - positionWS); + #else + float3 lightDirectionWS = _LightDirection; + #endif + + float invNdotL = 1.0 - saturate(dot(lightDirectionWS, normalWS)); + float scale = invNdotL * _ShadowBias.y; + + positionWS = lightDirectionWS * _ShadowBias.xxx + positionWS; + positionWS = normalWS * scale.xxx + positionWS; + float4 positionCS = TransformWorldToHClip( positionWS ); + + #if UNITY_REVERSED_Z + positionCS.z = min(positionCS.z, UNITY_NEAR_CLIP_VALUE) + -_ReduSha * 0.01; + #else + positionCS.z = max(positionCS.z, UNITY_NEAR_CLIP_VALUE) + _ReduSha * 0.01; + #endif + + + return positionCS; + + } + +Varyings ShadowPassVertex(Attributes input)//SCP + { + + Varyings output = (Varyings)0; + UNITY_SETUP_INSTANCE_ID (input); + UNITY_TRANSFER_INSTANCE_ID(input, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + #if _UVSET_UV0 + output.uv = input.texcoord; + #elif _UVSET_UV1 + output.uv = input.uv1; + #endif + + #if defined(UNITY_DOTS_INSTANCING_ENABLED) + + #if !defined (N_F_TESS_ON) + + #if N_F_DDMD_ON + + float4 _LBS_CD_Position = input.positionOS; + float3 _LBS_CD_Normal = input.normalOS; + //float4 _LBS_CD_Tangent = input.tangentOS; //not currently needed + + #else + + float4 _LBS_CD_Position = 0; + float3 _LBS_CD_Normal = 0; + float4 _LBS_CD_Tangent = 0; + +DOTS_LiBleSki(input.indices, input.weights, input.positionOS.xyz, input.normalOS.xyz, input.tangentOS.xyz, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_LiBleSki_SC +//DOTS_CompDef(input.vertexID, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_CompDef_SC + + #endif + + #else + float4 _LBS_CD_Position = input.positionOS; + float3 _LBS_CD_Normal = input.normalOS; + //float4 _LBS_CD_Tangent = input.tangentOS; //not currently needed + #endif + + #else + + float4 _LBS_CD_Position = input.positionOS; + float3 _LBS_CD_Normal = input.normalOS; + //float4 _LBS_CD_Tangent = input.tangentOS; //not currently needed + + #endif + + VertexPositionInputs vertexInput = GetVertexPositionInputs(_LBS_CD_Position.xyz); + + + //RT_SE + #if N_F_SE_ON + input.positionOS = RT_SE(vertexInput.positionWS, input.positionOS); + _LBS_CD_Position = input.positionOS; + #endif + //== + + + //output.positionCS = vertexInput.positionCS; //might remove + output.positionWS = TransformObjectToWorld(_LBS_CD_Position.xyz); + output.normalWS = TransformObjectToWorldDir(_LBS_CD_Normal); + output.projPos = ComputeScreenPos (output.positionCS); + output.positionCS = GetShadowPositionHClip(input, output.positionWS, output.normalWS); + + return output; + + } + +/*//Tess_SCP_2 + struct TessVertex + { + + float4 positionOS : INTERNALTESSPOS; + float3 normalOS : NORMAL; + + #ifndef N_F_DDMD_ON + float4 tangentOS : TANGENT; + #endif + + float2 uv : TEXCOORD0; + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + + }; + + struct OutputPatchConstant + { + float edge[3] : SV_TessFactor; + float inside : SV_InsideTessFactor; + }; + + TessVertex ShadowPassVertex(Attributes v) + { + TessVertex o = (TessVertex)0; + UNITY_SETUP_INSTANCE_ID(v); + UNITY_TRANSFER_INSTANCE_ID(v, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + o.positionOS = v.positionOS; + o.normalOS = v.normalOS; + + #if defined(UNITY_DOTS_INSTANCING_ENABLED) && !defined(N_F_DDMD_ON) + o.tangentOS = v.tangentOS; + #endif + + o.uv = v.texcoord; + return o; + } + + float Tessellation(TessVertex v) + { + + half RTD_TES_TRANS_Sli = (1.0 - _TessellationTransition); + half RTD_TES = lerp(_TessellationNear,_TessellationFar,saturate( ( distance(mul(GetObjectToWorldMatrix(), v.positionOS).xyz,_WorldSpaceCameraPos) * RTD_TES_TRANS_Sli ) ) ); + + return RTD_TES; + + } + + float4 Tessellation(TessVertex v, TessVertex v1, TessVertex v2) + { + + float tv = Tessellation(v); + float tv1 = Tessellation(v1); + float tv2 = Tessellation(v2); + return float4( tv1+tv2, tv2+tv, tv+tv1, tv+tv1+tv2 ) / float4(2,2,2,3); + + } + + OutputPatchConstant hullconst (InputPatch v) + { + + OutputPatchConstant o = (OutputPatchConstant)0; + UNITY_SETUP_INSTANCE_ID(v[0]); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + float4 ts = Tessellation( v[0], v[1], v[2] ); + o.edge[0] = ts.x; + o.edge[1] = ts.y; + o.edge[2] = ts.z; + o.inside = ts.w; + return o; + + } + + [domain("tri")] + [partitioning("fractional_odd")] + [outputtopology("triangle_cw")] + [patchconstantfunc("hullconst")] + [outputcontrolpoints(3)] + + TessVertex hull (InputPatch v, uint id : SV_OutputControlPointID) + { + return v[id]; + } + + [domain("tri")] + Varyings domain (OutputPatchConstant tessFactors, const OutputPatch vi, float3 bary : SV_DomainLocation) + { + + Attributes v = (Attributes)0; + UNITY_SETUP_INSTANCE_ID(vi[0]); + UNITY_TRANSFER_INSTANCE_ID(vi[0], v); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(v); + + v.positionOS = vi[0].positionOS*bary.x + vi[1].positionOS*bary.y + vi[2].positionOS*bary.z; + + float3 pp[3]; + for (int i = 0; i < 3; ++i) + { + pp[i] = v.positionOS.xyz - vi[i].normalOS * (dot(v.positionOS.xyz, vi[i].normalOS) - dot(vi[i].positionOS.xyz, vi[i].normalOS)); + } + + v.positionOS.xyz = _TessellationSmoothness * (pp[0] * bary.x + pp[1] * bary.y + pp[2] * bary.z) + (1.0f - _TessellationSmoothness) * v.positionOS.xyz; + v.normalOS = normalize( (vi[0]. normalOS * bary.x + vi[1].normalOS * bary.y + vi[2].normalOS * bary.z) ); + + #if defined(UNITY_DOTS_INSTANCING_ENABLED) && !defined(N_F_DDMD_ON) + v.tangentOS = vi[0].tangentOS*bary.x + vi[1].tangentOS*bary.y + vi[2].tangentOS*bary.z; + #endif + + v.texcoord = vi[0].uv*bary.x + vi[1].uv*bary.y + vi[2].uv*bary.z; + + if (_NorMapAsDis == 1) + { + float2 uv = TRANSFORM_TEX(v.texcoord, _NormalMap); + float norma_disp = dot(float3(0.299, 0.587, 0), normalize(UnpackNormal(SAMPLE_TEXTURE2D_LOD(_NormalMap, sampler_NormalMap, uv, 0))) ) ; + v.positionOS.xyz += v.normalOS * (norma_disp * (_NormalMapIntensity * 0.01) ); + } + + Varyings o = PostProcessVertex(v); + return o; + + } +//Tess_FP_2_End*/ + + half4 ShadowPassFragment(Varyings input) : SV_TARGET + { + + UNITY_SETUP_INSTANCE_ID (input); + + float4 objPos = mul ( GetObjectToWorldMatrix(), float4(0.0,0.0,0.0,1.0) ); + float2 sceneUVs = (input.projPos.xy / input.projPos.w); + half RTD_OB_VP_CAL = distance(objPos.rgb,_WorldSpaceCameraPos); + half2 RTD_VD_Cal = (float2((sceneUVs.x * 2.0 - 1.0)*(_ScreenParams.r/_ScreenParams.g), sceneUVs.y * 2.0 - 1.0).rg*RTD_OB_VP_CAL); + + + //** + half2 _TexturePatternStyle_var; + if (!_TexturePatternStyle) + { + _TexturePatternStyle_var = input.uv; + } + else + { + _TexturePatternStyle_var = RTD_VD_Cal; + } + //** + + + #if N_F_TP_ON + half4 _MainTex_var = RT_Tripl_Default(_MainTex, sampler_MainTex, input.positionWS, input.normalWS); + #else + half4 _MainTex_var = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, TRANSFORM_TEX(_TexturePatternStyle_var, _MainTex)); + #endif + + + #if N_F_TRANSAFFSHA_ON + + + //RT_TRANS_CO + half RTD_TRAN_OPA_Sli; + half RTD_CO; + half3 GLO_OUT; + RT_TRANS_CO(input.uv, _MainTex_var, _MainTex_var.a, RTD_TRAN_OPA_Sli, RTD_CO, input.positionWS, input.normalWS, input.positionCS.xy, GLO_OUT); + + #if N_F_TRANS_ON + #ifndef N_F_CO_ON + float dither = tex3D(_DitherMaskLOD, float3(input.positionCS.xy * 0.25, RTD_TRAN_OPA_Sli * 0.99)).a; + clip(saturate((0.74 > 0.5 ? (1.0 - (1.0 - 2.0 * (0.74 - 0.5)) * (1.0 - dither)) : (2.0 * 0.74 * dither))) - 0.5); + #endif + #endif + //== + + + #endif + + + //RT_NFD + #if N_F_NFD_ON + RT_NFD(input.positionCS.xy); + #endif + //== + + + #ifdef LOD_FADE_CROSSFADE + LODFadeCrossFade(input.positionCS); + #endif + + return 0; + } + + ENDHLSL + } + + Pass + { + + Name "GBuffer" + Tags{"LightMode" = "UniversalGBuffer"} + + Cull [_Culling] + ZWrite[_ZWrite] + ZTest [_ZTest] + +/*//G_ST + Stencil { + Ref[_RefVal] + Comp [_Compa] + Pass [_Oper] + Fail [_Oper] + } +//G_ST_En*/ + + HLSLPROGRAM + + #pragma only_renderers d3d9 d3d11 vulkan glcore gles3 gles metal webgpu xboxone ps4 xboxseries playstation switch switch2 + #pragma target 4.5 + + #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN + #pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS + #pragma multi_compile _ EVALUATE_SH_MIXED EVALUATE_SH_VERTEX + #pragma multi_compile_fragment _ _ADDITIONAL_LIGHT_SHADOWS + #pragma multi_compile_fragment _ _REFLECTION_PROBE_BLENDING + #pragma multi_compile_fragment _ _REFLECTION_PROBE_BOX_PROJECTION + #pragma multi_compile_fragment _ _SHADOWS_SOFT _SHADOWS_SOFT_LOW _SHADOWS_SOFT_MEDIUM _SHADOWS_SOFT_HIGH + #pragma multi_compile_fragment _ _SCREEN_SPACE_OCCLUSION + #pragma multi_compile_fragment _ _SCREEN_SPACE_IRRADIANCE + #pragma multi_compile_fragment _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3 + #pragma multi_compile_fragment _ _LIGHT_COOKIES + #pragma multi_compile _ _LIGHT_LAYERS + #pragma multi_compile_fragment _ _RENDER_PASS_ENABLED + #pragma multi_compile _ _CLUSTER_LIGHT_LOOP + + #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl" + #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/RenderingLayers.hlsl" + + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/GBufferOutput.hlsl" + + #pragma multi_compile _ LIGHTMAP_SHADOW_MIXING + #pragma multi_compile _ SHADOWS_SHADOWMASK + #pragma multi_compile _ DIRLIGHTMAP_COMBINED + #pragma multi_compile _ LIGHTMAP_ON + #pragma multi_compile_fragment _ LIGHTMAP_BICUBIC_SAMPLING + #pragma multi_compile_fragment _ REFLECTION_PROBE_ROTATION + #pragma multi_compile _ DYNAMICLIGHTMAP_ON + #pragma multi_compile _ USE_LEGACY_LIGHTMAPS + #pragma multi_compile _ LOD_FADE_CROSSFADE + #pragma multi_compile_fragment _ _GBUFFER_NORMALS_OCT + + #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ProbeVolumeVariants.hlsl" + + #pragma multi_compile_fog + #pragma multi_compile_instancing + #pragma instancing_options renderinglayer + #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl" + + #pragma vertex LitPassVertex + #pragma fragment LitPassFragment + +/*//Tess_GBP_1 + #pragma require tessellation + #pragma hull hull + #pragma domain domain +//TessTess_GBP_1_End*/ + + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" + + #pragma shader_feature_local_fragment N_F_USETLB_ON + #pragma shader_feature_local_fragment N_F_TRANS_ON + #pragma shader_feature_local_fragment N_F_SIMTRANS_ON + #pragma shader_feature_local N_F_DDMD_ON + + #pragma shader_feature_local_fragment N_F_O_ON + #pragma shader_feature_local_fragment N_F_O_MOTTSO_ON + #pragma shader_feature_local_fragment N_F_MC_ON + #pragma shader_feature_local_fragment N_F_NM_ON + #pragma shader_feature_local_fragment N_F_CO_ON + #pragma shader_feature_local_fragment N_F_SL_ON + #pragma shader_feature_local_fragment N_F_CA_ON + #pragma shader_feature_local_fragment N_F_GLO_ON + #pragma shader_feature_local_fragment N_F_GLOT_ON + #pragma shader_feature_local_fragment N_F_SS_ON + #pragma shader_feature_local_fragment N_F_SCT_ON + #pragma shader_feature_local_fragment N_F_ST_ON + #pragma shader_feature_local_fragment N_F_STIS_ON + #pragma shader_feature_local_fragment N_F_STIAL_ON + #pragma shader_feature_local N_F_SON_ON + #pragma shader_feature_local_fragment N_F_PT_ON + #pragma shader_feature_local_fragment N_F_RELGI_ON + #pragma shader_feature_local_fragment N_F_CLD_ON + #pragma shader_feature_local_fragment N_F_R_ON + #pragma shader_feature_local_fragment N_F_FR_ON + #pragma shader_feature_local_fragment N_F_RL_ON + #pragma shader_feature_local_fragment N_F_RLIS_ON + #pragma shader_feature_local_fragment N_F_HDLS_ON + #pragma shader_feature_local_fragment N_F_HPSS_ON + #pragma shader_feature_local_fragment N_F_EAL_ON + #pragma shader_feature_local_fragment N_F_NLASOBF_ON + #pragma shader_feature_local_fragment N_F_OFLMB_ON + #pragma shader_feature_local_fragment N_F_ESSAO_ON + #pragma shader_feature_local_fragment N_F_RDC_ON + #pragma shader_feature_local_fragment N_F_COEDGL_ON + #pragma shader_feature_local_fragment N_F_NFD_ON + #pragma shader_feature_local_fragment N_F_TP_ON + #pragma shader_feature_local N_F_PA_ON + #pragma shader_feature_local N_F_SE_ON + #pragma shader_feature_local_fragment N_F_SCO_ON + #pragma shader_feature_local_fragment N_F_STSDFM_ON + #pragma shader_feature_local_fragment N_F_ANIS_ON + #pragma shader_feature_local_fragment N_F_LLI_ON + #pragma shader_feature_local_fragment N_F_SLMM_ON + #pragma shader_feature_local _UVSET_UV0 _UVSET_UV1 + + #include "Assets/RealToon/RealToon Shaders/RealToon Core/URP/RT_URP_Core.hlsl" + + #if defined(LOD_FADE_CROSSFADE) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/LODCrossFade.hlsl" + #endif + +//#define N_F_TESS_ON//GBT + #define _EMISSION + + struct Attributes + { + + float4 positionOS : POSITION; + float3 normalOS : NORMAL; + float4 tangentOS : TANGENT; + float2 uv : TEXCOORD0; + float2 staticLightmapUV : TEXCOORD1; + float2 dynamicLightmapUV : TEXCOORD2; + float4 vertexColor : COLOR; + #if defined(UNITY_DOTS_INSTANCING_ENABLED) + + #ifndef N_F_DDMD_ON +float4 weights : BLENDWEIGHTS;//DOTS_LiBleSki_GB +uint4 indices : BLENDINDICES;//DOTS_LiBleSki_GB +//uint vertexID : SV_VertexID;//DOTS_CompDef_GB + #endif + + #endif + UNITY_VERTEX_INPUT_INSTANCE_ID + + }; + + struct Varyings + { + + float2 uv : TEXCOORD0; + float4 positionWSAndFogFactor : TEXCOORD1; + float3 normalWS : TEXCOORD2; + float3 tangentWS : TEXCOORD3; + float3 bitangentWS : TEXCOORD4; + float4 posWorld : TEXCOORD5; + +#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + float4 shadowCoord : TEXCOORD6; +#endif + float4 projPos : TEXCOORD7; + + float2 staticLightmapUV : TEXCOORD8; + #ifdef DYNAMICLIGHTMAP_ON + float2 dynamicLightmapUV : TEXCOORD9; + #endif + + float3 smoNorm : TEXCOORD10; + float4 vertexColor : COLOR; + float4 positionCS : SV_POSITION; + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + + }; + +Varyings LitPassVertex(Attributes input)//GBP + { + + Varyings output = (Varyings)0; + + UNITY_SETUP_INSTANCE_ID (input); + UNITY_TRANSFER_INSTANCE_ID(input, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + #if defined(UNITY_DOTS_INSTANCING_ENABLED) + + #if !defined (N_F_TESS_ON) + + #if N_F_DDMD_ON + + float4 _LBS_CD_Position = input.positionOS; + float3 _LBS_CD_Normal = input.normalOS; + float4 _LBS_CD_Tangent = input.tangentOS; + + #else + + float4 _LBS_CD_Position = 0; + float3 _LBS_CD_Normal = 0; + float4 _LBS_CD_Tangent = 0; + +DOTS_LiBleSki(input.indices, input.weights, input.positionOS.xyz, input.normalOS.xyz, input.tangentOS.xyz, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_LiBleSki_GB +//DOTS_CompDef(input.vertexID, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_CompDef_GB + + #endif + + #else + + float4 _LBS_CD_Position = input.positionOS; + float3 _LBS_CD_Normal = input.normalOS; + float4 _LBS_CD_Tangent = input.tangentOS; + + #endif + + #else + + float4 _LBS_CD_Position = input.positionOS; + float3 _LBS_CD_Normal = input.normalOS; + float4 _LBS_CD_Tangent = input.tangentOS; + + #endif + + VertexPositionInputs vertexInput = GetVertexPositionInputs(_LBS_CD_Position.xyz); + VertexNormalInputs vertexNormalInput = GetVertexNormalInputs(_LBS_CD_Normal, _LBS_CD_Tangent); + + + //RT_SE + #if N_F_SE_ON + input.positionOS = RT_SE(vertexInput.positionWS, input.positionOS); + _LBS_CD_Position = input.positionOS; + #endif + //== + + + //RT_PA + #if N_F_PA_ON + output.positionCS = mul(RT_PA(-vertexInput.positionVS.z), float4(_LBS_CD_Position.xyz,1.0) ) + (float4(0,0,_ObjePosiZCS,0.0) * 0.0001); + #else + output.positionCS = vertexInput.positionCS + (float4(0,0,_ObjePosiZCS,0.0) * 0.0001); + #endif + //== + + + #if _UVSET_UV0 + output.uv = input.uv; + #elif _UVSET_UV1 + output.uv = input.staticLightmapUV; + #endif + + output.vertexColor = input.vertexColor; + + output.normalWS = vertexNormalInput.normalWS; + output.tangentWS = vertexNormalInput.tangentWS; + output.bitangentWS = vertexNormalInput.bitangentWS; + + float fogFactor = ComputeFogFactor(vertexInput.positionCS.z); + output.positionWSAndFogFactor = float4(vertexInput.positionWS, fogFactor); + + output.posWorld = float4(vertexInput.positionWS, 1.0); + output.projPos = ComputeScreenPos (output.positionCS); + + OUTPUT_LIGHTMAP_UV(input.staticLightmapUV, unity_LightmapST, output.staticLightmapUV); + #ifdef DYNAMICLIGHTMAP_ON + output.dynamicLightmapUV = input.dynamicLightmapUV.xy * unity_DynamicLightmapST.xy + unity_DynamicLightmapST.zw; + #endif + + + + //RT_SON + #if N_F_SON_ON + output.smoNorm = GetAbsolutePositionWS(vertexInput.positionWS); + #endif + //== + + +#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + + output.shadowCoord = GetShadowCoord(vertexInput); +#endif + + return output; + } + +//cc +/*//Tess_GBP_2 + struct TessVertex + { + + float4 positionOS : INTERNALTESSPOS; + float3 normalOS : NORMAL; + float4 tangentOS : TANGENT; + float2 uv : TEXCOORD0; + float4 vertexColor : COLOR; + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + + }; + + struct OutputPatchConstant + { + + float edge[3] : SV_TessFactor; + float inside : SV_InsideTessFactor; + + }; + + TessVertex LitPassVertex(Attributes v) + { + TessVertex o = (TessVertex)0; + UNITY_SETUP_INSTANCE_ID(v); + UNITY_TRANSFER_INSTANCE_ID(v, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + o.positionOS = v.positionOS; + o.normalOS = v.normalOS; + o.tangentOS = v.tangentOS; + o.uv = v.uv; + o.vertexColor = v.vertexColor; + return o; + } + + float Tessellation(TessVertex v) + { + + half RTD_TES_TRANS_Sli = (1.0 - _TessellationTransition); + half RTD_TES = lerp(_TessellationNear,_TessellationFar,saturate( ( distance(mul(GetObjectToWorldMatrix(), v.positionOS).xyz,_WorldSpaceCameraPos) * RTD_TES_TRANS_Sli ) ) ); + + return RTD_TES; + + } + + float4 Tessellation(TessVertex v, TessVertex v1, TessVertex v2) + { + + float tv = Tessellation(v); + float tv1 = Tessellation(v1); + float tv2 = Tessellation(v2); + return float4( tv1+tv2, tv2+tv, tv+tv1, tv+tv1+tv2 ) / float4(2,2,2,3); + + } + + OutputPatchConstant hullconst (InputPatch v) + { + + OutputPatchConstant o = (OutputPatchConstant)0; + UNITY_SETUP_INSTANCE_ID(v[0]); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + float4 ts = Tessellation( v[0], v[1], v[2] ); + o.edge[0] = ts.x; + o.edge[1] = ts.y; + o.edge[2] = ts.z; + o.inside = ts.w; + return o; + + } + + [domain("tri")] + [partitioning("fractional_odd")] + [outputtopology("triangle_cw")] + [patchconstantfunc("hullconst")] + [outputcontrolpoints(3)] + + TessVertex hull (InputPatch v, uint id : SV_OutputControlPointID) + { + return v[id]; + } + + [domain("tri")] + Varyings domain (OutputPatchConstant tessFactors, const OutputPatch vi, float3 bary : SV_DomainLocation) + { + + Attributes v = (Attributes)0; + UNITY_SETUP_INSTANCE_ID(vi[0]); + UNITY_TRANSFER_INSTANCE_ID(vi[0], v); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(v); + + v.positionOS = vi[0].positionOS*bary.x + vi[1].positionOS*bary.y + vi[2].positionOS*bary.z; + + float3 pp[3]; + for (int i = 0; i < 3; ++i) + { + pp[i] = v.positionOS.xyz - vi[i].normalOS * (dot(v.positionOS.xyz, vi[i].normalOS) - dot(vi[i].positionOS.xyz, vi[i].normalOS)); + } + + v.positionOS.xyz = _TessellationSmoothness * (pp[0] * bary.x + pp[1] * bary.y + pp[2] * bary.z) + (1.0f - _TessellationSmoothness) * v.positionOS.xyz; + v.normalOS = normalize( (vi[0]. normalOS * bary.x + vi[1].normalOS * bary.y + vi[2].normalOS * bary.z) ); + v.tangentOS = vi[0].tangentOS*bary.x + vi[1].tangentOS*bary.y + vi[2].tangentOS*bary.z; + v.uv = vi[0].uv*bary.x + vi[1].uv*bary.y + vi[2].uv*bary.z; + v.vertexColor = vi[0].vertexColor*bary.x + vi[1].vertexColor*bary.y + vi[2].vertexColor*bary.z; + + if (_NorMapAsDis == 1) + { + float2 uv = TRANSFORM_TEX(v.uv, _NormalMap); + float norma_disp = dot(float3(0.299, 0.587, 0), normalize(UnpackNormal(SAMPLE_TEXTURE2D_LOD(_NormalMap, sampler_NormalMap, uv, 0))) ) ; + v.positionOS.xyz += v.normalOS * (norma_disp * (_NormalMapIntensity * 0.01) ); + } + + Varyings o = PostProcessVertex(v); + return o; + + } +//Tess_GBP_2_End*/ + + void LitPassFragment( + Varyings input + , out half4 GBuffer0 : SV_Target0 + , out half4 GBuffer1 : SV_Target1 + , out half4 GBuffer2 : SV_Target2 + , out half4 GBuffer3 : SV_Target3 + , out half4 GBuffer4 : SV_Target4 + , out half4 Shadow_Mask : SV_Target6 + , float facing : VFACE + #ifdef _WRITE_RENDERING_LAYERS + , out uint outRenderingLayers : SV_Target5 + #endif + ) + { + + UNITY_SETUP_INSTANCE_ID (input); + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input); + + + //RT_SSAO + half SSAmOc_GOF; + #if N_F_ESSAO_ON + SSAmOc_GOF = 1; + #else + SSAmOc_GOF = 0; + #endif + //== + + + GBuffer0 = half4(0.0,0.0,0.0,1); + GBuffer1 = half4(1.0,1.0,1.0,SSAmOc_GOF); + GBuffer4 = half4(0.0,0.0,0.0,0.0); + Shadow_Mask = half4(0.0,0.0,0.0,0.0); + + float3 positionWS = input.positionWSAndFogFactor.xyz; + + #if defined(DYNAMICLIGHTMAP_ON) + float2 RTD_SHA_MAS_UV = input.dynamicLightmapUV; + float2 RTD_DYN_LIGMAP_UV = input.dynamicLightmapUV; + #else + float2 RTD_SHA_MAS_UV = input.staticLightmapUV; + float2 RTD_DYN_LIGMAP_UV = float2(0.0,0.0); + #endif + + //========= + float4 shadow_mask = SAMPLE_SHADOWMASK(RTD_SHA_MAS_UV); + + #if defined(SHADOWS_SHADOWMASK) && defined(LIGHTMAP_ON) + half4 shadowMask = shadow_mask; + Shadow_Mask = shadowMask; + #elif !defined (LIGHTMAP_ON) + half4 shadowMask = unity_ProbesOcclusion; + #else + half4 shadowMask = half4(1.0, 1.0, 1.0, 1.0); + Shadow_Mask = shadowMask; + #endif + //========== + + half3 color = (half3)0.0; + float3 A_L_O = (float3)0.0; + //float3 baked_GI = (float3)1.0; // Remove + + half isFrontFace = ( facing >= 0 ? 1 : 0 ); + float4 objPos = mul ( GetObjectToWorldMatrix(), float4(0.0,0.0,0.0,1.0) ); + float2 sceneUVs = (input.projPos.xy / input.projPos.w); + half RTD_OB_VP_CAL = distance(objPos.rgb, _WorldSpaceCameraPos); + half2 RTD_VD_Cal = (float2((sceneUVs.x * 2.0 - 1.0) * (_ScreenParams.r / _ScreenParams.g), sceneUVs.y * 2.0 - 1.0).rg * RTD_OB_VP_CAL); + + + //** + half2 RTD_TC_TP_OO; + if (!_TexturePatternStyle) + { + RTD_TC_TP_OO = input.uv; + } + else + { + RTD_TC_TP_OO = RTD_VD_Cal; + } + //** + + + input.normalWS = normalize(input.normalWS); + float3x3 tangentTransform = float3x3( input.tangentWS, input.bitangentWS, input.normalWS); + + + //RT_NM + float3 normalLocal = RT_NM(input.uv, positionWS, tangentTransform, input.normalWS); + //== + + + float3 viewDirection = normalize(_WorldSpaceCameraPos.xyz - input.posWorld.xyz); + float3 normalDirection = normalize(mul( normalLocal, tangentTransform )); + + #if defined(_GBUFFER_NORMALS_OCT) + float3 normalWS = normalize(mul( normalLocal, tangentTransform )); + float2 octNormalWS = PackNormalOctQuadEncode(normalWS); + float2 remappedOctNormalWS = saturate(octNormalWS * 0.5 + 0.5); + half3 packedNormalWS = PackFloat2To888(remappedOctNormalWS); + GBuffer2 = half4(packedNormalWS,0.0); + #else + GBuffer2 = half4(normalDirection,0.0); + #endif + + float3 viewReflectDirection = reflect( -viewDirection, normalDirection ); + + #if N_F_TP_ON + half4 _MainTex_var = RT_Tripl_Default(_MainTex, sampler_MainTex, positionWS, normalDirection); + #else + half4 _MainTex_var = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, TRANSFORM_TEX(RTD_TC_TP_OO, _MainTex)); + #endif + + #if defined(N_F_RDC_ON) + #if defined(_DBUFFER) && (!defined(N_F_TRANS_ON) || defined(N_F_CO_ON)) + RT_DC(input.positionCS, _MainTex_var, normalDirection); //cc + #endif + #endif + + #ifdef LOD_FADE_CROSSFADE + LODFadeCrossFade(input.positionCS); + #endif + + half3 _RTD_MVCOL; + if (!_MVCOL) + { + _RTD_MVCOL = (half3)1.0; + } + else + { + _RTD_MVCOL = input.vertexColor.rgb; + } + + uint meshRenderingLayers = GetMeshRenderingLayer(); + + + // + #ifdef UNITY_COLORSPACE_GAMMA + _OverallShadowColor = float4(LinearToGamma22(_OverallShadowColor.rgb), _OverallShadowColor.a); + #endif + + #ifndef N_F_OFLMB_ON + half3 RTD_OSC = (_OverallShadowColor.rgb*_OverallShadowColorPower); + #else + half3 RTD_OSC = (half3)0.0; + #endif + // + + + //RT_MCAP + half3 MCapOutP = RT_MCAP(input.uv, normalDirection); + //== + + + // + #ifdef UNITY_COLORSPACE_GAMMA + _MainColor = float4(LinearToGamma22(_MainColor.rgb),_MainColor.a); + #endif + // + half3 _MC_MCP = (_MainColor.rgb * _MaiColPo); + + + //RT_MCAP_SUB1 + half3 RTD_TEX_COL; + half3 RTD_MCIALO_IL = RT_MCAP_SUB1(MCapOutP, _MainTex_var, _RTD_MVCOL, RTD_TEX_COL); + //== + + + //RT_TRANS_CO + half RTD_TRAN_OPA_Sli; + half RTD_CO; + half3 GLO_OUT = (half3)0.0; + RT_TRANS_CO(input.uv, _MainTex_var, _MainTex_var.a, RTD_TRAN_OPA_Sli, RTD_CO, positionWS, normalDirection, input.positionCS.xy, GLO_OUT); + //== + + + //RT_SON + float3 RTD_SON_CHE_1; + float3 RTD_SON = RT_SON(input.vertexColor, input.smoNorm, normalDirection, RTD_SON_CHE_1); + //== + + + //RT_RELGI + float3 RTD_GI_FS_OO = RT_RELGI(RTD_SON); + //== + + + //RT_SCT + half3 RTD_SCT = RT_SCT(input.uv, positionWS, normalDirection, RTD_MCIALO_IL); + //== + + + //RT_PT + half3 RTD_PT_COL; + half RTD_PT = RT_PT(RTD_VD_Cal, RTD_PT_COL); + //== + + + // + #ifdef UNITY_COLORSPACE_GAMMA + _SelfShadowRealTimeShadowColor = float4(LinearToGamma22(_SelfShadowRealTimeShadowColor.rgb), _SelfShadowRealTimeShadowColor.a); + #endif + + #ifndef N_F_OFLMB_ON + half3 ss_col = lerp( RTD_PT_COL, (_SelfShadowRealTimeShadowColor.rgb * _SelfShadowRealTimeShadowColorPower) * RTD_OSC * RTD_SCT, RTD_PT); + #else + half3 ss_col = (half3)0.0; + #endif + // + + + //========/ + //========/ + #if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) + Light mainLight = GetMainLight(input.shadowCoord, positionWS, shadowMask); + #elif defined(MAIN_LIGHT_CALCULATE_SHADOWS) + Light mainLight = GetMainLight(TransformWorldToShadowCoord(positionWS), positionWS, shadowMask); + #else + Light mainLight = GetMainLight(); + #endif + + half3 mainliCol = 0.0; + half mainliSAtt = 0.0; + float3 mainliDir = float3(0.0,0.0,0.0); + + #ifdef _LIGHT_LAYERS + if (IsMatchingLightLayer(mainLight.layerMask, meshRenderingLayers)) + #endif + { + #if N_F_LLI_ON + mainliCol = clamp(mainLight.color.rgb,_LLI_Min,_LLI_Max); + #else + mainliCol = mainLight.color.rgb; + #endif + + mainliSAtt = mainLight.shadowAttenuation; + mainliDir = mainLight.direction; + } + //========/ + //========/ + + + #ifndef N_F_OFLMB_ON + #if N_F_NLASOBF_ON + half3 lightColor = lerp( (float3)0.0 , mainliCol,isFrontFace); + #else + half3 lightColor = mainliCol; + #endif + #else + half3 lightColor = (half3)0.0; + #endif + + + + #ifndef N_F_OFLMB_ON + #if N_F_HDLS_ON + half attenuation = 1.0; + #else + half dlshmin = lerp( 0.0, 0.6 ,_ShadowHardness); + half dlshmax = lerp( 1.0, 0.6 ,_ShadowHardness); + + #if N_F_NLASOBF_ON + half FB_Check = lerp( 1.0 , mainliSAtt ,isFrontFace); + #else + half FB_Check = mainliSAtt; + #endif + + half attenuation = smoothstep(dlshmin,dlshmax,FB_Check); + #endif + #else + half attenuation = 1.0; + #endif + + + + #ifndef N_F_OFLMB_ON + float3 lightDirection = mainliDir; + float3 halfDirection = normalize(viewDirection + lightDirection); + #else + float3 lightDirection = (float3)0.0; + float3 halfDirection = (float3)0.0; + #endif + + + + //RT_CLD + float3 RTD_CLD = RT_CLD(lightDirection); + //== + + + #ifndef N_F_OFLMB_ON + + //** + half3 RTD_ST_SS_AVD_OO; + if (!_SelfShadowShadowTAtViewDirection) + { + RTD_ST_SS_AVD_OO = RTD_CLD; + } + else + { + RTD_ST_SS_AVD_OO = viewDirection; + } + //** + + + half RTD_NDOTL = 0.5 * dot(RTD_ST_SS_AVD_OO, float3(RTD_SON.x, RTD_SON.y * (1-_LigIgnoYNorDir), RTD_SON.z)) + 0.5; + half RTD_LVLC = RTD_LVLC_F(lightColor.rgb); + half3 lig_col_int = (_LightIntensity * lightColor.rgb); + + //** + half3 RTD_LAS; + if (!_LightAffectShadow) + { + RTD_LAS = ss_col * RTD_LVLC; + } + else + { + RTD_LAS = ss_col * lig_col_int; + } + //** + + + #else + half3 RTD_ST_SS_AVD_OO = (half3)0.0; + half RTD_NDOTL = 0.0; + half RTD_LVLC = 0.0; + half3 lig_col_int = (half3)0.0; + half3 RTD_LAS = (half3)0.0; + #endif + + + // + #ifdef UNITY_COLORSPACE_GAMMA + _HighlightColor = float4(LinearToGamma22(_HighlightColor.rgb), _HighlightColor.a); + #endif + + #ifndef _N_F_OFLMB + half3 RTD_HL = (_HighlightColor.rgb*_HighlightColorPower+_DirectionalLightIntensity); + #else + half3 RTD_HL = (half3)0.0; + #endif + // + + + //** + half3 RTD_MC_SM_TC_OO; + if (!_SPECMODE) + { + RTD_MC_SM_TC_OO = RTD_TEX_COL * _MC_MCP; + } + else + { + RTD_MC_SM_TC_OO = RTD_TEX_COL + _MC_MCP; + } + //** + + + //** + half3 RTD_MCIALO_OO; + if (!_MCIALO) + { + RTD_MCIALO_OO = RTD_TEX_COL; + } + else + { + RTD_MCIALO_OO = lerp(RTD_MC_SM_TC_OO, _MainTex_var.rgb * MCapOutP * _RTD_MVCOL * 0.7, clamp((RTD_LVLC * 1.0), 0.0, 1.0)); + } + //** + + + half3 RTD_MCIALO = RTD_MCIALO_OO; + + + //RT_GLO + half RTD_GLO; + half3 RTD_GLO_COL; + RT_GLO(input.uv, RTD_VD_Cal, halfDirection, input.bitangentWS, normalDirection, viewDirection, positionWS, RTD_GLO, RTD_GLO_COL); + half3 RTD_GLO_OTHERS = RTD_GLO; + //== + + + //RT_RL + half3 RTD_RL_LARL_OO; + half RTD_RL_MAIN; + half RTD_RL_CHE_1 = RT_RL(viewDirection, normalDirection, lightColor, RTD_RL_LARL_OO, RTD_RL_MAIN); + //== + + + //RT_ST + half3 RTD_SHAT_COL; + half RTD_STIAL; + half RTD_ST_IS; + half3 RTD_ST_LAF; + half RTD_ST = RT_ST(input.uv, positionWS, normalDirection, RTD_NDOTL, attenuation, lightDirection, RTD_LVLC, RTD_PT_COL, lig_col_int, RTD_SCT, RTD_OSC, RTD_PT, RTD_SHAT_COL, RTD_STIAL, RTD_ST_IS, RTD_ST_LAF); + //== + + + //RT_SS + half RTD_SS = RT_SS(input.vertexColor, RTD_NDOTL, attenuation, _MainLightShadowData.x); + //== + + + //RT_RELGI_SUB1 + half ref_int_val; + half3 RTD_SL_OFF_OTHERS = RT_RELGI_SUB1(input.staticLightmapUV, RTD_DYN_LIGMAP_UV, RTD_GI_FS_OO, RTD_SHAT_COL, RTD_MCIALO, RTD_STIAL, mainLight, normalDirection, positionWS, viewDirection, input.positionCS.xy ); + //== + + + half3 RTD_RL_LIG; + half3 RTD_RL_SHA; + #ifdef N_F_RLIS_ON + RTD_RL_LIG = lerp( RTD_MCIALO_IL * RTD_HL , RTD_GLO_COL , RTD_GLO_OTHERS ); + RTD_RL_SHA = lerp (lerp( RTD_ST_LAF, RTD_LAS, RTD_ST_IS),RTD_RL_LARL_OO,RTD_RL_CHE_1 * RTD_LVLC ); + #else + RTD_RL_LIG = lerp( lerp( RTD_MCIALO_IL * RTD_HL , RTD_GLO_COL , RTD_GLO_OTHERS) , RTD_RL_LARL_OO , RTD_RL_CHE_1 ); + RTD_RL_SHA = lerp( RTD_ST_LAF, RTD_LAS, RTD_ST_IS); + #endif + + #ifndef N_F_OFLMB_ON + half3 RTD_R_OFF_OTHERS = lerp( RTD_RL_SHA , lerp( RTD_ST_LAF, RTD_RL_LIG * lightColor.rgb, RTD_ST) , RTD_SS ) ; + #else + half3 RTD_R_OFF_OTHERS = (half3)0.0; + #endif + + + //RT_R + half3 RTD_R = RT_R(input.uv, viewReflectDirection, viewDirection, normalDirection, RTD_TEX_COL, RTD_R_OFF_OTHERS, positionWS); + //== + + + //RT_SL + half3 RTD_SL_CHE_1; + half3 RTD_SL = RT_SL(input.uv, positionWS, normalDirection, RTD_SL_OFF_OTHERS, RTD_TEX_COL, RTD_R, RTD_SL_CHE_1); + //== + + + //RT_RL_SUB1 + half3 RTD_RL = RT_RL_SUB1(RTD_SL_CHE_1, RTD_RL_LARL_OO, RTD_RL_MAIN); + //== + + + half3 RTD_CA_OFF_OTHERS = (RTD_RL + RTD_SL); + half3 main_light_output = RTD_CA_OFF_OTHERS; + + + //========/ + //========/ + #ifndef N_F_OFLMB_ON + + #if defined(_ADDITIONAL_LIGHTS) + + #if N_F_EAL_ON + + uint pixelLightCount = GetAdditionalLightsCount(); + + #if USE_CLUSTER_LIGHT_LOOP + + InputData inputData = (InputData)0; + inputData.positionWS = positionWS; + inputData.normalizedScreenSpaceUV = GetNormalizedScreenSpaceUV(input.positionCS); + + [loop] for (uint lightIndex = 0; lightIndex < min(URP_FP_DIRECTIONAL_LIGHTS_COUNT, MAX_VISIBLE_LIGHTS); lightIndex++) + { + + CLUSTER_LIGHT_LOOP_SUBTRACTIVE_LIGHT_CHECK + + Light light = GetAdditionalLight(lightIndex, input.posWorld.xyz, shadowMask); + + #ifdef _LIGHT_LAYERS + if (IsMatchingLightLayer(light.layerMask, meshRenderingLayers)) + #endif + { + #if N_F_USETLB_ON + A_L_O += RT_ADD_LI(light, input.bitangentWS, viewDirection, viewReflectDirection, positionWS, ss_col, RTD_TEX_COL, _MC_MCP, _MainTex_var, MCapOutP, _RTD_MVCOL, RTD_VD_Cal, normalDirection, RTD_SON, RTD_PT_COL, RTD_SCT, RTD_OSC, RTD_PT, RTD_MCIALO_IL, input.uv, input.vertexColor, isFrontFace, lightIndex); + #else + A_L_O = max(RT_ADD_LI(light, input.bitangentWS, viewDirection, viewReflectDirection, positionWS, ss_col, RTD_TEX_COL, _MC_MCP, _MainTex_var, MCapOutP, _RTD_MVCOL, RTD_VD_Cal, normalDirection, RTD_SON, RTD_PT_COL, RTD_SCT, RTD_OSC, RTD_PT, RTD_MCIALO_IL, input.uv, input.vertexColor, isFrontFace, lightIndex),A_L_O); + #endif + } + } + #endif + + LIGHT_LOOP_BEGIN(pixelLightCount) + Light light = GetAdditionalLight(lightIndex, input.posWorld.xyz, shadowMask); + + #ifdef _LIGHT_LAYERS + if (IsMatchingLightLayer(light.layerMask, meshRenderingLayers)) + #endif + { + #if N_F_USETLB_ON + A_L_O += RT_ADD_LI(light, input.bitangentWS, viewDirection, viewReflectDirection, positionWS, ss_col, RTD_TEX_COL, _MC_MCP, _MainTex_var, MCapOutP, _RTD_MVCOL, RTD_VD_Cal, normalDirection, RTD_SON, RTD_PT_COL, RTD_SCT, RTD_OSC, RTD_PT, RTD_MCIALO_IL, input.uv, input.vertexColor, isFrontFace, lightIndex); + #else + A_L_O = max(RT_ADD_LI(light, input.bitangentWS, viewDirection, viewReflectDirection, positionWS, ss_col, RTD_TEX_COL, _MC_MCP, _MainTex_var, MCapOutP, _RTD_MVCOL, RTD_VD_Cal, normalDirection, RTD_SON, RTD_PT_COL, RTD_SCT, RTD_OSC, RTD_PT, RTD_MCIALO_IL, input.uv, input.vertexColor, isFrontFace, lightIndex),A_L_O); + #endif + } + LIGHT_LOOP_END + + #endif + + #endif + + #endif + //========/ + //========/ + + + #ifndef N_F_OFLMB_ON + #if N_F_USETLB_ON + color = main_light_output + A_L_O; + #else + color = max (main_light_output,A_L_O); + #endif + #else + color = main_light_output; + #endif + + + #if N_F_TRANS_ON + float Trans_Val = 1.0; + #ifndef N_F_CO_ON + Trans_Val = RTD_TRAN_OPA_Sli; + #endif + #else + float Trans_Val = 1.0; + #endif + + //RT_CA + float3 RTD_CA = RT_CA(color + GLO_OUT); + +//SSOL_NU +//SSOL +//#ifdef UNITY_COLORSPACE_GAMMA//SSOL +//_OutlineColor=float4(LinearToGamma22(_OutlineColor.rgb),_OutlineColor.a);//SSOL +//#endif//SSOL +//#if N_F_O_ON//SSOL +//float3 SSOLi=(float3)EdgDet(sceneUVs.xy);//SSOL +//#if N_F_O_MOTTSO_ON//SSOL +//float3 Init_FO=((RTD_CA*RTD_SON_CHE_1))*lerp((float3)1.0,_OutlineColor.rgb,SSOLi);//SSOL +//#else//SSOL +//float3 Init_FO=lerp((RTD_CA*RTD_SON_CHE_1),_OutlineColor.rgb,SSOLi);//SSOL +//#endif//SSOL +//#else//SSOL +float3 Init_FO=RTD_CA*RTD_SON_CHE_1; +//#endif//SSOL + + + //RT_NFD + #if N_F_NFD_ON + RT_NFD(input.positionCS.xy); + #endif + //== + + + float fogFactor = input.positionWSAndFogFactor.w; + + color = MixFog(Init_FO, fogFactor); + GBuffer3 = half4(color, Trans_Val); + + #ifdef _WRITE_RENDERING_LAYERS + outRenderingLayers = EncodeMeshRenderingLayer(); + #endif + + #if _RENDER_PASS_ENABLED + GBuffer4 = input.positionCS.z; + #endif + + } + + ENDHLSL + + } + + Pass + { + Name "DepthOnly" + Tags{"LightMode" = "DepthOnly"} + + Cull [_Culling] + ZWrite On + ColorMask R + + HLSLPROGRAM + + #pragma only_renderers d3d9 d3d11 vulkan glcore gles3 gles metal webgpu xboxone ps4 xboxseries playstation switch switch2 +#pragma target 2.0 //targetdo + + #pragma vertex DepthOnlyVertex + #pragma fragment DepthOnlyFragment + +/*//Tess_DOP_1 + #pragma require tessellation + #pragma hull hull + #pragma domain domain +//TessTess_DOP_1_End*/ + + #pragma multi_compile_instancing + + #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl" + + #pragma multi_compile_fragment _ LOD_FADE_CROSSFADE + + #pragma shader_feature_local_fragment N_F_TRANS_ON + #pragma shader_feature_local_fragment N_F_SIMTRANS_ON + #pragma shader_feature_local_fragment N_F_TRANSAFFSHA_ON + #pragma shader_feature_local_fragment N_F_CO_ON + #pragma shader_feature_local_fragment N_F_SCO_ON + + #pragma shader_feature_local N_F_DDMD_ON + #pragma shader_feature_local N_F_PA_ON + #pragma shader_feature_local N_F_SE_ON + #pragma shader_feature_local_fragment N_F_NFD_ON + #pragma shader_feature_local_fragment N_F_TP_ON + #pragma shader_feature_local _UVSET_UV0 _UVSET_UV1 + + #include "Assets/RealToon/RealToon Shaders/RealToon Core/URP/RT_URP_Core.hlsl" + + #if defined(LOD_FADE_CROSSFADE) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/LODCrossFade.hlsl" + #endif + +//#define N_F_TESS_ON//DOPT + + struct Attributes + { + float4 position : POSITION; + float2 texcoord : TEXCOORD0; + float2 uv1 : TEXCOORD1; + float3 normalOS : NORMAL; + float4 tangentOS : TANGENT; + + #if defined(UNITY_DOTS_INSTANCING_ENABLED) + + #ifndef N_F_DDMD_ON +float4 weights : BLENDWEIGHTS;//DOTS_LiBleSki_DO +uint4 indices : BLENDINDICES;//DOTS_LiBleSki_DO +//uint vertexID : SV_VertexID;//DOTS_CompDef_DO + #endif + + #endif + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct Varyings + { + float2 uv : TEXCOORD0; + float4 projPos : TEXCOORD1; + float3 positionWS : TEXCOORD2; + float3 normalWS : TEXCOORD3; + float4 positionCS : SV_POSITION; + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + +Varyings DepthOnlyVertex(Attributes input)//DOP + { + Varyings output = (Varyings)0; + UNITY_SETUP_INSTANCE_ID(input); + UNITY_TRANSFER_INSTANCE_ID(input, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + #if defined(UNITY_DOTS_INSTANCING_ENABLED) + + #if !defined (N_F_TESS_ON) + + #if N_F_DDMD_ON + + float4 _LBS_CD_Position = input.position; + float3 _LBS_CD_Normal = input.normalOS; + float4 _LBS_CD_Tangent = input.tangentOS; + + #else + + float4 _LBS_CD_Position = 0; + float3 _LBS_CD_Normal = 0; + float4 _LBS_CD_Tangent = 0; + +DOTS_LiBleSki(input.indices, input.weights, input.position.xyz, input.normalOS.xyz, input.tangentOS.xyz, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_LiBleSki_DO +//DOTS_CompDef(input.vertexID, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_CompDef_DO + + #endif + + #else + + float4 _LBS_CD_Position = input.position; + float3 _LBS_CD_Normal = input.normalOS; + float4 _LBS_CD_Tangent = input.tangentOS; + + #endif + + #else + + float4 _LBS_CD_Position = input.position; + float3 _LBS_CD_Normal = input.normalOS; + float4 _LBS_CD_Tangent = input.tangentOS; + + #endif + + VertexPositionInputs vertexInput = GetVertexPositionInputs(_LBS_CD_Position.xyz); + VertexNormalInputs normalInput = GetVertexNormalInputs(_LBS_CD_Normal, _LBS_CD_Tangent); + + output.positionWS = TransformObjectToWorld(_LBS_CD_Position.xyz); + output.normalWS = NormalizeNormalPerVertex(normalInput.normalWS); + + #if _UVSET_UV0 + output.uv = input.texcoord; + #elif _UVSET_UV1 + output.uv = input.uv1; + #endif + + + //RT_SE + #if N_F_SE_ON + input.position = RT_SE(output.positionWS, input.position); + _LBS_CD_Position = input.position; + #endif + //== + + + //RT_PA + #if N_F_PA_ON + output.positionCS = mul(RT_PA(-vertexInput.positionVS.z), float4(_LBS_CD_Position.xyz,1.0) ) + (float4(0,0,_ObjePosiZCS,0.0) * 0.0001); + #else + output.positionCS = TransformObjectToHClip(_LBS_CD_Position.xyz) + (float4(0,0,_ObjePosiZCS,0.0) * 0.0001); + #endif + // + + output.projPos = ComputeScreenPos (output.positionCS); + + return output; + } + +/*//Tess_DOP_2 + struct TessVertex + { + + float4 positionOS : INTERNALTESSPOS; + float3 normalOS : NORMAL; + float4 tangentOS : TANGENT; + float2 uv : TEXCOORD0; + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + + }; + + struct OutputPatchConstant + { + + float edge[3] : SV_TessFactor; + float inside : SV_InsideTessFactor; + + }; + + TessVertex DepthOnlyVertex(Attributes v) + { + TessVertex o = (TessVertex)0; + UNITY_SETUP_INSTANCE_ID(v); + UNITY_TRANSFER_INSTANCE_ID(v, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + o.positionOS = v.position; + o.normalOS = v.normalOS; + o.tangentOS = v.tangentOS; + o.uv = v.texcoord; + return o; + } + + float Tessellation(TessVertex v) + { + + UNITY_SETUP_INSTANCE_ID(v); + half RTD_TES_TRANS_Sli = (1.0 - _TessellationTransition); + half RTD_TES = lerp(_TessellationNear,_TessellationFar,saturate( ( distance(mul(GetObjectToWorldMatrix(), v.positionOS).xyz,_WorldSpaceCameraPos) * RTD_TES_TRANS_Sli ) ) ); + + return RTD_TES; + + } + + float4 Tessellation(TessVertex v, TessVertex v1, TessVertex v2) + { + + float tv = Tessellation(v); + float tv1 = Tessellation(v1); + float tv2 = Tessellation(v2); + return float4( tv1+tv2, tv2+tv, tv+tv1, tv+tv1+tv2 ) / float4(2,2,2,3); + + } + + OutputPatchConstant hullconst (InputPatch v) + { + + OutputPatchConstant o = (OutputPatchConstant)0; + UNITY_SETUP_INSTANCE_ID(v[0]) + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + float4 ts = Tessellation( v[0], v[1], v[2] ); + o.edge[0] = ts.x; + o.edge[1] = ts.y; + o.edge[2] = ts.z; + o.inside = ts.w; + return o; + + } + + [domain("tri")] + [partitioning("fractional_odd")] + [outputtopology("triangle_cw")] + [patchconstantfunc("hullconst")] + [outputcontrolpoints(3)] + + TessVertex hull (InputPatch v, uint id : SV_OutputControlPointID) + { + return v[id]; + } + + [domain("tri")] + Varyings domain (OutputPatchConstant tessFactors, const OutputPatch vi, float3 bary : SV_DomainLocation) + { + + Attributes v = (Attributes)0; + UNITY_SETUP_INSTANCE_ID(vi[0]); + UNITY_TRANSFER_INSTANCE_ID(vi[0], v); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(v); + + v.position = vi[0].positionOS*bary.x + vi[1].positionOS*bary.y + vi[2].positionOS*bary.z; + + float3 pp[3]; + for (int i = 0; i < 3; ++i) + { + pp[i] = v.position.xyz - vi[i].normalOS * (dot(v.position.xyz, vi[i].normalOS) - dot(vi[i].positionOS.xyz, vi[i].normalOS)); + } + + v.position.xyz = _TessellationSmoothness * (pp[0] * bary.x + pp[1] * bary.y + pp[2] * bary.z) + (1.0f - _TessellationSmoothness) * v.position.xyz; + v.normalOS = normalize( (vi[0]. normalOS * bary.x + vi[1].normalOS * bary.y + vi[2].normalOS * bary.z) ); + v.tangentOS = vi[0].tangentOS*bary.x + vi[1].tangentOS*bary.y + vi[2].tangentOS*bary.z; + v.texcoord = vi[0].uv*bary.x + vi[1].uv*bary.y + vi[2].uv*bary.z; + + if (_NorMapAsDis == 1) + { + float2 uv = TRANSFORM_TEX(v.texcoord, _NormalMap); + float norma_disp = dot(float3(0.299, 0.587, 0), normalize(UnpackNormal(SAMPLE_TEXTURE2D_LOD(_NormalMap, sampler_NormalMap, uv, 0))) ) ; + v.position.xyz += v.normalOS * (norma_disp * (_NormalMapIntensity * 0.01) ); + } + + Varyings o = PostProcessVertex(v); + return o; + + } +//Tess_DOP_2_End*/ + + half4 DepthOnlyFragment(Varyings input) : SV_TARGET + { + UNITY_SETUP_INSTANCE_ID(input); + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input); + + float4 objPos = mul ( GetObjectToWorldMatrix(), float4(0.0,0.0,0.0,1.0) ); + float2 sceneUVs = (input.projPos.xy / input.projPos.w); + half RTD_OB_VP_CAL = distance(objPos.rgb,_WorldSpaceCameraPos); + half2 RTD_VD_Cal = (float2((sceneUVs.x * 2.0 - 1.0)*(_ScreenParams.r/_ScreenParams.g), sceneUVs.y * 2.0 - 1.0).rg*RTD_OB_VP_CAL); + //float3x3 tangentTransform = float3x3( input.tangentWS, input.bitangentWS, input.normalWS); + + + //** + half2 _TexturePatternStyle_var; + if (!_TexturePatternStyle) + { + _TexturePatternStyle_var = input.uv; + } + else + { + _TexturePatternStyle_var = RTD_VD_Cal; + } + //** + + + #if N_F_TP_ON + half4 _MainTex_var = RT_Tripl_Default(_MainTex, sampler_MainTex, input.positionWS, input.normalWS); + #else + half4 _MainTex_var = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, TRANSFORM_TEX(_TexturePatternStyle_var, _MainTex)); + #endif + + #if N_F_TRANSAFFSHA_ON + + //RT_TRANS_CO + half RTD_TRAN_OPA_Sli; + half RTD_CO; + half3 GLO_OUT; + RT_TRANS_CO(input.uv, _MainTex_var, _MainTex_var.a, RTD_TRAN_OPA_Sli, RTD_CO, input.positionWS, input.normalWS, input.positionCS.xy, GLO_OUT); + + #if N_F_TRANS_ON + #ifndef N_F_CO_ON + float dither = tex3D(_DitherMaskLOD, float3(input.positionCS.xy * 0.25, RTD_TRAN_OPA_Sli * 0.99)).a; + clip(saturate((0.74 > 0.5 ? (1.0 - (1.0 - 2.0 * (0.74 - 0.5)) * (1.0 - dither)) : (2.0 * 0.74 * dither))) - 0.5); + #endif + #endif + // + + #endif + + + //RT_NFD + #if N_F_NFD_ON + RT_NFD(input.positionCS.xy); + #endif + //== + + + #ifdef LOD_FADE_CROSSFADE + LODFadeCrossFade(input.positionCS); + #endif + + return input.positionCS.z; + } + + + ENDHLSL + } + + Pass + { + Name "DepthNormals" + Tags{"LightMode" = "DepthNormals"} + + ZWrite On + Cull[_Culling] + + HLSLPROGRAM + + #pragma only_renderers d3d9 d3d11 vulkan glcore gles3 gles metal webgpu xboxone ps4 xboxseries playstation switch switch2 +#pragma target 2.0 //targetdn + + #pragma vertex DepthNormalsVertex + #pragma fragment DepthNormalsFragment + +/*//Tess_DNP_1 + #pragma require tessellation + #pragma hull hull + #pragma domain domain +//TessTess_DNP_1_End*/ + + #pragma shader_feature_local _NORMALMAP + #pragma shader_feature_local _PARALLAXMAP + #pragma shader_feature_local _ _DETAIL_MULX2 _DETAIL_SCALED + #pragma shader_feature_local_fragment _ALPHATEST_ON + #pragma shader_feature_local_fragment _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A + + #pragma multi_compile_instancing + + #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl" + #pragma multi_compile_fragment _ LOD_FADE_CROSSFADE + + #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/RenderingLayers.hlsl" + + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/SurfaceInput.hlsl" + + #pragma shader_feature_local_fragment N_F_TRANS_ON + #pragma shader_feature_local_fragment N_F_SIMTRANS_ON + + #pragma shader_feature_local_fragment N_F_TRANSAFFSHA_ON + #pragma shader_feature_local_fragment N_F_CO_ON + + #pragma shader_feature_local N_F_DDMD_ON + #pragma shader_feature_local_fragment N_F_NFD_ON + #pragma shader_feature_local_fragment N_F_TP_ON + #pragma shader_feature_local N_F_PA_ON + #pragma shader_feature_local N_F_SE_ON + #pragma shader_feature_local_fragment N_F_SCO_ON + #pragma shader_feature_local _UVSET_UV0 _UVSET_UV1 + + #include "Assets/RealToon/RealToon Shaders/RealToon Core/URP/RT_URP_Core.hlsl" + + #if defined(LOD_FADE_CROSSFADE) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/LODCrossFade.hlsl" + #endif + +//#define N_F_TESS_ON//DNT + + struct Attributes + { + float4 positionOS : POSITION; + float3 normal : NORMAL; + float4 tangentOS : TANGENT; + float2 texcoord : TEXCOORD0; + float2 uv1 : TEXCOORD1; + #if defined(UNITY_DOTS_INSTANCING_ENABLED) + + #ifndef N_F_DDMD_ON +float4 weights : BLENDWEIGHTS;//DOTS_LiBleSki_DN +uint4 indices : BLENDINDICES;//DOTS_LiBleSki_DN +//uint vertexID : SV_VertexID;//DOTS_CompDef_DN + #endif + + #endif + UNITY_VERTEX_INPUT_INSTANCE_ID + }; + + struct Varyings + { + float4 positionCS : SV_POSITION; + float2 uv : TEXCOORD1; + float3 normalWS : TEXCOORD2; + float3 positionWS : TEXCOORD3; + float4 projPos : TEXCOORD4; + //float3 tangentWS : TEXCOORD5; + //float3 bitangentWS : TEXCOORD6; + + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + }; + +Varyings DepthNormalsVertex(Attributes input)//DNP + { + Varyings output = (Varyings)0; + UNITY_SETUP_INSTANCE_ID(input); + UNITY_TRANSFER_INSTANCE_ID(input, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + #if defined(UNITY_DOTS_INSTANCING_ENABLED) + + #if !defined (N_F_TESS_ON) + + #if N_F_DDMD_ON + + float4 _LBS_CD_Position = input.positionOS; + float3 _LBS_CD_Normal = input.normal; + float4 _LBS_CD_Tangent = input.tangentOS; + + #else + + float4 _LBS_CD_Position = 0; + float3 _LBS_CD_Normal = 0; + float4 _LBS_CD_Tangent = 0; + +DOTS_LiBleSki(input.indices, input.weights, input.positionOS.xyz, input.normal.xyz, input.tangentOS.xyz, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_LiBleSki_DN +//DOTS_CompDef(input.vertexID, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_CompDef_DN + + #endif + + #else + + float4 _LBS_CD_Position = input.positionOS; + float3 _LBS_CD_Normal = input.normal; + float4 _LBS_CD_Tangent = input.tangentOS; + + #endif + + #else + + float4 _LBS_CD_Position = input.positionOS; + float3 _LBS_CD_Normal = input.normal; + float4 _LBS_CD_Tangent = input.tangentOS; + + #endif + + VertexPositionInputs vertexInput = GetVertexPositionInputs(_LBS_CD_Position.xyz); + VertexNormalInputs normalInput = GetVertexNormalInputs(_LBS_CD_Normal, _LBS_CD_Tangent); + + output.positionWS = TransformObjectToWorld(_LBS_CD_Position.xyz); + output.normalWS = NormalizeNormalPerVertex(normalInput.normalWS); + //output.tangentWS = normalInput.tangentWS; + //output.bitangentWS = normalInput.bitangentWS; + + #if _UVSET_UV0 + output.uv = TRANSFORM_TEX(input.texcoord, _MainTex); + #elif _UVSET_UV1 + output.uv = TRANSFORM_TEX(input.uv1, _MainTex); + #endif + + + //RT_SE + #if N_F_SE_ON + input.positionOS = RT_SE(output.positionWS, input.positionOS); + _LBS_CD_Position = input.positionOS; + #endif + //== + + + //RT_PA + #if N_F_PA_ON + output.positionCS = mul(RT_PA(-vertexInput.positionVS.z), float4(_LBS_CD_Position.xyz,1.0) ) + (float4(0,0,_ObjePosiZCS,0.0) * 0.0001); + #else + output.positionCS = TransformObjectToHClip(_LBS_CD_Position.xyz) + (float4(0,0,_ObjePosiZCS,0.0) * 0.0001); + #endif + //== + + + output.projPos = ComputeScreenPos (output.positionCS); + + return output; + } + +/*//Tess_DNP_2 + struct TessVertex + { + + float4 positionOS : INTERNALTESSPOS; + float3 normalOS : NORMAL; + float4 tangentOS : TANGENT; + float2 uv : TEXCOORD0; + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + + }; + + struct OutputPatchConstant + { + + float edge[3] : SV_TessFactor; + float inside : SV_InsideTessFactor; + + }; + + TessVertex DepthNormalsVertex(Attributes v) + { + TessVertex o = (TessVertex)0; + UNITY_SETUP_INSTANCE_ID(v); + UNITY_TRANSFER_INSTANCE_ID(v, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + o.positionOS = v.positionOS; + o.normalOS = v.normal; + o.tangentOS = v.tangentOS; + o.uv = v.texcoord; + return o; + } + + float Tessellation(TessVertex v) + { + + half RTD_TES_TRANS_Sli = (1.0 - _TessellationTransition); + half RTD_TES = lerp(_TessellationNear,_TessellationFar,saturate( ( distance(mul(GetObjectToWorldMatrix(), v.positionOS).xyz,_WorldSpaceCameraPos) * RTD_TES_TRANS_Sli ) ) ); + + return RTD_TES; + + } + + float4 Tessellation(TessVertex v, TessVertex v1, TessVertex v2) + { + + float tv = Tessellation(v); + float tv1 = Tessellation(v1); + float tv2 = Tessellation(v2); + return float4( tv1+tv2, tv2+tv, tv+tv1, tv+tv1+tv2 ) / float4(2,2,2,3); + + } + + OutputPatchConstant hullconst (InputPatch v) + { + + OutputPatchConstant o = (OutputPatchConstant)0; + UNITY_SETUP_INSTANCE_ID(v[0]); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + float4 ts = Tessellation( v[0], v[1], v[2] ); + o.edge[0] = ts.x; + o.edge[1] = ts.y; + o.edge[2] = ts.z; + o.inside = ts.w; + return o; + + } + + [domain("tri")] + [partitioning("fractional_odd")] + [outputtopology("triangle_cw")] + [patchconstantfunc("hullconst")] + [outputcontrolpoints(3)] + + TessVertex hull (InputPatch v, uint id : SV_OutputControlPointID) + { + return v[id]; + } + + [domain("tri")] + Varyings domain (OutputPatchConstant tessFactors, const OutputPatch vi, float3 bary : SV_DomainLocation) + { + + Attributes v = (Attributes)0; + UNITY_SETUP_INSTANCE_ID(vi[0]); + UNITY_TRANSFER_INSTANCE_ID(vi[0], v); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(v); + + v.positionOS = vi[0].positionOS*bary.x + vi[1].positionOS*bary.y + vi[2].positionOS*bary.z; + + float3 pp[3]; + for (int i = 0; i < 3; ++i) + { + pp[i] = v.positionOS.xyz - vi[i].normalOS * (dot(v.positionOS.xyz, vi[i].normalOS) - dot(vi[i].positionOS.xyz, vi[i].normalOS)); + } + + v.positionOS.xyz = _TessellationSmoothness * (pp[0] * bary.x + pp[1] * bary.y + pp[2] * bary.z) + (1.0f - _TessellationSmoothness) * v.positionOS.xyz; + v.normal = normalize( (vi[0]. normalOS * bary.x + vi[1].normalOS * bary.y + vi[2].normalOS * bary.z) ); + v.tangentOS = vi[0].tangentOS*bary.x + vi[1].tangentOS*bary.y + vi[2].tangentOS*bary.z; + v.texcoord = vi[0].uv*bary.x + vi[1].uv*bary.y + vi[2].uv*bary.z; + + if (_NorMapAsDis == 1) + { + float2 uv = TRANSFORM_TEX(v.texcoord, _NormalMap); + float norma_disp = dot(float3(0.299, 0.587, 0), normalize(UnpackNormal(SAMPLE_TEXTURE2D_LOD(_NormalMap, sampler_NormalMap, uv, 0))) ) ; + v.positionOS.xyz += v.normal * (norma_disp * (_NormalMapIntensity * 0.01) ); + } + + Varyings o = PostProcessVertex(v); + + return o; + + } +//Tess_DNP_2_End*/ + + void DepthNormalsFragment( + Varyings input + , out half4 outNormalWS : SV_Target0 + #ifdef _WRITE_RENDERING_LAYERS + , out uint outRenderingLayers : SV_Target1 + #endif + ) + { + UNITY_SETUP_INSTANCE_ID(input); + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input); + + float4 objPos = mul ( GetObjectToWorldMatrix(), float4(0.0,0.0,0.0,1.0) ); + float2 sceneUVs = (input.projPos.xy / input.projPos.w); + half RTD_OB_VP_CAL = distance(objPos.rgb,_WorldSpaceCameraPos); + half2 RTD_VD_Cal = (float2((sceneUVs.x * 2.0 - 1.0)*(_ScreenParams.r/_ScreenParams.g), sceneUVs.y * 2.0 - 1.0).rg*RTD_OB_VP_CAL); + //float3x3 tangentTransform = float3x3( input.tangentWS, input.bitangentWS, input.normalWS); + + + //** + half2 _TexturePatternStyle_var; + if (!_TexturePatternStyle) + { + _TexturePatternStyle_var = input.uv; + } + else + { + _TexturePatternStyle_var = RTD_VD_Cal; + } + //** + + + #if N_F_TP_ON + half4 _MainTex_var = RT_Tripl_Default(_MainTex, sampler_MainTex, input.positionWS, input.normalWS); + #else + half4 _MainTex_var = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, TRANSFORM_TEX(_TexturePatternStyle_var, _MainTex)); + #endif + + #if N_F_TRANSAFFSHA_ON + + //RT_TRANS_CO + half RTD_TRAN_OPA_Sli; + half RTD_CO; + half3 GLO_OUT; + RT_TRANS_CO(input.uv, _MainTex_var, _MainTex_var.a, RTD_TRAN_OPA_Sli, RTD_CO, input.positionWS, input.normalWS, input.positionCS.xy, GLO_OUT); + + #if N_F_TRANS_ON + #ifndef N_F_CO_ON + float dither = tex3D(_DitherMaskLOD, float3(input.positionCS.xy * 0.25, RTD_TRAN_OPA_Sli * 0.99)).a; + clip(saturate((0.74 > 0.5 ? (1.0 - (1.0 - 2.0 * (0.74 - 0.5)) * (1.0 - dither)) : (2.0 * 0.74 * dither))) - 0.5); + #endif + #endif + // + + #endif + + + //RT_NFD + #if N_F_NFD_ON + RT_NFD(input.positionCS.xy); + #endif + //== + + + //RT_NM + //float3 normalLocal = RT_NM(input.uv, input.positionWS, tangentTransform, input.normalWS); + //== + + + #ifdef LOD_FADE_CROSSFADE + LODFadeCrossFade(input.positionCS); + #endif + + #if defined(_GBUFFER_NORMALS_OCT) + float3 normalWS = normalize(input.normalWS); + float2 octNormalWS = PackNormalOctQuadEncode(normalWS); + float2 remappedOctNormalWS = saturate(octNormalWS * 0.5 + 0.5); + half3 packedNormalWS = PackFloat2To888(remappedOctNormalWS); + outNormalWS = half4(packedNormalWS, 0.0); + #else + float3 normalWS = NormalizeNormalPerPixel(input.normalWS); + outNormalWS = half4(normalWS, 0.0); + #endif + + #ifdef _WRITE_RENDERING_LAYERS + outRenderingLayers = EncodeMeshRenderingLayer(); + #endif + + } + + ENDHLSL + } + + Pass + { + Name "Meta" + Tags{"LightMode" = "Meta"} + + Cull Off + + HLSLPROGRAM + + #pragma only_renderers d3d9 d3d11 vulkan glcore gles3 gles metal webgpu xboxone ps4 xboxseries playstation switch switch2 +#pragma target 2.0 //targetm + + #pragma vertex UniversalVertexMeta + #pragma fragment UniversalFragmentMeta + + #pragma shader_feature EDITOR_VISUALIZATION + + #pragma shader_feature_local_fragment N_F_SL_ON + #pragma shader_feature_local_fragment N_F_SLMM_ON + #pragma shader_feature_local _UVSET_UV0 _UVSET_UV1 + + #include "Assets/RealToon/RealToon Shaders/RealToon Core/URP/RT_URP_Core.hlsl" + + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/MetaInput.hlsl" + + struct Attributes + { + float4 positionOS : POSITION; + float3 normalOS : NORMAL; + float2 uv0 : TEXCOORD0; + float2 uv1 : TEXCOORD1; + float2 uv2 : TEXCOORD2; + UNITY_VERTEX_INPUT_INSTANCE_ID + //#ifdef _TANGENT_TO_WORLD + //float4 tangentOS : TANGENT; + //#endif + }; + + struct Varyings + { + float4 positionCS : SV_POSITION; + float2 uv : TEXCOORD0; + + // + #ifdef EDITOR_VISUALIZATION + float2 VizUV : TEXCOORD1; + float4 LightCoord : TEXCOORD2; + #endif + // + + float3 normalWS : TEXCOORD3; + float3 positionWS : TEXCOORD4; + }; + + Varyings UniversalVertexMeta(Attributes input) + { + + // + Varyings output = (Varyings)0; + output.positionWS = TransformObjectToWorld(input.positionOS.xyz); + output.normalWS = TransformObjectToWorldDir(input.normalOS); + output.positionCS = UnityMetaVertexPosition(input.positionOS.xyz, input.uv1, input.uv2); + + #if _UVSET_UV0 + output.uv = TRANSFORM_TEX(input.uv0, _MainTex); + #elif _UVSET_UV1 + output.uv = TRANSFORM_TEX(input.uv1, _MainTex); + #endif + + #ifdef EDITOR_VISUALIZATION + UnityEditorVizData(input.positionOS.xyz, input.uv0, input.uv1, input.uv2, output.VizUV, output.LightCoord); + #endif + + return output; + // + } + + half4 UniversalFragmentMeta(Varyings input) : SV_Target + { + #if N_F_TP_ON + half4 _MainTex_var = RT_Tripl_Default(_MainTex, sampler_MainTex, input.positionWS, input.normalWS); + #else + half4 _MainTex_var = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, TRANSFORM_TEX(input.uv, _MainTex)); + #endif + + + // + #ifdef UNITY_COLORSPACE_GAMMA + _MainColor = float4(LinearToGamma22(_MainColor.rgb),_MainColor.a); + #endif + // + + + half4 RTD_TEX_COL = _MainTex_var * (_MainColor * _MaiColPo); + + + //RT_SL + half3 RTD_SL_CHE_1; + half3 RTD_SL = RT_SL(input.uv, input.positionWS, input.normalWS, (half3)0.0, RTD_TEX_COL.rgb, (half3)0.0, RTD_SL_CHE_1); + //== + + + MetaInput metaInput; + metaInput.Albedo = RTD_TEX_COL.rgb; + metaInput.Emission = RTD_SL; + + #ifdef EDITOR_VISUALIZATION + metaInput.VizUV = input.VizUV; + metaInput.LightCoord = input.LightCoord; + #endif + + return MetaFragment(metaInput); + } + + ENDHLSL + } + + Pass + { + Name "MotionVectors" + Tags { "LightMode" = "MotionVectors" } + + ColorMask RG + + HLSLPROGRAM + + #pragma only_renderers d3d9 d3d11 vulkan glcore gles3 gles metal webgpu xboxone ps4 xboxseries playstation switch switch2 + #pragma target 3.5 + + #pragma vertex vert + #pragma fragment frag + + #pragma multi_compile _ LOD_FADE_CROSSFADE + #pragma shader_feature_local_vertex _ADD_PRECOMPUTED_VELOCITY + + #pragma shader_feature_local_fragment N_F_TRANS_ON + #pragma shader_feature_local_fragment N_F_CO_ON + #pragma shader_feature_local_fragment N_F_NFD_ON + #pragma shader_feature_local_fragment N_F_TP_ON + #pragma shader_feature_local_fragment N_F_SCO_ON + #pragma shader_feature_local_vertex N_F_DDMD_ON + #pragma shader_feature_local_vertex N_F_PA_ON + #pragma shader_feature_local_vertex N_F_SE_ON + #pragma shader_feature_local _UVSET_UV0 _UVSET_UV1 + + #include "Assets/RealToon/RealToon Shaders/RealToon Core/URP/RT_URP_Core.hlsl" + + #pragma multi_compile_instancing + #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl" + + #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/UnityInput.hlsl" + + #if defined(LOD_FADE_CROSSFADE) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/LODCrossFade.hlsl" + #endif + + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/MotionVectorsCommon.hlsl" + #include "Assets/RealToon/RealToon Shaders/RealToon Core/URP/Pass/RT_URP_MoVecPas.hlsl" + + ENDHLSL + } + + Pass + { + Name "XRMotionVectors" + Tags { "LightMode" = "XRMotionVectors" } + + ColorMask RGBA + + Stencil + { + WriteMask 1 + Ref 1 + Comp Always + Pass Replace + } + + HLSLPROGRAM + + #pragma only_renderers d3d9 d3d11 vulkan glcore gles3 gles metal webgpu xboxone ps4 xboxseries playstation switch switch2 + #pragma target 3.5 + + #pragma vertex vert + #pragma fragment frag + + #pragma multi_compile _ LOD_FADE_CROSSFADE + #pragma shader_feature_local_vertex _ADD_PRECOMPUTED_VELOCITY + #define APPLICATION_SPACE_WARP_MOTION 1 + + #pragma shader_feature_local_fragment N_F_TRANS_ON + #pragma shader_feature_local_fragment N_F_CO_ON + #pragma shader_feature_local_fragment N_F_NFD_ON + #pragma shader_feature_local_fragment N_F_TP_ON + #pragma shader_feature_local_fragment N_F_SCO_ON + #pragma shader_feature_local_vertex N_F_DDMD_ON + #pragma shader_feature_local_vertex N_F_PA_ON + #pragma shader_feature_local_vertex N_F_SE_ON + #pragma shader_feature_local _UVSET_UV0 _UVSET_UV1 + + #include "Assets/RealToon/RealToon Shaders/RealToon Core/URP/RT_URP_Core.hlsl" + + #pragma multi_compile_instancing + #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl" + + #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/UnityInput.hlsl" + + #if defined(LOD_FADE_CROSSFADE) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/LODCrossFade.hlsl" + #endif + + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/MotionVectorsCommon.hlsl" + #include "Assets/RealToon/RealToon Shaders/RealToon Core/URP/Pass/RT_URP_MoVecPas.hlsl" + + ENDHLSL + } + + Pass { + +Name"Outline" +Tags{"LightMode"="SRPDefaultUnlit"} +//OL_NRE + +Cull [_DoubleSidedOutline]//OL_RCUL +Blend[_BleModSour][_BleModDest] +ZWrite [_OutZWrite] +ZTest [_OutZTest] + +AlphaToMask[_AlpToCov] + + Stencil { +/*//O_ST + Ref[_RefVal] + Comp [_Compa] + Pass [_Oper] + Fail [_Oper] +//O_ST_En*/ + +Pass [_OutStenPass]//O_PI + } + + HLSLPROGRAM + + #pragma only_renderers d3d9 d3d11 vulkan glcore gles3 gles metal webgpu xboxone ps4 xboxseries playstation switch switch2 +#pragma target 2.0 //targetol + + #pragma multi_compile _ _ADDITIONAL_LIGHTS + #pragma multi_compile _ _CLUSTER_LIGHT_LOOP + + #include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl" + #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/RenderingLayers.hlsl" + #pragma multi_compile_fragment _ _LIGHT_LAYERS + #pragma multi_compile_fog + + #pragma multi_compile_instancing + #pragma instancing_options renderinglayer + #include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl" //cc + + #pragma multi_compile_fragment _ LOD_FADE_CROSSFADE + +//#define N_F_TESS_ON//OT + + #pragma vertex LitPassVertex + #pragma fragment LitPassFragment + +/*//Tess_OP_1 + #pragma require tessellation + #pragma hull hull + #pragma domain domain +//TessTess_OP_1_End*/ + + #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl" + + #pragma shader_feature_local_fragment N_F_TRANS_ON + #pragma shader_feature_local_fragment N_F_SIMTRANS_ON + #pragma shader_feature_local_fragment N_F_CO_ON + #pragma shader_feature_local_fragment N_F_EAL_ON + #pragma shader_feature_local N_F_O_ON + #pragma shader_feature_local_vertex N_F_DNO_ON + #pragma shader_feature_local_vertex N_F_DDMD_ON + #pragma shader_feature_local_fragment N_F_NFD_ON + #pragma shader_feature_local_fragment N_F_TP_ON + #pragma shader_feature_local N_F_PA_ON + #pragma shader_feature_local N_F_SE_ON + #pragma shader_feature_local_fragment N_F_SCO_ON + #pragma shader_feature_local_fragment N_F_LLI_ON + #pragma shader_feature_local _UVSET_UV0 _UVSET_UV1 + + #include "Assets/RealToon/RealToon Shaders/RealToon Core/URP/RT_URP_Core.hlsl" + + #if defined(LOD_FADE_CROSSFADE) + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/LODCrossFade.hlsl" + #endif + + struct Attributes + { + + float4 positionOS : POSITION; + float3 normalOS : NORMAL; + float2 uv : TEXCOORD0; + float2 uv1 : TEXCOORD1; + float4 vertexColor : COLOR; + #if defined(UNITY_DOTS_INSTANCING_ENABLED) + + #ifndef N_F_DDMD_ON + float4 tangentOS : TANGENT; +float4 weights : BLENDWEIGHTS;//DOTS_LiBleSki_OL +uint4 indices : BLENDINDICES;//DOTS_LiBleSki_OL +//uint vertexID : SV_VertexID;//DOTS_CompDef_OL + #endif + + #endif + UNITY_VERTEX_INPUT_INSTANCE_ID + + }; + + struct Varyings + { + + float2 uv : TEXCOORD0; + float4 positionWSAndFogFactor : TEXCOORD2; + float4 projPos : TEXCOORD7; + float4 posWorld : TEXCOORD8; + float3 normalWS : TEXCOORD9; + float4 vertexColor : COLOR; + float4 positionCS : SV_POSITION; + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + + }; + + +Varyings LitPassVertex(Attributes input)//OP + { + + Varyings output = (Varyings)0; + + UNITY_SETUP_INSTANCE_ID (input); + UNITY_TRANSFER_INSTANCE_ID(input, output); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output); + + #if _UVSET_UV0 + output.uv = input.uv; + #elif _UVSET_UV1 + output.uv = input.uv1; + #endif + + output.vertexColor = input.vertexColor; + + #if defined(UNITY_DOTS_INSTANCING_ENABLED) + + #if !defined (N_F_TESS_ON) + + #if N_F_DDMD_ON + + float4 _LBS_CD_Position = input.positionOS; + float3 _LBS_CD_Normal = input.normalOS; + //float4 _LBS_CD_Tangent = input.tangentOS; //not currently needed + + #else + + float4 _LBS_CD_Position = 0; + float3 _LBS_CD_Normal = 0; + float4 _LBS_CD_Tangent = 0; + +DOTS_LiBleSki(input.indices, input.weights, input.positionOS.xyz, input.normalOS.xyz, input.tangentOS.xyz, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_LiBleSki_OL +//DOTS_CompDef(input.vertexID, (float3)_LBS_CD_Position, _LBS_CD_Normal, (float3)_LBS_CD_Tangent);//DOTS_CompDef_OL + + #endif + + #else + + float4 _LBS_CD_Position = input.positionOS; + float3 _LBS_CD_Normal = input.normalOS; + //float4 _LBS_CD_Tangent = input.tangentOS; //not currently needed + + #endif + + #else + + float4 _LBS_CD_Position = input.positionOS; + float3 _LBS_CD_Normal = input.normalOS; + //float4 _LBS_CD_Tangent = input.tangentOS; //not currently needed + + #endif + + VertexPositionInputs vertexInput = GetVertexPositionInputs(_LBS_CD_Position.xyz); + + output.normalWS = TransformObjectToWorldNormal(input.normalOS); + output.posWorld = float4(vertexInput.positionWS, 1.0); + + float4 objPos = mul ( GetObjectToWorldMatrix(), float4(0.0,0.0,0.0,1.0) ); + + + //RT_SE + #if N_F_SE_ON + input.positionOS = RT_SE(vertexInput.positionWS, input.positionOS); + _LBS_CD_Position = input.positionOS; + #endif + //== + + + half RTD_OB_VP_CAL = distance(objPos.rgb,_WorldSpaceCameraPos); + + //** + half RTD_OL_VCRAOW_OO; + if (!_VertexColorBlueAffectOutlineWitdh) + { + RTD_OL_VCRAOW_OO = _OutlineWidth; + } + else + { + RTD_OL_VCRAOW_OO = _OutlineWidth * (1.0 - output.vertexColor.b); + } + //** + + + //** + half RTD_OL_OLWABVD_OO; + if (!_OutlineWidthAffectedByViewDistance) + { + RTD_OL_OLWABVD_OO = RTD_OL_VCRAOW_OO; + } + else + { + RTD_OL_OLWABVD_OO = clamp(RTD_OL_VCRAOW_OO * RTD_OB_VP_CAL, RTD_OL_VCRAOW_OO, _FarDistanceMaxWidth); + } + //** + + + #if defined(SHADER_API_GLES) + half4 _OutlineWidthControl_var = tex2Dlod(_OutlineWidthControl, float4(TRANSFORM_TEX(output.uv, _OutlineWidthControl), 0.0, 0)); //replace soon + #else + half4 _OutlineWidthControl_var = SAMPLE_TEXTURE2D_LOD(_OutlineWidthControl, sampler_OutlineWidthControl, TRANSFORM_TEX(output.uv, _OutlineWidthControl), 0.0); + #endif + + #if N_F_DNO_ON + + float4 _3726 = _Time; + float _8530_ang = _3726.g; + float _8530_spd = 0.002; + float _8530_cos = cos(_8530_spd * _8530_ang); + float _8530_sin = sin(_8530_spd * _8530_ang); + float2 _8530_piv = float2(0.5, 0.5); + half2 _8530 = (mul(output.uv - _8530_piv, float2x2(_8530_cos, -_8530_sin, _8530_sin, _8530_cos)) + _8530_piv); + + half2 RTD_OL_DNOL_OO = _8530; + + #else + + half2 RTD_OL_DNOL_OO = output.uv; + + #endif + + + half2 _8743 = RTD_OL_DNOL_OO; + float2 _1283_skew = _8743 + 0.2127+_8743.x*0.3713*_8743.y; + float2 _1283_rnd = 4.789*sin(489.123*(_1283_skew)); + half _1283 = frac(_1283_rnd.x*_1283_rnd.y*(1+_1283_skew.x)); + + + //** + float3 _OEM = float3(0.0, 0.0, 0.0); + if (!_OutlineExtrudeMethod) + { + _OEM = _LBS_CD_Normal * _OutResi; + } + else + { + _OEM = normalize(_LBS_CD_Position.xyz) * _OutResi; + } + //** + + + half RTD_OL = ( RTD_OL_OLWABVD_OO*0.01 ) * _OutlineWidthControl_var.r * lerp(1.0,_1283,_NoisyOutlineIntensity); + + + //RT_PA + #if N_F_PA_ON + output.positionCS = mul(RT_PA(-vertexInput.positionVS.z), float4( (_LBS_CD_Position.xyz + _OutlineOffset.xyz * 0.01) + _OEM * RTD_OL, 1.0) ) + (float4(0,0,_ObjePosiZCS,0.0) * 0.0001); + #else + output.positionCS = mul(GetWorldToHClipMatrix(), mul(GetObjectToWorldMatrix(), float4( (_LBS_CD_Position.xyz + _OutlineOffset.xyz * 0.01) + _OEM * RTD_OL,1.0) ) ) + (float4(0,0,_ObjePosiZCS,0.0) * 0.0001); + #endif + //== + + + #if defined(SHADER_API_GLCORE) || defined(SHADER_API_GLES) || defined(SHADER_API_GLES3) + output.positionCS.z += _OutlineZPostionInCamera * 0.0005; + #else + output.positionCS.z -= _OutlineZPostionInCamera * 0.0005; + #endif + + float fogFactor = ComputeFogFactor(vertexInput.positionCS.z); + output.positionWSAndFogFactor = float4(vertexInput.positionWS, fogFactor); + output.projPos = ComputeScreenPos (output.positionCS); + + return output; + + } + +/*//Tess_OP_2 + struct TessVertex + { + + float4 positionOS : INTERNALTESSPOS; + float3 normalOS : NORMAL; + float4 tangentOS : TANGENT; + float2 uv : TEXCOORD0; + float4 vertexColor : COLOR; + UNITY_VERTEX_INPUT_INSTANCE_ID + UNITY_VERTEX_OUTPUT_STEREO + + }; + + struct OutputPatchConstant + { + + float edge[3] : SV_TessFactor; + float inside : SV_InsideTessFactor; + + }; + + TessVertex LitPassVertex(Attributes v) + { + TessVertex o = (TessVertex)0; + UNITY_SETUP_INSTANCE_ID(v); + UNITY_TRANSFER_INSTANCE_ID(v, o); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + o.positionOS = v.positionOS; + o.normalOS = v.normalOS; + o.uv = v.uv; + o.vertexColor = v.vertexColor; + return o; + } + + float Tessellation(TessVertex v) + { + + half RTD_TES_TRANS_Sli = (1.0 - _TessellationTransition); + half RTD_TES = lerp(_TessellationNear,_TessellationFar,saturate( ( distance(mul(GetObjectToWorldMatrix(), v.positionOS).xyz,_WorldSpaceCameraPos) * RTD_TES_TRANS_Sli ) ) ); + + return RTD_TES; + + } + + float4 Tessellation(TessVertex v, TessVertex v1, TessVertex v2) + { + + float tv = Tessellation(v); + float tv1 = Tessellation(v1); + float tv2 = Tessellation(v2); + return float4( tv1+tv2, tv2+tv, tv+tv1, tv+tv1+tv2 ) / float4(2,2,2,3); + + } + + OutputPatchConstant hullconst (InputPatch v) + { + + OutputPatchConstant o = (OutputPatchConstant)0; + UNITY_SETUP_INSTANCE_ID(v[0]); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); + + float4 ts = Tessellation( v[0], v[1], v[2] ); + o.edge[0] = ts.x; + o.edge[1] = ts.y; + o.edge[2] = ts.z; + o.inside = ts.w; + return o; + + } + + [domain("tri")] + [partitioning("fractional_odd")] + [outputtopology("triangle_cw")] + [patchconstantfunc("hullconst")] + [outputcontrolpoints(3)] + + TessVertex hull (InputPatch v, uint id : SV_OutputControlPointID) + { + return v[id]; + } + + [domain("tri")] + Varyings domain (OutputPatchConstant tessFactors, const OutputPatch vi, float3 bary : SV_DomainLocation) + { + + Attributes v = (Attributes)0; + UNITY_SETUP_INSTANCE_ID(vi[0]); + UNITY_TRANSFER_INSTANCE_ID(vi[0], v); + UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(v); + + v.positionOS = vi[0].positionOS*bary.x + vi[1].positionOS*bary.y + vi[2].positionOS*bary.z; + + float3 pp[3]; + for (int i = 0; i < 3; ++i) + { + pp[i] = v.positionOS.xyz - vi[i].normalOS * (dot(v.positionOS.xyz, vi[i].normalOS) - dot(vi[i].positionOS.xyz, vi[i].normalOS)); + } + + v.positionOS.xyz = _TessellationSmoothness * (pp[0] * bary.x + pp[1] * bary.y + pp[2] * bary.z) + (1.0f - _TessellationSmoothness) * v.positionOS.xyz; + v.normalOS = normalize( (vi[0]. normalOS * bary.x + vi[1].normalOS * bary.y + vi[2].normalOS * bary.z) ); + v.uv = vi[0].uv*bary.x + vi[1].uv*bary.y + vi[2].uv*bary.z; + v.vertexColor = vi[0].vertexColor*bary.x + vi[1].vertexColor*bary.y + vi[2].vertexColor*bary.z; + + if (_NorMapAsDis == 1) + { + float2 uv = TRANSFORM_TEX(v.uv, _NormalMap); + float norma_disp = dot(float3(0.299, 0.587, 0), normalize(UnpackNormal(SAMPLE_TEXTURE2D_LOD(_NormalMap, sampler_NormalMap, uv, 0))) ) ; + v.positionOS.xyz += v.normalOS * (norma_disp * (_NormalMapIntensity * 0.01) ); + } + + Varyings o = PostProcessVertex(v); + return o; + + } +//Tess_OP_2_End*/ + + void LitPassFragment( + Varyings input + , out half4 outColor : SV_Target0 + #ifdef _WRITE_RENDERING_LAYERS + , out uint outRenderingLayers : SV_Target1 + #endif + ) + { + + UNITY_SETUP_INSTANCE_ID (input); + UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input); + + float3 positionWS = input.positionWSAndFogFactor.xyz; + float4 objPos = mul ( GetObjectToWorldMatrix(), float4(0.0,0.0,0.0,1.0) ); + float2 sceneUVs = (input.projPos.xy / input.projPos.w); + half RTD_OB_VP_CAL = distance(objPos.rgb,_WorldSpaceCameraPos); + half2 RTD_VD_Cal = (float2((sceneUVs.x * 2.0 - 1.0)*(_ScreenParams.r/_ScreenParams.g), sceneUVs.y * 2.0 - 1.0).rg*RTD_OB_VP_CAL); + + #ifdef LOD_FADE_CROSSFADE + LODFadeCrossFade(input.positionCS); + #endif + + half3 color = (half3)1.0; + + //** + half2 RTD_TC_TP_OO; + if (!_TexturePatternStyle) + { + RTD_TC_TP_OO = input.uv; + } + else + { + RTD_TC_TP_OO = RTD_VD_Cal; + } + //** + + + #if N_F_TP_ON + half4 _MainTex_var = RT_Tripl_Default(_MainTex, sampler_MainTex, positionWS, input.normalWS); + #else + half4 _MainTex_var = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, TRANSFORM_TEX(RTD_TC_TP_OO, _MainTex)); + #endif + + + //RT_TRANS_CO + half RTD_TRAN_OPA_Sli; + half RTD_CO; + half3 GLO_OUT; + RT_TRANS_CO(input.uv, _MainTex_var, _MainTex_var.a, RTD_TRAN_OPA_Sli, RTD_CO, positionWS, input.normalWS, input.positionCS.xy, GLO_OUT); + + #if N_F_TRANS_ON + #ifndef N_F_CO_ON + clip(RTD_TRAN_OPA_Sli - 0.5); + #endif + #endif + // + + + //========/ + //========/ + Light mainLight = GetMainLight(); + + #if N_F_LLI_ON + half3 mainliCol = clamp(mainLight.color.rgb,_LLI_Min,_LLI_Max); + #else + half3 mainliCol = mainLight.color.rgb; + #endif + + #ifndef N_F_OFLMB_ON + half3 lightColor = mainliCol; + #else + half3 lightColor = (half3)1.0; + #endif + //========/ + //========/ + + + uint meshRenderingLayers = GetMeshRenderingLayer(); + + + //========/ + //========/ + #ifndef N_F_OFLMB_ON + #if defined(_ADDITIONAL_LIGHTS) + #if N_F_EAL_ON + + uint pixelLightCount = GetAdditionalLightsCount(); + + #if USE_CLUSTER_LIGHT_LOOP + + InputData inputData = (InputData)0; + inputData.positionWS = positionWS; + inputData.normalizedScreenSpaceUV = GetNormalizedScreenSpaceUV(input.positionCS); + + [loop] for (uint lightIndex = 0; lightIndex < min(URP_FP_DIRECTIONAL_LIGHTS_COUNT, MAX_VISIBLE_LIGHTS); lightIndex++) + { + CLUSTER_LIGHT_LOOP_SUBTRACTIVE_LIGHT_CHECK + + Light light = GetAdditionalLight(lightIndex, input.posWorld.xyz, (float4)1.0); + + #ifdef _LIGHT_LAYERS + if (IsMatchingLightLayer(light.layerMask, meshRenderingLayers)) + #endif + { + #if N_F_LLI_ON + lightColor += clamp(light.color,_LLI_Min,_LLI_Max) * light.distanceAttenuation; + #else + lightColor += light.color * light.distanceAttenuation; + #endif + + } + } + #endif + + LIGHT_LOOP_BEGIN(pixelLightCount) + Light light = GetAdditionalLight(lightIndex, positionWS); + + #ifdef _LIGHT_LAYERS + if (IsMatchingLightLayer(light.layerMask, meshRenderingLayers)) + #endif + { + #if N_F_LLI_ON + lightColor += clamp(light.color,_LLI_Min,_LLI_Max) * light.distanceAttenuation; + #else + lightColor += light.color * light.distanceAttenuation; + #endif + + } + LIGHT_LOOP_END + + #endif + #endif + #endif + //========/ + //========/ + + + float fogFactor = input.positionWSAndFogFactor.w; + + + // + #ifdef UNITY_COLORSPACE_GAMMA + _OutlineColor = float4(LinearToGamma22(_OutlineColor.rgb), _OutlineColor.a); + #endif + // + + + //** + half3 RTD_MMTTO_OO; + if (!_MixMainTexToOutline) + { + RTD_MMTTO_OO = _OutlineColor.rgb; + } + else + { + + RTD_MMTTO_OO = _OutlineColor.rgb * _MainTex_var.rgb; + } + //** + + + //** + half3 RTD_OL_LAOC_OO; + if (!_LightAffectOutlineColor) + { + RTD_OL_LAOC_OO = RTD_MMTTO_OO; + } + else + { + + RTD_OL_LAOC_OO = lerp(half3(0.0, 0.0, 0.0), RTD_MMTTO_OO, lightColor.rgb); + } + //** + + + half3 finalRGBA = RTD_OL_LAOC_OO; + + + //RT_NFD + #if N_F_NFD_ON + RT_NFD(input.positionCS.xy); + #endif + //== + + + color = MixFog(finalRGBA, fogFactor); + + #if defined(N_F_TRANS_ON) & !defined(N_F_CO_ON) + outColor = half4(color, RTD_TRAN_OPA_Sli); + #else + #if N_F_ATC_ON + outColor = half4(color, _MainTex_var.a); + #else + outColor = half4(color, 1.0); + #endif + #endif + + #ifdef _WRITE_RENDERING_LAYERS + outRenderingLayers = EncodeMeshRenderingLayer(); + #endif + + } + + ENDHLSL + } + +} + +FallBack "Hidden/InternalErrorShader" +CustomEditor "RealToon.GUIInspector.RealToonShaderGUI_URP_SRP" + +} \ No newline at end of file diff --git a/Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader.meta b/Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader.meta new file mode 100644 index 00000000..65704445 --- /dev/null +++ b/Assets/RealToon/RealToon Shaders/Version 5/URP/Default/D_Default_URP.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 6459b2db96a08ca41b0f9b39dc7ad59e +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/RealToon/RealToon Tools.meta b/Assets/RealToon/RealToon Tools.meta new file mode 100644 index 00000000..aa6eaa3d --- /dev/null +++ b/Assets/RealToon/RealToon Tools.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e27fde06ce4a9204fbeab41327196928 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/RealToon/RealToon Tools/CustomShadowResolution.cs b/Assets/RealToon/RealToon Tools/CustomShadowResolution.cs new file mode 100644 index 00000000..5a36c1f5 --- /dev/null +++ b/Assets/RealToon/RealToon Tools/CustomShadowResolution.cs @@ -0,0 +1,57 @@ +ïğż//RealToon - Custom Shadow Resolution +//ÂİMJQStudioWorks + +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace RealToon.Script +{ + [ExecuteInEditMode] + [RequireComponent(typeof(Light))] + [AddComponentMenu("RealToon/Tools/Custom Shadow Resolution")] + public class CustomShadowResolution : MonoBehaviour + { + [Header("Custom Shadow Resolution V1.0.0")] + [Header("Note: Higher Shadow Resolution = More GPU RAM Usage.")] + [Header("For RealToon Built-In RP Only")] + + [Space(10)] + + [SerializeField] + [Tooltip("Input value")] + public int Value = 2048; + + [SerializeField] + [Tooltip("Final Resolution (Value * 2)")] + public int FinalResolution = 4096; + + [Space(10)] + + [SerializeField] + [Tooltip("Reset to default value")] + public bool Reset = false; + + void Update() + { + this.GetComponent().shadowCustomResolution = FinalResolution; + FinalResolution = Value * 2; + + if (Reset == true) + { + Value = 2048; + FinalResolution = 4096; + Reset = false; + } + + if (Value < 0) + { + + Value = 0; + FinalResolution = 0; + + } + } + + } +} diff --git a/Assets/RealToon/RealToon Tools/CustomShadowResolution.cs.meta b/Assets/RealToon/RealToon Tools/CustomShadowResolution.cs.meta new file mode 100644 index 00000000..61c5a068 --- /dev/null +++ b/Assets/RealToon/RealToon Tools/CustomShadowResolution.cs.meta @@ -0,0 +1,19 @@ +fileFormatVersion: 2 +guid: ef184494de3501f4ca1c8d8839a36f11 +timeCreated: 1534021412 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 65518 + packageName: RealToon (Pro Anime/Toon Shader) + packageVersion: 5.0.15 + assetPath: Assets/RealToon/RealToon Tools/CustomShadowResolution.cs + uploadId: 889742 diff --git a/Assets/RealToon/RealToon Tools/FrameByFrameRendering.meta b/Assets/RealToon/RealToon Tools/FrameByFrameRendering.meta new file mode 100644 index 00000000..879161da --- /dev/null +++ b/Assets/RealToon/RealToon Tools/FrameByFrameRendering.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: e796d49144713a84a9cee11d56b65120 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/RealToon/RealToon Tools/FrameByFrameRendering/FrameByFrameRendering_Default.cs b/Assets/RealToon/RealToon Tools/FrameByFrameRendering/FrameByFrameRendering_Default.cs new file mode 100644 index 00000000..5de6c4a2 --- /dev/null +++ b/Assets/RealToon/RealToon Tools/FrameByFrameRendering/FrameByFrameRendering_Default.cs @@ -0,0 +1,236 @@ +ïğż//RealToon - Frame By Frame Rendering V1.0.0 +//ÂİMJQStudioWorks + +using UnityEngine; +using System.Collections; + +namespace RealToon.Tools.FrameByFrameRendering +{ + [AddComponentMenu("RealToon/Tools/Frame By Frame Rendering/Frame By Frame Rendering (Default)")] + public class FrameByFrameRendering_Default : MonoBehaviour + { + [Header("(Frame By Frame Rendering V1.0.0)")] + [Header("Click 'Play' button to start render.")] + + [Space(20)] + + [Header("==============================")] + [Header("(Settings)")] + + [Space(5)] + + [SerializeField] + [Tooltip("Example Path: C:/TheNameOfTheFolder (Default folder name is Rendered Files and it will be created to your unity root project folder if this set to empty.")] + public string PathFolder = "Rendered Files"; + + [SerializeField] + [Tooltip("PNG File Name")] + public string PNGFileName = "Frame"; + + [Space(15)] + + [SerializeField] + [Tooltip("Frame Rate (Set this to 24 if you want Film Style framerate.")] + public int FrameRate = 24; + + [SerializeField] + [Tooltip("Start frame to start rendering.")] + public int StartFrame = 0; + + [SerializeField] + [Tooltip("End frame to end rendering.")] + public int EndFrame = 100; + + [Space(15)] + + [SerializeField] + [Tooltip("Render single frame or single image only, For Illustration or Art use.")] + public bool SingleFrameRenderingMode = false; + + [Header("==============================")] + + [Header("(Information [Display Only] )")] + + [Space(5)] + [Tooltip("Display the current frame of your scene/play. (Display Only)")] + public int CurrentFrame = 0; + + [Tooltip("Display the information of the operation or rendering. (Display Only)")] + public string info = string.Empty; + + private bool StartRendering = false; + private bool StartFrameCheck = false; + private string CurrentRenderedFile = string.Empty; + private int StartFrameCont = 0; + private int EndFrameCont = 100; + private int FrameRateCont = 24; + private string PathFolderCont = "Rendered Files"; + private string PNGFileNameCont = "Frame"; + private bool SingleFrameRenderingCont = false; + + private System.IO.DirectoryInfo DirInfo; + + + void Start() + { + + if (StartFrameCont <= -1) + { + StartFrameCheck = false; + StartRendering = false; + info = "Rendering has not started because 'Start Frame' value is less than 0."; + Debug.LogError(info); + } + + if (EndFrameCont <= 0) + { + StartFrameCheck = false; + StartRendering = false; + info = "Rendering has not started because 'End Frame' value is 0 or less than 0."; + Debug.LogError(info); + } + + if (FrameRateCont <= 0) + { + StartFrameCheck = false; + StartRendering = false; + info = "Rendering has not started because 'Frame Rate' value is 0 or less than 0."; + Debug.LogError(info); + } + + if (PNGFileName == string.Empty) + { + PNGFileName = "Frame"; + info = "File Name set to 'Frame' because the field is not set or empty."; + Debug.LogError(info); + } + + if (PathFolder == string.Empty) + { + PathFolder = "Rendered Files"; + info = "Folder Path set to 'Rendered Files' and will be created to your UNITY ROOT PROJECT FOLDER because the field is not set or empty."; + Debug.LogError(info); + } + + Time.captureFramerate = FrameRate; + StartFrameCont = StartFrame; + EndFrameCont = EndFrame; + FrameRateCont = FrameRate; + SingleFrameRenderingCont = SingleFrameRenderingMode; + PathFolderCont = PathFolder; + PNGFileNameCont = PNGFileName; + + DirInfo = new System.IO.DirectoryInfo(PathFolder); + + if (!System.IO.Directory.Exists(PathFolder)) + { + System.IO.Directory.CreateDirectory(PathFolder); + info = "Folder '" + PathFolder + "' Has Been Created To Your Root Project Folder."; + Debug.LogWarning(info); + } + + + if (SingleFrameRenderingMode == false) + { + info = "Video/Animation Mode"; + Debug.LogWarning(info); + + if (DirInfo.GetFiles().Length != 0) + { + StartFrameCheck = false; + StartRendering = false; + info = "(Video/Animation Mode) Rendering not started because there are already rendered frames or files in this folder ('" + PathFolder + "'), Please empty this folder or make another folder by changing the Path Folder."; + Debug.LogError(info); + } + else + { + StartFrameCheck = true; + StartRendering = true; + } + } + else + { + StartFrameCheck = true; + StartRendering = true; + info = "Picture or Single Frame Rendering Mode"; + Debug.LogWarning(info); + EndFrameCont = 1; + } + + } + + void Update() + { + CurrentFrame = Time.frameCount - 1; + StartFrame = StartFrameCont; + EndFrame = EndFrameCont; + SingleFrameRenderingMode = SingleFrameRenderingCont; + PathFolder = PathFolderCont; + PNGFileName = PNGFileNameCont; + + if (PathFolder == string.Empty) + { + PathFolder = "Rendered Files"; + } + + else + { + + if (StartFrameCheck == true) + { + + if (CurrentFrame == StartFrameCont) + { + info = "Rendering Has Started."; + Debug.LogWarning(info); + StartRendering = true; + } + + if (StartRendering == true) + { + if (SingleFrameRenderingMode == false) + { + string fname = string.Format("{0}/" + PNGFileNameCont + " {1:D04}.png", PathFolderCont, CurrentFrame); + CurrentRenderedFile = fname; + info = fname; + +#if UNITY_2017_1_OR_NEWER + ScreenCapture.CaptureScreenshot(fname); +#endif + +#if UNITY_5_6 + Application.CaptureScreenshot(fname); +#endif + + } + else + { + string fname = string.Format("{0}/" + PNGFileNameCont + " " + System.DateTime.Now.ToString("hh_mm_ss") + ".png", PathFolderCont, CurrentFrame); + CurrentRenderedFile = fname; + info = fname; + +#if UNITY_2017_1_OR_NEWER + ScreenCapture.CaptureScreenshot(fname); +#endif + +#if UNITY_5_6 + Application.CaptureScreenshot(fname); +#endif + + } + + + if (CurrentFrame == EndFrame) + { + info = "Rendering Has Ended." + " [Last Rendered File: " + CurrentRenderedFile + "]"; + Debug.LogWarning(info); + StartRendering = false; + StartFrameCheck = false; + } + } + } + } + } + } + +} \ No newline at end of file diff --git a/Assets/RealToon/RealToon Tools/FrameByFrameRendering/FrameByFrameRendering_Default.cs.meta b/Assets/RealToon/RealToon Tools/FrameByFrameRendering/FrameByFrameRendering_Default.cs.meta new file mode 100644 index 00000000..3b5ab879 --- /dev/null +++ b/Assets/RealToon/RealToon Tools/FrameByFrameRendering/FrameByFrameRendering_Default.cs.meta @@ -0,0 +1,20 @@ +fileFormatVersion: 2 +guid: 38f2863825408a940b834eb29e4811b4 +timeCreated: 1527622178 +licenseType: Store +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 65518 + packageName: RealToon (Pro Anime/Toon Shader) + packageVersion: 5.0.15 + assetPath: Assets/RealToon/RealToon Tools/FrameByFrameRendering/FrameByFrameRendering_Default.cs + uploadId: 889742 diff --git a/Assets/RealToon/RealToon Tools/FrameByFrameRendering/FrameByFrameRendering_Manual.cs b/Assets/RealToon/RealToon Tools/FrameByFrameRendering/FrameByFrameRendering_Manual.cs new file mode 100644 index 00000000..97d890b2 --- /dev/null +++ b/Assets/RealToon/RealToon Tools/FrameByFrameRendering/FrameByFrameRendering_Manual.cs @@ -0,0 +1,177 @@ +ïğż//RealToon - Frame By Frame Rendering V1.0.0 +//ÂİMJQStudioWorks + +using UnityEngine; +using System.Collections; + +namespace RealToon.Tools.FrameByFrameRendering +{ + [AddComponentMenu("RealToon/Tools/Frame By Frame Rendering/Frame By Frame Rendering (Manual)")] + public class FrameByFrameRendering_Manual : MonoBehaviour + { + [Header("(Frame By Frame Rendering V1.0.0)")] + [Header("Click 'Play' & 'Render' button to start render one by one.")] + + [Space(20)] + + [SerializeField] + [Tooltip("Current Frame Number")] + public int FrameNumber = 0; + + [Space(5)] + + [SerializeField] + [Tooltip("Start Render")] + public bool Render = false; + + [Header("==============================")] + [Header("(Settings)")] + + [Space(5)] + + [SerializeField] + [Tooltip("Example Path: C:/TheNameOfTheFolder (Default folder name is Rendered Files and it will be created to your unity root project folder if this set to empty.")] + public string PathFolder = "Rendered Files"; + + [SerializeField] + [Tooltip("PNG File Name")] + public string PNGFileName = "Frame"; + + [Space(15)] + + [SerializeField] + [Tooltip("Render single frame or single image only, For Illustration or Art use.")] + public bool PictureMode = false; + + [Header("==============================")] + + [Header("(Information [Display Only] )")] + + [Space(5)] + + [Tooltip("Display the information of the operation or rendering. (Display Only)")] + public int LastRenderedFrame = 0; + public string info = string.Empty; + + private string CurrentRenderedFile = string.Empty; + private string PathFolderCont = "Rendered Files"; + private string PNGFileNameCont = "Frame"; + private int FrameNumberCont = 0; + private bool PictureModeCont = false; + private bool PreventRender = false; + + private System.IO.DirectoryInfo DirInfo; + + + void Start() + { + + if (PNGFileName == string.Empty) + { + PNGFileName = "Frame"; + info = "File Name set to 'Frame' because the field is not set or empty."; + Debug.LogError(info); + } + + if (PathFolder == string.Empty) + { + PathFolder = "Rendered Files"; + info = "Folder Path set to 'Rendered Files' and will be created to your UNITY ROOT PROJECT FOLDER because the field is not set or empty."; + Debug.LogError(info); + } + + PictureModeCont = PictureMode; + PathFolderCont = PathFolder; + PNGFileNameCont = PNGFileName; + FrameNumberCont = FrameNumber; + + DirInfo = new System.IO.DirectoryInfo(PathFolder); + + if (!System.IO.Directory.Exists(PathFolder)) + { + System.IO.Directory.CreateDirectory(PathFolder); + info = "Folder '" + PathFolder + "' Has Been Created To Your Root Project Folder."; + Debug.LogWarning(info); + } + + + if (PictureMode == false) + { + info = "Frame by Frame Rendering Mode"; + Debug.LogWarning(info); + + if (DirInfo.GetFiles().Length != 0) + { + PreventRender = true; + Render = false; + info = "(Frame by Frame Mode) Rendering not started because there are already rendered frames or files in this folder ('" + PathFolder + "'), Please empty this folder or make another folder by changing the Path Folder."; + Debug.LogError(info); + } + } + else + { + info = "Picture or Single Frame Rendering Mode"; + Debug.LogWarning(info); + } + + } + + void Update() + { + PictureMode = PictureModeCont; + PathFolder = PathFolderCont; + PNGFileName = PNGFileNameCont; + LastRenderedFrame = FrameNumberCont; + + if (FrameNumber <= 0) + { + FrameNumber = FrameNumberCont; + } + + if (PreventRender == false) + { + if (Render == true) + { + if (PictureMode == false) + { + string fname = string.Format("{0}/" + PNGFileNameCont + " {1:D04}.png", PathFolderCont, FrameNumber); + CurrentRenderedFile = fname; + +#if UNITY_2017_1_OR_NEWER + ScreenCapture.CaptureScreenshot(fname); +#endif + +#if UNITY_5_6 + Application.CaptureScreenshot(fname); +#endif + + + FrameNumber += 1; + FrameNumberCont = FrameNumber; + + info = CurrentRenderedFile; + Debug.LogWarning(info); + Render = false; + } + else + { + string fname = string.Format("{0}/" + PNGFileNameCont + " " + System.DateTime.Now.ToString("hh_mm_ss") + ".png", PathFolderCont, FrameNumber); + CurrentRenderedFile = fname; + +#if UNITY_2017_1_OR_NEWER + ScreenCapture.CaptureScreenshot(fname); +#endif + +#if UNITY_5_6 + Application.CaptureScreenshot(fname); +#endif + info = CurrentRenderedFile; + Debug.LogWarning(info); + Render = false; + } + } + } + } + } + +} \ No newline at end of file diff --git a/Assets/RealToon/RealToon Tools/FrameByFrameRendering/FrameByFrameRendering_Manual.cs.meta b/Assets/RealToon/RealToon Tools/FrameByFrameRendering/FrameByFrameRendering_Manual.cs.meta new file mode 100644 index 00000000..22272f6e --- /dev/null +++ b/Assets/RealToon/RealToon Tools/FrameByFrameRendering/FrameByFrameRendering_Manual.cs.meta @@ -0,0 +1,19 @@ +fileFormatVersion: 2 +guid: 9f51a2cb54804064b8fc03edfef062fb +timeCreated: 1527764313 +licenseType: Store +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 65518 + packageName: RealToon (Pro Anime/Toon Shader) + packageVersion: 5.0.15 + assetPath: Assets/RealToon/RealToon Tools/FrameByFrameRendering/FrameByFrameRendering_Manual.cs + uploadId: 889742 diff --git a/Assets/RealToon/RealToon Tools/PerspectiveAdjustmentController.cs b/Assets/RealToon/RealToon Tools/PerspectiveAdjustmentController.cs new file mode 100644 index 00000000..c83f037f --- /dev/null +++ b/Assets/RealToon/RealToon Tools/PerspectiveAdjustmentController.cs @@ -0,0 +1,407 @@ +//RealToon - Perspective Adjustment [Helper] +//İMJQStudioWorks + +using UnityEngine; + +namespace RealToon.Script +{ + + [ExecuteAlways] + [AddComponentMenu("RealToon/Tools/Perspective Adjustment - Controller")] + public class PerspectiveAdjustmentController : MonoBehaviour + { + [HideInInspector] + [SerializeField] + Transform[] SubTran; + + [HideInInspector] + [SerializeField] + Material[] Mat; + + [HideInInspector] + [SerializeField] + Transform[] attac; + + [Header("Note: Perspective Adjustment feature will be automatically enable\nOn the materials of the object/model that uses RealToon Shader.")] + [Header("It is recommend to set the Clipping Planes - Near of the camera\nto 0.01 to prevent slicing when near.")] + + [Space(25)] + + [SerializeField] + [Tooltip("This will change the perspective of an object to 2D or 3D or FOV stretch look.\nFor 2d toon/anime look, set it to 0.5 or 0.")] + public float Perspective = 1; + + [SerializeField] + [Tooltip("This will change the clipping on the object.\nChange this if the object is overlapping front or back.")] + public float Clip = 0; + + [Space(15)] + + [SerializeField] + [Tooltip("This will adjust the size of the object when the camera is closer.")] + public float CloseUpSize = 0; + + [SerializeField] + [Tooltip("How smooth the transition of the sizing.")] + public float CloseUpSizeSmoothTransition = 1; + + [SerializeField] + [Tooltip("Distance transition from the camera to the object.")] + public float CloseUpSizeDistance = 0; + + [Space(15)] + + [SerializeField] + [Tooltip("Z position of the object in Clip Space.")] + public float ObjectPositionZ = 0; + + [Space(15)] + + [SerializeField] + [Tooltip("Can animate the values/properties or create keyframe.")] + public bool CanAnimateIt = true; + + int coun_obj_wi_ralsha = 0; + int coun_obj_mat = 0; + int coun_obj_mat_arr = 0; + + string RT_Sha_Nam_URP = "Universal Render Pipeline/RealToon/Version 5/Default/Default"; + string RT_Sha_Nam_HDRP = "HDRP/RealToon/Version 5/Default"; + + string RT_Sha_Nam_BiRP_DD = "RealToon/Version 5/Default/Default"; + string RT_Sha_Nam_BiRP_DFT = "RealToon/Version 5/Default/Fade Transparency"; + string RT_Sha_Nam_BiRP_DR = "RealToon/Version 5/Default/Refraction"; + string RT_Sha_Nam_BiRP_TDD = "RealToon/Version 5/Tessellation/Default"; + string RT_Sha_Nam_BiRP_TDFT = "RealToon/Version 5/Tessellation/Fade Transparency"; + string RT_Sha_Nam_BiRP_TDR = "RealToon/Version 5/Tessellation/Refraction"; + string RT_Sha_Nam_BiRP_DDL = "RealToon/Version 5/Lite/Default"; + string RT_Sha_Nam_BiRP_DFTL = "RealToon/Version 5/Lite/Fade Transparency"; + + [HideInInspector] + [SerializeField] + bool checkstart = true; + + void Start() + { + if (checkstart == true) + { + InitStart(); + checkstart = false; + } + } + + void LateUpdate() + { + if (Mat != null) + { + if (CanAnimateIt == true) + { + foreach (Material Mate in Mat) + { + if (Mate != null) + { + if (Mate.shader.name == RT_Sha_Nam_URP || + Mate.shader.name == RT_Sha_Nam_HDRP || + Mate.shader.name == RT_Sha_Nam_BiRP_DD || + Mate.shader.name == RT_Sha_Nam_BiRP_DFT || + Mate.shader.name == RT_Sha_Nam_BiRP_DR || + Mate.shader.name == RT_Sha_Nam_BiRP_TDD || + Mate.shader.name == RT_Sha_Nam_BiRP_TDFT || + Mate.shader.name == RT_Sha_Nam_BiRP_TDR || + Mate.shader.name == RT_Sha_Nam_BiRP_DDL || + Mate.shader.name == RT_Sha_Nam_BiRP_DFTL) + { + Set_Shad_Prop(Mate); + } + } + } + } + } + } + + void OnValidate() + { + if (Mat != null) + { + foreach (Material Mate in Mat) + { + if (Mate != null) + { + if (Mate.shader.name == RT_Sha_Nam_URP || + Mate.shader.name == RT_Sha_Nam_HDRP || + Mate.shader.name == RT_Sha_Nam_BiRP_DD || + Mate.shader.name == RT_Sha_Nam_BiRP_DFT || + Mate.shader.name == RT_Sha_Nam_BiRP_DR || + Mate.shader.name == RT_Sha_Nam_BiRP_TDD || + Mate.shader.name == RT_Sha_Nam_BiRP_TDFT || + Mate.shader.name == RT_Sha_Nam_BiRP_TDR || + Mate.shader.name == RT_Sha_Nam_BiRP_DDL || + Mate.shader.name == RT_Sha_Nam_BiRP_DFTL) + { + Set_Shad_Prop(Mate); + } + } + } + } + } + + /* Remove Later + void OnDestroy() + { + Res_Shad_Prop(); + foreach (Material Mate in Mat) + { + if (Mate != null) + { + if (Mate.shader.name == RT_Sha_Nam_URP || Mate.shader.name == RT_Sha_Nam_HDRP) + { + Mate.SetFloat("_N_F_PA", 0.0f); + Mate.DisableKeyword("N_F_PA_ON"); + } + } + } + } + */ + + void Reset() + { + if (Mat != null) + { + checkstart = true; + Res_Shad_Prop(); + + foreach (Material Mate in Mat) + { + if (Mate != null) + { + if (Mate.shader.name == RT_Sha_Nam_URP || + Mate.shader.name == RT_Sha_Nam_HDRP || + Mate.shader.name == RT_Sha_Nam_BiRP_DD || + Mate.shader.name == RT_Sha_Nam_BiRP_DFT || + Mate.shader.name == RT_Sha_Nam_BiRP_DR || + Mate.shader.name == RT_Sha_Nam_BiRP_TDD || + Mate.shader.name == RT_Sha_Nam_BiRP_TDFT || + Mate.shader.name == RT_Sha_Nam_BiRP_TDR || + Mate.shader.name == RT_Sha_Nam_BiRP_DDL || + Mate.shader.name == RT_Sha_Nam_BiRP_DFTL) + { + Set_Shad_Prop(Mate); + } + } + } + + coun_obj_wi_ralsha = 0; + coun_obj_mat = 0; + coun_obj_mat_arr = 0; + InitStart(); + + } + } + + #region Init + + void InitStart() + { + if (attac == null || attac.Length == 0) + { + attac = this.gameObject.GetComponentsInChildren(); + } + + int x = 0; + foreach (Transform Trans in attac) + { + if (Trans.GetComponent() == true) + { + if (Trans.GetComponent().sharedMaterial != null) + { + if (Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_URP || + Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_HDRP || + Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_BiRP_DD || + Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_BiRP_DFT || + Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_BiRP_DR || + Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_BiRP_TDD || + Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_BiRP_TDFT || + Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_BiRP_TDR || + Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_BiRP_DDL || + Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_BiRP_DFTL) + { + coun_obj_wi_ralsha++; + coun_obj_mat += Trans.GetComponent().sharedMaterials.Length; + } + } + + } + + if (Trans.GetComponent() == true) + { + if (Trans.GetComponent().sharedMaterial != null) + { + if (Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_URP || + Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_HDRP || + Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_BiRP_DD || + Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_BiRP_DFT || + Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_BiRP_DR || + Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_BiRP_TDD || + Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_BiRP_TDFT || + Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_BiRP_TDR || + Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_BiRP_DDL || + Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_BiRP_DFTL) + { + coun_obj_wi_ralsha++; + coun_obj_mat += Trans.GetComponent().sharedMaterials.Length; + } + + } + } + + } + + SubTran = new Transform[coun_obj_wi_ralsha]; + + foreach (Transform Trans in attac) + { + if (Trans.GetComponent() == true) + { + if (Trans.GetComponent().sharedMaterial != null) + { + if (Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_URP || + Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_HDRP || + Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_BiRP_DD || + Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_BiRP_DFT || + Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_BiRP_DR || + Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_BiRP_TDD || + Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_BiRP_TDFT || + Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_BiRP_TDR || + Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_BiRP_DDL || + Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_BiRP_DFTL) + { + SubTran[x] = Trans; + x++; + } + + } + + } + + if (Trans.GetComponent() == true) + { + if (Trans.GetComponent().sharedMaterial != null) + { + if (Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_URP || + Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_HDRP || + Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_BiRP_DD || + Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_BiRP_DFT || + Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_BiRP_DR || + Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_BiRP_TDD || + Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_BiRP_TDFT || + Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_BiRP_TDR || + Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_BiRP_DDL || + Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_BiRP_DFTL) + { + SubTran[x] = Trans; + x++; + } + } + } + } + + + Mat = new Material[coun_obj_mat]; + + + foreach (Transform Trans in SubTran) + { + if (Trans.GetComponent() == true) + { + if (Trans.GetComponent().sharedMaterial != null) + { + if (Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_URP || + Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_HDRP || + Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_BiRP_DD || + Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_BiRP_DFT || + Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_BiRP_DR || + Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_BiRP_TDD || + Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_BiRP_TDFT || + Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_BiRP_TDR || + Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_BiRP_DDL || + Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_BiRP_DFTL) + { + for (int i = 0; i < Trans.GetComponent().sharedMaterials.Length; i++) + { + Mat[coun_obj_mat_arr] = Trans.GetComponent().sharedMaterials[i]; + coun_obj_mat_arr++; + } + } + + } + + } + + if (Trans.GetComponent() == true) + { + if (Trans.GetComponent().sharedMaterial != null) + { + if (Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_URP || + Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_HDRP || + Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_BiRP_DD || + Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_BiRP_DFT || + Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_BiRP_DR || + Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_BiRP_TDD || + Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_BiRP_TDFT || + Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_BiRP_TDR || + Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_BiRP_DDL || + Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_BiRP_DFTL) + { + + for (int i = 0; i < Trans.GetComponent().sharedMaterials.Length; i++) + { + Mat[coun_obj_mat_arr] = Trans.GetComponent().sharedMaterials[i]; + coun_obj_mat_arr++; + } + } + } + } + + } + + foreach (Material Mat in Mat) + { + if (Mat != null) + { + Set_Shad_Prop(Mat); + } + } + } + + #endregion + + void Set_Shad_Prop(Material Mat) + { + if (Mat.IsKeywordEnabled("N_F_PA_ON") == true) + { + Mat.SetFloat("_PresAdju", Perspective); + Mat.SetFloat("_ClipAdju", Clip); + Mat.SetFloat("_PASize", CloseUpSize); + Mat.SetFloat("_PASmooTrans", CloseUpSizeSmoothTransition); + Mat.SetFloat("_PADist", CloseUpSizeDistance); + Mat.SetFloat("_ObjePosiZCS", ObjectPositionZ); + } + else if (Mat.IsKeywordEnabled("N_F_PA_ON") != true) + { + Mat.EnableKeyword("N_F_PA_ON"); + Mat.SetInt("_N_F_PA", 1); + } + } + + void Res_Shad_Prop() + { + Perspective = 1.0f; + Clip = 0.0f; + CloseUpSize = 0.0f; + CloseUpSizeSmoothTransition = 1.0f; + CloseUpSizeDistance = 0.0f; + } + + } + +} \ No newline at end of file diff --git a/Assets/RealToon/RealToon Tools/PerspectiveAdjustmentController.cs.meta b/Assets/RealToon/RealToon Tools/PerspectiveAdjustmentController.cs.meta new file mode 100644 index 00000000..836bf8a8 --- /dev/null +++ b/Assets/RealToon/RealToon Tools/PerspectiveAdjustmentController.cs.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 257798aae5c4052419047b7e5983c391 +AssetOrigin: + serializedVersion: 1 + productId: 65518 + packageName: RealToon (Pro Anime/Toon Shader) + packageVersion: 5.0.15 + assetPath: Assets/RealToon/RealToon Tools/PerspectiveAdjustmentController.cs + uploadId: 889742 diff --git a/Assets/RealToon/RealToon Tools/ShadowTSDFModeHelper.cs b/Assets/RealToon/RealToon Tools/ShadowTSDFModeHelper.cs new file mode 100644 index 00000000..c270416c --- /dev/null +++ b/Assets/RealToon/RealToon Tools/ShadowTSDFModeHelper.cs @@ -0,0 +1,192 @@ +//RealToon - ShadowT SDF Mode [Helper] +//İMJQStudioWorks + +using System.Collections; +using System.Collections.Generic; +using UnityEditor; +using UnityEngine; +using UnityEngine.UI; + +namespace RealToon.Script +{ + [ExecuteAlways] + [AddComponentMenu("RealToon/Tools/ShadowT SDF Mode - Helper")] + public class ShadowTSDFModeHelper : MonoBehaviour + { + [Header("Note: ShadowT feature and SDF Mode will be automatically enable\nWhen you put a material that uses RealToon Shader on the Material slot.")] + + [Space(25)] + + [Space(10)] + [SerializeField] + [Tooltip("A material that uses 'RealToon - ShadowT' feature and enabled 'SDF Mode'.")] + public Material Material = null; + + [SerializeField] + [Tooltip("An object to follow the position.")] + public Transform ObjectToFollow = null; + + [Space(10)] + + [SerializeField] + public Texture2D SDFTexture = null; + + [SerializeField] + [Tooltip("The amount of light.")] + float LightThreshold = 200.0f; + + [SerializeField] + [Tooltip("How hard/soft the shadow.")] + float Hardness = 1.0f; + + [Space(10)] + + [SerializeField] + [Tooltip("Invert the Foward/Front position of the object.")] + bool ForwardInverted = false; + + [Tooltip("Invert the Right position of the object.")] + [SerializeField] + bool RightInverted = false; + + [Space(10)] + + [SerializeField] + [Tooltip("Enable/Disable Self Shadow feature.")] + bool SelfShadow = false; + + [Space(10)] + + [HideInInspector] + [SerializeField] + bool checkstart = true; + + string RT_Sha_Nam_URP = "Universal Render Pipeline/RealToon/Version 5/Default/Default"; + string RT_Sha_Nam_HDRP = "HDRP/RealToon/Version 5/Default"; + + string RT_Sha_Nam_BiRP_DD = "RealToon/Version 5/Default/Default"; + string RT_Sha_Nam_BiRP_DFT = "RealToon/Version 5/Default/Fade Transparency"; + string RT_Sha_Nam_BiRP_DR = "RealToon/Version 5/Default/Refraction"; + string RT_Sha_Nam_BiRP_TDD = "RealToon/Version 5/Tessellation/Default"; + string RT_Sha_Nam_BiRP_TDFT = "RealToon/Version 5/Tessellation/Fade Transparency"; + string RT_Sha_Nam_BiRP_TDR = "RealToon/Version 5/Tessellation/Refraction"; + + void LateUpdate() + { + + if (Material == null || ObjectToFollow == null) + { } + else + { + if (Material.shader.name == RT_Sha_Nam_URP || + Material.shader.name == RT_Sha_Nam_HDRP || + Material.shader.name == RT_Sha_Nam_BiRP_DD || + Material.shader.name == RT_Sha_Nam_BiRP_DFT || + Material.shader.name == RT_Sha_Nam_BiRP_DR || + Material.shader.name == RT_Sha_Nam_BiRP_TDD || + Material.shader.name == RT_Sha_Nam_BiRP_TDFT || + Material.shader.name == RT_Sha_Nam_BiRP_TDR) + { + Material.SetFloat("_ShadowTLightThreshold", LightThreshold); + Material.SetFloat("_ShadowTHardness", Hardness); + + switch(ForwardInverted) + { + case true: + Material.SetVector("_ObjectForward", -ObjectToFollow.transform.forward); + break; + + case false: + Material.SetVector("_ObjectForward", ObjectToFollow.transform.forward); + break; + } + + switch (RightInverted) + { + case true: + Material.SetVector("_ObjectRight", -ObjectToFollow.transform.right); + break; + + case false: + Material.SetVector("_ObjectRight", ObjectToFollow.transform.right); + break; + } + } + } + + } + + void OnValidate() + { + if (Material == null) + { + checkstart = true; + } + else if (Material != null) + { + if (Material.shader.name == RT_Sha_Nam_URP || + Material.shader.name == RT_Sha_Nam_HDRP || + Material.shader.name == RT_Sha_Nam_BiRP_DD || + Material.shader.name == RT_Sha_Nam_BiRP_DFT || + Material.shader.name == RT_Sha_Nam_BiRP_DR || + Material.shader.name == RT_Sha_Nam_BiRP_TDD || + Material.shader.name == RT_Sha_Nam_BiRP_TDFT || + Material.shader.name == RT_Sha_Nam_BiRP_TDR) + { + if (checkstart == true) + { + if ( (Material.IsKeywordEnabled("N_F_ST_ON") == false && Material.IsKeywordEnabled("N_F_STSDFM_ON") == false) || + (Material.IsKeywordEnabled("N_F_ST_ON") == true && Material.IsKeywordEnabled("N_F_STSDFM_ON") == false) || + (Material.IsKeywordEnabled("N_F_ST_ON") == false && Material.IsKeywordEnabled("N_F_STSDFM_ON") == true) ) + { + Material.EnableKeyword("N_F_ST_ON"); + Material.SetFloat("_N_F_ST", 1.0f); + + Material.EnableKeyword("N_F_STSDFM_ON"); + Material.SetFloat("_N_F_STSDFM", 1.0f); + + if(Material.IsKeywordEnabled("N_F_ST_ON") == true) + { + SelfShadow = true; + } + else if(Material.IsKeywordEnabled("N_F_ST_ON") == false) + { + SelfShadow = false; + } + + checkstart = false; + } + } + { + if (Material.GetTexture("_ShadowT") != null || + Material.GetTexture("_ShadowT") == null) + { + Material.SetTexture("_ShadowT", SDFTexture); + } + + switch (SelfShadow) + { + case true: + Material.EnableKeyword("N_F_SS_ON"); + Material.SetFloat("_N_F_SS", 1.0f); + break; + case false: + Material.DisableKeyword("N_F_SS_ON"); + Material.SetFloat("_N_F_SS", 0.0f); + break; + } + } + } + } + } + + void Reset() + { + Material = null; + ObjectToFollow = null; + checkstart = true; + } + + } + +} diff --git a/Assets/RealToon/RealToon Tools/ShadowTSDFModeHelper.cs.meta b/Assets/RealToon/RealToon Tools/ShadowTSDFModeHelper.cs.meta new file mode 100644 index 00000000..efe68270 --- /dev/null +++ b/Assets/RealToon/RealToon Tools/ShadowTSDFModeHelper.cs.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 94b1292d6eecd6b489a2afd078000520 +AssetOrigin: + serializedVersion: 1 + productId: 65518 + packageName: RealToon (Pro Anime/Toon Shader) + packageVersion: 5.0.15 + assetPath: Assets/RealToon/RealToon Tools/ShadowTSDFModeHelper.cs + uploadId: 889742 diff --git a/Assets/RealToon/RealToon Tools/SmearEffectHelper.cs b/Assets/RealToon/RealToon Tools/SmearEffectHelper.cs new file mode 100644 index 00000000..7b24e625 --- /dev/null +++ b/Assets/RealToon/RealToon Tools/SmearEffectHelper.cs @@ -0,0 +1,314 @@ +//RealToon - Smear Effect [Helper] +//İMJQStudioWorks + +using UnityEngine; +using System.Collections.Generic; + +namespace RealToon.Script +{ + + [ExecuteAlways] + [AddComponentMenu("RealToon/Tools/Smear Effect - Helper")] + + public class SmearEffectHelper : MonoBehaviour + { + Queue recentPositions = new Queue(); + + [HideInInspector] + [SerializeField] + Transform[] SubTran; + + [HideInInspector] + [SerializeField] + Material[] Mat; + + [HideInInspector] + [SerializeField] + Transform[] attac; + + [Header("Note: Smear Effect feature will be automatically enable\nOn the materials of the object/model that uses RealToon Shader.")] + + [Space(25)] + + [SerializeField] + [Tooltip("An object to control the smear effect.")] + public Transform SmearController; + + [Space(10)] + + [SerializeField] + [Tooltip("How long the distorted line trails stays on the previous position.")] + int Delay = 15; + + [SerializeField] + [Tooltip("How large/small the trailing noise.")] + float NoiseSize = 100; + + [SerializeField] + [Tooltip("How tall/short the trailing noise.")] + float TrailSize = 1.5f; + + [Space(10)] + + [SerializeField] + [Tooltip("Pause the current smear effect.")] + bool PauseSmear = false; + + int coun_obj_wi_ralsha = 0; + int coun_obj_mat = 0; + int coun_obj_mat_arr = 0; + + [HideInInspector] + [SerializeField] + bool checkstart = true; + + string RT_Sha_Nam_URP = "Universal Render Pipeline/RealToon/Version 5/Default/Default"; + string RT_Sha_Nam_HDRP = "HDRP/RealToon/Version 5/Default"; + + void Start() + { + if (checkstart == true) + { + InitStart(); + checkstart = false; + } + } + + void LateUpdate() + { + if (SmearController != null) + { + if (PauseSmear != true) + { + if (Mat != null) + { + foreach (Material mate in Mat) + { + if (mate != null) + { + mate.SetVector("_ObjPosi", SmearController.position); + recentPositions.Enqueue(SmearController.position); + + if (recentPositions.Count > Delay) + mate.SetVector("_PrevPosition", recentPositions.Dequeue()); + + Set_Shad_Prop(mate); + + } + + } + } + } + } + } + void Reset() + { + if (Mat != null) + { + foreach (Material mate in Mat) + { + if (mate != null) + { + mate.SetVector("_ObjPosi", new Vector4(0, 0, 0, 0)); + mate.SetVector("_PrevPosition", new Vector4(0, 0, 0, 0)); + } + } + recentPositions.Dequeue(); + recentPositions.Clear(); + checkstart = true; + coun_obj_wi_ralsha = 0; + coun_obj_mat = 0; + coun_obj_mat_arr = 0; + Res_Shad_Prop(); + InitStart(); + checkstart = false; + } + } + + void OnDisable() + { + recentPositions.Dequeue(); + foreach (Material mate in Mat) + { + if (mate != null) + { + mate.SetVector("_ObjPosi", new Vector4(0, 0, 0, 0)); + mate.SetVector("_PrevPosition", new Vector4(0, 0, 0, 0)); + } + } + } + + /* Remove Later + void OnDestroy() + { + recentPositions.Clear(); + Res_Shad_Prop(); + foreach (Material Mate in Mat) + { + if (Mate != null) + { + if (Mate.shader.name == RT_Sha_Nam_URP || Mate.shader.name == RT_Sha_Nam_HDRP) + { + Mate.SetVector("_ObjPosi", new Vector4(0, 0, 0, 0)); + Mate.SetVector("_PrevPosition", new Vector4(0, 0, 0, 0)); + Mate.SetFloat("_N_F_SE", 0.0f); + Mate.DisableKeyword("N_F_SE_ON"); + } + } + } + } + */ + + #region Init + + void InitStart() + { + if (attac == null || attac.Length == 0) + { + attac = this.gameObject.GetComponentsInChildren(); + } + + if (SmearController == null) + { + SmearController = this.gameObject.transform; + } + + int x = 0; + foreach (Transform Trans in attac) + { + + if (Trans.GetComponent() == true) + { + if (Trans.GetComponent().sharedMaterial != null) + { + if (Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_URP || Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_HDRP) + { + coun_obj_wi_ralsha++; + coun_obj_mat += Trans.GetComponent().sharedMaterials.Length; + } + } + + } + + if (Trans.GetComponent() == true) + { + if (Trans.GetComponent().sharedMaterial != null) + { + if (Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_URP || Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_HDRP) + { + coun_obj_wi_ralsha++; + coun_obj_mat += Trans.GetComponent().sharedMaterials.Length; + } + + } + } + + } + + SubTran = new Transform[coun_obj_wi_ralsha]; + + foreach (Transform Trans in attac) + { + if (Trans.GetComponent() == true) + { + if (Trans.GetComponent().sharedMaterial != null) + { + if (Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_URP || Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_HDRP) + { + SubTran[x] = Trans; + x++; + } + + } + + } + + if (Trans.GetComponent() == true) + { + if (Trans.GetComponent().sharedMaterial != null) + { + if (Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_URP || Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_HDRP) + { + SubTran[x] = Trans; + x++; + } + } + } + } + + + Mat = new Material[coun_obj_mat]; + + + foreach (Transform Trans in SubTran) + { + if (Trans.GetComponent() == true) + { + if (Trans.GetComponent().sharedMaterial != null) + { + if (Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_URP || Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_HDRP) + { + for (int i = 0; i < Trans.GetComponent().sharedMaterials.Length; i++) + { + Mat[coun_obj_mat_arr] = Trans.GetComponent().sharedMaterials[i]; + coun_obj_mat_arr++; + } + } + + } + + } + + if (Trans.GetComponent() == true) + { + if (Trans.GetComponent().sharedMaterial != null) + { + if (Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_URP || Trans.GetComponent().sharedMaterial.shader.name == RT_Sha_Nam_HDRP) + { + + for (int i = 0; i < Trans.GetComponent().sharedMaterials.Length; i++) + { + Mat[coun_obj_mat_arr] = Trans.GetComponent().sharedMaterials[i]; + coun_obj_mat_arr++; + } + } + } + } + + } + + foreach (Material Mat in Mat) + { + if (Mat != null) + { + Set_Shad_Prop(Mat); + } + } + + } + + #endregion + + void Set_Shad_Prop(Material Mat) + { + if (Mat.IsKeywordEnabled("N_F_SE_ON") == true) + { + Mat.SetFloat("_NoiseSize", NoiseSize); + Mat.SetFloat("_TrailSize", TrailSize); + } + else if (Mat.IsKeywordEnabled("N_F_SE_ON") != true) + { + Mat.EnableKeyword("N_F_SE_ON"); + Mat.SetInt("_N_F_SE", 1); + } + } + void Res_Shad_Prop() + { + NoiseSize = 100; + TrailSize = 1.5f; + Delay = 15; + } + + } + +} \ No newline at end of file diff --git a/Assets/RealToon/RealToon Tools/SmearEffectHelper.cs.meta b/Assets/RealToon/RealToon Tools/SmearEffectHelper.cs.meta new file mode 100644 index 00000000..79b78dd7 --- /dev/null +++ b/Assets/RealToon/RealToon Tools/SmearEffectHelper.cs.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 9b8a89bf5e3673342a090796bba2a357 +AssetOrigin: + serializedVersion: 1 + productId: 65518 + packageName: RealToon (Pro Anime/Toon Shader) + packageVersion: 5.0.15 + assetPath: Assets/RealToon/RealToon Tools/SmearEffectHelper.cs + uploadId: 889742 diff --git a/Assets/RealToon/RealToon Tools/SmoothObjectNormalHelper.cs b/Assets/RealToon/RealToon Tools/SmoothObjectNormalHelper.cs new file mode 100644 index 00000000..04eaff33 --- /dev/null +++ b/Assets/RealToon/RealToon Tools/SmoothObjectNormalHelper.cs @@ -0,0 +1,128 @@ +ïğż//RealToon - SmoothObjectNomal [Helper] +//ÂİMJQStudioWorks + +using UnityEngine; + +namespace RealToon.Script +{ + [ExecuteAlways] + [AddComponentMenu("RealToon/Tools/Smooth Object Normal - Helper")] + public class SmoothObjectNormalHelper : MonoBehaviour + { + [Header("Note: Smooth Object Normal feature will be automatically enable\nWhen you put a material that uses RealToon Shader on the Material slot.")] + + [Space(25)] + + [SerializeField] + [Range(0f, 1f)] + [Tooltip("The amount of Smoothed Object Normal.")] + public float Intensity = 0; + + [Space(10)] + [SerializeField] + [Tooltip("A material that uses 'RealToon - Smooth Object Normal' feature.")] + public Material Material = null; + + [SerializeField] + [Tooltip("An object to follow the position.")] + public Transform ObjectToFollow = null; + + [Space(10)] + [SerializeField] + [Tooltip("Show object normal.")] + public bool ShowNormal = false; + + [HideInInspector] + [SerializeField] + bool checkstart = true; + + string RT_Sha_Nam_URP = "Universal Render Pipeline/RealToon/Version 5/Default/Default"; + string RT_Sha_Nam_HDRP = "HDRP/RealToon/Version 5/Default"; + + string RT_Sha_Nam_BiRP_DD = "RealToon/Version 5/Default/Default"; + string RT_Sha_Nam_BiRP_DFT = "RealToon/Version 5/Default/Fade Transparency"; + string RT_Sha_Nam_BiRP_DR = "RealToon/Version 5/Default/Refraction"; + string RT_Sha_Nam_BiRP_TDD = "RealToon/Version 5/Tessellation/Default"; + string RT_Sha_Nam_BiRP_TDFT = "RealToon/Version 5/Tessellation/Fade Transparency"; + string RT_Sha_Nam_BiRP_TDR = "RealToon/Version 5/Tessellation/Refraction"; + + string RT_Sha_Nam_BiRP_LD = "RealToon/Version 5/Lite/Default"; + string RT_Sha_Nam_BiRP_LFT = "RealToon/Version 5/Lite/Fade Transparency"; + + void LateUpdate() + { + + if (Material == null || ObjectToFollow == null) + { } + else + { + if (Material.shader.name == RT_Sha_Nam_URP || + Material.shader.name == RT_Sha_Nam_HDRP || + Material.shader.name == RT_Sha_Nam_BiRP_DD || + Material.shader.name == RT_Sha_Nam_BiRP_DFT || + Material.shader.name == RT_Sha_Nam_BiRP_DR || + Material.shader.name == RT_Sha_Nam_BiRP_TDD || + Material.shader.name == RT_Sha_Nam_BiRP_TDFT || + Material.shader.name == RT_Sha_Nam_BiRP_TDR || + Material.shader.name == RT_Sha_Nam_BiRP_LD || + Material.shader.name == RT_Sha_Nam_BiRP_LFT) + { + Vector3 ObjPos = ObjectToFollow.gameObject.transform.position; + Material.SetVector("_XYZPosition", ObjPos); + Material.SetFloat("_SmoothObjectNormal", Intensity); + } + } + + } + + void OnValidate() + { + if (Material == null) + { + checkstart = true; + } + else if (Material != null) + { + if (Material.shader.name == RT_Sha_Nam_URP || + Material.shader.name == RT_Sha_Nam_HDRP || + Material.shader.name == RT_Sha_Nam_BiRP_DD || + Material.shader.name == RT_Sha_Nam_BiRP_DFT || + Material.shader.name == RT_Sha_Nam_BiRP_DR || + Material.shader.name == RT_Sha_Nam_BiRP_TDD || + Material.shader.name == RT_Sha_Nam_BiRP_TDFT || + Material.shader.name == RT_Sha_Nam_BiRP_TDR || + Material.shader.name == RT_Sha_Nam_BiRP_LD || + Material.shader.name == RT_Sha_Nam_BiRP_LFT) + { + if (checkstart == true) + { + if (Material.IsKeywordEnabled("N_F_SON_ON") == false) + { + Material.EnableKeyword("N_F_SON_ON"); + Material.SetFloat("_N_F_SON", 1.0f); + checkstart = false; + } + } + + switch(ShowNormal) + { + case true: + Material.SetFloat("_ShowNormal", 1.0f); + break; + case false: + Material.SetFloat("_ShowNormal", 0.0f); + break; + } + } + } + } + + void Reset() + { + Material = null; + ObjectToFollow = null; + checkstart = true; + } + + } +} diff --git a/Assets/RealToon/RealToon Tools/SmoothObjectNormalHelper.cs.meta b/Assets/RealToon/RealToon Tools/SmoothObjectNormalHelper.cs.meta new file mode 100644 index 00000000..2f25cbc7 --- /dev/null +++ b/Assets/RealToon/RealToon Tools/SmoothObjectNormalHelper.cs.meta @@ -0,0 +1,18 @@ +fileFormatVersion: 2 +guid: 81bb1f0a42687e64bbbb9942add38b86 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: +AssetOrigin: + serializedVersion: 1 + productId: 65518 + packageName: RealToon (Pro Anime/Toon Shader) + packageVersion: 5.0.15 + assetPath: Assets/RealToon/RealToon Tools/SmoothObjectNormalHelper.cs + uploadId: 889742 diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index bc69ef54..03363233 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:738abead11762d0468a65a889adcecf9f16e7a0c56e8ce03a618bedee60dcd31 -size 28100 +oid sha256:87718b14f88a5f893b5f109c236d208b8984fa7985c0699ec63dccd6d60386fe +size 28113 From f85ea1ffc15e2ed7f28af934d94aae74cbebf182 Mon Sep 17 00:00:00 2001 From: "NJ\\skrwn" Date: Sat, 20 Jun 2026 17:33:30 +0900 Subject: [PATCH 2/4] =?UTF-8?q?2026-06-20=20=EB=89=B4=ED=8E=98=EC=96=B4?= =?UTF-8?q?=EB=A6=AC=20=EB=A7=88=ED=85=8C=EB=A6=AC=EC=96=BC=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../01_Scenes/WhaleAdventure_VR/Rooms/CatsRoom.unity | 4 ++-- .../Rooms/CatsRoom/Global Volume Profile.asset | 4 ++-- Assets/04_Models/Characters/Fariy/Fairy.prefab | 4 ++-- .../Fariy/Materials/Body_Hair/Alistia_Body.mat | 10 +++++----- .../Fariy/Materials/Body_Hair/Alistia_Face.mat | 10 +++++----- .../Fariy/Materials/Body_Hair/Alistia_Hair.mat | 8 ++++---- .../Fariy/Materials/Cloth/Alistia_Cloth_1_Blue.mat | 2 +- .../Materials/Cloth/Alistia_Cloth_1_Blue_Lace.mat | 2 +- .../Fariy/Materials/Cloth/Alistia_Cloth_2_Lace.mat | 2 +- .../Characters/Fariy/Materials/Komono/Jewel_Blue.mat | 6 +++--- .../Characters/Fariy/Materials/Komono/Metal_Gold.mat | 2 +- .../04_Models/Characters/Fariy/Materials/wing_mat.mat | 10 +++++----- Assets/XR/AndroidXR/AndroidXRSettingsInitializer | 2 +- 13 files changed, 33 insertions(+), 33 deletions(-) diff --git a/Assets/01_Scenes/WhaleAdventure_VR/Rooms/CatsRoom.unity b/Assets/01_Scenes/WhaleAdventure_VR/Rooms/CatsRoom.unity index 703e6b1e..a9eac320 100644 --- a/Assets/01_Scenes/WhaleAdventure_VR/Rooms/CatsRoom.unity +++ b/Assets/01_Scenes/WhaleAdventure_VR/Rooms/CatsRoom.unity @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:81f97d177af2e06dff1e4c59125348c6dcdc9fea4f5b2f6a57d7d1c9091b7270 -size 2112412 +oid sha256:f03f1d9bcfcece83cc0e5550e9650667159e66a3336fcacf1ee28becfbf9ff87 +size 2115191 diff --git a/Assets/01_Scenes/WhaleAdventure_VR/Rooms/CatsRoom/Global Volume Profile.asset b/Assets/01_Scenes/WhaleAdventure_VR/Rooms/CatsRoom/Global Volume Profile.asset index 70eee6a8..7e08ed51 100644 --- a/Assets/01_Scenes/WhaleAdventure_VR/Rooms/CatsRoom/Global Volume Profile.asset +++ b/Assets/01_Scenes/WhaleAdventure_VR/Rooms/CatsRoom/Global Volume Profile.asset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:26e0b488fa569da49cb06fdbe41c509e8796f71b915753d5a660136198f23911 -size 1670 +oid sha256:1fe0c9f19090cb013df9d704f549e54be135b0c8803cffeda638d98433a69a6f +size 1669 diff --git a/Assets/04_Models/Characters/Fariy/Fairy.prefab b/Assets/04_Models/Characters/Fariy/Fairy.prefab index e005bc94..99ba07ca 100644 --- a/Assets/04_Models/Characters/Fariy/Fairy.prefab +++ b/Assets/04_Models/Characters/Fariy/Fairy.prefab @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d007c21785389ce941f7be6c6deec99248b6e61a2125f113eeaead0ee33bec4c -size 472037 +oid sha256:81d6f1de5145ac728583fee5cf72fdcd46d9e65dc313e0bb2e925e47ad36fba0 +size 472003 diff --git a/Assets/04_Models/Characters/Fariy/Materials/Body_Hair/Alistia_Body.mat b/Assets/04_Models/Characters/Fariy/Materials/Body_Hair/Alistia_Body.mat index 1ba2268e..36fe4dce 100644 --- a/Assets/04_Models/Characters/Fariy/Materials/Body_Hair/Alistia_Body.mat +++ b/Assets/04_Models/Characters/Fariy/Materials/Body_Hair/Alistia_Body.mat @@ -416,7 +416,7 @@ Material: - _Cutoff: 0.5 - _Cutout: 0.5 - _DepthThreshold: 900 - - _DirectionalLightIntensity: 1 + - _DirectionalLightIntensity: 0.2 - _DissolveNoiseStrength: 0.1 - _DistanceFadeMode: 0 - _DistanceFadeRimFresnelPower: 5 @@ -444,7 +444,7 @@ Material: - _EmissionMap_UVMode: 0 - _EmissionParallaxDepth: 0 - _EmissionUseGrad: 0 - - _EnvironmentalLightingIntensity: 1 + - _EnvironmentalLightingIntensity: 0.5 - _FarDistanceMaxWidth: 10 - _FlipNormal: 0 - _GIFlatShade: 0 @@ -518,7 +518,7 @@ Material: - _MCIALO: 0 - _MCapIntensity: 1 - _MVCOL: 0 - - _MaiColPo: 0.8 + - _MaiColPo: 0.9 - _Main2ndDissolveNoiseStrength: 0.1 - _Main2ndEnableLighting: 1 - _Main2ndTexAlphaMode: 0 @@ -906,7 +906,7 @@ Material: - _GlitterParams2: {r: 0.25, g: 0, b: 0, a: 0} - _GlossColor: {r: 1, g: 1, b: 1, a: 1} - _Glow_Color: {r: 1, g: 1, b: 1, a: 1} - - _HighlightColor: {r: 0.7311321, g: 0.7490734, b: 1, a: 1} + - _HighlightColor: {r: 0.71733713, g: 0.73595804, b: 0.9811321, a: 1} - _Keys: {r: 0, g: 0, b: 0, a: 0} - _LightDirectionOverride: {r: 0, g: 0.001, b: 0, a: 0} - _Main2ndDissolveColor: {r: 1, g: 1, b: 1, a: 1} @@ -925,7 +925,7 @@ Material: - _Main3rdTexDecalAnimation: {r: 1, g: 1, b: 1, a: 30} - _Main3rdTexDecalSubParam: {r: 1, g: 1, b: 0, a: 1} - _Main3rdTex_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} - - _MainColor: {r: 1, g: 1, b: 1, a: 1} + - _MainColor: {r: 1, g: 0.9009434, b: 0.9009434, a: 1} - _MainTexHSVG: {r: 0, g: 1, b: 1, a: 1} - _MainTex_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} - _MatCap2ndBlendUV1: {r: 0, g: 0, b: 0, a: 0} diff --git a/Assets/04_Models/Characters/Fariy/Materials/Body_Hair/Alistia_Face.mat b/Assets/04_Models/Characters/Fariy/Materials/Body_Hair/Alistia_Face.mat index 44ff3be8..9cc1829b 100644 --- a/Assets/04_Models/Characters/Fariy/Materials/Body_Hair/Alistia_Face.mat +++ b/Assets/04_Models/Characters/Fariy/Materials/Body_Hair/Alistia_Face.mat @@ -417,7 +417,7 @@ Material: - _Cutoff: 0.5 - _Cutout: 0.5 - _DepthThreshold: 900 - - _DirectionalLightIntensity: 0.5 + - _DirectionalLightIntensity: 0.2 - _DissolveNoiseStrength: 0.1 - _DistanceFadeMode: 0 - _DistanceFadeRimFresnelPower: 5 @@ -445,7 +445,7 @@ Material: - _EmissionMap_UVMode: 0 - _EmissionParallaxDepth: 0 - _EmissionUseGrad: 0 - - _EnvironmentalLightingIntensity: 1 + - _EnvironmentalLightingIntensity: 0.5 - _FarDistanceMaxWidth: 10 - _FlipNormal: 0 - _GIFlatShade: 0 @@ -519,7 +519,7 @@ Material: - _MCIALO: 0 - _MCapIntensity: 1 - _MVCOL: 0 - - _MaiColPo: 0.8 + - _MaiColPo: 0.9 - _Main2ndDissolveNoiseStrength: 0.1 - _Main2ndEnableLighting: 1 - _Main2ndTexAlphaMode: 0 @@ -907,7 +907,7 @@ Material: - _GlitterParams2: {r: 0.25, g: 0, b: 0, a: 0} - _GlossColor: {r: 1, g: 1, b: 1, a: 1} - _Glow_Color: {r: 1, g: 1, b: 1, a: 1} - - _HighlightColor: {r: 0.75, g: 0.7710225, b: 1, a: 1} + - _HighlightColor: {r: 0.66180134, g: 0.7226262, b: 0.9811321, a: 1} - _Keys: {r: 0, g: 0, b: 0, a: 0} - _LightDirectionOverride: {r: 0, g: 0.001, b: 0, a: 0} - _Main2ndDissolveColor: {r: 1, g: 1, b: 1, a: 1} @@ -926,7 +926,7 @@ Material: - _Main3rdTexDecalAnimation: {r: 1, g: 1, b: 1, a: 30} - _Main3rdTexDecalSubParam: {r: 1, g: 1, b: 0, a: 1} - _Main3rdTex_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} - - _MainColor: {r: 1, g: 1, b: 1, a: 1} + - _MainColor: {r: 1, g: 0.9481132, b: 0.9481132, a: 1} - _MainTexHSVG: {r: 0, g: 1, b: 1, a: 1} - _MainTex_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} - _MatCap2ndBlendUV1: {r: 0, g: 0, b: 0, a: 0} diff --git a/Assets/04_Models/Characters/Fariy/Materials/Body_Hair/Alistia_Hair.mat b/Assets/04_Models/Characters/Fariy/Materials/Body_Hair/Alistia_Hair.mat index 4ce2de3e..8d998a67 100644 --- a/Assets/04_Models/Characters/Fariy/Materials/Body_Hair/Alistia_Hair.mat +++ b/Assets/04_Models/Characters/Fariy/Materials/Body_Hair/Alistia_Hair.mat @@ -442,7 +442,7 @@ Material: - _EmissionMap_UVMode: 0 - _EmissionParallaxDepth: 0 - _EmissionUseGrad: 0 - - _EnvironmentalLightingIntensity: 1 + - _EnvironmentalLightingIntensity: 0.5 - _FarDistanceMaxWidth: 10 - _FlipNormal: 0 - _GIFlatShade: 0 @@ -471,7 +471,7 @@ Material: - _GlossTextureSoftness: 0 - _Glossiness: 0.6 - _Glow_Edge_Width: 1 - - _HighlightColorPower: 1 + - _HighlightColorPower: 2 - _IDMask1: 0 - _IDMask2: 0 - _IDMask3: 0 @@ -516,7 +516,7 @@ Material: - _MCIALO: 0 - _MCapIntensity: 1 - _MVCOL: 0 - - _MaiColPo: 0.8 + - _MaiColPo: 0.85 - _Main2ndDissolveNoiseStrength: 0.1 - _Main2ndEnableLighting: 1 - _Main2ndTexAlphaMode: 0 @@ -952,7 +952,7 @@ Material: - _Main3rdTexDecalAnimation: {r: 1, g: 1, b: 1, a: 30} - _Main3rdTexDecalSubParam: {r: 1, g: 1, b: 0, a: 1} - _Main3rdTex_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} - - _MainColor: {r: 1, g: 1, b: 1, a: 1} + - _MainColor: {r: 0.7558568, g: 0.7311321, b: 1, a: 1} - _MainTexHSVG: {r: 0, g: 1, b: 1, a: 1} - _MainTex_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} - _MatCap2ndBlendUV1: {r: 0, g: 0, b: 0, a: 0} diff --git a/Assets/04_Models/Characters/Fariy/Materials/Cloth/Alistia_Cloth_1_Blue.mat b/Assets/04_Models/Characters/Fariy/Materials/Cloth/Alistia_Cloth_1_Blue.mat index d66be4b9..8aefe05d 100644 --- a/Assets/04_Models/Characters/Fariy/Materials/Cloth/Alistia_Cloth_1_Blue.mat +++ b/Assets/04_Models/Characters/Fariy/Materials/Cloth/Alistia_Cloth_1_Blue.mat @@ -471,7 +471,7 @@ Material: - _GlossTextureSoftness: 0 - _Glossiness: 0.6 - _Glow_Edge_Width: 1 - - _HighlightColorPower: 5 + - _HighlightColorPower: 4 - _IDMask1: 0 - _IDMask2: 0 - _IDMask3: 0 diff --git a/Assets/04_Models/Characters/Fariy/Materials/Cloth/Alistia_Cloth_1_Blue_Lace.mat b/Assets/04_Models/Characters/Fariy/Materials/Cloth/Alistia_Cloth_1_Blue_Lace.mat index 37411fbf..b9a9a023 100644 --- a/Assets/04_Models/Characters/Fariy/Materials/Cloth/Alistia_Cloth_1_Blue_Lace.mat +++ b/Assets/04_Models/Characters/Fariy/Materials/Cloth/Alistia_Cloth_1_Blue_Lace.mat @@ -473,7 +473,7 @@ Material: - _GlossTextureSoftness: 0 - _Glossiness: 0.6 - _Glow_Edge_Width: 1 - - _HighlightColorPower: 5 + - _HighlightColorPower: 4 - _IDMask1: 0 - _IDMask2: 0 - _IDMask3: 0 diff --git a/Assets/04_Models/Characters/Fariy/Materials/Cloth/Alistia_Cloth_2_Lace.mat b/Assets/04_Models/Characters/Fariy/Materials/Cloth/Alistia_Cloth_2_Lace.mat index fb37c1bd..674ce31e 100644 --- a/Assets/04_Models/Characters/Fariy/Materials/Cloth/Alistia_Cloth_2_Lace.mat +++ b/Assets/04_Models/Characters/Fariy/Materials/Cloth/Alistia_Cloth_2_Lace.mat @@ -471,7 +471,7 @@ Material: - _GlossTextureSoftness: 0 - _Glossiness: 0.6 - _Glow_Edge_Width: 1 - - _HighlightColorPower: 5 + - _HighlightColorPower: 2 - _IDMask1: 0 - _IDMask2: 0 - _IDMask3: 0 diff --git a/Assets/04_Models/Characters/Fariy/Materials/Komono/Jewel_Blue.mat b/Assets/04_Models/Characters/Fariy/Materials/Komono/Jewel_Blue.mat index 741d6eb7..ae932c3b 100644 --- a/Assets/04_Models/Characters/Fariy/Materials/Komono/Jewel_Blue.mat +++ b/Assets/04_Models/Characters/Fariy/Materials/Komono/Jewel_Blue.mat @@ -414,7 +414,7 @@ Material: - _Cutoff: 0.5 - _Cutout: 0.5 - _DepthThreshold: 900 - - _DirectionalLightIntensity: 1 + - _DirectionalLightIntensity: 0.5 - _DissolveNoiseStrength: 0.1 - _DistanceFadeMode: 0 - _DistanceFadeRimFresnelPower: 5 @@ -442,7 +442,7 @@ Material: - _EmissionMap_UVMode: 0 - _EmissionParallaxDepth: 0 - _EmissionUseGrad: 0 - - _EnvironmentalLightingIntensity: 1 + - _EnvironmentalLightingIntensity: 0.5 - _FarDistanceMaxWidth: 10 - _FlipNormal: 0 - _GIFlatShade: 0 @@ -475,7 +475,7 @@ Material: - _GlossTextureSoftness: 0 - _Glossiness: 0.6 - _Glow_Edge_Width: 1 - - _HighlightColorPower: 5 + - _HighlightColorPower: 1 - _IDMask1: 0 - _IDMask2: 0 - _IDMask3: 0 diff --git a/Assets/04_Models/Characters/Fariy/Materials/Komono/Metal_Gold.mat b/Assets/04_Models/Characters/Fariy/Materials/Komono/Metal_Gold.mat index 81fc02a7..1f6e9ce1 100644 --- a/Assets/04_Models/Characters/Fariy/Materials/Komono/Metal_Gold.mat +++ b/Assets/04_Models/Characters/Fariy/Materials/Komono/Metal_Gold.mat @@ -471,7 +471,7 @@ Material: - _GlossTextureSoftness: 0 - _Glossiness: 0.6 - _Glow_Edge_Width: 1 - - _HighlightColorPower: 5 + - _HighlightColorPower: 2 - _IDMask1: 0 - _IDMask2: 0 - _IDMask3: 0 diff --git a/Assets/04_Models/Characters/Fariy/Materials/wing_mat.mat b/Assets/04_Models/Characters/Fariy/Materials/wing_mat.mat index 042f18cc..d6e0b933 100644 --- a/Assets/04_Models/Characters/Fariy/Materials/wing_mat.mat +++ b/Assets/04_Models/Characters/Fariy/Materials/wing_mat.mat @@ -438,7 +438,7 @@ Material: - _Cutout: 0.5 - _DepthThreshold: 900 - _DetailNormalMapScale: 1 - - _DirectionalLightIntensity: 2 + - _DirectionalLightIntensity: 0.8 - _DissolveNoiseStrength: 0.1 - _DistanceFadeMode: 0 - _DistanceFadeRimFresnelPower: 5 @@ -466,7 +466,7 @@ Material: - _EmissionMap_UVMode: 0 - _EmissionParallaxDepth: 0 - _EmissionUseGrad: 0 - - _EnvironmentalLightingIntensity: 2 + - _EnvironmentalLightingIntensity: 1 - _FarDistanceMaxWidth: 10 - _FlipNormal: 0 - _GIFlatShade: 0 @@ -497,7 +497,7 @@ Material: - _Glossiness: 0.25123277 - _GlossyReflections: 1 - _Glow_Edge_Width: 1 - - _HighlightColorPower: 10 + - _HighlightColorPower: 4 - _IDMask1: 0 - _IDMask2: 0 - _IDMask3: 0 @@ -542,7 +542,7 @@ Material: - _MCIALO: 0 - _MCapIntensity: 1 - _MVCOL: 0 - - _MaiColPo: 0.8 + - _MaiColPo: 1 - _Main2ndDissolveNoiseStrength: 0.1 - _Main2ndEnableLighting: 1 - _Main2ndTexAlphaMode: 0 @@ -954,7 +954,7 @@ Material: - _Main3rdTexDecalAnimation: {r: 1, g: 1, b: 1, a: 30} - _Main3rdTexDecalSubParam: {r: 1, g: 1, b: 0, a: 1} - _Main3rdTex_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} - - _MainColor: {r: 1, g: 1, b: 1, a: 1} + - _MainColor: {r: 0.5339979, g: 0.5487908, b: 0.9056604, a: 1} - _MainTexHSVG: {r: 0, g: 1, b: 1, a: 1} - _MainTex_ScrollRotate: {r: 0, g: 0, b: 0, a: 0} - _MatCap2ndBlendUV1: {r: 0, g: 0, b: 0, a: 0} diff --git a/Assets/XR/AndroidXR/AndroidXRSettingsInitializer b/Assets/XR/AndroidXR/AndroidXRSettingsInitializer index f9a9372d..ba1ef72f 100644 --- a/Assets/XR/AndroidXR/AndroidXRSettingsInitializer +++ b/Assets/XR/AndroidXR/AndroidXRSettingsInitializer @@ -11,5 +11,5 @@ MonoBehaviour: m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: d7e9a0ba2b7f40ebbb3dad8385aa807b, type: 3} m_Name: - m_EditorClassIdentifier: Unity.XR.AndroidOpenXR.Editor::UnityEditor.XR.OpenXR.Features.Android.AndroidXRSettingsInitializer + m_EditorClassIdentifier: isInitialized: 0 From b90f996d14a7d838023eabf4dcccbef5fa8eb525 Mon Sep 17 00:00:00 2001 From: "NJ\\skrwn" Date: Sat, 20 Jun 2026 17:35:54 +0900 Subject: [PATCH 3/4] =?UTF-8?q?=ED=8C=8C=ED=8B=B0=ED=81=B4=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/01_Scenes/WhaleAdventure_VR/Rooms/CatsRoom.unity | 4 ++-- Assets/04_Models/Characters/Fariy/Fairy.prefab | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Assets/01_Scenes/WhaleAdventure_VR/Rooms/CatsRoom.unity b/Assets/01_Scenes/WhaleAdventure_VR/Rooms/CatsRoom.unity index a9eac320..f0264e71 100644 --- a/Assets/01_Scenes/WhaleAdventure_VR/Rooms/CatsRoom.unity +++ b/Assets/01_Scenes/WhaleAdventure_VR/Rooms/CatsRoom.unity @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f03f1d9bcfcece83cc0e5550e9650667159e66a3336fcacf1ee28becfbf9ff87 -size 2115191 +oid sha256:3a50c3ffb70b15c9f303d4632f6b62bb3669897f0f3efc54ee512fc9474c62d0 +size 2115194 diff --git a/Assets/04_Models/Characters/Fariy/Fairy.prefab b/Assets/04_Models/Characters/Fariy/Fairy.prefab index 99ba07ca..16c68c2f 100644 --- a/Assets/04_Models/Characters/Fariy/Fairy.prefab +++ b/Assets/04_Models/Characters/Fariy/Fairy.prefab @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:81d6f1de5145ac728583fee5cf72fdcd46d9e65dc313e0bb2e925e47ad36fba0 -size 472003 +oid sha256:5a1dfec82bb68ec1771c53245d46adf02a4db595653ba5fe5be27fef33f197c0 +size 472001 From 8c764be37821755605a3b3f9c02eee7d987780ce Mon Sep 17 00:00:00 2001 From: "NJ\\skrwn" Date: Sat, 20 Jun 2026 17:38:52 +0900 Subject: [PATCH 4/4] =?UTF-8?q?=ED=8C=8C=ED=8B=B0=ED=81=B4=20=EC=9E=AC?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/01_Scenes/WhaleAdventure_VR/Rooms/CatsRoom.unity | 4 ++-- Assets/04_Models/Characters/Fariy/Fairy.prefab | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Assets/01_Scenes/WhaleAdventure_VR/Rooms/CatsRoom.unity b/Assets/01_Scenes/WhaleAdventure_VR/Rooms/CatsRoom.unity index f0264e71..007d4074 100644 --- a/Assets/01_Scenes/WhaleAdventure_VR/Rooms/CatsRoom.unity +++ b/Assets/01_Scenes/WhaleAdventure_VR/Rooms/CatsRoom.unity @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3a50c3ffb70b15c9f303d4632f6b62bb3669897f0f3efc54ee512fc9474c62d0 -size 2115194 +oid sha256:707049e0e526e4c944606d0a4de411dace6c0d7079746cfb218ecf8ab7c24132 +size 2115193 diff --git a/Assets/04_Models/Characters/Fariy/Fairy.prefab b/Assets/04_Models/Characters/Fariy/Fairy.prefab index 16c68c2f..8ffbce53 100644 --- a/Assets/04_Models/Characters/Fariy/Fairy.prefab +++ b/Assets/04_Models/Characters/Fariy/Fairy.prefab @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5a1dfec82bb68ec1771c53245d46adf02a4db595653ba5fe5be27fef33f197c0 -size 472001 +oid sha256:15fe95fcce389c08a3318eaaa0fff6c236a3f292825836361bf9f710d2229b3e +size 472002