This commit is contained in:
2026-11-24 15:51:02 +01:00
parent cca4d73e41
commit f4aa17114a
22092 changed files with 5042406 additions and 0 deletions
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b1e0c8a42c5ad194389231f7780e158d
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,44 @@
#ifndef _2D_COMMON
#define _2D_COMMON
TEXTURE2D(_MainTex);
SAMPLER(sampler_MainTex);
UNITY_TEXTURE_STREAMING_DEBUG_VARS_FOR_TEX(_MainTex);
Varyings CommonUnlitVertex(Attributes input)
{
Varyings o = (Varyings)0;
UNITY_SETUP_INSTANCE_ID(input);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
o.positionCS = TransformObjectToHClip(input.positionOS);
#if defined(DEBUG_DISPLAY)
o.positionWS = TransformObjectToWorld(input.positionOS);
#endif
o.uv = input.uv;
return o;
}
half4 CommonUnlitFragment(Varyings input, half4 color)
{
float4 mainTex = color * SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, input.uv);
#if defined(DEBUG_DISPLAY)
SurfaceData2D surfaceData;
InputData2D inputData;
half4 debugColor = 0;
InitializeSurfaceData(mainTex.rgb, mainTex.a, surfaceData);
InitializeInputData(input.uv, inputData);
SETUP_DEBUG_TEXTURE_DATA_2D_NO_TS(inputData, input.positionWS, input.positionCS, _MainTex);
if (CanDebugOverrideOutputColor(surfaceData, inputData, debugColor))
{
return debugColor;
}
#endif
return mainTex;
}
#endif // _2D_COMMON
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: e707208f874722b45a81cf2f59f81458
ShaderIncludeImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,115 @@
#ifndef COMBINED_SHAPE_LIGHT_PASS
#define COMBINED_SHAPE_LIGHT_PASS
#include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/LightingUtility.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/ShapeLightVariables.hlsl"
#if defined(DEBUG_DISPLAY)
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Debug/Debugging2D.hlsl"
#endif
half4 CombinedShapeLightShared(in SurfaceData2D surfaceData, in InputData2D inputData)
{
#if defined(DEBUG_DISPLAY)
half4 debugColor = 0;
if (CanDebugOverrideOutputColor(surfaceData, inputData, debugColor))
{
return debugColor;
}
#endif
half alpha = surfaceData.alpha;
half4 color = half4(surfaceData.albedo, alpha);
const half4 mask = surfaceData.mask;
half2 lightingUV = inputData.lightingUV;
#if defined(UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION)
// When this pass renders straight to the backbuffer (2D renderer with no intermediate color
// target), Vulkan swapchain pre-transform has rotated clip space, so lightingUV is a physical
// screen coordinate. The shape light textures are offscreen and so are still in the logical
// orientation - undo the rotation before sampling them. lightingUV comes from ComputeScreenPos()
// followed by the perspective divide, so this is the positionNDC overload. UUM-147359.
lightingUV = half2(RemovePretransformRotation(float2(lightingUV)));
#endif
if (alpha == 0.0)
discard;
#if USE_SHAPE_LIGHT_TYPE_0
half4 shapeLight0 = SAMPLE_TEXTURE2D(_ShapeLightTexture0, sampler_ShapeLightTexture0, lightingUV);
if (any(_ShapeLightMaskFilter0))
{
half4 processedMask = (1 - _ShapeLightInvertedFilter0) * mask + _ShapeLightInvertedFilter0 * (1 - mask);
shapeLight0 *= dot(processedMask, _ShapeLightMaskFilter0);
}
half4 shapeLight0Modulate = shapeLight0 * _ShapeLightBlendFactors0.x;
half4 shapeLight0Additive = shapeLight0 * _ShapeLightBlendFactors0.y;
#else
half4 shapeLight0Modulate = 0;
half4 shapeLight0Additive = 0;
#endif
#if USE_SHAPE_LIGHT_TYPE_1
half4 shapeLight1 = SAMPLE_TEXTURE2D(_ShapeLightTexture1, sampler_ShapeLightTexture1, lightingUV);
if (any(_ShapeLightMaskFilter1))
{
half4 processedMask = (1 - _ShapeLightInvertedFilter1) * mask + _ShapeLightInvertedFilter1 * (1 - mask);
shapeLight1 *= dot(processedMask, _ShapeLightMaskFilter1);
}
half4 shapeLight1Modulate = shapeLight1 * _ShapeLightBlendFactors1.x;
half4 shapeLight1Additive = shapeLight1 * _ShapeLightBlendFactors1.y;
#else
half4 shapeLight1Modulate = 0;
half4 shapeLight1Additive = 0;
#endif
#if USE_SHAPE_LIGHT_TYPE_2
half4 shapeLight2 = SAMPLE_TEXTURE2D(_ShapeLightTexture2, sampler_ShapeLightTexture2, lightingUV);
if (any(_ShapeLightMaskFilter2))
{
half4 processedMask = (1 - _ShapeLightInvertedFilter2) * mask + _ShapeLightInvertedFilter2 * (1 - mask);
shapeLight2 *= dot(processedMask, _ShapeLightMaskFilter2);
}
half4 shapeLight2Modulate = shapeLight2 * _ShapeLightBlendFactors2.x;
half4 shapeLight2Additive = shapeLight2 * _ShapeLightBlendFactors2.y;
#else
half4 shapeLight2Modulate = 0;
half4 shapeLight2Additive = 0;
#endif
#if USE_SHAPE_LIGHT_TYPE_3
half4 shapeLight3 = SAMPLE_TEXTURE2D(_ShapeLightTexture3, sampler_ShapeLightTexture3, lightingUV);
if (any(_ShapeLightMaskFilter3))
{
half4 processedMask = (1 - _ShapeLightInvertedFilter3) * mask + _ShapeLightInvertedFilter3 * (1 - mask);
shapeLight3 *= dot(processedMask, _ShapeLightMaskFilter3);
}
half4 shapeLight3Modulate = shapeLight3 * _ShapeLightBlendFactors3.x;
half4 shapeLight3Additive = shapeLight3 * _ShapeLightBlendFactors3.y;
#else
half4 shapeLight3Modulate = 0;
half4 shapeLight3Additive = 0;
#endif
half4 finalOutput;
#if !USE_SHAPE_LIGHT_TYPE_0 && !USE_SHAPE_LIGHT_TYPE_1 && !USE_SHAPE_LIGHT_TYPE_2 && ! USE_SHAPE_LIGHT_TYPE_3
finalOutput = color;
#else
half4 finalModulate = shapeLight0Modulate + shapeLight1Modulate + shapeLight2Modulate + shapeLight3Modulate;
half4 finalAdditve = shapeLight0Additive + shapeLight1Additive + shapeLight2Additive + shapeLight3Additive;
finalOutput = _HDREmulationScale * (color * finalModulate + finalAdditve);
#endif
finalOutput.a = alpha;
return max(0, finalOutput);
}
#endif
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: e7ee44e4db2311b428e6f789318838f8
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,108 @@
#ifndef INPUT_CORE_2D_INCLUDED
#define INPUT_CORE_2D_INCLUDED
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/InputData2D.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/SurfaceData2D.hlsl"
#if defined(DEBUG_DISPLAY)
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Debug/Debugging2D.hlsl"
#endif
// Lit
#define COMMON_2D_LIT_OUTPUTS \
COMMON_2D_OUTPUTS \
half2 lightingUV : TEXCOORD1;
// Unlit
#define COMMON_2D_INPUTS \
float3 positionOS : POSITION; \
float2 uv : TEXCOORD0; \
float3 normal : NORMAL; \
UNITY_VERTEX_INPUT_INSTANCE_ID
#define COMMON_2D_OUTPUTS_SHARED \
float4 positionCS : SV_POSITION; \
float2 uv : TEXCOORD0; \
UNITY_VERTEX_OUTPUT_STEREO
#if defined(DEBUG_DISPLAY)
#define COMMON_2D_OUTPUTS \
COMMON_2D_OUTPUTS_SHARED \
float3 positionWS : TEXCOORD2; \
half3 normalWS : TEXCOORD3;
#else
#define COMMON_2D_OUTPUTS \
COMMON_2D_OUTPUTS_SHARED
#endif
// Normals
#define COMMON_2D_NORMALS_INPUTS \
COMMON_2D_INPUTS \
float4 tangent : TANGENT; \
#define COMMON_2D_NORMALS_OUTPUTS \
COMMON_2D_OUTPUTS_SHARED \
half3 normalWS : TEXCOORD1; \
half3 tangentWS : TEXCOORD2; \
half3 bitangentWS : TEXCOORD3;
#if defined(SKINNED_SPRITE)
#define UNITY_SKINNED_VERTEX_INPUTS float4 weights : BLENDWEIGHTS; uint4 indices : BLENDINDICES;
#define UNITY_SKINNED_VERTEX_COMPUTE(x) x.positionOS = UnitySkinSprite(x.positionOS, x.indices, x.weights, unity_SpriteProps.z, 1.0f);
#else
#define UNITY_SKINNED_VERTEX_INPUTS
#define UNITY_SKINNED_VERTEX_COMPUTE(x)
#endif
uniform StructuredBuffer<float4x4> _SpriteBoneTransforms;
float3 UnityFlipSprite( in float3 pos, in float2 flip )
{
return float3(pos.xy * flip, pos.z);
}
float3 UnitySkinSprite( in float3 inputData, in uint4 blendIndices, in float4 blendWeights, in float offset, in float w )
{
float4 outputData = float4(inputData, w);
#if defined(SKINNED_SPRITE) && !defined(SHADERGRAPH_PREVIEW)
UNITY_BRANCH
if (offset >= 0)
{
outputData =
mul(_SpriteBoneTransforms[uint(offset) + blendIndices.x], outputData) * blendWeights.x +
mul(_SpriteBoneTransforms[uint(offset) + blendIndices.y], outputData) * blendWeights.y +
mul(_SpriteBoneTransforms[uint(offset) + blendIndices.z], outputData) * blendWeights.z +
mul(_SpriteBoneTransforms[uint(offset) + blendIndices.w], outputData) * blendWeights.w;
}
#endif // SKINNED_SPRITE
return outputData.xyz;
}
#ifdef UNITY_INSTANCING_ENABLED
UNITY_INSTANCING_BUFFER_START(PerDrawSprite)
// SpriteRenderer.Color while Non-Batched/Instanced.
UNITY_DEFINE_INSTANCED_PROP(float4, unity_SpriteRendererColorArray)
// this could be smaller but that's how bit each entry is regardless of type
UNITY_DEFINE_INSTANCED_PROP(float2, unity_SpriteFlipArray)
UNITY_INSTANCING_BUFFER_END(PerDrawSprite)
#define unity_SpriteColor UNITY_ACCESS_INSTANCED_PROP(PerDrawSprite, unity_SpriteRendererColorArray)
#define unity_SpriteFlip UNITY_ACCESS_INSTANCED_PROP(PerDrawSprite, unity_SpriteFlipArray)
#endif // instancing
void SetUpSpriteInstanceProperties()
{
#if defined(UNITY_INSTANCING_ENABLED) && !defined(HAVE_VFX_MODIFICATION)
unity_SpriteProps.xy = unity_SpriteFlip;
#endif
}
#endif
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 882f88039036f6c49a8df5ce3d214444
ShaderIncludeImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,35 @@
#ifndef INPUT_DATA_2D_INCLUDED
#define INPUT_DATA_2D_INCLUDED
struct InputData2D
{
float2 uv;
half2 lightingUV;
#if defined(DEBUG_DISPLAY)
float3 positionWS;
float4 positionCS;
// Mipmap Streaming Debug
float4 texelSize;
float4 mipInfo;
float4 streamInfo;
uint mipCount;
#endif
};
void InitializeInputData(float2 uv, half2 lightingUV, out InputData2D inputData)
{
inputData = (InputData2D)0;
inputData.uv = uv;
inputData.lightingUV = lightingUV;
}
void InitializeInputData(float2 uv, out InputData2D inputData)
{
InitializeInputData(uv, 0, inputData);
}
#endif
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 15c09e9f82634f5881e6676d62f25bcb
timeCreated: 1614177501
@@ -0,0 +1,217 @@
// Must match: LightBatch.isBatchingSupported
#define USE_STRUCTURED_BUFFER_FOR_LIGHT2D_DATA 0
#if USE_NORMAL_MAP
#if LIGHT_QUALITY_FAST
#define NORMALS_LIGHTING_COORDS(TEXCOORDA, TEXCOORDB) \
half4 lightDirection : TEXCOORDA;\
float2 screenUV : TEXCOORDB;
#define TRANSFER_NORMALS_LIGHTING(output, worldSpacePos, lightPosition, lightZDistance)\
output.screenUV = ComputeNormalizedDeviceCoordinates(output.positionCS.xyz / output.positionCS.w);\
half3 planeNormal = -GetViewForwardDir();\
half3 projLightPos = lightPosition.xyz - (dot(lightPosition.xyz - worldSpacePos.xyz, planeNormal) - lightZDistance) * planeNormal;\
output.lightDirection.xyz = projLightPos - worldSpacePos.xyz;\
output.lightDirection.w = 0;
#define APPLY_NORMALS_LIGHTING(input, lightColor, lightPosition, lightZDistance)\
half4 normal = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, input.screenUV);\
half3 normalUnpacked = UnpackNormalRGBNoScale(normal);\
half3 dirToLight = normalize(input.lightDirection.xyz);\
lightColor = lightColor * saturate(dot(dirToLight, normalUnpacked));
#else
#define NORMALS_LIGHTING_COORDS(TEXCOORDA, TEXCOORDB) \
half4 positionWS : TEXCOORDA;\
float2 screenUV : TEXCOORDB;
#define TRANSFER_NORMALS_LIGHTING(output, worldSpacePos, lightPosition, lightZDistance) \
output.screenUV = ComputeNormalizedDeviceCoordinates(output.positionCS.xyz / output.positionCS.w); \
output.positionWS = worldSpacePos;
#define APPLY_NORMALS_LIGHTING(input, lightColor, lightPosition, lightZDistance)\
half4 normal = SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, input.screenUV);\
half3 normalUnpacked = UnpackNormalRGBNoScale(normal);\
half3 planeNormal = -GetViewForwardDir();\
half3 projLightPos = lightPosition.xyz - (dot(lightPosition.xyz - input.positionWS.xyz, planeNormal) - lightZDistance) * planeNormal;\
half3 dirToLight = normalize(projLightPos - input.positionWS.xyz);\
lightColor = lightColor * saturate(dot(dirToLight, normalUnpacked));
#endif
#define NORMALS_LIGHTING_VARIABLES \
TEXTURE2D(_NormalMap); \
SAMPLER(sampler_NormalMap);
#else
#define NORMALS_LIGHTING_COORDS(TEXCOORDA, TEXCOORDB)
#define NORMALS_LIGHTING_VARIABLES
#define TRANSFER_NORMALS_LIGHTING(output, worldSpacePos, lightPosition, lightZDistance)
#define APPLY_NORMALS_LIGHTING(input, lightColor, lightPosition, lightZDistance)
#endif
#define SHADOW_COORDS(TEXCOORDA)\
float2 shadowUV : TEXCOORDA;
#define SHADOW_VARIABLES\
TEXTURE2D(_ShadowTex);\
SAMPLER(sampler_ShadowTex);
// Need to look at shadow caster to remove issue with shadows
#define APPLY_SHADOWS(input, color, intensity)\
if(intensity < 1)\
{\
half4 shadowTex = SAMPLE_TEXTURE2D(_ShadowTex, sampler_ShadowTex, input.shadowUV); \
half shadowIntensity = 1 - max(shadowTex.r, shadowTex.g * (1 - shadowTex.b));\
color.rgb = (color.rgb * shadowIntensity) + (color.rgb * intensity * (1 - shadowIntensity));\
}
#define TRANSFER_SHADOWS(output)\
output.shadowUV = ComputeNormalizedDeviceCoordinates(output.positionCS.xyz / output.positionCS.w);
#define SHAPE_LIGHT(index)\
TEXTURE2D(_ShapeLightTexture##index);\
SAMPLER(sampler_ShapeLightTexture##index);\
half2 _ShapeLightBlendFactors##index;\
half4 _ShapeLightMaskFilter##index;\
half4 _ShapeLightInvertedFilter##index;
#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
#if !defined(USE_SHAPE_LIGHT_TYPE_0) && !defined(USE_SHAPE_LIGHT_TYPE_1) && !defined(USE_SHAPE_LIGHT_TYPE_2) && !defined(USE_SHAPE_LIGHT_TYPE_3)
#define USE_DEFAULT_LIGHT_TYPE 1
#endif
struct FragmentOutput
{
#if USE_SHAPE_LIGHT_TYPE_0 || USE_DEFAULT_LIGHT_TYPE
half4 GLightBuffer0 : SV_Target0;
#endif
#if USE_SHAPE_LIGHT_TYPE_1
half4 GLightBuffer1 : SV_Target1;
#endif
#if USE_SHAPE_LIGHT_TYPE_2
half4 GLightBuffer2 : SV_Target2;
#endif
#if USE_SHAPE_LIGHT_TYPE_3
half4 GLightBuffer3 : SV_Target3;
#endif
};
FragmentOutput ToFragmentOutput(half4 finalColor)
{
FragmentOutput output;
#if USE_SHAPE_LIGHT_TYPE_0 || USE_DEFAULT_LIGHT_TYPE
output.GLightBuffer0 = finalColor;
#endif
#if USE_SHAPE_LIGHT_TYPE_1
output.GLightBuffer1 = finalColor;
#endif
#if USE_SHAPE_LIGHT_TYPE_2
output.GLightBuffer2 = finalColor;
#endif
#if USE_SHAPE_LIGHT_TYPE_3
output.GLightBuffer3 = finalColor;
#endif
return output;
}
#define LIGHT_OFFSET(TEXCOORD)\
float4 lightOffset : TEXCOORD;
// Light-Batcher mapping for Reference.
// OuterAngle; // 1-0 where 1 is the value at 0 degrees and 1 is the value at 180 degrees
// InnerAngle; // 1-0 where 1 is the value at 0 degrees and 1 is the value at 180 degrees
// InnerRadiusMult; // 1-0 where 1 is the value at the center and 0 is the value at the outer radius
// Note: IsFullSpotlight // Is no longer fed but deduced within the shader. Value basically is test for InnerAngle = 1.0f
// Likewise InnerAngleMult is also deduced and is basically 1 / (Outer - Inner)
// Position.xyz => _LightPosition
// Position.w => _LightZDistance
// ShadowIntensity => In case of Volumetric Lighting this represents ShadowVolumeIntensity
struct PerLight2D
{
float4x4 InvMatrix;
float4 Color;
float4 Position;
float FalloffIntensity;
float FalloffDistance;
float OuterAngle;
float InnerAngle;
float InnerRadiusMult;
float VolumeOpacity;
float ShadowIntensity;
int LightType;
};
#if USE_STRUCTURED_BUFFER_FOR_LIGHT2D_DATA
#define UNITY_LIGHT2D_DATA \
\
uniform StructuredBuffer<PerLight2D> _Light2DBuffer; \
\
int _BatchBufferOffset; \
\
PerLight2D GetPerLight2D(float4 color) \
{ \
int idx = (int)(color.b * 64) + _BatchBufferOffset; \
return _Light2DBuffer[idx]; \
}
#define _L2D_INVMATRIX light.InvMatrix
#define _L2D_COLOR light.Color
#define _L2D_POSITION light.Position
#define _L2D_FALLOFF_INTENSITY light.FalloffIntensity
#define _L2D_FALLOFF_DISTANCE light.FalloffDistance
#define _L2D_OUTER_ANGLE light.OuterAngle
#define _L2D_INNER_ANGLE light.InnerAngle
#define _L2D_INNER_RADIUS_MULT light.InnerRadiusMult
#define _L2D_VOLUME_OPACITY light.VolumeOpacity
#define _L2D_SHADOW_INTENSITY light.ShadowIntensity
#define _L2D_LIGHT_TYPE light.LightType
#else
#define UNITY_LIGHT2D_DATA \
\
float4x4 L2DInvMatrix; \
float4 L2DColor; \
float4 L2DPosition; \
float L2DFalloffIntensity; \
float L2DFalloffDistance; \
float L2DOuterAngle; \
float L2DInnerAngle; \
float L2DInnerRadiusMult; \
float L2DVolumeOpacity; \
float L2DShadowIntensity; \
int L2DLightType; \
int L2DLightRenderingLayer; \
#define _L2D_INVMATRIX L2DInvMatrix
#define _L2D_COLOR L2DColor
#define _L2D_POSITION L2DPosition
#define _L2D_FALLOFF_INTENSITY L2DFalloffIntensity
#define _L2D_FALLOFF_DISTANCE L2DFalloffDistance
#define _L2D_OUTER_ANGLE L2DOuterAngle
#define _L2D_INNER_ANGLE L2DInnerAngle
#define _L2D_INNER_RADIUS_MULT L2DInnerRadiusMult
#define _L2D_VOLUME_OPACITY L2DVolumeOpacity
#define _L2D_SHADOW_INTENSITY L2DShadowIntensity
#define _L2D_LIGHT_TYPE L2DLightType
#define _L2D_LIGHT_RENDERING_LAYER L2DLightRenderingLayer
#endif
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 931e5ffca47cea54783e99bf989216b5
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,52 @@
#ifndef _LIT_2D_COMMON
#define _LIT_2D_COMMON
#include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/CombinedShapeLightShared.hlsl"
TEXTURE2D(_MainTex);
SAMPLER(sampler_MainTex);
UNITY_TEXTURE_STREAMING_DEBUG_VARS_FOR_TEX(_MainTex);
TEXTURE2D(_MaskTex);
SAMPLER(sampler_MaskTex);
TEXTURE2D(_NormalMap);
SAMPLER(sampler_NormalMap);
Varyings CommonLitVertex(Attributes input)
{
Varyings o = (Varyings) 0;
UNITY_SETUP_INSTANCE_ID(input);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
o.positionCS = TransformObjectToHClip(input.positionOS);
#if defined(DEBUG_DISPLAY)
o.positionWS = TransformObjectToWorld(input.positionOS);
o.normalWS = TransformObjectToWorldDir(input.normal);
#endif
o.uv = input.uv;
o.lightingUV = half2(ComputeScreenPos(o.positionCS / o.positionCS.w).xy);
return o;
}
half4 CommonLitFragment(Varyings input, half4 color)
{
const half4 main = color * SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, input.uv);
const half4 mask = SAMPLE_TEXTURE2D(_MaskTex, sampler_MaskTex, input.uv);
const half3 normalTS = UnpackNormal(SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, input.uv));
SurfaceData2D surfaceData;
InputData2D inputData;
InitializeSurfaceData(main.rgb, main.a, mask, normalTS, surfaceData);
InitializeInputData(input.uv, input.lightingUV, inputData);
#if defined(DEBUG_DISPLAY)
SETUP_DEBUG_TEXTURE_DATA_2D_NO_TS(inputData, input.positionWS, input.positionCS, _MainTex);
surfaceData.normalWS = input.normalWS;
#endif
return CombinedShapeLightShared(surfaceData, inputData);
}
#endif // _LIT_2D_COMMON
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 4b0b97f5510f6a34681068f902b725d5
ShaderIncludeImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,35 @@
#ifndef _NORMALS_2D_COMMON
#define _NORMALS_2D_COMMON
#include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/NormalsRenderingShared.hlsl"
TEXTURE2D(_MainTex);
SAMPLER(sampler_MainTex);
UNITY_TEXTURE_STREAMING_DEBUG_VARS_FOR_TEX(_MainTex);
TEXTURE2D(_NormalMap);
SAMPLER(sampler_NormalMap);
Varyings CommonNormalsVertex(Attributes input)
{
Varyings o = (Varyings) 0;
UNITY_SETUP_INSTANCE_ID(input);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
o.positionCS = TransformObjectToHClip(input.positionOS);
o.uv = input.uv;
o.normalWS = TransformObjectToWorldDir(input.normal);
o.tangentWS = TransformObjectToWorldDir(input.tangent.xyz);
o.bitangentWS = cross(o.normalWS, o.tangentWS) * input.tangent.w;
return o;
}
half4 CommonNormalsFragment(Varyings input, half4 color)
{
const half4 mainTex = color * SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, input.uv);
const half3 normalTS = UnpackNormal(SAMPLE_TEXTURE2D(_NormalMap, sampler_NormalMap, input.uv));
return NormalsRenderingShared(mainTex, normalTS, input.tangentWS.xyz, input.bitangentWS.xyz, input.normalWS.xyz);
}
#endif // _NORMALS_2D_COMMON
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 694e01e6361351641bfb5cc5fc69f087
ShaderIncludeImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,16 @@
#if !defined(NORMALS_RENDERING_PASS)
#define NORMALS_RENDERING_PASS
half4 NormalsRenderingShared(half4 color, half3 normalTS, half3 tangent, half3 bitangent, half3 normal)
{
// Account for sprite flip
normalTS.xy *= unity_SpriteProps.xy;
half3 normalWS = TransformTangentToWorld(normalTS, half3x3(tangent.xyz, bitangent.xyz, normal.xyz));
half4 normalColor;
normalColor.rgb = 0.5 * ((normalWS)+1);
normalColor.a = color.a; // used for blending
return normalColor;
}
#endif
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: b9c3f97797bd9374cb2607614554fe54
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,126 @@
#if !defined(SHADOW_PROJECT_VERTEX)
#define SHADOW_PROJECT_VERTEX
#define ToFloat(x) x
#define Deg2Rad(x) (x * 3.14159265359f / 180)
#define MIN_SHADOW_Y 0.000001f
struct Attributes
{
float3 vertex : POSITION;
float4 packed0 : TANGENT;
};
struct Varyings
{
float4 vertex : SV_POSITION;
float2 shadow : TEXCOORD0;
};
uniform float3 _LightPos;
uniform float4x4 _ShadowModelMatrix; // This is a custom model matrix without scaling
uniform float4x4 _ShadowModelInvMatrix;
uniform float3 _ShadowModelScale; // This is the scale
uniform float _ShadowRadius;
uniform float _ShadowContractionDistance;
uniform float _SoftShadowAngle;
float AngleFromDir(float3 dir)
{
// Assumes dir is normalized. Will return -180 to 180
float angle = acos(dir.x);
float gt180 = ceil(saturate(-dir.y)); // Greater than 180
return gt180 * -angle + (1 - gt180) * angle;
}
float3 DirFromAngle(float angle)
{
return float3(cos(angle), sin(angle), 0);
}
float2 CalculateShadowValue(float shadowType)
{
float isLeft = ToFloat(shadowType == 1);
float isRight = ToFloat(shadowType == 3);
return float2(-isLeft + isRight, isLeft + isRight);
}
float3 SoftShadowDir(float3 lightDir, float3 vertex0, float3 vertex1, float angleOp, float softShadowAngle)
{
float lightAngle = AngleFromDir(lightDir);
float edgeAngle = AngleFromDir(normalize(vertex1 - vertex0));
float softAngle = lightAngle + angleOp * softShadowAngle;
return DirFromAngle(softAngle);
}
float4 ProjectShadowVertexToWS(float2 vertex, float2 otherEndPt, float2 contractDir, float shadowType, float3 lightPos, float3 shadowModelScale, float4x4 shadowModelMatrix, float4x4 shadowModelInvMatrix, float shadowContractionDistance, float shadowRadius, float softShadowAngle)
{
#if NOT_TRANSFORMABLE
float3 vertexOS0 = float3(vertex.x, vertex.y, 0);
float3 vertexOS1 = float3(otherEndPt.x, otherEndPt.y, 0); // the tangent has the adjacent point stored in zw
float3 lightPosOS = float3(lightPos.xy, 0); // Transform the light into local space
#else
float3 vertexOS0 = float3(vertex.x * shadowModelScale.x, vertex.y * shadowModelScale.y, 0);
float3 vertexOS1 = float3(otherEndPt.x * shadowModelScale.x, otherEndPt.y * shadowModelScale.y, 0); // the tangent has the adjacent point stored in zw
float3 lightPosOS = float3(mul(shadowModelInvMatrix, float4(lightPos.x, lightPos.y, lightPos.z, 1)).xy, 0); // Transform the light into local space
#endif
float3 unnormalizedLightDir0 = vertexOS0 - lightPosOS;
float3 unnormalizedLightDir1 = vertexOS1 - lightPosOS;
float3 lightDir0 = normalize(unnormalizedLightDir0);
float3 lightDir1 = normalize(unnormalizedLightDir1);
float3 avgLightDir = normalize(lightDir0 + lightDir1);
float isSoftShadow = ToFloat(shadowType >= 1);
float isHardShadow = ToFloat(shadowType == 0);
float isShadowVertex = saturate(isSoftShadow + isHardShadow);
float3 softShadowDir = SoftShadowDir(lightDir0, vertexOS0, vertexOS1, shadowType - 2, softShadowAngle);
float3 hardShadowDir = lightDir0;
float3 shadowDir = isSoftShadow * softShadowDir + isHardShadow * hardShadowDir;
float lightDistance = length(unnormalizedLightDir0);
float hardShadowLength = max(shadowRadius / dot(lightDir0, avgLightDir), lightDistance);
float softShadowLength = shadowRadius * (1 / cos(softShadowAngle));
// Tests to make sure the light is between 0-90 degrees to the normal. Will be one if it is, zero if not.
float3 shadowOffset = (isSoftShadow * softShadowLength + isHardShadow * hardShadowLength) * shadowDir;
float3 contractedVertexPos = vertexOS0 + float3(shadowContractionDistance * contractDir.xy, 0);
// If we are suppose to extrude this point, then
float3 finalVertexOS = isShadowVertex * (lightPosOS + shadowOffset) + (1 - isShadowVertex) * contractedVertexPos;
#if NOT_TRANSFORMABLE
return float4(finalVertexOS, 1);
#else
return mul(shadowModelMatrix, float4(finalVertexOS, 1));
#endif
}
Varyings ProjectShadow(Attributes v)
{
Varyings o;
float2 otherEndPt = v.packed0.zw;
float shadowType = v.packed0.x;
float2 position = v.vertex.xy;
float softShadowAngle = _SoftShadowAngle;
float2 contractDir = 0;
float4 positionWS = ProjectShadowVertexToWS(position, otherEndPt, contractDir, shadowType, _LightPos, _ShadowModelScale, _ShadowModelMatrix, _ShadowModelInvMatrix, _ShadowContractionDistance, _ShadowRadius, softShadowAngle);
o.vertex = mul(GetWorldToHClipMatrix(), positionWS);
o.shadow = CalculateShadowValue(shadowType);
return o;
}
#endif
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 97832dc646b4fb4498bf5aa61e366c13
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,9 @@
#ifndef SHAPE_LIGHT_PRAGMAS
#define SHAPE_LIGHT_PRAGMAS
#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 __
#endif
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 4151cfb2494f10243a255c8a553306e3
ShaderIncludeImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,6 @@
#ifndef SHAPE_LIGHT_VARIABLES
#define SHAPE_LIGHT_VARIABLES
half _HDREmulationScale;
#endif
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 5ce9e51bf709e4e459da190b3cf4d110
ShaderIncludeImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,43 @@
#if !defined(SPRITE_MASK_SHARED)
#define SPRITE_MASK_SHARED
// alpha below which a mask should discard a pixel, thereby preventing the stencil buffer from being marked with the Mask's presence
half _Cutoff;
TEXTURE2D(_MainTex);
SAMPLER(sampler_MainTex);
struct Attributes
{
float4 positionOS : POSITION;
half2 texcoord : TEXCOORD0;
};
struct Varyings
{
float4 positionCS : SV_POSITION;
half2 uv : TEXCOORD0;
};
Varyings MaskRenderingVertex(Attributes input)
{
Varyings output;
output.positionCS = TransformObjectToHClip(input.positionOS.xyz);
output.uv = input.texcoord;
return output;
}
half4 MaskRenderingFragment(Varyings input) : SV_Target
{
half4 c = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, input.uv);
// for masks: discard pixel if alpha falls below MaskingCutoff
clip(c.a - _Cutoff);
return half4(1, 1, 1, 0.2);
}
#endif
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: c9ac51d204bc24b118ec6bc5ab6c29c6
ShaderIncludeImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,38 @@
#ifndef SURFACE_DATA_2D_INCLUDED
#define SURFACE_DATA_2D_INCLUDED
struct SurfaceData2D
{
half3 albedo;
half alpha;
half4 mask;
half3 normalTS;
#if defined(DEBUG_DISPLAY)
half3 normalWS;
#endif
};
void InitializeSurfaceData(half3 albedo, half alpha, half4 mask, half3 normalTS, out SurfaceData2D surfaceData)
{
surfaceData = (SurfaceData2D)0;
surfaceData.albedo = albedo;
surfaceData.alpha = alpha;
surfaceData.mask = mask;
surfaceData.normalTS = normalTS;
}
void InitializeSurfaceData(half3 albedo, half alpha, half4 mask, out SurfaceData2D surfaceData)
{
const half3 normalTS = half3(0, 0, 1);
InitializeSurfaceData(albedo, alpha, mask, normalTS, surfaceData);
}
void InitializeSurfaceData(half3 albedo, half alpha, out SurfaceData2D surfaceData)
{
InitializeSurfaceData(albedo, alpha, 1, surfaceData);
}
#endif
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 2861459260b14a2481f8f8e7f6637d8f
timeCreated: 1614008064
@@ -0,0 +1,287 @@
Shader "Hidden/Light2D"
{
Properties
{
[HideInInspector] _SrcBlend("__src", Float) = 1.0
[HideInInspector] _DstBlend("__dst", Float) = 0.0
}
SubShader
{
Tags { "Queue" = "Transparent" "RenderType" = "Transparent" "RenderPipeline" = "UniversalPipeline" }
Pass
{
Blend [_SrcBlend][_DstBlend]
ZWrite Off
ZTest Off
Cull Off
HLSLPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma multi_compile_local USE_NORMAL_MAP __
#pragma multi_compile_local USE_SHADOW_MAP __
#pragma multi_compile_local USE_ADDITIVE_BLENDING __
#pragma multi_compile_local USE_VOLUMETRIC __
#pragma multi_compile_local USE_POINT_LIGHT_COOKIES __
#pragma multi_compile_local LIGHT_QUALITY_FAST __
#pragma multi_compile_fragment _LIGHT_LAYERS __
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/ShapeLightShared.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/LightingUtility.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/CommonLighting.hlsl"
struct Attributes
{
float3 positionOS : POSITION;
float4 color : COLOR;
float2 uv : TEXCOORD0;
};
struct Varyings
{
float4 positionCS : SV_POSITION;
half4 color : COLOR;
half2 uv : TEXCOORD0;
half2 lookupUV : TEXCOORD1; // This is used for light relative direction
SHADOW_COORDS(TEXCOORD2)
NORMALS_LIGHTING_COORDS(TEXCOORD3, TEXCOORD4)
LIGHT_OFFSET(TEXCOORD5)
};
TEXTURE2D(_CookieTex); // This can either be a sprite texture uv or a falloff texture
SAMPLER(sampler_CookieTex);
TEXTURE2D(_FalloffLookup);
SAMPLER(sampler_FalloffLookup);
TEXTURE2D(_LightLookup);
SAMPLER(sampler_LightLookup);
half4 _LightLookup_TexelSize;
TYPED_TEXTURE2D_X(uint, _CameraRenderingLayersTexture);
#if USE_POINT_LIGHT_COOKIES
TEXTURE2D(_PointLightCookieTex);
SAMPLER(sampler_PointLightCookieTex);
#endif
NORMALS_LIGHTING_VARIABLES
SHADOW_VARIABLES
UNITY_LIGHT2D_DATA
half _InverseHDREmulationScale;
Varyings vert_shape_shared(float3 position, Attributes a, PerLight2D light)
{
Varyings o = (Varyings)0;
o.positionCS = TransformObjectToHClip(position);
o.color = _L2D_COLOR * _InverseHDREmulationScale;
o.color.a = a.color.a;
#if USE_VOLUMETRIC
o.color.a = _L2D_COLOR.a * _L2D_VOLUME_OPACITY;
#endif
// If Sprite use UV.
o.uv = (_L2D_LIGHT_TYPE == 2) ? a.uv : float2(a.color.a, _L2D_FALLOFF_INTENSITY);
float4 worldSpacePos;
worldSpacePos.xyz = TransformObjectToWorld(position);
worldSpacePos.w = 1;
TRANSFER_NORMALS_LIGHTING(o, worldSpacePos, _L2D_POSITION.xyz, _L2D_POSITION.w)
TRANSFER_SHADOWS(o)
return o;
}
Varyings vert_provider(Attributes a, PerLight2D light)
{
return vert_shape_shared(a.positionOS, a, light);
}
Varyings vert_shape(Attributes a, PerLight2D light)
{
Varyings o = (Varyings)0;
float3 positionOS = a.positionOS;
positionOS.x = positionOS.x + _L2D_FALLOFF_DISTANCE * a.color.r;
positionOS.y = positionOS.y + _L2D_FALLOFF_DISTANCE * a.color.g;
return vert_shape_shared(positionOS, a, light);
}
Varyings vert_point(Attributes a, PerLight2D light)
{
Varyings output = (Varyings)0;
output.positionCS = TransformObjectToHClip(a.positionOS);
output.uv = a.uv;
float4 worldSpacePos;
worldSpacePos.xyz = TransformObjectToWorld(a.positionOS);
worldSpacePos.w = 1;
float4 lightSpacePos = mul(_L2D_INVMATRIX, worldSpacePos);
float halfTexelOffset = 0.5 * _LightLookup_TexelSize.x;
output.lookupUV = 0.5 * (lightSpacePos.xy + 1) + halfTexelOffset;
TRANSFER_NORMALS_LIGHTING(output, worldSpacePos, _L2D_POSITION.xyz, _L2D_POSITION.w)
TRANSFER_SHADOWS(output)
return output;
}
Varyings vert(Attributes attributes)
{
PerLight2D light;
#if USE_STRUCTURED_BUFFER_FOR_LIGHT2D_DATA
light = GetPerLight2D(attributes.color);
#endif
switch (_L2D_LIGHT_TYPE)
{
case 0:
case 1:
case 2:
{
Varyings v = vert_shape(attributes, light);
v.lightOffset = attributes.color;
return v;
}
break;
case 3:
{
Varyings v = vert_point(attributes, light);
v.lightOffset = attributes.color;
return v;
}
break;
case 5:
{
Varyings v = vert_provider(attributes, light);
v.lightOffset = attributes.color;
return v;
}
}
Varyings v = (Varyings)0;
return v;
}
FragmentOutput frag_shape(Varyings i, PerLight2D light)
{
half4 lightColor = i.color;
if (_L2D_LIGHT_TYPE == 2)
{
half4 cookie = SAMPLE_TEXTURE2D(_CookieTex, sampler_CookieTex, i.uv);
#if USE_ADDITIVE_BLENDING
lightColor *= cookie * cookie.a;
#else
lightColor *= cookie;
#endif
}
else
{
#if USE_ADDITIVE_BLENDING
lightColor *= SAMPLE_TEXTURE2D(_FalloffLookup, sampler_FalloffLookup, i.uv).r;
#elif USE_VOLUMETRIC
lightColor.a = i.color.a * SAMPLE_TEXTURE2D(_FalloffLookup, sampler_FalloffLookup, i.uv).r;
#else
lightColor.a = SAMPLE_TEXTURE2D(_FalloffLookup, sampler_FalloffLookup, i.uv).r;
#endif
}
#if !USE_VOLUMETRIC
APPLY_NORMALS_LIGHTING(i, lightColor, _L2D_POSITION.xyz, _L2D_POSITION.w);
#endif
#if USE_SHADOW_MAP
APPLY_SHADOWS(i, lightColor, _L2D_SHADOW_INTENSITY);
#endif
return ToFragmentOutput(lightColor);
}
FragmentOutput frag_point(Varyings i, PerLight2D light)
{
half4 lookupValue = SAMPLE_TEXTURE2D(_LightLookup, sampler_LightLookup, i.lookupUV); // r = distance, g = angle, b = x direction, a = y direction
// Inner Radius
half attenuation = saturate(_L2D_INNER_RADIUS_MULT * lookupValue.r); // This is the code to take care of our inner radius
// Spotlight
half isFullSpotlight = _L2D_INNER_ANGLE == 1.0f;
half spotAttenuation = saturate((_L2D_OUTER_ANGLE - lookupValue.g + isFullSpotlight) * (1.0f / (_L2D_OUTER_ANGLE - _L2D_INNER_ANGLE)));
attenuation = attenuation * spotAttenuation;
half2 mappedUV;
mappedUV.x = attenuation;
mappedUV.y = _L2D_FALLOFF_INTENSITY;
attenuation = SAMPLE_TEXTURE2D(_FalloffLookup, sampler_FalloffLookup, mappedUV).r;
half4 lightColor = _L2D_COLOR;
#if USE_POINT_LIGHT_COOKIES
half4 cookieColor = SAMPLE_TEXTURE2D(_PointLightCookieTex, sampler_PointLightCookieTex, i.lookupUV);
lightColor = cookieColor * _L2D_COLOR;
#endif
#if USE_ADDITIVE_BLENDING || USE_VOLUMETRIC
lightColor *= attenuation;
#else
lightColor.a = attenuation;
#endif
#if !USE_VOLUMETRIC
APPLY_NORMALS_LIGHTING(i, lightColor, _L2D_POSITION.xyz, _L2D_POSITION.w);
#endif
#if USE_SHADOW_MAP
APPLY_SHADOWS(i, lightColor, _L2D_SHADOW_INTENSITY);
#endif
#if USE_VOLUMETRIC
lightColor *= _L2D_VOLUME_OPACITY;
#endif
return ToFragmentOutput(lightColor * _InverseHDREmulationScale);
}
FragmentOutput frag(Varyings i)
{
#if _LIGHT_LAYERS && !USE_VOLUMETRIC
uint2 pixelCoords = i.positionCS.xy;
uint lightLayers = _L2D_LIGHT_RENDERING_LAYER;
uint meshRenderingLayers = LOAD_TEXTURE2D_X(_CameraRenderingLayersTexture, pixelCoords);
if (!IsMatchingLightLayer(lightLayers, meshRenderingLayers))
discard;
#endif
PerLight2D light;
#if USE_STRUCTURED_BUFFER_FOR_LIGHT2D_DATA
light = GetPerLight2D(i.lightOffset);
#endif
switch (_L2D_LIGHT_TYPE)
{
case 3:
{
FragmentOutput output = frag_point(i, light);
return output;
}
break;
default:
{
FragmentOutput output = frag_shape(i, light);
return output;
}
}
}
ENDHLSL
}
}
}
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 3f6c848ca3d7bca4bbe846546ac701a1
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,146 @@
Shader "Universal Render Pipeline/2D/Mesh2D-Lit-Default"
{
Properties
{
_MainTex("Diffuse", 2D) = "white" {}
_MaskTex("Mask", 2D) = "white" {}
_NormalMap("Normal Map", 2D) = "bump" {}
[HideInInspector] _White("Tint", Color) = (1,1,1,1) // Added to break SRP batching. Work around for issue with SRP Batching
}
SubShader
{
Tags {"Queue" = "Transparent" "RenderType" = "Transparent" "RenderPipeline" = "UniversalPipeline" }
Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha
Cull Back
ZWrite On
Stencil
{
Ref 128 // Put this in the last bit of our stencil value for maximum compatibility with sprite mask
Comp always
Pass replace
}
Pass
{
Tags { "LightMode" = "Universal2D" }
HLSLPROGRAM
#include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/Core2D.hlsl"
#pragma vertex LitVertex
#pragma fragment LitFragment
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/ShapeLightShared.hlsl"
// GPU Instancing
#pragma multi_compile_instancing
#pragma multi_compile _ DEBUG_DISPLAY
struct Attributes
{
COMMON_2D_INPUTS
};
struct Varyings
{
COMMON_2D_LIT_OUTPUTS
};
float4 _White;
#include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/Lit2DCommon.hlsl"
Varyings LitVertex(Attributes input)
{
return CommonLitVertex(input);
}
half4 LitFragment(Varyings input) : SV_Target
{
return CommonLitFragment(input, _White);
}
ENDHLSL
}
Pass
{
Tags { "LightMode" = "NormalsRendering"}
HLSLPROGRAM
#include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/Core2D.hlsl"
#pragma vertex NormalsRenderingVertex
#pragma fragment NormalsRenderingFragment
// GPU Instancing
#pragma multi_compile_instancing
struct Attributes
{
COMMON_2D_NORMALS_INPUTS
};
struct Varyings
{
COMMON_2D_NORMALS_OUTPUTS
};
float4 _White;
#include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/Normals2DCommon.hlsl"
Varyings NormalsRenderingVertex(Attributes input)
{
return CommonNormalsVertex(input);
}
half4 NormalsRenderingFragment(Varyings input) : SV_Target
{
return CommonNormalsFragment(input, _White);
}
ENDHLSL
}
Pass
{
Tags { "LightMode" = "UniversalForward" "Queue"="Transparent" "RenderType"="Transparent"}
HLSLPROGRAM
#include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/Core2D.hlsl"
#pragma vertex UnlitVertex
#pragma fragment UnlitFragment
// GPU Instancing
#pragma multi_compile_instancing
struct Attributes
{
COMMON_2D_INPUTS
};
struct Varyings
{
COMMON_2D_OUTPUTS
};
float4 _White;
#include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/2DCommon.hlsl"
Varyings UnlitVertex(Attributes input)
{
return CommonUnlitVertex(input);
}
half4 UnlitFragment(Varyings input) : SV_Target
{
return CommonUnlitFragment(input, _White);
}
ENDHLSL
}
}
}
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 4e90a8289da1f3943885176e4f83e35c
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,68 @@
Shader "Universal Render Pipeline/2D/Mesh2D-Unlit-Default"
{
Properties
{
_MainTex("Diffuse", 2D) = "white" {}
[HideInInspector] _White("Tint", Color) = (1,1,1,1) // Added to break SRP batching. Work around for issue with SRP Batching
}
SubShader
{
Tags {"Queue" = "Transparent" "RenderType" = "Transparent" "RenderPipeline" = "UniversalPipeline" }
Stencil
{
Ref 128 // Put this in the last bit of our stencil value for maximum compatibility with sprite mask
Comp always
Pass replace
}
Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha
Cull Back
ZWrite On
Pass
{
Stencil
{
Ref 128 // Put this in the last bit of our stencil value for maximum compatibility with sprite mask
Comp always
Pass replace
}
HLSLPROGRAM
#include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/Core2D.hlsl"
#pragma vertex UnlitVertex
#pragma fragment UnlitFragment
// GPU Instancing
#pragma multi_compile_instancing
struct Attributes
{
COMMON_2D_INPUTS
};
struct Varyings
{
COMMON_2D_OUTPUTS
};
float4 _White;
#include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/2DCommon.hlsl"
Varyings UnlitVertex(Attributes input)
{
return CommonUnlitVertex(input);
}
half4 UnlitFragment(Varyings input) : SV_Target
{
return CommonUnlitFragment(input, _White);
}
ENDHLSL
}
}
}
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 8c3bb6de0c0e7c047b65c077249507e5
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,184 @@
Shader "2D/RenderAs2D-Flattening"
{
Properties
{
// Legacy properties. They're here so that materials using this shader can gracefully fallback to the legacy sprite shader.
[HideInInspector] _Color("Tint", Color) = (1,1,1,1)
[HideInInspector] _RendererColor("RendererColor", Color) = (1,1,1,1)
[HideInInspector] _Flip("Flip", Vector) = (1,1,1,1)
[HideInInspector] _AlphaTex("External Alpha", 2D) = "white" {}
[HideInInspector] _EnableExternalAlpha("Enable External Alpha", Float) = 0
}
SubShader
{
Tags {"Queue" = "Transparent" "RenderType" = "Transparent" "RenderPipeline" = "UniversalPipeline" }
Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha
Cull Off
ZTest Always
ZWrite On
ColorMask 0
Stencil
{
Ref 128 // Put this in the last bit of our stencil value for maximum compatibility with sprite mask
ReadMask 128
WriteMask 128
Comp equal
Pass zero
}
Pass
{
Tags { "LightMode" = "Universal2D" }
HLSLPROGRAM
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#pragma vertex ColorVertex
#pragma fragment ColorFragment
struct Attributes
{
float3 positionOS : POSITION;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct Varyings
{
float4 positionCS : SV_POSITION;
UNITY_VERTEX_OUTPUT_STEREO
};
Varyings ColorVertex(Attributes v)
{
Varyings o = (Varyings)0;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
// We need to flatten the object relative to the camera. After it has been transformed to clip space, we can set the z value to the object's origin.
float4 originCS = TransformObjectToHClip(float3(0, 0, 0));
o.positionCS = TransformObjectToHClip(v.positionOS);
//o.positionCS.z = (originCS.z * o.positionCS.w) / originCS.w;
o.positionCS.z = 0;
return o;
}
half4 ColorFragment(Varyings i) : SV_Target
{
const half4 color = half4(0,0,1,1);
return color;
}
ENDHLSL
}
Pass
{
Tags { "LightMode" = "NormalsRendering"}
HLSLPROGRAM
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#pragma vertex NormalsRenderingVertex
#pragma fragment NormalsRenderingFragment
struct Attributes
{
float3 positionOS : POSITION;
float4 color : COLOR;
float2 uv : TEXCOORD0;
float3 normal : NORMAL;
float4 tangent : TANGENT;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct Varyings
{
float4 positionCS : SV_POSITION;
half4 color : COLOR;
float2 uv : TEXCOORD0;
half3 normalWS : TEXCOORD1;
half3 tangentWS : TEXCOORD2;
half3 bitangentWS : TEXCOORD3;
UNITY_VERTEX_OUTPUT_STEREO
};
TEXTURE2D(_MainTex);
SAMPLER(sampler_MainTex);
TEXTURE2D(_NormalMap);
SAMPLER(sampler_NormalMap);
half4 _NormalMap_ST; // Is this the right way to do this?
Varyings NormalsRenderingVertex(Attributes attributes)
{
Varyings o = (Varyings)0;
UNITY_SETUP_INSTANCE_ID(attributes);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
float4 originCS = TransformObjectToHClip(float3(0, 0, 0));
o.positionCS = TransformObjectToHClip(attributes.positionOS);
//o.positionCS.z = (originCS.z * o.positionCS.w) / originCS.w;
o.positionCS.z = 0;
return o;
}
#include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/NormalsRenderingShared.hlsl"
half4 NormalsRenderingFragment(Varyings i) : SV_Target
{
const half4 color = half4(0,0,1,1);
return color;
}
ENDHLSL
}
Pass
{
Tags { "LightMode" = "UniversalForward" "Queue"="Transparent" "RenderType"="Transparent"}
ZTest Never
ZWrite Off
HLSLPROGRAM
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#pragma vertex UnlitVertex
#pragma fragment UnlitFragment
struct Attributes
{
float3 positionOS : POSITION;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct Varyings
{
float4 positionCS : SV_POSITION;
UNITY_VERTEX_OUTPUT_STEREO
};
Varyings UnlitVertex(Attributes attributes)
{
Varyings o = (Varyings)0;
UNITY_SETUP_INSTANCE_ID(attributes);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
o.positionCS = TransformObjectToHClip(attributes.positionOS);
return o;
}
float4 UnlitFragment(Varyings i) : SV_Target
{
return float4(0,0,0,0);
}
ENDHLSL
}
}
Fallback "Sprites/Default"
}
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 74659692f6350ba46b88180d9c826630
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,76 @@
Shader "Hidden/2D/RenderingLayerMask"
{
Properties
{
_MainTex("Diffuse", 2D) = "white" {}
_MaskTex("Mask", 2D) = "white" {}
_NormalMap("Normal Map", 2D) = "bump" {}
[MaterialToggle] _ZWrite("ZWrite", Float) = 0
// Legacy properties. They're here so that materials using this shader can gracefully fallback to the legacy sprite shader.
[HideInInspector] _Color("Tint", Color) = (1,1,1,1)
}
SubShader
{
ZWrite [_ZWrite]
ZTest Off
Blend Off
Cull Off
Pass
{
HLSLPROGRAM
#include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/Core2D.hlsl"
#pragma vertex UnlitVertex
#pragma fragment UnlitFragment
struct Attributes
{
COMMON_2D_INPUTS
half4 color : COLOR;
UNITY_SKINNED_VERTEX_INPUTS
};
struct Varyings
{
COMMON_2D_OUTPUTS
half4 color : COLOR;
};
#include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/2DCommon.hlsl"
// GPU Instancing
#pragma multi_compile_instancing
#pragma multi_compile _ DEBUG_DISPLAY SKINNED_SPRITE
// NOTE: Do not ifdef the properties here as SRP batcher can not handle different layouts.
CBUFFER_START(UnityPerMaterial)
half4 _Color;
CBUFFER_END
Varyings UnlitVertex(Attributes input)
{
UNITY_SKINNED_VERTEX_COMPUTE(input);
SetUpSpriteInstanceProperties();
input.positionOS = UnityFlipSprite(input.positionOS, unity_SpriteProps.xy);
Varyings o = CommonUnlitVertex(input);
o.color = input.color * _Color * unity_SpriteColor;
return o;
}
void UnlitFragment(Varyings input, out uint outRenderingLayers : SV_Target0)
{
half4 color = CommonUnlitFragment(input, input.color);
if (color.a == 0.0f)
discard;
outRenderingLayers = GetMeshRenderingLayer();
}
ENDHLSL
}
}
}
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 9ac9bae9f40d7dc4a80dbf809b9544aa
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,118 @@
Shader "Hidden/ShadowProjected2D"
{
Properties
{
[HideInInspector] _ShadowColorMask("__ShadowColorMask", Float) = 0
}
SubShader
{
Tags { "RenderType"="Transparent" }
Cull Off
BlendOp Max
Blend One One, One One
ZWrite Off
ZTest Always
Stencil
{
Ref 1
Comp NotEqual
Pass Keep
}
// This pass draws the projected shadows
Pass
{
Name "Projected Shadow (R)"
// Draw the shadow
ColorMask R
HLSLPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/ShadowProjectVertex.hlsl"
#pragma multi_compile _ NOT_TRANSFORMABLE
TEXTURE2D(_FalloffLookup);
SAMPLER(sampler_FalloffLookup);
half _ShadowSoftnessFalloffIntensity;
Varyings vert (Attributes v)
{
return ProjectShadow(v);
}
half4 frag(Varyings i) : SV_Target
{
half2 mappedUV;
float clamppedY = clamp(i.shadow.y, MIN_SHADOW_Y, 1);
float value = 1.0f - saturate(abs(i.shadow.x) / clamppedY);
mappedUV.x = value;
mappedUV.y = _ShadowSoftnessFalloffIntensity;
value = SAMPLE_TEXTURE2D(_FalloffLookup, sampler_FalloffLookup, mappedUV).r;
half4 color = half4(value, value, value, value);
return color;
}
ENDHLSL
}
// This pass draws the projected unshadowing
Pass
{
Stencil
{
Ref 1
Comp Equal
Pass Keep
}
Name "Projected Unshadow (G) - Stencil: Ref 1, Comp Eq, Pass Keep"
// Draw the shadow
ColorMask G
HLSLPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/ShadowProjectVertex.hlsl"
#pragma multi_compile _ NOT_TRANSFORMABLE
TEXTURE2D(_FalloffLookup);
SAMPLER(sampler_FalloffLookup);
half _ShadowSoftnessFalloffIntensity;
Varyings vert (Attributes v)
{
return ProjectShadow(v);
}
half4 frag(Varyings i) : SV_Target
{
half2 mappedUV;
float clamppedY = clamp(i.shadow.y, MIN_SHADOW_Y, 1);
float value = 1.0f - saturate(abs(i.shadow.x) / clamppedY);
mappedUV.x = value;
mappedUV.y = _ShadowSoftnessFalloffIntensity;
value = SAMPLE_TEXTURE2D(_FalloffLookup, sampler_FalloffLookup, mappedUV).r;
half4 color = half4(value, value, value, value);
return color;
}
ENDHLSL
}
}
}
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: ce09d4a80b88c5a4eb9768fab4f1ee00
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,54 @@
Shader "Hidden/Shadow2DShadowGeometry"
{
Properties
{
[HideInInspector] _ShadowColorMask("__ShadowColorMask", Int) = 1
}
SubShader
{
Tags { "RenderType"="Opaque" }
Cull Off
BlendOp Max
Blend One One
ZWrite Off
ZTest Always
// Process the shadow
Pass
{
Name "Draw Geometry Shadow (R)"
ColorMask R
HLSLPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
struct Attributes
{
float4 vertex : POSITION;
};
struct Varyings
{
float4 vertex : SV_POSITION;
};
Varyings vert (Attributes v)
{
Varyings o;
o.vertex = TransformObjectToHClip(v.vertex.xyz);
return o;
}
half4 frag(Varyings i) : SV_Target
{
return half4(1,1,1,1);
}
ENDHLSL
}
}
}
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 19349a0f9a7ed4c48a27445bcf92e5e1
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,74 @@
Shader "Hidden/Shadow2DShadowSprite"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_Color("Tint", Color) = (1,1,1,1)
[HideInInspector] _ShadowColorMask("__ShadowColorMask", Int) = 1
}
SubShader
{
Tags { "RenderType"="Opaque" }
Cull Off
BlendOp Max
Blend One One
ZWrite Off
ZTest Always
// Process the shadow
Pass
{
Name "Draw Sprite Shadow (R)"
ColorMask R
HLSLPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma multi_compile _ SKINNED_SPRITE
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/UnityInput.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/Core2D.hlsl"
struct Attributes
{
float3 positionOS : POSITION;
float2 uv : TEXCOORD0;
float4 color : COLOR;
UNITY_SKINNED_VERTEX_INPUTS
};
struct Varyings
{
float4 vertex : SV_POSITION;
float2 uv : TEXCOORD0;
float4 color : COLOR;
};
sampler2D _MainTex;
float4 _MainTex_ST;
float4 _Color;
Varyings vert (Attributes v)
{
Varyings o;
UNITY_SKINNED_VERTEX_COMPUTE(v);
v.positionOS = UnityFlipSprite(v.positionOS, unity_SpriteProps.xy);
o.vertex = TransformObjectToHClip(v.positionOS);
o.uv = TRANSFORM_TEX(v.uv, _MainTex);
o.color = _Color.a * v.color;
return o;
}
half4 frag(Varyings i) : SV_Target
{
half4 main = i.color * tex2D(_MainTex, i.uv);
return half4(main.a, main.a, main.a, main.a);
}
ENDHLSL
}
}
}
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 44fc62292b65ab04eabcf310e799ccf6
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,112 @@
Shader "Hidden/Shadow2DUnshadowGeometry"
{
Properties
{
[HideInInspector] _ShadowColorMask("__ShadowColorMask", Int) = 0
}
SubShader
{
Tags { "RenderType" = "Transparent" }
Pass
{
Stencil
{
Ref 1
Comp Always
Pass Replace
}
Cull Off
ZWrite Off
ZTest Always
ColorMask 0
Name "Geometry Unshadow (0) - Stencil: Ref 1, Comp Always, Pass Replace"
HLSLPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
struct Attributes
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct Varyings
{
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
};
sampler2D _MainTex;
float4 _MainTex_ST;
Varyings vert(Attributes v)
{
Varyings o;
o.vertex = TransformObjectToHClip(v.vertex.xyz);
o.uv = TRANSFORM_TEX(v.uv, _MainTex);
return o;
}
half4 frag(Varyings i) : SV_Target
{
return half4(1, 1, 1, 1);
}
ENDHLSL
}
Pass
{
Stencil
{
Ref 0
Comp Always
Pass Replace
}
Cull Off
Blend One One
BlendOp Add
ZWrite Off
ZTest Always
ColorMask B
Name "Geometry Unshadow (B) - Stencil: Ref 0, Comp Always, Pass Replace"
HLSLPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
struct Attributes
{
float4 vertex : POSITION;
};
struct Varyings
{
float4 vertex : SV_POSITION;
};
Varyings vert(Attributes v)
{
Varyings o;
o.vertex = TransformObjectToHClip(v.vertex.xyz);
return o;
}
half4 frag(Varyings i) : SV_Target
{
return half4(1, 1, 1, 1);
}
ENDHLSL
}
}
}
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 77774d9009bb81447b048c907d4c6273
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,157 @@
Shader "Hidden/Shadow2DUnshadowSprite"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_Color("Tint", Color) = (1,1,1,1)
[HideInInspector] _ShadowColorMask("__ShadowColorMask", Int) = 0
}
SubShader
{
Tags { "RenderType" = "Transparent" }
Pass
{
Stencil
{
Ref 1
Comp Always
Pass Replace
}
Cull Off
Blend One One
BlendOp Add
ZWrite Off
ZTest Always
ColorMask B
Name "Sprite Unshadow (B) - Stencil: Ref 1, Comp Always, Pass Replace"
HLSLPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma multi_compile _ SKINNED_SPRITE
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/UnityInput.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/Core2D.hlsl"
struct Attributes
{
float3 positionOS : POSITION;
float2 uv : TEXCOORD0;
float4 color : COLOR;
UNITY_SKINNED_VERTEX_INPUTS
};
struct Varyings
{
float4 vertex : SV_POSITION;
float2 uv : TEXCOORD0;
float4 color : COLOR;
};
sampler2D _MainTex;
float4 _MainTex_ST;
float4 _Color;
float _ShadowAlphaCutoff;
Varyings vert(Attributes v)
{
Varyings o;
UNITY_SKINNED_VERTEX_COMPUTE(v);
v.positionOS = UnityFlipSprite(v.positionOS, unity_SpriteProps.xy);
o.vertex = TransformObjectToHClip(v.positionOS);
o.uv = TRANSFORM_TEX(v.uv, _MainTex);
o.color = _Color.a * v.color;
return o;
}
half4 frag(Varyings i) : SV_Target
{
half4 main = i.color * tex2D(_MainTex, i.uv);
if (main.a <= _ShadowAlphaCutoff)
discard;
return half4(0, 0, main.a, 0);
}
ENDHLSL
}
// Remove stencil from previous stencil pass
Pass
{
Stencil
{
Ref 0
Comp Always
Pass Replace
}
Blend One One
BlendOp Add
Cull Off
ZWrite Off
ZTest Always
ColorMask 0
Name "Sprite Unshadow (B) - Stencil: Ref 0, Comp Always, Pass Replace"
HLSLPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma multi_compile _ SKINNED_SPRITE
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/UnityInput.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/Core2D.hlsl"
struct Attributes
{
float3 positionOS : POSITION;
float2 uv : TEXCOORD0;
float4 color : COLOR;
UNITY_SKINNED_VERTEX_INPUTS
};
struct Varyings
{
float4 vertex : SV_POSITION;
float2 uv : TEXCOORD0;
float4 color : COLOR;
};
sampler2D _MainTex;
float4 _MainTex_ST;
float4 _Color;
float _ShadowAlphaCutoff;
Varyings vert(Attributes v)
{
Varyings o;
UNITY_SKINNED_VERTEX_COMPUTE(v);
v.positionOS = UnityFlipSprite(v.positionOS, unity_SpriteProps.xy);
o.vertex = TransformObjectToHClip(v.positionOS);
o.uv = TRANSFORM_TEX(v.uv, _MainTex);
o.color = _Color.a * v.color;
return o;
}
half4 frag(Varyings i) : SV_Target
{
half4 main = i.color * tex2D(_MainTex, i.uv);
if (main.a <= _ShadowAlphaCutoff)
discard;
return half4(1, 1, 1, 1);
}
ENDHLSL
}
}
}
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: de02b375720b5c445afe83cd483bedf3
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,189 @@
Shader "Universal Render Pipeline/2D/Sprite-Lit-Default"
{
Properties
{
_MainTex("Diffuse", 2D) = "white" {}
_MaskTex("Mask", 2D) = "white" {}
_NormalMap("Normal Map", 2D) = "bump" {}
[MaterialToggle] _ZWrite("ZWrite", Float) = 0
// Legacy properties. They're here so that materials using this shader can gracefully fallback to the legacy sprite shader.
[HideInInspector] _Color("Tint", Color) = (1,1,1,1)
[HideInInspector] _RendererColor("RendererColor", Color) = (1,1,1,1)
[HideInInspector] _AlphaTex("External Alpha", 2D) = "white" {}
[HideInInspector] _EnableExternalAlpha("Enable External Alpha", Float) = 0
}
SubShader
{
Tags {"Queue" = "Transparent" "RenderType" = "Transparent" "RenderPipeline" = "UniversalPipeline" }
Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha
Cull Off
ZWrite [_ZWrite]
Pass
{
Tags { "LightMode" = "Universal2D" }
HLSLPROGRAM
#include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/Core2D.hlsl"
#pragma vertex LitVertex
#pragma fragment LitFragment
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/ShapeLightShared.hlsl"
// GPU Instancing
#pragma multi_compile_instancing
#pragma multi_compile _ DEBUG_DISPLAY
#pragma multi_compile _ SKINNED_SPRITE
struct Attributes
{
COMMON_2D_INPUTS
half4 color : COLOR;
UNITY_SKINNED_VERTEX_INPUTS
};
struct Varyings
{
COMMON_2D_LIT_OUTPUTS
half4 color : COLOR;
};
#include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/Lit2DCommon.hlsl"
// NOTE: Do not ifdef the properties here as SRP batcher can not handle different layouts.
CBUFFER_START(UnityPerMaterial)
half4 _Color;
CBUFFER_END
Varyings LitVertex(Attributes input)
{
UNITY_SKINNED_VERTEX_COMPUTE(input);
SetUpSpriteInstanceProperties();
input.positionOS = UnityFlipSprite(input.positionOS, unity_SpriteProps.xy);
Varyings o = CommonLitVertex(input);
o.color = input.color * _Color * unity_SpriteColor;
return o;
}
half4 LitFragment(Varyings input) : SV_Target
{
return CommonLitFragment(input, input.color);
}
ENDHLSL
}
Pass
{
Tags { "LightMode" = "NormalsRendering"}
HLSLPROGRAM
#include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/Core2D.hlsl"
#pragma vertex NormalsRenderingVertex
#pragma fragment NormalsRenderingFragment
// GPU Instancing
#pragma multi_compile_instancing
#pragma multi_compile _ SKINNED_SPRITE
struct Attributes
{
COMMON_2D_NORMALS_INPUTS
float4 color : COLOR;
UNITY_SKINNED_VERTEX_INPUTS
};
struct Varyings
{
COMMON_2D_NORMALS_OUTPUTS
half4 color : COLOR;
};
#include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/Normals2DCommon.hlsl"
// NOTE: Do not ifdef the properties here as SRP batcher can not handle different layouts.
CBUFFER_START( UnityPerMaterial )
half4 _Color;
CBUFFER_END
Varyings NormalsRenderingVertex(Attributes input)
{
UNITY_SKINNED_VERTEX_COMPUTE(input);
SetUpSpriteInstanceProperties();
input.positionOS = UnityFlipSprite(input.positionOS, unity_SpriteProps.xy);
Varyings o = CommonNormalsVertex(input);
o.color = input.color * _Color * unity_SpriteColor;
return o;
}
half4 NormalsRenderingFragment(Varyings input) : SV_Target
{
// Setup instancing for SpriteFlip is used in NormalsRenderingShared
SetUpSpriteInstanceProperties();
return CommonNormalsFragment(input, input.color);
}
ENDHLSL
}
Pass
{
Tags { "LightMode" = "UniversalForward" "Queue"="Transparent" "RenderType"="Transparent"}
HLSLPROGRAM
#include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/Core2D.hlsl"
#pragma vertex UnlitVertex
#pragma fragment UnlitFragment
struct Attributes
{
COMMON_2D_INPUTS
half4 color : COLOR;
UNITY_SKINNED_VERTEX_INPUTS
};
struct Varyings
{
COMMON_2D_OUTPUTS
half4 color : COLOR;
};
#include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/2DCommon.hlsl"
// GPU Instancing
#pragma multi_compile_instancing
#pragma multi_compile _ DEBUG_DISPLAY SKINNED_SPRITE
// NOTE: Do not ifdef the properties here as SRP batcher can not handle different layouts.
CBUFFER_START(UnityPerMaterial)
half4 _Color;
CBUFFER_END
Varyings UnlitVertex(Attributes input)
{
UNITY_SKINNED_VERTEX_COMPUTE(input);
SetUpSpriteInstanceProperties();
input.positionOS = UnityFlipSprite(input.positionOS, unity_SpriteProps.xy);
Varyings o = CommonUnlitVertex(input);
o.color = input.color *_Color * unity_SpriteColor;
return o;
}
half4 UnlitFragment(Varyings input) : SV_Target
{
return CommonUnlitFragment(input, input.color);
}
ENDHLSL
}
}
}
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: e260cfa7296ee7642b167f1eb5be5023
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,63 @@
Shader "Universal Render Pipeline/2D/Sprite-Mask"
{
Properties
{
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
[HideInInspector] _Cutoff ("Mask alpha cutoff", Range(0.0, 1.0)) = 0.0
}
HLSLINCLUDE
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
ENDHLSL
SubShader
{
Tags
{
"Queue"="Transparent"
"IgnoreProjector"="True"
"RenderType"="Transparent"
"PreviewType"="Plane"
"CanUseSpriteAtlas"="True"
"RenderPipeline" = "UniversalPipeline"
}
Cull Off
Lighting Off
ZWrite Off
Blend Off
ColorMask 0
Pass
{
Tags{ "LightMode" = "Universal2D" }
HLSLPROGRAM
#pragma vertex MaskRenderingVertex
#pragma fragment MaskRenderingFragment
#include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/SpriteMaskShared.hlsl"
ENDHLSL
}
Pass
{
Tags{ "LightMode" = "NormalsRendering" }
HLSLPROGRAM
#pragma vertex MaskRenderingVertex
#pragma fragment MaskRenderingFragment
#include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/SpriteMaskShared.hlsl"
ENDHLSL
}
Pass
{
Tags{ "LightMode" = "UniversalForward" }
HLSLPROGRAM
#pragma vertex MaskRenderingVertex
#pragma fragment MaskRenderingFragment
#include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/SpriteMaskShared.hlsl"
ENDHLSL
}
}
}
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: e39bd598ce13f44ba8af997d3e42cd18
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,74 @@
Shader "Universal Render Pipeline/2D/Sprite-Unlit-Default"
{
Properties
{
_MainTex ("Sprite Texture", 2D) = "white" {}
[MaterialToggle] _ZWrite("ZWrite", Float) = 0
// Legacy properties. They're here so that materials using this shader can gracefully fallback to the legacy sprite shader.
[HideInInspector] _Color ("Tint", Color) = (1,1,1,1)
[HideInInspector] PixelSnap ("Pixel snap", Float) = 0
[HideInInspector] _RendererColor ("RendererColor", Color) = (1,1,1,1)
[HideInInspector] _AlphaTex ("External Alpha", 2D) = "white" {}
[HideInInspector] _EnableExternalAlpha ("Enable External Alpha", Float) = 0
}
SubShader
{
Tags {"Queue" = "Transparent" "RenderType" = "Transparent" "RenderPipeline" = "UniversalPipeline" }
Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha
Cull Off
ZWrite [_ZWrite]
Pass
{
HLSLPROGRAM
#include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/Core2D.hlsl"
#pragma vertex UnlitVertex
#pragma fragment UnlitFragment
struct Attributes
{
COMMON_2D_INPUTS
half4 color : COLOR;
UNITY_SKINNED_VERTEX_INPUTS
};
struct Varyings
{
COMMON_2D_OUTPUTS
half4 color : COLOR;
};
#include "Packages/com.unity.render-pipelines.universal/Shaders/2D/Include/2DCommon.hlsl"
// GPU Instancing
#pragma multi_compile_instancing
#pragma multi_compile _ DEBUG_DISPLAY SKINNED_SPRITE
// NOTE: Do not ifdef the properties here as SRP batcher can not handle different layouts.
CBUFFER_START(UnityPerMaterial)
half4 _Color;
CBUFFER_END
Varyings UnlitVertex(Attributes input)
{
UNITY_SKINNED_VERTEX_COMPUTE(input);
SetUpSpriteInstanceProperties();
input.positionOS = UnityFlipSprite(input.positionOS, unity_SpriteProps.xy);
Varyings o = CommonUnlitVertex(input);
o.color = input.color *_Color * unity_SpriteColor;
return o;
}
half4 UnlitFragment(Varyings input) : SV_Target
{
return CommonUnlitFragment(input, input.color);
}
ENDHLSL
}
}
}
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 13c02b14c4d048fa9653293d54f6e0e1
timeCreated: 1614780416
@@ -0,0 +1,876 @@
{
"m_SGVersion": 3,
"m_Type": "UnityEditor.ShaderGraph.GraphData",
"m_ObjectId": "0103472ce60c41b697eab44acf4d1c05",
"m_Properties": [
{
"m_Id": "d5ecaf317c7d4adaa6aa338e708043ff"
}
],
"m_Keywords": [],
"m_Dropdowns": [],
"m_CategoryData": [
{
"m_Id": "e6f7aa956a6643a69a8ce033ecec0fc8"
}
],
"m_Nodes": [
{
"m_Id": "3c8553f9c6714e948df2f2e96ef35567"
},
{
"m_Id": "8420596fd6b24c0b97e6f8a612e5dfe6"
},
{
"m_Id": "1828deec104d498f81391df073431c76"
},
{
"m_Id": "1ac17146aa2944f59ddba46d6fdcfca0"
},
{
"m_Id": "deeb0e7bee0a466b937ecbd25df67a72"
},
{
"m_Id": "709025c277234bacb066c6dd2f796674"
},
{
"m_Id": "7d404c357a03490d9c3289c3692af3fc"
},
{
"m_Id": "6adaec30608745fab1192b9024131c74"
},
{
"m_Id": "ebbf0d028eed4b93ae5f18405d10d9e8"
}
],
"m_GroupDatas": [],
"m_StickyNoteDatas": [],
"m_Edges": [
{
"m_OutputSlot": {
"m_Node": {
"m_Id": "709025c277234bacb066c6dd2f796674"
},
"m_SlotId": 0
},
"m_InputSlot": {
"m_Node": {
"m_Id": "7d404c357a03490d9c3289c3692af3fc"
},
"m_SlotId": 1
}
},
{
"m_OutputSlot": {
"m_Node": {
"m_Id": "7d404c357a03490d9c3289c3692af3fc"
},
"m_SlotId": 0
},
"m_InputSlot": {
"m_Node": {
"m_Id": "1ac17146aa2944f59ddba46d6fdcfca0"
},
"m_SlotId": 0
}
},
{
"m_OutputSlot": {
"m_Node": {
"m_Id": "7d404c357a03490d9c3289c3692af3fc"
},
"m_SlotId": 7
},
"m_InputSlot": {
"m_Node": {
"m_Id": "deeb0e7bee0a466b937ecbd25df67a72"
},
"m_SlotId": 0
}
}
],
"m_VertexContext": {
"m_Position": {
"x": 0.0,
"y": 0.0
},
"m_Blocks": [
{
"m_Id": "3c8553f9c6714e948df2f2e96ef35567"
},
{
"m_Id": "8420596fd6b24c0b97e6f8a612e5dfe6"
},
{
"m_Id": "1828deec104d498f81391df073431c76"
}
]
},
"m_FragmentContext": {
"m_Position": {
"x": 0.0,
"y": 200.0
},
"m_Blocks": [
{
"m_Id": "1ac17146aa2944f59ddba46d6fdcfca0"
},
{
"m_Id": "deeb0e7bee0a466b937ecbd25df67a72"
},
{
"m_Id": "6adaec30608745fab1192b9024131c74"
},
{
"m_Id": "ebbf0d028eed4b93ae5f18405d10d9e8"
}
]
},
"m_PreviewData": {
"serializedMesh": {
"m_SerializedMesh": "{\"mesh\":{\"instanceID\":0}}",
"m_Guid": ""
},
"preventRotation": false
},
"m_Path": "VFX Graph",
"m_GraphPrecision": 1,
"m_PreviewMode": 2,
"m_OutputNode": {
"m_Id": ""
},
"m_SubDatas": [],
"m_ActiveTargets": [
{
"m_Id": "70a9f027c6694907af2bde51966d3bda"
}
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot",
"m_ObjectId": "1000415f71684b2fac75ad74360912a4",
"m_Id": 0,
"m_DisplayName": "Normal",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "Normal",
"m_StageCapability": 1,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": [],
"m_Space": 0
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
"m_ObjectId": "1828deec104d498f81391df073431c76",
"m_Group": {
"m_Id": ""
},
"m_Name": "VertexDescription.Tangent",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": 0.0,
"y": 0.0,
"width": 0.0,
"height": 0.0
}
},
"m_Slots": [
{
"m_Id": "6ee773bf452a46d0887440db8df8b49b"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_SerializedDescriptor": "VertexDescription.Tangent"
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
"m_ObjectId": "1ac17146aa2944f59ddba46d6fdcfca0",
"m_Group": {
"m_Id": ""
},
"m_Name": "SurfaceDescription.BaseColor",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": 0.0,
"y": 0.0,
"width": 0.0,
"height": 0.0
}
},
"m_Slots": [
{
"m_Id": "694e527d0772478397e77f39977cfd5a"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_SerializedDescriptor": "SurfaceDescription.BaseColor"
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
"m_ObjectId": "3c8553f9c6714e948df2f2e96ef35567",
"m_Group": {
"m_Id": ""
},
"m_Name": "VertexDescription.Position",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": 0.0,
"y": 0.0,
"width": 0.0,
"height": 0.0
}
},
"m_Slots": [
{
"m_Id": "fda9c1de16734249a1d98144da8e4ec6"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_SerializedDescriptor": "VertexDescription.Position"
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Texture2DMaterialSlot",
"m_ObjectId": "460498a8bd3a4c3f8d64d69725e6b69e",
"m_Id": 0,
"m_DisplayName": "Texture2D",
"m_SlotType": 1,
"m_Hidden": false,
"m_ShaderOutputName": "Out",
"m_StageCapability": 3,
"m_BareResource": false
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.ColorRGBAMaterialSlot",
"m_ObjectId": "479e8d19badc4fee817f076defa07730",
"m_Id": 0,
"m_DisplayName": "Sprite Mask",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "SpriteMask",
"m_StageCapability": 2,
"m_Value": {
"x": 1.0,
"y": 1.0,
"z": 1.0,
"w": 1.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0,
"w": 0.0
},
"m_Labels": []
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalSpriteLitSubTarget",
"m_ObjectId": "4c2e30ef6ca84729a2290200f6a1fbfd"
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot",
"m_ObjectId": "6373b432f5104af0bd129bb537d0298c",
"m_Id": 0,
"m_DisplayName": "RGBA",
"m_SlotType": 1,
"m_Hidden": false,
"m_ShaderOutputName": "RGBA",
"m_StageCapability": 2,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0,
"w": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0,
"w": 0.0
},
"m_Labels": []
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot",
"m_ObjectId": "660871e6c2a946e385c66467996fbfa3",
"m_Id": 0,
"m_DisplayName": "Normal (Tangent Space)",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "NormalTS",
"m_StageCapability": 2,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": [],
"m_Space": 3
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
"m_ObjectId": "6789b1d9527e43beb305ca71c883f78c",
"m_Id": 0,
"m_DisplayName": "Alpha",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "Alpha",
"m_StageCapability": 2,
"m_Value": 1.0,
"m_DefaultValue": 1.0,
"m_Labels": []
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot",
"m_ObjectId": "694e527d0772478397e77f39977cfd5a",
"m_Id": 0,
"m_DisplayName": "Base Color",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "BaseColor",
"m_StageCapability": 2,
"m_Value": {
"x": 0.5,
"y": 0.5,
"z": 0.5
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": [],
"m_ColorMode": 0,
"m_DefaultColor": {
"r": 0.5,
"g": 0.5,
"b": 0.5,
"a": 1.0
}
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
"m_ObjectId": "6adaec30608745fab1192b9024131c74",
"m_Group": {
"m_Id": ""
},
"m_Name": "SurfaceDescription.SpriteMask",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": 0.0,
"y": 0.0,
"width": 0.0,
"height": 0.0
}
},
"m_Slots": [
{
"m_Id": "479e8d19badc4fee817f076defa07730"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_SerializedDescriptor": "SurfaceDescription.SpriteMask"
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.TangentMaterialSlot",
"m_ObjectId": "6ee773bf452a46d0887440db8df8b49b",
"m_Id": 0,
"m_DisplayName": "Tangent",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "Tangent",
"m_StageCapability": 1,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": [],
"m_Space": 0
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.PropertyNode",
"m_ObjectId": "709025c277234bacb066c6dd2f796674",
"m_Group": {
"m_Id": ""
},
"m_Name": "Property",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": -532.0,
"y": 240.0,
"width": 140.0,
"height": 36.0
}
},
"m_Slots": [
{
"m_Id": "460498a8bd3a4c3f8d64d69725e6b69e"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_Property": {
"m_Id": "d5ecaf317c7d4adaa6aa338e708043ff"
}
}
{
"m_SGVersion": 1,
"m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalTarget",
"m_ObjectId": "70a9f027c6694907af2bde51966d3bda",
"m_Datas": [],
"m_ActiveSubTarget": {
"m_Id": "4c2e30ef6ca84729a2290200f6a1fbfd"
},
"m_AllowMaterialOverride": false,
"m_SurfaceType": 0,
"m_ZTestMode": 4,
"m_ZWriteControl": 0,
"m_AlphaMode": 0,
"m_RenderFace": 2,
"m_AlphaClip": false,
"m_CastShadows": true,
"m_ReceiveShadows": true,
"m_DisableTint": false,
"m_AdditionalMotionVectorMode": 0,
"m_AlembicMotionVectors": false,
"m_SupportsLODCrossFade": false,
"m_CustomEditorGUI": "",
"m_SupportVFX": true
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.UVMaterialSlot",
"m_ObjectId": "7b0de4c06e9b45e3a81de10dc069ff34",
"m_Id": 2,
"m_DisplayName": "UV",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "UV",
"m_StageCapability": 3,
"m_Value": {
"x": 0.0,
"y": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0
},
"m_Labels": [],
"m_Channel": 0
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.SampleTexture2DNode",
"m_ObjectId": "7d404c357a03490d9c3289c3692af3fc",
"m_Group": {
"m_Id": ""
},
"m_Name": "Sample Texture 2D",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": -299.0,
"y": 199.99998474121095,
"width": 207.99998474121095,
"height": 435.0
}
},
"m_Slots": [
{
"m_Id": "6373b432f5104af0bd129bb537d0298c"
},
{
"m_Id": "bf75e74cedb947d182db51ec113b47f8"
},
{
"m_Id": "b2c85159de12473baf6cc480267bdc14"
},
{
"m_Id": "8c9ef2cdb03a4014b10ae923123fea71"
},
{
"m_Id": "ff9698c4d98f427691577a9b32892a89"
},
{
"m_Id": "fe4ce8ee728e432fa0fa4c38b9d755b3"
},
{
"m_Id": "7b0de4c06e9b45e3a81de10dc069ff34"
},
{
"m_Id": "c6f567bff577444699063c16608c73b2"
}
],
"synonyms": [
"tex2d"
],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_TextureType": 0,
"m_NormalMapSpace": 0,
"m_EnableGlobalMipBias": true,
"m_MipSamplingMode": 0
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
"m_ObjectId": "8420596fd6b24c0b97e6f8a612e5dfe6",
"m_Group": {
"m_Id": ""
},
"m_Name": "VertexDescription.Normal",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": 0.0,
"y": 0.0,
"width": 0.0,
"height": 0.0
}
},
"m_Slots": [
{
"m_Id": "1000415f71684b2fac75ad74360912a4"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_SerializedDescriptor": "VertexDescription.Normal"
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
"m_ObjectId": "8c9ef2cdb03a4014b10ae923123fea71",
"m_Id": 6,
"m_DisplayName": "B",
"m_SlotType": 1,
"m_Hidden": false,
"m_ShaderOutputName": "B",
"m_StageCapability": 2,
"m_Value": 0.0,
"m_DefaultValue": 0.0,
"m_Labels": []
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
"m_ObjectId": "b2c85159de12473baf6cc480267bdc14",
"m_Id": 5,
"m_DisplayName": "G",
"m_SlotType": 1,
"m_Hidden": false,
"m_ShaderOutputName": "G",
"m_StageCapability": 2,
"m_Value": 0.0,
"m_DefaultValue": 0.0,
"m_Labels": []
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
"m_ObjectId": "bf75e74cedb947d182db51ec113b47f8",
"m_Id": 4,
"m_DisplayName": "R",
"m_SlotType": 1,
"m_Hidden": false,
"m_ShaderOutputName": "R",
"m_StageCapability": 2,
"m_Value": 0.0,
"m_DefaultValue": 0.0,
"m_Labels": []
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.SamplerStateMaterialSlot",
"m_ObjectId": "c6f567bff577444699063c16608c73b2",
"m_Id": 3,
"m_DisplayName": "Sampler",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "Sampler",
"m_StageCapability": 3,
"m_BareResource": false
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Internal.Texture2DShaderProperty",
"m_ObjectId": "d5ecaf317c7d4adaa6aa338e708043ff",
"m_Guid": {
"m_GuidSerialized": "f9e71d0b-f7a9-425f-af3f-28cf5c7a63be"
},
"m_Name": "Texture2D",
"m_DefaultRefNameVersion": 1,
"m_RefNameGeneratedByDisplayName": "Texture2D",
"m_DefaultReferenceName": "_Texture2D",
"m_OverrideReferenceName": "",
"m_GeneratePropertyBlock": true,
"m_UseCustomSlotLabel": false,
"m_CustomSlotLabel": "",
"m_DismissedVersion": 0,
"m_Precision": 0,
"overrideHLSLDeclaration": false,
"hlslDeclarationOverride": 0,
"m_Hidden": false,
"m_PerRendererData": false,
"m_customAttributes": [],
"m_Value": {
"m_SerializedTexture": "",
"m_Guid": ""
},
"isMainTexture": false,
"useTilingAndOffset": false,
"useTexelSize": true,
"m_Modifiable": true,
"m_DefaultType": 0
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
"m_ObjectId": "deeb0e7bee0a466b937ecbd25df67a72",
"m_Group": {
"m_Id": ""
},
"m_Name": "SurfaceDescription.Alpha",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": 0.0,
"y": 0.0,
"width": 0.0,
"height": 0.0
}
},
"m_Slots": [
{
"m_Id": "6789b1d9527e43beb305ca71c883f78c"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_SerializedDescriptor": "SurfaceDescription.Alpha"
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.CategoryData",
"m_ObjectId": "e6f7aa956a6643a69a8ce033ecec0fc8",
"m_Name": "",
"m_ChildObjectList": [
{
"m_Id": "d5ecaf317c7d4adaa6aa338e708043ff"
}
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
"m_ObjectId": "ebbf0d028eed4b93ae5f18405d10d9e8",
"m_Group": {
"m_Id": ""
},
"m_Name": "SurfaceDescription.NormalTS",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": 0.0,
"y": 0.0,
"width": 0.0,
"height": 0.0
}
},
"m_Slots": [
{
"m_Id": "660871e6c2a946e385c66467996fbfa3"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_SerializedDescriptor": "SurfaceDescription.NormalTS"
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.PositionMaterialSlot",
"m_ObjectId": "fda9c1de16734249a1d98144da8e4ec6",
"m_Id": 0,
"m_DisplayName": "Position",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "Position",
"m_StageCapability": 1,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": [],
"m_Space": 0
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Texture2DInputMaterialSlot",
"m_ObjectId": "fe4ce8ee728e432fa0fa4c38b9d755b3",
"m_Id": 1,
"m_DisplayName": "Texture",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "Texture",
"m_StageCapability": 3,
"m_BareResource": false,
"m_Texture": {
"m_SerializedTexture": "",
"m_Guid": ""
},
"m_DefaultType": 0
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
"m_ObjectId": "ff9698c4d98f427691577a9b32892a89",
"m_Id": 7,
"m_DisplayName": "A",
"m_SlotType": 1,
"m_Hidden": false,
"m_ShaderOutputName": "A",
"m_StageCapability": 2,
"m_Value": 0.0,
"m_DefaultValue": 0.0,
"m_Labels": []
}
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 24a73dccd7b6fad4798be282f96a21f4
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}
@@ -0,0 +1,812 @@
{
"m_SGVersion": 3,
"m_Type": "UnityEditor.ShaderGraph.GraphData",
"m_ObjectId": "0103472ce60c41b697eab44acf4d1c05",
"m_Properties": [
{
"m_Id": "d5ecaf317c7d4adaa6aa338e708043ff"
}
],
"m_Keywords": [],
"m_Dropdowns": [],
"m_CategoryData": [
{
"m_Id": "e6f7aa956a6643a69a8ce033ecec0fc8"
}
],
"m_Nodes": [
{
"m_Id": "3c8553f9c6714e948df2f2e96ef35567"
},
{
"m_Id": "8420596fd6b24c0b97e6f8a612e5dfe6"
},
{
"m_Id": "1828deec104d498f81391df073431c76"
},
{
"m_Id": "1ac17146aa2944f59ddba46d6fdcfca0"
},
{
"m_Id": "31916685738d47d598e3dd1f8ed48f63"
},
{
"m_Id": "deeb0e7bee0a466b937ecbd25df67a72"
},
{
"m_Id": "709025c277234bacb066c6dd2f796674"
},
{
"m_Id": "7d404c357a03490d9c3289c3692af3fc"
}
],
"m_GroupDatas": [],
"m_StickyNoteDatas": [],
"m_Edges": [
{
"m_OutputSlot": {
"m_Node": {
"m_Id": "709025c277234bacb066c6dd2f796674"
},
"m_SlotId": 0
},
"m_InputSlot": {
"m_Node": {
"m_Id": "7d404c357a03490d9c3289c3692af3fc"
},
"m_SlotId": 1
}
},
{
"m_OutputSlot": {
"m_Node": {
"m_Id": "7d404c357a03490d9c3289c3692af3fc"
},
"m_SlotId": 0
},
"m_InputSlot": {
"m_Node": {
"m_Id": "1ac17146aa2944f59ddba46d6fdcfca0"
},
"m_SlotId": 0
}
},
{
"m_OutputSlot": {
"m_Node": {
"m_Id": "7d404c357a03490d9c3289c3692af3fc"
},
"m_SlotId": 7
},
"m_InputSlot": {
"m_Node": {
"m_Id": "deeb0e7bee0a466b937ecbd25df67a72"
},
"m_SlotId": 0
}
}
],
"m_VertexContext": {
"m_Position": {
"x": 0.0,
"y": 0.0
},
"m_Blocks": [
{
"m_Id": "3c8553f9c6714e948df2f2e96ef35567"
},
{
"m_Id": "8420596fd6b24c0b97e6f8a612e5dfe6"
},
{
"m_Id": "1828deec104d498f81391df073431c76"
}
]
},
"m_FragmentContext": {
"m_Position": {
"x": 0.0,
"y": 200.0
},
"m_Blocks": [
{
"m_Id": "1ac17146aa2944f59ddba46d6fdcfca0"
},
{
"m_Id": "31916685738d47d598e3dd1f8ed48f63"
},
{
"m_Id": "deeb0e7bee0a466b937ecbd25df67a72"
}
]
},
"m_PreviewData": {
"serializedMesh": {
"m_SerializedMesh": "{\"mesh\":{\"instanceID\":0}}",
"m_Guid": ""
},
"preventRotation": false
},
"m_Path": "VFX Graph",
"m_GraphPrecision": 1,
"m_PreviewMode": 2,
"m_OutputNode": {
"m_Id": ""
},
"m_SubDatas": [],
"m_ActiveTargets": [
{
"m_Id": "70a9f027c6694907af2bde51966d3bda"
}
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.NormalMaterialSlot",
"m_ObjectId": "1000415f71684b2fac75ad74360912a4",
"m_Id": 0,
"m_DisplayName": "Normal",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "Normal",
"m_StageCapability": 1,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": [],
"m_Space": 0
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
"m_ObjectId": "1828deec104d498f81391df073431c76",
"m_Group": {
"m_Id": ""
},
"m_Name": "VertexDescription.Tangent",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": 0.0,
"y": 0.0,
"width": 0.0,
"height": 0.0
}
},
"m_Slots": [
{
"m_Id": "6ee773bf452a46d0887440db8df8b49b"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_SerializedDescriptor": "VertexDescription.Tangent"
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
"m_ObjectId": "1ac17146aa2944f59ddba46d6fdcfca0",
"m_Group": {
"m_Id": ""
},
"m_Name": "SurfaceDescription.BaseColor",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": 0.0,
"y": 0.0,
"width": 0.0,
"height": 0.0
}
},
"m_Slots": [
{
"m_Id": "694e527d0772478397e77f39977cfd5a"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_SerializedDescriptor": "SurfaceDescription.BaseColor"
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.ColorRGBAMaterialSlot",
"m_ObjectId": "248c12b836044e7b9673bf246d27903d",
"m_Id": 0,
"m_DisplayName": "Sprite Mask",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "SpriteMask",
"m_StageCapability": 2,
"m_Value": {
"x": 1.0,
"y": 1.0,
"z": 1.0,
"w": 1.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0,
"w": 0.0
},
"m_Labels": []
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
"m_ObjectId": "31916685738d47d598e3dd1f8ed48f63",
"m_Group": {
"m_Id": ""
},
"m_Name": "SurfaceDescription.SpriteMask",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": 0.0,
"y": 0.0,
"width": 0.0,
"height": 0.0
}
},
"m_Slots": [
{
"m_Id": "248c12b836044e7b9673bf246d27903d"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_SerializedDescriptor": "SurfaceDescription.SpriteMask"
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
"m_ObjectId": "3c8553f9c6714e948df2f2e96ef35567",
"m_Group": {
"m_Id": ""
},
"m_Name": "VertexDescription.Position",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": 0.0,
"y": 0.0,
"width": 0.0,
"height": 0.0
}
},
"m_Slots": [
{
"m_Id": "fda9c1de16734249a1d98144da8e4ec6"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_SerializedDescriptor": "VertexDescription.Position"
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Texture2DMaterialSlot",
"m_ObjectId": "460498a8bd3a4c3f8d64d69725e6b69e",
"m_Id": 0,
"m_DisplayName": "Texture2D",
"m_SlotType": 1,
"m_Hidden": false,
"m_ShaderOutputName": "Out",
"m_StageCapability": 3,
"m_BareResource": false
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector4MaterialSlot",
"m_ObjectId": "6373b432f5104af0bd129bb537d0298c",
"m_Id": 0,
"m_DisplayName": "RGBA",
"m_SlotType": 1,
"m_Hidden": false,
"m_ShaderOutputName": "RGBA",
"m_StageCapability": 2,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0,
"w": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0,
"w": 0.0
},
"m_Labels": []
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
"m_ObjectId": "6789b1d9527e43beb305ca71c883f78c",
"m_Id": 0,
"m_DisplayName": "Alpha",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "Alpha",
"m_StageCapability": 2,
"m_Value": 1.0,
"m_DefaultValue": 1.0,
"m_Labels": []
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot",
"m_ObjectId": "694e527d0772478397e77f39977cfd5a",
"m_Id": 0,
"m_DisplayName": "Base Color",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "BaseColor",
"m_StageCapability": 2,
"m_Value": {
"x": 0.5,
"y": 0.5,
"z": 0.5
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": [],
"m_ColorMode": 0,
"m_DefaultColor": {
"r": 0.5,
"g": 0.5,
"b": 0.5,
"a": 1.0
}
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.TangentMaterialSlot",
"m_ObjectId": "6ee773bf452a46d0887440db8df8b49b",
"m_Id": 0,
"m_DisplayName": "Tangent",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "Tangent",
"m_StageCapability": 1,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": [],
"m_Space": 0
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.PropertyNode",
"m_ObjectId": "709025c277234bacb066c6dd2f796674",
"m_Group": {
"m_Id": ""
},
"m_Name": "Property",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": -569.3333129882813,
"y": 220.6666717529297,
"width": 140.0,
"height": 36.00001525878906
}
},
"m_Slots": [
{
"m_Id": "460498a8bd3a4c3f8d64d69725e6b69e"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_Property": {
"m_Id": "d5ecaf317c7d4adaa6aa338e708043ff"
}
}
{
"m_SGVersion": 1,
"m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalTarget",
"m_ObjectId": "70a9f027c6694907af2bde51966d3bda",
"m_Datas": [],
"m_ActiveSubTarget": {
"m_Id": "7c4ba124b9d844159c62dcc87fa075d9"
},
"m_AllowMaterialOverride": false,
"m_SurfaceType": 0,
"m_ZTestMode": 4,
"m_ZWriteControl": 0,
"m_AlphaMode": 0,
"m_RenderFace": 2,
"m_AlphaClip": false,
"m_CastShadows": true,
"m_ReceiveShadows": true,
"m_DisableTint": false,
"m_AdditionalMotionVectorMode": 0,
"m_AlembicMotionVectors": false,
"m_SupportsLODCrossFade": false,
"m_CustomEditorGUI": "",
"m_SupportVFX": true
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.UVMaterialSlot",
"m_ObjectId": "7b0de4c06e9b45e3a81de10dc069ff34",
"m_Id": 2,
"m_DisplayName": "UV",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "UV",
"m_StageCapability": 3,
"m_Value": {
"x": 0.0,
"y": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0
},
"m_Labels": [],
"m_Channel": 0
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalSpriteUnlitSubTarget",
"m_ObjectId": "7c4ba124b9d844159c62dcc87fa075d9"
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.SampleTexture2DNode",
"m_ObjectId": "7d404c357a03490d9c3289c3692af3fc",
"m_Group": {
"m_Id": ""
},
"m_Name": "Sample Texture 2D",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": -299.0,
"y": 199.99998474121095,
"width": 207.99998474121095,
"height": 435.0
}
},
"m_Slots": [
{
"m_Id": "6373b432f5104af0bd129bb537d0298c"
},
{
"m_Id": "bf75e74cedb947d182db51ec113b47f8"
},
{
"m_Id": "b2c85159de12473baf6cc480267bdc14"
},
{
"m_Id": "8c9ef2cdb03a4014b10ae923123fea71"
},
{
"m_Id": "ff9698c4d98f427691577a9b32892a89"
},
{
"m_Id": "fe4ce8ee728e432fa0fa4c38b9d755b3"
},
{
"m_Id": "7b0de4c06e9b45e3a81de10dc069ff34"
},
{
"m_Id": "c6f567bff577444699063c16608c73b2"
}
],
"synonyms": [
"tex2d"
],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_TextureType": 0,
"m_NormalMapSpace": 0,
"m_EnableGlobalMipBias": true,
"m_MipSamplingMode": 0
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
"m_ObjectId": "8420596fd6b24c0b97e6f8a612e5dfe6",
"m_Group": {
"m_Id": ""
},
"m_Name": "VertexDescription.Normal",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": 0.0,
"y": 0.0,
"width": 0.0,
"height": 0.0
}
},
"m_Slots": [
{
"m_Id": "1000415f71684b2fac75ad74360912a4"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_SerializedDescriptor": "VertexDescription.Normal"
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
"m_ObjectId": "8c9ef2cdb03a4014b10ae923123fea71",
"m_Id": 6,
"m_DisplayName": "B",
"m_SlotType": 1,
"m_Hidden": false,
"m_ShaderOutputName": "B",
"m_StageCapability": 2,
"m_Value": 0.0,
"m_DefaultValue": 0.0,
"m_Labels": []
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
"m_ObjectId": "b2c85159de12473baf6cc480267bdc14",
"m_Id": 5,
"m_DisplayName": "G",
"m_SlotType": 1,
"m_Hidden": false,
"m_ShaderOutputName": "G",
"m_StageCapability": 2,
"m_Value": 0.0,
"m_DefaultValue": 0.0,
"m_Labels": []
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
"m_ObjectId": "bf75e74cedb947d182db51ec113b47f8",
"m_Id": 4,
"m_DisplayName": "R",
"m_SlotType": 1,
"m_Hidden": false,
"m_ShaderOutputName": "R",
"m_StageCapability": 2,
"m_Value": 0.0,
"m_DefaultValue": 0.0,
"m_Labels": []
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.SamplerStateMaterialSlot",
"m_ObjectId": "c6f567bff577444699063c16608c73b2",
"m_Id": 3,
"m_DisplayName": "Sampler",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "Sampler",
"m_StageCapability": 3,
"m_BareResource": false
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Internal.Texture2DShaderProperty",
"m_ObjectId": "d5ecaf317c7d4adaa6aa338e708043ff",
"m_Guid": {
"m_GuidSerialized": "f9e71d0b-f7a9-425f-af3f-28cf5c7a63be"
},
"m_Name": "Texture2D",
"m_DefaultRefNameVersion": 1,
"m_RefNameGeneratedByDisplayName": "Texture2D",
"m_DefaultReferenceName": "_Texture2D",
"m_OverrideReferenceName": "",
"m_GeneratePropertyBlock": true,
"m_UseCustomSlotLabel": false,
"m_CustomSlotLabel": "",
"m_DismissedVersion": 0,
"m_Precision": 0,
"overrideHLSLDeclaration": false,
"hlslDeclarationOverride": 0,
"m_Hidden": false,
"m_PerRendererData": false,
"m_customAttributes": [],
"m_Value": {
"m_SerializedTexture": "",
"m_Guid": ""
},
"isMainTexture": false,
"useTilingAndOffset": false,
"useTexelSize": true,
"m_Modifiable": true,
"m_DefaultType": 0
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
"m_ObjectId": "deeb0e7bee0a466b937ecbd25df67a72",
"m_Group": {
"m_Id": ""
},
"m_Name": "SurfaceDescription.Alpha",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": 0.0,
"y": 0.0,
"width": 0.0,
"height": 0.0
}
},
"m_Slots": [
{
"m_Id": "6789b1d9527e43beb305ca71c883f78c"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_SerializedDescriptor": "SurfaceDescription.Alpha"
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.CategoryData",
"m_ObjectId": "e6f7aa956a6643a69a8ce033ecec0fc8",
"m_Name": "",
"m_ChildObjectList": [
{
"m_Id": "d5ecaf317c7d4adaa6aa338e708043ff"
}
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.PositionMaterialSlot",
"m_ObjectId": "fda9c1de16734249a1d98144da8e4ec6",
"m_Id": 0,
"m_DisplayName": "Position",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "Position",
"m_StageCapability": 1,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": [],
"m_Space": 0
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Texture2DInputMaterialSlot",
"m_ObjectId": "fe4ce8ee728e432fa0fa4c38b9d755b3",
"m_Id": 1,
"m_DisplayName": "Texture",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "Texture",
"m_StageCapability": 3,
"m_BareResource": false,
"m_Texture": {
"m_SerializedTexture": "",
"m_Guid": ""
},
"m_DefaultType": 0
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
"m_ObjectId": "ff9698c4d98f427691577a9b32892a89",
"m_Id": 7,
"m_DisplayName": "A",
"m_SlotType": 1,
"m_Hidden": false,
"m_ShaderOutputName": "A",
"m_StageCapability": 2,
"m_Value": 0.0,
"m_DefaultValue": 0.0,
"m_Labels": []
}
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: d7288f66e4fb0634c9afef98c31b722a
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}