From 21c34c5fdd0d36675b1a9d88189804fd97c853a7 Mon Sep 17 00:00:00 2001 From: wookywok <62037083+wookywok@users.noreply.github.com> Date: Tue, 23 Apr 2024 06:47:57 -0500 Subject: [PATCH] Fixed Airboarder bopping, reworked floor texture - Airboarder bops will no longer interrupt whiff animations or YEAAAAAAAH LET'S GO - The floor now uses a custom shader that makes the textures much more vibrant --- .../Airboarder/Materials/floorspecular.mat | 96 ++++++++++++++-- Assets/Scripts/Games/Airboarder/Airboarder.cs | 27 ++++- Assets/Shaders/SpecularRGB.shader | 108 ++++++++++++++++++ Assets/Shaders/SpecularRGB.shader.meta | 11 ++ 4 files changed, 230 insertions(+), 12 deletions(-) create mode 100644 Assets/Shaders/SpecularRGB.shader create mode 100644 Assets/Shaders/SpecularRGB.shader.meta diff --git a/Assets/Resources/Models/Games/Airboarder/Materials/floorspecular.mat b/Assets/Resources/Models/Games/Airboarder/Materials/floorspecular.mat index a2afcd79e..8c0f4fb7c 100644 --- a/Assets/Resources/Models/Games/Airboarder/Materials/floorspecular.mat +++ b/Assets/Resources/Models/Games/Airboarder/Materials/floorspecular.mat @@ -8,12 +8,11 @@ Material: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_Name: floorspecular - m_Shader: {fileID: 4800000, guid: bedf46e927dae18459dcdcdef5201a5f, type: 3} - m_ValidKeywords: - - _EMISSION + m_Shader: {fileID: 4800000, guid: 01fcad061413647468af49d96a9fd5d0, type: 3} + m_ValidKeywords: [] m_InvalidKeywords: - - _METALLICGLOSSMAP - m_LightmapFlags: 2 + - _EMISSION + m_LightmapFlags: 6 m_EnableInstancingVariants: 0 m_DoubleSidedGI: 0 m_CustomRenderQueue: -1 @@ -22,10 +21,26 @@ Material: m_SavedProperties: serializedVersion: 3 m_TexEnvs: + - _Albedo: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BaseTexture: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BlendTex: + 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} + - _ColorMask: + m_Texture: {fileID: 2800000, guid: f181c9819c5bc7b488b3eedee117d8e0, type: 3} + m_Scale: {x: 128, y: 1} + m_Offset: {x: 0, y: 0} - _ColorMaskTex: m_Texture: {fileID: 2800000, guid: f181c9819c5bc7b488b3eedee117d8e0, type: 3} m_Scale: {x: 1, y: 1} @@ -42,10 +57,18 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + - _Diffuse: + m_Texture: {fileID: 2800000, guid: f181c9819c5bc7b488b3eedee117d8e0, type: 3} + m_Scale: {x: 128, y: 1} + m_Offset: {x: 0, y: 0} - _EmissionMap: - m_Texture: {fileID: 0} + m_Texture: {fileID: 2800000, guid: f181c9819c5bc7b488b3eedee117d8e0, type: 3} m_Scale: {x: 128, y: 0} m_Offset: {x: 0, y: 0} + - _FinishedColor: + m_Texture: {fileID: 2800000, guid: f181c9819c5bc7b488b3eedee117d8e0, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} - _MainTex: m_Texture: {fileID: 0} m_Scale: {x: 128, y: 0} @@ -54,10 +77,18 @@ Material: m_Texture: {fileID: 2800000, guid: 19bee659c965a1f43821279858da805d, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + - _NoiseMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} - _OcclusionMap: m_Texture: {fileID: 2800000, guid: f181c9819c5bc7b488b3eedee117d8e0, type: 3} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + - _OcclusionTexture: + 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} @@ -66,30 +97,81 @@ Material: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} + - _SpecularTexture: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _Texture0: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _TextureSample0: + m_Texture: {fileID: 2800000, guid: f181c9819c5bc7b488b3eedee117d8e0, type: 3} + m_Scale: {x: 128, y: 1} + m_Offset: {x: 0, y: 0} + - _TextureSample1: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ToonRamp: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ToonShade: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _texcoord: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} m_Ints: [] m_Floats: + - _ASEOutlineWidth: 0 - _BumpScale: 1 - _Cutoff: 0 - _DetailNormalMapScale: 1 - _DstBlend: 0 + - _EdgeLength: 15 - _GlossMapScale: 0.05 - _Glossiness: 0.1 - _GlossyReflections: 1 - _Metallic: 0.2 - _Mode: 0 + - _NoiseMapStrength: 0 - _OcclusionStrength: 0 - _Parallax: 0.02 + - _RimOffset: 0.24 + - _RimPower: 10 - _SmoothnessTextureChannel: 0 - _SpecularHighlights: 1 - _SrcBlend: 1 + - _Threshold: 0 - _UVSec: 0 - _ZWrite: 1 + - __dirty: 0 m_Colors: - - _AlphaColor: {r: 0.3773585, g: 0.3773585, b: 0.3773585, a: 1} + - _ASEOutlineColor: {r: 0, g: 0, b: 0, a: 0} + - _AlphaColor: {r: 0, g: 0, b: 0, a: 1} + - _BlendColor: {r: 1, g: 1, b: 1, a: 1} + - _Blue: {r: 0, g: 0, b: 1, a: 1} - _BlueColor: {r: 1, g: 1, b: 1, a: 1} - _Color: {r: 1, g: 0.97547174, b: 0.97547174, a: 1} + - _Color0: {r: 0, g: 0, b: 1, a: 0} + - _Color1: {r: 0, g: 0, b: 0, a: 1} + - _Color2: {r: 1, g: 0, b: 0, a: 0} + - _Color3: {r: 0.103773594, g: 0.103773594, b: 0.103773594, a: 0} + - _Color9: {r: 1, g: 1, b: 1, a: 1} - _EmissionColor: {r: 0.078431375, g: 0.078431375, b: 0.078431375, a: 1} - _GreenColor: {r: 1, g: 1, b: 1, a: 0} + - _NoiseMapPannerSpeed: {r: 0, g: 0, b: 0, a: 0} + - _NoiseMapSize: {r: 512, g: 512, b: 0, a: 0} - _RedColor: {r: 0.8274511, g: 0.1254902, b: 0.8078432, a: 1} + - _RimColor: {r: 0, g: 1, b: 0.8758622, a: 0} + - _RingPannerSpeed: {r: 0, g: 0, b: 0, a: 0} - _SpecColor: {r: 0.047169805, g: 0.047169805, b: 0.047169805, a: 1} + - _SpecularColor: {r: 0.18867922, g: 0.18867922, b: 0.18867922, a: 0} + - _TilingOffset: {r: 0, g: 0, b: 0, a: 0} + - _TilingScale: {r: 1, g: 1, b: 0, a: 0} + - _Tint: {r: 0, g: 0, b: 0, a: 0} m_BuildTextureStacks: [] diff --git a/Assets/Scripts/Games/Airboarder/Airboarder.cs b/Assets/Scripts/Games/Airboarder/Airboarder.cs index f06f25c16..3fc84562f 100644 --- a/Assets/Scripts/Games/Airboarder/Airboarder.cs +++ b/Assets/Scripts/Games/Airboarder/Airboarder.cs @@ -263,6 +263,7 @@ namespace HeavenStudio.Games foreach (var e in blockEvents) { + double unswungBeat = Conductor.instance.GetUnSwungBeat(e.beat); switch (e.datamodel) { case "airboarder/duck": RequestArch(e.beat - 25, false); @@ -335,7 +336,7 @@ namespace HeavenStudio.Games public void Update() { var cond = Conductor.instance; - var currentBeat = cond.songPositionInBeatsAsDouble; + var currentBeat = cond.unswungSongPositionInBeatsAsDouble; ColorUpdate(); @@ -377,7 +378,10 @@ namespace HeavenStudio.Games { Player.DoScaledAnimationAsync("jump",1f, 0, 1); SoundByte.PlayOneShotGame("airboarder/jump"); - playerCantBop = false;} + BeatAction.New(this, new() { + new(currentBeat, ()=>playerCantBop = true), + new(currentBeat+1.5f, ()=>playerCantBop = false)}); + } } } @@ -510,15 +514,28 @@ namespace HeavenStudio.Games if(voiceOn) { BeatAction.New(instance, new List(){ + new BeatAction.Action(beat, delegate {SoundByte.PlayOneShotGame("airboarder/start1");}), new BeatAction.Action(beat + 6.5, delegate {SoundByte.PlayOneShotGame("airboarder/start2");}), new BeatAction.Action(beat + 7, delegate {SoundByte.PlayOneShotGame("airboarder/start3");}), }); } BeatAction.New(instance, new List(){ - new BeatAction.Action(beat, delegate {CPU1.DoScaledAnimationAsync("letsgo", 1f, 0, 1);}), - new BeatAction.Action(beat, delegate {CPU2.DoScaledAnimationAsync("letsgo", 1f, 0, 1);}), - new BeatAction.Action(beat, delegate {Player.DoScaledAnimationAsync("letsgo", 1f, 0, 1);}) + + new BeatAction.Action(beat, delegate { + cpu1CantBop = true; + cpu2CantBop = true; + playerCantBop = true; + CPU1.DoScaledAnimationAsync("letsgo", 1f, 0, 1); + CPU2.DoScaledAnimationAsync("letsgo", 1f, 0, 1); + Player.DoScaledAnimationAsync("letsgo", 1f, 0, 1); + }), + + new BeatAction.Action(beat+7, delegate { + cpu1CantBop = false; + cpu2CantBop = false; + playerCantBop = false; + }) } ); diff --git a/Assets/Shaders/SpecularRGB.shader b/Assets/Shaders/SpecularRGB.shader new file mode 100644 index 000000000..8446870c9 --- /dev/null +++ b/Assets/Shaders/SpecularRGB.shader @@ -0,0 +1,108 @@ +// Made with Amplify Shader Editor v1.9.2.2 +// Available at the Unity Asset Store - http://u3d.as/y3X +Shader "RGB Mapped Specular" +{ + Properties + { + _BlueColor("Blue Color", Color) = (0,0,1,1) + _ColorMask("Color Mask", 2D) = "white" {} + _GreenColor("Green Color", Color) = (0,1,0,1) + _RedColor("Red Color", Color) = (1,0,0,1) + _SpecularTexture("Specular Texture", 2D) = "white" {} + _SpecularColor("Specular Color", Color) = (0,0,0,0) + [HideInInspector] _texcoord( "", 2D ) = "white" {} + [HideInInspector] __dirty( "", Int ) = 1 + } + + SubShader + { + Tags{ "RenderType" = "Opaque" "Queue" = "Geometry+0" } + Cull Back + CGPROGRAM + #pragma target 3.0 + #pragma surface surf StandardSpecular keepalpha addshadow fullforwardshadows + struct Input + { + float2 uv_texcoord; + }; + + uniform float4 _RedColor; + uniform sampler2D _ColorMask; + uniform float4 _ColorMask_ST; + uniform float4 _GreenColor; + uniform float4 _BlueColor; + uniform sampler2D _SpecularTexture; + uniform float4 _SpecularTexture_ST; + uniform float4 _SpecularColor; + + void surf( Input i , inout SurfaceOutputStandardSpecular o ) + { + float2 uv_ColorMask = i.uv_texcoord * _ColorMask_ST.xy + _ColorMask_ST.zw; + float4 tex2DNode56 = tex2D( _ColorMask, uv_ColorMask ); + float4 temp_cast_0 = (tex2DNode56.r).xxxx; + float4 temp_output_1_0_g30 = temp_cast_0; + float4 color145 = IsGammaSpace() ? float4(1,1,1,1) : float4(1,1,1,1); + float4 temp_cast_1 = (color145.r).xxxx; + float4 temp_output_2_0_g30 = temp_cast_1; + float temp_output_11_0_g30 = distance( temp_output_1_0_g30 , temp_output_2_0_g30 ); + float4 lerpResult21_g30 = lerp( _RedColor , temp_output_1_0_g30 , saturate( ( ( temp_output_11_0_g30 - 0.0 ) / max( 0.0 , 1E-05 ) ) )); + float4 temp_cast_2 = (tex2DNode56.g).xxxx; + float4 temp_output_1_0_g33 = temp_cast_2; + float4 temp_cast_3 = (color145.g).xxxx; + float4 temp_output_2_0_g33 = temp_cast_3; + float temp_output_11_0_g33 = distance( temp_output_1_0_g33 , temp_output_2_0_g33 ); + float4 lerpResult21_g33 = lerp( _GreenColor , temp_output_1_0_g33 , saturate( ( ( temp_output_11_0_g33 - 0.0 ) / max( 0.0 , 1E-05 ) ) )); + float4 temp_cast_4 = (tex2DNode56.b).xxxx; + float4 temp_output_1_0_g32 = temp_cast_4; + float4 temp_cast_5 = (color145.b).xxxx; + float4 temp_output_2_0_g32 = temp_cast_5; + float temp_output_11_0_g32 = distance( temp_output_1_0_g32 , temp_output_2_0_g32 ); + float4 lerpResult21_g32 = lerp( _BlueColor , temp_output_1_0_g32 , saturate( ( ( temp_output_11_0_g32 - 0.0 ) / max( 0.0 , 1E-05 ) ) )); + o.Albedo = ( lerpResult21_g30 + lerpResult21_g33 + lerpResult21_g32 ).rgb; + float2 uv_SpecularTexture = i.uv_texcoord * _SpecularTexture_ST.xy + _SpecularTexture_ST.zw; + o.Specular = ( tex2D( _SpecularTexture, uv_SpecularTexture ) * _SpecularColor ).rgb; + float4 color180 = IsGammaSpace() ? float4(0.490566,0.490566,0.490566,0) : float4(0.2054128,0.2054128,0.2054128,0); + o.Smoothness = color180.r; + o.Alpha = 1; + } + + ENDCG + } + Fallback "Diffuse" + CustomEditor "ASEMaterialInspector" +} +/*ASEBEGIN +Version=19202 +Node;AmplifyShaderEditor.ColorNode;85;923.9312,-104.79;Inherit;False;Property;_GreenColor;Green Color;2;0;Create;True;0;0;0;False;0;False;0,1,0,1;1,1,1,1;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 +Node;AmplifyShaderEditor.FunctionNode;133;609.7323,-354.0471;Inherit;True;Replace Color;-1;;30;896dccb3016c847439def376a728b869;1,12,0;5;1;COLOR;0,0,0,0;False;2;COLOR;0,0,0,0;False;3;COLOR;0,0,0,0;False;4;FLOAT;0;False;5;FLOAT;0;False;1;COLOR;0 +Node;AmplifyShaderEditor.ColorNode;145;283.1273,-165.9594;Inherit;False;Constant;_SAMPLER1;SAMPLER;5;0;Create;True;0;0;0;False;0;False;1,1,1,1;0,0,0,0;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 +Node;AmplifyShaderEditor.FunctionNode;74;625.8145,121.5868;Inherit;True;Replace Color;-1;;32;896dccb3016c847439def376a728b869;1,12,0;5;1;COLOR;0,0,0,0;False;2;COLOR;0,0,0,0;False;3;COLOR;0,0,0,0;False;4;FLOAT;0;False;5;FLOAT;0;False;1;COLOR;0 +Node;AmplifyShaderEditor.SamplerNode;56;684.2705,-619.2117;Inherit;True;Property;_ColorMask;Color Mask;1;0;Create;True;0;0;0;False;0;False;-1;f181c9819c5bc7b488b3eedee117d8e0;f181c9819c5bc7b488b3eedee117d8e0;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 +Node;AmplifyShaderEditor.ColorNode;80;936.1936,-305.71;Inherit;False;Property;_RedColor;Red Color;3;0;Create;True;0;0;0;False;0;False;1,0,0,1;0.8274511,0.1254902,0.8078432,1;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 +Node;AmplifyShaderEditor.SamplerNode;177;1814.391,-405.1943;Inherit;True;Property;_SpecularTexture;Specular Texture;4;0;Create;True;0;0;0;False;0;False;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 +Node;AmplifyShaderEditor.SimpleMultiplyOpNode;179;1983.39,-191.9944;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0 +Node;AmplifyShaderEditor.ColorNode;180;1789.009,19.38913;Inherit;False;Constant;_Color4;Color 4;6;0;Create;True;0;0;0;False;0;False;0.490566,0.490566,0.490566,0;0,0,0,0;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 +Node;AmplifyShaderEditor.FunctionNode;100;610.3962,-119.2751;Inherit;True;Replace Color;-1;;33;896dccb3016c847439def376a728b869;1,12,0;5;1;COLOR;0,0,0,0;False;2;COLOR;0,0,0,0;False;3;COLOR;0,0,0,0;False;4;FLOAT;0;False;5;FLOAT;0;False;1;COLOR;0 +Node;AmplifyShaderEditor.ColorNode;73;917.8559,126.702;Inherit;False;Property;_BlueColor;Blue Color;0;0;Create;True;0;0;0;False;0;False;0,0,1,1;1,1,1,1;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 +Node;AmplifyShaderEditor.StandardSurfaceOutputNode;32;1448.904,-264.5044;Float;False;True;-1;2;ASEMaterialInspector;0;0;StandardSpecular;Color Masking Test;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;Back;0;False;;0;False;;False;0;False;;0;False;;False;0;Opaque;0.5;True;True;0;False;Opaque;;Geometry;All;12;all;True;True;True;True;0;False;_SpecularHighlights;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;2;15;10;25;False;0.5;True;0;5;False;;10;False;;0;0;False;;0;False;;0;False;;0;False;;0;False;0;0,0,0,0;VertexOffset;True;False;Cylindrical;False;True;Relative;0;;-1;-1;-1;-1;0;False;0;0;False;;-1;0;False;;0;0;0;False;0.1;False;;0;False;;False;17;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;2;FLOAT3;0,0,0;False;3;FLOAT3;0,0,0;False;4;FLOAT;0;False;5;FLOAT;0;False;6;FLOAT3;0,0,0;False;7;FLOAT3;0,0,0;False;8;FLOAT;0;False;9;FLOAT;0;False;10;FLOAT;0;False;13;FLOAT3;0,0,0;False;11;FLOAT3;0,0,0;False;12;FLOAT3;0,0,0;False;16;FLOAT4;0,0,0,0;False;14;FLOAT4;0,0,0,0;False;15;FLOAT3;0,0,0;False;0 +Node;AmplifyShaderEditor.SimpleAddOpNode;173;1205.289,-157.06;Inherit;True;3;3;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;COLOR;0,0,0,0;False;1;COLOR;0 +Node;AmplifyShaderEditor.ColorNode;178;1744.19,-176.3944;Inherit;False;Property;_SpecularColor;Specular Color;5;0;Create;True;0;0;0;False;0;False;0,0,0,0;0,0,0,0;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4 +WireConnection;133;1;56;1 +WireConnection;133;2;145;1 +WireConnection;133;3;80;0 +WireConnection;74;1;56;3 +WireConnection;74;2;145;3 +WireConnection;74;3;73;0 +WireConnection;179;0;177;0 +WireConnection;179;1;178;0 +WireConnection;100;1;56;2 +WireConnection;100;2;145;2 +WireConnection;100;3;85;0 +WireConnection;32;0;173;0 +WireConnection;32;3;179;0 +WireConnection;32;4;180;0 +WireConnection;173;0;133;0 +WireConnection;173;1;100;0 +WireConnection;173;2;74;0 +ASEEND*/ +//CHKSM=91F445FA4870F75F56B6AF4194C5218D6A21E584 \ No newline at end of file diff --git a/Assets/Shaders/SpecularRGB.shader.meta b/Assets/Shaders/SpecularRGB.shader.meta new file mode 100644 index 000000000..f18ad4be2 --- /dev/null +++ b/Assets/Shaders/SpecularRGB.shader.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 01fcad061413647468af49d96a9fd5d0 +ShaderImporter: + externalObjects: {} + defaultTextures: + - _ColorMask: {fileID: 2800000, guid: f181c9819c5bc7b488b3eedee117d8e0, type: 3} + nonModifiableTextures: [] + preprocessorOverride: 0 + userData: + assetBundleName: + assetBundleVariant: