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: e674d0c2643d94245b5da6cc11dfe0ec
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -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}
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: ffac7c69f2faf9345b5b32ae0580e2e9
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 0e9d5a909a1f7e84882a534d0d11e49f
ScriptedImporter:
fileIDToRecycleName:
4800000: MainAsset
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 80aa867ac363ac043847b06ad71604cd
ScriptedImporter:
fileIDToRecycleName:
4800000: MainAsset
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 5c81372d981403744adbdda4433c9c11
ScriptedImporter:
fileIDToRecycleName:
4800000: MainAsset
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}
@@ -0,0 +1,143 @@
// Use this shader as a fallback when trying to render using a BatchRendererGroup with a shader that doesn't define a ScenePickingPass or SceneSelectionPass.
Shader "Hidden/Universal Render Pipeline/BRGPicking"
{
// The shader does not use these properties, but they have to be declared to
// make the shader SRP Batcher compatible.
Properties
{
[HideInInspector] [MainTexture] _BaseMap("Albedo", 2D) = "white" {}
[HideInInspector] [MainColor] _BaseColor("Color", Color) = (1,1,1,1)
[HideInInspector] _Cutoff("Alpha Cutoff", Range(0.0, 1.0)) = 0.5
}
SubShader
{
// Universal Pipeline tag is required. If Universal render pipeline is not set in the graphics settings
// this Subshader will fail. One can add a subshader below or fallback to Standard built-in to make this
// material work with both Universal Render Pipeline and Builtin Unity Pipeline
Tags{"RenderType" = "Opaque" "RenderPipeline" = "UniversalPipeline" "IgnoreProjector" = "True" "ShaderModel"="4.5"}
LOD 300
Pass
{
Name "ScenePickingPass"
Tags { "LightMode" = "Picking" }
Cull [_CullMode]
HLSLPROGRAM
#pragma target 4.5
#pragma editor_sync_compilation
#pragma multi_compile DOTS_INSTANCING_ON
#pragma vertex Vert
#pragma fragment Frag
#define SCENEPICKINGPASS
float4 _SelectionID;
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
struct Attributes
{
float4 positionOS : POSITION;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct Varyings
{
float4 positionCS : SV_POSITION;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
Varyings Vert(Attributes input)
{
Varyings output = (Varyings)0;
UNITY_SETUP_INSTANCE_ID(input);
UNITY_TRANSFER_INSTANCE_ID(input, output);
float4x4 objectToWorld = UNITY_DOTS_MATRIX_M;
float4 positionWS = mul(objectToWorld, float4(input.positionOS.xyz, 1.0));
output.positionCS = mul(unity_MatrixVP, positionWS);
return output;
}
half4 Frag(Varyings input) : SV_Target
{
UNITY_SETUP_INSTANCE_ID(input);
return unity_SelectionID;
}
ENDHLSL
}
Pass
{
Name "SceneSelectionPass"
Tags {"LightMode" = "SceneSelectionPass"}
Cull [_CullMode]
HLSLPROGRAM
#pragma target 4.5
#pragma editor_sync_compilation
#pragma multi_compile DOTS_INSTANCING_ON
#pragma vertex Vert
#pragma fragment Frag
#define SCENESELECTIONPASS
int _ObjectId;
int _PassValue;
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderVariablesFunctions.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Shaders/LitInput.hlsl"
struct Attributes
{
float4 positionOS : POSITION;
float2 texcoord : TEXCOORD0;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct Varyings
{
float4 positionCS : SV_POSITION;
float2 uv : TEXCOORD0;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
Varyings Vert(Attributes input)
{
Varyings output = (Varyings)0;
UNITY_SETUP_INSTANCE_ID(input);
UNITY_TRANSFER_INSTANCE_ID(input, output);
output.positionCS = TransformObjectToHClip(input.positionOS.xyz);
output.uv = TRANSFORM_TEX(input.texcoord, _BaseMap);
return output;
}
half4 Frag(Varyings input) : SV_Target
{
UNITY_SETUP_INSTANCE_ID(input);
return half4(_ObjectId, _PassValue, 1.0, 1.0);
}
ENDHLSL
}
}
FallBack Off
}
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 74b1585886a85614aa34e2c8e303c77a
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,411 @@
Shader "Universal Render Pipeline/Baked Lit"
{
Properties
{
[MainTexture] _BaseMap("Texture", 2D) = "white" {}
[MainColor] _BaseColor("Color", Color) = (1, 1, 1, 1)
_Cutoff("AlphaCutout", Range(0.0, 1.0)) = 0.5
_BumpMap("Normal Map", 2D) = "bump" {}
// BlendMode
_Surface("__surface", Float) = 0.0
_Blend("__mode", Float) = 0.0
_Cull("__cull", Float) = 2.0
[ToggleUI] _AlphaClip("__clip", Float) = 0.0
[HideInInspector] _BlendOp("__blendop", Float) = 0.0
[HideInInspector] _SrcBlend("__src", Float) = 1.0
[HideInInspector] _DstBlend("__dst", Float) = 0.0
[HideInInspector] _SrcBlendAlpha("__srcA", Float) = 1.0
[HideInInspector] _DstBlendAlpha("__dstA", Float) = 0.0
[HideInInspector] _ZWrite("__zw", Float) = 1.0
[HideInInspector] _AlphaToMask("__alphaToMask", Float) = 0.0
[HideInInspector] _AddPrecomputedVelocity("_AddPrecomputedVelocity", Float) = 0.0
[HideInInspector] _XRMotionVectorsPass("_XRMotionVectorsPass", Float) = 1.0
// Editmode props
_QueueOffset("Queue offset", Float) = 0.0
[HideInInspector][NoScaleOffset]unity_Lightmaps("unity_Lightmaps", 2DArray) = "" {}
[HideInInspector][NoScaleOffset]unity_LightmapsInd("unity_LightmapsInd", 2DArray) = "" {}
[HideInInspector][NoScaleOffset]unity_ShadowMasks("unity_ShadowMasks", 2DArray) = "" {}
}
SubShader
{
Tags
{
"RenderType" = "Opaque"
"IgnoreProjector" = "True"
"RenderPipeline" = "UniversalPipeline"
}
LOD 100
// -------------------------------------
// Render State Commands
Blend [_SrcBlend][_DstBlend], [_SrcBlendAlpha][_DstBlendAlpha]
ZWrite [_ZWrite]
Cull [_Cull]
Pass
{
Name "BakedLit"
Tags
{
"LightMode" = "UniversalForwardOnly"
}
// -------------------------------------
// Render State Commands
AlphaToMask[_AlphaToMask]
HLSLPROGRAM
#pragma target 2.0
// -------------------------------------
// Shader Stages
#pragma vertex BakedLitForwardPassVertex
#pragma fragment BakedLitForwardPassFragment
// -------------------------------------
// Material Keywords
#pragma shader_feature_local _NORMALMAP
#pragma shader_feature_local_fragment _SURFACE_TYPE_TRANSPARENT
#pragma shader_feature_local_fragment _ALPHATEST_ON
#pragma shader_feature_local_fragment _ALPHAMODULATE_ON
// -------------------------------------
// Universal Pipeline keywords
#pragma multi_compile_fragment _ _SCREEN_SPACE_OCCLUSION
#pragma multi_compile_fragment _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3
#pragma multi_compile _ EVALUATE_SH_MIXED EVALUATE_SH_VERTEX
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ProbeVolumeVariants.hlsl"
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/RenderingLayers.hlsl"
// -------------------------------------
// Unity defined keywords
#pragma multi_compile _ DIRLIGHTMAP_COMBINED
#pragma multi_compile _ LIGHTMAP_ON
#pragma multi_compile_fragment _ LIGHTMAP_BICUBIC_SAMPLING
#pragma multi_compile_fragment _ REFLECTION_PROBE_ROTATION
#pragma multi_compile _ USE_LEGACY_LIGHTMAPS
#pragma multi_compile _ DEBUG_DISPLAY
#pragma multi_compile _ LOD_FADE_CROSSFADE
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Fog.hlsl"
//--------------------------------------
// GPU Instancing
#pragma multi_compile_instancing
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl"
// -------------------------------------
// Includes
// Lighting include is needed because of GI
#include "Packages/com.unity.render-pipelines.universal/Shaders/BakedLitInput.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Shaders/BakedLitForwardPass.hlsl"
ENDHLSL
}
// Fill GBuffer data to prevent "holes", just in case someone wants to reuse GBuffer for non-lighting effects.
// Deferred lighting is stenciled out.
Pass
{
Name "GBuffer"
Tags
{
"LightMode" = "UniversalGBuffer"
}
HLSLPROGRAM
#pragma target 4.5
// Deferred Rendering Path does not support the OpenGL-based graphics API:
// Desktop OpenGL, OpenGL ES 3.0, WebGL 2.0.
#pragma exclude_renderers gles3 glcore
// -------------------------------------
// Shader Stages
#pragma vertex BakedLitGBufferPassVertex
#pragma fragment BakedLitGBufferPassFragment
// -------------------------------------
// Material Keywords
#pragma shader_feature_local _ _NORMALMAP
#pragma shader_feature_local_fragment _ALPHATEST_ON
#pragma shader_feature_local_fragment _ALPHAMODULATE_ON
// -------------------------------------
// Universal Pipeline keywords
#pragma multi_compile_fragment _ _RENDER_PASS_ENABLED
// -------------------------------------
// Unity defined keywords
#pragma multi_compile_fragment _ _SCREEN_SPACE_OCCLUSION
#pragma multi_compile_fragment _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3
#pragma multi_compile _ LOD_FADE_CROSSFADE
#pragma multi_compile_fragment _ _GBUFFER_NORMALS_OCT
#pragma multi_compile_fragment _ SHADOWS_SHADOWMASK
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/RenderingLayers.hlsl"
//--------------------------------------
// GPU Instancing
#pragma multi_compile_instancing
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl"
// -------------------------------------
// Includes
// Lighting include is needed because of GI
#include "Packages/com.unity.render-pipelines.universal/Shaders/BakedLitInput.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Shaders/BakedLitGBufferPass.hlsl"
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/GBufferOutputFormat.hlsl"
ENDHLSL
}
Pass
{
Tags
{
"LightMode" = "DepthOnly"
}
// -------------------------------------
// Render State Commands
ZWrite On
ColorMask R
HLSLPROGRAM
#pragma target 2.0
// -------------------------------------
// Shader Stages
#pragma vertex DepthOnlyVertex
#pragma fragment DepthOnlyFragment
// -------------------------------------
// Material Keywords
#pragma shader_feature_local _ALPHATEST_ON
// -------------------------------------
// Unity defined keywords
#pragma multi_compile _ LOD_FADE_CROSSFADE
//--------------------------------------
// GPU Instancing
#pragma multi_compile_instancing
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl"
// -------------------------------------
// Includes
#include "Packages/com.unity.render-pipelines.universal/Shaders/BakedLitInput.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Shaders/DepthOnlyPass.hlsl"
ENDHLSL
}
// This pass is used when drawing to a _CameraNormalsTexture texture with the forward renderer or the depthNormal prepass with the deferred renderer.
Pass
{
Name "DepthNormalsOnly"
Tags
{
"LightMode" = "DepthNormalsOnly"
}
// -------------------------------------
// Render State Commands
ZWrite On
Cull[_Cull]
HLSLPROGRAM
#pragma target 2.0
// -------------------------------------
// Shader Stages
#pragma vertex DepthNormalsVertex
#pragma fragment DepthNormalsFragment
// -------------------------------------
// Material Keywords
#pragma shader_feature_local _ _NORMALMAP
#pragma shader_feature_local_fragment _ALPHATEST_ON
// -------------------------------------
// Universal Pipeline keywords
#pragma multi_compile_fragment _ _GBUFFER_NORMALS_OCT // forward-only variant
#pragma multi_compile _ LOD_FADE_CROSSFADE
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/RenderingLayers.hlsl"
//--------------------------------------
// GPU Instancing
#pragma multi_compile_instancing
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl"
// -------------------------------------
// Includes
#include "Packages/com.unity.render-pipelines.universal/Shaders/BakedLitInput.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Shaders/BakedLitDepthNormalsPass.hlsl"
ENDHLSL
}
// Same as DepthNormals pass, but used for deferred renderer and forwardOnly materials.
Pass
{
Name "DepthNormalsOnly"
Tags
{
"LightMode" = "DepthNormalsOnly"
}
// -------------------------------------
// Render State Commands
ZWrite On
Cull[_Cull]
HLSLPROGRAM
#pragma target 2.0
// -------------------------------------
// Shader Stages
#pragma vertex DepthNormalsVertex
#pragma fragment DepthNormalsFragment
// -------------------------------------
// Material Keywords
#pragma shader_feature_local _ _NORMALMAP
#pragma shader_feature_local_fragment _ALPHATEST_ON
// -------------------------------------
// Universal Pipeline keywords
#pragma multi_compile_fragment _ _GBUFFER_NORMALS_OCT // forward-only variant
#pragma multi_compile _ LOD_FADE_CROSSFADE
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/RenderingLayers.hlsl"
//--------------------------------------
// Defines
#define BUMP_SCALE_NOT_SUPPORTED 1
//--------------------------------------
// GPU Instancing
#pragma multi_compile_instancing
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl"
// -------------------------------------
// Includes
#include "Packages/com.unity.render-pipelines.universal/Shaders/BakedLitInput.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Shaders/DepthNormalsPass.hlsl"
ENDHLSL
}
// This pass it not used during regular rendering, only for lightmap baking.
Pass
{
Name "Meta"
Tags
{
"LightMode" = "Meta"
}
// -------------------------------------
// Render State Commands
Cull Off
HLSLPROGRAM
#pragma target 2.0
// -------------------------------------
// Shader Stages
#pragma vertex UniversalVertexMeta
#pragma fragment UniversalFragmentMetaUnlit
// -------------------------------------
// Unity defined keywords
#pragma shader_feature EDITOR_VISUALIZATION
// -------------------------------------
// Includes
#include "Packages/com.unity.render-pipelines.universal/Shaders/BakedLitInput.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Shaders/BakedLitMetaPass.hlsl"
ENDHLSL
}
Pass
{
Name "Universal2D"
Tags
{
"LightMode" = "Universal2D"
}
// -------------------------------------
// Render State Commands
Blend[_SrcBlend][_DstBlend]
ZWrite[_ZWrite]
Cull[_Cull]
HLSLPROGRAM
#pragma target 2.0
// -------------------------------------
// Shader Stages
#pragma vertex vert
#pragma fragment frag
// -------------------------------------
// Material Keywords
#pragma shader_feature_local_fragment _ALPHATEST_ON
#pragma shader_feature_local_fragment _ALPHAPREMULTIPLY_ON
// -------------------------------------
// Includes
#include "Packages/com.unity.render-pipelines.universal/Shaders/BakedLitInput.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Shaders/Utils/Universal2D.hlsl"
ENDHLSL
}
Pass
{
Name "MotionVectors"
Tags { "LightMode" = "MotionVectors" }
ColorMask RG
HLSLPROGRAM
#pragma shader_feature_local _ALPHATEST_ON
#pragma multi_compile _ LOD_FADE_CROSSFADE
#pragma shader_feature_local_vertex _ADD_PRECOMPUTED_VELOCITY
#include "Packages/com.unity.render-pipelines.universal/Shaders/BakedLitInput.hlsl"
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ObjectMotionVectors.hlsl"
ENDHLSL
}
Pass
{
Name "XRMotionVectors"
Tags { "LightMode" = "XRMotionVectors" }
ColorMask RGBA
// Stencil write for obj motion pixels
Stencil
{
WriteMask 1
Ref 1
Comp Always
Pass Replace
}
HLSLPROGRAM
#pragma shader_feature_local _ALPHATEST_ON
#pragma multi_compile _ LOD_FADE_CROSSFADE
#pragma multi_compile _ APPLICATION_SPACE_WARP_MOTION_TRANSPARENT
#pragma shader_feature_local_vertex _ADD_PRECOMPUTED_VELOCITY
#define APPLICATION_SPACE_WARP_MOTION 1
#include "Packages/com.unity.render-pipelines.universal/Shaders/BakedLitInput.hlsl"
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ObjectMotionVectors.hlsl"
ENDHLSL
}
}
FallBack "Universal Render Pipeline/Unlit"
CustomEditor "UnityEditor.Rendering.Universal.ShaderGUI.BakedLitShader"
}
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 0ca6dca7396eb48e5849247ffd444914
timeCreated: 1496762173
licenseType: Pro
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,100 @@
#ifndef UNIVERSAL_BAKEDLIT_DEPTH_NORMALS_PASS_INCLUDED
#define UNIVERSAL_BAKEDLIT_DEPTH_NORMALS_PASS_INCLUDED
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#if defined(LOD_FADE_CROSSFADE)
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/LODCrossFade.hlsl"
#endif
struct Attributes
{
float4 positionOS : POSITION;
float2 uv : TEXCOORD0;
half3 normalOS : NORMAL;
half4 tangentOS : TANGENT;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct Varyings
{
float4 positionCS : SV_POSITION;
float2 uv : TEXCOORD0;
half3 normalWS : TEXCOORD1;
#if defined(_NORMALMAP)
half4 tangentWS : TEXCOORD3;
#endif
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
};
Varyings DepthNormalsVertex(Attributes input)
{
Varyings output = (Varyings)0;
UNITY_SETUP_INSTANCE_ID(input);
UNITY_TRANSFER_INSTANCE_ID(input, output);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
VertexPositionInputs vertexInput = GetVertexPositionInputs(input.positionOS.xyz);
output.positionCS = vertexInput.positionCS;
output.uv = TRANSFORM_TEX(input.uv, _BaseMap).xy;
// normalWS and tangentWS already normalize.
// this is required to avoid skewing the direction during interpolation
// also required for per-vertex SH evaluation
VertexNormalInputs normalInput = GetVertexNormalInputs(input.normalOS, input.tangentOS);
output.normalWS = half3(normalInput.normalWS);
#if defined(_NORMALMAP)
real sign = input.tangentOS.w * GetOddNegativeScale();
output.tangentWS = half4(normalInput.tangentWS.xyz, sign);
#endif
return output;
}
void DepthNormalsFragment(
Varyings input
, out half4 outNormalWS : SV_Target0
#ifdef _WRITE_RENDERING_LAYERS
, out uint outRenderingLayers : SV_Target1
#endif
)
{
UNITY_SETUP_INSTANCE_ID(input);
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
half4 texColor = (half4) SAMPLE_TEXTURE2D(_BaseMap, sampler_BaseMap, input.uv);
half alpha = texColor.a * _BaseColor.a;
AlphaDiscard(alpha, _Cutoff);
#ifdef LOD_FADE_CROSSFADE
LODFadeCrossFade(input.positionCS);
#endif
#if defined(_GBUFFER_NORMALS_OCT)
float3 normalWS = normalize(input.normalWS);
float2 octNormalWS = PackNormalOctQuadEncode(normalWS); // values between [-1, +1], must use fp32 on some platforms
float2 remappedOctNormalWS = saturate(octNormalWS * 0.5 + 0.5); // values between [ 0, 1]
half3 packedNormalWS = PackFloat2To888(remappedOctNormalWS); // values between [ 0, 1]
outNormalWS = half4(packedNormalWS, 0.0);
#else
#if defined(_NORMALMAP)
half3 normalTS = SampleNormal(input.uv, TEXTURE2D_ARGS(_BumpMap, sampler_BumpMap)).xyz;
half sgn = input.tangentWS.w; // should be either +1 or -1
half3 bitangent = sgn * cross(input.normalWS.xyz, input.tangentWS.xyz);
half3 normalWS = TransformTangentToWorld(normalTS, half3x3(input.tangentWS.xyz, bitangent, input.normalWS));
#else
half3 normalWS = input.normalWS;
#endif
outNormalWS = half4(NormalizeNormalPerPixel(normalWS), 0.0);
#endif
#ifdef _WRITE_RENDERING_LAYERS
outRenderingLayers = EncodeMeshRenderingLayer();
#endif
}
#endif
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 9604e389528d04ae39fe05a7b4212172
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,186 @@
#ifndef UNIVERSAL_BAKEDLIT_FORWARD_PASS_INCLUDED
#define UNIVERSAL_BAKEDLIT_FORWARD_PASS_INCLUDED
#include "BakedLitInput.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
#if defined(LOD_FADE_CROSSFADE)
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/LODCrossFade.hlsl"
#endif
struct Attributes
{
float4 positionOS : POSITION;
float2 uv : TEXCOORD0;
float2 staticLightmapUV : TEXCOORD1;
float3 normalOS : NORMAL;
float4 tangentOS : TANGENT;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct Varyings
{
float4 positionCS : SV_POSITION;
float3 uv0AndFogCoord : TEXCOORD0; // xy: uv0, z: fogCoord
DECLARE_LIGHTMAP_OR_SH(staticLightmapUV, vertexSH, 1);
half3 normalWS : TEXCOORD2;
#if defined(_NORMALMAP)
half4 tangentWS : TEXCOORD3;
#endif
#if defined(DEBUG_DISPLAY) || (defined(PROBE_VOLUMES_L1) || defined(PROBE_VOLUMES_L2))
float3 positionWS : TEXCOORD4;
float3 viewDirWS : TEXCOORD5;
#endif
#ifdef USE_APV_PROBE_OCCLUSION
float4 probeOcclusion : TEXCOORD6;
#endif
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
};
void InitializeInputData(Varyings input, half3 normalTS, out InputData inputData)
{
inputData = (InputData)0;
#if defined(DEBUG_DISPLAY)
inputData.positionWS = input.positionWS;
inputData.positionCS = input.positionCS;
inputData.viewDirectionWS = input.viewDirWS;
#else
inputData.positionWS = float3(0, 0, 0);
inputData.viewDirectionWS = half3(0, 0, 1);
#endif
#if defined(_NORMALMAP)
float sgn = input.tangentWS.w; // should be either +1 or -1
float3 bitangent = sgn * cross(input.normalWS.xyz, input.tangentWS.xyz);
inputData.tangentToWorld = half3x3(input.tangentWS.xyz, bitangent.xyz, input.normalWS.xyz);
inputData.normalWS = TransformTangentToWorld(normalTS, inputData.tangentToWorld);
#else
inputData.normalWS = input.normalWS;
#endif
inputData.shadowCoord = float4(0, 0, 0, 0);
inputData.fogCoord = input.uv0AndFogCoord.z;
inputData.vertexLighting = half3(0, 0, 0);
inputData.normalizedScreenSpaceUV = GetNormalizedScreenSpaceUV(input.positionCS);
inputData.shadowMask = half4(1, 1, 1, 1);
#if defined(DEBUG_DISPLAY)
#if defined(LIGHTMAP_ON)
inputData.staticLightmapUV = input.staticLightmapUV;
#else
inputData.vertexSH = input.vertexSH;
#endif
#if defined(USE_APV_PROBE_OCCLUSION)
inputData.probeOcclusion = input.probeOcclusion;
#endif
#endif
}
void InitializeBakedGIData(Varyings input, inout InputData inputData)
{
#if !defined(LIGHTMAP_ON) && (defined(PROBE_VOLUMES_L1) || defined(PROBE_VOLUMES_L2))
inputData.bakedGI = SAMPLE_GI(input.vertexSH,
GetAbsolutePositionWS(input.positionWS),
inputData.normalWS,
input.viewDirWS,
input.positionCS.xy,
input.probeOcclusion,
inputData.shadowMask);
#else
inputData.bakedGI = SAMPLE_GI(input.staticLightmapUV, input.vertexSH, inputData.normalWS);
#endif
}
Varyings BakedLitForwardPassVertex(Attributes input)
{
Varyings output;
UNITY_SETUP_INSTANCE_ID(input);
UNITY_TRANSFER_INSTANCE_ID(input, output);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
VertexPositionInputs vertexInput = GetVertexPositionInputs(input.positionOS.xyz);
output.positionCS = vertexInput.positionCS;
output.uv0AndFogCoord.xy = TRANSFORM_TEX(input.uv, _BaseMap);
#if defined(_FOG_FRAGMENT)
output.uv0AndFogCoord.z = vertexInput.positionVS.z;
#else
output.uv0AndFogCoord.z = ComputeFogFactor(vertexInput.positionCS.z);
#endif
// normalWS and tangentWS already normalize.
// this is required to avoid skewing the direction during interpolation
// also required for per-vertex SH evaluation
VertexNormalInputs normalInput = GetVertexNormalInputs(input.normalOS, input.tangentOS);
output.normalWS = normalInput.normalWS;
#if defined(_NORMALMAP)
real sign = input.tangentOS.w * GetOddNegativeScale();
output.tangentWS = half4(normalInput.tangentWS.xyz, sign);
#endif
OUTPUT_LIGHTMAP_UV(input.staticLightmapUV, unity_LightmapST, output.staticLightmapUV);
OUTPUT_SH4(vertexInput.positionWS, output.normalWS.xyz, GetWorldSpaceNormalizeViewDir(vertexInput.positionWS), output.vertexSH, output.probeOcclusion);
#if defined(DEBUG_DISPLAY) || (defined(PROBE_VOLUMES_L1) || defined(PROBE_VOLUMES_L2))
output.positionWS = vertexInput.positionWS;
output.viewDirWS = GetWorldSpaceViewDir(vertexInput.positionWS);
#endif
return output;
}
void BakedLitForwardPassFragment(
Varyings input
, out half4 outColor : SV_Target0
#ifdef _WRITE_RENDERING_LAYERS
, out uint outRenderingLayers : SV_Target1
#endif
)
{
UNITY_SETUP_INSTANCE_ID(input);
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
half2 uv = input.uv0AndFogCoord.xy;
#if defined(_NORMALMAP)
half3 normalTS = SampleNormal(uv, TEXTURE2D_ARGS(_BumpMap, sampler_BumpMap)).xyz;
#else
half3 normalTS = half3(0, 0, 1);
#endif
InputData inputData;
InitializeInputData(input, normalTS, inputData);
SETUP_DEBUG_TEXTURE_DATA(inputData, UNDO_TRANSFORM_TEX(input.uv0AndFogCoord.xy, _BaseMap));
half4 texColor = SAMPLE_TEXTURE2D(_BaseMap, sampler_BaseMap, uv);
half3 color = texColor.rgb * _BaseColor.rgb;
half alpha = texColor.a * _BaseColor.a;
alpha = AlphaDiscard(alpha, _Cutoff);
color = AlphaModulate(color, alpha);
#ifdef LOD_FADE_CROSSFADE
LODFadeCrossFade(input.positionCS);
#endif
#if defined(_DBUFFER)
ApplyDecalToBaseColorAndNormal(input.positionCS, color, inputData.normalWS);
#endif
InitializeBakedGIData(input, inputData);
half4 finalColor = UniversalFragmentBakedLit(inputData, color, alpha, normalTS);
finalColor.a = OutputAlpha(finalColor.a, IsSurfaceTypeTransparent());
outColor = finalColor;
#ifdef _WRITE_RENDERING_LAYERS
outRenderingLayers = EncodeMeshRenderingLayer();
#endif
}
#endif
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 70003ec87ea6481a920369a377c1b623
timeCreated: 1600853530
@@ -0,0 +1,176 @@
#ifndef UNIVERSAL_BAKEDLIT_GBUFFER_PASS_INCLUDED
#define UNIVERSAL_BAKEDLIT_GBUFFER_PASS_INCLUDED
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/GBufferOutput.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
#if defined(LOD_FADE_CROSSFADE)
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/LODCrossFade.hlsl"
#endif
struct Attributes
{
float4 positionOS : POSITION;
float2 uv : TEXCOORD0;
float2 staticLightmapUV : TEXCOORD1;
float3 normalOS : NORMAL;
float4 tangentOS : TANGENT;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct Varyings
{
float4 positionCS : SV_POSITION;
float3 uv0AndFogCoord : TEXCOORD0; // xy: uv0, z: fogCoord
DECLARE_LIGHTMAP_OR_SH(staticLightmapUV, vertexSH, 1);
half3 normalWS : TEXCOORD2;
#if defined(_NORMALMAP)
half4 tangentWS : TEXCOORD3;
#endif
#if defined(DEBUG_DISPLAY) || (defined(PROBE_VOLUMES_L1) || defined(PROBE_VOLUMES_L2))
float3 positionWS : TEXCOORD4;
float3 viewDirWS : TEXCOORD5;
#endif
#ifdef USE_APV_PROBE_OCCLUSION
float4 probeOcclusion : TEXCOORD6;
#endif
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
};
void InitializeInputData(Varyings input, half3 normalTS, out InputData inputData)
{
inputData = (InputData) 0;
inputData.positionCS = input.positionCS;
inputData.positionWS = float3(0, 0, 0);
inputData.viewDirectionWS = half3(0, 0, 1);
#if defined(_NORMALMAP)
float sgn = input.tangentWS.w; // should be either +1 or -1
float3 bitangent = sgn * cross(input.normalWS.xyz, input.tangentWS.xyz);
inputData.tangentToWorld = half3x3(input.tangentWS.xyz, bitangent.xyz, input.normalWS.xyz);
inputData.normalWS = TransformTangentToWorld(normalTS, inputData.tangentToWorld);
#else
inputData.normalWS = input.normalWS;
#endif
inputData.shadowCoord = float4(0, 0, 0, 0);
inputData.fogCoord = input.uv0AndFogCoord.z;
inputData.vertexLighting = half3(0, 0, 0);
inputData.normalizedScreenSpaceUV = GetNormalizedScreenSpaceUV(input.positionCS);
inputData.shadowMask = half4(1, 1, 1, 1);
#if defined(DEBUG_DISPLAY)
#if defined(LIGHTMAP_ON)
inputData.staticLightmapUV = input.staticLightmapUV;
#else
inputData.vertexSH = input.vertexSH;
#endif
#if defined(USE_APV_PROBE_OCCLUSION)
inputData.probeOcclusion = input.probeOcclusion;
#endif
#endif
}
void InitializeBakedGIData(Varyings input, inout InputData inputData)
{
#if !defined(LIGHTMAP_ON) && (defined(PROBE_VOLUMES_L1) || defined(PROBE_VOLUMES_L2))
inputData.bakedGI = SAMPLE_GI(input.vertexSH,
GetAbsolutePositionWS(input.positionWS),
inputData.normalWS,
input.viewDirWS,
input.positionCS.xy,
input.probeOcclusion,
inputData.shadowMask);
#else
inputData.bakedGI = SAMPLE_GI(input.staticLightmapUV, input.vertexSH, inputData.normalWS);
#endif
}
Varyings BakedLitGBufferPassVertex(Attributes input)
{
Varyings output;
UNITY_SETUP_INSTANCE_ID(input);
UNITY_TRANSFER_INSTANCE_ID(input, output);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
VertexPositionInputs vertexInput = GetVertexPositionInputs(input.positionOS.xyz);
output.positionCS = vertexInput.positionCS;
output.uv0AndFogCoord.xy = TRANSFORM_TEX(input.uv, _BaseMap);
#if defined(_FOG_FRAGMENT)
output.uv0AndFogCoord.z = vertexInput.positionVS.z;
#else
output.uv0AndFogCoord.z = ComputeFogFactor(vertexInput.positionCS.z);
#endif
// normalWS and tangentWS already normalize.
// this is required to avoid skewing the direction during interpolation
// also required for per-vertex SH evaluation
VertexNormalInputs normalInput = GetVertexNormalInputs(input.normalOS, input.tangentOS);
output.normalWS = normalInput.normalWS;
#if defined(_NORMALMAP)
real sign = input.tangentOS.w * GetOddNegativeScale();
output.tangentWS = half4(normalInput.tangentWS.xyz, sign);
#endif
OUTPUT_LIGHTMAP_UV(input.staticLightmapUV, unity_LightmapST, output.staticLightmapUV);
OUTPUT_SH4(vertexInput.positionWS, output.normalWS.xyz, GetWorldSpaceNormalizeViewDir(vertexInput.positionWS), output.vertexSH, output.probeOcclusion);
#if defined(DEBUG_DISPLAY) || (defined(PROBE_VOLUMES_L1) || defined(PROBE_VOLUMES_L2))
output.positionWS = vertexInput.positionWS;
output.viewDirWS = GetWorldSpaceViewDir(vertexInput.positionWS);
#endif
return output;
}
GBufferFragOutput BakedLitGBufferPassFragment(Varyings input)
{
UNITY_SETUP_INSTANCE_ID(input);
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
#if defined(LOD_FADE_CROSSFADE) && USE_UNITY_CROSSFADE
LODFadeCrossFade(input.positionCS);
#endif
half2 uv = input.uv0AndFogCoord.xy;
#if defined(_NORMALMAP)
half3 normalTS = SampleNormal(uv, TEXTURE2D_ARGS(_BumpMap, sampler_BumpMap)).xyz;
#else
half3 normalTS = half3(0, 0, 1);
#endif
half4 texColor = SAMPLE_TEXTURE2D(_BaseMap, sampler_BaseMap, uv);
half alpha = AlphaDiscard(texColor.a * _BaseColor.a, _Cutoff);
half3 color = AlphaModulate(texColor.rgb * _BaseColor.rgb, alpha);
InputData inputData;
InitializeInputData(input, normalTS, inputData);
#if defined(_DBUFFER)
ApplyDecalToBaseColorAndNormal(input.positionCS, color, inputData.normalWS);
#endif
InitializeBakedGIData(input, inputData);
SurfaceData surfaceData = (SurfaceData) 0;
surfaceData.albedo = color;
surfaceData.alpha = alpha;
#if defined(_SCREEN_SPACE_OCCLUSION) // GBuffer never has transparents
float2 normalizedScreenSpaceUV = GetNormalizedScreenSpaceUV(input.positionCS);
AmbientOcclusionFactor aoFactor = GetScreenSpaceAmbientOcclusion(normalizedScreenSpaceUV);
surfaceData.occlusion = aoFactor.directAmbientOcclusion;
#else
surfaceData.occlusion = 1;
#endif
return PackGBuffersSurfaceData(surfaceData, inputData, float3(0, 0, 0));
}
#endif
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 3624eb79d3c1a4742a2737c755e4ee51
ShaderIncludeImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,50 @@
#ifndef UNIVERSAL_BAKEDLIT_INPUT_INCLUDED
#define UNIVERSAL_BAKEDLIT_INPUT_INCLUDED
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/SurfaceInput.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/DebugMipmapStreamingMacros.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Shaders/Utils/SurfaceType.hlsl"
CBUFFER_START(UnityPerMaterial)
float4 _BaseMap_ST;
float4 _BaseMap_TexelSize;
half4 _BaseColor;
half _Cutoff;
half _Glossiness;
half _Metallic;
UNITY_TEXTURE_STREAMING_DEBUG_VARS;
CBUFFER_END
#ifdef UNITY_DOTS_INSTANCING_ENABLED
UNITY_DOTS_INSTANCING_START(MaterialPropertyMetadata)
UNITY_DOTS_INSTANCED_PROP(float4, _BaseColor)
UNITY_DOTS_INSTANCED_PROP(float , _Cutoff)
UNITY_DOTS_INSTANCED_PROP(float , _Glossiness)
UNITY_DOTS_INSTANCED_PROP(float , _Metallic)
UNITY_DOTS_INSTANCING_END(MaterialPropertyMetadata)
static float4 unity_DOTS_Sampled_BaseColor;
static float unity_DOTS_Sampled_Cutoff;
static float unity_DOTS_Sampled_Glossiness;
static float unity_DOTS_Sampled_Metallic;
void SetupDOTSBakedLitMaterialPropertyCaches()
{
unity_DOTS_Sampled_BaseColor = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float4, _BaseColor);
unity_DOTS_Sampled_Cutoff = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _Cutoff);
unity_DOTS_Sampled_Glossiness = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _Glossiness);
unity_DOTS_Sampled_Metallic = UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float , _Metallic);
}
#undef UNITY_SETUP_DOTS_MATERIAL_PROPERTY_CACHES
#define UNITY_SETUP_DOTS_MATERIAL_PROPERTY_CACHES() SetupDOTSBakedLitMaterialPropertyCaches()
#define _BaseColor unity_DOTS_Sampled_BaseColor
#define _Cutoff unity_DOTS_Sampled_Cutoff
#define _Glossiness unity_DOTS_Sampled_Glossiness
#define _Metallic unity_DOTS_Sampled_Metallic
#endif
#endif
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 463a8185744c2459f8e621f4e4eb74d3
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,6 @@
#ifndef UNIVERSAL_BAKEDLIT_META_PASS_INCLUDED
#define UNIVERSAL_BAKEDLIT_META_PASS_INCLUDED
#include "Packages/com.unity.render-pipelines.universal/Shaders/UnlitMetaPass.hlsl"
#endif
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: f31bf343921b848fa8e5cde15f1dbaab
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,128 @@
Shader "Hidden/Universal Render Pipeline/CameraMotionVectors"
{
SubShader
{
Pass
{
Name "Camera Motion Vectors"
Cull Off
ZWrite On
HLSLPROGRAM
#pragma target 3.5
#pragma vertex vert
#pragma fragment frag
// -------------------------------------
// Includes
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareDepthTexture.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/UnityInput.hlsl"
#include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRendering.hlsl"
struct Attributes
{
uint vertexID : SV_VertexID;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct Varyings
{
float4 positionCS : SV_POSITION;
float2 texcoord : TEXCOORD0;
UNITY_VERTEX_OUTPUT_STEREO
};
// -------------------------------------
// Vertex
Varyings vert(Attributes input)
{
Varyings output;
UNITY_SETUP_INSTANCE_ID(input);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
float4 pos = GetFullScreenTriangleVertexPosition(input.vertexID);
float2 uv = GetFullScreenTriangleTexCoord(input.vertexID);
output.positionCS = pos;
output.texcoord = uv;
return output;
}
// -------------------------------------
// Fragment
half4 frag(Varyings input, out float outDepth : SV_Depth) : SV_Target
{
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
float2 uv = input.texcoord;
float depth = LoadSceneDepth(uv * _CameraDepthTexture_TexelSize.zw);
outDepth = depth; // Write depth out unmodified
#if !UNITY_REVERSED_Z
depth = lerp(UNITY_NEAR_CLIP_VALUE, 1, SampleSceneDepth(uv).x);
#endif
#if defined(SUPPORTS_FOVEATED_RENDERING_NON_UNIFORM_RASTER)
UNITY_BRANCH if (_FOVEATED_RENDERING_NON_UNIFORM_RASTER)
{
// Get the UVs from non-unifrom space to linear space to determine the right world-space position
uv = RemapFoveatedRenderingNonUniformToLinear(uv);
}
#endif
// Reconstruct world position
float3 posWS = ComputeWorldSpacePosition(uv, depth, UNITY_MATRIX_I_VP);
// Multiply with current and previous non-jittered view projection
float4 posCS = mul(_NonJitteredViewProjMatrix, float4(posWS.xyz, 1.0));
float4 prevPosCS = mul(_PrevViewProjMatrix, float4(posWS.xyz, 1.0));
// Non-uniform raster needs to keep the posNDC values in float to avoid additional conversions
// since uv remap functions use floats
float2 posNDC = posCS.xy * rcp(posCS.w);
float2 prevPosNDC = prevPosCS.xy * rcp(prevPosCS.w);
float2 velocity;
#if defined(SUPPORTS_FOVEATED_RENDERING_NON_UNIFORM_RASTER)
UNITY_BRANCH if (_FOVEATED_RENDERING_NON_UNIFORM_RASTER)
{
// Convert velocity from NDC space (-1..1) to screen UV 0..1 space since FoveatedRendering remap needs that range.
// Also return both position in non-uniform UV space to get the right velocity vector
float2 posUV = RemapFoveatedRenderingResolve(posNDC * 0.5f + 0.5f);
float2 prevPosUV = RemapFoveatedRenderingPrevFrameLinearToNonUniform(prevPosNDC * 0.5f + 0.5f);
// Calculate forward velocity
velocity = (posUV - prevPosUV);
#if UNITY_UV_STARTS_AT_TOP
velocity.y = -velocity.y;
#endif
}
else
#endif
{
// Calculate forward velocity
velocity = (posNDC - prevPosNDC);
// TODO: test that velocity.y is correct
#if UNITY_UV_STARTS_AT_TOP
velocity.y = -velocity.y;
#endif
// Convert velocity from NDC space (-1..1) to screen UV 0..1 space
// Note: It doesn't mean we don't have negative values, we store negative or positive offset in the UV space.
// Note: ((posNDC * 0.5 + 0.5) - (prevPosNDC * 0.5 + 0.5)) = (velocity * 0.5)
velocity.xy *= 0.5;
}
return float4(velocity, 0, 0);
}
ENDHLSL
}
}
}
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: c56b7e0d4c7cb484e959caeeedae9bbf
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,558 @@
// Complex Lit is superset of Lit, but provides
// advanced material properties and is always forward rendered.
// It also has higher hardware and shader model requirements.
Shader "Universal Render Pipeline/Complex Lit"
{
Properties
{
// Specular vs Metallic workflow
_WorkflowMode("WorkflowMode", Float) = 1.0
[MainTexture] _BaseMap("Albedo", 2D) = "white" {}
[MainColor] _BaseColor("Color", Color) = (1,1,1,1)
_Cutoff("Alpha Cutoff", Range(0.0, 1.0)) = 0.5
_Smoothness("Smoothness", Range(0.0, 1.0)) = 0.5
_SmoothnessTextureChannel("Smoothness texture channel", Float) = 0
_Metallic("Metallic", Range(0.0, 1.0)) = 0.0
_MetallicGlossMap("Metallic", 2D) = "white" {}
_SpecColor("Specular", Color) = (0.2, 0.2, 0.2)
_SpecGlossMap("Specular", 2D) = "white" {}
[ToggleOff] _SpecularHighlights("Specular Highlights", Float) = 1.0
[ToggleOff] _EnvironmentReflections("Environment Reflections", Float) = 1.0
[ToggleOff] _ScreenSpaceReflections("Screen Space Reflections", Float) = 1.0
[ToggleOff] _ScreenSpaceReflectionsContributeTransparent("Screen Space Reflections Contribute Transparent", Float) = 1.0
_BumpScale("Scale", Float) = 1.0
_BumpMap("Normal Map", 2D) = "bump" {}
_Parallax("Scale", Range(0.005, 0.08)) = 0.005
_ParallaxMap("Height Map", 2D) = "black" {}
_OcclusionStrength("Strength", Range(0.0, 1.0)) = 1.0
_OcclusionMap("Occlusion", 2D) = "white" {}
[HDR] _EmissionColor("Color", Color) = (0,0,0)
_EmissionMap("Emission", 2D) = "white" {}
_DetailMask("Detail Mask", 2D) = "white" {}
_DetailAlbedoMapScale("Scale", Range(0.0, 2.0)) = 1.0
_DetailAlbedoMap("Detail Albedo x2", 2D) = "linearGrey" {}
_DetailNormalMapScale("Scale", Range(0.0, 2.0)) = 1.0
[Normal] _DetailNormalMap("Normal Map", 2D) = "bump" {}
[ToggleUI] _ClearCoat("Clear Coat", Float) = 0.0
_ClearCoatMap("Clear Coat Map", 2D) = "white" {}
_ClearCoatMask("Clear Coat Mask", Range(0.0, 1.0)) = 0.0
_ClearCoatSmoothness("Clear Coat Smoothness", Range(0.0, 1.0)) = 1.0
// Blending state
_Surface("__surface", Float) = 0.0
_Blend("__mode", Float) = 0.0
_Cull("__cull", Float) = 2.0
[ToggleUI] _AlphaClip("__clip", Float) = 0.0
[HideInInspector] _BlendOp("__blendop", Float) = 0.0
[HideInInspector] _SrcBlend("__src", Float) = 1.0
[HideInInspector] _DstBlend("__dst", Float) = 0.0
[HideInInspector] _SrcBlendAlpha("__srcA", Float) = 1.0
[HideInInspector] _DstBlendAlpha("__dstA", Float) = 0.0
[HideInInspector] _ZWrite("__zw", Float) = 1.0
[HideInInspector] _BlendModePreserveSpecular("_BlendModePreserveSpecular", Float) = 1.0
[HideInInspector] _AlphaToMask("__alphaToMask", Float) = 0.0
[HideInInspector] _AddPrecomputedVelocity("_AddPrecomputedVelocity", Float) = 0.0
[HideInInspector] _XRMotionVectorsPass("_XRMotionVectorsPass", Float) = 1.0
[ToggleUI] _ReceiveShadows("Receive Shadows", Float) = 1.0
// Editmode props
_QueueOffset("Queue offset", Float) = 0.0
[HideInInspector][NoScaleOffset]unity_Lightmaps("unity_Lightmaps", 2DArray) = "" {}
[HideInInspector][NoScaleOffset]unity_LightmapsInd("unity_LightmapsInd", 2DArray) = "" {}
[HideInInspector][NoScaleOffset]unity_ShadowMasks("unity_ShadowMasks", 2DArray) = "" {}
}
SubShader
{
// Universal Pipeline tag is required. If Universal render pipeline is not set in the graphics settings
// this Subshader will fail. One can add a subshader below or fallback to Standard built-in to make this
// material work with both Universal Render Pipeline and Builtin Unity Pipeline
Tags
{
"RenderType" = "Opaque"
"RenderPipeline" = "UniversalPipeline"
"UniversalMaterialType" = "ComplexLit"
"IgnoreProjector" = "True"
}
LOD 300
// ------------------------------------------------------------------
// Forward only pass.
// Acts also as an opaque forward fallback for deferred rendering.
Pass
{
// Lightmode matches the ShaderPassName set in UniversalRenderPipeline.cs. SRPDefaultUnlit and passes with
// no LightMode tag are also rendered by Universal Render Pipeline
Name "ForwardLit"
Tags
{
"LightMode" = "UniversalForwardOnly"
}
// -------------------------------------
// Render State Commands
Blend[_SrcBlend][_DstBlend], [_SrcBlendAlpha][_DstBlendAlpha]
ZWrite[_ZWrite]
Cull[_Cull]
AlphaToMask[_AlphaToMask]
HLSLPROGRAM
#pragma target 2.0
// -------------------------------------
// Shader Stages
#pragma vertex LitPassVertex
#pragma fragment LitPassFragment
// -------------------------------------
// Material Keywords
#pragma shader_feature_local _NORMALMAP
#pragma shader_feature_local _PARALLAXMAP
#pragma shader_feature_local _RECEIVE_SHADOWS_OFF
#pragma shader_feature_local _ _DETAIL_MULX2 _DETAIL_SCALED
#pragma shader_feature_local_fragment _SURFACE_TYPE_TRANSPARENT
#pragma shader_feature_local_fragment _ALPHATEST_ON
#pragma shader_feature_local_fragment _ _ALPHAPREMULTIPLY_ON _ALPHAMODULATE_ON
#pragma shader_feature_local_fragment _EMISSION
#pragma shader_feature_local_fragment _METALLICSPECGLOSSMAP
#pragma shader_feature_local_fragment _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
#pragma shader_feature_local_fragment _OCCLUSIONMAP
#pragma shader_feature_local_fragment _ _CLEARCOAT _CLEARCOATMAP
#pragma shader_feature_local_fragment _SPECULARHIGHLIGHTS_OFF
#pragma shader_feature_local_fragment _ENVIRONMENTREFLECTIONS_OFF
#pragma shader_feature_local_fragment _SCREENSPACEREFLECTIONS_OFF
#pragma shader_feature_local_fragment _SPECULAR_SETUP
// -------------------------------------
// Universal Pipeline keywords
#if defined(UNITY_PLATFORM_META_QUEST)
#pragma multi_compile _ META_QUEST_LIGHTUNROLL
#endif
#pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN
#pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS
#pragma multi_compile _ EVALUATE_SH_MIXED EVALUATE_SH_VERTEX
#pragma multi_compile _ _LIGHT_LAYERS
#pragma multi_compile _ _CLUSTER_LIGHT_LOOP
#if defined(UNITY_PLATFORM_META_QUEST)
#pragma multi_compile _ META_QUEST_ORTHO_PROJ
#pragma multi_compile _ META_QUEST_NO_SPOTLIGHTS_LIGHT_LOOP
#endif
#pragma multi_compile_fragment _ _ADDITIONAL_LIGHT_SHADOWS
#pragma multi_compile_fragment _ _REFLECTION_PROBE_BLENDING
#pragma multi_compile_fragment _ _REFLECTION_PROBE_BOX_PROJECTION
#pragma multi_compile_fragment _ _REFLECTION_PROBE_ATLAS
#pragma multi_compile_fragment _ _SCREEN_SPACE_REFLECTION
#pragma multi_compile_fragment _ _SHADOWS_SOFT
#pragma multi_compile_fragment _ _SHADOWS_SOFT_LOW _SHADOWS_SOFT_MEDIUM _SHADOWS_SOFT_HIGH
#pragma multi_compile_fragment _ _SCREEN_SPACE_OCCLUSION
#pragma multi_compile_fragment _ _SCREEN_SPACE_IRRADIANCE
#pragma multi_compile_fragment _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3
#pragma multi_compile_fragment _ _LIGHT_COOKIES
#include_with_pragmas "Packages/com.unity.render-pipelines.core/ShaderLibrary/FoveatedRenderingKeywords.hlsl"
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/RenderingLayers.hlsl"
// -------------------------------------
// Unity defined keywords
#pragma multi_compile _ LIGHTMAP_SHADOW_MIXING
#pragma multi_compile _ SHADOWS_SHADOWMASK
#pragma multi_compile _ DIRLIGHTMAP_COMBINED
#pragma multi_compile _ LIGHTMAP_ON
#pragma multi_compile_fragment _ LIGHTMAP_BICUBIC_SAMPLING
#pragma multi_compile_fragment _ REFLECTION_PROBE_ROTATION
#pragma multi_compile _ DYNAMICLIGHTMAP_ON
#pragma multi_compile _ USE_LEGACY_LIGHTMAPS
#pragma multi_compile _ LOD_FADE_CROSSFADE
#pragma multi_compile_fragment _ DEBUG_DISPLAY
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Fog.hlsl"
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ProbeVolumeVariants.hlsl"
//--------------------------------------
// GPU Instancing
#pragma multi_compile_instancing
#pragma instancing_options renderinglayer
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl"
// -------------------------------------
// Includes
#include "Packages/com.unity.render-pipelines.universal/Shaders/LitInput.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Shaders/LitForwardPass.hlsl"
ENDHLSL
}
Pass
{
Name "ShadowCaster"
Tags
{
"LightMode" = "ShadowCaster"
}
// -------------------------------------
// Render State Commands
ZWrite On
ZTest LEqual
ColorMask 0
Cull[_Cull]
HLSLPROGRAM
#pragma target 2.0
// -------------------------------------
// Shader Stages
#pragma vertex ShadowPassVertex
#pragma fragment ShadowPassFragment
// -------------------------------------
// Material Keywords
#pragma shader_feature_local _ALPHATEST_ON
#pragma shader_feature_local_fragment _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
//--------------------------------------
// GPU Instancing
#pragma multi_compile_instancing
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl"
// -------------------------------------
// Unity defined keywords
#pragma multi_compile _ LOD_FADE_CROSSFADE
// This is used during shadow map generation to differentiate between directional and punctual light shadows, as they use different formulas to apply Normal Bias
#pragma multi_compile_vertex _ _CASTING_PUNCTUAL_LIGHT_SHADOW
// -------------------------------------
// Includes
#include "Packages/com.unity.render-pipelines.universal/Shaders/LitInput.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Shaders/ShadowCasterPass.hlsl"
ENDHLSL
}
Pass
{
// Lightmode matches the ShaderPassName set in UniversalRenderPipeline.cs. SRPDefaultUnlit and passes with
// no LightMode tag are also rendered by Universal Render Pipeline
//
// Fill GBuffer data to prevent "holes", just in case someone wants to reuse GBuffer data.
// Deferred lighting is stenciled out for ComplexLit and rendered as forward.
Name "GBuffer"
Tags
{
"LightMode" = "UniversalGBuffer"
}
// -------------------------------------
// Render State Commands
ZWrite[_ZWrite]
ZTest LEqual
Cull[_Cull]
HLSLPROGRAM
#pragma target 4.5
// Deferred Rendering Path does not support the OpenGL-based graphics API:
// Desktop OpenGL, OpenGL ES 3.0, WebGL 2.0.
#pragma exclude_renderers gles3 glcore
// -------------------------------------
// Shader Stages
#pragma vertex LitGBufferPassVertex
#pragma fragment LitGBufferPassFragment
// -------------------------------------
// Material Keywords
#pragma shader_feature_local _NORMALMAP
#pragma shader_feature_local_fragment _ALPHATEST_ON
//#pragma shader_feature_local_fragment _ALPHAPREMULTIPLY_ON
#pragma shader_feature_local_fragment _EMISSION
#pragma shader_feature_local_fragment _METALLICSPECGLOSSMAP
#pragma shader_feature_local_fragment _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
#pragma shader_feature_local_fragment _OCCLUSIONMAP
#pragma shader_feature_local _PARALLAXMAP
#pragma shader_feature_local _ _DETAIL_MULX2 _DETAIL_SCALED
#pragma shader_feature_local_fragment _SPECULARHIGHLIGHTS_OFF
#pragma shader_feature_local_fragment _ENVIRONMENTREFLECTIONS_OFF
#pragma shader_feature_local_fragment _SCREENSPACEREFLECTIONS_OFF
#pragma shader_feature_local_fragment _SPECULAR_SETUP
#pragma shader_feature_local _RECEIVE_SHADOWS_OFF
// -------------------------------------
// Universal Pipeline keywords
#pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN
//#pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS
//#pragma multi_compile _ _ADDITIONAL_LIGHT_SHADOWS
#pragma multi_compile_fragment _ _REFLECTION_PROBE_BLENDING
#pragma multi_compile_fragment _ _REFLECTION_PROBE_BOX_PROJECTION
#pragma multi_compile_fragment _ _SCREEN_SPACE_REFLECTION
#pragma multi_compile_fragment _ _SHADOWS_SOFT
#pragma multi_compile_fragment _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3
#pragma multi_compile_fragment _ _RENDER_PASS_ENABLED
#pragma multi_compile _ _CLUSTER_LIGHT_LOOP
#pragma multi_compile _ EVALUATE_SH_MIXED EVALUATE_SH_VERTEX
#pragma multi_compile_fragment _ _SCREEN_SPACE_IRRADIANCE
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/RenderingLayers.hlsl"
// -------------------------------------
// Unity defined keywords
#pragma multi_compile _ LIGHTMAP_SHADOW_MIXING
#pragma multi_compile _ SHADOWS_SHADOWMASK
#pragma multi_compile _ DIRLIGHTMAP_COMBINED
#pragma multi_compile _ LIGHTMAP_ON
#pragma multi_compile_fragment _ LIGHTMAP_BICUBIC_SAMPLING
#pragma multi_compile_fragment _ REFLECTION_PROBE_ROTATION
#pragma multi_compile _ DYNAMICLIGHTMAP_ON
#pragma multi_compile _ USE_LEGACY_LIGHTMAPS
#pragma multi_compile _ LOD_FADE_CROSSFADE
#pragma multi_compile_fragment _ _GBUFFER_NORMALS_OCT
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ProbeVolumeVariants.hlsl"
//--------------------------------------
// GPU Instancing
#pragma multi_compile_instancing
#pragma instancing_options renderinglayer
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl"
// -------------------------------------
// Includes
#include "Packages/com.unity.render-pipelines.universal/Shaders/LitInput.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Shaders/LitGBufferPass.hlsl"
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/GBufferOutputFormat.hlsl"
ENDHLSL
}
Pass
{
Name "DepthOnly"
Tags
{
"LightMode" = "DepthOnly"
}
// -------------------------------------
// Render State Commands
ZWrite On
ColorMask R
Cull[_Cull]
HLSLPROGRAM
#pragma target 2.0
// -------------------------------------
// Shader Stages
#pragma vertex DepthOnlyVertex
#pragma fragment DepthOnlyFragment
// -------------------------------------
// Material Keywords
#pragma shader_feature_local _ALPHATEST_ON
#pragma shader_feature_local _PARALLAXMAP
#pragma shader_feature_local_fragment _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
// -------------------------------------
// Unity defined keywords
#pragma multi_compile _ LOD_FADE_CROSSFADE
//--------------------------------------
// GPU Instancing
#pragma multi_compile_instancing
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl"
// -------------------------------------
// Includes
#include "Packages/com.unity.render-pipelines.universal/Shaders/LitInput.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Shaders/DepthOnlyPass.hlsl"
ENDHLSL
}
// This pass is used when drawing to a _CameraNormalsTexture texture with the forward renderer or the depthNormal prepass with the deferred renderer.
Pass
{
Name "DepthNormalsOnly"
Tags
{
"LightMode" = "DepthNormalsOnly"
}
// -------------------------------------
// Render State Commands
ZWrite On
Cull[_Cull]
HLSLPROGRAM
#pragma target 2.0
// -------------------------------------
// Shader Stages
#pragma vertex DepthNormalsVertex
#pragma fragment DepthNormalsFragment
// -------------------------------------
// Material Keywords
#pragma shader_feature_local _NORMALMAP
#pragma shader_feature_local _PARALLAXMAP
#pragma shader_feature_local _ _DETAIL_MULX2 _DETAIL_SCALED
#pragma shader_feature_local _ALPHATEST_ON
#pragma shader_feature_local_fragment _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
#pragma shader_feature_local_fragment _METALLICSPECGLOSSMAP
#pragma shader_feature_local_fragment _SCREENSPACEREFLECTIONS_OFF
#pragma shader_feature_local_fragment _SCREENSPACEREFLECTIONSCONTRIBUTETRANSPARENT_OFF
// -------------------------------------
// Universal Pipeline keywords
#pragma multi_compile_fragment _ _GBUFFER_NORMALS_OCT // forward-only variant
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/RenderingLayers.hlsl"
#pragma multi_compile _ _WRITE_SMOOTHNESS
// -------------------------------------
// Unity defined keywords
#pragma multi_compile _ LOD_FADE_CROSSFADE
//--------------------------------------
// GPU Instancing
#pragma multi_compile_instancing
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl"
// -------------------------------------
// Includes
#include "Packages/com.unity.render-pipelines.universal/Shaders/LitInput.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Shaders/LitDepthNormalsPass.hlsl"
ENDHLSL
}
// This pass it not used during regular rendering, only for lightmap baking.
Pass
{
Name "Meta"
Tags
{
"LightMode" = "Meta"
}
// -------------------------------------
// Render State Commands
Cull Off
HLSLPROGRAM
#pragma target 2.0
// -------------------------------------
// Shader Stages
#pragma vertex UniversalVertexMeta
#pragma fragment UniversalFragmentMetaLit
// -------------------------------------
// Material Keywords
#pragma shader_feature_local_fragment _SPECULAR_SETUP
#pragma shader_feature_local_fragment _EMISSION
#pragma shader_feature_local_fragment _METALLICSPECGLOSSMAP
#pragma shader_feature_local_fragment _ALPHATEST_ON
#pragma shader_feature_local_fragment _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
#pragma shader_feature_local _ _DETAIL_MULX2 _DETAIL_SCALED
#pragma shader_feature_local_fragment _SPECGLOSSMAP
#pragma shader_feature EDITOR_VISUALIZATION
// -------------------------------------
// Includes
#include "Packages/com.unity.render-pipelines.universal/Shaders/LitInput.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Shaders/LitMetaPass.hlsl"
ENDHLSL
}
Pass
{
Name "Universal2D"
Tags
{
"LightMode" = "Universal2D"
}
// -------------------------------------
// Render State Commands
Blend[_SrcBlend][_DstBlend]
ZWrite[_ZWrite]
Cull[_Cull]
HLSLPROGRAM
#pragma target 2.0
// -------------------------------------
// Shader Stages
#pragma vertex vert
#pragma fragment frag
// -------------------------------------
// Material Keywords
#pragma shader_feature_local_fragment _ALPHATEST_ON
#pragma shader_feature_local_fragment _ALPHAPREMULTIPLY_ON
// -------------------------------------
// Includes
#include "Packages/com.unity.render-pipelines.universal/Shaders/LitInput.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Shaders/Utils/Universal2D.hlsl"
ENDHLSL
}
Pass
{
Name "MotionVectors"
Tags { "LightMode" = "MotionVectors" }
ColorMask RG
HLSLPROGRAM
#pragma shader_feature_local _ALPHATEST_ON
#pragma multi_compile _ LOD_FADE_CROSSFADE
#pragma shader_feature_local_vertex _ADD_PRECOMPUTED_VELOCITY
#include "Packages/com.unity.render-pipelines.universal/Shaders/LitInput.hlsl"
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ObjectMotionVectors.hlsl"
ENDHLSL
}
Pass
{
Name "XRMotionVectors"
Tags { "LightMode" = "XRMotionVectors" }
ColorMask RGB
// Stencil write for obj motion pixels
Stencil
{
WriteMask 1
Ref 1
Comp Always
Pass Replace
}
HLSLPROGRAM
#pragma shader_feature_local _ALPHATEST_ON
#pragma multi_compile _ LOD_FADE_CROSSFADE
#pragma multi_compile _ APPLICATION_SPACE_WARP_MOTION_TRANSPARENT
#pragma shader_feature_local_vertex _ADD_PRECOMPUTED_VELOCITY
#define APPLICATION_SPACE_WARP_MOTION 1
#include "Packages/com.unity.render-pipelines.universal/Shaders/LitInput.hlsl"
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ObjectMotionVectors.hlsl"
ENDHLSL
}
}
//////////////////////////////////////////////////////
FallBack "Hidden/Universal Render Pipeline/Lit"
FallBack "Hidden/Universal Render Pipeline/FallbackError"
CustomEditor "UnityEditor.Rendering.Universal.ShaderGUI.LitShader"
}
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: ee7e4c9a5f6364b688a332c67fc32cca
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 83e12e3399064822abd3e69798ce3053
timeCreated: 1602509589
@@ -0,0 +1,117 @@
Shader "Hidden/Universal Render Pipeline/Debug/DebugReplacement"
{
SubShader
{
Tags{"RenderType" = "Opaque" "RenderPipeline" = "UniversalPipeline" "IgnoreProjector" = "True"}
Pass
{
Name "Vertex Attributes"
Tags {"LightMode" = "UniversalForward"}
HLSLPROGRAM
#pragma target 2.0
#pragma vertex vert
#pragma fragment frag
#define DEBUG_DISPLAY
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Debug/Debugging3D.hlsl"
//--------------------------------------
// GPU Instancing
#include_with_pragmas "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DOTS.hlsl"
// -------------------------------------
// Includes
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"
struct Attributes
{
float4 positionOS : POSITION;
float4 texcoord0 : TEXCOORD0;
float4 texcoord1 : TEXCOORD1;
float4 texcoord2 : TEXCOORD2;
float4 texcoord3 : TEXCOORD3;
float4 texcoord4 : TEXCOORD4;
float4 texcoord5 : TEXCOORD5;
float4 texcoord6 : TEXCOORD6;
float4 texcoord7 : TEXCOORD7;
float4 color : COLOR;
float4 normal : NORMAL;
float4 tangent : TANGENT;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct Varyings
{
float4 positionCS : SV_POSITION;
float4 texcoord0 : TEXCOORD0;
float4 texcoord1 : TEXCOORD1;
float4 texcoord2 : TEXCOORD2;
float4 texcoord3 : TEXCOORD3;
float4 texcoord4 : TEXCOORD4;
float4 texcoord5 : TEXCOORD5;
float4 texcoord6 : TEXCOORD6;
float4 texcoord7 : TEXCOORD7;
float4 color : COLOR;
float4 normal : NORMAL;
float4 tangent : TANGENT;
};
Varyings vert(Attributes input)
{
Varyings output;
UNITY_SETUP_INSTANCE_ID(input);
output.texcoord0 = input.texcoord0;
output.texcoord1 = input.texcoord1;
output.texcoord2 = input.texcoord2;
output.texcoord3 = input.texcoord3;
output.texcoord4 = input.texcoord4;
output.texcoord5 = input.texcoord5;
output.texcoord6 = input.texcoord6;
output.texcoord7 = input.texcoord7;
output.color = input.color;
output.normal = input.normal;
output.tangent = input.tangent;
output.positionCS = TransformObjectToHClip(input.positionOS.xyz);
return output;
}
half4 frag(Varyings input) : SV_TARGET
{
switch (_DebugVertexAttributeMode)
{
case DEBUGVERTEXATTRIBUTEMODE_TEXCOORD0:
return input.texcoord0;
case DEBUGVERTEXATTRIBUTEMODE_TEXCOORD1:
return input.texcoord1;
case DEBUGVERTEXATTRIBUTEMODE_TEXCOORD2:
return input.texcoord2;
case DEBUGVERTEXATTRIBUTEMODE_TEXCOORD3:
return input.texcoord3;
case DEBUGVERTEXATTRIBUTEMODE_TEXCOORD4:
return input.texcoord4;
case DEBUGVERTEXATTRIBUTEMODE_TEXCOORD5:
return input.texcoord5;
case DEBUGVERTEXATTRIBUTEMODE_TEXCOORD6:
return input.texcoord6;
case DEBUGVERTEXATTRIBUTEMODE_TEXCOORD7:
return input.texcoord7;
case DEBUGVERTEXATTRIBUTEMODE_COLOR:
return input.color;
case DEBUGVERTEXATTRIBUTEMODE_TANGENT:
return input.tangent;
case DEBUGVERTEXATTRIBUTEMODE_NORMAL:
return input.normal;
default:
return half4(0, 0, 0, 1);
}
}
ENDHLSL
}
}
}
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: cf852408f2e174538bcd9b7fda1c5ae7
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,265 @@
Shader "Hidden/Universal/HDRDebugView"
{
HLSLINCLUDE
#pragma target 4.5
#pragma editor_sync_compilation
#pragma multi_compile_fragment _ DEBUG_DISPLAY
#pragma multi_compile_local_fragment _ HDR_ENCODING
#pragma dynamic_branch_local_fragment _ _HDR_OVERLAY
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/ACES.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/HDROutput.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Debug/DebuggingFullscreen.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Debug.hlsl"
#include "Packages/com.unity.render-pipelines.core/Runtime/Utilities/Blit.hlsl"
TEXTURE2D_X(_OverlayUITexture);
TEXTURE2D(_xyBuffer);
int _DebugHDRMode;
float4 _HDRDebugParams; // xy: xyBuffer size, zw: unused
float4 _HDROutputLuminanceParams; // xy: brightness min/max, z: paper white brightness, w: one over paper white brightness
#define _MinNits _HDROutputLuminanceParams.x
#define _MaxNits _HDROutputLuminanceParams.y
#define _PaperWhite _HDROutputLuminanceParams.z
float2 RGBtoxy(float3 rgb)
{
float3 XYZ = RotateOutputSpaceToXYZ(rgb);
return XYZtoxy(XYZ);
}
float3 uvToGamut(float2 uv)
{
float3 xyzColor = xyYtoXYZ(float3(uv.x, uv.y, 1.0f));
float3 linearRGB = RotateXYZToOutputSpace(xyzColor);
float scale = 1.0f / length(linearRGB);
float desat = dot(linearRGB, 0.333f);
scale *= 1.0 + exp(-length(linearRGB - desat) * 2.0f) * 0.5f;
linearRGB *= scale;
return linearRGB;
}
bool IsInCIExyMapping(float2 xy)
{
return SAMPLE_TEXTURE2D_LOD(_xyBuffer, sampler_PointClamp, xy, 0.0).x != 0;
}
float3 ValuesAbovePaperWhite(half4 color, float2 uv)
{
float maxC = max(color.x, max(color.y, color.z));
if (maxC > _PaperWhite)
{
if ( maxC > _MaxNits)
{
return float3(0, 0, _PaperWhite);
}
else
{
float t = (maxC - _PaperWhite) / (_MaxNits - _PaperWhite);
return lerp(float3(_PaperWhite, _PaperWhite, 0), float3(_PaperWhite, 0, 0), saturate(t));
}
}
else
{
return Luminance(color).xxx;
}
}
void RenderDebugHDR(half4 color, float2 uv, inout half4 debugColor)
{
if (_DebugHDRMode == HDRDEBUGMODE_VALUES_ABOVE_PAPER_WHITE)
{
debugColor.xyz = ValuesAbovePaperWhite(color, uv);
return;
}
int displayClip = (_DebugHDRMode == HDRDEBUGMODE_GAMUT_CLIP);
int gamutPiPSize = _ScreenSize.x / 3.0f;
float2 r_2020 = float2(0.708, 0.292);
float2 g_2020 = float2(0.170, 0.797);
float2 b_2020 = float2(0.131, 0.046);
float2 r_709 = float2(0.64, 0.33);
float2 g_709 = float2(0.3, 0.6);
float2 b_709 = float2(0.15, 0.06);
float2 r_p3 = float2(0.68, 0.32);
float2 g_p3 = float2(0.265, 0.69);
float2 b_p3 = float2(0.15, 0.06);
float2 pos = uv * _ScreenSize.xy;
float lineThickness = 0.002;
float2 xy = RGBtoxy(color.rgb);
float3 rec2020Color = float3(_PaperWhite, 0, 0);
float3 rec2020ColorDesat = float3(3.0, 0.5, 0.5);
float3 rec709Color = float3(0, _PaperWhite, 0);
float3 rec709ColorDesat = float3(0.4, 0.6, 0.4);
float3 p3Color = float3(0, 0, _PaperWhite);
float3 p3ColorDesat = float3(0.4, 0.4, 0.6);
//Display Gamut Clip Scene colour conversion
if (displayClip)
{
float clipAlpha = 0.2f;
if (IsPointInTriangle(xy, r_709, g_709, b_709))
{
color.rgb = (color.rgb * (1 - clipAlpha) + clipAlpha * rec709Color);
}
else if (IsPointInTriangle(xy, r_p3, g_p3, b_p3))
{
color.rgb = (color.rgb * (1 - clipAlpha) + clipAlpha * p3Color);
}
else if (IsPointInTriangle(xy, r_2020, g_2020, b_2020))
{
color.rgb = (color.rgb * (1 - clipAlpha) + clipAlpha * rec2020Color);
}
}
float4 gamutColor = 0;
if (all(pos < gamutPiPSize))
{
float2 uv = pos / gamutPiPSize; // scale-down uv
float4 lineColor = DrawSegment(uv, g_709, b_709, lineThickness, float3(0, 0, 0)) + DrawSegment(uv, b_709, r_709, lineThickness, float3(0, 0, 0)) +
DrawSegment(uv, r_709, g_709, lineThickness, float3(0, 0, 0)) +
DrawSegment(uv, g_2020, b_2020, lineThickness, float3(0, 0, 0)) + DrawSegment(uv, b_2020, r_2020, lineThickness, float3(0, 0, 0)) +
DrawSegment(uv, r_2020, g_2020, lineThickness, float3(0, 0, 0)) +
DrawSegment(uv, g_p3, b_p3, lineThickness, float3(0, 0, 0)) + DrawSegment(uv, b_p3, r_p3, lineThickness, float3(0, 0, 0)) +
DrawSegment(uv, r_p3, g_p3, lineThickness, float3(0, 0, 0));
float3 linearRGB = 0;
bool pointInRec709 = true;
if (IsPointInTriangle(uv, r_2020, g_2020, b_2020))
{
float3 colorSpaceColor = rec709Color;
linearRGB = uvToGamut(uv);
if (displayClip)
{
if (IsPointInTriangle(uv, r_709, g_709, b_709))
{
colorSpaceColor = rec709Color;
linearRGB.rgb = rec709ColorDesat;
}
else if (IsPointInTriangle(uv, r_p3, g_p3, b_p3))
{
colorSpaceColor = p3Color;
linearRGB.rgb = p3ColorDesat;
}
else
{
colorSpaceColor = rec2020Color;
linearRGB.rgb = rec2020ColorDesat;
}
}
gamutColor.a = max(lineColor.a, 0.15);
gamutColor.rgb = linearRGB * _PaperWhite;
if (IsInCIExyMapping(uv))
{
gamutColor.a = 1;
if (displayClip)
gamutColor.rgb = colorSpaceColor;
}
}
gamutColor.rgb = gamutColor.rgb * (1.0f - lineColor.a) + lineColor.rgb;
}
debugColor.rgb = gamutColor.rgb * gamutColor.a + color.rgb * (1 - gamutColor.a);
}
ENDHLSL
SubShader
{
Tags{ "RenderPipeline" = "UniversalPipeline" }
Pass
{
ZWrite Off
ZTest Always
ZClip Off
Blend Off
Cull Off
HLSLPROGRAM
#pragma vertex Vert
#pragma fragment Frag
RW_TEXTURE2D(float, _xyBufferRW);
#define _SizePerDim _HDRDebugParams.xy
half4 Frag(Varyings input) : SV_Target
{
float4 col = SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_PointClamp, input.texcoord);
float2 xy = (RGBtoxy(col.rgb));
_xyBufferRW[(xy * _SizePerDim)] = 1;
return col;
}
ENDHLSL
}
Pass
{
ZWrite Off
ZTest Always
ZClip Off
Blend Off
Cull Off
HLSLPROGRAM
#pragma vertex Vert
#pragma fragment Frag
half4 Frag(Varyings input) : SV_Target
{
float4 outCol = 0;
float2 uv = input.texcoord;
half4 col = SAMPLE_TEXTURE2D_X(_BlitTexture, sampler_PointClamp, uv);
half4 outColor = 0;
RenderDebugHDR(col, uv, outColor);
#if defined(HDR_ENCODING)
UNITY_BRANCH if(_HDR_OVERLAY)
{
float4 uiSample = SAMPLE_TEXTURE2D_X(_OverlayUITexture, sampler_PointClamp, input.texcoord);
outColor.rgb = SceneUIComposition(uiSample, outColor.rgb, _PaperWhite, _MaxNits);
}
outColor.rgb = OETF(outColor.rgb, _MaxNits);
#endif
#if defined(DEBUG_DISPLAY)
half4 debugColor = 0;
if (CanDebugOverrideOutputColor(outColor, uv, debugColor))
{
return debugColor;
}
#endif
return outColor;
}
ENDHLSL
}
}
Fallback "Hidden/Core/FallbackError"
}
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 573620ae32aec764abd4d728906d2587
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,26 @@
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/EntityLighting.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareDepthTexture.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareNormalsTexture.hlsl"
// Compute worldspace position and normal at given screenspace position and write it in the ResultBuffer
#pragma kernel ComputePositionNormal
RWStructuredBuffer<float4> _ResultBuffer;
uniform float4 _positionSS; // screenspace position
[numthreads(1,1,1)]
void ComputePositionNormal (uint3 id : SV_DispatchThreadID)
{
float deviceDepth = LOAD_TEXTURE2D_X(_CameraDepthTexture, _positionSS.xy).r;
float2 positionNDC = _positionSS.xy *_ScreenSize.zw + (0.5 * _ScreenSize.zw);
float3 positionWS = ComputeWorldSpacePosition(positionNDC, deviceDepth, UNITY_MATRIX_I_VP);
float3 normalWS = LoadSceneNormals(_positionSS.xy);
_ResultBuffer[0] = float4(positionWS, 1.0f);
_ResultBuffer[1] = float4(normalWS, 0.0f);
}
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 53626a513ea68ce47b59dc1299fe3959
ComputeShaderImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,41 @@
fileFormatVersion: 2
guid: 9b4e681081e2b4c469111bb649e2f7ee
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}
useAsTemplate: 1
exposeTemplateAsShader: 1
template:
name: Decal URP Default
category: Decals
description: 'This is the default decal shader that comes with URP. It projects
a color and normal along a single axis.
In order to use decals
in URP, you''ll need to add the Decal Renderer Feature to URP''s Renderer Data
asset. In HDRP, decals work automatically so no settings changes are required.
You
can add a decal to your scene by right-clicking in your scene''s Hierarchy
panel and selecting Rendering->URP Decal Projector. Then select the new Decal
Projector and assign it a material that uses your Shader Graph asset.
<i>Supported
Pipeline(s): URP
Active Target: Decal
VFX Graph Support: disabled</i>'
icon: {instanceID: 0}
thumbnail: {fileID: 2800000, guid: 73df811908489f1408d1bec44aab3a80, type: 3}
@@ -0,0 +1,83 @@
#ifndef UNIVERSAL_DEPTH_NORMALS_PASS_INCLUDED
#define UNIVERSAL_DEPTH_NORMALS_PASS_INCLUDED
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#if defined(LOD_FADE_CROSSFADE)
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/LODCrossFade.hlsl"
#endif
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/RealtimeLights.hlsl"
struct Attributes
{
float4 positionOS : POSITION;
float4 tangentOS : TANGENT;
float2 texcoord : TEXCOORD0;
float3 normal : NORMAL;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct Varyings
{
float4 positionCS : SV_POSITION;
#if defined(_ALPHATEST_ON)
float2 uv : TEXCOORD1;
#endif
float3 normalWS : TEXCOORD2;
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
};
Varyings DepthNormalsVertex(Attributes input)
{
Varyings output = (Varyings)0;
UNITY_SETUP_INSTANCE_ID(input);
UNITY_TRANSFER_INSTANCE_ID(input, output);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
#if defined(_ALPHATEST_ON)
output.uv = TRANSFORM_TEX(input.texcoord, _BaseMap);
#endif
output.positionCS = TransformObjectToHClip(input.positionOS.xyz);
VertexNormalInputs normalInput = GetVertexNormalInputs(input.normal, input.tangentOS);
output.normalWS = NormalizeNormalPerVertex(normalInput.normalWS);
return output;
}
void DepthNormalsFragment(
Varyings input
, out half4 outNormalWS : SV_Target0
#ifdef _WRITE_RENDERING_LAYERS
, out uint outRenderingLayers : SV_Target1
#endif
)
{
UNITY_SETUP_INSTANCE_ID(input);
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
#if defined(_ALPHATEST_ON)
Alpha(SampleAlbedoAlpha(input.uv, TEXTURE2D_ARGS(_BaseMap, sampler_BaseMap)).a, _BaseColor, _Cutoff);
#endif
#if defined(LOD_FADE_CROSSFADE)
LODFadeCrossFade(input.positionCS);
#endif
#if defined(_GBUFFER_NORMALS_OCT)
float3 normalWS = normalize(input.normalWS);
float2 octNormalWS = PackNormalOctQuadEncode(normalWS); // values between [-1, +1], must use fp32 on some platforms.
float2 remappedOctNormalWS = saturate(octNormalWS * 0.5 + 0.5); // values between [ 0, 1]
half3 packedNormalWS = PackFloat2To888(remappedOctNormalWS); // values between [ 0, 1]
outNormalWS = half4(packedNormalWS, 0.0);
#else
float3 normalWS = NormalizeNormalPerPixel(input.normalWS);
outNormalWS = half4(normalWS, 0.0);
#endif
#ifdef _WRITE_RENDERING_LAYERS
outRenderingLayers = EncodeMeshRenderingLayer();
#endif
}
#endif
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: b76d45ea333b2a049bc45c5328ef3e7c
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
preprocessorOverride: 0
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,81 @@
#ifndef UNIVERSAL_DEPTH_ONLY_PASS_INCLUDED
#define UNIVERSAL_DEPTH_ONLY_PASS_INCLUDED
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#if defined(LOD_FADE_CROSSFADE)
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/LODCrossFade.hlsl"
#endif
#if defined(_PARALLAXMAP) && defined(_ALPHATEST_ON)
#define REQUIRES_TANGENT_SPACE_VIEW_DIR_INTERPOLATOR
#endif
struct Attributes
{
float4 position : POSITION;
float2 texcoord : TEXCOORD0;
#if defined(REQUIRES_TANGENT_SPACE_VIEW_DIR_INTERPOLATOR)
float3 normalOS : NORMAL;
float4 tangentOS : TANGENT;
#endif
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct Varyings
{
#if defined(_ALPHATEST_ON)
float2 uv : TEXCOORD0;
#endif
#if defined(REQUIRES_TANGENT_SPACE_VIEW_DIR_INTERPOLATOR)
half3 viewDirTS : TEXCOORD1;
#endif
float4 positionCS : SV_POSITION;
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
};
Varyings DepthOnlyVertex(Attributes input)
{
Varyings output = (Varyings)0;
UNITY_SETUP_INSTANCE_ID(input);
UNITY_TRANSFER_INSTANCE_ID(input, output);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
#if defined(_ALPHATEST_ON)
output.uv = TRANSFORM_TEX(input.texcoord, _BaseMap);
#endif
output.positionCS = TransformObjectToHClip(input.position.xyz);
#if defined(REQUIRES_TANGENT_SPACE_VIEW_DIR_INTERPOLATOR)
VertexPositionInputs vertexInput = GetVertexPositionInputs(input.position.xyz);
VertexNormalInputs normalInput = GetVertexNormalInputs(input.normalOS, input.tangentOS);
half3 viewDirWS = GetWorldSpaceNormalizeViewDir(vertexInput.positionWS);
half sign = input.tangentOS.w * float(GetOddNegativeScale());
half4 tangentWS = half4(normalInput.tangentWS.xyz, sign);
output.viewDirTS = GetViewDirectionTangentSpace(tangentWS, half3(normalInput.normalWS), viewDirWS);
#endif
return output;
}
half DepthOnlyFragment(Varyings input) : SV_TARGET
{
UNITY_SETUP_INSTANCE_ID(input);
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
#if defined(_PARALLAXMAP) && defined(_ALPHATEST_ON)
ApplyPerPixelDisplacement(input.viewDirTS, input.uv);
#endif
#if defined(_ALPHATEST_ON)
Alpha(SampleAlbedoAlpha(input.uv, TEXTURE2D_ARGS(_BaseMap, sampler_BaseMap)).a, _BaseColor, _Cutoff);
#endif
#if defined(LOD_FADE_CROSSFADE)
LODFadeCrossFade(input.positionCS);
#endif
return input.positionCS.z;
}
#endif
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 0acd4fdbcf0cf654a9cdf3e9ccc2edce
timeCreated: 1488965025
licenseType: Pro
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,738 @@
{
"m_SGVersion": 3,
"m_Type": "UnityEditor.ShaderGraph.GraphData",
"m_ObjectId": "6318ffd0f2104c5caf9c1135e0865739",
"m_Properties": [
{
"m_Id": "26bd7e32ce074feda892063d0c11ee51"
}
],
"m_Keywords": [],
"m_Dropdowns": [],
"m_CategoryData": [
{
"m_Id": "58f40455834e4ed8a751f34672ee0905"
}
],
"m_Nodes": [
{
"m_Id": "4c723b931760454694de99abb517648b"
},
{
"m_Id": "780f8769cbea425cba5117597de9bf1c"
},
{
"m_Id": "8a48e6c3bfab4c0e9de0c289535f147a"
},
{
"m_Id": "72c0c344d5024bb2b89b36f881e6bab6"
},
{
"m_Id": "beffde4ede024046818e1db4326ec07e"
},
{
"m_Id": "fcb9f35339ad4b45ae5cfcb85eb2b283"
}
],
"m_GroupDatas": [],
"m_StickyNoteDatas": [],
"m_Edges": [
{
"m_OutputSlot": {
"m_Node": {
"m_Id": "72c0c344d5024bb2b89b36f881e6bab6"
},
"m_SlotId": 1
},
"m_InputSlot": {
"m_Node": {
"m_Id": "fcb9f35339ad4b45ae5cfcb85eb2b283"
},
"m_SlotId": 1
}
},
{
"m_OutputSlot": {
"m_Node": {
"m_Id": "8a48e6c3bfab4c0e9de0c289535f147a"
},
"m_SlotId": 2
},
"m_InputSlot": {
"m_Node": {
"m_Id": "72c0c344d5024bb2b89b36f881e6bab6"
},
"m_SlotId": 0
}
},
{
"m_OutputSlot": {
"m_Node": {
"m_Id": "8a48e6c3bfab4c0e9de0c289535f147a"
},
"m_SlotId": 2
},
"m_InputSlot": {
"m_Node": {
"m_Id": "fcb9f35339ad4b45ae5cfcb85eb2b283"
},
"m_SlotId": 0
}
},
{
"m_OutputSlot": {
"m_Node": {
"m_Id": "beffde4ede024046818e1db4326ec07e"
},
"m_SlotId": 0
},
"m_InputSlot": {
"m_Node": {
"m_Id": "fcb9f35339ad4b45ae5cfcb85eb2b283"
},
"m_SlotId": 2
}
},
{
"m_OutputSlot": {
"m_Node": {
"m_Id": "fcb9f35339ad4b45ae5cfcb85eb2b283"
},
"m_SlotId": 3
},
"m_InputSlot": {
"m_Node": {
"m_Id": "4c723b931760454694de99abb517648b"
},
"m_SlotId": 0
}
}
],
"m_VertexContext": {
"m_Position": {
"x": -0.0000064373016357421879,
"y": 4.666651725769043
},
"m_Blocks": []
},
"m_FragmentContext": {
"m_Position": {
"x": 0.0,
"y": 200.0
},
"m_Blocks": [
{
"m_Id": "4c723b931760454694de99abb517648b"
},
{
"m_Id": "780f8769cbea425cba5117597de9bf1c"
}
]
},
"m_PreviewData": {
"serializedMesh": {
"m_SerializedMesh": "{\"mesh\":{\"instanceID\":0}}",
"m_Guid": ""
},
"preventRotation": false
},
"m_Path": "Shader Graphs",
"m_GraphPrecision": 1,
"m_PreviewMode": 2,
"m_OutputNode": {
"m_Id": ""
},
"m_ActiveTargets": [
{
"m_Id": "6ba83f4495e54c749af3a4a227433223"
}
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot",
"m_ObjectId": "04e351fc8cf644bfb0e2bcd7c2e18ea4",
"m_Id": 1,
"m_DisplayName": "B",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "B",
"m_StageCapability": 3,
"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_SGVersion": 0,
"m_Type": "UnityEditor.Rendering.Fullscreen.ShaderGraph.FullscreenData",
"m_ObjectId": "0b64171c534d407ba3cab148cba25a7c",
"m_Version": 0,
"m_fullscreenMode": 0,
"m_BlendMode": 0,
"m_SrcColorBlendMode": 0,
"m_DstColorBlendMode": 1,
"m_ColorBlendOperation": 0,
"m_SrcAlphaBlendMode": 0,
"m_DstAlphaBlendMode": 1,
"m_AlphaBlendOperation": 0,
"m_EnableStencil": false,
"m_StencilReference": 0,
"m_StencilReadMask": 255,
"m_StencilWriteMask": 255,
"m_StencilCompareFunction": 8,
"m_StencilPassOperation": 0,
"m_StencilFailOperation": 0,
"m_StencilDepthFailOperation": 0,
"m_DepthWrite": false,
"m_depthWriteMode": 0,
"m_AllowMaterialOverride": false,
"m_DepthTestMode": 0
}
{
"m_SGVersion": 1,
"m_Type": "UnityEditor.ShaderGraph.Internal.Vector1ShaderProperty",
"m_ObjectId": "26bd7e32ce074feda892063d0c11ee51",
"m_Guid": {
"m_GuidSerialized": "6022b6b0-2a34-4900-82c8-f106319daeae"
},
"m_Name": "Intensity",
"m_DefaultRefNameVersion": 1,
"m_RefNameGeneratedByDisplayName": "Intensity",
"m_DefaultReferenceName": "_Intensity",
"m_OverrideReferenceName": "",
"m_GeneratePropertyBlock": true,
"m_UseCustomSlotLabel": false,
"m_CustomSlotLabel": "",
"m_DismissedVersion": 0,
"m_Precision": 0,
"overrideHLSLDeclaration": false,
"hlslDeclarationOverride": 0,
"m_Hidden": false,
"m_Value": 1.0,
"m_FloatType": 0,
"m_RangeValues": {
"x": 0.0,
"y": 1.0
}
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
"m_ObjectId": "4c723b931760454694de99abb517648b",
"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": "d2ec017c5f984fb18b3b94fb73e623e7"
}
],
"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.CategoryData",
"m_ObjectId": "58f40455834e4ed8a751f34672ee0905",
"m_Name": "",
"m_ChildObjectList": [
{
"m_Id": "26bd7e32ce074feda892063d0c11ee51"
}
]
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot",
"m_ObjectId": "5925490bf11f41acbacc32689179cb74",
"m_Id": 1,
"m_DisplayName": "Out",
"m_SlotType": 1,
"m_Hidden": false,
"m_ShaderOutputName": "Out",
"m_StageCapability": 3,
"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_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot",
"m_ObjectId": "59aff61f204e46be8147bce1bd671019",
"m_Id": 0,
"m_DisplayName": "A",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "A",
"m_StageCapability": 3,
"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_SGVersion": 1,
"m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalTarget",
"m_ObjectId": "6ba83f4495e54c749af3a4a227433223",
"m_Datas": [
{
"m_Id": "0b64171c534d407ba3cab148cba25a7c"
}
],
"m_ActiveSubTarget": {
"m_Id": "c5e6639bcec84ef393b3bc5eb3d28ce4"
},
"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_AdditionalMotionVectorMode": 0,
"m_AlembicMotionVectors": false,
"m_SupportsLODCrossFade": false,
"m_CustomEditorGUI": "",
"m_SupportVFX": false
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.OneMinusNode",
"m_ObjectId": "72c0c344d5024bb2b89b36f881e6bab6",
"m_Group": {
"m_Id": ""
},
"m_Name": "One Minus",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": -525.3333129882813,
"y": 266.66668701171877,
"width": 133.33331298828126,
"height": 96.0
}
},
"m_Slots": [
{
"m_Id": "8f5713c4f22c46259950c39359047080"
},
{
"m_Id": "5925490bf11f41acbacc32689179cb74"
}
],
"synonyms": [
"complement",
"invert",
"opposite"
],
"m_Precision": 0,
"m_PreviewExpanded": false,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
}
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
"m_ObjectId": "780f8769cbea425cba5117597de9bf1c",
"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": "814f4da7959e4f1f88fb7c95bf2dee1d"
}
],
"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.ColorRGBAMaterialSlot",
"m_ObjectId": "7e4408ff5b564b7db1329620bac0c45d",
"m_Id": 2,
"m_DisplayName": "Output",
"m_SlotType": 1,
"m_Hidden": false,
"m_ShaderOutputName": "Output",
"m_StageCapability": 2,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.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.Vector1MaterialSlot",
"m_ObjectId": "814f4da7959e4f1f88fb7c95bf2dee1d",
"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.DynamicVectorMaterialSlot",
"m_ObjectId": "81ba1366b5504f4eabee1ac86bd9ced1",
"m_Id": 2,
"m_DisplayName": "T",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "T",
"m_StageCapability": 3,
"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_SGVersion": 0,
"m_Type": "UnityEditor.Rendering.Universal.UniversalSampleBufferNode",
"m_ObjectId": "8a48e6c3bfab4c0e9de0c289535f147a",
"m_Group": {
"m_Id": ""
},
"m_Name": "URP Sample Buffer",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": -769.3333129882813,
"y": 200.0,
"width": 156.66668701171876,
"height": 132.0
}
},
"m_Slots": [
{
"m_Id": "b03211bd92e646c5a5960632ada03074"
},
{
"m_Id": "7e4408ff5b564b7db1329620bac0c45d"
}
],
"synonyms": [
"normal",
"motion vector",
"blit"
],
"m_Precision": 0,
"m_PreviewExpanded": false,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_BufferType": 2
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.DynamicVectorMaterialSlot",
"m_ObjectId": "8f5713c4f22c46259950c39359047080",
"m_Id": 0,
"m_DisplayName": "In",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "In",
"m_StageCapability": 3,
"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_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.ScreenPositionMaterialSlot",
"m_ObjectId": "b03211bd92e646c5a5960632ada03074",
"m_Id": 0,
"m_DisplayName": "UV",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "UV",
"m_StageCapability": 3,
"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_ScreenSpaceType": 0
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
"m_ObjectId": "b8195f05c2c3449ab5a125416488cfbe",
"m_Id": 0,
"m_DisplayName": "Intensity",
"m_SlotType": 1,
"m_Hidden": false,
"m_ShaderOutputName": "Out",
"m_StageCapability": 3,
"m_Value": 0.0,
"m_DefaultValue": 0.0,
"m_Labels": []
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.PropertyNode",
"m_ObjectId": "beffde4ede024046818e1db4326ec07e",
"m_Group": {
"m_Id": ""
},
"m_Name": "Property",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": -513.3333129882813,
"y": 379.3333435058594,
"width": 121.33331298828125,
"height": 36.0
}
},
"m_Slots": [
{
"m_Id": "b8195f05c2c3449ab5a125416488cfbe"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_Property": {
"m_Id": "26bd7e32ce074feda892063d0c11ee51"
}
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.Rendering.Universal.ShaderGraph.UniversalFullscreenSubTarget",
"m_ObjectId": "c5e6639bcec84ef393b3bc5eb3d28ce4"
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot",
"m_ObjectId": "d2ec017c5f984fb18b3b94fb73e623e7",
"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.DynamicVectorMaterialSlot",
"m_ObjectId": "f63c8d26ee4142da81024c50c4d020d5",
"m_Id": 3,
"m_DisplayName": "Out",
"m_SlotType": 1,
"m_Hidden": false,
"m_ShaderOutputName": "Out",
"m_StageCapability": 3,
"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_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.LerpNode",
"m_ObjectId": "fcb9f35339ad4b45ae5cfcb85eb2b283",
"m_Group": {
"m_Id": ""
},
"m_Name": "Lerp",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": -304.0000305175781,
"y": 200.0,
"width": 209.33331298828126,
"height": 327.99993896484377
}
},
"m_Slots": [
{
"m_Id": "59aff61f204e46be8147bce1bd671019"
},
{
"m_Id": "04e351fc8cf644bfb0e2bcd7c2e18ea4"
},
{
"m_Id": "81ba1366b5504f4eabee1ac86bd9ced1"
},
{
"m_Id": "f63c8d26ee4142da81024c50c4d020d5"
}
],
"synonyms": [
"mix",
"blend",
"linear interpolate"
],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
}
}
@@ -0,0 +1,39 @@
fileFormatVersion: 2
guid: fb6390f650ca44a5ba3246d8dda47927
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}
useAsTemplate: 1
exposeTemplateAsShader: 1
template:
name: Fullscreen Invert - URP
category: Image Processing
description: 'A URP Shader Graph template that does simple fullscreen image invert.
Fullscreen
shaders are intended to be used to apply image adjustments for applications
like post-process filters. They are not intended to be applied to individual
meshes.
To apply a fullscreen shader as a post-process filter, select
URP''s renderer data asset and click the Add Renderer Feature button at the
bottom of the Inspector. Choose Full Screen Pass Renderer Feature. Then create
a material from your fullscreen shader and apply it to the Pass Material slot
of the Full Screen Pass Renderer Feature.
Supported Pipeline(s): URP
Active
Target: Fullscreen
VFX Graph Support: disabled'
icon: {instanceID: 0}
thumbnail: {fileID: 2800000, guid: 2bf17b1d7445af843ad939d7527d8938, type: 3}
@@ -0,0 +1,117 @@
fileFormatVersion: 2
guid: 2bf17b1d7445af843ad939d7527d8938
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 2
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

Some files were not shown because too many files have changed in this diff Show More