From 4a338290cddb9f5875acdb78ded54e22a8649bc9 Mon Sep 17 00:00:00 2001 From: raccoon Date: Sat, 29 Mar 2025 18:20:25 +0500 Subject: [PATCH] Debug avatar fixes --- .../animation/debug/left-wrist-twist.anim | 2 +- .../animation/debug/right-wrist-twist.anim | 2 +- .../debug-avatar-fx.controller | 16 ++-- .../materials/debug_body.mat | 85 +++++++++++++++++++ .../materials/debug_body.mat.meta | 8 ++ .../mesh/fbx/minecraft-biped.fbx.meta | 2 +- .../scenes/debug-avatar-assembly.unity | 10 +-- Assets/minecraft-character/shaders.meta | 8 ++ .../shaders/DoubleSidedSurfaceShader.shader | 54 ++++++++++++ .../DoubleSidedSurfaceShader.shader.meta | 9 ++ 10 files changed, 180 insertions(+), 16 deletions(-) create mode 100644 Assets/minecraft-character/materials/debug_body.mat create mode 100644 Assets/minecraft-character/materials/debug_body.mat.meta create mode 100644 Assets/minecraft-character/shaders.meta create mode 100644 Assets/minecraft-character/shaders/DoubleSidedSurfaceShader.shader create mode 100644 Assets/minecraft-character/shaders/DoubleSidedSurfaceShader.shader.meta diff --git a/Assets/minecraft-character/animation/debug/left-wrist-twist.anim b/Assets/minecraft-character/animation/debug/left-wrist-twist.anim index bf93a3f..1395235 100644 --- a/Assets/minecraft-character/animation/debug/left-wrist-twist.anim +++ b/Assets/minecraft-character/animation/debug/left-wrist-twist.anim @@ -84,7 +84,7 @@ AnimationClip: m_Level: 0 m_CycleOffset: 0 m_HasAdditiveReferencePose: 0 - m_LoopTime: 1 + m_LoopTime: 0 m_LoopBlend: 0 m_LoopBlendOrientation: 0 m_LoopBlendPositionY: 0 diff --git a/Assets/minecraft-character/animation/debug/right-wrist-twist.anim b/Assets/minecraft-character/animation/debug/right-wrist-twist.anim index 387bfde..f4997b1 100644 --- a/Assets/minecraft-character/animation/debug/right-wrist-twist.anim +++ b/Assets/minecraft-character/animation/debug/right-wrist-twist.anim @@ -84,7 +84,7 @@ AnimationClip: m_Level: 0 m_CycleOffset: 0 m_HasAdditiveReferencePose: 0 - m_LoopTime: 1 + m_LoopTime: 0 m_LoopBlend: 0 m_LoopBlendOrientation: 0 m_LoopBlendPositionY: 0 diff --git a/Assets/minecraft-character/animcontrollers/debug-avatar-fx.controller b/Assets/minecraft-character/animcontrollers/debug-avatar-fx.controller index e9cf381..b6983b7 100644 --- a/Assets/minecraft-character/animcontrollers/debug-avatar-fx.controller +++ b/Assets/minecraft-character/animcontrollers/debug-avatar-fx.controller @@ -37,7 +37,7 @@ AnimatorStateTransition: m_Conditions: - m_ConditionMode: 4 m_ConditionEvent: armBend_R - m_EventTreshold: 0.001 + m_EventTreshold: 0.00001 m_DstStateMachine: {fileID: 0} m_DstState: {fileID: 4421189594993522951} m_Solo: 0 @@ -111,7 +111,7 @@ AnimatorStateTransition: m_Conditions: - m_ConditionMode: 3 m_ConditionEvent: armBend_L - m_EventTreshold: 0.001 + m_EventTreshold: 0.00001 m_DstStateMachine: {fileID: 0} m_DstState: {fileID: -8685169139931353087} m_Solo: 0 @@ -313,7 +313,7 @@ AnimatorStateTransition: m_Conditions: - m_ConditionMode: 4 m_ConditionEvent: legBend_R - m_EventTreshold: 0.001 + m_EventTreshold: 0.00001 m_DstStateMachine: {fileID: 0} m_DstState: {fileID: -8499032383996745326} m_Solo: 0 @@ -390,7 +390,7 @@ AnimatorStateTransition: m_Conditions: - m_ConditionMode: 3 m_ConditionEvent: legBend_L - m_EventTreshold: 0.001 + m_EventTreshold: 0.00001 m_DstStateMachine: {fileID: 0} m_DstState: {fileID: -6058138267361310940} m_Solo: 0 @@ -437,7 +437,7 @@ AnimatorStateTransition: m_Conditions: - m_ConditionMode: 4 m_ConditionEvent: legBend_L - m_EventTreshold: 0.001 + m_EventTreshold: 0.00001 m_DstStateMachine: {fileID: 0} m_DstState: {fileID: 7338583640218896176} m_Solo: 0 @@ -895,7 +895,7 @@ AnimatorStateTransition: m_Conditions: - m_ConditionMode: 4 m_ConditionEvent: armBend_L - m_EventTreshold: 0.001 + m_EventTreshold: 0.00001 m_DstStateMachine: {fileID: 0} m_DstState: {fileID: -6469148207063262467} m_Solo: 0 @@ -972,7 +972,7 @@ AnimatorStateTransition: m_Conditions: - m_ConditionMode: 3 m_ConditionEvent: armBend_R - m_EventTreshold: 0.001 + m_EventTreshold: 0.00001 m_DstStateMachine: {fileID: 0} m_DstState: {fileID: 6143320012694462314} m_Solo: 0 @@ -1485,7 +1485,7 @@ AnimatorStateTransition: m_Conditions: - m_ConditionMode: 3 m_ConditionEvent: legBend_R - m_EventTreshold: 0.001 + m_EventTreshold: 0.00001 m_DstStateMachine: {fileID: 0} m_DstState: {fileID: -7022503834672408926} m_Solo: 0 diff --git a/Assets/minecraft-character/materials/debug_body.mat b/Assets/minecraft-character/materials/debug_body.mat new file mode 100644 index 0000000..308903e --- /dev/null +++ b/Assets/minecraft-character/materials/debug_body.mat @@ -0,0 +1,85 @@ +%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: debug_body + m_Shader: {fileID: 4800000, guid: 676df02408413fd43bd784849747d32e, type: 3} + m_Parent: {fileID: 0} + m_ModifiedSerializedProperties: 0 + m_ValidKeywords: [] + m_InvalidKeywords: + - _GLOSSYREFLECTIONS_OFF + - _SPECULARHIGHLIGHTS_OFF + m_LightmapFlags: 4 + m_EnableInstancingVariants: 1 + 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: 2800000, guid: d423117f73a512444acb1727e90cce21, 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: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0 + - _GlossyReflections: 0 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 0 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + m_BuildTextureStacks: [] diff --git a/Assets/minecraft-character/materials/debug_body.mat.meta b/Assets/minecraft-character/materials/debug_body.mat.meta new file mode 100644 index 0000000..d178c84 --- /dev/null +++ b/Assets/minecraft-character/materials/debug_body.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8dc21be836d47b140b767e54a509509a +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/minecraft-character/mesh/fbx/minecraft-biped.fbx.meta b/Assets/minecraft-character/mesh/fbx/minecraft-biped.fbx.meta index d478559..bcd79ca 100644 --- a/Assets/minecraft-character/mesh/fbx/minecraft-biped.fbx.meta +++ b/Assets/minecraft-character/mesh/fbx/minecraft-biped.fbx.meta @@ -8,7 +8,7 @@ ModelImporter: type: UnityEngine:Material assembly: UnityEngine.CoreModule name: character_body - second: {fileID: 2100000, guid: a9db5faeb0ec81b4c8357e1a347b3fb6, type: 2} + second: {fileID: 2100000, guid: 8dc21be836d47b140b767e54a509509a, type: 2} materials: materialImportMode: 2 materialName: 1 diff --git a/Assets/minecraft-character/scenes/debug-avatar-assembly.unity b/Assets/minecraft-character/scenes/debug-avatar-assembly.unity index b46bfb7..a3ed052 100644 --- a/Assets/minecraft-character/scenes/debug-avatar-assembly.unity +++ b/Assets/minecraft-character/scenes/debug-avatar-assembly.unity @@ -172,12 +172,12 @@ MonoBehaviour: position: {x: -0.105, y: 0, z: 0} rotation: {x: 0, y: 0, z: 0, w: 1} collisionTags: - - PalmLevel_L + - MiddleLevel_L allowSelf: 1 allowOthers: 0 localOnly: 0 receiverType: 2 - parameter: palmLevel_L + parameter: middleLevel_L minVelocity: 0.05 --- !u!114 &228568949 MonoBehaviour: @@ -2350,7 +2350,7 @@ MonoBehaviour: allowOthers: 0 localOnly: 0 receiverType: 2 - parameter: pinkyLevel_L + parameter: pinkyLevel_R minVelocity: 0.05 --- !u!114 &1377740652 MonoBehaviour: @@ -2546,12 +2546,12 @@ MonoBehaviour: position: {x: -0.105, y: 0, z: 0} rotation: {x: 0, y: 0, z: 0, w: 1} collisionTags: - - PalmLevel_R + - MiddleLevel_R allowSelf: 1 allowOthers: 0 localOnly: 0 receiverType: 2 - parameter: palmLevel_R + parameter: middleLevel_R minVelocity: 0.05 --- !u!114 &1818142023 MonoBehaviour: diff --git a/Assets/minecraft-character/shaders.meta b/Assets/minecraft-character/shaders.meta new file mode 100644 index 0000000..356ef91 --- /dev/null +++ b/Assets/minecraft-character/shaders.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3c2579b516aec5c48b1524e5feacaf02 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/minecraft-character/shaders/DoubleSidedSurfaceShader.shader b/Assets/minecraft-character/shaders/DoubleSidedSurfaceShader.shader new file mode 100644 index 0000000..4779003 --- /dev/null +++ b/Assets/minecraft-character/shaders/DoubleSidedSurfaceShader.shader @@ -0,0 +1,54 @@ +Shader "Custom/DoubleSidedSurfaceShader" +{ + Properties + { + _Color ("Color", Color) = (1,1,1,1) + _MainTex ("Albedo (RGB)", 2D) = "white" {} + _Glossiness ("Smoothness", Range(0,1)) = 0.5 + _Metallic ("Metallic", Range(0,1)) = 0.0 + } + SubShader + { + Tags { "RenderType"="Opaque" } + LOD 200 + Cull Off + + CGPROGRAM + // Physically based Standard lighting model, and enable shadows on all light types + #pragma surface surf Standard fullforwardshadows + + // Use shader model 3.0 target, to get nicer looking lighting + #pragma target 3.0 + + sampler2D _MainTex; + + struct Input + { + float2 uv_MainTex; + }; + + half _Glossiness; + half _Metallic; + fixed4 _Color; + + // Add instancing support for this shader. You need to check 'Enable Instancing' on materials that use the shader. + // See https://docs.unity3d.com/Manual/GPUInstancing.html for more information about instancing. + // #pragma instancing_options assumeuniformscaling + UNITY_INSTANCING_BUFFER_START(Props) + // put more per-instance properties here + UNITY_INSTANCING_BUFFER_END(Props) + + void surf (Input IN, inout SurfaceOutputStandard o) + { + // Albedo comes from a texture tinted by color + fixed4 c = tex2D (_MainTex, IN.uv_MainTex) * _Color; + o.Albedo = c.rgb; + // Metallic and smoothness come from slider variables + o.Metallic = _Metallic; + o.Smoothness = _Glossiness; + o.Alpha = c.a; + } + ENDCG + } + FallBack "Diffuse" +} diff --git a/Assets/minecraft-character/shaders/DoubleSidedSurfaceShader.shader.meta b/Assets/minecraft-character/shaders/DoubleSidedSurfaceShader.shader.meta new file mode 100644 index 0000000..aa89aea --- /dev/null +++ b/Assets/minecraft-character/shaders/DoubleSidedSurfaceShader.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 676df02408413fd43bd784849747d32e +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: