2231 lines
88 KiB
GLSL
2231 lines
88 KiB
GLSL
// Made with Amplify Shader Editor
|
|
// Available at the Unity Asset Store - http://u3d.as/y3X
|
|
Shader "DawnShaderURP/EyesShaderURP"
|
|
{
|
|
Properties
|
|
{
|
|
[HideInInspector] _EmissionColor("Emission Color", Color) = (1,1,1,1)
|
|
[HideInInspector] _VTInfoBlock( "VT( auto )", Vector ) = ( 0, 0, 0, 0 )
|
|
[HideInInspector] _AlphaCutoff("Alpha Cutoff ", Range(0, 1)) = 0.5
|
|
[ASEBegin]_IrisBrightnessPower1("Iris Brightness Power", Float) = 1
|
|
_Normal("Normal", 2D) = "bump" {}
|
|
_Mask("Mask", 2D) = "white" {}
|
|
_Roughness("Roughness", 2D) = "white" {}
|
|
_RoughnessBoost("Roughness Boost", Range( 0 , 4)) = 0.5
|
|
_BC("Base Color", 2D) = "white" {}
|
|
_BlendColor01("Blend Color 01", Color) = (1,1,1,0)
|
|
_BlendColorPower2("Blend Color Power 01", Range( 0 , 1)) = 0
|
|
_BlendColor02("Blend Color 02", Color) = (1,1,1,0)
|
|
_BlendColorPower3("Blend Color Power 02", Range( 0 , 1)) = 0
|
|
_BlendColor03("Blend Color 03", Color) = (1,1,1,0)
|
|
_BlendColorPower4("Blend Color Power 03", Range( 0 , 1)) = 0
|
|
_BlendColor04("Blend Color 04", Color) = (1,1,1,0)
|
|
_BlendColorPower5("Blend Color Power 04", Range( 0 , 1)) = 0
|
|
_EmissiveColor1("Emissive Color 1", Color) = (0,0,0,0)
|
|
_EmissivePower1("Emissive Power 1", Range( 0 , 5)) = 0
|
|
_EmissiveColor2("Emissive Color 2", Color) = (0,0,0,0)
|
|
_EmissivePower2("Emissive Power 2", Range( 0 , 5)) = 0
|
|
_EmissiveColor3("Emissive Color 3", Color) = (0,0,0,0)
|
|
_EmissivePower3("Emissive Power 3", Range( 0 , 5)) = 0
|
|
_EyePOMmask1("Eye POM mask", 2D) = "white" {}
|
|
_EmissiveColor4("Emissive Color 4", Color) = (0,0,0,0)
|
|
_EmissivePower4("Emissive Power 4", Range( 0 , 5)) = 0
|
|
_Scale1("Scale", Range( 0 , 0.5)) = 0.1
|
|
_CubeMap("CubeMap", CUBE) = "white" {}
|
|
_CurvatureU1("Curvature U", Range( 0 , 100)) = 0
|
|
_CurvatureV1("Curvature V", Range( 0 , 100)) = 0
|
|
[Header(Parallax Occlusion Mapping)]
|
|
[ASEEnd]_CurvFix("Curvature Bias", Range( 0 , 1)) = 1
|
|
|
|
//_TransmissionShadow( "Transmission Shadow", Range( 0, 1 ) ) = 0.5
|
|
//_TransStrength( "Trans Strength", Range( 0, 50 ) ) = 1
|
|
//_TransNormal( "Trans Normal Distortion", Range( 0, 1 ) ) = 0.5
|
|
//_TransScattering( "Trans Scattering", Range( 1, 50 ) ) = 2
|
|
//_TransDirect( "Trans Direct", Range( 0, 1 ) ) = 0.9
|
|
//_TransAmbient( "Trans Ambient", Range( 0, 1 ) ) = 0.1
|
|
//_TransShadow( "Trans Shadow", Range( 0, 1 ) ) = 0.5
|
|
//_TessPhongStrength( "Tess Phong Strength", Range( 0, 1 ) ) = 0.5
|
|
//_TessValue( "Tess Max Tessellation", Range( 1, 32 ) ) = 16
|
|
//_TessMin( "Tess Min Distance", Float ) = 10
|
|
//_TessMax( "Tess Max Distance", Float ) = 25
|
|
//_TessEdgeLength ( "Tess Edge length", Range( 2, 50 ) ) = 16
|
|
//_TessMaxDisp( "Tess Max Displacement", Float ) = 25
|
|
}
|
|
|
|
SubShader
|
|
{
|
|
LOD 0
|
|
|
|
|
|
|
|
Tags { "RenderPipeline"="UniversalPipeline" "RenderType"="Opaque" "Queue"="Geometry" }
|
|
Cull Back
|
|
AlphaToMask Off
|
|
HLSLINCLUDE
|
|
#pragma target 2.0
|
|
|
|
float4 FixedTess( float tessValue )
|
|
{
|
|
return tessValue;
|
|
}
|
|
|
|
float CalcDistanceTessFactor (float4 vertex, float minDist, float maxDist, float tess, float4x4 o2w, float3 cameraPos )
|
|
{
|
|
float3 wpos = mul(o2w,vertex).xyz;
|
|
float dist = distance (wpos, cameraPos);
|
|
float f = clamp(1.0 - (dist - minDist) / (maxDist - minDist), 0.01, 1.0) * tess;
|
|
return f;
|
|
}
|
|
|
|
float4 CalcTriEdgeTessFactors (float3 triVertexFactors)
|
|
{
|
|
float4 tess;
|
|
tess.x = 0.5 * (triVertexFactors.y + triVertexFactors.z);
|
|
tess.y = 0.5 * (triVertexFactors.x + triVertexFactors.z);
|
|
tess.z = 0.5 * (triVertexFactors.x + triVertexFactors.y);
|
|
tess.w = (triVertexFactors.x + triVertexFactors.y + triVertexFactors.z) / 3.0f;
|
|
return tess;
|
|
}
|
|
|
|
float CalcEdgeTessFactor (float3 wpos0, float3 wpos1, float edgeLen, float3 cameraPos, float4 scParams )
|
|
{
|
|
float dist = distance (0.5 * (wpos0+wpos1), cameraPos);
|
|
float len = distance(wpos0, wpos1);
|
|
float f = max(len * scParams.y / (edgeLen * dist), 1.0);
|
|
return f;
|
|
}
|
|
|
|
float DistanceFromPlane (float3 pos, float4 plane)
|
|
{
|
|
float d = dot (float4(pos,1.0f), plane);
|
|
return d;
|
|
}
|
|
|
|
bool WorldViewFrustumCull (float3 wpos0, float3 wpos1, float3 wpos2, float cullEps, float4 planes[6] )
|
|
{
|
|
float4 planeTest;
|
|
planeTest.x = (( DistanceFromPlane(wpos0, planes[0]) > -cullEps) ? 1.0f : 0.0f ) +
|
|
(( DistanceFromPlane(wpos1, planes[0]) > -cullEps) ? 1.0f : 0.0f ) +
|
|
(( DistanceFromPlane(wpos2, planes[0]) > -cullEps) ? 1.0f : 0.0f );
|
|
planeTest.y = (( DistanceFromPlane(wpos0, planes[1]) > -cullEps) ? 1.0f : 0.0f ) +
|
|
(( DistanceFromPlane(wpos1, planes[1]) > -cullEps) ? 1.0f : 0.0f ) +
|
|
(( DistanceFromPlane(wpos2, planes[1]) > -cullEps) ? 1.0f : 0.0f );
|
|
planeTest.z = (( DistanceFromPlane(wpos0, planes[2]) > -cullEps) ? 1.0f : 0.0f ) +
|
|
(( DistanceFromPlane(wpos1, planes[2]) > -cullEps) ? 1.0f : 0.0f ) +
|
|
(( DistanceFromPlane(wpos2, planes[2]) > -cullEps) ? 1.0f : 0.0f );
|
|
planeTest.w = (( DistanceFromPlane(wpos0, planes[3]) > -cullEps) ? 1.0f : 0.0f ) +
|
|
(( DistanceFromPlane(wpos1, planes[3]) > -cullEps) ? 1.0f : 0.0f ) +
|
|
(( DistanceFromPlane(wpos2, planes[3]) > -cullEps) ? 1.0f : 0.0f );
|
|
return !all (planeTest);
|
|
}
|
|
|
|
float4 DistanceBasedTess( float4 v0, float4 v1, float4 v2, float tess, float minDist, float maxDist, float4x4 o2w, float3 cameraPos )
|
|
{
|
|
float3 f;
|
|
f.x = CalcDistanceTessFactor (v0,minDist,maxDist,tess,o2w,cameraPos);
|
|
f.y = CalcDistanceTessFactor (v1,minDist,maxDist,tess,o2w,cameraPos);
|
|
f.z = CalcDistanceTessFactor (v2,minDist,maxDist,tess,o2w,cameraPos);
|
|
|
|
return CalcTriEdgeTessFactors (f);
|
|
}
|
|
|
|
float4 EdgeLengthBasedTess( float4 v0, float4 v1, float4 v2, float edgeLength, float4x4 o2w, float3 cameraPos, float4 scParams )
|
|
{
|
|
float3 pos0 = mul(o2w,v0).xyz;
|
|
float3 pos1 = mul(o2w,v1).xyz;
|
|
float3 pos2 = mul(o2w,v2).xyz;
|
|
float4 tess;
|
|
tess.x = CalcEdgeTessFactor (pos1, pos2, edgeLength, cameraPos, scParams);
|
|
tess.y = CalcEdgeTessFactor (pos2, pos0, edgeLength, cameraPos, scParams);
|
|
tess.z = CalcEdgeTessFactor (pos0, pos1, edgeLength, cameraPos, scParams);
|
|
tess.w = (tess.x + tess.y + tess.z) / 3.0f;
|
|
return tess;
|
|
}
|
|
|
|
float4 EdgeLengthBasedTessCull( float4 v0, float4 v1, float4 v2, float edgeLength, float maxDisplacement, float4x4 o2w, float3 cameraPos, float4 scParams, float4 planes[6] )
|
|
{
|
|
float3 pos0 = mul(o2w,v0).xyz;
|
|
float3 pos1 = mul(o2w,v1).xyz;
|
|
float3 pos2 = mul(o2w,v2).xyz;
|
|
float4 tess;
|
|
|
|
if (WorldViewFrustumCull(pos0, pos1, pos2, maxDisplacement, planes))
|
|
{
|
|
tess = 0.0f;
|
|
}
|
|
else
|
|
{
|
|
tess.x = CalcEdgeTessFactor (pos1, pos2, edgeLength, cameraPos, scParams);
|
|
tess.y = CalcEdgeTessFactor (pos2, pos0, edgeLength, cameraPos, scParams);
|
|
tess.z = CalcEdgeTessFactor (pos0, pos1, edgeLength, cameraPos, scParams);
|
|
tess.w = (tess.x + tess.y + tess.z) / 3.0f;
|
|
}
|
|
return tess;
|
|
}
|
|
ENDHLSL
|
|
|
|
|
|
Pass
|
|
{
|
|
|
|
Name "Forward"
|
|
Tags { "LightMode"="UniversalForward" }
|
|
|
|
Blend One Zero, One Zero
|
|
ZWrite On
|
|
ZTest LEqual
|
|
Offset 0 , 0
|
|
ColorMask RGBA
|
|
|
|
|
|
HLSLPROGRAM
|
|
#define _NORMAL_DROPOFF_TS 1
|
|
#pragma multi_compile_instancing
|
|
#pragma multi_compile _ LOD_FADE_CROSSFADE
|
|
#pragma multi_compile_fog
|
|
#define ASE_FOG 1
|
|
#define _EMISSION
|
|
#define _NORMALMAP 1
|
|
#define ASE_SRP_VERSION 70301
|
|
|
|
#pragma prefer_hlslcc gles
|
|
#pragma exclude_renderers d3d11_9x
|
|
|
|
#pragma multi_compile _ _MAIN_LIGHT_SHADOWS
|
|
#pragma multi_compile _ _MAIN_LIGHT_SHADOWS_CASCADE
|
|
#pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS
|
|
#pragma multi_compile _ _ADDITIONAL_LIGHT_SHADOWS
|
|
#pragma multi_compile _ _SHADOWS_SOFT
|
|
#pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE
|
|
|
|
#pragma multi_compile _ DIRLIGHTMAP_COMBINED
|
|
#pragma multi_compile _ LIGHTMAP_ON
|
|
|
|
#pragma vertex vert
|
|
#pragma fragment frag
|
|
|
|
#define SHADERPASS_FORWARD
|
|
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/UnityInstancing.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
|
|
|
|
#if ASE_SRP_VERSION <= 70108
|
|
#define REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR
|
|
#endif
|
|
|
|
#if defined(UNITY_INSTANCING_ENABLED) && defined(_TERRAIN_INSTANCED_PERPIXEL_NORMAL)
|
|
#define ENABLE_TERRAIN_PERPIXEL_NORMAL
|
|
#endif
|
|
|
|
#define ASE_NEEDS_FRAG_WORLD_TANGENT
|
|
#define ASE_NEEDS_FRAG_WORLD_NORMAL
|
|
#define ASE_NEEDS_FRAG_WORLD_BITANGENT
|
|
#define ASE_NEEDS_FRAG_WORLD_VIEW_DIR
|
|
|
|
|
|
struct VertexInput
|
|
{
|
|
float4 vertex : POSITION;
|
|
float3 ase_normal : NORMAL;
|
|
float4 ase_tangent : TANGENT;
|
|
float4 texcoord1 : TEXCOORD1;
|
|
float4 texcoord : TEXCOORD0;
|
|
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
};
|
|
|
|
struct VertexOutput
|
|
{
|
|
float4 clipPos : SV_POSITION;
|
|
float4 lightmapUVOrVertexSH : TEXCOORD0;
|
|
half4 fogFactorAndVertexLight : TEXCOORD1;
|
|
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
|
|
float4 shadowCoord : TEXCOORD2;
|
|
#endif
|
|
float4 tSpace0 : TEXCOORD3;
|
|
float4 tSpace1 : TEXCOORD4;
|
|
float4 tSpace2 : TEXCOORD5;
|
|
#if defined(ASE_NEEDS_FRAG_SCREEN_POSITION)
|
|
float4 screenPos : TEXCOORD6;
|
|
#endif
|
|
float4 ase_texcoord7 : TEXCOORD7;
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
UNITY_VERTEX_OUTPUT_STEREO
|
|
};
|
|
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float4 _EmissiveColor3;
|
|
float4 _EyePOMmask1_ST;
|
|
float4 _EmissiveColor4;
|
|
float4 _BlendColor01;
|
|
float4 _BlendColor02;
|
|
float4 _BlendColor03;
|
|
float4 _BlendColor04;
|
|
float4 _EmissiveColor2;
|
|
float4 _EmissiveColor1;
|
|
float _Scale1;
|
|
float _EmissivePower4;
|
|
float _EmissivePower2;
|
|
float _EmissivePower1;
|
|
float _BlendColorPower3;
|
|
float _BlendColorPower4;
|
|
float _EmissivePower3;
|
|
float _BlendColorPower2;
|
|
float _IrisBrightnessPower1;
|
|
float _CurvatureV1;
|
|
float _CurvatureU1;
|
|
float _BlendColorPower5;
|
|
float _RoughnessBoost;
|
|
#ifdef _TRANSMISSION_ASE
|
|
float _TransmissionShadow;
|
|
#endif
|
|
#ifdef _TRANSLUCENCY_ASE
|
|
float _TransStrength;
|
|
float _TransNormal;
|
|
float _TransScattering;
|
|
float _TransDirect;
|
|
float _TransAmbient;
|
|
float _TransShadow;
|
|
#endif
|
|
#ifdef TESSELLATION_ON
|
|
float _TessPhongStrength;
|
|
float _TessValue;
|
|
float _TessMin;
|
|
float _TessMax;
|
|
float _TessEdgeLength;
|
|
float _TessMaxDisp;
|
|
#endif
|
|
CBUFFER_END
|
|
sampler2D _BC;
|
|
sampler2D _EyePOMmask1;
|
|
uniform float _CurvFix;
|
|
sampler2D _Mask;
|
|
SAMPLER(sampler_Mask);
|
|
sampler2D _Normal;
|
|
samplerCUBE _CubeMap;
|
|
sampler2D _Roughness;
|
|
|
|
|
|
inline float2 POM( sampler2D heightMap, float2 uvs, float2 dx, float2 dy, float3 normalWorld, float3 viewWorld, float3 viewDirTan, int minSamples, int maxSamples, float parallax, float refPlane, float2 tilling, float2 curv, int index )
|
|
{
|
|
float3 result = 0;
|
|
int stepIndex = 0;
|
|
int numSteps = ( int )lerp( (float)maxSamples, (float)minSamples, saturate( dot( normalWorld, viewWorld ) ) );
|
|
float layerHeight = 1.0 / numSteps;
|
|
float2 plane = parallax * ( viewDirTan.xy / viewDirTan.z );
|
|
uvs.xy += refPlane * plane;
|
|
float2 deltaTex = -plane * layerHeight;
|
|
float2 prevTexOffset = 0;
|
|
float prevRayZ = 1.0f;
|
|
float prevHeight = 0.0f;
|
|
float2 currTexOffset = deltaTex;
|
|
float currRayZ = 1.0f - layerHeight;
|
|
float currHeight = 0.0f;
|
|
float intersection = 0;
|
|
float2 finalTexOffset = 0;
|
|
while ( stepIndex < numSteps + 1 )
|
|
{
|
|
result.z = dot( curv, currTexOffset * currTexOffset );
|
|
currHeight = tex2Dgrad( heightMap, uvs + currTexOffset, dx, dy ).r * ( 1 - result.z );
|
|
if ( currHeight > currRayZ )
|
|
{
|
|
stepIndex = numSteps + 1;
|
|
}
|
|
else
|
|
{
|
|
stepIndex++;
|
|
prevTexOffset = currTexOffset;
|
|
prevRayZ = currRayZ;
|
|
prevHeight = currHeight;
|
|
currTexOffset += deltaTex;
|
|
currRayZ -= layerHeight * ( 1 - result.z ) * (1+_CurvFix);
|
|
}
|
|
}
|
|
int sectionSteps = 2;
|
|
int sectionIndex = 0;
|
|
float newZ = 0;
|
|
float newHeight = 0;
|
|
while ( sectionIndex < sectionSteps )
|
|
{
|
|
intersection = ( prevHeight - prevRayZ ) / ( prevHeight - currHeight + currRayZ - prevRayZ );
|
|
finalTexOffset = prevTexOffset + intersection * deltaTex;
|
|
newZ = prevRayZ - intersection * layerHeight;
|
|
newHeight = tex2Dgrad( heightMap, uvs + finalTexOffset, dx, dy ).r;
|
|
if ( newHeight > newZ )
|
|
{
|
|
currTexOffset = finalTexOffset;
|
|
currHeight = newHeight;
|
|
currRayZ = newZ;
|
|
deltaTex = intersection * deltaTex;
|
|
layerHeight = intersection * layerHeight;
|
|
}
|
|
else
|
|
{
|
|
prevTexOffset = finalTexOffset;
|
|
prevHeight = newHeight;
|
|
prevRayZ = newZ;
|
|
deltaTex = ( 1 - intersection ) * deltaTex;
|
|
layerHeight = ( 1 - intersection ) * layerHeight;
|
|
}
|
|
sectionIndex++;
|
|
}
|
|
#ifdef UNITY_PASS_SHADOWCASTER
|
|
if ( unity_LightShadowBias.z == 0.0 )
|
|
{
|
|
#endif
|
|
if ( result.z > 1 )
|
|
clip( -1 );
|
|
#ifdef UNITY_PASS_SHADOWCASTER
|
|
}
|
|
#endif
|
|
return uvs.xy + finalTexOffset;
|
|
}
|
|
|
|
|
|
VertexOutput VertexFunction( VertexInput v )
|
|
{
|
|
VertexOutput o = (VertexOutput)0;
|
|
UNITY_SETUP_INSTANCE_ID(v);
|
|
UNITY_TRANSFER_INSTANCE_ID(v, o);
|
|
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
|
|
|
|
o.ase_texcoord7.xyz = v.texcoord.xyz;
|
|
|
|
//setting value to unused interpolator channels and avoid initialization warnings
|
|
o.ase_texcoord7.w = 0;
|
|
#ifdef ASE_ABSOLUTE_VERTEX_POS
|
|
float3 defaultVertexValue = v.vertex.xyz;
|
|
#else
|
|
float3 defaultVertexValue = float3(0, 0, 0);
|
|
#endif
|
|
float3 vertexValue = defaultVertexValue;
|
|
#ifdef ASE_ABSOLUTE_VERTEX_POS
|
|
v.vertex.xyz = vertexValue;
|
|
#else
|
|
v.vertex.xyz += vertexValue;
|
|
#endif
|
|
v.ase_normal = v.ase_normal;
|
|
|
|
float3 positionWS = TransformObjectToWorld( v.vertex.xyz );
|
|
float3 positionVS = TransformWorldToView( positionWS );
|
|
float4 positionCS = TransformWorldToHClip( positionWS );
|
|
|
|
VertexNormalInputs normalInput = GetVertexNormalInputs( v.ase_normal, v.ase_tangent );
|
|
|
|
o.tSpace0 = float4( normalInput.normalWS, positionWS.x);
|
|
o.tSpace1 = float4( normalInput.tangentWS, positionWS.y);
|
|
o.tSpace2 = float4( normalInput.bitangentWS, positionWS.z);
|
|
|
|
OUTPUT_LIGHTMAP_UV( v.texcoord1, unity_LightmapST, o.lightmapUVOrVertexSH.xy );
|
|
OUTPUT_SH( normalInput.normalWS.xyz, o.lightmapUVOrVertexSH.xyz );
|
|
|
|
#if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL)
|
|
o.lightmapUVOrVertexSH.zw = v.texcoord;
|
|
o.lightmapUVOrVertexSH.xy = v.texcoord * unity_LightmapST.xy + unity_LightmapST.zw;
|
|
#endif
|
|
|
|
half3 vertexLight = VertexLighting( positionWS, normalInput.normalWS );
|
|
#ifdef ASE_FOG
|
|
half fogFactor = ComputeFogFactor( positionCS.z );
|
|
#else
|
|
half fogFactor = 0;
|
|
#endif
|
|
o.fogFactorAndVertexLight = half4(fogFactor, vertexLight);
|
|
|
|
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
|
|
VertexPositionInputs vertexInput = (VertexPositionInputs)0;
|
|
vertexInput.positionWS = positionWS;
|
|
vertexInput.positionCS = positionCS;
|
|
o.shadowCoord = GetShadowCoord( vertexInput );
|
|
#endif
|
|
|
|
o.clipPos = positionCS;
|
|
#if defined(ASE_NEEDS_FRAG_SCREEN_POSITION)
|
|
o.screenPos = ComputeScreenPos(positionCS);
|
|
#endif
|
|
return o;
|
|
}
|
|
|
|
#if defined(TESSELLATION_ON)
|
|
struct VertexControl
|
|
{
|
|
float4 vertex : INTERNALTESSPOS;
|
|
float3 ase_normal : NORMAL;
|
|
float4 ase_tangent : TANGENT;
|
|
float4 texcoord1 : TEXCOORD1;
|
|
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
};
|
|
|
|
struct TessellationFactors
|
|
{
|
|
float edge[3] : SV_TessFactor;
|
|
float inside : SV_InsideTessFactor;
|
|
};
|
|
|
|
VertexControl vert ( VertexInput v )
|
|
{
|
|
VertexControl o;
|
|
UNITY_SETUP_INSTANCE_ID(v);
|
|
UNITY_TRANSFER_INSTANCE_ID(v, o);
|
|
o.vertex = v.vertex;
|
|
o.ase_normal = v.ase_normal;
|
|
o.ase_tangent = v.ase_tangent;
|
|
o.texcoord1 = v.texcoord1;
|
|
|
|
return o;
|
|
}
|
|
|
|
TessellationFactors TessellationFunction (InputPatch<VertexControl,3> v)
|
|
{
|
|
TessellationFactors o;
|
|
float4 tf = 1;
|
|
float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax;
|
|
float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp;
|
|
#if defined(ASE_FIXED_TESSELLATION)
|
|
tf = FixedTess( tessValue );
|
|
#elif defined(ASE_DISTANCE_TESSELLATION)
|
|
tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
|
|
#elif defined(ASE_LENGTH_TESSELLATION)
|
|
tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
|
|
#elif defined(ASE_LENGTH_CULL_TESSELLATION)
|
|
tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
|
|
#endif
|
|
o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w;
|
|
return o;
|
|
}
|
|
|
|
[domain("tri")]
|
|
[partitioning("fractional_odd")]
|
|
[outputtopology("triangle_cw")]
|
|
[patchconstantfunc("TessellationFunction")]
|
|
[outputcontrolpoints(3)]
|
|
VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
|
|
{
|
|
return patch[id];
|
|
}
|
|
|
|
[domain("tri")]
|
|
VertexOutput DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
|
|
{
|
|
VertexInput o = (VertexInput) 0;
|
|
o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z;
|
|
o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z;
|
|
o.ase_tangent = patch[0].ase_tangent * bary.x + patch[1].ase_tangent * bary.y + patch[2].ase_tangent * bary.z;
|
|
o.texcoord1 = patch[0].texcoord1 * bary.x + patch[1].texcoord1 * bary.y + patch[2].texcoord1 * bary.z;
|
|
|
|
#if defined(ASE_PHONG_TESSELLATION)
|
|
float3 pp[3];
|
|
for (int i = 0; i < 3; ++i)
|
|
pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal));
|
|
float phongStrength = _TessPhongStrength;
|
|
o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz;
|
|
#endif
|
|
UNITY_TRANSFER_INSTANCE_ID(patch[0], o);
|
|
return VertexFunction(o);
|
|
}
|
|
#else
|
|
VertexOutput vert ( VertexInput v )
|
|
{
|
|
return VertexFunction( v );
|
|
}
|
|
#endif
|
|
|
|
half4 frag ( VertexOutput IN ) : SV_Target
|
|
{
|
|
UNITY_SETUP_INSTANCE_ID(IN);
|
|
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(IN);
|
|
|
|
#ifdef LOD_FADE_CROSSFADE
|
|
LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x );
|
|
#endif
|
|
|
|
#if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL)
|
|
float2 sampleCoords = (IN.lightmapUVOrVertexSH.zw / _TerrainHeightmapRecipSize.zw + 0.5f) * _TerrainHeightmapRecipSize.xy;
|
|
float3 WorldNormal = TransformObjectToWorldNormal(normalize(SAMPLE_TEXTURE2D(_TerrainNormalmapTexture, sampler_TerrainNormalmapTexture, sampleCoords).rgb * 2 - 1));
|
|
float3 WorldTangent = -cross(GetObjectToWorldMatrix()._13_23_33, WorldNormal);
|
|
float3 WorldBiTangent = cross(WorldNormal, -WorldTangent);
|
|
#else
|
|
float3 WorldNormal = normalize( IN.tSpace0.xyz );
|
|
float3 WorldTangent = IN.tSpace1.xyz;
|
|
float3 WorldBiTangent = IN.tSpace2.xyz;
|
|
#endif
|
|
float3 WorldPosition = float3(IN.tSpace0.w,IN.tSpace1.w,IN.tSpace2.w);
|
|
float3 WorldViewDirection = _WorldSpaceCameraPos.xyz - WorldPosition;
|
|
float4 ShadowCoords = float4( 0, 0, 0, 0 );
|
|
#if defined(ASE_NEEDS_FRAG_SCREEN_POSITION)
|
|
float4 ScreenPos = IN.screenPos;
|
|
#endif
|
|
|
|
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
|
|
ShadowCoords = IN.shadowCoord;
|
|
#elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
|
|
ShadowCoords = TransformWorldToShadowCoord( WorldPosition );
|
|
#endif
|
|
|
|
WorldViewDirection = SafeNormalize( WorldViewDirection );
|
|
|
|
float2 texCoord179 = IN.ase_texcoord7.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float3 tanToWorld0 = float3( WorldTangent.x, WorldBiTangent.x, WorldNormal.x );
|
|
float3 tanToWorld1 = float3( WorldTangent.y, WorldBiTangent.y, WorldNormal.y );
|
|
float3 tanToWorld2 = float3( WorldTangent.z, WorldBiTangent.z, WorldNormal.z );
|
|
float3 ase_tanViewDir = tanToWorld0 * WorldViewDirection.x + tanToWorld1 * WorldViewDirection.y + tanToWorld2 * WorldViewDirection.z;
|
|
ase_tanViewDir = normalize(ase_tanViewDir);
|
|
float2 appendResult176 = (float2(_CurvatureU1 , _CurvatureV1));
|
|
float2 OffsetPOM180 = POM( _EyePOMmask1, texCoord179, ddx(texCoord179), ddy(texCoord179), WorldNormal, WorldViewDirection, ase_tanViewDir, 8, 8, _Scale1, 0, _EyePOMmask1_ST.xy, appendResult176, 0 );
|
|
float2 myVarName182 = OffsetPOM180;
|
|
float2 temp_output_181_0 = ddx( texCoord179 );
|
|
float2 temp_output_183_0 = ddy( texCoord179 );
|
|
float4 tex2DNode1 = tex2D( _BC, myVarName182, temp_output_181_0, temp_output_183_0 );
|
|
float4 tex2DNode2 = tex2D( _Mask, myVarName182, temp_output_181_0, temp_output_183_0 );
|
|
float4 lerpResult186 = lerp( tex2DNode1 , ( tex2DNode1 * _IrisBrightnessPower1 ) , tex2DNode2.r);
|
|
float4 lerpResult28 = lerp( float4( 0,0,0,0 ) , _BlendColor01 , tex2DNode2.r);
|
|
float4 lerpResult29 = lerp( float4( 0,0,0,0 ) , _BlendColor02 , tex2DNode2.g);
|
|
float4 lerpResult30 = lerp( float4( 0,0,0,0 ) , _BlendColor03 , tex2DNode2.b);
|
|
float4 lerpResult31 = lerp( float4( 0,0,0,0 ) , _BlendColor04 , tex2DNode2.a);
|
|
float4 lerpResult132 = lerp( lerpResult186 , ( lerpResult28 + lerpResult29 + lerpResult30 + lerpResult31 ) , ( ( _BlendColorPower2 * tex2DNode2.r ) + ( _BlendColorPower3 * tex2DNode2.g ) + ( _BlendColorPower4 * tex2DNode2.b ) + ( _BlendColorPower5 * tex2DNode2.a ) ));
|
|
|
|
float3 tex2DNode75 = UnpackNormalScale( tex2D( _Normal, myVarName182, float2( 0,0 ), float2( 0,0 ) ), 1.0f );
|
|
|
|
float3 worldRefl156 = reflect( -WorldViewDirection, float3( dot( tanToWorld0, tex2DNode75 ), dot( tanToWorld1, tex2DNode75 ), dot( tanToWorld2, tex2DNode75 ) ) );
|
|
|
|
float3 Albedo = lerpResult132.rgb;
|
|
float3 Normal = tex2DNode75;
|
|
float3 Emission = ( ( ( ( tex2DNode2.r * _EmissiveColor1 ) * _EmissivePower1 ) + ( ( tex2DNode2.g * _EmissiveColor2 ) * _EmissivePower2 ) ) + ( ( ( tex2DNode2.a * _EmissiveColor4 ) * _EmissivePower4 ) + ( ( tex2DNode2.b * _EmissiveColor3 ) * _EmissivePower3 ) ) ).rgb;
|
|
float3 Specular = 0.5;
|
|
float Metallic = texCUBE( _CubeMap, worldRefl156, float3( temp_output_181_0 , 0.0 ), float3( temp_output_183_0 , 0.0 ) ).r;
|
|
float Smoothness = ( _RoughnessBoost * tex2D( _Roughness, myVarName182, temp_output_181_0, temp_output_183_0 ) ).r;
|
|
float Occlusion = 1;
|
|
float Alpha = 1;
|
|
float AlphaClipThreshold = 0.5;
|
|
float AlphaClipThresholdShadow = 0.5;
|
|
float3 BakedGI = 0;
|
|
float3 RefractionColor = 1;
|
|
float RefractionIndex = 1;
|
|
float3 Transmission = 1;
|
|
float3 Translucency = 1;
|
|
|
|
#ifdef _ALPHATEST_ON
|
|
clip(Alpha - AlphaClipThreshold);
|
|
#endif
|
|
|
|
InputData inputData;
|
|
inputData.positionWS = WorldPosition;
|
|
inputData.viewDirectionWS = WorldViewDirection;
|
|
inputData.shadowCoord = ShadowCoords;
|
|
|
|
#ifdef _NORMALMAP
|
|
#if _NORMAL_DROPOFF_TS
|
|
inputData.normalWS = TransformTangentToWorld(Normal, half3x3( WorldTangent, WorldBiTangent, WorldNormal ));
|
|
#elif _NORMAL_DROPOFF_OS
|
|
inputData.normalWS = TransformObjectToWorldNormal(Normal);
|
|
#elif _NORMAL_DROPOFF_WS
|
|
inputData.normalWS = Normal;
|
|
#endif
|
|
inputData.normalWS = NormalizeNormalPerPixel(inputData.normalWS);
|
|
#else
|
|
inputData.normalWS = WorldNormal;
|
|
#endif
|
|
|
|
#ifdef ASE_FOG
|
|
inputData.fogCoord = IN.fogFactorAndVertexLight.x;
|
|
#endif
|
|
|
|
inputData.vertexLighting = IN.fogFactorAndVertexLight.yzw;
|
|
#if defined(ENABLE_TERRAIN_PERPIXEL_NORMAL)
|
|
float3 SH = SampleSH(inputData.normalWS.xyz);
|
|
#else
|
|
float3 SH = IN.lightmapUVOrVertexSH.xyz;
|
|
#endif
|
|
|
|
inputData.bakedGI = SAMPLE_GI( IN.lightmapUVOrVertexSH.xy, SH, inputData.normalWS );
|
|
#ifdef _ASE_BAKEDGI
|
|
inputData.bakedGI = BakedGI;
|
|
#endif
|
|
half4 color = UniversalFragmentPBR(
|
|
inputData,
|
|
Albedo,
|
|
Metallic,
|
|
Specular,
|
|
Smoothness,
|
|
Occlusion,
|
|
Emission,
|
|
Alpha);
|
|
|
|
#ifdef _TRANSMISSION_ASE
|
|
{
|
|
float shadow = _TransmissionShadow;
|
|
|
|
Light mainLight = GetMainLight( inputData.shadowCoord );
|
|
float3 mainAtten = mainLight.color * mainLight.distanceAttenuation;
|
|
mainAtten = lerp( mainAtten, mainAtten * mainLight.shadowAttenuation, shadow );
|
|
half3 mainTransmission = max(0 , -dot(inputData.normalWS, mainLight.direction)) * mainAtten * Transmission;
|
|
color.rgb += Albedo * mainTransmission;
|
|
|
|
#ifdef _ADDITIONAL_LIGHTS
|
|
int transPixelLightCount = GetAdditionalLightsCount();
|
|
for (int i = 0; i < transPixelLightCount; ++i)
|
|
{
|
|
Light light = GetAdditionalLight(i, inputData.positionWS);
|
|
float3 atten = light.color * light.distanceAttenuation;
|
|
atten = lerp( atten, atten * light.shadowAttenuation, shadow );
|
|
|
|
half3 transmission = max(0 , -dot(inputData.normalWS, light.direction)) * atten * Transmission;
|
|
color.rgb += Albedo * transmission;
|
|
}
|
|
#endif
|
|
}
|
|
#endif
|
|
|
|
#ifdef _TRANSLUCENCY_ASE
|
|
{
|
|
float shadow = _TransShadow;
|
|
float normal = _TransNormal;
|
|
float scattering = _TransScattering;
|
|
float direct = _TransDirect;
|
|
float ambient = _TransAmbient;
|
|
float strength = _TransStrength;
|
|
|
|
Light mainLight = GetMainLight( inputData.shadowCoord );
|
|
float3 mainAtten = mainLight.color * mainLight.distanceAttenuation;
|
|
mainAtten = lerp( mainAtten, mainAtten * mainLight.shadowAttenuation, shadow );
|
|
|
|
half3 mainLightDir = mainLight.direction + inputData.normalWS * normal;
|
|
half mainVdotL = pow( saturate( dot( inputData.viewDirectionWS, -mainLightDir ) ), scattering );
|
|
half3 mainTranslucency = mainAtten * ( mainVdotL * direct + inputData.bakedGI * ambient ) * Translucency;
|
|
color.rgb += Albedo * mainTranslucency * strength;
|
|
|
|
#ifdef _ADDITIONAL_LIGHTS
|
|
int transPixelLightCount = GetAdditionalLightsCount();
|
|
for (int i = 0; i < transPixelLightCount; ++i)
|
|
{
|
|
Light light = GetAdditionalLight(i, inputData.positionWS);
|
|
float3 atten = light.color * light.distanceAttenuation;
|
|
atten = lerp( atten, atten * light.shadowAttenuation, shadow );
|
|
|
|
half3 lightDir = light.direction + inputData.normalWS * normal;
|
|
half VdotL = pow( saturate( dot( inputData.viewDirectionWS, -lightDir ) ), scattering );
|
|
half3 translucency = atten * ( VdotL * direct + inputData.bakedGI * ambient ) * Translucency;
|
|
color.rgb += Albedo * translucency * strength;
|
|
}
|
|
#endif
|
|
}
|
|
#endif
|
|
|
|
#ifdef _REFRACTION_ASE
|
|
float4 projScreenPos = ScreenPos / ScreenPos.w;
|
|
float3 refractionOffset = ( RefractionIndex - 1.0 ) * mul( UNITY_MATRIX_V, WorldNormal ).xyz * ( 1.0 - dot( WorldNormal, WorldViewDirection ) );
|
|
projScreenPos.xy += refractionOffset.xy;
|
|
float3 refraction = SHADERGRAPH_SAMPLE_SCENE_COLOR( projScreenPos ) * RefractionColor;
|
|
color.rgb = lerp( refraction, color.rgb, color.a );
|
|
color.a = 1;
|
|
#endif
|
|
|
|
#ifdef ASE_FINAL_COLOR_ALPHA_MULTIPLY
|
|
color.rgb *= color.a;
|
|
#endif
|
|
|
|
#ifdef ASE_FOG
|
|
#ifdef TERRAIN_SPLAT_ADDPASS
|
|
color.rgb = MixFogColor(color.rgb, half3( 0, 0, 0 ), IN.fogFactorAndVertexLight.x );
|
|
#else
|
|
color.rgb = MixFog(color.rgb, IN.fogFactorAndVertexLight.x);
|
|
#endif
|
|
#endif
|
|
|
|
return color;
|
|
}
|
|
|
|
ENDHLSL
|
|
}
|
|
|
|
|
|
Pass
|
|
{
|
|
|
|
Name "ShadowCaster"
|
|
Tags { "LightMode"="ShadowCaster" }
|
|
|
|
ZWrite On
|
|
ZTest LEqual
|
|
AlphaToMask Off
|
|
|
|
HLSLPROGRAM
|
|
#define _NORMAL_DROPOFF_TS 1
|
|
#pragma multi_compile_instancing
|
|
#pragma multi_compile _ LOD_FADE_CROSSFADE
|
|
#pragma multi_compile_fog
|
|
#define ASE_FOG 1
|
|
#define _EMISSION
|
|
#define _NORMALMAP 1
|
|
#define ASE_SRP_VERSION 70301
|
|
|
|
#pragma prefer_hlslcc gles
|
|
#pragma exclude_renderers d3d11_9x
|
|
|
|
#pragma vertex vert
|
|
#pragma fragment frag
|
|
|
|
#define SHADERPASS_SHADOWCASTER
|
|
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
|
|
|
|
|
|
|
|
struct VertexInput
|
|
{
|
|
float4 vertex : POSITION;
|
|
float3 ase_normal : NORMAL;
|
|
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
};
|
|
|
|
struct VertexOutput
|
|
{
|
|
float4 clipPos : SV_POSITION;
|
|
#if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
|
|
float3 worldPos : TEXCOORD0;
|
|
#endif
|
|
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
|
|
float4 shadowCoord : TEXCOORD1;
|
|
#endif
|
|
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
UNITY_VERTEX_OUTPUT_STEREO
|
|
};
|
|
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float4 _EmissiveColor3;
|
|
float4 _EyePOMmask1_ST;
|
|
float4 _EmissiveColor4;
|
|
float4 _BlendColor01;
|
|
float4 _BlendColor02;
|
|
float4 _BlendColor03;
|
|
float4 _BlendColor04;
|
|
float4 _EmissiveColor2;
|
|
float4 _EmissiveColor1;
|
|
float _Scale1;
|
|
float _EmissivePower4;
|
|
float _EmissivePower2;
|
|
float _EmissivePower1;
|
|
float _BlendColorPower3;
|
|
float _BlendColorPower4;
|
|
float _EmissivePower3;
|
|
float _BlendColorPower2;
|
|
float _IrisBrightnessPower1;
|
|
float _CurvatureV1;
|
|
float _CurvatureU1;
|
|
float _BlendColorPower5;
|
|
float _RoughnessBoost;
|
|
#ifdef _TRANSMISSION_ASE
|
|
float _TransmissionShadow;
|
|
#endif
|
|
#ifdef _TRANSLUCENCY_ASE
|
|
float _TransStrength;
|
|
float _TransNormal;
|
|
float _TransScattering;
|
|
float _TransDirect;
|
|
float _TransAmbient;
|
|
float _TransShadow;
|
|
#endif
|
|
#ifdef TESSELLATION_ON
|
|
float _TessPhongStrength;
|
|
float _TessValue;
|
|
float _TessMin;
|
|
float _TessMax;
|
|
float _TessEdgeLength;
|
|
float _TessMaxDisp;
|
|
#endif
|
|
CBUFFER_END
|
|
|
|
|
|
|
|
float3 _LightDirection;
|
|
|
|
VertexOutput VertexFunction( VertexInput v )
|
|
{
|
|
VertexOutput o;
|
|
UNITY_SETUP_INSTANCE_ID(v);
|
|
UNITY_TRANSFER_INSTANCE_ID(v, o);
|
|
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO( o );
|
|
|
|
|
|
#ifdef ASE_ABSOLUTE_VERTEX_POS
|
|
float3 defaultVertexValue = v.vertex.xyz;
|
|
#else
|
|
float3 defaultVertexValue = float3(0, 0, 0);
|
|
#endif
|
|
float3 vertexValue = defaultVertexValue;
|
|
#ifdef ASE_ABSOLUTE_VERTEX_POS
|
|
v.vertex.xyz = vertexValue;
|
|
#else
|
|
v.vertex.xyz += vertexValue;
|
|
#endif
|
|
|
|
v.ase_normal = v.ase_normal;
|
|
|
|
float3 positionWS = TransformObjectToWorld( v.vertex.xyz );
|
|
#if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
|
|
o.worldPos = positionWS;
|
|
#endif
|
|
float3 normalWS = TransformObjectToWorldDir(v.ase_normal);
|
|
|
|
float4 clipPos = TransformWorldToHClip( ApplyShadowBias( positionWS, normalWS, _LightDirection ) );
|
|
|
|
#if UNITY_REVERSED_Z
|
|
clipPos.z = min(clipPos.z, clipPos.w * UNITY_NEAR_CLIP_VALUE);
|
|
#else
|
|
clipPos.z = max(clipPos.z, clipPos.w * UNITY_NEAR_CLIP_VALUE);
|
|
#endif
|
|
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
|
|
VertexPositionInputs vertexInput = (VertexPositionInputs)0;
|
|
vertexInput.positionWS = positionWS;
|
|
vertexInput.positionCS = clipPos;
|
|
o.shadowCoord = GetShadowCoord( vertexInput );
|
|
#endif
|
|
o.clipPos = clipPos;
|
|
return o;
|
|
}
|
|
|
|
#if defined(TESSELLATION_ON)
|
|
struct VertexControl
|
|
{
|
|
float4 vertex : INTERNALTESSPOS;
|
|
float3 ase_normal : NORMAL;
|
|
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
};
|
|
|
|
struct TessellationFactors
|
|
{
|
|
float edge[3] : SV_TessFactor;
|
|
float inside : SV_InsideTessFactor;
|
|
};
|
|
|
|
VertexControl vert ( VertexInput v )
|
|
{
|
|
VertexControl o;
|
|
UNITY_SETUP_INSTANCE_ID(v);
|
|
UNITY_TRANSFER_INSTANCE_ID(v, o);
|
|
o.vertex = v.vertex;
|
|
o.ase_normal = v.ase_normal;
|
|
|
|
return o;
|
|
}
|
|
|
|
TessellationFactors TessellationFunction (InputPatch<VertexControl,3> v)
|
|
{
|
|
TessellationFactors o;
|
|
float4 tf = 1;
|
|
float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax;
|
|
float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp;
|
|
#if defined(ASE_FIXED_TESSELLATION)
|
|
tf = FixedTess( tessValue );
|
|
#elif defined(ASE_DISTANCE_TESSELLATION)
|
|
tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
|
|
#elif defined(ASE_LENGTH_TESSELLATION)
|
|
tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
|
|
#elif defined(ASE_LENGTH_CULL_TESSELLATION)
|
|
tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
|
|
#endif
|
|
o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w;
|
|
return o;
|
|
}
|
|
|
|
[domain("tri")]
|
|
[partitioning("fractional_odd")]
|
|
[outputtopology("triangle_cw")]
|
|
[patchconstantfunc("TessellationFunction")]
|
|
[outputcontrolpoints(3)]
|
|
VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
|
|
{
|
|
return patch[id];
|
|
}
|
|
|
|
[domain("tri")]
|
|
VertexOutput DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
|
|
{
|
|
VertexInput o = (VertexInput) 0;
|
|
o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z;
|
|
o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z;
|
|
|
|
#if defined(ASE_PHONG_TESSELLATION)
|
|
float3 pp[3];
|
|
for (int i = 0; i < 3; ++i)
|
|
pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal));
|
|
float phongStrength = _TessPhongStrength;
|
|
o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz;
|
|
#endif
|
|
UNITY_TRANSFER_INSTANCE_ID(patch[0], o);
|
|
return VertexFunction(o);
|
|
}
|
|
#else
|
|
VertexOutput vert ( VertexInput v )
|
|
{
|
|
return VertexFunction( v );
|
|
}
|
|
#endif
|
|
|
|
half4 frag(VertexOutput IN ) : SV_TARGET
|
|
{
|
|
UNITY_SETUP_INSTANCE_ID( IN );
|
|
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN );
|
|
|
|
#if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
|
|
float3 WorldPosition = IN.worldPos;
|
|
#endif
|
|
float4 ShadowCoords = float4( 0, 0, 0, 0 );
|
|
|
|
#if defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
|
|
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
|
|
ShadowCoords = IN.shadowCoord;
|
|
#elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
|
|
ShadowCoords = TransformWorldToShadowCoord( WorldPosition );
|
|
#endif
|
|
#endif
|
|
|
|
|
|
float Alpha = 1;
|
|
float AlphaClipThreshold = 0.5;
|
|
float AlphaClipThresholdShadow = 0.5;
|
|
|
|
#ifdef _ALPHATEST_ON
|
|
#ifdef _ALPHATEST_SHADOW_ON
|
|
clip(Alpha - AlphaClipThresholdShadow);
|
|
#else
|
|
clip(Alpha - AlphaClipThreshold);
|
|
#endif
|
|
#endif
|
|
|
|
#ifdef LOD_FADE_CROSSFADE
|
|
LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x );
|
|
#endif
|
|
return 0;
|
|
}
|
|
|
|
ENDHLSL
|
|
}
|
|
|
|
|
|
Pass
|
|
{
|
|
|
|
Name "DepthOnly"
|
|
Tags { "LightMode"="DepthOnly" }
|
|
|
|
ZWrite On
|
|
ColorMask 0
|
|
AlphaToMask Off
|
|
|
|
HLSLPROGRAM
|
|
#define _NORMAL_DROPOFF_TS 1
|
|
#pragma multi_compile_instancing
|
|
#pragma multi_compile _ LOD_FADE_CROSSFADE
|
|
#pragma multi_compile_fog
|
|
#define ASE_FOG 1
|
|
#define _EMISSION
|
|
#define _NORMALMAP 1
|
|
#define ASE_SRP_VERSION 70301
|
|
|
|
#pragma prefer_hlslcc gles
|
|
#pragma exclude_renderers d3d11_9x
|
|
|
|
#pragma vertex vert
|
|
#pragma fragment frag
|
|
|
|
#define SHADERPASS_DEPTHONLY
|
|
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
|
|
|
|
|
|
|
|
struct VertexInput
|
|
{
|
|
float4 vertex : POSITION;
|
|
float3 ase_normal : NORMAL;
|
|
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
};
|
|
|
|
struct VertexOutput
|
|
{
|
|
float4 clipPos : SV_POSITION;
|
|
#if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
|
|
float3 worldPos : TEXCOORD0;
|
|
#endif
|
|
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
|
|
float4 shadowCoord : TEXCOORD1;
|
|
#endif
|
|
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
UNITY_VERTEX_OUTPUT_STEREO
|
|
};
|
|
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float4 _EmissiveColor3;
|
|
float4 _EyePOMmask1_ST;
|
|
float4 _EmissiveColor4;
|
|
float4 _BlendColor01;
|
|
float4 _BlendColor02;
|
|
float4 _BlendColor03;
|
|
float4 _BlendColor04;
|
|
float4 _EmissiveColor2;
|
|
float4 _EmissiveColor1;
|
|
float _Scale1;
|
|
float _EmissivePower4;
|
|
float _EmissivePower2;
|
|
float _EmissivePower1;
|
|
float _BlendColorPower3;
|
|
float _BlendColorPower4;
|
|
float _EmissivePower3;
|
|
float _BlendColorPower2;
|
|
float _IrisBrightnessPower1;
|
|
float _CurvatureV1;
|
|
float _CurvatureU1;
|
|
float _BlendColorPower5;
|
|
float _RoughnessBoost;
|
|
#ifdef _TRANSMISSION_ASE
|
|
float _TransmissionShadow;
|
|
#endif
|
|
#ifdef _TRANSLUCENCY_ASE
|
|
float _TransStrength;
|
|
float _TransNormal;
|
|
float _TransScattering;
|
|
float _TransDirect;
|
|
float _TransAmbient;
|
|
float _TransShadow;
|
|
#endif
|
|
#ifdef TESSELLATION_ON
|
|
float _TessPhongStrength;
|
|
float _TessValue;
|
|
float _TessMin;
|
|
float _TessMax;
|
|
float _TessEdgeLength;
|
|
float _TessMaxDisp;
|
|
#endif
|
|
CBUFFER_END
|
|
|
|
|
|
|
|
VertexOutput VertexFunction( VertexInput v )
|
|
{
|
|
VertexOutput o = (VertexOutput)0;
|
|
UNITY_SETUP_INSTANCE_ID(v);
|
|
UNITY_TRANSFER_INSTANCE_ID(v, o);
|
|
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
|
|
|
|
|
|
#ifdef ASE_ABSOLUTE_VERTEX_POS
|
|
float3 defaultVertexValue = v.vertex.xyz;
|
|
#else
|
|
float3 defaultVertexValue = float3(0, 0, 0);
|
|
#endif
|
|
float3 vertexValue = defaultVertexValue;
|
|
#ifdef ASE_ABSOLUTE_VERTEX_POS
|
|
v.vertex.xyz = vertexValue;
|
|
#else
|
|
v.vertex.xyz += vertexValue;
|
|
#endif
|
|
|
|
v.ase_normal = v.ase_normal;
|
|
float3 positionWS = TransformObjectToWorld( v.vertex.xyz );
|
|
float4 positionCS = TransformWorldToHClip( positionWS );
|
|
|
|
#if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
|
|
o.worldPos = positionWS;
|
|
#endif
|
|
|
|
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
|
|
VertexPositionInputs vertexInput = (VertexPositionInputs)0;
|
|
vertexInput.positionWS = positionWS;
|
|
vertexInput.positionCS = positionCS;
|
|
o.shadowCoord = GetShadowCoord( vertexInput );
|
|
#endif
|
|
o.clipPos = positionCS;
|
|
return o;
|
|
}
|
|
|
|
#if defined(TESSELLATION_ON)
|
|
struct VertexControl
|
|
{
|
|
float4 vertex : INTERNALTESSPOS;
|
|
float3 ase_normal : NORMAL;
|
|
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
};
|
|
|
|
struct TessellationFactors
|
|
{
|
|
float edge[3] : SV_TessFactor;
|
|
float inside : SV_InsideTessFactor;
|
|
};
|
|
|
|
VertexControl vert ( VertexInput v )
|
|
{
|
|
VertexControl o;
|
|
UNITY_SETUP_INSTANCE_ID(v);
|
|
UNITY_TRANSFER_INSTANCE_ID(v, o);
|
|
o.vertex = v.vertex;
|
|
o.ase_normal = v.ase_normal;
|
|
|
|
return o;
|
|
}
|
|
|
|
TessellationFactors TessellationFunction (InputPatch<VertexControl,3> v)
|
|
{
|
|
TessellationFactors o;
|
|
float4 tf = 1;
|
|
float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax;
|
|
float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp;
|
|
#if defined(ASE_FIXED_TESSELLATION)
|
|
tf = FixedTess( tessValue );
|
|
#elif defined(ASE_DISTANCE_TESSELLATION)
|
|
tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
|
|
#elif defined(ASE_LENGTH_TESSELLATION)
|
|
tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
|
|
#elif defined(ASE_LENGTH_CULL_TESSELLATION)
|
|
tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
|
|
#endif
|
|
o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w;
|
|
return o;
|
|
}
|
|
|
|
[domain("tri")]
|
|
[partitioning("fractional_odd")]
|
|
[outputtopology("triangle_cw")]
|
|
[patchconstantfunc("TessellationFunction")]
|
|
[outputcontrolpoints(3)]
|
|
VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
|
|
{
|
|
return patch[id];
|
|
}
|
|
|
|
[domain("tri")]
|
|
VertexOutput DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
|
|
{
|
|
VertexInput o = (VertexInput) 0;
|
|
o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z;
|
|
o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z;
|
|
|
|
#if defined(ASE_PHONG_TESSELLATION)
|
|
float3 pp[3];
|
|
for (int i = 0; i < 3; ++i)
|
|
pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal));
|
|
float phongStrength = _TessPhongStrength;
|
|
o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz;
|
|
#endif
|
|
UNITY_TRANSFER_INSTANCE_ID(patch[0], o);
|
|
return VertexFunction(o);
|
|
}
|
|
#else
|
|
VertexOutput vert ( VertexInput v )
|
|
{
|
|
return VertexFunction( v );
|
|
}
|
|
#endif
|
|
|
|
half4 frag(VertexOutput IN ) : SV_TARGET
|
|
{
|
|
UNITY_SETUP_INSTANCE_ID(IN);
|
|
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN );
|
|
|
|
#if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
|
|
float3 WorldPosition = IN.worldPos;
|
|
#endif
|
|
float4 ShadowCoords = float4( 0, 0, 0, 0 );
|
|
|
|
#if defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
|
|
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
|
|
ShadowCoords = IN.shadowCoord;
|
|
#elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
|
|
ShadowCoords = TransformWorldToShadowCoord( WorldPosition );
|
|
#endif
|
|
#endif
|
|
|
|
|
|
float Alpha = 1;
|
|
float AlphaClipThreshold = 0.5;
|
|
|
|
#ifdef _ALPHATEST_ON
|
|
clip(Alpha - AlphaClipThreshold);
|
|
#endif
|
|
|
|
#ifdef LOD_FADE_CROSSFADE
|
|
LODDitheringTransition( IN.clipPos.xyz, unity_LODFade.x );
|
|
#endif
|
|
return 0;
|
|
}
|
|
ENDHLSL
|
|
}
|
|
|
|
|
|
Pass
|
|
{
|
|
|
|
Name "Meta"
|
|
Tags { "LightMode"="Meta" }
|
|
|
|
Cull Off
|
|
|
|
HLSLPROGRAM
|
|
#define _NORMAL_DROPOFF_TS 1
|
|
#pragma multi_compile_instancing
|
|
#pragma multi_compile _ LOD_FADE_CROSSFADE
|
|
#pragma multi_compile_fog
|
|
#define ASE_FOG 1
|
|
#define _EMISSION
|
|
#define _NORMALMAP 1
|
|
#define ASE_SRP_VERSION 70301
|
|
|
|
#pragma prefer_hlslcc gles
|
|
#pragma exclude_renderers d3d11_9x
|
|
|
|
#pragma vertex vert
|
|
#pragma fragment frag
|
|
|
|
#define SHADERPASS_META
|
|
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/MetaInput.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
|
|
|
|
#define ASE_NEEDS_VERT_NORMAL
|
|
#define ASE_NEEDS_FRAG_WORLD_POSITION
|
|
|
|
|
|
#pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
|
|
|
|
struct VertexInput
|
|
{
|
|
float4 vertex : POSITION;
|
|
float3 ase_normal : NORMAL;
|
|
float4 texcoord1 : TEXCOORD1;
|
|
float4 texcoord2 : TEXCOORD2;
|
|
float4 ase_texcoord : TEXCOORD0;
|
|
float4 ase_tangent : TANGENT;
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
};
|
|
|
|
struct VertexOutput
|
|
{
|
|
float4 clipPos : SV_POSITION;
|
|
#if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
|
|
float3 worldPos : TEXCOORD0;
|
|
#endif
|
|
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
|
|
float4 shadowCoord : TEXCOORD1;
|
|
#endif
|
|
float4 ase_texcoord2 : TEXCOORD2;
|
|
float4 ase_texcoord3 : TEXCOORD3;
|
|
float4 ase_texcoord4 : TEXCOORD4;
|
|
float4 ase_texcoord5 : TEXCOORD5;
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
UNITY_VERTEX_OUTPUT_STEREO
|
|
};
|
|
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float4 _EmissiveColor3;
|
|
float4 _EyePOMmask1_ST;
|
|
float4 _EmissiveColor4;
|
|
float4 _BlendColor01;
|
|
float4 _BlendColor02;
|
|
float4 _BlendColor03;
|
|
float4 _BlendColor04;
|
|
float4 _EmissiveColor2;
|
|
float4 _EmissiveColor1;
|
|
float _Scale1;
|
|
float _EmissivePower4;
|
|
float _EmissivePower2;
|
|
float _EmissivePower1;
|
|
float _BlendColorPower3;
|
|
float _BlendColorPower4;
|
|
float _EmissivePower3;
|
|
float _BlendColorPower2;
|
|
float _IrisBrightnessPower1;
|
|
float _CurvatureV1;
|
|
float _CurvatureU1;
|
|
float _BlendColorPower5;
|
|
float _RoughnessBoost;
|
|
#ifdef _TRANSMISSION_ASE
|
|
float _TransmissionShadow;
|
|
#endif
|
|
#ifdef _TRANSLUCENCY_ASE
|
|
float _TransStrength;
|
|
float _TransNormal;
|
|
float _TransScattering;
|
|
float _TransDirect;
|
|
float _TransAmbient;
|
|
float _TransShadow;
|
|
#endif
|
|
#ifdef TESSELLATION_ON
|
|
float _TessPhongStrength;
|
|
float _TessValue;
|
|
float _TessMin;
|
|
float _TessMax;
|
|
float _TessEdgeLength;
|
|
float _TessMaxDisp;
|
|
#endif
|
|
CBUFFER_END
|
|
sampler2D _BC;
|
|
sampler2D _EyePOMmask1;
|
|
uniform float _CurvFix;
|
|
sampler2D _Mask;
|
|
SAMPLER(sampler_Mask);
|
|
|
|
|
|
inline float2 POM( sampler2D heightMap, float2 uvs, float2 dx, float2 dy, float3 normalWorld, float3 viewWorld, float3 viewDirTan, int minSamples, int maxSamples, float parallax, float refPlane, float2 tilling, float2 curv, int index )
|
|
{
|
|
float3 result = 0;
|
|
int stepIndex = 0;
|
|
int numSteps = ( int )lerp( (float)maxSamples, (float)minSamples, saturate( dot( normalWorld, viewWorld ) ) );
|
|
float layerHeight = 1.0 / numSteps;
|
|
float2 plane = parallax * ( viewDirTan.xy / viewDirTan.z );
|
|
uvs.xy += refPlane * plane;
|
|
float2 deltaTex = -plane * layerHeight;
|
|
float2 prevTexOffset = 0;
|
|
float prevRayZ = 1.0f;
|
|
float prevHeight = 0.0f;
|
|
float2 currTexOffset = deltaTex;
|
|
float currRayZ = 1.0f - layerHeight;
|
|
float currHeight = 0.0f;
|
|
float intersection = 0;
|
|
float2 finalTexOffset = 0;
|
|
while ( stepIndex < numSteps + 1 )
|
|
{
|
|
result.z = dot( curv, currTexOffset * currTexOffset );
|
|
currHeight = tex2Dgrad( heightMap, uvs + currTexOffset, dx, dy ).r * ( 1 - result.z );
|
|
if ( currHeight > currRayZ )
|
|
{
|
|
stepIndex = numSteps + 1;
|
|
}
|
|
else
|
|
{
|
|
stepIndex++;
|
|
prevTexOffset = currTexOffset;
|
|
prevRayZ = currRayZ;
|
|
prevHeight = currHeight;
|
|
currTexOffset += deltaTex;
|
|
currRayZ -= layerHeight * ( 1 - result.z ) * (1+_CurvFix);
|
|
}
|
|
}
|
|
int sectionSteps = 2;
|
|
int sectionIndex = 0;
|
|
float newZ = 0;
|
|
float newHeight = 0;
|
|
while ( sectionIndex < sectionSteps )
|
|
{
|
|
intersection = ( prevHeight - prevRayZ ) / ( prevHeight - currHeight + currRayZ - prevRayZ );
|
|
finalTexOffset = prevTexOffset + intersection * deltaTex;
|
|
newZ = prevRayZ - intersection * layerHeight;
|
|
newHeight = tex2Dgrad( heightMap, uvs + finalTexOffset, dx, dy ).r;
|
|
if ( newHeight > newZ )
|
|
{
|
|
currTexOffset = finalTexOffset;
|
|
currHeight = newHeight;
|
|
currRayZ = newZ;
|
|
deltaTex = intersection * deltaTex;
|
|
layerHeight = intersection * layerHeight;
|
|
}
|
|
else
|
|
{
|
|
prevTexOffset = finalTexOffset;
|
|
prevHeight = newHeight;
|
|
prevRayZ = newZ;
|
|
deltaTex = ( 1 - intersection ) * deltaTex;
|
|
layerHeight = ( 1 - intersection ) * layerHeight;
|
|
}
|
|
sectionIndex++;
|
|
}
|
|
#ifdef UNITY_PASS_SHADOWCASTER
|
|
if ( unity_LightShadowBias.z == 0.0 )
|
|
{
|
|
#endif
|
|
if ( result.z > 1 )
|
|
clip( -1 );
|
|
#ifdef UNITY_PASS_SHADOWCASTER
|
|
}
|
|
#endif
|
|
return uvs.xy + finalTexOffset;
|
|
}
|
|
|
|
|
|
VertexOutput VertexFunction( VertexInput v )
|
|
{
|
|
VertexOutput o = (VertexOutput)0;
|
|
UNITY_SETUP_INSTANCE_ID(v);
|
|
UNITY_TRANSFER_INSTANCE_ID(v, o);
|
|
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
|
|
|
|
float3 ase_worldTangent = TransformObjectToWorldDir(v.ase_tangent.xyz);
|
|
o.ase_texcoord3.xyz = ase_worldTangent;
|
|
float3 ase_worldNormal = TransformObjectToWorldNormal(v.ase_normal);
|
|
o.ase_texcoord4.xyz = ase_worldNormal;
|
|
float ase_vertexTangentSign = v.ase_tangent.w * unity_WorldTransformParams.w;
|
|
float3 ase_worldBitangent = cross( ase_worldNormal, ase_worldTangent ) * ase_vertexTangentSign;
|
|
o.ase_texcoord5.xyz = ase_worldBitangent;
|
|
|
|
o.ase_texcoord2.xy = v.ase_texcoord.xy;
|
|
|
|
//setting value to unused interpolator channels and avoid initialization warnings
|
|
o.ase_texcoord2.zw = 0;
|
|
o.ase_texcoord3.w = 0;
|
|
o.ase_texcoord4.w = 0;
|
|
o.ase_texcoord5.w = 0;
|
|
|
|
#ifdef ASE_ABSOLUTE_VERTEX_POS
|
|
float3 defaultVertexValue = v.vertex.xyz;
|
|
#else
|
|
float3 defaultVertexValue = float3(0, 0, 0);
|
|
#endif
|
|
float3 vertexValue = defaultVertexValue;
|
|
#ifdef ASE_ABSOLUTE_VERTEX_POS
|
|
v.vertex.xyz = vertexValue;
|
|
#else
|
|
v.vertex.xyz += vertexValue;
|
|
#endif
|
|
|
|
v.ase_normal = v.ase_normal;
|
|
|
|
float3 positionWS = TransformObjectToWorld( v.vertex.xyz );
|
|
#if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
|
|
o.worldPos = positionWS;
|
|
#endif
|
|
|
|
o.clipPos = MetaVertexPosition( v.vertex, v.texcoord1.xy, v.texcoord1.xy, unity_LightmapST, unity_DynamicLightmapST );
|
|
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
|
|
VertexPositionInputs vertexInput = (VertexPositionInputs)0;
|
|
vertexInput.positionWS = positionWS;
|
|
vertexInput.positionCS = o.clipPos;
|
|
o.shadowCoord = GetShadowCoord( vertexInput );
|
|
#endif
|
|
return o;
|
|
}
|
|
|
|
#if defined(TESSELLATION_ON)
|
|
struct VertexControl
|
|
{
|
|
float4 vertex : INTERNALTESSPOS;
|
|
float3 ase_normal : NORMAL;
|
|
float4 texcoord1 : TEXCOORD1;
|
|
float4 texcoord2 : TEXCOORD2;
|
|
float4 ase_texcoord : TEXCOORD0;
|
|
float4 ase_tangent : TANGENT;
|
|
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
};
|
|
|
|
struct TessellationFactors
|
|
{
|
|
float edge[3] : SV_TessFactor;
|
|
float inside : SV_InsideTessFactor;
|
|
};
|
|
|
|
VertexControl vert ( VertexInput v )
|
|
{
|
|
VertexControl o;
|
|
UNITY_SETUP_INSTANCE_ID(v);
|
|
UNITY_TRANSFER_INSTANCE_ID(v, o);
|
|
o.vertex = v.vertex;
|
|
o.ase_normal = v.ase_normal;
|
|
o.texcoord1 = v.texcoord1;
|
|
o.texcoord2 = v.texcoord2;
|
|
o.ase_texcoord = v.ase_texcoord;
|
|
o.ase_tangent = v.ase_tangent;
|
|
return o;
|
|
}
|
|
|
|
TessellationFactors TessellationFunction (InputPatch<VertexControl,3> v)
|
|
{
|
|
TessellationFactors o;
|
|
float4 tf = 1;
|
|
float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax;
|
|
float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp;
|
|
#if defined(ASE_FIXED_TESSELLATION)
|
|
tf = FixedTess( tessValue );
|
|
#elif defined(ASE_DISTANCE_TESSELLATION)
|
|
tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
|
|
#elif defined(ASE_LENGTH_TESSELLATION)
|
|
tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
|
|
#elif defined(ASE_LENGTH_CULL_TESSELLATION)
|
|
tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
|
|
#endif
|
|
o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w;
|
|
return o;
|
|
}
|
|
|
|
[domain("tri")]
|
|
[partitioning("fractional_odd")]
|
|
[outputtopology("triangle_cw")]
|
|
[patchconstantfunc("TessellationFunction")]
|
|
[outputcontrolpoints(3)]
|
|
VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
|
|
{
|
|
return patch[id];
|
|
}
|
|
|
|
[domain("tri")]
|
|
VertexOutput DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
|
|
{
|
|
VertexInput o = (VertexInput) 0;
|
|
o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z;
|
|
o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z;
|
|
o.texcoord1 = patch[0].texcoord1 * bary.x + patch[1].texcoord1 * bary.y + patch[2].texcoord1 * bary.z;
|
|
o.texcoord2 = patch[0].texcoord2 * bary.x + patch[1].texcoord2 * bary.y + patch[2].texcoord2 * bary.z;
|
|
o.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z;
|
|
o.ase_tangent = patch[0].ase_tangent * bary.x + patch[1].ase_tangent * bary.y + patch[2].ase_tangent * bary.z;
|
|
#if defined(ASE_PHONG_TESSELLATION)
|
|
float3 pp[3];
|
|
for (int i = 0; i < 3; ++i)
|
|
pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal));
|
|
float phongStrength = _TessPhongStrength;
|
|
o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz;
|
|
#endif
|
|
UNITY_TRANSFER_INSTANCE_ID(patch[0], o);
|
|
return VertexFunction(o);
|
|
}
|
|
#else
|
|
VertexOutput vert ( VertexInput v )
|
|
{
|
|
return VertexFunction( v );
|
|
}
|
|
#endif
|
|
|
|
half4 frag(VertexOutput IN ) : SV_TARGET
|
|
{
|
|
UNITY_SETUP_INSTANCE_ID(IN);
|
|
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN );
|
|
|
|
#if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
|
|
float3 WorldPosition = IN.worldPos;
|
|
#endif
|
|
float4 ShadowCoords = float4( 0, 0, 0, 0 );
|
|
|
|
#if defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
|
|
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
|
|
ShadowCoords = IN.shadowCoord;
|
|
#elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
|
|
ShadowCoords = TransformWorldToShadowCoord( WorldPosition );
|
|
#endif
|
|
#endif
|
|
|
|
float2 texCoord179 = IN.ase_texcoord2.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float3 ase_worldTangent = IN.ase_texcoord3.xyz;
|
|
float3 ase_worldNormal = IN.ase_texcoord4.xyz;
|
|
float3 ase_worldBitangent = IN.ase_texcoord5.xyz;
|
|
float3 tanToWorld0 = float3( ase_worldTangent.x, ase_worldBitangent.x, ase_worldNormal.x );
|
|
float3 tanToWorld1 = float3( ase_worldTangent.y, ase_worldBitangent.y, ase_worldNormal.y );
|
|
float3 tanToWorld2 = float3( ase_worldTangent.z, ase_worldBitangent.z, ase_worldNormal.z );
|
|
float3 ase_worldViewDir = ( _WorldSpaceCameraPos.xyz - WorldPosition );
|
|
ase_worldViewDir = normalize(ase_worldViewDir);
|
|
float3 ase_tanViewDir = tanToWorld0 * ase_worldViewDir.x + tanToWorld1 * ase_worldViewDir.y + tanToWorld2 * ase_worldViewDir.z;
|
|
ase_tanViewDir = normalize(ase_tanViewDir);
|
|
float2 appendResult176 = (float2(_CurvatureU1 , _CurvatureV1));
|
|
float2 OffsetPOM180 = POM( _EyePOMmask1, texCoord179, ddx(texCoord179), ddy(texCoord179), ase_worldNormal, ase_worldViewDir, ase_tanViewDir, 8, 8, _Scale1, 0, _EyePOMmask1_ST.xy, appendResult176, 0 );
|
|
float2 myVarName182 = OffsetPOM180;
|
|
float2 temp_output_181_0 = ddx( texCoord179 );
|
|
float2 temp_output_183_0 = ddy( texCoord179 );
|
|
float4 tex2DNode1 = tex2D( _BC, myVarName182, temp_output_181_0, temp_output_183_0 );
|
|
float4 tex2DNode2 = tex2D( _Mask, myVarName182, temp_output_181_0, temp_output_183_0 );
|
|
float4 lerpResult186 = lerp( tex2DNode1 , ( tex2DNode1 * _IrisBrightnessPower1 ) , tex2DNode2.r);
|
|
float4 lerpResult28 = lerp( float4( 0,0,0,0 ) , _BlendColor01 , tex2DNode2.r);
|
|
float4 lerpResult29 = lerp( float4( 0,0,0,0 ) , _BlendColor02 , tex2DNode2.g);
|
|
float4 lerpResult30 = lerp( float4( 0,0,0,0 ) , _BlendColor03 , tex2DNode2.b);
|
|
float4 lerpResult31 = lerp( float4( 0,0,0,0 ) , _BlendColor04 , tex2DNode2.a);
|
|
float4 lerpResult132 = lerp( lerpResult186 , ( lerpResult28 + lerpResult29 + lerpResult30 + lerpResult31 ) , ( ( _BlendColorPower2 * tex2DNode2.r ) + ( _BlendColorPower3 * tex2DNode2.g ) + ( _BlendColorPower4 * tex2DNode2.b ) + ( _BlendColorPower5 * tex2DNode2.a ) ));
|
|
|
|
|
|
float3 Albedo = lerpResult132.rgb;
|
|
float3 Emission = ( ( ( ( tex2DNode2.r * _EmissiveColor1 ) * _EmissivePower1 ) + ( ( tex2DNode2.g * _EmissiveColor2 ) * _EmissivePower2 ) ) + ( ( ( tex2DNode2.a * _EmissiveColor4 ) * _EmissivePower4 ) + ( ( tex2DNode2.b * _EmissiveColor3 ) * _EmissivePower3 ) ) ).rgb;
|
|
float Alpha = 1;
|
|
float AlphaClipThreshold = 0.5;
|
|
|
|
#ifdef _ALPHATEST_ON
|
|
clip(Alpha - AlphaClipThreshold);
|
|
#endif
|
|
|
|
MetaInput metaInput = (MetaInput)0;
|
|
metaInput.Albedo = Albedo;
|
|
metaInput.Emission = Emission;
|
|
|
|
return MetaFragment(metaInput);
|
|
}
|
|
ENDHLSL
|
|
}
|
|
|
|
|
|
Pass
|
|
{
|
|
|
|
Name "Universal2D"
|
|
Tags { "LightMode"="Universal2D" }
|
|
|
|
Blend One Zero, One Zero
|
|
ZWrite On
|
|
ZTest LEqual
|
|
Offset 0 , 0
|
|
ColorMask RGBA
|
|
|
|
HLSLPROGRAM
|
|
#define _NORMAL_DROPOFF_TS 1
|
|
#pragma multi_compile_instancing
|
|
#pragma multi_compile _ LOD_FADE_CROSSFADE
|
|
#pragma multi_compile_fog
|
|
#define ASE_FOG 1
|
|
#define _EMISSION
|
|
#define _NORMALMAP 1
|
|
#define ASE_SRP_VERSION 70301
|
|
|
|
#pragma enable_d3d11_debug_symbols
|
|
#pragma prefer_hlslcc gles
|
|
#pragma exclude_renderers d3d11_9x
|
|
|
|
#pragma vertex vert
|
|
#pragma fragment frag
|
|
|
|
#define SHADERPASS_2D
|
|
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Color.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/UnityInstancing.hlsl"
|
|
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderGraphFunctions.hlsl"
|
|
|
|
#define ASE_NEEDS_VERT_NORMAL
|
|
#define ASE_NEEDS_FRAG_WORLD_POSITION
|
|
|
|
|
|
#pragma shader_feature _ _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A
|
|
|
|
struct VertexInput
|
|
{
|
|
float4 vertex : POSITION;
|
|
float3 ase_normal : NORMAL;
|
|
float4 ase_texcoord : TEXCOORD0;
|
|
float4 ase_tangent : TANGENT;
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
};
|
|
|
|
struct VertexOutput
|
|
{
|
|
float4 clipPos : SV_POSITION;
|
|
#if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
|
|
float3 worldPos : TEXCOORD0;
|
|
#endif
|
|
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
|
|
float4 shadowCoord : TEXCOORD1;
|
|
#endif
|
|
float4 ase_texcoord2 : TEXCOORD2;
|
|
float4 ase_texcoord3 : TEXCOORD3;
|
|
float4 ase_texcoord4 : TEXCOORD4;
|
|
float4 ase_texcoord5 : TEXCOORD5;
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
UNITY_VERTEX_OUTPUT_STEREO
|
|
};
|
|
|
|
CBUFFER_START(UnityPerMaterial)
|
|
float4 _EmissiveColor3;
|
|
float4 _EyePOMmask1_ST;
|
|
float4 _EmissiveColor4;
|
|
float4 _BlendColor01;
|
|
float4 _BlendColor02;
|
|
float4 _BlendColor03;
|
|
float4 _BlendColor04;
|
|
float4 _EmissiveColor2;
|
|
float4 _EmissiveColor1;
|
|
float _Scale1;
|
|
float _EmissivePower4;
|
|
float _EmissivePower2;
|
|
float _EmissivePower1;
|
|
float _BlendColorPower3;
|
|
float _BlendColorPower4;
|
|
float _EmissivePower3;
|
|
float _BlendColorPower2;
|
|
float _IrisBrightnessPower1;
|
|
float _CurvatureV1;
|
|
float _CurvatureU1;
|
|
float _BlendColorPower5;
|
|
float _RoughnessBoost;
|
|
#ifdef _TRANSMISSION_ASE
|
|
float _TransmissionShadow;
|
|
#endif
|
|
#ifdef _TRANSLUCENCY_ASE
|
|
float _TransStrength;
|
|
float _TransNormal;
|
|
float _TransScattering;
|
|
float _TransDirect;
|
|
float _TransAmbient;
|
|
float _TransShadow;
|
|
#endif
|
|
#ifdef TESSELLATION_ON
|
|
float _TessPhongStrength;
|
|
float _TessValue;
|
|
float _TessMin;
|
|
float _TessMax;
|
|
float _TessEdgeLength;
|
|
float _TessMaxDisp;
|
|
#endif
|
|
CBUFFER_END
|
|
sampler2D _BC;
|
|
sampler2D _EyePOMmask1;
|
|
uniform float _CurvFix;
|
|
sampler2D _Mask;
|
|
SAMPLER(sampler_Mask);
|
|
|
|
|
|
inline float2 POM( sampler2D heightMap, float2 uvs, float2 dx, float2 dy, float3 normalWorld, float3 viewWorld, float3 viewDirTan, int minSamples, int maxSamples, float parallax, float refPlane, float2 tilling, float2 curv, int index )
|
|
{
|
|
float3 result = 0;
|
|
int stepIndex = 0;
|
|
int numSteps = ( int )lerp( (float)maxSamples, (float)minSamples, saturate( dot( normalWorld, viewWorld ) ) );
|
|
float layerHeight = 1.0 / numSteps;
|
|
float2 plane = parallax * ( viewDirTan.xy / viewDirTan.z );
|
|
uvs.xy += refPlane * plane;
|
|
float2 deltaTex = -plane * layerHeight;
|
|
float2 prevTexOffset = 0;
|
|
float prevRayZ = 1.0f;
|
|
float prevHeight = 0.0f;
|
|
float2 currTexOffset = deltaTex;
|
|
float currRayZ = 1.0f - layerHeight;
|
|
float currHeight = 0.0f;
|
|
float intersection = 0;
|
|
float2 finalTexOffset = 0;
|
|
while ( stepIndex < numSteps + 1 )
|
|
{
|
|
result.z = dot( curv, currTexOffset * currTexOffset );
|
|
currHeight = tex2Dgrad( heightMap, uvs + currTexOffset, dx, dy ).r * ( 1 - result.z );
|
|
if ( currHeight > currRayZ )
|
|
{
|
|
stepIndex = numSteps + 1;
|
|
}
|
|
else
|
|
{
|
|
stepIndex++;
|
|
prevTexOffset = currTexOffset;
|
|
prevRayZ = currRayZ;
|
|
prevHeight = currHeight;
|
|
currTexOffset += deltaTex;
|
|
currRayZ -= layerHeight * ( 1 - result.z ) * (1+_CurvFix);
|
|
}
|
|
}
|
|
int sectionSteps = 2;
|
|
int sectionIndex = 0;
|
|
float newZ = 0;
|
|
float newHeight = 0;
|
|
while ( sectionIndex < sectionSteps )
|
|
{
|
|
intersection = ( prevHeight - prevRayZ ) / ( prevHeight - currHeight + currRayZ - prevRayZ );
|
|
finalTexOffset = prevTexOffset + intersection * deltaTex;
|
|
newZ = prevRayZ - intersection * layerHeight;
|
|
newHeight = tex2Dgrad( heightMap, uvs + finalTexOffset, dx, dy ).r;
|
|
if ( newHeight > newZ )
|
|
{
|
|
currTexOffset = finalTexOffset;
|
|
currHeight = newHeight;
|
|
currRayZ = newZ;
|
|
deltaTex = intersection * deltaTex;
|
|
layerHeight = intersection * layerHeight;
|
|
}
|
|
else
|
|
{
|
|
prevTexOffset = finalTexOffset;
|
|
prevHeight = newHeight;
|
|
prevRayZ = newZ;
|
|
deltaTex = ( 1 - intersection ) * deltaTex;
|
|
layerHeight = ( 1 - intersection ) * layerHeight;
|
|
}
|
|
sectionIndex++;
|
|
}
|
|
#ifdef UNITY_PASS_SHADOWCASTER
|
|
if ( unity_LightShadowBias.z == 0.0 )
|
|
{
|
|
#endif
|
|
if ( result.z > 1 )
|
|
clip( -1 );
|
|
#ifdef UNITY_PASS_SHADOWCASTER
|
|
}
|
|
#endif
|
|
return uvs.xy + finalTexOffset;
|
|
}
|
|
|
|
|
|
VertexOutput VertexFunction( VertexInput v )
|
|
{
|
|
VertexOutput o = (VertexOutput)0;
|
|
UNITY_SETUP_INSTANCE_ID( v );
|
|
UNITY_TRANSFER_INSTANCE_ID( v, o );
|
|
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO( o );
|
|
|
|
float3 ase_worldTangent = TransformObjectToWorldDir(v.ase_tangent.xyz);
|
|
o.ase_texcoord3.xyz = ase_worldTangent;
|
|
float3 ase_worldNormal = TransformObjectToWorldNormal(v.ase_normal);
|
|
o.ase_texcoord4.xyz = ase_worldNormal;
|
|
float ase_vertexTangentSign = v.ase_tangent.w * unity_WorldTransformParams.w;
|
|
float3 ase_worldBitangent = cross( ase_worldNormal, ase_worldTangent ) * ase_vertexTangentSign;
|
|
o.ase_texcoord5.xyz = ase_worldBitangent;
|
|
|
|
o.ase_texcoord2.xy = v.ase_texcoord.xy;
|
|
|
|
//setting value to unused interpolator channels and avoid initialization warnings
|
|
o.ase_texcoord2.zw = 0;
|
|
o.ase_texcoord3.w = 0;
|
|
o.ase_texcoord4.w = 0;
|
|
o.ase_texcoord5.w = 0;
|
|
|
|
#ifdef ASE_ABSOLUTE_VERTEX_POS
|
|
float3 defaultVertexValue = v.vertex.xyz;
|
|
#else
|
|
float3 defaultVertexValue = float3(0, 0, 0);
|
|
#endif
|
|
float3 vertexValue = defaultVertexValue;
|
|
#ifdef ASE_ABSOLUTE_VERTEX_POS
|
|
v.vertex.xyz = vertexValue;
|
|
#else
|
|
v.vertex.xyz += vertexValue;
|
|
#endif
|
|
|
|
v.ase_normal = v.ase_normal;
|
|
|
|
float3 positionWS = TransformObjectToWorld( v.vertex.xyz );
|
|
float4 positionCS = TransformWorldToHClip( positionWS );
|
|
|
|
#if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
|
|
o.worldPos = positionWS;
|
|
#endif
|
|
|
|
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR) && defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
|
|
VertexPositionInputs vertexInput = (VertexPositionInputs)0;
|
|
vertexInput.positionWS = positionWS;
|
|
vertexInput.positionCS = positionCS;
|
|
o.shadowCoord = GetShadowCoord( vertexInput );
|
|
#endif
|
|
|
|
o.clipPos = positionCS;
|
|
return o;
|
|
}
|
|
|
|
#if defined(TESSELLATION_ON)
|
|
struct VertexControl
|
|
{
|
|
float4 vertex : INTERNALTESSPOS;
|
|
float3 ase_normal : NORMAL;
|
|
float4 ase_texcoord : TEXCOORD0;
|
|
float4 ase_tangent : TANGENT;
|
|
|
|
UNITY_VERTEX_INPUT_INSTANCE_ID
|
|
};
|
|
|
|
struct TessellationFactors
|
|
{
|
|
float edge[3] : SV_TessFactor;
|
|
float inside : SV_InsideTessFactor;
|
|
};
|
|
|
|
VertexControl vert ( VertexInput v )
|
|
{
|
|
VertexControl o;
|
|
UNITY_SETUP_INSTANCE_ID(v);
|
|
UNITY_TRANSFER_INSTANCE_ID(v, o);
|
|
o.vertex = v.vertex;
|
|
o.ase_normal = v.ase_normal;
|
|
o.ase_texcoord = v.ase_texcoord;
|
|
o.ase_tangent = v.ase_tangent;
|
|
return o;
|
|
}
|
|
|
|
TessellationFactors TessellationFunction (InputPatch<VertexControl,3> v)
|
|
{
|
|
TessellationFactors o;
|
|
float4 tf = 1;
|
|
float tessValue = _TessValue; float tessMin = _TessMin; float tessMax = _TessMax;
|
|
float edgeLength = _TessEdgeLength; float tessMaxDisp = _TessMaxDisp;
|
|
#if defined(ASE_FIXED_TESSELLATION)
|
|
tf = FixedTess( tessValue );
|
|
#elif defined(ASE_DISTANCE_TESSELLATION)
|
|
tf = DistanceBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, tessValue, tessMin, tessMax, GetObjectToWorldMatrix(), _WorldSpaceCameraPos );
|
|
#elif defined(ASE_LENGTH_TESSELLATION)
|
|
tf = EdgeLengthBasedTess(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams );
|
|
#elif defined(ASE_LENGTH_CULL_TESSELLATION)
|
|
tf = EdgeLengthBasedTessCull(v[0].vertex, v[1].vertex, v[2].vertex, edgeLength, tessMaxDisp, GetObjectToWorldMatrix(), _WorldSpaceCameraPos, _ScreenParams, unity_CameraWorldClipPlanes );
|
|
#endif
|
|
o.edge[0] = tf.x; o.edge[1] = tf.y; o.edge[2] = tf.z; o.inside = tf.w;
|
|
return o;
|
|
}
|
|
|
|
[domain("tri")]
|
|
[partitioning("fractional_odd")]
|
|
[outputtopology("triangle_cw")]
|
|
[patchconstantfunc("TessellationFunction")]
|
|
[outputcontrolpoints(3)]
|
|
VertexControl HullFunction(InputPatch<VertexControl, 3> patch, uint id : SV_OutputControlPointID)
|
|
{
|
|
return patch[id];
|
|
}
|
|
|
|
[domain("tri")]
|
|
VertexOutput DomainFunction(TessellationFactors factors, OutputPatch<VertexControl, 3> patch, float3 bary : SV_DomainLocation)
|
|
{
|
|
VertexInput o = (VertexInput) 0;
|
|
o.vertex = patch[0].vertex * bary.x + patch[1].vertex * bary.y + patch[2].vertex * bary.z;
|
|
o.ase_normal = patch[0].ase_normal * bary.x + patch[1].ase_normal * bary.y + patch[2].ase_normal * bary.z;
|
|
o.ase_texcoord = patch[0].ase_texcoord * bary.x + patch[1].ase_texcoord * bary.y + patch[2].ase_texcoord * bary.z;
|
|
o.ase_tangent = patch[0].ase_tangent * bary.x + patch[1].ase_tangent * bary.y + patch[2].ase_tangent * bary.z;
|
|
#if defined(ASE_PHONG_TESSELLATION)
|
|
float3 pp[3];
|
|
for (int i = 0; i < 3; ++i)
|
|
pp[i] = o.vertex.xyz - patch[i].ase_normal * (dot(o.vertex.xyz, patch[i].ase_normal) - dot(patch[i].vertex.xyz, patch[i].ase_normal));
|
|
float phongStrength = _TessPhongStrength;
|
|
o.vertex.xyz = phongStrength * (pp[0]*bary.x + pp[1]*bary.y + pp[2]*bary.z) + (1.0f-phongStrength) * o.vertex.xyz;
|
|
#endif
|
|
UNITY_TRANSFER_INSTANCE_ID(patch[0], o);
|
|
return VertexFunction(o);
|
|
}
|
|
#else
|
|
VertexOutput vert ( VertexInput v )
|
|
{
|
|
return VertexFunction( v );
|
|
}
|
|
#endif
|
|
|
|
half4 frag(VertexOutput IN ) : SV_TARGET
|
|
{
|
|
UNITY_SETUP_INSTANCE_ID( IN );
|
|
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX( IN );
|
|
|
|
#if defined(ASE_NEEDS_FRAG_WORLD_POSITION)
|
|
float3 WorldPosition = IN.worldPos;
|
|
#endif
|
|
float4 ShadowCoords = float4( 0, 0, 0, 0 );
|
|
|
|
#if defined(ASE_NEEDS_FRAG_SHADOWCOORDS)
|
|
#if defined(REQUIRES_VERTEX_SHADOW_COORD_INTERPOLATOR)
|
|
ShadowCoords = IN.shadowCoord;
|
|
#elif defined(MAIN_LIGHT_CALCULATE_SHADOWS)
|
|
ShadowCoords = TransformWorldToShadowCoord( WorldPosition );
|
|
#endif
|
|
#endif
|
|
|
|
float2 texCoord179 = IN.ase_texcoord2.xy * float2( 1,1 ) + float2( 0,0 );
|
|
float3 ase_worldTangent = IN.ase_texcoord3.xyz;
|
|
float3 ase_worldNormal = IN.ase_texcoord4.xyz;
|
|
float3 ase_worldBitangent = IN.ase_texcoord5.xyz;
|
|
float3 tanToWorld0 = float3( ase_worldTangent.x, ase_worldBitangent.x, ase_worldNormal.x );
|
|
float3 tanToWorld1 = float3( ase_worldTangent.y, ase_worldBitangent.y, ase_worldNormal.y );
|
|
float3 tanToWorld2 = float3( ase_worldTangent.z, ase_worldBitangent.z, ase_worldNormal.z );
|
|
float3 ase_worldViewDir = ( _WorldSpaceCameraPos.xyz - WorldPosition );
|
|
ase_worldViewDir = normalize(ase_worldViewDir);
|
|
float3 ase_tanViewDir = tanToWorld0 * ase_worldViewDir.x + tanToWorld1 * ase_worldViewDir.y + tanToWorld2 * ase_worldViewDir.z;
|
|
ase_tanViewDir = normalize(ase_tanViewDir);
|
|
float2 appendResult176 = (float2(_CurvatureU1 , _CurvatureV1));
|
|
float2 OffsetPOM180 = POM( _EyePOMmask1, texCoord179, ddx(texCoord179), ddy(texCoord179), ase_worldNormal, ase_worldViewDir, ase_tanViewDir, 8, 8, _Scale1, 0, _EyePOMmask1_ST.xy, appendResult176, 0 );
|
|
float2 myVarName182 = OffsetPOM180;
|
|
float2 temp_output_181_0 = ddx( texCoord179 );
|
|
float2 temp_output_183_0 = ddy( texCoord179 );
|
|
float4 tex2DNode1 = tex2D( _BC, myVarName182, temp_output_181_0, temp_output_183_0 );
|
|
float4 tex2DNode2 = tex2D( _Mask, myVarName182, temp_output_181_0, temp_output_183_0 );
|
|
float4 lerpResult186 = lerp( tex2DNode1 , ( tex2DNode1 * _IrisBrightnessPower1 ) , tex2DNode2.r);
|
|
float4 lerpResult28 = lerp( float4( 0,0,0,0 ) , _BlendColor01 , tex2DNode2.r);
|
|
float4 lerpResult29 = lerp( float4( 0,0,0,0 ) , _BlendColor02 , tex2DNode2.g);
|
|
float4 lerpResult30 = lerp( float4( 0,0,0,0 ) , _BlendColor03 , tex2DNode2.b);
|
|
float4 lerpResult31 = lerp( float4( 0,0,0,0 ) , _BlendColor04 , tex2DNode2.a);
|
|
float4 lerpResult132 = lerp( lerpResult186 , ( lerpResult28 + lerpResult29 + lerpResult30 + lerpResult31 ) , ( ( _BlendColorPower2 * tex2DNode2.r ) + ( _BlendColorPower3 * tex2DNode2.g ) + ( _BlendColorPower4 * tex2DNode2.b ) + ( _BlendColorPower5 * tex2DNode2.a ) ));
|
|
|
|
|
|
float3 Albedo = lerpResult132.rgb;
|
|
float Alpha = 1;
|
|
float AlphaClipThreshold = 0.5;
|
|
|
|
half4 color = half4( Albedo, Alpha );
|
|
|
|
#ifdef _ALPHATEST_ON
|
|
clip(Alpha - AlphaClipThreshold);
|
|
#endif
|
|
|
|
return color;
|
|
}
|
|
ENDHLSL
|
|
}
|
|
|
|
}
|
|
/*ase_lod*/
|
|
CustomEditor "UnityEditor.ShaderGraph.PBRMasterGUI"
|
|
Fallback "Hidden/InternalErrorShader"
|
|
|
|
}
|
|
/*ASEBEGIN
|
|
Version=18500
|
|
2560;0;2560;1059;3535.031;2597.924;1.338546;True;False
|
|
Node;AmplifyShaderEditor.RangedFloatNode;174;-3319.524,-1771.13;Inherit;False;Property;_CurvatureU1;Curvature U;25;0;Create;True;0;0;False;0;False;0;0;0;100;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;173;-3325.076,-1667.525;Inherit;False;Property;_CurvatureV1;Curvature V;26;0;Create;True;0;0;False;0;False;0;0;0;100;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.ViewDirInputsCoordNode;175;-3125.948,-1963.81;Inherit;False;Tangent;False;0;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
|
|
Node;AmplifyShaderEditor.DynamicAppendNode;176;-2975.518,-1757.23;Inherit;False;FLOAT2;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT2;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;177;-3121.627,-2050.3;Inherit;False;Property;_Scale1;Scale;23;0;Create;True;0;0;False;0;False;0.1;0;0;0.5;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.VirtualTextureObject;178;-3464.551,-2166.458;Inherit;True;Property;_EyePOMmask1;Eye POM mask;20;0;Create;True;0;0;False;0;False;-1;None;None;False;white;Auto;Unity5;0;0;2;SAMPLER2D;0;SAMPLERSTATE;1
|
|
Node;AmplifyShaderEditor.TextureCoordinatesNode;179;-3143.778,-2266.451;Inherit;False;0;-1;2;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0,0;False;5;FLOAT2;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.ParallaxOcclusionMappingNode;180;-2753.376,-2177.084;Inherit;False;0;8;False;-1;16;False;-1;2;0.02;0;False;1,1;True;0,0;7;0;FLOAT2;0,0;False;1;SAMPLER2D;;False;2;FLOAT;0.02;False;3;FLOAT3;0,0,0;False;4;FLOAT;0;False;5;FLOAT2;0,0;False;6;FLOAT;0;False;1;FLOAT2;0
|
|
Node;AmplifyShaderEditor.DdxOpNode;181;-2699.518,-1804.231;Inherit;False;1;0;FLOAT2;0,0;False;1;FLOAT2;0
|
|
Node;AmplifyShaderEditor.RegisterLocalVarNode;182;-2443.984,-2082.651;Inherit;False;myVarName;-1;True;1;0;FLOAT2;0,0;False;1;FLOAT2;0
|
|
Node;AmplifyShaderEditor.DdyOpNode;183;-2702.518,-1725.231;Inherit;False;1;0;FLOAT2;0,0;False;1;FLOAT2;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;160;-2701.085,-2708.999;Inherit;False;Property;_BlendColorPower3;Blend Color Power 02;9;0;Create;True;0;0;False;0;False;0;0;0;1;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;161;-2697.35,-2557.356;Inherit;False;Property;_BlendColorPower4;Blend Color Power 03;11;0;Create;True;0;0;False;0;False;0;0;0;1;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.ColorNode;15;-937.5658,-2228.902;Float;False;Property;_BlendColor04;Blend Color 04;12;0;Create;True;0;0;False;0;False;1,1,1,0;1,1,1,0;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.ColorNode;8;-2184.097,-2251.844;Float;False;Property;_BlendColor01;Blend Color 01;6;0;Create;True;0;0;False;0;False;1,1,1,0;1,1,1,0;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.ColorNode;10;-1673.49,-2246.74;Float;False;Property;_BlendColor02;Blend Color 02;8;0;Create;True;0;0;False;0;False;1,1,1,0;1,1,1,0;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.SamplerNode;1;-2170.632,-1873.75;Inherit;True;Property;_BC;Base Color;5;0;Create;False;0;0;False;0;False;-1;None;None;True;0;False;white;Auto;False;Object;-1;Derivative;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.RangedFloatNode;158;-2702.628,-2395.512;Inherit;False;Property;_BlendColorPower5;Blend Color Power 04;13;0;Create;True;0;0;False;0;False;0;0;0;1;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;184;-2114.355,-1658.726;Inherit;False;Property;_IrisBrightnessPower1;Iris Brightness Power;0;0;Create;True;0;0;False;0;False;1;0;0;0;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SamplerNode;2;-2182.578,-2069.825;Inherit;True;Property;_Mask;Mask;2;0;Create;True;0;0;False;0;False;-1;None;None;True;0;False;white;Auto;False;Object;-1;Derivative;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.RangedFloatNode;159;-2702.558,-2841.441;Inherit;False;Property;_BlendColorPower2;Blend Color Power 01;7;0;Create;True;0;0;False;0;False;0;0;0;1;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.ColorNode;13;-1297.669,-2232.802;Float;False;Property;_BlendColor03;Blend Color 03;10;0;Create;True;0;0;False;0;False;1,1,1,0;1,1,1,0;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;163;-2388.096,-2560.652;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;185;-1702.369,-1822.652;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;164;-2366.667,-2699.211;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.LerpOp;30;-1441.453,-2473.968;Inherit;False;3;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;FLOAT;0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.LerpOp;29;-1660.614,-2471.336;Inherit;False;3;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;FLOAT;0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.LerpOp;31;-1246.897,-2470.799;Inherit;False;3;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;FLOAT;0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;165;-2366.333,-2843.121;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;162;-2392.375,-2398.809;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.LerpOp;28;-1880.47,-2476.402;Inherit;False;3;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;FLOAT;0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.SimpleAddOpNode;130;-1507.587,-2771.956;Inherit;False;4;4;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;COLOR;0,0,0,0;False;3;COLOR;0,0,0,0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.LerpOp;186;-1500.28,-1974.491;Inherit;False;3;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;FLOAT;0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.SimpleAddOpNode;166;-2079.833,-2737.466;Inherit;True;4;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;135;-2066,-1348;Float;False;Property;_EmissivePower1;Emissive Power 1;15;0;Create;True;0;0;False;0;False;0;0;0;5;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;152;-1756.556,-820.5927;Inherit;False;2;2;0;FLOAT;0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;138;-1776,-1632;Inherit;False;2;2;0;FLOAT;0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;153;-1580.556,-708.5939;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.ColorNode;134;-2000,-1520;Float;False;Property;_EmissiveColor1;Emissive Color 1;14;0;Create;True;0;0;False;0;False;0,0,0,0;1,1,1,0;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.ColorNode;145;-1996.465,-1004.939;Float;False;Property;_EmissiveColor3;Emissive Color 3;18;0;Create;True;0;0;False;0;False;0,0,0,0;1,1,1,0;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.RangedFloatNode;151;-2069.571,-572.4749;Float;False;Property;_EmissivePower4;Emissive Power 4;22;0;Create;True;0;0;False;0;False;0;0;0;5;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;141;-1762.311,-1359.009;Inherit;False;2;2;0;FLOAT;0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;147;-1758.034,-1086.747;Inherit;False;2;2;0;FLOAT;0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;140;-2063.311,-1087.009;Float;False;Property;_EmissivePower2;Emissive Power 2;17;0;Create;True;0;0;False;0;False;0;0;0;5;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;146;-2068.349,-830.7182;Float;False;Property;_EmissivePower3;Emissive Power 3;19;0;Create;True;0;0;False;0;False;0;0;0;5;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.ColorNode;150;-1996.466,-746.6957;Float;False;Property;_EmissiveColor4;Emissive Color 4;21;0;Create;True;0;0;False;0;False;0,0,0,0;1,1,1,0;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.ColorNode;139;-1996.311,-1260.009;Float;False;Property;_EmissiveColor2;Emissive Color 2;16;0;Create;True;0;0;False;0;False;0,0,0,0;1,1,1,0;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.SimpleAddOpNode;154;-1219.227,-1208.737;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.SamplerNode;77;630.459,-872.668;Inherit;True;Property;_Roughness;Roughness;3;0;Create;True;0;0;False;0;False;-1;None;None;True;0;False;white;Auto;False;Object;-1;Derivative;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;3;-1859.684,-2239.549;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;12;-1075.954,-2227.006;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;11;-1452.776,-2239.944;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;142;-1586.311,-1247.009;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.SimpleAddOpNode;144;-1413.455,-1361.677;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.SimpleAddOpNode;149;-1409.178,-1089.415;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;133;-1600,-1520;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.LerpOp;132;-947.392,-2737.569;Inherit;False;3;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;FLOAT;0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.SamplerNode;75;-250.3056,-2160.307;Inherit;True;Property;_Normal;Normal;1;0;Create;True;0;0;False;0;False;-1;None;None;True;0;True;bump;Auto;True;Object;-1;Derivative;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;117;1154.87,-1036.85;Inherit;False;2;2;0;FLOAT;0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.RangedFloatNode;79;629.7375,-1093.339;Float;False;Property;_RoughnessBoost;Roughness Boost;4;0;Create;True;0;0;False;0;False;0.5;0;0;4;0;1;FLOAT;0
|
|
Node;AmplifyShaderEditor.WorldReflectionVector;156;530.4367,-1592.982;Inherit;False;False;1;0;FLOAT3;0,0,0;False;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
|
|
Node;AmplifyShaderEditor.SamplerNode;157;734.2535,-1616.989;Inherit;True;Property;_CubeMap;CubeMap;24;0;Create;True;0;0;False;0;False;-1;None;None;True;0;False;white;Auto;False;Object;-1;Derivative;Cube;8;0;SAMPLERCUBE;;False;1;FLOAT3;0,0,0;False;2;FLOAT;0;False;3;FLOAT3;0,0,0;False;4;FLOAT3;0,0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;148;-1582.034,-974.7482;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;14;-715.853,-2223.105;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;1;COLOR;0
|
|
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;168;1442.579,-1523.725;Float;False;True;-1;2;UnityEditor.ShaderGraph.PBRMasterGUI;0;2;DawnShaderURP/EyesShaderURP;94348b07e5e8bab40bd6c8a1e3df54cd;True;Forward;0;1;Forward;17;False;False;False;False;False;False;False;False;True;0;False;-1;True;0;False;-1;False;False;False;False;False;False;False;False;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;0;0;True;1;1;False;-1;0;False;-1;1;1;False;-1;0;False;-1;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;-1;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;1;LightMode=UniversalForward;False;0;Hidden/InternalErrorShader;0;0;Standard;36;Workflow;1;Surface;0; Refraction Model;0; Blend;0;Two Sided;1;Fragment Normal Space,InvertActionOnDeselection;0;Transmission;0; Transmission Shadow;0.5,False,-1;Translucency;0; Translucency Strength;1,False,-1; Normal Distortion;0.5,False,-1; Scattering;2,False,-1; Direct;0.9,False,-1; Ambient;0.1,False,-1; Shadow;0.5,False,-1;Cast Shadows;1; Use Shadow Threshold;0;Receive Shadows;1;GPU Instancing;1;LOD CrossFade;1;Built-in Fog;1;_FinalColorxAlpha;0;Meta Pass;1;Override Baked GI;0;Extra Pre Pass;0;DOTS Instancing;0;Tessellation;0; Phong;0; Strength;0.5,False,-1; Type;0; Tess;16,False,-1; Min;10,False,-1; Max;25,False,-1; Edge Length;16,False,-1; Max Displacement;25,False,-1;Vertex Position,InvertActionOnDeselection;1;0;6;False;True;True;True;True;True;False;;False;0
|
|
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;169;1442.579,-1523.725;Float;False;False;-1;2;UnityEditor.ShaderGraph.PBRMasterGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ShadowCaster;0;2;ShadowCaster;0;False;False;False;False;False;False;False;False;True;0;False;-1;True;0;False;-1;False;False;False;False;False;False;False;False;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;0;0;False;False;False;False;False;False;False;False;True;0;False;-1;False;False;False;False;False;False;True;1;False;-1;True;3;False;-1;False;True;1;LightMode=ShadowCaster;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0
|
|
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;170;1442.579,-1523.725;Float;False;False;-1;2;UnityEditor.ShaderGraph.PBRMasterGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;DepthOnly;0;3;DepthOnly;0;False;False;False;False;False;False;False;False;True;0;False;-1;True;0;False;-1;False;False;False;False;False;False;False;False;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;0;0;False;False;False;False;False;False;False;False;True;0;False;-1;False;True;False;False;False;False;0;False;-1;False;False;False;False;True;1;False;-1;False;False;True;1;LightMode=DepthOnly;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0
|
|
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;171;1442.579,-1523.725;Float;False;False;-1;2;UnityEditor.ShaderGraph.PBRMasterGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;Meta;0;4;Meta;0;False;False;False;False;False;False;False;False;True;0;False;-1;True;0;False;-1;False;False;False;False;False;False;False;False;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;0;0;False;False;False;False;False;False;False;False;False;True;2;False;-1;False;False;False;False;False;False;False;False;True;1;LightMode=Meta;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0
|
|
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;167;1442.579,-1523.725;Float;False;False;-1;2;UnityEditor.ShaderGraph.PBRMasterGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;ExtraPrePass;0;0;ExtraPrePass;5;False;False;False;False;False;False;False;False;True;0;False;-1;True;0;False;-1;False;False;False;False;False;False;False;False;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;0;0;True;1;1;False;-1;0;False;-1;0;1;False;-1;0;False;-1;False;False;False;False;False;False;False;False;True;0;False;-1;True;True;True;True;True;0;False;-1;False;False;False;True;False;255;False;-1;255;False;-1;255;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;7;False;-1;1;False;-1;1;False;-1;1;False;-1;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;0;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0
|
|
Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;172;1442.579,-1523.725;Float;False;False;-1;2;UnityEditor.ShaderGraph.PBRMasterGUI;0;1;New Amplify Shader;94348b07e5e8bab40bd6c8a1e3df54cd;True;Universal2D;0;5;Universal2D;0;False;False;False;False;False;False;False;False;True;0;False;-1;True;0;False;-1;False;False;False;False;False;False;False;False;True;3;RenderPipeline=UniversalPipeline;RenderType=Opaque=RenderType;Queue=Geometry=Queue=0;True;0;0;True;1;1;False;-1;0;False;-1;1;1;False;-1;0;False;-1;False;False;False;False;False;False;False;False;False;True;True;True;True;True;0;False;-1;False;False;False;False;True;1;False;-1;True;3;False;-1;True;True;0;False;-1;0;False;-1;True;1;LightMode=Universal2D;False;0;Hidden/InternalErrorShader;0;0;Standard;0;False;0
|
|
WireConnection;176;0;174;0
|
|
WireConnection;176;1;173;0
|
|
WireConnection;180;0;179;0
|
|
WireConnection;180;1;178;0
|
|
WireConnection;180;2;177;0
|
|
WireConnection;180;3;175;0
|
|
WireConnection;180;5;176;0
|
|
WireConnection;181;0;179;0
|
|
WireConnection;182;0;180;0
|
|
WireConnection;183;0;179;0
|
|
WireConnection;1;1;182;0
|
|
WireConnection;1;3;181;0
|
|
WireConnection;1;4;183;0
|
|
WireConnection;2;1;182;0
|
|
WireConnection;2;3;181;0
|
|
WireConnection;2;4;183;0
|
|
WireConnection;163;0;161;0
|
|
WireConnection;163;1;2;3
|
|
WireConnection;185;0;1;0
|
|
WireConnection;185;1;184;0
|
|
WireConnection;164;0;160;0
|
|
WireConnection;164;1;2;2
|
|
WireConnection;30;1;13;0
|
|
WireConnection;30;2;2;3
|
|
WireConnection;29;1;10;0
|
|
WireConnection;29;2;2;2
|
|
WireConnection;31;1;15;0
|
|
WireConnection;31;2;2;4
|
|
WireConnection;165;0;159;0
|
|
WireConnection;165;1;2;1
|
|
WireConnection;162;0;158;0
|
|
WireConnection;162;1;2;4
|
|
WireConnection;28;1;8;0
|
|
WireConnection;28;2;2;1
|
|
WireConnection;130;0;28;0
|
|
WireConnection;130;1;29;0
|
|
WireConnection;130;2;30;0
|
|
WireConnection;130;3;31;0
|
|
WireConnection;186;0;1;0
|
|
WireConnection;186;1;185;0
|
|
WireConnection;186;2;2;1
|
|
WireConnection;166;0;165;0
|
|
WireConnection;166;1;164;0
|
|
WireConnection;166;2;163;0
|
|
WireConnection;166;3;162;0
|
|
WireConnection;152;0;2;4
|
|
WireConnection;152;1;150;0
|
|
WireConnection;138;0;2;1
|
|
WireConnection;138;1;134;0
|
|
WireConnection;153;0;152;0
|
|
WireConnection;153;1;151;0
|
|
WireConnection;141;0;2;2
|
|
WireConnection;141;1;139;0
|
|
WireConnection;147;0;2;3
|
|
WireConnection;147;1;145;0
|
|
WireConnection;154;0;144;0
|
|
WireConnection;154;1;149;0
|
|
WireConnection;77;1;182;0
|
|
WireConnection;77;3;181;0
|
|
WireConnection;77;4;183;0
|
|
WireConnection;3;0;8;0
|
|
WireConnection;3;1;2;1
|
|
WireConnection;12;0;13;0
|
|
WireConnection;12;1;2;3
|
|
WireConnection;11;0;10;0
|
|
WireConnection;11;1;2;2
|
|
WireConnection;142;0;141;0
|
|
WireConnection;142;1;140;0
|
|
WireConnection;144;0;133;0
|
|
WireConnection;144;1;142;0
|
|
WireConnection;149;0;153;0
|
|
WireConnection;149;1;148;0
|
|
WireConnection;133;0;138;0
|
|
WireConnection;133;1;135;0
|
|
WireConnection;132;0;186;0
|
|
WireConnection;132;1;130;0
|
|
WireConnection;132;2;166;0
|
|
WireConnection;75;1;182;0
|
|
WireConnection;117;0;79;0
|
|
WireConnection;117;1;77;0
|
|
WireConnection;156;0;75;0
|
|
WireConnection;157;1;156;0
|
|
WireConnection;157;3;181;0
|
|
WireConnection;157;4;183;0
|
|
WireConnection;148;0;147;0
|
|
WireConnection;148;1;146;0
|
|
WireConnection;14;0;15;0
|
|
WireConnection;14;1;2;4
|
|
WireConnection;168;0;132;0
|
|
WireConnection;168;1;75;0
|
|
WireConnection;168;2;154;0
|
|
WireConnection;168;3;157;0
|
|
WireConnection;168;4;117;0
|
|
ASEEND*/
|
|
//CHKSM=596172F9ED46E2D0E80E757F497DA3756630F977 |