ShaoNv
PC-202302260912\Administrator 2024-12-29 20:36:00 +08:00
parent 99c0eeafed
commit 97eacfa11b
2 changed files with 260 additions and 0 deletions

View File

@ -0,0 +1,251 @@
// Upgrade NOTE: upgraded instancing buffer 'X1_spinedead' to new syntax.
// Made with Amplify Shader Editor
// Available at the Unity Asset Store - http://u3d.as/y3X
Shader "X1_spine/dead"
{
Properties
{
_MainTex("MainTex", 2D) = "white" {}
_Color("Color", Color) = (1,1,1,1)
_HDR("HDR", Range( 0 , 2)) = 0
_MaskTex("MaskTex", 2D) = "white" {}
_TexTilling("TexTilling", Vector) = (1,1,0,0)
[HideInInspector] _texcoord( "", 2D ) = "white" {}
}
SubShader
{
Tags { "RenderType"="Transparent" "Queue"="Transparent" }
LOD 100
CGINCLUDE
#pragma target 3.0
ENDCG
Blend SrcAlpha OneMinusSrcAlpha
AlphaToMask Off
Cull Off
ColorMask RGBA
ZWrite Off
ZTest LEqual
Offset 0 , 0
Pass
{
Name "Unlit"
Tags { "LightMode"="ForwardBase" }
CGPROGRAM
#ifndef UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX
//only defining to not throw compilation error over Unity 5.5
#define UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input)
#endif
#pragma vertex vert
#pragma fragment frag
#pragma multi_compile_instancing
#include "UnityCG.cginc"
#define ASE_NEEDS_VERT_POSITION
struct appdata
{
float4 vertex : POSITION;
float4 color : COLOR;
float3 ase_normal : NORMAL;
float4 ase_texcoord : TEXCOORD0;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct v2f
{
float4 vertex : SV_POSITION;
#ifdef ASE_NEEDS_FRAG_WORLD_POSITION
float3 worldPos : TEXCOORD0;
#endif
float4 ase_texcoord1 : TEXCOORD1;
float4 ase_texcoord2 : TEXCOORD2;
float4 ase_texcoord3 : TEXCOORD3;
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
};
uniform sampler2D _MainTex;
uniform sampler2D _MaskTex;
uniform float2 _TexTilling;
UNITY_INSTANCING_BUFFER_START(X1_spinedead)
UNITY_DEFINE_INSTANCED_PROP(float4, _Color)
#define _Color_arr X1_spinedead
UNITY_DEFINE_INSTANCED_PROP(float4, _MainTex_ST)
#define _MainTex_ST_arr X1_spinedead
UNITY_DEFINE_INSTANCED_PROP(float, _HDR)
#define _HDR_arr X1_spinedead
UNITY_INSTANCING_BUFFER_END(X1_spinedead)
inline float4 ASE_ComputeGrabScreenPos( float4 pos )
{
#if UNITY_UV_STARTS_AT_TOP
float scale = -1.0;
#else
float scale = 1.0;
#endif
float4 o = pos;
o.y = pos.w * 0.5f;
o.y = ( pos.y - o.y ) * _ProjectionParams.x * scale + o.y;
return o;
}
v2f vert ( appdata v )
{
v2f o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
UNITY_TRANSFER_INSTANCE_ID(v, o);
//Calculate new billboard vertex position and normal;
//float3 upCamVec = normalize ( UNITY_MATRIX_V._m10_m11_m12 );
//float3 forwardCamVec = -normalize ( UNITY_MATRIX_V._m20_m21_m22 );
//float3 rightCamVec = normalize( UNITY_MATRIX_V._m00_m01_m02 );
//float4x4 rotationCamMatrix = float4x4( rightCamVec, 0, upCamVec, 0, forwardCamVec, 0, 0, 0, 0, 1 );
//v.ase_normal = normalize( mul( float4( v.ase_normal , 0 ), rotationCamMatrix )).xyz;
//This unfortunately must be made to take non-uniform scaling into account;
//Transform to world coords, apply rotation and transform back to local;
v.vertex = mul( v.vertex , unity_ObjectToWorld );
//v.vertex = mul( v.vertex , rotationCamMatrix );
v.vertex = mul( v.vertex , unity_WorldToObject );
float4 ase_clipPos = UnityObjectToClipPos(v.vertex);
float4 screenPos = ComputeScreenPos(ase_clipPos);
o.ase_texcoord2 = screenPos;
o.ase_texcoord1.xy = v.ase_texcoord.xy;
o.ase_texcoord3 = v.vertex;
//setting value to unused interpolator channels and avoid initialization warnings
o.ase_texcoord1.zw = 0;
float3 vertexValue = float3(0, 0, 0);
#if ASE_ABSOLUTE_VERTEX_POS
vertexValue = v.vertex.xyz;
#endif
vertexValue = 0;
#if ASE_ABSOLUTE_VERTEX_POS
v.vertex.xyz = vertexValue;
#else
v.vertex.xyz += vertexValue;
#endif
o.vertex = UnityObjectToClipPos(v.vertex);
#ifdef ASE_NEEDS_FRAG_WORLD_POSITION
o.worldPos = mul(unity_ObjectToWorld, v.vertex).xyz;
#endif
return o;
}
fixed4 frag (v2f i ) : SV_Target
{
UNITY_SETUP_INSTANCE_ID(i);
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);
fixed4 finalColor;
#ifdef ASE_NEEDS_FRAG_WORLD_POSITION
float3 WorldPosition = i.worldPos;
#endif
float4 _Color_Instance = UNITY_ACCESS_INSTANCED_PROP(_Color_arr, _Color);
float3 appendResult33 = (float3(_Color_Instance.r , _Color_Instance.g , _Color_Instance.b));
float _HDR_Instance = UNITY_ACCESS_INSTANCED_PROP(_HDR_arr, _HDR);
float4 _MainTex_ST_Instance = UNITY_ACCESS_INSTANCED_PROP(_MainTex_ST_arr, _MainTex_ST);
float2 uv_MainTex = i.ase_texcoord1.xy * _MainTex_ST_Instance.xy + _MainTex_ST_Instance.zw;
float4 tex2DNode1 = tex2D( _MainTex, uv_MainTex );
float4 screenPos = i.ase_texcoord2;
float4 ase_grabScreenPos = ASE_ComputeGrabScreenPos( screenPos );
float4 ase_grabScreenPosNorm = ase_grabScreenPos / ase_grabScreenPos.w;
float2 appendResult34 = (float2(_TexTilling));
float alpha41 = _Color_Instance.a;
float clampResult20 = clamp( (0.0 + (distance( i.ase_texcoord3.xyz , float3( 0,0,0 ) ) - 0.0) * (1.0 - 0.0) / ((0.0 + (alpha41 - 0.0) * (10.0 - 0.0) / (1.0 - 0.0)) - 0.0)) , 0.0 , 1.0 );
float temp_output_15_0 = ( tex2D( _MaskTex, ( ase_grabScreenPosNorm * float4( appendResult34, 0.0 , 0.0 ) ).xy ).r * clampResult20 );
float3 lerpResult32 = lerp( ( appendResult33 * (1.0 + (_HDR_Instance - 0.0) * (20.0 - 1.0) / (2.0 - 0.0)) ) , (tex2DNode1).rgb , step( temp_output_15_0 , 0.3 ));
float4 appendResult27 = (float4(lerpResult32 , ( step( temp_output_15_0 , 0.5 ) * ( 1.0 - clampResult20 ) * (tex2DNode1).a )));
finalColor = appendResult27;
return finalColor;
}
ENDCG
}
}
CustomEditor "ASEMaterialInspector"
}
/*ASEBEGIN
Version=18707
-28;29;1318;595;2058.366;-443.6661;1.262017;True;True
Node;AmplifyShaderEditor.ColorNode;5;-1092.845,-226.2349;Inherit;False;InstancedProperty;_Color;Color;1;0;Create;True;0;0;False;0;False;1,1,1,1;0.1273585,0.5608922,1,1;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.RegisterLocalVarNode;41;-764.6649,-124.9044;Inherit;False;alpha;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.Vector2Node;36;-1418.797,431.5317;Inherit;False;Property;_TexTilling;TexTilling;4;0;Create;True;0;0;False;0;False;1,1;10,10;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
Node;AmplifyShaderEditor.GetLocalVarNode;42;-1421.048,761.694;Inherit;False;41;alpha;1;0;OBJECT;;False;1;FLOAT;0
Node;AmplifyShaderEditor.PosVertexDataNode;16;-1393.514,566.8544;Inherit;False;0;0;5;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.DynamicAppendNode;34;-1177.797,418.5317;Inherit;False;FLOAT2;4;0;FLOAT2;0,0;False;1;FLOAT;0.1;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT2;0
Node;AmplifyShaderEditor.TFHCRemapNode;37;-1166.797,737.5317;Inherit;False;5;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;3;FLOAT;0;False;4;FLOAT;10;False;1;FLOAT;0
Node;AmplifyShaderEditor.GrabScreenPosition;12;-1325.812,230.5982;Inherit;False;0;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.DistanceOpNode;17;-1174.414,572.9407;Inherit;False;2;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;1;FLOAT;0
Node;AmplifyShaderEditor.TFHCRemapNode;19;-929.3549,560.5959;Inherit;False;5;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;2;False;3;FLOAT;0;False;4;FLOAT;1;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;13;-1019.368,325.244;Inherit;False;2;2;0;FLOAT4;0,0,0,0;False;1;FLOAT2;0,0;False;1;FLOAT4;0
Node;AmplifyShaderEditor.SamplerNode;11;-845.5724,215.3896;Inherit;True;Property;_MaskTex;MaskTex;3;0;Create;True;0;0;False;0;False;-1;None;8e03b1d92a2014f488c688757d5c8eda;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.ClampOpNode;20;-675.0834,546.5779;Inherit;False;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;9;-831.1087,-8.089468;Inherit;False;InstancedProperty;_HDR;HDR;2;0;Create;True;0;0;False;0;False;0;0.68;0;2;0;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;15;-212.2623,263.6331;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.DynamicAppendNode;33;-134.1398,-191.2535;Inherit;False;FLOAT3;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT3;0
Node;AmplifyShaderEditor.SamplerNode;1;-805.3985,-616.6469;Inherit;True;Property;_MainTex;MainTex;0;0;Create;True;0;0;False;0;False;-1;None;aef88f95d1e7e734a805e97cf9166bfd;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.TFHCRemapNode;40;-510.6606,3.455167;Inherit;False;5;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;2;False;3;FLOAT;1;False;4;FLOAT;20;False;1;FLOAT;0
Node;AmplifyShaderEditor.StepOpNode;30;-27.0197,148.6525;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;0.3;False;1;FLOAT;0
Node;AmplifyShaderEditor.OneMinusNode;25;-340.0261,521.5587;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.ComponentMaskNode;29;-203.3298,39.23352;Inherit;False;False;False;False;True;1;0;COLOR;0,0,0,0;False;1;FLOAT;0
Node;AmplifyShaderEditor.ComponentMaskNode;31;-165.6952,-344.1174;Inherit;False;True;True;True;False;1;0;COLOR;0,0,0,0;False;1;FLOAT3;0
Node;AmplifyShaderEditor.StepOpNode;21;-30.78301,278.7083;Inherit;False;2;0;FLOAT;0;False;1;FLOAT;0.5;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;38;94.56425,-180.4531;Inherit;False;2;2;0;FLOAT3;0,0,0;False;1;FLOAT;0;False;1;FLOAT3;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;24;168.9034,268.3773;Inherit;False;3;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.LerpOp;32;224.1391,-126.3741;Inherit;False;3;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;2;FLOAT;0;False;1;FLOAT3;0
Node;AmplifyShaderEditor.BillboardNode;2;-33.52745,932.0913;Inherit;False;Spherical;False;0;1;FLOAT3;0
Node;AmplifyShaderEditor.DynamicAppendNode;27;398.3418,3.763906;Inherit;False;FLOAT4;4;0;FLOAT3;0,0,0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT4;0
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;0;660.3832,-113.132;Float;False;True;-1;2;ASEMaterialInspector;100;1;X1_spine/dead;0770190933193b94aaa3065e307002fa;True;Unlit;0;0;Unlit;2;True;2;5;False;-1;10;False;-1;0;1;False;-1;0;False;-1;True;0;False;-1;0;False;-1;False;False;False;False;False;False;True;0;False;-1;True;2;False;-1;True;True;True;True;True;0;False;-1;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;True;2;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;2;RenderType=Transparent=RenderType;Queue=Transparent=Queue=0;True;2;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;1;LightMode=ForwardBase;False;0;;0;0;Standard;1;Vertex Position,InvertActionOnDeselection;1;0;1;True;False;;False;0
WireConnection;41;0;5;4
WireConnection;34;0;36;0
WireConnection;37;0;42;0
WireConnection;17;0;16;0
WireConnection;19;0;17;0
WireConnection;19;2;37;0
WireConnection;13;0;12;0
WireConnection;13;1;34;0
WireConnection;11;1;13;0
WireConnection;20;0;19;0
WireConnection;15;0;11;1
WireConnection;15;1;20;0
WireConnection;33;0;5;1
WireConnection;33;1;5;2
WireConnection;33;2;5;3
WireConnection;40;0;9;0
WireConnection;30;0;15;0
WireConnection;25;0;20;0
WireConnection;29;0;1;0
WireConnection;31;0;1;0
WireConnection;21;0;15;0
WireConnection;38;0;33;0
WireConnection;38;1;40;0
WireConnection;24;0;21;0
WireConnection;24;1;25;0
WireConnection;24;2;29;0
WireConnection;32;0;38;0
WireConnection;32;1;31;0
WireConnection;32;2;30;0
WireConnection;27;0;32;0
WireConnection;27;3;24;0
WireConnection;0;0;27;0
WireConnection;0;1;2;0
ASEEND*/
//CHKSM=851D98685D391736D701F3519DC6904F258273D9

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 3a86f8eb512222b42bb3b4bc35508a13
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant: