This commit is contained in:
2025-04-03 02:30:16 +08:00
parent 142adb61c6
commit bee7af1732
14907 changed files with 1009130 additions and 13 deletions

View File

@ -0,0 +1,757 @@
Shader /*ase_name*/ "Hidden/Universal/2D Custom Lit" /*end*/
{
Properties
{
/*ase_props*/
[HideInInspector][NoScaleOffset] unity_Lightmaps("unity_Lightmaps", 2DArray) = "" {}
[HideInInspector][NoScaleOffset] unity_LightmapsInd("unity_LightmapsInd", 2DArray) = "" {}
[HideInInspector][NoScaleOffset] unity_ShadowMasks("unity_ShadowMasks", 2DArray) = "" {}
}
SubShader
{
/*ase_subshader_options:Name=Additional Options
Option:Vertex Position:Absolute,Relative:Relative
Absolute:SetDefine:ASE_ABSOLUTE_VERTEX_POS 1
Absolute:SetPortName:Sprite Lit:4,Vertex Position
Relative:RemoveDefine:ASE_ABSOLUTE_VERTEX_POS 1
Relative:SetPortName:Sprite Lit:4,Vertex Offset
Option:Debug Display:false,true:false
true:SetDefine:pragma multi_compile _ DEBUG_DISPLAY
false,disable:RemoveDefine:pragma multi_compile _ DEBUG_DISPLAY
*/
Tags
{
"RenderPipeline"="UniversalPipeline"
"RenderType"="Transparent"
"UniversalMaterialType" = "Lit"
"Queue"="Transparent"
"ShaderGraphShader"="true"
"ShaderGraphTargetId"=""
}
Cull Off
Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha
ZTest LEqual
ZWrite Off
Offset 0,0
ColorMask RGBA
/*ase_stencil*/
HLSLINCLUDE
#pragma target 2.0
#pragma prefer_hlslcc gles
#pragma exclude_renderers d3d9 // ensure rendering platforms toggle list is visible
ENDHLSL
/*ase_pass*/
Pass
{
/*ase_hide_pass*/
Name "Sprite Lit"
Tags
{
"LightMode" = "Universal2D"
}
HLSLPROGRAM
#pragma vertex vert
#pragma fragment frag
#define _SURFACE_TYPE_TRANSPARENT 1
#define ATTRIBUTES_NEED_NORMAL
#define ATTRIBUTES_NEED_TANGENT
#define ATTRIBUTES_NEED_TEXCOORD0
#define ATTRIBUTES_NEED_COLOR
#define VARYINGS_NEED_POSITION_WS
#define VARYINGS_NEED_TEXCOORD0
#define VARYINGS_NEED_COLOR
#define VARYINGS_NEED_SCREENPOSITION
#define FEATURES_GRAPH_VERTEX
#define SHADERPASS SHADERPASS_SPRITELIT
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
/*ase_unity_cond_begin:>=20220316*/
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl"
/*ase_unity_cond_end*/
/*ase_unity_cond_begin:>=20220316*/
#if ASE_SRP_VERSION >=140009
#include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
#endif
/*ase_unity_cond_end*/
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/SurfaceData2D.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Debug/Debugging2D.hlsl"
/*ase_pragma*/
struct VertexInput
{
float3 positionOS : POSITION;
float3 normal : NORMAL;
float4 tangent : TANGENT;
float4 uv0 : TEXCOORD0;
float4 color : COLOR;
/*ase_vdata:p=p;n=n;t=t;c=c;uv0=tc0*/
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct VertexOutput
{
float4 positionCS : SV_POSITION;
float4 texCoord0 : TEXCOORD0;
float3 positionWS : TEXCOORD1;
float4 color : TEXCOORD2;
float4 screenPosition : TEXCOORD3;
/*ase_interp(4,):sp=sp;uv0=tc0;wp=tc1;c=tc2;spn=tc3*/
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
};
struct SurfaceDescription
{
float3 BaseColor;
float Alpha;
};
half4 _RendererColor;
/*ase_globals*/
/*ase_funcs*/
VertexOutput vert( VertexInput v /*ase_vert_input*/ )
{
VertexOutput o;
ZERO_INITIALIZE(VertexOutput, o);
UNITY_SETUP_INSTANCE_ID(v);
UNITY_TRANSFER_INSTANCE_ID(v, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
/*ase_vert_code:v=VertexInput;o=VertexOutput*/
#ifdef ASE_ABSOLUTE_VERTEX_POS
float3 defaultVertexValue = v.positionOS.xyz;
#else
float3 defaultVertexValue = float3(0, 0, 0);
#endif
float3 vertexValue = /*ase_vert_out:Vertex Offset;Float3;2;-1;_Vertex*/defaultVertexValue/*end*/;
#ifdef ASE_ABSOLUTE_VERTEX_POS
v.positionOS.xyz = vertexValue;
#else
v.positionOS.xyz += vertexValue;
#endif
v.normal = /*ase_vert_out:Vertex Normal;Float3;3;-1;_VNormal*/v.normal/*end*/;
v.tangent.xyz = /*ase_vert_out:Vertex Tangent;Float3;4;-1;_VTangent*/v.tangent.xyz/*end*/;
VertexPositionInputs vertexInput = GetVertexPositionInputs(v.positionOS.xyz);
o.positionCS = vertexInput.positionCS;
o.positionWS.xyz = vertexInput.positionWS;
o.texCoord0.xyzw = v.uv0;
o.color.xyzw = v.color;
o.screenPosition.xyzw = vertexInput.positionNDC;
return o;
}
half4 frag( VertexOutput IN /*ase_frag_input*/ ) : SV_TARGET
{
UNITY_SETUP_INSTANCE_ID(IN);
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN);
/*ase_frag_code:IN=VertexOutput*/
SurfaceDescription surfaceDescription = (SurfaceDescription)0;
surfaceDescription.BaseColor = /*ase_frag_out:Color;Float3;0;-1;_Color*/IsGammaSpace() ? float3(0.5, 0.5, 0.5) : SRGBToLinear(float3(0.5, 0.5, 0.5))/*end*/;
surfaceDescription.Alpha = /*ase_frag_out:Alpha;Float;1;-1;_Alpha*/1/*end*/;
half4 color = half4(surfaceDescription.BaseColor, surfaceDescription.Alpha);
#if defined(DEBUG_DISPLAY)
SurfaceData2D surfaceData;
InitializeSurfaceData(color.rgb, color.a, surfaceData);
InputData2D inputData;
InitializeInputData(IN.positionWS.xy, half2(IN.texCoord0.xy), inputData);
half4 debugColor = 0;
SETUP_DEBUG_DATA_2D(inputData, IN.positionWS);
if (CanDebugOverrideOutputColor(surfaceData, inputData, debugColor))
{
return debugColor;
}
#endif
color *= IN.color * _RendererColor;
return color;
}
ENDHLSL
}
/*ase_pass*/
Pass
{
/*ase_hide_pass*/
Name "Sprite Normal"
Tags
{
"LightMode" = "NormalsRendering"
}
HLSLPROGRAM
#pragma vertex vert
#pragma fragment frag
#define _SURFACE_TYPE_TRANSPARENT 1
#define ATTRIBUTES_NEED_NORMAL
#define ATTRIBUTES_NEED_TANGENT
#define VARYINGS_NEED_NORMAL_WS
#define VARYINGS_NEED_TANGENT_WS
#define FEATURES_GRAPH_VERTEX
#define SHADERPASS SHADERPASS_SPRITENORMAL
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
/*ase_unity_cond_begin:>=20220316*/
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl"
/*ase_unity_cond_end*/
/*ase_unity_cond_begin:>=20220316*/
#if ASE_SRP_VERSION >=140009
#include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
#endif
/*ase_unity_cond_end*/
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/NormalsRenderingShared.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
/*ase_pragma*/
/*ase_globals*/
struct VertexInput
{
float3 positionOS : POSITION;
float3 normal : NORMAL;
float4 tangent : TANGENT;
/*ase_vdata:p=p;n=n;t=t*/
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct VertexOutput
{
float4 positionCS : SV_POSITION;
float3 normalWS : TEXCOORD0;
float4 tangentWS : TEXCOORD1;
/*ase_interp(2,):sp=sp;wn=tc0;wt=tc1*/
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
};
struct SurfaceDescription
{
float3 NormalTS;
float Alpha;
};
/*ase_funcs*/
VertexOutput vert( VertexInput v /*ase_vert_input*/ )
{
VertexOutput o;
ZERO_INITIALIZE(VertexOutput, o);
UNITY_SETUP_INSTANCE_ID(v);
UNITY_TRANSFER_INSTANCE_ID(v, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
/*ase_vert_code:v=VertexInput;o=VertexOutput*/
#ifdef ASE_ABSOLUTE_VERTEX_POS
float3 defaultVertexValue = v.positionOS.xyz;
#else
float3 defaultVertexValue = float3(0, 0, 0);
#endif
float3 vertexValue = /*ase_vert_out:Vertex Offset;Float3;2;-1;_Vertex*/defaultVertexValue/*end*/;
#ifdef ASE_ABSOLUTE_VERTEX_POS
v.positionOS.xyz = vertexValue;
#else
v.positionOS.xyz += vertexValue;
#endif
v.normal = /*ase_vert_out:Vertex Normal;Float3;3;-1;_VNormal*/v.normal/*end*/;
v.tangent.xyz = /*ase_vert_out:Vertex Tangent;Float3;4;-1;_VTangent*/v.tangent.xyz/*end*/;
float3 positionWS = TransformObjectToWorld(v.positionOS);
float4 tangentWS = float4(TransformObjectToWorldDir(v.tangent.xyz), v.tangent.w);
o.positionCS = TransformWorldToHClip(positionWS);
o.normalWS.xyz = -GetViewForwardDir();
o.tangentWS.xyzw = tangentWS;
return o;
}
half4 frag( VertexOutput IN /*ase_frag_input*/ ) : SV_TARGET
{
UNITY_SETUP_INSTANCE_ID(IN);
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN);
/*ase_frag_code:IN=VertexOutput*/
SurfaceDescription surfaceDescription = (SurfaceDescription)0;
surfaceDescription.NormalTS = /*ase_frag_out:Normal;Float3;0;-1;_Normal*/float3(0.0f, 0.0f, 1.0f)/*end*/;
surfaceDescription.Alpha = /*ase_frag_out:Alpha;Float;1;-1;_Alpha*/1/*end*/;
half crossSign = (IN.tangentWS.w > 0.0 ? 1.0 : -1.0) * GetOddNegativeScale();
half3 bitangent = crossSign * cross(IN.normalWS.xyz, IN.tangentWS.xyz);
half4 color = half4(1.0,1.0,1.0, surfaceDescription.Alpha);
return NormalsRenderingShared(color, surfaceDescription.NormalTS, IN.tangentWS.xyz, bitangent, IN.normalWS);
}
ENDHLSL
}
/*ase_pass*/
Pass
{
/*ase_hide_pass*/
Name "SceneSelectionPass"
Tags
{
"LightMode" = "SceneSelectionPass"
}
Cull Off
Blend Off
ZTest LEqual
ZWrite On
HLSLPROGRAM
#pragma vertex vert
#pragma fragment frag
#define _SURFACE_TYPE_TRANSPARENT 1
#define ATTRIBUTES_NEED_NORMAL
#define ATTRIBUTES_NEED_TANGENT
#define FEATURES_GRAPH_VERTEX
#define SHADERPASS SHADERPASS_DEPTHONLY
#define SCENESELECTIONPASS 1
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
/*ase_unity_cond_begin:>=20220316*/
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl"
/*ase_unity_cond_end*/
/*ase_unity_cond_begin:>=20220316*/
#if ASE_SRP_VERSION >=140009
#include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
#endif
/*ase_unity_cond_end*/
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
/*ase_pragma*/
/*ase_globals*/
struct VertexInput
{
float3 positionOS : POSITION;
float3 normal : NORMAL;
float4 tangent : TANGENT;
/*ase_vdata:p=p;n=n;t=t*/
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct VertexOutput
{
float4 positionCS : SV_POSITION;
/*ase_interp(0,):sp=sp*/
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
};
int _ObjectId;
int _PassValue;
struct SurfaceDescription
{
float Alpha;
};
/*ase_funcs*/
VertexOutput vert(VertexInput v /*ase_vert_input*/)
{
VertexOutput o;
ZERO_INITIALIZE(VertexOutput, o);
UNITY_SETUP_INSTANCE_ID(v);
UNITY_TRANSFER_INSTANCE_ID(v, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
/*ase_vert_code:v=VertexInput;o=VertexOutput*/
#ifdef ASE_ABSOLUTE_VERTEX_POS
float3 defaultVertexValue = v.positionOS.xyz;
#else
float3 defaultVertexValue = float3(0, 0, 0);
#endif
float3 vertexValue = /*ase_vert_out:Vertex Offset;Float3;1;-1;_Vertex*/defaultVertexValue/*end*/;
#ifdef ASE_ABSOLUTE_VERTEX_POS
v.positionOS.xyz = vertexValue;
#else
v.positionOS.xyz += vertexValue;
#endif
float3 positionWS = TransformObjectToWorld(v.positionOS);
o.positionCS = TransformWorldToHClip(positionWS);
return o;
}
half4 frag(VertexOutput IN/*ase_frag_input*/) : SV_TARGET
{
UNITY_SETUP_INSTANCE_ID(IN);
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN);
/*ase_frag_code:IN=VertexOutput*/
SurfaceDescription surfaceDescription = (SurfaceDescription)0;
surfaceDescription.Alpha = /*ase_frag_out:Alpha;Float;0;-1;_Alpha*/1/*end*/;
#if _ALPHATEST_ON
float alphaClipThreshold = 0.01f;
#if ALPHA_CLIP_THRESHOLD
alphaClipThreshold = surfaceDescription.AlphaClipThreshold;
#endif
clip(surfaceDescription.Alpha - alphaClipThreshold);
#endif
half4 outColor = half4(_ObjectId, _PassValue, 1.0, 1.0);
return outColor;
}
ENDHLSL
}
/*ase_pass*/
Pass
{
/*ase_hide_pass*/
Name "ScenePickingPass"
Tags
{
"LightMode" = "Picking"
}
Cull Off
Blend Off
ZTest LEqual
ZWrite On
HLSLPROGRAM
#pragma vertex vert
#pragma fragment frag
#define _SURFACE_TYPE_TRANSPARENT 1
#define ATTRIBUTES_NEED_NORMAL
#define ATTRIBUTES_NEED_TANGENT
#define FEATURES_GRAPH_VERTEX
#define SHADERPASS SHADERPASS_DEPTHONLY
#define SCENEPICKINGPASS 1
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
/*ase_unity_cond_begin:>=20220316*/
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl"
/*ase_unity_cond_end*/
/*ase_unity_cond_begin:>=20220316*/
#if ASE_SRP_VERSION >=140009
#include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
#endif
/*ase_unity_cond_end*/
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
/*ase_pragma*/
/*ase_globals*/
struct VertexInput
{
float3 positionOS : POSITION;
float3 normal : NORMAL;
float4 tangent : TANGENT;
/*ase_vdata:p=p;n=n;t=t*/
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct VertexOutput
{
float4 positionCS : SV_POSITION;
/*ase_interp(0,):sp=sp*/
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
};
float4 _SelectionID;
struct SurfaceDescription
{
float Alpha;
};
/*ase_funcs*/
VertexOutput vert(VertexInput v /*ase_vert_input*/ )
{
VertexOutput o;
ZERO_INITIALIZE(VertexOutput, o);
UNITY_SETUP_INSTANCE_ID(v);
UNITY_TRANSFER_INSTANCE_ID(v, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
/*ase_vert_code:v=VertexInput;o=VertexOutput*/
#ifdef ASE_ABSOLUTE_VERTEX_POS
float3 defaultVertexValue = v.positionOS.xyz;
#else
float3 defaultVertexValue = float3(0, 0, 0);
#endif
float3 vertexValue = /*ase_vert_out:Vertex Offset;Float3;1;-1;_Vertex*/defaultVertexValue/*end*/;
#ifdef ASE_ABSOLUTE_VERTEX_POS
v.positionOS.xyz = vertexValue;
#else
v.positionOS.xyz += vertexValue;
#endif
float3 positionWS = TransformObjectToWorld(v.positionOS);
o.positionCS = TransformWorldToHClip(positionWS);
return o;
}
half4 frag(VertexOutput IN /*ase_frag_input*/) : SV_TARGET
{
UNITY_SETUP_INSTANCE_ID(IN);
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN);
/*ase_frag_code:IN=VertexOutput*/
SurfaceDescription surfaceDescription = (SurfaceDescription)0;
surfaceDescription.Alpha = /*ase_frag_out:Alpha;Float;0;-1;_Alpha*/1/*end*/;
#if _ALPHATEST_ON
float alphaClipThreshold = 0.01f;
#if ALPHA_CLIP_THRESHOLD
alphaClipThreshold = surfaceDescription.AlphaClipThreshold;
#endif
clip(surfaceDescription.Alpha - alphaClipThreshold);
#endif
half4 outColor = _SelectionID;
return outColor;
}
ENDHLSL
}
/*ase_pass*/
Pass
{
/*ase_main_pass*/
Name "Sprite Forward"
Tags
{
"LightMode" = "UniversalForward"
}
HLSLPROGRAM
#pragma vertex vert
#pragma fragment frag
#define _SURFACE_TYPE_TRANSPARENT 1
#define ATTRIBUTES_NEED_NORMAL
#define ATTRIBUTES_NEED_TANGENT
#define ATTRIBUTES_NEED_TEXCOORD0
#define ATTRIBUTES_NEED_COLOR
#define VARYINGS_NEED_POSITION_WS
#define VARYINGS_NEED_TEXCOORD0
#define VARYINGS_NEED_COLOR
#define FEATURES_GRAPH_VERTEX
#define SHADERPASS SHADERPASS_SPRITEFORWARD
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
/*ase_unity_cond_begin:>=20220316*/
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl"
/*ase_unity_cond_end*/
/*ase_unity_cond_begin:>=20220316*/
#if ASE_SRP_VERSION >=140009
#include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
#endif
/*ase_unity_cond_end*/
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/SurfaceData2D.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Debug/Debugging2D.hlsl"
/*ase_pragma*/
/*ase_globals*/
struct VertexInput
{
float3 positionOS : POSITION;
float3 normal : NORMAL;
float4 tangent : TANGENT;
float4 uv0 : TEXCOORD0;
float4 color : COLOR;
/*ase_vdata:p=p;n=n;t=t;c=c;uv0=tc0*/
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct VertexOutput
{
float4 positionCS : SV_POSITION;
float4 texCoord0 : TEXCOORD0;
float3 positionWS : TEXCOORD1;
float4 color : TEXCOORD2;
/*ase_interp(3,):sp=sp;uv0=tc0;wp=tc1;c=tc2*/
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
};
struct SurfaceDescription
{
float3 BaseColor;
float Alpha;
float3 NormalTS;
};
/*ase_funcs*/
VertexOutput vert( VertexInput v /*ase_vert_input*/ )
{
VertexOutput o;
ZERO_INITIALIZE(VertexOutput, o);
UNITY_SETUP_INSTANCE_ID(v);
UNITY_TRANSFER_INSTANCE_ID(v, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
/*ase_vert_code:v=VertexInput;o=VertexOutput*/
#ifdef ASE_ABSOLUTE_VERTEX_POS
float3 defaultVertexValue = v.positionOS.xyz;
#else
float3 defaultVertexValue = float3( 0, 0, 0 );
#endif
float3 vertexValue = /*ase_vert_out:Vertex Offset;Float3;3;-1;_Vertex*/defaultVertexValue/*end*/;
#ifdef ASE_ABSOLUTE_VERTEX_POS
v.positionOS.xyz = vertexValue;
#else
v.positionOS.xyz += vertexValue;
#endif
v.normal = /*ase_vert_out:Vertex Normal;Float3;4;-1;_VNormal*/v.normal/*end*/;
v.tangent.xyz = /*ase_vert_out:Vertex Tangent;Float3;5;-1;_VTangent*/v.tangent.xyz/*end*/;
float3 positionWS = TransformObjectToWorld(v.positionOS);
o.positionCS = TransformWorldToHClip(positionWS);
o.positionWS.xyz = positionWS;
o.texCoord0.xyzw = v.uv0;
o.color.xyzw = v.color;
return o;
}
half4 frag( VertexOutput IN /*ase_frag_input*/ ) : SV_TARGET
{
UNITY_SETUP_INSTANCE_ID(IN);
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN);
/*ase_frag_code:IN=VertexOutput*/
SurfaceDescription surfaceDescription = (SurfaceDescription)0;
surfaceDescription.BaseColor = /*ase_frag_out:Color;Float3;0;-1;_Color*/IsGammaSpace() ? float3(0.5, 0.5, 0.5) : SRGBToLinear(float3(0.5, 0.5, 0.5))/*end*/;
surfaceDescription.NormalTS = /*ase_frag_out:Normal;Float3;1;-1;_Normal*/float3(0.0f, 0.0f, 1.0f)/*end*/;
surfaceDescription.Alpha = /*ase_frag_out:Alpha;Float;2;-1;_Alpha*/1/*end*/;
half4 color = half4(surfaceDescription.BaseColor, surfaceDescription.Alpha);
#if defined(DEBUG_DISPLAY)
SurfaceData2D surfaceData;
InitializeSurfaceData(color.rgb, color.a, surfaceData);
InputData2D inputData;
InitializeInputData(IN.positionWS.xy, half2(IN.texCoord0.xy), inputData);
half4 debugColor = 0;
SETUP_DEBUG_DATA_2D(inputData, IN.positionWS);
if (CanDebugOverrideOutputColor(surfaceData, inputData, debugColor))
{
return debugColor;
}
#endif
color *= IN.color;
return color;
}
ENDHLSL
}
/*ase_pass_end*/
}
CustomEditor "UnityEditor.ShaderGraph.GenericShaderGraphMaterialGUI"
FallBack "Hidden/Shader Graph/FallbackError"
}

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: ece0159bad6633944bf6b818f4dd296c
timeCreated: 1639679966
licenseType: Pro
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,756 @@
Shader /*ase_name*/ "Hidden/Universal/2D Lit" /*end*/
{
Properties
{
/*ase_props*/
[HideInInspector][NoScaleOffset] unity_Lightmaps("unity_Lightmaps", 2DArray) = "" {}
[HideInInspector][NoScaleOffset] unity_LightmapsInd("unity_LightmapsInd", 2DArray) = "" {}
[HideInInspector][NoScaleOffset] unity_ShadowMasks("unity_ShadowMasks", 2DArray) = "" {}
}
SubShader
{
/*ase_subshader_options:Name=Additional Options
Option:Vertex Position:Absolute,Relative:Relative
Absolute:SetDefine:ASE_ABSOLUTE_VERTEX_POS 1
Absolute:SetPortName:Sprite Lit:4,Vertex Position
Relative:RemoveDefine:ASE_ABSOLUTE_VERTEX_POS 1
Relative:SetPortName:Sprite Lit:4,Vertex Offset
Option:Debug Display:false,true:false
true:SetDefine:pragma multi_compile _ DEBUG_DISPLAY
false,disable:RemoveDefine:pragma multi_compile _ DEBUG_DISPLAY
Option:External Alpha:false,true:false
true:SetDefine:pragma multi_compile _ ETC1_EXTERNAL_ALPHA
false,disable:RemoveDefine:pragma multi_compile _ ETC1_EXTERNAL_ALPHA
*/
Tags
{
"RenderPipeline" = "UniversalPipeline"
"RenderType" = "Transparent"
"Queue" = "Transparent+0"
"UniversalMaterialType" = "Lit"
"ShaderGraphShader"="true"
"ShaderGraphTargetId"=""
}
Cull Off
HLSLINCLUDE
#pragma target 2.0
#pragma prefer_hlslcc gles
#pragma exclude_renderers d3d9 // ensure rendering platforms toggle list is visible
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Filtering.hlsl"
ENDHLSL
/*ase_pass*/
Pass
{
Name "Sprite Lit"
Tags
{
"LightMode" = "Universal2D"
}
Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha
ZTest LEqual
ZWrite Off
Offset 0,0
ColorMask RGBA
/*ase_stencil*/
HLSLPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma multi_compile _ USE_SHAPE_LIGHT_TYPE_0
#pragma multi_compile _ USE_SHAPE_LIGHT_TYPE_1
#pragma multi_compile _ USE_SHAPE_LIGHT_TYPE_2
#pragma multi_compile _ USE_SHAPE_LIGHT_TYPE_3
#define _SURFACE_TYPE_TRANSPARENT 1
#define ATTRIBUTES_NEED_NORMAL
#define ATTRIBUTES_NEED_TANGENT
#define ATTRIBUTES_NEED_TEXCOORD0
#define ATTRIBUTES_NEED_COLOR
#define VARYINGS_NEED_POSITION_WS
#define VARYINGS_NEED_TEXCOORD0
#define VARYINGS_NEED_COLOR
#define VARYINGS_NEED_SCREENPOSITION
#define FEATURES_GRAPH_VERTEX
#define SHADERPASS SHADERPASS_SPRITELIT
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
/*ase_unity_cond_begin:>=20220316*/
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl"
/*ase_unity_cond_end*/
/*ase_unity_cond_begin:>=20220316*/
#if ASE_SRP_VERSION >=140009
#include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
#endif
/*ase_unity_cond_end*/
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/LightingUtility.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/SurfaceData2D.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Debug/Debugging2D.hlsl"
#if USE_SHAPE_LIGHT_TYPE_0
SHAPE_LIGHT(0)
#endif
#if USE_SHAPE_LIGHT_TYPE_1
SHAPE_LIGHT(1)
#endif
#if USE_SHAPE_LIGHT_TYPE_2
SHAPE_LIGHT(2)
#endif
#if USE_SHAPE_LIGHT_TYPE_3
SHAPE_LIGHT(3)
#endif
#include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/CombinedShapeLightShared.hlsl"
/*ase_pragma*/
/*ase_globals*/
struct VertexInput
{
float4 positionOS : POSITION;
float3 normal : NORMAL;
float4 tangent : TANGENT;
float4 uv0 : TEXCOORD0;
float4 color : COLOR;
/*ase_vdata:p=p;n=n;t=t;c=c;uv0=tc0*/
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct VertexOutput
{
float4 positionCS : SV_POSITION;
float4 texCoord0 : TEXCOORD0;
float4 color : TEXCOORD1;
float4 screenPosition : TEXCOORD2;
float3 positionWS : TEXCOORD3;
/*ase_interp(4,):sp=sp;uv0=tc0;*/
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
};
#if ETC1_EXTERNAL_ALPHA
TEXTURE2D(_AlphaTex); SAMPLER(sampler_AlphaTex);
float _EnableAlphaTexture;
#endif
/*ase_funcs*/
VertexOutput vert( VertexInput v /*ase_vert_input*/ )
{
VertexOutput o = (VertexOutput)0;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_TRANSFER_INSTANCE_ID(v, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
/*ase_vert_code:v=VertexInput;o=VertexOutput*/
#ifdef ASE_ABSOLUTE_VERTEX_POS
float3 defaultVertexValue = v.positionOS.xyz;
#else
float3 defaultVertexValue = float3(0, 0, 0);
#endif
float3 vertexValue = /*ase_vert_out:Vertex Offset;Float3;4;-1;_Vertex*/defaultVertexValue/*end*/;
#ifdef ASE_ABSOLUTE_VERTEX_POS
v.positionOS.xyz = vertexValue;
#else
v.positionOS.xyz += vertexValue;
#endif
v.normal = /*ase_vert_out:Vertex Normal;Float3;5;-1;_VNormal*/v.normal/*end*/;
v.tangent.xyz = /*ase_vert_out:Vertex Tangent;Float3;6;-1;_VTangent*/v.tangent.xyz/*end*/;
VertexPositionInputs vertexInput = GetVertexPositionInputs(v.positionOS.xyz);
o.positionCS = vertexInput.positionCS;
o.positionWS = vertexInput.positionWS;
o.texCoord0 = v.uv0;
o.color = v.color;
o.screenPosition = vertexInput.positionNDC;
return o;
}
half4 frag( VertexOutput IN /*ase_frag_input*/ ) : SV_Target
{
UNITY_SETUP_INSTANCE_ID(IN);
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN);
/*ase_local_var:wp*/float3 positionWS = IN.positionWS.xyz;
/*ase_frag_code:IN=VertexOutput*/
float4 Color = /*ase_frag_out:Color;Float4;1;-1;_Color*/float4( 1, 1, 1, 1 )/*end*/;
float4 Mask = /*ase_frag_out:Mask;Float4;2;-1;_Mask*/float4(1,1,1,1)/*end*/;
float3 Normal = /*ase_frag_out:Normal;Float3;3;-1;_Normal*/float3( 0, 0, 1 )/*end*/;
#if ETC1_EXTERNAL_ALPHA
float4 alpha = SAMPLE_TEXTURE2D(_AlphaTex, sampler_AlphaTex, IN.texCoord0.xy);
Color.a = lerp( Color.a, alpha.r, _EnableAlphaTexture);
#endif
SurfaceData2D surfaceData;
InitializeSurfaceData(Color.rgb, Color.a, Mask, surfaceData);
InputData2D inputData;
InitializeInputData(IN.texCoord0.xy, half2(IN.screenPosition.xy / IN.screenPosition.w), inputData);
SETUP_DEBUG_DATA_2D(inputData, positionWS);
return CombinedShapeLightShared(surfaceData, inputData);
Color *= IN.color;
}
ENDHLSL
}
/*ase_pass*/
Pass
{
/*ase_hide_pass:SyncP*/
Name "Sprite Normal"
Tags
{
"LightMode" = "NormalsRendering"
}
Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha
ZTest LEqual
ZWrite Off
Offset 0,0
ColorMask RGBA
/*ase_stencil*/
HLSLPROGRAM
#pragma vertex vert
#pragma fragment frag
#define _SURFACE_TYPE_TRANSPARENT 1
#define ATTRIBUTES_NEED_NORMAL
#define ATTRIBUTES_NEED_TANGENT
#define VARYINGS_NEED_NORMAL_WS
#define VARYINGS_NEED_TANGENT_WS
#define FEATURES_GRAPH_VERTEX
#define SHADERPASS SHADERPASS_SPRITENORMAL
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
/*ase_unity_cond_begin:>=20220316*/
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl"
/*ase_unity_cond_end*/
/*ase_unity_cond_begin:>=20220316*/
#if ASE_SRP_VERSION >=140009
#include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
#endif
/*ase_unity_cond_end*/
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/NormalsRenderingShared.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
/*ase_pragma*/
/*ase_globals*/
struct VertexInput
{
float4 positionOS : POSITION;
float3 normal : NORMAL;
float4 tangent : TANGENT;
float4 uv0 : TEXCOORD0;
float4 color : COLOR;
/*ase_vdata:p=p;n=n;t=t;c=c;uv0=tc0*/
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct VertexOutput
{
float4 positionCS : SV_POSITION;
float4 texCoord0 : TEXCOORD0;
float4 color : TEXCOORD1;
float3 normalWS : TEXCOORD2;
float4 tangentWS : TEXCOORD3;
float3 bitangentWS : TEXCOORD4;
/*ase_interp(5,):sp=sp;uv0=tc0;c=tc1;wn=tc2;wt=tc3;wbt=tc4*/
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
};
/*ase_funcs*/
VertexOutput vert( VertexInput v /*ase_vert_input*/ )
{
VertexOutput o = (VertexOutput)0;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_TRANSFER_INSTANCE_ID(v, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
/*ase_vert_code:v=VertexInput;o=VertexOutput*/
#ifdef ASE_ABSOLUTE_VERTEX_POS
float3 defaultVertexValue = v.positionOS.xyz;
#else
float3 defaultVertexValue = float3(0, 0, 0);
#endif
float3 vertexValue = /*ase_vert_out:Vertex Offset;Float3;3;-1;_Vertex*/defaultVertexValue/*end*/;
#ifdef ASE_ABSOLUTE_VERTEX_POS
v.positionOS.xyz = vertexValue;
#else
v.positionOS.xyz += vertexValue;
#endif
v.normal = /*ase_vert_out:Vertex Normal;Float3;4;-1;_VNormal*/v.normal/*end*/;
v.tangent.xyz = /*ase_vert_out:Vertex Tangent;Float3;5;-1;_VTangent*/v.tangent.xyz/*end*/;
VertexPositionInputs vertexInput = GetVertexPositionInputs(v.positionOS.xyz);
o.texCoord0 = v.uv0;
o.color = v.color;
o.positionCS = vertexInput.positionCS;
float3 normalWS = TransformObjectToWorldNormal(v.normal);
o.normalWS = -GetViewForwardDir();
float4 tangentWS = float4( TransformObjectToWorldDir(v.tangent.xyz), v.tangent.w);
o.tangentWS = normalize(tangentWS);
half crossSign = (tangentWS.w > 0.0 ? 1.0 : -1.0) * GetOddNegativeScale();
o.bitangentWS = crossSign * cross(normalWS, tangentWS.xyz) * tangentWS.w;
return o;
}
half4 frag( VertexOutput IN /*ase_frag_input*/ ) : SV_Target
{
UNITY_SETUP_INSTANCE_ID(IN);
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN);
/*ase_frag_code:IN=VertexOutput*/
float4 Color = /*ase_frag_out:Color;Float4;1;-1;_Color*/float4( 1, 1, 1, 1 )/*end*/;
float3 Normal = /*ase_frag_out:Normal;Float3;2;-1;_Normal*/float3( 0, 0, 1 )/*end*/;
Color *= IN.color;
return NormalsRenderingShared(Color, Normal, IN.tangentWS.xyz, IN.bitangentWS, IN.normalWS);
}
ENDHLSL
}
/*ase_pass*/
Pass
{
/*ase_hide_pass:SyncP*/
Name "Sprite Forward"
Tags
{
"LightMode" = "UniversalForward"
}
Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha
ZTest LEqual
ZWrite Off
Offset 0,0
ColorMask RGBA
/*ase_stencil*/
HLSLPROGRAM
#pragma vertex vert
#pragma fragment frag
#define _SURFACE_TYPE_TRANSPARENT 1
#define ATTRIBUTES_NEED_NORMAL
#define ATTRIBUTES_NEED_TANGENT
#define ATTRIBUTES_NEED_TEXCOORD0
#define ATTRIBUTES_NEED_COLOR
#define VARYINGS_NEED_POSITION_WS
#define VARYINGS_NEED_TEXCOORD0
#define VARYINGS_NEED_COLOR
#define FEATURES_GRAPH_VERTEX
#define SHADERPASS SHADERPASS_SPRITEFORWARD
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
/*ase_unity_cond_begin:>=20220316*/
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl"
/*ase_unity_cond_end*/
/*ase_unity_cond_begin:>=20220316*/
#if ASE_SRP_VERSION >=140009
#include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
#endif
/*ase_unity_cond_end*/
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/SurfaceData2D.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Debug/Debugging2D.hlsl"
/*ase_pragma*/
/*ase_globals*/
struct VertexInput
{
float4 positionOS : POSITION;
float3 normal : NORMAL;
float4 tangent : TANGENT;
float4 uv0 : TEXCOORD0;
float4 color : COLOR;
/*ase_vdata:p=p;n=n;t=t;c=c;uv0=tc0*/
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct VertexOutput
{
float4 positionCS : SV_POSITION;
float4 texCoord0 : TEXCOORD0;
float4 color : TEXCOORD1;
float3 positionWS : TEXCOORD2;
/*ase_interp(3,):sp=sp;uv0=tc0;c=tc1*/
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
};
#if ETC1_EXTERNAL_ALPHA
TEXTURE2D( _AlphaTex ); SAMPLER( sampler_AlphaTex );
float _EnableAlphaTexture;
#endif
/*ase_funcs*/
VertexOutput vert( VertexInput v /*ase_vert_input*/ )
{
VertexOutput o = (VertexOutput)0;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_TRANSFER_INSTANCE_ID(v, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
/*ase_vert_code:v=VertexInput;o=VertexOutput*/
#ifdef ASE_ABSOLUTE_VERTEX_POS
float3 defaultVertexValue = v.positionOS.xyz;
#else
float3 defaultVertexValue = float3( 0, 0, 0 );
#endif
float3 vertexValue = /*ase_vert_out:Vertex Offset;Float3;3;-1;_Vertex*/defaultVertexValue/*end*/;
#ifdef ASE_ABSOLUTE_VERTEX_POS
v.positionOS.xyz = vertexValue;
#else
v.positionOS.xyz += vertexValue;
#endif
v.normal = /*ase_vert_out:Vertex Normal;Float3;4;-1;_VNormal*/v.normal/*end*/;
v.tangent.xyz = /*ase_vert_out:Vertex Tangent;Float3;5;-1;_VTangent*/v.tangent.xyz/*end*/;
VertexPositionInputs vertexInput = GetVertexPositionInputs(v.positionOS.xyz);
o.positionCS = vertexInput.positionCS;
o.positionWS = vertexInput.positionWS;
o.texCoord0 = v.uv0;
o.color = v.color;
return o;
}
half4 frag( VertexOutput IN /*ase_frag_input*/ ) : SV_Target
{
UNITY_SETUP_INSTANCE_ID(IN);
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN);
/*ase_local_var:wp*/float3 positionWS = IN.positionWS.xyz;
/*ase_frag_code:IN=VertexOutput*/
float4 Color = /*ase_frag_out:Color;Float4;1;-1;_Color*/float4( 1, 1, 1, 1 )/*end*/;
#if defined(DEBUG_DISPLAY)
SurfaceData2D surfaceData;
InitializeSurfaceData(Color.rgb, Color.a, surfaceData);
InputData2D inputData;
InitializeInputData(positionWS.xy, half2(IN.texCoord0.xy), inputData);
half4 debugColor = 0;
SETUP_DEBUG_DATA_2D(inputData, positionWS);
if (CanDebugOverrideOutputColor(surfaceData, inputData, debugColor))
{
return debugColor;
}
#endif
#if ETC1_EXTERNAL_ALPHA
float4 alpha = SAMPLE_TEXTURE2D( _AlphaTex, sampler_AlphaTex, IN.texCoord0.xy );
Color.a = lerp( Color.a, alpha.r, _EnableAlphaTexture );
#endif
Color *= IN.color;
return Color;
}
ENDHLSL
}
/*ase_pass*/
Pass
{
/*ase_hide_pass*/
Name "SceneSelectionPass"
Tags
{
"LightMode" = "SceneSelectionPass"
}
Cull Off
HLSLPROGRAM
#pragma vertex vert
#pragma fragment frag
#define _SURFACE_TYPE_TRANSPARENT 1
#define ATTRIBUTES_NEED_NORMAL
#define ATTRIBUTES_NEED_TANGENT
#define FEATURES_GRAPH_VERTEX
#define SHADERPASS SHADERPASS_DEPTHONLY
#define SCENESELECTIONPASS 1
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
/*ase_unity_cond_begin:>=20220316*/
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl"
/*ase_unity_cond_end*/
/*ase_unity_cond_begin:>=20220316*/
#if ASE_SRP_VERSION >=140009
#include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
#endif
/*ase_unity_cond_end*/
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
/*ase_srp_cond_begin:>=140007*/
#if ASE_SRP_VERSION >=140007
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl"
#endif
/*ase_srp_cond_end*/
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
/*ase_pragma*/
/*ase_globals*/
struct VertexInput
{
float3 positionOS : POSITION;
float3 normal : NORMAL;
float4 tangent : TANGENT;
/*ase_vdata:p=p;n=n;t=t*/
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct VertexOutput
{
float4 positionCS : SV_POSITION;
/*ase_interp(0,):sp=sp*/
UNITY_VERTEX_INPUT_INSTANCE_ID
};
int _ObjectId;
int _PassValue;
/*ase_funcs*/
VertexOutput vert(VertexInput v /*ase_vert_input*/)
{
VertexOutput o = (VertexOutput)0;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_TRANSFER_INSTANCE_ID(v, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
/*ase_vert_code:v=VertexInput;o=VertexOutput*/
#ifdef ASE_ABSOLUTE_VERTEX_POS
float3 defaultVertexValue = v.positionOS.xyz;
#else
float3 defaultVertexValue = float3(0, 0, 0);
#endif
float3 vertexValue = /*ase_vert_out:Vertex Offset;Float3;1;-1;_Vertex*/defaultVertexValue/*end*/;
#ifdef ASE_ABSOLUTE_VERTEX_POS
v.positionOS.xyz = vertexValue;
#else
v.positionOS.xyz += vertexValue;
#endif
VertexPositionInputs vertexInput = GetVertexPositionInputs(v.positionOS.xyz);
float3 positionWS = TransformObjectToWorld(v.positionOS);
o.positionCS = TransformWorldToHClip(positionWS);
return o;
}
half4 frag(VertexOutput IN/*ase_frag_input*/) : SV_TARGET
{
/*ase_frag_code:IN=VertexOutput*/
float4 Color = /*ase_frag_out:Color;Float4;0;-1;_Color*/float4( 1, 1, 1, 1 )/*end*/;
half4 outColor = half4(_ObjectId, _PassValue, 1.0, 1.0);
return outColor;
}
ENDHLSL
}
/*ase_pass*/
Pass
{
/*ase_hide_pass*/
Name "ScenePickingPass"
Tags
{
"LightMode" = "Picking"
}
Cull Off
HLSLPROGRAM
#pragma vertex vert
#pragma fragment frag
#define _SURFACE_TYPE_TRANSPARENT 1
#define ATTRIBUTES_NEED_NORMAL
#define ATTRIBUTES_NEED_TANGENT
#define FEATURES_GRAPH_VERTEX
#define SHADERPASS SHADERPASS_DEPTHONLY
#define SCENEPICKINGPASS 1
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
/*ase_unity_cond_begin:>=20220316*/
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl"
/*ase_unity_cond_end*/
/*ase_unity_cond_begin:>=20220316*/
#if ASE_SRP_VERSION >=140009
#include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
#endif
/*ase_unity_cond_end*/
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
/*ase_srp_cond_begin:>=140007*/
#if ASE_SRP_VERSION >=140007
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl"
#endif
/*ase_srp_cond_end*/
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
/*ase_pragma*/
/*ase_globals*/
struct VertexInput
{
float3 positionOS : POSITION;
float3 normal : NORMAL;
float4 tangent : TANGENT;
/*ase_vdata:p=p;n=n;t=t*/
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct VertexOutput
{
float4 positionCS : SV_POSITION;
/*ase_interp(0,):sp=sp*/
UNITY_VERTEX_INPUT_INSTANCE_ID
};
float4 _SelectionID;
/*ase_funcs*/
VertexOutput vert(VertexInput v /*ase_vert_input*/ )
{
VertexOutput o = (VertexOutput)0;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_TRANSFER_INSTANCE_ID(v, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
/*ase_vert_code:v=VertexInput;o=VertexOutput*/
#ifdef ASE_ABSOLUTE_VERTEX_POS
float3 defaultVertexValue = v.positionOS.xyz;
#else
float3 defaultVertexValue = float3(0, 0, 0);
#endif
float3 vertexValue = /*ase_vert_out:Vertex Offset;Float3;1;-1;_Vertex*/defaultVertexValue/*end*/;
#ifdef ASE_ABSOLUTE_VERTEX_POS
v.positionOS.xyz = vertexValue;
#else
v.positionOS.xyz += vertexValue;
#endif
VertexPositionInputs vertexInput = GetVertexPositionInputs(v.positionOS.xyz);
float3 positionWS = TransformObjectToWorld(v.positionOS);
o.positionCS = TransformWorldToHClip(positionWS);
return o;
}
half4 frag(VertexOutput IN /*ase_frag_input*/) : SV_TARGET
{
/*ase_frag_code:IN=VertexOutput*/
float4 Color = /*ase_frag_out:Color;Float4;0;-1;_Color*/float4( 1, 1, 1, 1 )/*end*/;
half4 outColor = _SelectionID;
return outColor;
}
ENDHLSL
}
/*ase_pass_end*/
}
CustomEditor "UnityEditor.ShaderGraph.GenericShaderGraphMaterialGUI"
FallBack "Hidden/Shader Graph/FallbackError"
}

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 199187dac283dbe4a8cb1ea611d70c58
timeCreated: 1568647145
licenseType: Pro
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,586 @@
Shader /*ase_name*/ "Hidden/Universal/2D Unlit" /*end*/
{
Properties
{
/*ase_props*/
[HideInInspector][NoScaleOffset] unity_Lightmaps("unity_Lightmaps", 2DArray) = "" {}
[HideInInspector][NoScaleOffset] unity_LightmapsInd("unity_LightmapsInd", 2DArray) = "" {}
[HideInInspector][NoScaleOffset] unity_ShadowMasks("unity_ShadowMasks", 2DArray) = "" {}
}
SubShader
{
/*ase_subshader_options:Name=Additional Options
Option:Vertex Position:Absolute,Relative:Relative
Absolute:SetDefine:ASE_ABSOLUTE_VERTEX_POS 1
Absolute:SetPortName:Sprite Unlit:3,Vertex Position
Relative:RemoveDefine:ASE_ABSOLUTE_VERTEX_POS 1
Relative:SetPortName:Sprite Unlit:3,Vertex Offset
Option:Debug Display:false,true:false
true:SetDefine:pragma multi_compile _ DEBUG_DISPLAY
false,disable:RemoveDefine:pragma multi_compile _ DEBUG_DISPLAY
Option:External Alpha:false,true:false
true:SetDefine:pragma multi_compile _ ETC1_EXTERNAL_ALPHA
false,disable:RemoveDefine:pragma multi_compile _ ETC1_EXTERNAL_ALPHA
*/
Tags
{
"RenderPipeline" = "UniversalPipeline"
"RenderType" = "Transparent"
"Queue" = "Transparent+0"
}
Cull Off
HLSLINCLUDE
#pragma target 2.0
#pragma prefer_hlslcc gles
#pragma exclude_renderers d3d9 // ensure rendering platforms toggle list is visible
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Filtering.hlsl"
ENDHLSL
/*ase_pass*/
Pass
{
Name "Sprite Unlit"
Tags
{
"LightMode" = "Universal2D"
}
Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha
ZTest LEqual
ZWrite Off
Offset 0,0
ColorMask RGBA
/*ase_stencil*/
HLSLPROGRAM
#pragma vertex vert
#pragma fragment frag
#define _SURFACE_TYPE_TRANSPARENT 1
#define ATTRIBUTES_NEED_NORMAL
#define ATTRIBUTES_NEED_TANGENT
#define ATTRIBUTES_NEED_TEXCOORD0
#define ATTRIBUTES_NEED_COLOR
#define VARYINGS_NEED_POSITION_WS
#define VARYINGS_NEED_TEXCOORD0
#define VARYINGS_NEED_COLOR
#define FEATURES_GRAPH_VERTEX
#define SHADERPASS SHADERPASS_SPRITEUNLIT
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
/*ase_unity_cond_begin:>=20220316*/
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl"
/*ase_unity_cond_end*/
/*ase_unity_cond_begin:>=20220316*/
#if ASE_SRP_VERSION >=140009
#include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
#endif
/*ase_unity_cond_end*/
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/SurfaceData2D.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Debug/Debugging2D.hlsl"
/*ase_pragma*/
/*ase_globals*/
struct VertexInput
{
float4 positionOS : POSITION;
float3 normal : NORMAL;
float4 tangent : TANGENT;
float4 uv0 : TEXCOORD0;
float4 color : COLOR;
/*ase_vdata:p=p;n=n;t=t;c=c;uv0=tc0*/
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct VertexOutput
{
float4 positionCS : SV_POSITION;
float4 texCoord0 : TEXCOORD0;
float4 color : TEXCOORD1;
float3 positionWS : TEXCOORD2;
/*ase_interp(3,):sp=sp;uv0=tc0;c=tc1*/
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
};
#if ETC1_EXTERNAL_ALPHA
TEXTURE2D(_AlphaTex); SAMPLER(sampler_AlphaTex);
float _EnableAlphaTexture;
#endif
float4 _RendererColor;
/*ase_funcs*/
VertexOutput vert( VertexInput v /*ase_vert_input*/ )
{
VertexOutput o = (VertexOutput)0;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_TRANSFER_INSTANCE_ID(v, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
/*ase_vert_code:v=VertexInput;o=VertexOutput*/
#ifdef ASE_ABSOLUTE_VERTEX_POS
float3 defaultVertexValue = v.positionOS.xyz;
#else
float3 defaultVertexValue = float3(0, 0, 0);
#endif
float3 vertexValue = /*ase_vert_out:Vertex Offset;Float3;3;-1;_Vertex*/defaultVertexValue/*end*/;
#ifdef ASE_ABSOLUTE_VERTEX_POS
v.positionOS.xyz = vertexValue;
#else
v.positionOS.xyz += vertexValue;
#endif
v.normal = /*ase_vert_out:Vertex Normal;Float3;4;-1;_VNormal*/v.normal/*end*/;
v.tangent.xyz = /*ase_vert_out:Vertex Tangent;Float3;5;-1;_VTangent*/v.tangent.xyz/*end*/;
VertexPositionInputs vertexInput = GetVertexPositionInputs(v.positionOS.xyz);
o.positionCS = vertexInput.positionCS;
o.positionWS = vertexInput.positionWS;
o.texCoord0 = v.uv0;
o.color = v.color;
return o;
}
half4 frag( VertexOutput IN /*ase_frag_input*/ ) : SV_Target
{
UNITY_SETUP_INSTANCE_ID(IN);
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN);
/*ase_frag_code:IN=VertexOutput*/
float4 Color = /*ase_frag_out:Color;Float4;1;-1;_Color*/float4( 1, 1, 1, 1 )/*end*/;
#if ETC1_EXTERNAL_ALPHA
float4 alpha = SAMPLE_TEXTURE2D(_AlphaTex, sampler_AlphaTex, IN.texCoord0.xy);
Color.a = lerp( Color.a, alpha.r, _EnableAlphaTexture);
#endif
#if defined(DEBUG_DISPLAY)
SurfaceData2D surfaceData;
InitializeSurfaceData(Color.rgb, Color.a, surfaceData);
InputData2D inputData;
InitializeInputData(IN.positionWS.xy, half2(IN.texCoord0.xy), inputData);
half4 debugColor = 0;
SETUP_DEBUG_DATA_2D(inputData, IN.positionWS);
if (CanDebugOverrideOutputColor(surfaceData, inputData, debugColor))
{
return debugColor;
}
#endif
Color *= IN.color * _RendererColor;
return Color;
}
ENDHLSL
}
/*ase_pass*/
Pass
{
/*ase_hide_pass:SyncP*/
Name "Sprite Unlit Forward"
Tags
{
"LightMode" = "UniversalForward"
}
Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha
ZTest LEqual
ZWrite Off
Offset 0,0
ColorMask RGBA
/*ase_stencil*/
HLSLPROGRAM
#pragma vertex vert
#pragma fragment frag
#define _SURFACE_TYPE_TRANSPARENT 1
#define ATTRIBUTES_NEED_NORMAL
#define ATTRIBUTES_NEED_TANGENT
#define ATTRIBUTES_NEED_TEXCOORD0
#define ATTRIBUTES_NEED_COLOR
#define VARYINGS_NEED_POSITION_WS
#define VARYINGS_NEED_TEXCOORD0
#define VARYINGS_NEED_COLOR
#define FEATURES_GRAPH_VERTEX
#define SHADERPASS SHADERPASS_SPRITEFORWARD
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
/*ase_unity_cond_begin:>=20220316*/
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl"
/*ase_unity_cond_end*/
/*ase_unity_cond_begin:>=20220316*/
#if ASE_SRP_VERSION >=140009
#include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
#endif
/*ase_unity_cond_end*/
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/SurfaceData2D.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Debug/Debugging2D.hlsl"
/*ase_pragma*/
/*ase_globals*/
struct VertexInput
{
float4 positionOS : POSITION;
float3 normal : NORMAL;
float4 tangent : TANGENT;
float4 uv0 : TEXCOORD0;
float4 color : COLOR;
/*ase_vdata:p=p;n=n;t=t;c=c;uv0=tc0*/
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct VertexOutput
{
float4 positionCS : SV_POSITION;
float4 texCoord0 : TEXCOORD0;
float4 color : TEXCOORD1;
float3 positionWS : TEXCOORD2;
/*ase_interp(3,):sp=sp;uv0=tc0;c=tc1*/
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
};
#if ETC1_EXTERNAL_ALPHA
TEXTURE2D( _AlphaTex ); SAMPLER( sampler_AlphaTex );
float _EnableAlphaTexture;
#endif
float4 _RendererColor;
/*ase_funcs*/
VertexOutput vert( VertexInput v /*ase_vert_input*/ )
{
VertexOutput o = (VertexOutput)0;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_TRANSFER_INSTANCE_ID(v, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
/*ase_vert_code:v=VertexInput;o=VertexOutput*/
#ifdef ASE_ABSOLUTE_VERTEX_POS
float3 defaultVertexValue = v.positionOS.xyz;
#else
float3 defaultVertexValue = float3( 0, 0, 0 );
#endif
float3 vertexValue = /*ase_vert_out:Vertex Offset;Float3;3;-1;_Vertex*/defaultVertexValue/*end*/;
#ifdef ASE_ABSOLUTE_VERTEX_POS
v.positionOS.xyz = vertexValue;
#else
v.positionOS.xyz += vertexValue;
#endif
v.normal = /*ase_vert_out:Vertex Normal;Float3;4;-1;_VNormal*/v.normal/*end*/;
v.tangent.xyz = /*ase_vert_out:Vertex Tangent;Float3;5;-1;_VTangent*/v.tangent.xyz/*end*/;
VertexPositionInputs vertexInput = GetVertexPositionInputs(v.positionOS.xyz);
o.positionCS = vertexInput.positionCS;
o.positionWS = vertexInput.positionWS;
o.texCoord0 = v.uv0;
o.color = v.color;
return o;
}
half4 frag( VertexOutput IN /*ase_frag_input*/ ) : SV_Target
{
UNITY_SETUP_INSTANCE_ID(IN);
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN);
/*ase_frag_code:IN=VertexOutput*/
float4 Color = /*ase_frag_out:Color;Float4;1;-1;_Color*/float4( 1, 1, 1, 1 )/*end*/;
#if ETC1_EXTERNAL_ALPHA
float4 alpha = SAMPLE_TEXTURE2D( _AlphaTex, sampler_AlphaTex, IN.texCoord0.xy );
Color.a = lerp( Color.a, alpha.r, _EnableAlphaTexture );
#endif
#if defined(DEBUG_DISPLAY)
SurfaceData2D surfaceData;
InitializeSurfaceData(Color.rgb, Color.a, surfaceData);
InputData2D inputData;
InitializeInputData(IN.positionWS.xy, half2(IN.texCoord0.xy), inputData);
half4 debugColor = 0;
SETUP_DEBUG_DATA_2D(inputData, IN.positionWS);
if (CanDebugOverrideOutputColor(surfaceData, inputData, debugColor))
{
return debugColor;
}
#endif
Color *= IN.color * _RendererColor;
return Color;
}
ENDHLSL
}
/*ase_pass*/
Pass
{
/*ase_hide_pass*/
Name "SceneSelectionPass"
Tags
{
"LightMode" = "SceneSelectionPass"
}
Cull Off
HLSLPROGRAM
#pragma vertex vert
#pragma fragment frag
#define _SURFACE_TYPE_TRANSPARENT 1
#define ATTRIBUTES_NEED_NORMAL
#define ATTRIBUTES_NEED_TANGENT
#define FEATURES_GRAPH_VERTEX
#define SHADERPASS SHADERPASS_DEPTHONLY
#define SCENESELECTIONPASS 1
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
/*ase_unity_cond_begin:>=20220316*/
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl"
/*ase_unity_cond_end*/
/*ase_unity_cond_begin:>=20220316*/
#if ASE_SRP_VERSION >=140009
#include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
#endif
/*ase_unity_cond_end*/
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
/*ase_pragma*/
/*ase_globals*/
struct VertexInput
{
float3 positionOS : POSITION;
float3 normal : NORMAL;
float4 tangent : TANGENT;
/*ase_vdata:p=p;n=n;t=t*/
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct VertexOutput
{
float4 positionCS : SV_POSITION;
/*ase_interp(0,):sp=sp*/
UNITY_VERTEX_INPUT_INSTANCE_ID
};
int _ObjectId;
int _PassValue;
/*ase_funcs*/
VertexOutput vert(VertexInput v /*ase_vert_input*/)
{
VertexOutput o = (VertexOutput)0;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_TRANSFER_INSTANCE_ID(v, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
/*ase_vert_code:v=VertexInput;o=VertexOutput*/
#ifdef ASE_ABSOLUTE_VERTEX_POS
float3 defaultVertexValue = v.positionOS.xyz;
#else
float3 defaultVertexValue = float3(0, 0, 0);
#endif
float3 vertexValue = /*ase_vert_out:Vertex Offset;Float3;1;-1;_Vertex*/defaultVertexValue/*end*/;
#ifdef ASE_ABSOLUTE_VERTEX_POS
v.positionOS.xyz = vertexValue;
#else
v.positionOS.xyz += vertexValue;
#endif
VertexPositionInputs vertexInput = GetVertexPositionInputs(v.positionOS.xyz);
float3 positionWS = TransformObjectToWorld(v.positionOS);
o.positionCS = TransformWorldToHClip(positionWS);
return o;
}
half4 frag(VertexOutput IN/*ase_frag_input*/) : SV_TARGET
{
/*ase_frag_code:IN=VertexOutput*/
float4 Color = /*ase_frag_out:Color;Float4;0;-1;_Color*/float4( 1, 1, 1, 1 )/*end*/;
half4 outColor = half4(_ObjectId, _PassValue, 1.0, 1.0);
return outColor;
}
ENDHLSL
}
/*ase_pass*/
Pass
{
/*ase_hide_pass*/
Name "ScenePickingPass"
Tags
{
"LightMode" = "Picking"
}
Cull Off
HLSLPROGRAM
#pragma vertex vert
#pragma fragment frag
#define _SURFACE_TYPE_TRANSPARENT 1
#define ATTRIBUTES_NEED_NORMAL
#define ATTRIBUTES_NEED_TANGENT
#define FEATURES_GRAPH_VERTEX
#define SHADERPASS SHADERPASS_DEPTHONLY
#define SCENEPICKINGPASS 1
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/TextureStack.hlsl"
/*ase_unity_cond_begin:>=20220316*/
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl"
/*ase_unity_cond_end*/
/*ase_unity_cond_begin:>=20220316*/
#if ASE_SRP_VERSION >=140009
#include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
#endif
/*ase_unity_cond_end*/
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Editor/ShaderGraph/Includes/ShaderPass.hlsl"
/*ase_pragma*/
/*ase_globals*/
struct VertexInput
{
float3 positionOS : POSITION;
float3 normal : NORMAL;
float4 tangent : TANGENT;
/*ase_vdata:p=p;n=n;t=t*/
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct VertexOutput
{
float4 positionCS : SV_POSITION;
/*ase_interp(0,):sp=sp*/
UNITY_VERTEX_INPUT_INSTANCE_ID
};
float4 _SelectionID;
/*ase_funcs*/
VertexOutput vert(VertexInput v /*ase_vert_input*/ )
{
VertexOutput o = (VertexOutput)0;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_TRANSFER_INSTANCE_ID(v, o);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
/*ase_vert_code:v=VertexInput;o=VertexOutput*/
#ifdef ASE_ABSOLUTE_VERTEX_POS
float3 defaultVertexValue = v.positionOS.xyz;
#else
float3 defaultVertexValue = float3(0, 0, 0);
#endif
float3 vertexValue = /*ase_vert_out:Vertex Offset;Float3;1;-1;_Vertex*/defaultVertexValue/*end*/;
#ifdef ASE_ABSOLUTE_VERTEX_POS
v.positionOS.xyz = vertexValue;
#else
v.positionOS.xyz += vertexValue;
#endif
VertexPositionInputs vertexInput = GetVertexPositionInputs(v.positionOS.xyz);
float3 positionWS = TransformObjectToWorld(v.positionOS);
o.positionCS = TransformWorldToHClip(positionWS);
return o;
}
half4 frag(VertexOutput IN /*ase_frag_input*/) : SV_TARGET
{
/*ase_frag_code:IN=VertexOutput*/
float4 Color = /*ase_frag_out:Color;Float4;0;-1;_Color*/float4( 1, 1, 1, 1 )/*end*/;
half4 outColor = _SelectionID;
return outColor;
}
ENDHLSL
}
/*ase_pass_end*/
}
CustomEditor "UnityEditor.ShaderGraph.GenericShaderGraphMaterialGUI"
FallBack "Hidden/Shader Graph/FallbackError"
}

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: cf964e524c8e69742b1d21fbe2ebcc4a
timeCreated: 1568647145
licenseType: Pro
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: c2a467ab6d5391a4ea692226d82ffefd
timeCreated: 1635876295
licenseType: Pro
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 94348b07e5e8bab40bd6c8a1e3df54cd
ShaderImporter:
externalObjects: {}
defaultTextures:
- unity_Lightmaps: {instanceID: 0}
- unity_LightmapsInd: {instanceID: 0}
- unity_ShadowMasks: {instanceID: 0}
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 2992e84f91cbeb14eab234972e07ea9d
timeCreated: 1568647145
licenseType: Pro
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant: