This commit is contained in:
CortexCore
2025-03-14 21:04:19 +08:00
parent ff8670c453
commit 757ffe79ee
1282 changed files with 104378 additions and 3 deletions

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 1b7f70bc6291b94498722200b2fdde98
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 91c3ccd1cf53b074bba7fad1b82160e5
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,168 @@

Shader "Polaris/BuiltinRP/Demo/WaterBasic"
{
Properties
{
_Color("Color", Color) = (0.0, 0.8, 1.0, 0.5)
_Specular ("Specular Color", Color) = (0.1, 0.1, 0.1, 1)
_Smoothness("Smoothness", Range(0.0,1.0)) = 1
_DepthColor("Depth Color", Color) = (0.0, 0.45, 0.65, 0.85)
_MaxDepth("Max Depth", Float) = 5
_FoamColor("Foam Color", Color) = (1,1,1,1)
_FoamDistance("Foam Distance", Float) = 1.2
_FresnelStrength("Fresnel Strength", Range(0.0, 5.0)) = 1
_FresnelBias("Fresnel Bias", Range(0.0, 1.0)) = 0
}
SubShader
{
Tags{ "RenderType" = "Transparent" "Queue" = "Transparent+0" "IgnoreProjector" = "True" "ForceNoShadowCasting" = "True" }
CGPROGRAM
#include "UnityShaderVariables.cginc"
#include "UnityCG.cginc"
#pragma multi_compile_fog
#pragma surface surfBasic StandardSpecular alpha:fade keepalpha nolightmap vertex:vertexFunction finalcolor:finalColorFunction
struct Input
{
float4 vertexPos;
float3 worldPos;
float4 screenPos;
float3 normal;
float fogCoord;
};
uniform half4 _Color;
uniform half4 _Specular;
uniform half _Smoothness;
uniform half4 _DepthColor;
uniform half _MaxDepth;
uniform half4 _FoamColor;
uniform half _FoamDistance;
uniform half _FresnelStrength;
uniform half _FresnelBias;
UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture);
float4 _CameraDepthTexture_TexelSize;
float InverseLerpUnclamped(float a, float b, float value)
{
//adding a==b check if needed
return (value - a) / (b - a + 0.00000001);
}
half IsOrtho()
{
return unity_OrthoParams.w;
}
half GetNearPlane()
{
return _ProjectionParams.y;
}
half GetFarPlane()
{
return _ProjectionParams.z;
}
void CalculateScreenDepthEyeSpace(float4 vertexScreenPos, out float depth)
{
float4 screenPos = float4(vertexScreenPos.xyz, vertexScreenPos.w + 0.00000000001);
float depth01 = SAMPLE_DEPTH_TEXTURE_PROJ(_CameraDepthTexture, UNITY_PROJ_COORD(screenPos));
float perpsDepth = LinearEyeDepth(depth01);
#if defined(UNITY_REVERSED_Z)
depth01 = 1 - depth01;
#endif
float orthoDepth = lerp(GetNearPlane(), GetFarPlane(), depth01);
depth = lerp(perpsDepth, orthoDepth, IsOrtho());
}
void CalculateSurfaceDepthEyeSpace(float4 vertexPos, out float depth)
{
depth = -UnityObjectToViewPos(vertexPos.xyz).z;
}
void CalculateDeepWaterColor(float4 vertexScreenPos, float4 vertexPos, float4 color, float4 depthColor, float maxDepth, out float4 waterColor)
{
float screenDepth;
float surfaceDepth;
CalculateScreenDepthEyeSpace(vertexScreenPos, screenDepth);
CalculateSurfaceDepthEyeSpace(vertexPos, surfaceDepth);
float waterDepth = screenDepth - surfaceDepth;
float depthFade = saturate(InverseLerpUnclamped(0, maxDepth, waterDepth));
waterColor = lerp(color, depthColor, depthFade);
}
void CalculateFresnelFactor(float3 worldPos, float3 worldNormal, float power, float bias, out float fresnel)
{
float3 worldViewDir = normalize(_WorldSpaceCameraPos.xyz - worldPos);
float vDotN = dot(worldViewDir, worldNormal);
fresnel = saturate(pow(max(0, 1 - vDotN), power)) - bias;
}
void CalculateFoamColor(float4 vertexScreenPos, float4 vertexPos, float4 tint, float foamDistance, out float4 foamColor)
{
float screenDepth;
float surfaceDepth;
CalculateScreenDepthEyeSpace(vertexScreenPos, screenDepth);
CalculateSurfaceDepthEyeSpace(vertexPos, surfaceDepth);
float waterDepth = screenDepth - surfaceDepth;
float depthClip = waterDepth <= foamDistance;
foamColor = depthClip*tint;
}
void vertexFunction(inout appdata_full v, out Input o)
{
UNITY_INITIALIZE_OUTPUT(Input, o);
o.vertexPos = v.vertex;
o.normal = v.normal;
UNITY_TRANSFER_FOG(o, UnityObjectToClipPos(v.vertex));
}
void surfBasic(Input i, inout SurfaceOutputStandardSpecular o)
{
float3 worldNormal = UnityObjectToWorldNormal(i.normal);
float fresnel;
CalculateFresnelFactor(i.worldPos, worldNormal, _FresnelStrength, _FresnelBias, fresnel);
float4 tintColor = _Color;
CalculateDeepWaterColor(i.screenPos, i.vertexPos, _Color, _DepthColor, _MaxDepth, tintColor);
float4 waterColor = lerp(_Color, tintColor, fresnel);
waterColor = saturate(waterColor);
o.Albedo = waterColor.rgb;
o.Specular = _Specular;
o.Alpha = waterColor.a;
o.Smoothness = _Smoothness;
}
void finalColorFunction(Input i, SurfaceOutputStandardSpecular o, inout fixed4 color)
{
float4 foamColor = float4(0,0,0,0);
CalculateFoamColor(i.screenPos, i.vertexPos, _FoamColor, _FoamDistance, foamColor);
color = lerp(color, foamColor, foamColor.a);
UNITY_APPLY_FOG(i.fogCoord, color); // apply fog
}
ENDCG
}
Fallback "Diffuse"
}

View File

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

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 8e9a97868f1ca0d4ab56bf5dbbdf5c97
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,113 @@
// Made with Amplify Shader Editor
// Available at the Unity Asset Store - http://u3d.as/y3X
Shader "Polaris/BuiltinRP/Foliage/Grass"
{
Properties
{
_Cutoff( "Mask Clip Value", Float ) = 0
_Color("Color", Color) = (1,1,1,1)
_NoiseTex("_NoiseTex", 2D) = "white" {}
_MainTex("MainTex", 2D) = "white" {}
_Occlusion("Occlusion", Range( 0 , 1)) = 0.2
[HideInInspector]_BendFactor("Bend Factor", Float) = 1
_WaveDistance("Wave Distance", Float) = 0.1
_Wind("Wind", Vector) = (1,1,4,8)
_FadeMinDistance("Fade Min Distance", Float) = 50
_FadeMaxDistance("Fade Max Distance", Float) = 100
[HideInInspector] _texcoord( "", 2D ) = "white" {}
[HideInInspector] __dirty( "", Int ) = 1
}
SubShader
{
Tags{ "RenderType" = "Opaque" "Queue" = "AlphaTest+0" "IgnoreProjector" = "True" "DisableBatching" = "True" }
Cull Off
CGPROGRAM
#include "UnityShaderVariables.cginc"
#pragma target 2.0
#pragma multi_compile_instancing
#pragma instancing_options nolodfade nolightmap
#pragma surface surf Lambert keepalpha addshadow fullforwardshadows vertex:vertexDataFunc
struct Input
{
float2 uv_texcoord;
};
uniform half _FadeMaxDistance;
uniform half _FadeMinDistance;
uniform sampler2D _NoiseTex;
uniform float4 _Wind;
uniform float _Occlusion;
uniform float _WaveDistance;
uniform float _BendFactor;
uniform float4 _Color;
uniform sampler2D _MainTex;
uniform float4 _MainTex_ST;
uniform float _Cutoff = 0;
void vertexDataFunc( inout appdata_full v, out Input o )
{
UNITY_INITIALIZE_OUTPUT( Input, o );
float3 ase_vertex3Pos = v.vertex.xyz;
half3 objToView2_g24 = mul( UNITY_MATRIX_MV, float4( ase_vertex3Pos, 1 ) ).xyz;
half _FadeMaxDistance67_g22 = _FadeMaxDistance;
half temp_output_1_0_g25 = _FadeMaxDistance67_g22;
half _FadeMinDistance65_g22 = _FadeMinDistance;
half clampResult7_g24 = clamp( ( ( -objToView2_g24.z - temp_output_1_0_g25 ) / ( _FadeMinDistance65_g22 - temp_output_1_0_g25 ) ) , 0.0 , 1.0 );
float4 _VertexPos3_g23 = half4( ( clampResult7_g24 * ase_vertex3Pos ) , 0.0 );
half3 objToWorld64_g23 = mul( unity_ObjectToWorld, float4( _VertexPos3_g23.xyz, 1 ) ).xyz;
half2 appendResult22_g23 = (half2(objToWorld64_g23.x , objToWorld64_g23.z));
float2 worldPosXZ21_g23 = appendResult22_g23;
float _WindDirX25_g22 = _Wind.x;
float _WindDirX5_g23 = _WindDirX25_g22;
float _Occlusion12_g22 = _Occlusion;
float _WindDirY7_g23 = _Occlusion12_g22;
half2 appendResult19_g23 = (half2(_WindDirX5_g23 , _WindDirY7_g23));
float _WindSpeed33_g22 = _Wind.z;
float _WindSpeed9_g23 = _WindSpeed33_g22;
float _WindSpread31_g22 = _Wind.w;
float _WindSpread10_g23 = _WindSpread31_g22;
float2 noisePos32_g23 = ( ( worldPosXZ21_g23 - ( appendResult19_g23 * _WindSpeed9_g23 * _Time.y ) ) / _WindSpread10_g23 );
half temp_output_35_0_g23 = ( tex2Dlod( _NoiseTex, float4( noisePos32_g23, 0, 0.0) ).r * v.texcoord.xy.y );
float _WaveDistance34_g22 = _WaveDistance;
float _WaveDistance12_g23 = _WaveDistance34_g22;
float _BendFactor27_g22 = _BendFactor;
float _BendFactor38_g23 = _BendFactor27_g22;
half4 appendResult42_g23 = (half4(_WindDirX5_g23 , ( temp_output_35_0_g23 * 0.5 ) , _WindDirY7_g23 , 0.0));
half4 transform47_g23 = mul(unity_WorldToObject,( temp_output_35_0_g23 * _WaveDistance12_g23 * _BendFactor38_g23 * appendResult42_g23 ));
half4 _NewVertexPosition63_g23 = ( _VertexPos3_g23 + transform47_g23 );
float4 vertexPosition48_g22 = _NewVertexPosition63_g23;
v.vertex.xyz = vertexPosition48_g22.xyz;
float3 vertexNormal49_g22 = float3(0,1,0);
v.normal = vertexNormal49_g22;
}
void surf( Input i , inout SurfaceOutput o )
{
float4 _Color22_g22 = _Color;
float2 uv0_MainTex = i.uv_texcoord * _MainTex_ST.xy + _MainTex_ST.zw;
half4 temp_output_37_0_g22 = ( _Color22_g22 * tex2D( _MainTex, uv0_MainTex ) );
float _Occlusion12_g22 = _Occlusion;
half lerpResult29_g22 = lerp( 0.0 , _Occlusion12_g22 , ( ( 1.0 - i.uv_texcoord.y ) * ( 1.0 - i.uv_texcoord.y ) ));
float4 albedoColor50_g22 = ( temp_output_37_0_g22 - half4( ( 0.5 * float3(1,1,1) * lerpResult29_g22 ) , 0.0 ) );
o.Albedo = albedoColor50_g22.rgb;
o.Alpha = 1;
float alpha47_g22 = temp_output_37_0_g22.a;
clip( alpha47_g22 - _Cutoff );
}
ENDCG
}
Fallback "Diffuse"
}
/*ASEBEGIN
Version=18000
835;319;1906;879;1054.042;176.5205;1;True;False
Node;AmplifyShaderEditor.FunctionNode;104;-432,128;Inherit;False;GrassBaseGraph;1;;22;ad52558deb80624468aa023b05a9535b;0;0;4;COLOR;0;FLOAT;54;FLOAT4;56;FLOAT3;58
Node;AmplifyShaderEditor.StandardSurfaceOutputNode;76;0,0;Half;False;True;-1;0;;0;0;Lambert;Polaris/BuiltinRP/Foliage/Grass;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;False;True;False;False;False;True;Off;0;False;-1;0;False;-1;False;0;False;-1;0;False;-1;False;0;Custom;0;True;True;0;True;Opaque;;AlphaTest;All;14;all;True;True;True;True;0;False;-1;False;0;False;-1;255;False;-1;255;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;False;2;15;10;25;False;0.5;True;0;0;False;-1;0;False;-1;0;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;0;0,0,0,0;VertexOffset;True;False;Cylindrical;True;Absolute;0;;0;-1;-1;-1;0;False;0;0;False;-1;-1;0;False;-1;0;0;0;False;0.1;False;-1;0;False;-1;15;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;2;FLOAT3;0,0,0;False;3;FLOAT;0;False;4;FLOAT;0;False;6;FLOAT3;0,0,0;False;7;FLOAT3;0,0,0;False;8;FLOAT;0;False;9;FLOAT;0;False;10;FLOAT;0;False;13;FLOAT3;0,0,0;False;11;FLOAT3;0,0,0;False;12;FLOAT3;0,0,0;False;14;FLOAT4;0,0,0,0;False;15;FLOAT3;0,0,0;False;0
WireConnection;76;0;104;0
WireConnection;76;10;104;54
WireConnection;76;11;104;56
WireConnection;76;12;104;58
ASEEND*/
//CHKSM=200553EEED5E127828E7B77C2F29D6E2DACF95F2

View File

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

View File

@@ -0,0 +1,126 @@
// Made with Amplify Shader Editor
// Available at the Unity Asset Store - http://u3d.as/y3X
Shader "Polaris/BuiltinRP/Foliage/GrassBillboard"
{
Properties
{
_Cutoff( "Mask Clip Value", Float ) = 0
_Color("Color", Color) = (1,1,1,1)
_NoiseTex("_NoiseTex", 2D) = "white" {}
_MainTex("MainTex", 2D) = "white" {}
_Occlusion("Occlusion", Range( 0 , 1)) = 0.2
[HideInInspector]_BendFactor("Bend Factor", Float) = 1
_WaveDistance("Wave Distance", Float) = 0.1
_Wind("Wind", Vector) = (1,1,4,8)
_FadeMinDistance("Fade Min Distance", Float) = 50
_FadeMaxDistance("Fade Max Distance", Float) = 100
[HideInInspector] _texcoord( "", 2D ) = "white" {}
[HideInInspector] __dirty( "", Int ) = 1
}
SubShader
{
Tags{ "RenderType" = "Opaque" "Queue" = "AlphaTest+0" "IgnoreProjector" = "True" "DisableBatching" = "True" }
Cull Off
CGPROGRAM
#include "UnityShaderVariables.cginc"
#pragma target 3.0
#pragma multi_compile_instancing
#pragma instancing_options nolodfade nolightmap
#pragma surface surf Lambert keepalpha addshadow fullforwardshadows vertex:vertexDataFunc
struct Input
{
float2 uv_texcoord;
};
uniform half _FadeMaxDistance;
uniform half _FadeMinDistance;
uniform sampler2D _NoiseTex;
uniform float4 _Wind;
uniform float _Occlusion;
uniform float _WaveDistance;
uniform float _BendFactor;
uniform float4 _Color;
uniform sampler2D _MainTex;
uniform float4 _MainTex_ST;
uniform float _Cutoff = 0;
void vertexDataFunc( inout appdata_full v, out Input o )
{
UNITY_INITIALIZE_OUTPUT( Input, o );
float3 ase_vertex3Pos = v.vertex.xyz;
half3 objToView2_g20 = mul( UNITY_MATRIX_MV, float4( ase_vertex3Pos, 1 ) ).xyz;
half _FadeMaxDistance67_g18 = _FadeMaxDistance;
half temp_output_1_0_g21 = _FadeMaxDistance67_g18;
half _FadeMinDistance65_g18 = _FadeMinDistance;
half clampResult7_g20 = clamp( ( ( -objToView2_g20.z - temp_output_1_0_g21 ) / ( _FadeMinDistance65_g18 - temp_output_1_0_g21 ) ) , 0.0 , 1.0 );
float4 _VertexPos3_g19 = half4( ( clampResult7_g20 * ase_vertex3Pos ) , 0.0 );
half3 objToWorld64_g19 = mul( unity_ObjectToWorld, float4( _VertexPos3_g19.xyz, 1 ) ).xyz;
half2 appendResult22_g19 = (half2(objToWorld64_g19.x , objToWorld64_g19.z));
float2 worldPosXZ21_g19 = appendResult22_g19;
float _WindDirX25_g18 = _Wind.x;
float _WindDirX5_g19 = _WindDirX25_g18;
float _Occlusion12_g18 = _Occlusion;
float _WindDirY7_g19 = _Occlusion12_g18;
half2 appendResult19_g19 = (half2(_WindDirX5_g19 , _WindDirY7_g19));
float _WindSpeed33_g18 = _Wind.z;
float _WindSpeed9_g19 = _WindSpeed33_g18;
float _WindSpread31_g18 = _Wind.w;
float _WindSpread10_g19 = _WindSpread31_g18;
float2 noisePos32_g19 = ( ( worldPosXZ21_g19 - ( appendResult19_g19 * _WindSpeed9_g19 * _Time.y ) ) / _WindSpread10_g19 );
half temp_output_35_0_g19 = ( tex2Dlod( _NoiseTex, float4( noisePos32_g19, 0, 0.0) ).r * v.texcoord.xy.y );
float _WaveDistance34_g18 = _WaveDistance;
float _WaveDistance12_g19 = _WaveDistance34_g18;
float _BendFactor27_g18 = _BendFactor;
float _BendFactor38_g19 = _BendFactor27_g18;
half4 appendResult42_g19 = (half4(_WindDirX5_g19 , ( temp_output_35_0_g19 * 0.5 ) , _WindDirY7_g19 , 0.0));
half4 transform47_g19 = mul(unity_WorldToObject,( temp_output_35_0_g19 * _WaveDistance12_g19 * _BendFactor38_g19 * appendResult42_g19 ));
half4 _NewVertexPosition63_g19 = ( _VertexPos3_g19 + transform47_g19 );
float4 vertexPosition48_g18 = _NewVertexPosition63_g19;
v.vertex.xyz = vertexPosition48_g18.xyz;
float3 vertexNormal49_g18 = float3(0,1,0);
v.normal = vertexNormal49_g18;
//Calculate new billboard vertex position and normal;
float3 upCamVec = float3( 0, 1, 0 );
float3 forwardCamVec = -normalize ( UNITY_MATRIX_V._m20_m21_m22 );
float3 rightCamVec = normalize( UNITY_MATRIX_V._m00_m01_m02 );
float4x4 rotationCamMatrix = float4x4( rightCamVec, 0, upCamVec, 0, forwardCamVec, 0, 0, 0, 0, 1 );
v.normal = normalize( mul( float4( v.normal , 0 ), rotationCamMatrix )).xyz;
v.vertex.x *= length( unity_ObjectToWorld._m00_m10_m20 );
v.vertex.y *= length( unity_ObjectToWorld._m01_m11_m21 );
v.vertex.z *= length( unity_ObjectToWorld._m02_m12_m22 );
v.vertex = mul( v.vertex, rotationCamMatrix );
v.vertex.xyz += unity_ObjectToWorld._m03_m13_m23;
//Need to nullify rotation inserted by generated surface shader;
v.vertex = mul( unity_WorldToObject, v.vertex );
}
void surf( Input i , inout SurfaceOutput o )
{
float4 _Color22_g18 = _Color;
float2 uv0_MainTex = i.uv_texcoord * _MainTex_ST.xy + _MainTex_ST.zw;
half4 temp_output_37_0_g18 = ( _Color22_g18 * tex2D( _MainTex, uv0_MainTex ) );
float _Occlusion12_g18 = _Occlusion;
half lerpResult29_g18 = lerp( 0.0 , _Occlusion12_g18 , ( ( 1.0 - i.uv_texcoord.y ) * ( 1.0 - i.uv_texcoord.y ) ));
float4 albedoColor50_g18 = ( temp_output_37_0_g18 - half4( ( 0.5 * float3(1,1,1) * lerpResult29_g18 ) , 0.0 ) );
o.Albedo = albedoColor50_g18.rgb;
o.Alpha = 1;
float alpha47_g18 = temp_output_37_0_g18.a;
clip( alpha47_g18 - _Cutoff );
}
ENDCG
}
Fallback "Diffuse"
}
/*ASEBEGIN
Version=18000
1534;339;1906;879;1136.054;189.9912;1;True;False
Node;AmplifyShaderEditor.FunctionNode;93;-353.3602,109.1532;Inherit;False;GrassBaseGraph;1;;18;ad52558deb80624468aa023b05a9535b;0;0;4;COLOR;0;FLOAT;54;FLOAT4;56;FLOAT3;58
Node;AmplifyShaderEditor.StandardSurfaceOutputNode;76;0,0;Half;False;True;-1;2;;0;0;Lambert;Polaris/BuiltinRP/Foliage/GrassBillboard;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;False;True;False;False;False;True;Off;0;False;-1;0;False;-1;False;0;False;-1;0;False;-1;False;0;Custom;0;True;True;0;True;Opaque;;AlphaTest;All;14;all;True;True;True;True;0;False;-1;False;0;False;-1;255;False;-1;255;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;False;2;15;10;25;False;0.5;True;0;0;False;-1;0;False;-1;0;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;0;0,0,0,0;VertexOffset;True;True;Cylindrical;True;Absolute;0;;0;-1;-1;-1;0;False;0;0;False;-1;-1;0;False;-1;0;0;0;False;0.1;False;-1;0;False;-1;15;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;2;FLOAT3;0,0,0;False;3;FLOAT;0;False;4;FLOAT;0;False;6;FLOAT3;0,0,0;False;7;FLOAT3;0,0,0;False;8;FLOAT;0;False;9;FLOAT;0;False;10;FLOAT;0;False;13;FLOAT3;0,0,0;False;11;FLOAT3;0,0,0;False;12;FLOAT3;0,0,0;False;14;FLOAT4;0,0,0,0;False;15;FLOAT3;0,0,0;False;0
WireConnection;76;0;93;0
WireConnection;76;10;93;54
WireConnection;76;11;93;56
WireConnection;76;12;93;58
ASEEND*/
//CHKSM=39D12AD88416EDC0F0B9B06CEB85EC8A44AF8D2B

View File

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

View File

@@ -0,0 +1,248 @@
// Made with Amplify Shader Editor
// Available at the Unity Asset Store - http://u3d.as/y3X
Shader "Polaris/BuiltinRP/Foliage/GrassInteractive"
{
Properties
{
_NoiseTex("_NoiseTex", 2D) = "white" {}
_Color("Color", Color) = (1,1,1,1)
_MainTex("MainTex", 2D) = "white" {}
_Occlusion("Occlusion", Range( 0 , 1)) = 0.2
_AlphaCutoff("Alpha Cutoff", Range( 0 , 1)) = 0.5
[HideInInspector]_BendFactor("BendFactor", Float) = 1
_WaveDistance("Wave Distance", Float) = 0.1
_Wind("Wind", Vector) = (1,1,4,8)
_VectorField("VectorField", 2D) = "gray" {}
_FadeMinDistance("FadeMinDistance", Float) = 50
_FadeMaxDistance("FadeMaxDistance", Float) = 100
[HideInInspector] _texcoord( "", 2D ) = "white" {}
[HideInInspector] __dirty( "", Int ) = 1
}
SubShader
{
Tags{ "RenderType" = "Opaque" "Queue" = "AlphaTest+0" "IgnoreProjector" = "True" "DisableBatching" = "True" }
Cull Off
CGPROGRAM
#include "UnityShaderVariables.cginc"
#pragma target 3.0
#pragma multi_compile_instancing
#pragma instancing_options nolodfade nolightmap
#pragma surface surf Lambert keepalpha addshadow fullforwardshadows vertex:vertexDataFunc
struct Input
{
float2 uv_texcoord;
};
uniform sampler2D _VectorField;
uniform float4x4 _WorldToNormalized;
uniform float _FadeMaxDistance;
uniform float _FadeMinDistance;
uniform float _BendFactor;
uniform sampler2D _NoiseTex;
SamplerState sampler_NoiseTex;
uniform float4 _Wind;
uniform float _WaveDistance;
uniform float4 _Color;
uniform sampler2D _MainTex;
uniform float4 _MainTex_ST;
uniform float _Occlusion;
uniform float _AlphaCutoff;
void vertexDataFunc( inout appdata_full v, out Input o )
{
UNITY_INITIALIZE_OUTPUT( Input, o );
float4x4 myLocalVar55_g2 = _WorldToNormalized;
float4x4 _WorldToNormalized8_g2 = myLocalVar55_g2;
float3 ase_vertex3Pos = v.vertex.xyz;
float3 objToView2_g18 = mul( UNITY_MATRIX_MV, float4( ase_vertex3Pos, 1 ) ).xyz;
float _FadeMaxDistance118 = _FadeMaxDistance;
float temp_output_1_0_g19 = _FadeMaxDistance118;
float _FadeMinDistance117 = _FadeMinDistance;
float clampResult7_g18 = clamp( ( ( -objToView2_g18.z - temp_output_1_0_g19 ) / ( _FadeMinDistance117 - temp_output_1_0_g19 ) ) , 0.0 , 1.0 );
float4 _VertexPos3_g2 = float4( ( clampResult7_g18 * ase_vertex3Pos ) , 0.0 );
float4 break68_g2 = _VertexPos3_g2;
float4 appendResult69_g2 = (float4(break68_g2.x , break68_g2.y , break68_g2.z , 1.0));
float4 break28_g2 = mul( _WorldToNormalized8_g2, mul( unity_ObjectToWorld, appendResult69_g2 ) );
float4 appendResult29_g2 = (float4(break28_g2.x , break28_g2.z , 0.0 , 0.0));
float4 vectorFieldUV30_g2 = appendResult29_g2;
float4 bendVector33_g2 = tex2Dlod( _VectorField, float4( vectorFieldUV30_g2.xy, 0, 0.0) );
float4 break36_g2 = bendVector33_g2;
float4 appendResult43_g2 = (float4(( ( break36_g2.r * 2.0 ) - 1.0 ) , ( ( break36_g2.g * 2.0 ) - 1.0 ) , ( ( break36_g2.b * 2.0 ) - 1.0 ) , 0.0));
float4 remappedBendVector44_g2 = appendResult43_g2;
float _BendFactor71 = _BendFactor;
float _BendFactor51_g2 = _BendFactor71;
float4 newVertexPosition52_g2 = ( ( remappedBendVector44_g2 * v.texcoord.xy.y * _BendFactor51_g2 ) + _VertexPos3_g2 );
float4 _VertexPos3_g32 = newVertexPosition52_g2;
float3 objToWorld64_g32 = mul( unity_ObjectToWorld, float4( _VertexPos3_g32.xyz, 1 ) ).xyz;
float2 appendResult22_g32 = (float2(objToWorld64_g32.x , objToWorld64_g32.z));
float2 worldPosXZ21_g32 = appendResult22_g32;
float _WindDirX11 = _Wind.x;
float _WindDirX5_g32 = _WindDirX11;
float _WindDirY12 = _Wind.y;
float _WindDirY7_g32 = _WindDirY12;
float2 appendResult19_g32 = (float2(_WindDirX5_g32 , _WindDirY7_g32));
float _WindSpeed13 = _Wind.z;
float _WindSpeed9_g32 = _WindSpeed13;
float _WindSpread14 = _Wind.w;
float _WindSpread10_g32 = _WindSpread14;
float2 noisePos32_g32 = ( ( worldPosXZ21_g32 - ( appendResult19_g32 * _WindSpeed9_g32 * _Time.y ) ) / _WindSpread10_g32 );
float temp_output_35_0_g32 = ( tex2Dlod( _NoiseTex, float4( noisePos32_g32, 0, 0.0) ).r * v.texcoord.xy.y );
float _WaveDistance9 = _WaveDistance;
float _WaveDistance12_g32 = _WaveDistance9;
float _BendFactor38_g32 = _BendFactor71;
float4 appendResult42_g32 = (float4(_WindDirX5_g32 , ( temp_output_35_0_g32 * 0.5 ) , _WindDirY7_g32 , 0.0));
float4 transform47_g32 = mul(unity_WorldToObject,( temp_output_35_0_g32 * _WaveDistance12_g32 * _BendFactor38_g32 * appendResult42_g32 ));
float4 _NewVertexPosition63_g32 = ( _VertexPos3_g32 + transform47_g32 );
float4 finalVertexPosition83 = _NewVertexPosition63_g32;
v.vertex.xyz = finalVertexPosition83.xyz;
float3 vertexNormal55 = float3(0,1,0);
v.normal = vertexNormal55;
}
void surf( Input i , inout SurfaceOutput o )
{
float4 _Color5 = _Color;
float2 uv_MainTex = i.uv_texcoord * _MainTex_ST.xy + _MainTex_ST.zw;
float4 temp_output_24_0 = ( _Color5 * tex2D( _MainTex, uv_MainTex ) );
float _Occlusion18 = _Occlusion;
float lerpResult33 = lerp( 0.0 , _Occlusion18 , ( ( 1.0 - i.uv_texcoord.y ) * ( 1.0 - i.uv_texcoord.y ) ));
float4 albedoColor40 = ( temp_output_24_0 - float4( ( 0.5 * float3(1,1,1) * lerpResult33 ) , 0.0 ) );
o.Albedo = albedoColor40.rgb;
float alpha45 = temp_output_24_0.a;
float temp_output_46_0 = alpha45;
o.Alpha = temp_output_46_0;
clip( temp_output_46_0 - _AlphaCutoff );
}
ENDCG
}
Fallback "Diffuse"
CustomEditor "ASEMaterialInspector"
}
/*ASEBEGIN
Version=18400
1631;73;1531;1286;2861.304;-1253.962;1.168632;True;False
Node;AmplifyShaderEditor.CommentaryNode;41;-3517.229,-256.6267;Inherit;False;1899.109;1469.351;;6;40;39;37;38;44;45;Albedo;1,1,1,1;0;0
Node;AmplifyShaderEditor.CommentaryNode;19;-2343.704,-2056.074;Inherit;False;681.3742;1685.453;;23;15;16;5;4;18;17;7;6;12;9;13;81;11;71;14;10;80;70;8;115;116;117;118;Properties;1,1,1,1;0;0
Node;AmplifyShaderEditor.CommentaryNode;37;-3415.318,290.2566;Inherit;False;1270.362;876.2831;;7;35;34;33;30;32;31;36;Occlusion;1,1,1,1;0;0
Node;AmplifyShaderEditor.TexturePropertyNode;6;-2216.348,-1819.075;Float;True;Property;_MainTex;MainTex;3;0;Create;True;0;0;False;0;False;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;2;SAMPLER2D;0;SAMPLERSTATE;1
Node;AmplifyShaderEditor.CommentaryNode;36;-3395.857,845.9573;Inherit;False;711;293;;4;26;27;28;29;Occlusion factor;1,1,1,1;0;0
Node;AmplifyShaderEditor.RangedFloatNode;17;-2289.935,-799.0703;Float;False;Property;_Occlusion;Occlusion;4;0;Create;True;0;0;False;0;False;0.2;0.2;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.TextureCoordinatesNode;26;-3345.857,910.957;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.CommentaryNode;38;-3109.156,-135.5909;Inherit;False;957;392;;5;21;22;23;25;24;Color;1,1,1,1;0;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;7;-1910.346,-1818.075;Float;False;_MainTex;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RangedFloatNode;116;-2220.509,-489.8274;Inherit;False;Property;_FadeMaxDistance;FadeMaxDistance;11;0;Create;True;0;0;False;0;False;100;0;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;115;-2220.509,-589.8274;Inherit;False;Property;_FadeMinDistance;FadeMinDistance;10;0;Create;True;0;0;False;0;False;50;0;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.OneMinusNode;27;-3060.857,895.9569;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;117;-1928.509,-591.8274;Inherit;False;_FadeMinDistance;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;70;-2179.777,-697.3823;Float;False;Property;_BendFactor;BendFactor;6;1;[HideInInspector];Create;True;0;0;False;0;False;1;0;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.OneMinusNode;28;-3065.857,1028.956;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;118;-1922.509,-487.8274;Inherit;False;_FadeMaxDistance;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.CommentaryNode;75;-2991.674,1324.012;Inherit;False;1411.137;1925.975;;13;55;54;83;79;82;120;121;68;66;65;64;63;72;Vertex Animation, Normal;1,1,1,1;0;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;18;-1912.209,-796.5604;Float;False;_Occlusion;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.ColorNode;4;-2200.348,-2005.074;Float;False;Property;_Color;Color;2;0;Create;True;0;0;False;0;False;1,1,1,1;1,1,1,1;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.TexturePropertyNode;80;-2218.335,-1608.123;Float;True;Property;_VectorField;VectorField;9;0;Create;True;0;0;False;0;False;None;None;False;gray;LockedToTexture2D;Texture2D;-1;0;2;SAMPLER2D;0;SAMPLERSTATE;1
Node;AmplifyShaderEditor.GetLocalVarNode;22;-3011.407,8.565916;Inherit;False;7;_MainTex;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;81;-1906.155,-1606.096;Float;False;_VectorField;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;120;-2884.402,1597.212;Inherit;False;118;_FadeMaxDistance;1;0;OBJECT;;False;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;8;-2194.579,-1353.997;Float;False;Property;_WaveDistance;Wave Distance;7;0;Create;True;0;0;False;0;False;0.1;0.2;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.Vector4Node;10;-2195.579,-1252.998;Float;False;Property;_Wind;Wind;8;0;Create;True;0;0;False;0;False;1,1,4,8;1,1,7,7;0;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.GetLocalVarNode;119;-2888.422,1492.67;Inherit;False;117;_FadeMinDistance;1;0;OBJECT;;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;5;-1911.346,-2006.074;Float;False;_Color;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.TextureCoordinatesNode;23;-3059.156,100.409;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.SimpleMultiplyOpNode;29;-2853.856,953.9564;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;35;-2931.117,686.2404;Inherit;False;18;_Occlusion;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;34;-2847.918,578.3406;Float;False;Constant;_Float1;Float 1;6;0;Create;True;0;0;False;0;False;0;0;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;71;-1919.776,-693.3823;Float;False;_BendFactor;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;14;-1910.577,-1008;Float;False;_WindSpread;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.LerpOp;33;-2645.116,634.2404;Inherit;False;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;13;-1908.577,-1089;Float;False;_WindSpeed;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;9;-1907.577,-1352.997;Float;False;_WaveDistance;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;11;-1908.577,-1245.998;Float;False;_WindDirX;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;25;-2606.156,-85.59092;Inherit;False;5;_Color;1;0;OBJECT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.SamplerNode;21;-2705.05,8.684111;Inherit;True;Property;_TextureSample0;Texture Sample 0;6;0;Create;True;0;0;False;0;False;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.Vector3Node;32;-2659.255,452.257;Float;False;Constant;_Vector1;Vector 1;6;0;Create;True;0;0;False;0;False;1,1,1;0,0,0;0;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
Node;AmplifyShaderEditor.GetLocalVarNode;82;-2874.532,1828.327;Inherit;False;71;_BendFactor;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;79;-2877.412,1735.809;Inherit;False;81;_VectorField;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;12;-1908.577,-1170.999;Float;False;_WindDirY;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;31;-2634.255,340.2565;Float;False;Constant;_Float0;Float 0;6;0;Create;True;0;0;False;0;False;0.5;0;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.FunctionNode;121;-2629.597,1526.365;Inherit;False;GrassFade;-1;;18;cbea1fee1a4ae92478317361ce0d3b0b;0;2;4;FLOAT;50;False;5;FLOAT;100;False;1;FLOAT3;0
Node;AmplifyShaderEditor.GetLocalVarNode;66;-2880.345,2203.931;Inherit;False;14;_WindSpread;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;72;-2872.56,2378.925;Inherit;False;71;_BendFactor;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;63;-2869.945,1949.457;Inherit;False;11;_WindDirX;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;64;-2866.345,2029.931;Inherit;False;12;_WindDirY;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.FunctionNode;176;-2292.423,1756.451;Inherit;False;GrassTouchBending;12;;2;de9a62c6bacea6b4888ce2cdd0a3d3f8;0;3;2;FLOAT4;0,0,0,0;False;4;SAMPLER2D;;False;50;FLOAT;1;False;1;FLOAT4;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;24;-2321.157,-8.590945;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;30;-2289.256,500.2567;Inherit;False;3;3;0;FLOAT;0;False;1;FLOAT3;0,0,0;False;2;FLOAT;0;False;1;FLOAT3;0
Node;AmplifyShaderEditor.GetLocalVarNode;68;-2889.345,2289.931;Inherit;False;9;_WaveDistance;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;65;-2876.345,2108.931;Inherit;False;13;_WindSpeed;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.BreakToComponentsNode;44;-2110.054,-11.27011;Inherit;False;COLOR;1;0;COLOR;0,0,0,0;False;16;FLOAT;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4;FLOAT;5;FLOAT;6;FLOAT;7;FLOAT;8;FLOAT;9;FLOAT;10;FLOAT;11;FLOAT;12;FLOAT;13;FLOAT;14;FLOAT;15
Node;AmplifyShaderEditor.FunctionNode;144;-2306.832,1982.287;Inherit;True;GrassWindAnimation;0;;32;8d39a13fc2a7a164fa1708057ff071d3;0;7;1;FLOAT4;0,0,0,0;False;51;FLOAT;1;False;52;FLOAT;1;False;53;FLOAT;7;False;54;FLOAT;7;False;55;FLOAT;0.2;False;56;FLOAT;1;False;1;FLOAT4;0
Node;AmplifyShaderEditor.Vector3Node;54;-2038.875,1502.98;Float;False;Constant;_Up;Up;7;0;Create;True;0;0;False;0;False;0,1,0;0,0,0;0;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
Node;AmplifyShaderEditor.SimpleSubtractOpNode;39;-2025.438,246.9899;Inherit;False;2;0;COLOR;0,0,0,0;False;1;FLOAT3;0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;40;-1847.459,246.99;Float;False;albedoColor;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;55;-1818.502,1502.283;Float;False;vertexNormal;-1;True;1;0;FLOAT3;0,0,0;False;1;FLOAT3;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;45;-1844.054,53.72989;Float;False;alpha;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;83;-1873.551,1999.116;Float;False;finalVertexPosition;-1;True;1;0;FLOAT4;0,0,0,0;False;1;FLOAT4;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;16;-1910.955,-900.7172;Float;False;_AlphaCutoff;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;15;-2289.935,-901.9721;Float;False;Property;_AlphaCutoff;Alpha Cutoff;5;0;Create;True;0;0;False;0;False;0.5;0.5;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;46;-342.2595,180.5466;Inherit;False;45;alpha;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;59;-373.3654,450.1091;Inherit;False;55;vertexNormal;1;0;OBJECT;0;False;1;FLOAT3;0
Node;AmplifyShaderEditor.GetLocalVarNode;73;-371.1169,354.3228;Inherit;False;83;finalVertexPosition;1;0;OBJECT;0;False;1;FLOAT4;0
Node;AmplifyShaderEditor.GetLocalVarNode;42;-367.3995,-0.407074;Inherit;False;40;albedoColor;1;0;OBJECT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.StandardSurfaceOutputNode;110;0,0;Float;False;True;-1;2;ASEMaterialInspector;0;0;Lambert;Polaris/BuiltinRP/Foliage/GrassInteractive;False;False;False;False;False;False;False;False;False;False;False;False;False;True;True;False;True;False;False;False;True;Off;0;False;-1;0;False;-1;False;0;False;-1;0;False;-1;False;0;Custom;0.5;True;True;0;True;Opaque;;AlphaTest;All;14;all;True;True;True;True;0;False;-1;False;0;False;-1;255;False;-1;255;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;False;2;15;10;25;False;0.5;True;0;0;False;-1;0;False;-1;0;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;0;0,0,0,0;VertexOffset;True;False;Cylindrical;False;Absolute;0;;-1;-1;-1;-1;0;False;0;0;False;-1;-1;0;True;15;1;Pragma;instancing_options nolodfade nolightmap;False;;Custom;0;0;False;0.1;False;-1;0;False;-1;False;15;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;2;FLOAT3;0,0,0;False;3;FLOAT;0;False;4;FLOAT;0;False;6;FLOAT3;0,0,0;False;7;FLOAT3;0,0,0;False;8;FLOAT;0;False;9;FLOAT;0;False;10;FLOAT;0;False;13;FLOAT3;0,0,0;False;11;FLOAT3;0,0,0;False;12;FLOAT3;0,0,0;False;14;FLOAT4;0,0,0,0;False;15;FLOAT3;0,0,0;False;0
WireConnection;7;0;6;0
WireConnection;27;0;26;2
WireConnection;117;0;115;0
WireConnection;28;0;26;2
WireConnection;118;0;116;0
WireConnection;18;0;17;0
WireConnection;81;0;80;0
WireConnection;5;0;4;0
WireConnection;23;2;22;0
WireConnection;29;0;27;0
WireConnection;29;1;28;0
WireConnection;71;0;70;0
WireConnection;14;0;10;4
WireConnection;33;0;34;0
WireConnection;33;1;35;0
WireConnection;33;2;29;0
WireConnection;13;0;10;3
WireConnection;9;0;8;0
WireConnection;11;0;10;1
WireConnection;21;0;22;0
WireConnection;21;1;23;0
WireConnection;12;0;10;2
WireConnection;121;4;119;0
WireConnection;121;5;120;0
WireConnection;176;2;121;0
WireConnection;176;4;79;0
WireConnection;176;50;82;0
WireConnection;24;0;25;0
WireConnection;24;1;21;0
WireConnection;30;0;31;0
WireConnection;30;1;32;0
WireConnection;30;2;33;0
WireConnection;44;0;24;0
WireConnection;144;1;176;0
WireConnection;144;51;63;0
WireConnection;144;52;64;0
WireConnection;144;53;65;0
WireConnection;144;54;66;0
WireConnection;144;55;68;0
WireConnection;144;56;72;0
WireConnection;39;0;24;0
WireConnection;39;1;30;0
WireConnection;40;0;39;0
WireConnection;55;0;54;0
WireConnection;45;0;44;3
WireConnection;83;0;144;0
WireConnection;16;0;15;0
WireConnection;110;0;42;0
WireConnection;110;9;46;0
WireConnection;110;10;46;0
WireConnection;110;11;73;0
WireConnection;110;12;59;0
ASEEND*/
//CHKSM=AB66B735D926BDF112589D997FEB34BBA45B0A74

View File

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

View File

@@ -0,0 +1,58 @@
#ifndef GRIFFIN_BILLBOARD_COMMON_INCLUDED
#define GRIFFIN_BILLBOARD_COMMON_INCLUDED
#include "UnityCG.cginc"
struct Input
{
float2 uv_MainTex;
float2 imageTexcoord;
float face : VFACE;
};
fixed4 _ImageTexcoords[256];
int _ImageCount;
void GetImageTexcoord(appdata_full i, inout Input IN)
{
fixed3 normal = normalize(UnityObjectToWorldNormal(i.normal));
fixed dotZ = dot(normal, fixed3(0,0,1));
fixed dotX = dot(normal, fixed3(1,0,0));
fixed rad = atan2(dotZ, dotX);
rad = (rad + UNITY_TWO_PI) % UNITY_TWO_PI;
fixed f = rad/UNITY_TWO_PI - 0.5/_ImageCount;
int imageIndex = f*_ImageCount;
fixed4 rect = _ImageTexcoords[imageIndex];
fixed2 min = rect.xy;
fixed2 max = rect.xy + rect.zw;
fixed2 result = fixed2(
lerp(min.x, max.x, i.texcoord.x),
lerp(min.y, max.y, i.texcoord.y));
IN.imageTexcoord = result;
}
void TreeBillboardVert(inout appdata_full v, out Input o)
{
UNITY_INITIALIZE_OUTPUT(Input, o);
//Calculate new billboard vertex position and normal;
float3 upCamVec = float3(0, 1, 0);
float3 forwardCamVec = -normalize(UNITY_MATRIX_V._m20_m21_m22);
float3 rightCamVec = normalize(UNITY_MATRIX_V._m00_m01_m02);
float4x4 rotationCamMatrix = float4x4(rightCamVec, 0, upCamVec, 0, forwardCamVec, 0, 0, 0, 0, 1);
v.normal = mul(unity_WorldToObject, -forwardCamVec);
v.tangent = mul(unity_WorldToObject, float4(rightCamVec, 0));
v.vertex.x *= length(unity_ObjectToWorld._m00_m10_m20);
v.vertex.y *= length(unity_ObjectToWorld._m01_m11_m21);
v.vertex.z *= length(unity_ObjectToWorld._m02_m12_m22);
v.vertex = mul(v.vertex, rotationCamMatrix);
v.vertex.xyz += unity_ObjectToWorld._m03_m13_m23;
//Need to nullify rotation inserted by generated surface shader;
v.vertex = mul(unity_WorldToObject, v.vertex);
GetImageTexcoord(v, o);
}
#endif //GRIFFIN_BILLBOARD_COMMON_INCLUDED

View File

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

View File

@@ -0,0 +1,49 @@
Shader "Polaris/BuiltinRP/Foliage/TreeBillboard"
{
Properties
{
_Color ("Color", Color) = (1,1,1,1)
_MainTex ("Albedo (RGB)", 2D) = "white" {}
[Normal] _BumpMap ("Normal Map", 2D) = "bump" {}
_Cutoff ("Alpha cutoff", Range(0.01,0.9)) = 0.3
}
SubShader
{
Tags
{
"Queue" = "AlphaTest"
"RenderType" = "TransparentCutout"
"DisableBatching" = "True"
"IgnoreProjector" = "True"
}
CGPROGRAM
#include "GriffinBillboardCommon.cginc"
#pragma surface surf Lambert alphatest:_Cutoff addshadow vertex:TreeBillboardVert nolightmap nodirlightmap
#pragma multi_compile_instancing
#pragma instancing_options nolodfade nolightmap
#pragma target 3.0
sampler2D _MainTex;
sampler2D _BumpMap;
fixed4 _Color;
UNITY_INSTANCING_BUFFER_START(Props)
// put more per-instance properties here
UNITY_INSTANCING_BUFFER_END(Props)
void surf (Input IN, inout SurfaceOutput o)
{
fixed4 c = tex2D (_MainTex, IN.imageTexcoord) * _Color;
o.Albedo = c;
fixed4 normalColor = (tex2D(_BumpMap, IN.imageTexcoord));
fixed3 normal = UnpackNormal(normalColor);
o.Normal = normal;
o.Alpha = c.a;
}
ENDCG
}
FallBack "Diffuse"
}

View File

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

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 779e2a19617443e41adaf2a6b42043e3
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,121 @@
// Made with Amplify Shader Editor
// Available at the Unity Asset Store - http://u3d.as/y3X
Shader "Polaris/BuiltinRP/Terrain/BlinnPhong_4Splats"
{
Properties
{
_Color("Color", Color) = (1,1,1,1)
_SpecColor("Specular Color",Color)=(1,1,1,1)
_Specular("Specular", Range( 0 , 1)) = 0.5
_Gloss("Gloss", Float) = 1
_Control0("Control0", 2D) = "black" {}
_Splat0("Splat0", 2D) = "white" {}
_Splat1("Splat1", 2D) = "white" {}
_Splat2("Splat2", 2D) = "white" {}
_Splat3("Splat3", 2D) = "white" {}
[HideInInspector] _texcoord( "", 2D ) = "white" {}
[HideInInspector] __dirty( "", Int ) = 1
}
SubShader
{
Tags{ "RenderType" = "Opaque" "Queue" = "Geometry+0" "DisableBatching" = "True" }
Cull Back
CGPROGRAM
#pragma target 3.0
#pragma surface surf BlinnPhong keepalpha addshadow fullforwardshadows noinstancing
struct Input
{
float2 uv_texcoord;
};
uniform float4 _Color;
uniform sampler2D _Splat0;
uniform float4 _Splat0_ST;
uniform sampler2D _Control0;
uniform sampler2D _Splat1;
uniform float4 _Splat1_ST;
uniform sampler2D _Splat2;
uniform float4 _Splat2_ST;
uniform sampler2D _Splat3;
uniform float4 _Splat3_ST;
uniform float _Specular;
uniform float _Gloss;
void surf( Input i , inout SurfaceOutput o )
{
float4 _Color59 = _Color;
float2 uv0_Splat0 = i.uv_texcoord * _Splat0_ST.xy + _Splat0_ST.zw;
half4 break34_g1 = tex2D( _Control0, i.uv_texcoord );
float2 uv0_Splat1 = i.uv_texcoord * _Splat1_ST.xy + _Splat1_ST.zw;
float2 uv0_Splat2 = i.uv_texcoord * _Splat2_ST.xy + _Splat2_ST.zw;
float2 uv0_Splat3 = i.uv_texcoord * _Splat3_ST.xy + _Splat3_ST.zw;
float4 splatColor52_g1 = ( ( tex2D( _Splat0, uv0_Splat0 ) * break34_g1.r ) + ( tex2D( _Splat1, uv0_Splat1 ) * break34_g1.g ) + ( tex2D( _Splat2, uv0_Splat2 ) * break34_g1.b ) + ( tex2D( _Splat3, uv0_Splat3 ) * break34_g1.a ) );
float4 albedo55 = ( _Color59 * splatColor52_g1 );
o.Albedo = albedo55.rgb;
float _Specular69 = _Specular;
o.Specular = _Specular69;
float _Gloss71 = _Gloss;
o.Gloss = _Gloss71;
o.Alpha = 1;
}
ENDCG
}
Fallback "Diffuse"
}
/*ASEBEGIN
Version=18000
1244;197;1906;885;2934.794;1314.469;1.3;True;False
Node;AmplifyShaderEditor.CommentaryNode;5;-2705.477,-1354.525;Inherit;False;1129.338;1349.356;;16;59;6;58;12;26;11;9;31;8;13;7;10;69;70;71;74;Inputs;1,1,1,1;0;0
Node;AmplifyShaderEditor.TexturePropertyNode;10;-2636.643,-426.1253;Float;True;Property;_Splat2;Splat2;7;0;Create;True;0;0;False;0;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;7;-2646.643,-868.1251;Float;True;Property;_Splat0;Splat0;5;0;Create;True;0;0;False;0;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;13;-2638.187,-210.5692;Float;True;Property;_Splat3;Splat3;8;0;Create;True;0;0;False;0;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;8;-2641.643,-636.1255;Float;True;Property;_Splat1;Splat1;6;0;Create;True;0;0;False;0;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;31;-2646.643,-1090.125;Float;True;Property;_Control0;Control0;4;0;Create;True;0;0;False;0;None;None;False;black;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;9;-2343.642,-632.1255;Float;False;_Splat1;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;11;-2338.642,-422.1253;Float;False;_Splat2;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;26;-2348.642,-1086.125;Float;False;_Control;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;12;-2340.186,-206.5692;Float;False;_Splat3;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.ColorNode;58;-2648.181,-1280.629;Float;False;Property;_Color;Color;0;0;Create;True;0;0;False;0;1,1,1,1;1,1,1,1;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.CommentaryNode;65;-2707.217,82.32843;Inherit;False;1217.75;531.1187;;9;40;41;39;38;42;67;55;60;61;Albedo, Metallic, Smoothness;1,1,1,1;0;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;6;-2348.642,-864.1251;Float;False;_Splat0;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;41;-2641.59,430.8285;Inherit;False;11;_Splat2;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;39;-2645.59,270.8285;Inherit;False;6;_Splat0;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;38;-2648.59,190.8285;Inherit;False;26;_Control;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;42;-2640.59,508.8288;Inherit;False;12;_Splat3;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;40;-2644.59,350.8284;Inherit;False;9;_Splat1;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;59;-2353.028,-1282.264;Float;False;_Color;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.FunctionNode;67;-2343.82,308.0544;Inherit;False;Sample4Splats;-1;;1;563b5268ffef6d8479bb5dc663a94e53;0;5;54;SAMPLER2D;0;False;55;SAMPLER2D;0;False;56;SAMPLER2D;0;False;57;SAMPLER2D;0;False;58;SAMPLER2D;0;False;1;COLOR;0
Node;AmplifyShaderEditor.GetLocalVarNode;61;-2245.136,166.0216;Inherit;False;59;_Color;1;0;OBJECT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;60;-1968.135,270.0217;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.RangedFloatNode;74;-2094.186,-1278.196;Float;False;Property;_Specular;Specular;2;0;Create;True;0;0;False;0;0.5;0;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;70;-2093.016,-1087.158;Float;False;Property;_Gloss;Gloss;3;0;Create;True;0;0;False;0;1;0.5;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;55;-1730.163,264.757;Float;False;albedo;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;69;-1796.016,-1281.158;Float;False;_Specular;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;71;-1790.016,-1087.158;Float;False;_Gloss;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;62;-309.2018,0.01220703;Inherit;False;55;albedo;1;0;OBJECT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.GetLocalVarNode;72;-317.1857,95.80402;Inherit;False;69;_Specular;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;73;-309.1857,170.804;Inherit;False;71;_Gloss;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.StandardSurfaceOutputNode;66;0,0;Half;False;True;-1;2;;0;0;BlinnPhong;Polaris/BuiltinRP/Terrain/BlinnPhong_4Splats;False;False;False;False;False;False;False;False;False;False;False;False;False;True;False;False;False;True;False;False;False;Back;0;False;-1;0;False;-1;False;0;False;-1;0;False;-1;False;0;Opaque;0.5;True;True;0;False;Opaque;;Geometry;All;14;all;True;True;True;True;0;False;-1;False;0;False;-1;255;False;-1;255;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;False;2;15;10;25;False;0.5;True;0;0;False;-1;0;False;-1;0;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;0;0,0,0,0;VertexOffset;True;False;Cylindrical;False;Relative;0;;-1;-1;-1;-1;0;False;0;0;False;-1;1;0;False;-1;0;0;0;False;0.1;False;-1;0;False;-1;15;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;2;FLOAT3;0,0,0;False;3;FLOAT;0;False;4;FLOAT;0;False;6;FLOAT3;0,0,0;False;7;FLOAT3;0,0,0;False;8;FLOAT;0;False;9;FLOAT;0;False;10;FLOAT;0;False;13;FLOAT3;0,0,0;False;11;FLOAT3;0,0,0;False;12;FLOAT3;0,0,0;False;14;FLOAT4;0,0,0,0;False;15;FLOAT3;0,0,0;False;0
WireConnection;9;0;8;0
WireConnection;11;0;10;0
WireConnection;26;0;31;0
WireConnection;12;0;13;0
WireConnection;6;0;7;0
WireConnection;59;0;58;0
WireConnection;67;54;38;0
WireConnection;67;55;39;0
WireConnection;67;56;40;0
WireConnection;67;57;41;0
WireConnection;67;58;42;0
WireConnection;60;0;61;0
WireConnection;60;1;67;0
WireConnection;55;0;60;0
WireConnection;69;0;74;0
WireConnection;71;0;70;0
WireConnection;66;0;62;0
WireConnection;66;3;72;0
WireConnection;66;4;73;0
ASEEND*/
//CHKSM=E36E1117F712479A93E143ACFC095B2B53EB55FD

View File

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

View File

@@ -0,0 +1,159 @@
// Made with Amplify Shader Editor
// Available at the Unity Asset Store - http://u3d.as/y3X
Shader "Polaris/BuiltinRP/Terrain/BlinnPhong_4Splats4Normals"
{
Properties
{
_SpecColor("Specular Color",Color)=(1,1,1,1)
_Color("Color", Color) = (1,1,1,1)
_Control0("Control0", 2D) = "black" {}
_Splat0("Splat0", 2D) = "white" {}
_Specular("Specular", Range( 0 , 1)) = 0.5
_Splat1("Splat1", 2D) = "white" {}
_Gloss("Gloss", Float) = 1
_Splat2("Splat2", 2D) = "white" {}
_Splat3("Splat3", 2D) = "white" {}
_Normal0("Normal0", 2D) = "bump" {}
_Normal1("Normal1", 2D) = "bump" {}
_Normal2("Normal2", 2D) = "bump" {}
_Normal3("Normal3", 2D) = "bump" {}
[HideInInspector] _texcoord( "", 2D ) = "white" {}
[HideInInspector] __dirty( "", Int ) = 1
}
SubShader
{
Tags{ "RenderType" = "Opaque" "Queue" = "Geometry+0" "DisableBatching" = "True" }
Cull Back
CGPROGRAM
#pragma target 3.0
#pragma surface surf BlinnPhong keepalpha addshadow fullforwardshadows noinstancing
struct Input
{
float2 uv_texcoord;
};
uniform sampler2D _Normal0;
uniform sampler2D _Splat0;
uniform float4 _Splat0_ST;
uniform sampler2D _Control0;
uniform sampler2D _Normal1;
uniform sampler2D _Splat1;
uniform float4 _Splat1_ST;
uniform sampler2D _Normal2;
uniform sampler2D _Splat2;
uniform float4 _Splat2_ST;
uniform sampler2D _Normal3;
uniform sampler2D _Splat3;
uniform float4 _Splat3_ST;
uniform float4 _Color;
uniform float _Specular;
uniform float _Gloss;
void surf( Input i , inout SurfaceOutput o )
{
float2 uv0_Splat0 = i.uv_texcoord * _Splat0_ST.xy + _Splat0_ST.zw;
half4 tex2DNode31_g15 = tex2D( _Control0, i.uv_texcoord );
half4 break125_g15 = tex2DNode31_g15;
float2 uv0_Splat1 = i.uv_texcoord * _Splat1_ST.xy + _Splat1_ST.zw;
float2 uv0_Splat2 = i.uv_texcoord * _Splat2_ST.xy + _Splat2_ST.zw;
float2 uv0_Splat3 = i.uv_texcoord * _Splat3_ST.xy + _Splat3_ST.zw;
half3 lerpResult128_g15 = lerp( float3(0,0,0.5) , UnpackNormal( ( ( tex2D( _Normal0, uv0_Splat0 ) * break125_g15.r ) + ( tex2D( _Normal1, uv0_Splat1 ) * break125_g15.g ) + ( tex2D( _Normal2, uv0_Splat2 ) * break125_g15.b ) + ( tex2D( _Normal3, uv0_Splat3 ) * break125_g15.a ) ) ) , ( break125_g15.r + break125_g15.g + break125_g15.b + break125_g15.a ));
float3 normalVector114_g15 = lerpResult128_g15;
float3 normalVector80 = normalVector114_g15;
o.Normal = normalVector80;
float4 _Color59 = _Color;
half4 break34_g15 = tex2DNode31_g15;
float4 splatColor52_g15 = ( ( tex2D( _Splat0, uv0_Splat0 ) * break34_g15.r ) + ( tex2D( _Splat1, uv0_Splat1 ) * break34_g15.g ) + ( tex2D( _Splat2, uv0_Splat2 ) * break34_g15.b ) + ( tex2D( _Splat3, uv0_Splat3 ) * break34_g15.a ) );
float4 albedo55 = ( _Color59 * splatColor52_g15 );
o.Albedo = albedo55.rgb;
float _Specular87 = _Specular;
o.Specular = _Specular87;
float _Gloss88 = _Gloss;
o.Gloss = _Gloss88;
o.Alpha = 1;
}
ENDCG
}
Fallback "Diffuse"
}
/*ASEBEGIN
Version=18000
1244;197;1906;885;2393.73;708.0329;1.6;True;False
Node;AmplifyShaderEditor.CommentaryNode;5;-2582.276,-1258.525;Inherit;False;1849.843;1153.783;;22;73;72;71;70;69;68;67;66;11;9;6;12;8;13;10;7;59;26;58;31;86;88;Inputs;1,1,1,1;0;0
Node;AmplifyShaderEditor.TexturePropertyNode;69;-1303.146,-751.9892;Float;True;Property;_Normal1;Normal1;10;0;Create;True;0;0;False;0;None;None;False;bump;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;66;-1308.146,-983.9891;Float;True;Property;_Normal0;Normal0;9;0;Create;True;0;0;False;0;None;None;False;bump;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;10;-1862.24,-544.5253;Float;True;Property;_Splat2;Splat2;7;0;Create;True;0;0;False;0;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;31;-1872.24,-1208.525;Float;True;Property;_Control0;Control0;2;0;Create;True;0;0;False;0;None;None;False;black;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;13;-1863.784,-328.9691;Float;True;Property;_Splat3;Splat3;8;0;Create;True;0;0;False;0;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;68;-1299.69,-326.4331;Float;True;Property;_Normal3;Normal3;12;0;Create;True;0;0;False;0;None;None;False;bump;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;7;-1872.24,-986.5253;Float;True;Property;_Splat0;Splat0;3;0;Create;True;0;0;False;0;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;8;-1867.24,-754.5253;Float;True;Property;_Splat1;Splat1;5;0;Create;True;0;0;False;0;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;67;-1298.146,-541.9893;Float;True;Property;_Normal2;Normal2;11;0;Create;True;0;0;False;0;None;None;False;bump;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;6;-1574.24,-982.5253;Float;False;_Splat0;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;26;-1574.24,-1204.525;Float;False;_Control;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.CommentaryNode;65;-2670.415,123.9284;Inherit;False;1408.794;881.6259;;14;77;79;76;38;42;41;78;40;39;84;80;55;60;61;Albedo, Normal, Metallic, Smoothness;1,1,1,1;0;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;11;-1564.24,-540.5253;Float;False;_Splat2;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;70;-1001.69,-322.4331;Float;False;_Normal3;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;73;-1000.146,-537.9894;Float;False;_Normal2;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;71;-1010.146,-979.9891;Float;False;_Normal0;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;72;-1005.146,-747.9892;Float;False;_Normal1;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;9;-1569.24,-750.5253;Float;False;_Splat1;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.ColorNode;58;-2524.98,-1184.629;Float;False;Property;_Color;Color;1;0;Create;True;0;0;False;0;1,1,1,1;1,1,1,1;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.RegisterLocalVarNode;12;-1565.784,-324.9691;Float;False;_Splat3;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;59;-2193.028,-1186.264;Float;False;_Color;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.GetLocalVarNode;77;-2497.286,739.8362;Inherit;False;72;_Normal1;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;79;-2494.586,900.4363;Inherit;False;70;_Normal3;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;40;-2498.589,411.9284;Inherit;False;9;_Splat1;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;39;-2499.589,331.9284;Inherit;False;6;_Splat0;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;41;-2495.589,491.9284;Inherit;False;11;_Splat2;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;76;-2495.586,822.4363;Inherit;False;73;_Normal2;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;38;-2502.589,251.9284;Inherit;False;26;_Control;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;78;-2499.586,662.4363;Inherit;False;71;_Normal0;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;42;-2494.589,569.9283;Inherit;False;12;_Splat3;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.FunctionNode;84;-2116.618,505.0056;Inherit;False;Sample4Splats4Normals;-1;;15;45f7d1aa5e9d58743aec839bd3751783;0;9;54;SAMPLER2D;0;False;55;SAMPLER2D;0;False;56;SAMPLER2D;0;False;57;SAMPLER2D;0;False;58;SAMPLER2D;0;False;100;SAMPLER2D;0;False;101;SAMPLER2D;0;False;105;SAMPLER2D;0;False;102;SAMPLER2D;0;False;2;COLOR;0;FLOAT3;132
Node;AmplifyShaderEditor.GetLocalVarNode;61;-2006.835,362.3217;Inherit;False;59;_Color;1;0;OBJECT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.RangedFloatNode;86;-2522.786,-844.4161;Float;False;Property;_Gloss;Gloss;6;0;Create;True;0;0;False;0;1;0.5;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;85;-2523.956,-953.754;Float;False;Property;_Specular;Specular;4;0;Create;True;0;0;False;0;0.5;0;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;60;-1729.835,466.3217;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;88;-2219.786,-844.4161;Float;False;_Gloss;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;87;-2225.786,-956.7159;Float;False;_Specular;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;55;-1491.863,461.057;Float;False;albedo;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;80;-1490.6,559.9918;Float;False;normalVector;-1;True;1;0;FLOAT3;0,0,0;False;1;FLOAT3;0
Node;AmplifyShaderEditor.GetLocalVarNode;81;-357.1204,12.14795;Inherit;False;80;normalVector;1;0;OBJECT;0;False;1;FLOAT3;0
Node;AmplifyShaderEditor.GetLocalVarNode;62;-329.2018,-75.98779;Inherit;False;55;albedo;1;0;OBJECT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.GetLocalVarNode;89;-332.3497,92.79211;Inherit;False;87;_Specular;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;90;-319.3497,176.7921;Inherit;False;88;_Gloss;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.StandardSurfaceOutputNode;83;0,0;Half;False;True;-1;2;;0;0;BlinnPhong;Polaris/BuiltinRP/Terrain/BlinnPhong_4Splats4Normals;False;False;False;False;False;False;False;False;False;False;False;False;False;True;False;False;False;True;False;False;False;Back;0;False;-1;0;False;-1;False;0;False;-1;0;False;-1;False;0;Opaque;0.5;True;True;0;False;Opaque;;Geometry;All;14;all;True;True;True;True;0;False;-1;False;0;False;-1;255;False;-1;255;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;False;2;15;10;25;False;0.5;True;0;0;False;-1;0;False;-1;0;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;0;0,0,0,0;VertexOffset;True;False;Cylindrical;False;Relative;0;;-1;-1;-1;-1;0;False;0;0;False;-1;0;0;False;-1;0;0;0;False;0.1;False;-1;0;False;-1;15;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;2;FLOAT3;0,0,0;False;3;FLOAT;0;False;4;FLOAT;0;False;6;FLOAT3;0,0,0;False;7;FLOAT3;0,0,0;False;8;FLOAT;0;False;9;FLOAT;0;False;10;FLOAT;0;False;13;FLOAT3;0,0,0;False;11;FLOAT3;0,0,0;False;12;FLOAT3;0,0,0;False;14;FLOAT4;0,0,0,0;False;15;FLOAT3;0,0,0;False;0
WireConnection;6;0;7;0
WireConnection;26;0;31;0
WireConnection;11;0;10;0
WireConnection;70;0;68;0
WireConnection;73;0;67;0
WireConnection;71;0;66;0
WireConnection;72;0;69;0
WireConnection;9;0;8;0
WireConnection;12;0;13;0
WireConnection;59;0;58;0
WireConnection;84;54;38;0
WireConnection;84;55;39;0
WireConnection;84;56;40;0
WireConnection;84;57;41;0
WireConnection;84;58;42;0
WireConnection;84;100;78;0
WireConnection;84;101;77;0
WireConnection;84;105;76;0
WireConnection;84;102;79;0
WireConnection;60;0;61;0
WireConnection;60;1;84;0
WireConnection;88;0;86;0
WireConnection;87;0;85;0
WireConnection;55;0;60;0
WireConnection;80;0;84;132
WireConnection;83;0;62;0
WireConnection;83;1;81;0
WireConnection;83;3;89;0
WireConnection;83;4;90;0
ASEEND*/
//CHKSM=9F5ECCF7CE92888ED9A25D494F69AC8944251A08

View File

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

View File

@@ -0,0 +1,180 @@
// Made with Amplify Shader Editor
// Available at the Unity Asset Store - http://u3d.as/y3X
Shader "Polaris/BuiltinRP/Terrain/BlinnPhong_8Splats"
{
Properties
{
_SpecColor("Specular Color",Color)=(1,1,1,1)
_Color("Color", Color) = (1,1,1,1)
_Control0("Control0", 2D) = "black" {}
_Specular("Specular", Range( 0 , 1)) = 0.5
_Control1("Control1", 2D) = "black" {}
_Gloss("Gloss", Float) = 1
_Splat0("Splat0", 2D) = "white" {}
_Splat1("Splat1", 2D) = "white" {}
_Splat2("Splat2", 2D) = "white" {}
_Splat3("Splat3", 2D) = "white" {}
_Splat4("Splat4", 2D) = "white" {}
_Splat5("Splat5", 2D) = "white" {}
_Splat6("Splat6", 2D) = "white" {}
_Splat7("Splat7", 2D) = "white" {}
[HideInInspector] _texcoord( "", 2D ) = "white" {}
[HideInInspector] __dirty( "", Int ) = 1
}
SubShader
{
Tags{ "RenderType" = "Opaque" "Queue" = "Geometry+0" "DisableBatching" = "True" }
Cull Back
CGPROGRAM
#pragma target 3.0
#pragma surface surf BlinnPhong keepalpha addshadow fullforwardshadows noinstancing
struct Input
{
float2 uv_texcoord;
};
uniform float4 _Color;
uniform sampler2D _Splat0;
uniform float4 _Splat0_ST;
uniform sampler2D _Control0;
uniform sampler2D _Splat1;
uniform float4 _Splat1_ST;
uniform sampler2D _Splat2;
uniform float4 _Splat2_ST;
uniform sampler2D _Splat3;
uniform float4 _Splat3_ST;
uniform sampler2D _Splat4;
uniform float4 _Splat4_ST;
uniform sampler2D _Control1;
uniform sampler2D _Splat5;
uniform float4 _Splat5_ST;
uniform sampler2D _Splat6;
uniform float4 _Splat6_ST;
uniform sampler2D _Splat7;
uniform float4 _Splat7_ST;
uniform float _Specular;
uniform float _Gloss;
void surf( Input i , inout SurfaceOutput o )
{
float4 _Color59 = _Color;
float2 uv0_Splat0 = i.uv_texcoord * _Splat0_ST.xy + _Splat0_ST.zw;
half4 break34_g20 = tex2D( _Control0, i.uv_texcoord );
float2 uv0_Splat1 = i.uv_texcoord * _Splat1_ST.xy + _Splat1_ST.zw;
float2 uv0_Splat2 = i.uv_texcoord * _Splat2_ST.xy + _Splat2_ST.zw;
float2 uv0_Splat3 = i.uv_texcoord * _Splat3_ST.xy + _Splat3_ST.zw;
float4 splatColor52_g20 = ( ( tex2D( _Splat0, uv0_Splat0 ) * break34_g20.r ) + ( tex2D( _Splat1, uv0_Splat1 ) * break34_g20.g ) + ( tex2D( _Splat2, uv0_Splat2 ) * break34_g20.b ) + ( tex2D( _Splat3, uv0_Splat3 ) * break34_g20.a ) );
float4 splatColor055 = splatColor52_g20;
float2 uv0_Splat4 = i.uv_texcoord * _Splat4_ST.xy + _Splat4_ST.zw;
half4 break34_g19 = tex2D( _Control1, i.uv_texcoord );
float2 uv0_Splat5 = i.uv_texcoord * _Splat5_ST.xy + _Splat5_ST.zw;
float2 uv0_Splat6 = i.uv_texcoord * _Splat6_ST.xy + _Splat6_ST.zw;
float2 uv0_Splat7 = i.uv_texcoord * _Splat7_ST.xy + _Splat7_ST.zw;
float4 splatColor52_g19 = ( ( tex2D( _Splat4, uv0_Splat4 ) * break34_g19.r ) + ( tex2D( _Splat5, uv0_Splat5 ) * break34_g19.g ) + ( tex2D( _Splat6, uv0_Splat6 ) * break34_g19.b ) + ( tex2D( _Splat7, uv0_Splat7 ) * break34_g19.a ) );
float4 splatColor1117 = splatColor52_g19;
float4 albedoColor125 = ( _Color59 * ( splatColor055 + splatColor1117 ) );
o.Albedo = albedoColor125.rgb;
float _Specular140 = _Specular;
o.Specular = _Specular140;
float _Gloss141 = _Gloss;
o.Gloss = _Gloss141;
o.Alpha = 1;
}
ENDCG
}
Fallback "Diffuse"
}
/*ASEBEGIN
Version=18000
1244;197;1906;885;2541.458;727.9801;1;True;False
Node;AmplifyShaderEditor.CommentaryNode;5;-2709.488,-2432.581;Inherit;False;1792.826;1170.514;;26;59;58;9;6;26;12;71;72;73;70;84;11;10;8;31;7;68;83;66;67;69;13;138;139;140;141;Inputs;1,1,1,1;0;0
Node;AmplifyShaderEditor.TexturePropertyNode;8;-2074.251,-1928.582;Float;True;Property;_Splat1;Splat1;7;0;Create;True;0;0;False;0;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;31;-2079.251,-2382.581;Float;True;Property;_Control0;Control0;2;0;Create;True;0;0;False;0;None;None;False;black;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;7;-2079.251,-2160.582;Float;True;Property;_Splat0;Splat0;6;0;Create;True;0;0;False;0;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;68;-1506.701,-1500.49;Float;True;Property;_Splat7;Splat7;13;0;Create;True;0;0;False;0;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;10;-2069.251,-1718.582;Float;True;Property;_Splat2;Splat2;8;0;Create;True;0;0;False;0;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;66;-1515.157,-2158.046;Float;True;Property;_Splat4;Splat4;10;0;Create;True;0;0;False;0;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;67;-1505.157,-1716.046;Float;True;Property;_Splat6;Splat6;12;0;Create;True;0;0;False;0;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;83;-1515.058,-2377.599;Float;True;Property;_Control1;Control1;4;0;Create;True;0;0;False;0;None;None;False;black;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;69;-1510.157,-1926.045;Float;True;Property;_Splat5;Splat5;11;0;Create;True;0;0;False;0;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;13;-2070.795,-1503.025;Float;True;Property;_Splat3;Splat3;9;0;Create;True;0;0;False;0;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;84;-1217.058,-2373.599;Float;False;_Control1;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;11;-1771.251,-1714.582;Float;False;_Splat2;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;70;-1208.702,-1496.49;Float;False;_Splat7;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;72;-1212.158,-1922.045;Float;False;_Splat5;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;71;-1217.158,-2154.046;Float;False;_Splat4;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;73;-1207.158,-1712.046;Float;False;_Splat6;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;26;-1781.251,-2378.581;Float;False;_Control0;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.CommentaryNode;65;-3024.415,-1017.926;Inherit;False;882.7046;478.625;;7;55;41;38;39;40;42;136;First layer;1,1,1,1;0;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;12;-1772.795,-1499.026;Float;False;_Splat3;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;9;-1776.251,-1924.582;Float;False;_Splat1;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;6;-1781.251,-2156.582;Float;False;_Splat0;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.CommentaryNode;102;-3088.116,-454.5433;Inherit;False;962.8787;466.6581;;7;117;137;113;114;115;110;112;Second layer;1,1,1,1;0;0
Node;AmplifyShaderEditor.GetLocalVarNode;112;-3008.49,-86.54466;Inherit;False;70;_Splat7;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;110;-3016.49,-404.5437;Inherit;False;84;_Control1;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;114;-3013.49,-324.5442;Inherit;False;71;_Splat4;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;42;-2973.511,-640.7599;Inherit;False;12;_Splat3;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;113;-3012.49,-244.5443;Inherit;False;72;_Splat5;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;41;-2974.511,-718.7598;Inherit;False;11;_Splat2;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;38;-2981.511,-958.7596;Inherit;False;26;_Control0;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;115;-3009.49,-164.5444;Inherit;False;73;_Splat6;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;40;-2977.511,-798.7598;Inherit;False;9;_Splat1;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;39;-2978.511,-878.7599;Inherit;False;6;_Splat0;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.FunctionNode;137;-2677.408,-287.2572;Inherit;False;Sample4Splats;-1;;19;563b5268ffef6d8479bb5dc663a94e53;0;5;54;SAMPLER2D;0;False;55;SAMPLER2D;0;False;56;SAMPLER2D;0;False;57;SAMPLER2D;0;False;58;SAMPLER2D;0;False;1;COLOR;0
Node;AmplifyShaderEditor.FunctionNode;136;-2711.357,-831.6314;Inherit;False;Sample4Splats;-1;;20;563b5268ffef6d8479bb5dc663a94e53;0;5;54;SAMPLER2D;0;False;55;SAMPLER2D;0;False;56;SAMPLER2D;0;False;57;SAMPLER2D;0;False;58;SAMPLER2D;0;False;1;COLOR;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;55;-2359.53,-838.5478;Float;False;splatColor0;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.CommentaryNode;134;-1923.133,-1016.12;Inherit;False;993.3678;323.2437;;6;125;124;123;122;120;121;Blend Addictive;1,1,1,1;0;0
Node;AmplifyShaderEditor.ColorNode;58;-2645.673,-2373.899;Float;False;Property;_Color;Color;1;0;Create;True;0;0;False;0;1,1,1,1;1,1,1,1;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.RegisterLocalVarNode;117;-2372.176,-284.4217;Float;False;splatColor1;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.GetLocalVarNode;120;-1869.316,-915.3834;Inherit;False;55;splatColor0;1;0;OBJECT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.GetLocalVarNode;121;-1870.723,-819.7946;Inherit;False;117;splatColor1;1;0;OBJECT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;59;-2313.72,-2375.534;Float;False;_Color;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.GetLocalVarNode;123;-1615.276,-966.1201;Inherit;False;59;_Color;1;0;OBJECT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.SimpleAddOpNode;122;-1562.87,-874.6176;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.RangedFloatNode;138;-2638.7,-2157.054;Float;False;Property;_Specular;Specular;3;0;Create;True;0;0;False;0;0.5;0;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;124;-1378.276,-882.1201;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.RangedFloatNode;139;-2637.53,-1966.016;Float;False;Property;_Gloss;Gloss;5;0;Create;True;0;0;False;0;1;0.5;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;141;-2334.53,-1966.016;Float;False;_Gloss;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;140;-2340.53,-2160.016;Float;False;_Specular;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;125;-1172.276,-887.1201;Float;False;albedoColor;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.GetLocalVarNode;143;-1480.458,-349.9801;Inherit;False;141;_Gloss;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;142;-1490.458,-434.9801;Inherit;False;140;_Specular;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;62;-1506.905,-528.8466;Inherit;False;125;albedoColor;1;0;OBJECT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.StandardSurfaceOutputNode;135;-1217.387,-533.661;Half;False;True;-1;2;;0;0;BlinnPhong;Polaris/BuiltinRP/Terrain/BlinnPhong_8Splats;False;False;False;False;False;False;False;False;False;False;False;False;False;True;False;False;False;True;False;False;False;Back;0;False;-1;0;False;-1;False;0;False;-1;0;False;-1;False;0;Opaque;0.5;True;True;0;False;Opaque;;Geometry;All;14;all;True;True;True;True;0;False;-1;False;0;False;-1;255;False;-1;255;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;False;2;15;10;25;False;0.5;True;0;0;False;-1;0;False;-1;0;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;0;0,0,0,0;VertexOffset;True;False;Cylindrical;False;Relative;0;;-1;-1;-1;-1;0;False;0;0;False;-1;0;0;False;-1;0;0;0;False;0.1;False;-1;0;False;-1;15;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;2;FLOAT3;0,0,0;False;3;FLOAT;0;False;4;FLOAT;0;False;6;FLOAT3;0,0,0;False;7;FLOAT3;0,0,0;False;8;FLOAT;0;False;9;FLOAT;0;False;10;FLOAT;0;False;13;FLOAT3;0,0,0;False;11;FLOAT3;0,0,0;False;12;FLOAT3;0,0,0;False;14;FLOAT4;0,0,0,0;False;15;FLOAT3;0,0,0;False;0
WireConnection;84;0;83;0
WireConnection;11;0;10;0
WireConnection;70;0;68;0
WireConnection;72;0;69;0
WireConnection;71;0;66;0
WireConnection;73;0;67;0
WireConnection;26;0;31;0
WireConnection;12;0;13;0
WireConnection;9;0;8;0
WireConnection;6;0;7;0
WireConnection;137;54;110;0
WireConnection;137;55;114;0
WireConnection;137;56;113;0
WireConnection;137;57;115;0
WireConnection;137;58;112;0
WireConnection;136;54;38;0
WireConnection;136;55;39;0
WireConnection;136;56;40;0
WireConnection;136;57;41;0
WireConnection;136;58;42;0
WireConnection;55;0;136;0
WireConnection;117;0;137;0
WireConnection;59;0;58;0
WireConnection;122;0;120;0
WireConnection;122;1;121;0
WireConnection;124;0;123;0
WireConnection;124;1;122;0
WireConnection;141;0;139;0
WireConnection;140;0;138;0
WireConnection;125;0;124;0
WireConnection;135;0;62;0
WireConnection;135;3;142;0
WireConnection;135;4;143;0
ASEEND*/
//CHKSM=6E26207ED61903AF092F636593F79EF4B01036A6

View File

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

View File

@@ -0,0 +1,70 @@
// Made with Amplify Shader Editor
// Available at the Unity Asset Store - http://u3d.as/y3X
Shader "Polaris/BuiltinRP/Terrain/BlinnPhong_ColorMap"
{
Properties
{
_SpecColor("Specular Color",Color)=(1,1,1,1)
_Specular("Specular", Range( 0 , 1)) = 0.5
_Gloss("Gloss", Float) = 1
_MainTex("_MainTex", 2D) = "white" {}
[HideInInspector] _texcoord( "", 2D ) = "white" {}
[HideInInspector] __dirty( "", Int ) = 1
}
SubShader
{
Tags{ "RenderType" = "Opaque" "Queue" = "Geometry+0" "DisableBatching" = "True" }
Cull Back
CGPROGRAM
#pragma target 3.0
#pragma surface surf BlinnPhong keepalpha addshadow fullforwardshadows noinstancing
struct Input
{
float2 uv_texcoord;
};
uniform sampler2D _MainTex;
uniform half4 _MainTex_ST;
uniform float _Specular;
uniform float _Gloss;
void surf( Input i , inout SurfaceOutput o )
{
float2 uv_MainTex = i.uv_texcoord * _MainTex_ST.xy + _MainTex_ST.zw;
o.Albedo = tex2D( _MainTex, uv_MainTex ).rgb;
float _Specular22 = _Specular;
o.Specular = _Specular22;
float _Gloss23 = _Gloss;
o.Gloss = _Gloss23;
o.Alpha = 1;
}
ENDCG
}
Fallback "Diffuse"
}
/*ASEBEGIN
Version=18000
1244;197;1906;885;2532.847;650.2826;1.3;True;False
Node;AmplifyShaderEditor.CommentaryNode;6;-1874.6,-462.8;Inherit;False;587;419;;6;23;22;21;20;5;4;Properties;1,1,1,1;0;0
Node;AmplifyShaderEditor.RangedFloatNode;21;-1727.141,-147.4117;Float;False;Property;_Gloss;Gloss;3;0;Create;True;0;0;False;0;1;0.5;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;20;-1855.311,-235.4498;Float;False;Property;_Specular;Specular;2;0;Create;True;0;0;False;0;0.5;0;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;23;-1511.038,-156.4288;Float;False;_Gloss;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;22;-1504.728,-239.0671;Float;False;_Specular;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.TexturePropertyNode;26;-784.3473,-585.2824;Inherit;True;Property;_MainTex;_MainTex;4;0;Create;True;0;0;False;0;None;None;False;white;Auto;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.ColorNode;4;-1788.6,-412.7999;Float;False;Property;_Color;Color;1;0;Create;True;0;0;False;0;1,1,1,1;1,1,1,1;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.SamplerNode;27;-451.5472,-544.9824;Inherit;True;Property;_TextureSample0;Texture Sample 0;5;0;Create;True;0;0;False;0;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;6;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;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.GetLocalVarNode;25;-208.705,-230.2894;Inherit;False;23;_Gloss;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;5;-1502.6,-409.7999;Float;False;_Color;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.GetLocalVarNode;24;-219.705,-318.2894;Inherit;False;22;_Specular;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.StandardSurfaceOutputNode;19;69,-386;Half;False;True;-1;2;;0;0;BlinnPhong;Polaris/BuiltinRP/Terrain/BlinnPhong_ColorMap;False;False;False;False;False;False;False;False;False;False;False;False;False;True;False;False;False;True;False;False;False;Back;0;False;-1;0;False;-1;False;0;False;-1;0;False;-1;False;0;Opaque;0.5;True;True;0;False;Opaque;;Geometry;All;14;all;True;True;True;True;0;False;-1;False;0;False;-1;255;False;-1;255;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;False;2;15;10;25;False;0.5;True;0;0;False;-1;0;False;-1;0;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;0;0,0,0,0;VertexOffset;True;False;Cylindrical;False;Relative;0;;-1;-1;-1;-1;0;False;0;0;False;-1;0;0;False;-1;0;0;0;False;0.1;False;-1;0;False;-1;15;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;2;FLOAT3;0,0,0;False;3;FLOAT;0;False;4;FLOAT;0;False;6;FLOAT3;0,0,0;False;7;FLOAT3;0,0,0;False;8;FLOAT;0;False;9;FLOAT;0;False;10;FLOAT;0;False;13;FLOAT3;0,0,0;False;11;FLOAT3;0,0,0;False;12;FLOAT3;0,0,0;False;14;FLOAT4;0,0,0,0;False;15;FLOAT3;0,0,0;False;0
WireConnection;23;0;21;0
WireConnection;22;0;20;0
WireConnection;27;0;26;0
WireConnection;5;0;4;0
WireConnection;19;0;27;0
WireConnection;19;3;24;0
WireConnection;19;4;25;0
ASEEND*/
//CHKSM=9EB03EA78077666F9E150F95F75CFFABCD01C83E

View File

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

View File

@@ -0,0 +1,264 @@
// Made with Amplify Shader Editor
// Available at the Unity Asset Store - http://u3d.as/y3X
Shader "Polaris/BuiltinRP/Terrain/BlinnPhong_GradientLookup"
{
Properties
{
_SpecColor("Specular Color",Color)=(1,1,1,1)
_Color("Color", Color) = (1,1,1,1)
_ColorByHeight("Color By Height", 2D) = "white" {}
_Specular("Specular", Range( 0 , 1)) = 0.5
_ColorByNormal("Color By Normal", 2D) = "white" {}
_Gloss("Gloss", Float) = 1
_ColorBlend("ColorBlend", 2D) = "white" {}
_Dimension("Dimension", Vector) = (1,1,1,0)
_MainTex("MainTex", 2D) = "white" {}
[HideInInspector] _texcoord( "", 2D ) = "white" {}
[HideInInspector] __dirty( "", Int ) = 1
}
SubShader
{
Tags{ "RenderType" = "Opaque" "Queue" = "Geometry+0" "DisableBatching" = "True" }
Cull Back
CGINCLUDE
#include "UnityShaderVariables.cginc"
#include "UnityPBSLighting.cginc"
#include "Lighting.cginc"
#pragma target 3.0
struct Input
{
float3 worldPos;
half3 worldNormal;
float2 uv_texcoord;
};
uniform sampler2D _ColorByHeight;
uniform float3 _Dimension;
uniform sampler2D _ColorBlend;
uniform sampler2D _ColorByNormal;
uniform sampler2D _MainTex;
uniform float4 _Color;
uniform float _Specular;
uniform float _Gloss;
void surf( Input i , inout SurfaceOutput o )
{
float3 ase_vertex3Pos = mul( unity_WorldToObject, float4( i.worldPos , 1 ) );
float _Height22 = _Dimension.y;
float heightFraction59 = (0.0 + (ase_vertex3Pos.y - 0.0) * (1.0 - 0.0) / (_Height22 - 0.0));
half2 appendResult25 = (half2(heightFraction59 , 0.5));
float4 colorByHeightResult30 = tex2D( _ColorByHeight, appendResult25 );
half2 appendResult63 = (half2(heightFraction59 , 0.5));
half4 tex2DNode65 = tex2D( _ColorBlend, appendResult63 );
half3 ase_worldNormal = i.worldNormal;
half3 ase_vertexNormal = mul( unity_WorldToObject, float4( ase_worldNormal, 0 ) );
half2 appendResult41 = (half2(saturate( ase_vertexNormal.y ) , 0.5));
float4 colorByNormalResult43 = tex2D( _ColorByNormal, appendResult41 );
float4 mainTexColor53 = tex2D( _MainTex, i.uv_texcoord );
float4 _Color9 = _Color;
float4 albedoResult78 = ( ( ( ( ( colorByHeightResult30 * ( 1.0 - tex2DNode65.r ) ) + ( colorByNormalResult43 * tex2DNode65.r ) ) * ( 1.0 - mainTexColor53.a ) ) + mainTexColor53 ) * _Color9 );
o.Albedo = albedoResult78.rgb;
float _Specular85 = _Specular;
o.Specular = _Specular85;
float _Gloss86 = _Gloss;
o.Gloss = _Gloss86;
o.Alpha = 1;
}
ENDCG
CGPROGRAM
#pragma surface surf BlinnPhong keepalpha fullforwardshadows noinstancing
ENDCG
Pass
{
Name "ShadowCaster"
Tags{ "LightMode" = "ShadowCaster" }
ZWrite On
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma target 3.0
#pragma multi_compile_shadowcaster
#pragma multi_compile UNITY_PASS_SHADOWCASTER
#pragma skip_variants FOG_LINEAR FOG_EXP FOG_EXP2
#include "HLSLSupport.cginc"
#if ( SHADER_API_D3D11 || SHADER_API_GLCORE || SHADER_API_GLES || SHADER_API_GLES3 || SHADER_API_METAL || SHADER_API_VULKAN )
#define CAN_SKIP_VPOS
#endif
#include "UnityCG.cginc"
#include "Lighting.cginc"
#include "UnityPBSLighting.cginc"
struct v2f
{
V2F_SHADOW_CASTER;
float2 customPack1 : TEXCOORD1;
float3 worldPos : TEXCOORD2;
float3 worldNormal : TEXCOORD3;
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
};
v2f vert( appdata_full v )
{
v2f o;
UNITY_SETUP_INSTANCE_ID( v );
UNITY_INITIALIZE_OUTPUT( v2f, o );
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO( o );
UNITY_TRANSFER_INSTANCE_ID( v, o );
Input customInputData;
float3 worldPos = mul( unity_ObjectToWorld, v.vertex ).xyz;
half3 worldNormal = UnityObjectToWorldNormal( v.normal );
o.worldNormal = worldNormal;
o.customPack1.xy = customInputData.uv_texcoord;
o.customPack1.xy = v.texcoord;
o.worldPos = worldPos;
TRANSFER_SHADOW_CASTER_NORMALOFFSET( o )
return o;
}
half4 frag( v2f IN
#if !defined( CAN_SKIP_VPOS )
, UNITY_VPOS_TYPE vpos : VPOS
#endif
) : SV_Target
{
UNITY_SETUP_INSTANCE_ID( IN );
Input surfIN;
UNITY_INITIALIZE_OUTPUT( Input, surfIN );
surfIN.uv_texcoord = IN.customPack1.xy;
float3 worldPos = IN.worldPos;
half3 worldViewDir = normalize( UnityWorldSpaceViewDir( worldPos ) );
surfIN.worldPos = worldPos;
surfIN.worldNormal = IN.worldNormal;
SurfaceOutput o;
UNITY_INITIALIZE_OUTPUT( SurfaceOutput, o )
surf( surfIN, o );
#if defined( CAN_SKIP_VPOS )
float2 vpos = IN.pos;
#endif
SHADOW_CASTER_FRAGMENT( IN )
}
ENDCG
}
}
Fallback "Diffuse"
}
/*ASEBEGIN
Version=18000
1244;197;1906;885;4030.805;441.8075;1;True;False
Node;AmplifyShaderEditor.CommentaryNode;19;-3470.578,-1284.338;Inherit;False;700.7617;1495.715;;17;18;9;7;16;15;33;12;14;10;13;32;22;17;83;85;84;86;Properties;1,1,1,1;0;0
Node;AmplifyShaderEditor.Vector3Node;17;-3360.015,-177.142;Float;False;Property;_Dimension;Dimension;7;0;Create;True;0;0;False;0;1,1,1;500,150,500;0;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
Node;AmplifyShaderEditor.CommentaryNode;29;-4462.73,222.3531;Inherit;False;1705.197;471.512;;9;21;20;23;59;27;26;28;25;30;Sample Color By Height;1,1,1,1;0;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;22;-3010.162,-101.5121;Float;False;_Height;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.PosVertexDataNode;20;-4431.73,366.4063;Inherit;False;0;0;5;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.GetLocalVarNode;21;-4420.388,526.8657;Inherit;False;22;_Height;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.CommentaryNode;46;-4251.19,848.2155;Inherit;False;1479.913;393.3013;;7;44;38;45;40;41;42;43;Sample Color By Normal;1,1,1,1;0;0
Node;AmplifyShaderEditor.TFHCRemapNode;23;-4154.533,369.3532;Inherit;False;5;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;3;FLOAT;0;False;4;FLOAT;1;False;1;FLOAT;0
Node;AmplifyShaderEditor.NormalVertexDataNode;44;-4201.19,985.4062;Inherit;False;0;5;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.TexturePropertyNode;32;-3414.7,-1039.444;Float;True;Property;_MainTex;MainTex;8;0;Create;True;0;0;False;0;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;13;-3413.915,-622.4089;Float;True;Property;_ColorByNormal;Color By Normal;4;0;Create;True;0;0;False;0;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;10;-3411.312,-826.9905;Float;True;Property;_ColorByHeight;Color By Height;2;0;Create;True;0;0;False;0;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;14;-3011.122,-621.2454;Float;False;_ColorByNormal;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RangedFloatNode;38;-3893.935,1126.517;Float;False;Constant;_Float1;Float 1;5;0;Create;True;0;0;False;0;0.5;0;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;26;-3838.534,551.3537;Float;False;Constant;_Float0;Float 0;5;0;Create;True;0;0;False;0;0.5;0;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.SaturateNode;45;-3887.889,985.4063;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;12;-3008.519,-825.827;Float;False;_ColorByHeight;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.CommentaryNode;56;-4035.565,1390.725;Inherit;False;1219.639;322.5514;;4;53;49;50;47;Sample Color Map;1,1,1,1;0;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;33;-3015.051,-1030.608;Float;False;_MainTex;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;15;-3414.915,-403.4093;Float;True;Property;_ColorBlend;ColorBlend;6;0;Create;True;0;0;False;0;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;59;-3919.558,376.0131;Float;False;heightFraction;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.CommentaryNode;81;-5233.805,1785.144;Inherit;False;2426.761;752.334;;19;62;64;66;63;65;61;73;60;70;69;71;77;72;76;75;74;80;79;78;Blending;1,1,1,1;0;0
Node;AmplifyShaderEditor.GetLocalVarNode;62;-5183.805,2038.893;Inherit;False;59;heightFraction;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.DynamicAppendNode;41;-3664.434,1005.216;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.GetLocalVarNode;50;-3933.888,1440.725;Inherit;False;33;_MainTex;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RangedFloatNode;64;-5133.621,2129.977;Float;False;Constant;_Float2;Float 2;7;0;Create;True;0;0;False;0;0.5;0;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;16;-3012.122,-402.2459;Float;False;_ColorBlend;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TextureCoordinatesNode;47;-3977.185,1555.253;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.DynamicAppendNode;25;-3615.534,379.3532;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.GetLocalVarNode;40;-3757.434,898.2155;Inherit;False;14;_ColorByNormal;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;28;-3708.534,272.3531;Inherit;False;12;_ColorByHeight;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;66;-5168.621,1956.977;Inherit;False;16;_ColorBlend;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.SamplerNode;49;-3538.628,1451.898;Inherit;True;Property;_TextureSample2;Texture Sample 2;7;0;Create;True;0;0;False;0;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;6;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;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.DynamicAppendNode;63;-4954.622,2042.977;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.SamplerNode;27;-3372.534,307.3531;Inherit;True;Property;_TextureSample0;Texture Sample 0;5;0;Create;True;0;0;False;0;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;6;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;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.SamplerNode;42;-3421.434,933.2155;Inherit;True;Property;_TextureSample1;Texture Sample 1;5;0;Create;True;0;0;False;0;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;6;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;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.RegisterLocalVarNode;53;-3047.001,1457.485;Float;False;mainTexColor;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;43;-3060.277,935.2553;Float;False;colorByNormalResult;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;30;-3011.377,309.393;Float;False;colorByHeightResult;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.SamplerNode;65;-4679.621,1953.977;Inherit;True;Property;_TextureSample4;Texture Sample 4;7;0;Create;True;0;0;False;0;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;6;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;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.GetLocalVarNode;73;-4599.287,2422.477;Inherit;False;53;mainTexColor;1;0;OBJECT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.OneMinusNode;70;-4333.625,1985.977;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;60;-4642.066,1835.144;Inherit;False;30;colorByHeightResult;1;0;OBJECT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.GetLocalVarNode;61;-4645.817,2188.26;Inherit;False;43;colorByNormalResult;1;0;OBJECT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;71;-4138.626,2140.977;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.BreakToComponentsNode;77;-4250.572,2275.761;Inherit;False;COLOR;1;0;COLOR;0,0,0,0;False;16;FLOAT;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4;FLOAT;5;FLOAT;6;FLOAT;7;FLOAT;8;FLOAT;9;FLOAT;10;FLOAT;11;FLOAT;12;FLOAT;13;FLOAT;14;FLOAT;15
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;69;-4135.626,1912.978;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.OneMinusNode;76;-3935.575,2155.761;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleAddOpNode;72;-3930.628,2002.977;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.ColorNode;7;-3399.708,-1232.622;Float;False;Property;_Color;Color;1;0;Create;True;0;0;False;0;1,1,1,1;1,1,1,1;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;75;-3708.765,2001.316;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;9;-3028.91,-1234.338;Float;False;_Color;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.GetLocalVarNode;80;-3520.034,2185.513;Inherit;False;9;_Color;1;0;OBJECT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.SimpleAddOpNode;74;-3476.92,1997.653;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.RangedFloatNode;84;-3326.386,80.75391;Float;False;Property;_Gloss;Gloss;5;0;Create;True;0;0;False;0;1;0.5;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;79;-3257.034,2000.514;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.RangedFloatNode;83;-3454.556,-7.28418;Float;False;Property;_Specular;Specular;3;0;Create;True;0;0;False;0;0.5;0;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;78;-3050.051,1991.049;Float;False;albedoResult;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;86;-3003.283,75.73693;Float;False;_Gloss;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;85;-3005.973,-12.90144;Float;False;_Specular;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;87;-2405.805,217.1925;Inherit;False;85;_Specular;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;88;-2394.805,303.1925;Inherit;False;86;_Gloss;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;31;-2429.736,122.1925;Inherit;False;78;albedoResult;1;0;OBJECT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;18;-3008.649,-192.5653;Float;False;_Dimension;-1;True;1;0;FLOAT3;0,0,0;False;1;FLOAT3;0
Node;AmplifyShaderEditor.StandardSurfaceOutputNode;82;-2051.866,136.1994;Half;False;True;-1;2;;0;0;BlinnPhong;Polaris/BuiltinRP/Terrain/BlinnPhong_GradientLookup;False;False;False;False;False;False;False;False;False;False;False;False;False;True;False;False;False;True;False;False;False;Back;0;False;-1;0;False;-1;False;0;False;-1;0;False;-1;False;0;Opaque;0.5;True;True;0;False;Opaque;;Geometry;All;14;all;True;True;True;True;0;False;-1;False;0;False;-1;255;False;-1;255;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;False;2;15;10;25;False;0.5;True;0;0;False;-1;0;False;-1;0;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;0;0,0,0,0;VertexOffset;True;False;Cylindrical;False;Relative;0;;-1;-1;-1;-1;0;False;0;0;False;-1;0;0;False;-1;0;0;0;False;0.1;False;-1;0;False;-1;15;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;2;FLOAT3;0,0,0;False;3;FLOAT;0;False;4;FLOAT;0;False;6;FLOAT3;0,0,0;False;7;FLOAT3;0,0,0;False;8;FLOAT;0;False;9;FLOAT;0;False;10;FLOAT;0;False;13;FLOAT3;0,0,0;False;11;FLOAT3;0,0,0;False;12;FLOAT3;0,0,0;False;14;FLOAT4;0,0,0,0;False;15;FLOAT3;0,0,0;False;0
WireConnection;22;0;17;2
WireConnection;23;0;20;2
WireConnection;23;2;21;0
WireConnection;14;0;13;0
WireConnection;45;0;44;2
WireConnection;12;0;10;0
WireConnection;33;0;32;0
WireConnection;59;0;23;0
WireConnection;41;0;45;0
WireConnection;41;1;38;0
WireConnection;16;0;15;0
WireConnection;25;0;59;0
WireConnection;25;1;26;0
WireConnection;49;0;50;0
WireConnection;49;1;47;0
WireConnection;63;0;62;0
WireConnection;63;1;64;0
WireConnection;27;0;28;0
WireConnection;27;1;25;0
WireConnection;42;0;40;0
WireConnection;42;1;41;0
WireConnection;53;0;49;0
WireConnection;43;0;42;0
WireConnection;30;0;27;0
WireConnection;65;0;66;0
WireConnection;65;1;63;0
WireConnection;70;0;65;1
WireConnection;71;0;61;0
WireConnection;71;1;65;1
WireConnection;77;0;73;0
WireConnection;69;0;60;0
WireConnection;69;1;70;0
WireConnection;76;0;77;3
WireConnection;72;0;69;0
WireConnection;72;1;71;0
WireConnection;75;0;72;0
WireConnection;75;1;76;0
WireConnection;9;0;7;0
WireConnection;74;0;75;0
WireConnection;74;1;73;0
WireConnection;79;0;74;0
WireConnection;79;1;80;0
WireConnection;78;0;79;0
WireConnection;86;0;84;0
WireConnection;85;0;83;0
WireConnection;18;0;17;0
WireConnection;82;0;31;0
WireConnection;82;3;87;0
WireConnection;82;4;88;0
ASEEND*/
//CHKSM=6E8DCA84CCEA4EB8FF348992A7D73051319B9D7A

View File

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

View File

@@ -0,0 +1,75 @@
// Made with Amplify Shader Editor
// Available at the Unity Asset Store - http://u3d.as/y3X
Shader "Polaris/BuiltinRP/Terrain/BlinnPhong_VertexColor"
{
Properties
{
_SpecColor("Specular Color",Color)=(1,1,1,1)
_Color("Color", Color) = (1,1,1,1)
_Specular("Specular", Range( 0 , 1)) = 0.5
_Gloss("Gloss", Float) = 1
[HideInInspector] __dirty( "", Int ) = 1
}
SubShader
{
Tags{ "RenderType" = "Opaque" "Queue" = "Geometry+0" "DisableBatching" = "True" }
Cull Back
CGPROGRAM
#pragma target 3.0
#pragma surface surf BlinnPhong keepalpha addshadow fullforwardshadows noinstancing
struct Input
{
float4 vertexColor : COLOR;
};
uniform float4 _Color;
uniform float _Specular;
uniform float _Gloss;
void surf( Input i , inout SurfaceOutput o )
{
float4 _Color5 = _Color;
float4 albedo10 = ( _Color5 * i.vertexColor );
o.Albedo = albedo10.rgb;
float _Specular22 = _Specular;
o.Specular = _Specular22;
float _Gloss23 = _Gloss;
o.Gloss = _Gloss23;
o.Alpha = 1;
}
ENDCG
}
Fallback "Diffuse"
}
/*ASEBEGIN
Version=18000
1244;197;1906;885;1318.705;591.2894;1;True;False
Node;AmplifyShaderEditor.CommentaryNode;6;-1027,-650;Inherit;False;587;419;;6;23;22;21;20;5;4;Properties;1,1,1,1;0;0
Node;AmplifyShaderEditor.ColorNode;4;-941,-600;Float;False;Property;_Color;Color;1;0;Create;True;0;0;False;0;1,1,1,1;1,1,1,1;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.CommentaryNode;11;-1163.788,-95.79129;Inherit;False;731;378;;4;7;8;9;10;Albedo;1,1,1,1;0;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;5;-655,-597;Float;False;_Color;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.VertexColorNode;7;-1102.788,80.20869;Inherit;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.GetLocalVarNode;8;-1113.788,-45.79129;Inherit;False;5;_Color;1;0;OBJECT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;9;-866.7881,15.20871;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.RangedFloatNode;20;-1007.711,-422.6499;Float;False;Property;_Specular;Specular;2;0;Create;True;0;0;False;0;0.5;0;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;21;-879.5408,-334.6118;Float;False;Property;_Gloss;Gloss;3;0;Create;True;0;0;False;0;1;0.5;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;10;-675.7881,15.20871;Float;False;albedo;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;22;-657.1277,-426.2672;Float;False;_Specular;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;23;-663.4377,-343.6288;Float;False;_Gloss;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;16;-207.7881,-420.7913;Inherit;False;10;albedo;1;0;OBJECT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.GetLocalVarNode;24;-219.705,-318.2894;Inherit;False;22;_Specular;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;25;-208.705,-230.2894;Inherit;False;23;_Gloss;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.StandardSurfaceOutputNode;19;69,-386;Half;False;True;-1;2;;0;0;BlinnPhong;Polaris/BuiltinRP/Terrain/BlinnPhong_VertexColor;False;False;False;False;False;False;False;False;False;False;False;False;False;True;False;False;False;True;False;False;False;Back;0;False;-1;0;False;-1;False;0;False;-1;0;False;-1;False;0;Opaque;0.5;True;True;0;False;Opaque;;Geometry;All;14;all;True;True;True;True;0;False;-1;False;0;False;-1;255;False;-1;255;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;False;2;15;10;25;False;0.5;True;0;0;False;-1;0;False;-1;0;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;0;0,0,0,0;VertexOffset;True;False;Cylindrical;False;Relative;0;;-1;-1;-1;-1;0;False;0;0;False;-1;0;0;False;-1;0;0;0;False;0.1;False;-1;0;False;-1;15;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;2;FLOAT3;0,0,0;False;3;FLOAT;0;False;4;FLOAT;0;False;6;FLOAT3;0,0,0;False;7;FLOAT3;0,0,0;False;8;FLOAT;0;False;9;FLOAT;0;False;10;FLOAT;0;False;13;FLOAT3;0,0,0;False;11;FLOAT3;0,0,0;False;12;FLOAT3;0,0,0;False;14;FLOAT4;0,0,0,0;False;15;FLOAT3;0,0,0;False;0
WireConnection;5;0;4;0
WireConnection;9;0;8;0
WireConnection;9;1;7;0
WireConnection;10;0;9;0
WireConnection;22;0;20;0
WireConnection;23;0;21;0
WireConnection;19;0;16;0
WireConnection;19;3;24;0
WireConnection;19;4;25;0
ASEEND*/
//CHKSM=0365DD07D49874EBC9EE5285F280A3D11964812B

View File

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

View File

@@ -0,0 +1,102 @@
// Made with Amplify Shader Editor
// Available at the Unity Asset Store - http://u3d.as/y3X
Shader "Polaris/BuiltinRP/Terrain/Lambert_4Splats"
{
Properties
{
_Color("Color", Color) = (1,1,1,1)
_Control0("Control0", 2D) = "black" {}
_Splat0("Splat0", 2D) = "white" {}
_Splat1("Splat1", 2D) = "white" {}
_Splat2("Splat2", 2D) = "white" {}
_Splat3("Splat3", 2D) = "white" {}
[HideInInspector] _texcoord( "", 2D ) = "white" {}
[HideInInspector] __dirty( "", Int ) = 1
}
SubShader
{
Tags{ "RenderType" = "Opaque" "Queue" = "Geometry+0" "DisableBatching" = "True" }
Cull Back
CGPROGRAM
#pragma target 3.0
#pragma surface surf Lambert keepalpha addshadow fullforwardshadows noinstancing
struct Input
{
float2 uv_texcoord;
};
uniform float4 _Color;
uniform sampler2D _Splat0;
uniform float4 _Splat0_ST;
uniform sampler2D _Control0;
uniform sampler2D _Splat1;
uniform float4 _Splat1_ST;
uniform sampler2D _Splat2;
uniform float4 _Splat2_ST;
uniform sampler2D _Splat3;
uniform float4 _Splat3_ST;
void surf( Input i , inout SurfaceOutput o )
{
float4 _Color59 = _Color;
float2 uv0_Splat0 = i.uv_texcoord * _Splat0_ST.xy + _Splat0_ST.zw;
half4 break34_g1 = tex2D( _Control0, i.uv_texcoord );
float2 uv0_Splat1 = i.uv_texcoord * _Splat1_ST.xy + _Splat1_ST.zw;
float2 uv0_Splat2 = i.uv_texcoord * _Splat2_ST.xy + _Splat2_ST.zw;
float2 uv0_Splat3 = i.uv_texcoord * _Splat3_ST.xy + _Splat3_ST.zw;
float4 splatColor52_g1 = ( ( tex2D( _Splat0, uv0_Splat0 ) * break34_g1.r ) + ( tex2D( _Splat1, uv0_Splat1 ) * break34_g1.g ) + ( tex2D( _Splat2, uv0_Splat2 ) * break34_g1.b ) + ( tex2D( _Splat3, uv0_Splat3 ) * break34_g1.a ) );
float4 albedo55 = ( _Color59 * splatColor52_g1 );
o.Albedo = albedo55.rgb;
o.Alpha = 1;
}
ENDCG
}
Fallback "Diffuse"
}
/*ASEBEGIN
Version=18000
1244;197;1906;885;2030.482;545.588;1.6;True;False
Node;AmplifyShaderEditor.CommentaryNode;5;-2705.477,-1354.525;Inherit;False;595.4381;1353.156;;12;59;6;26;12;11;9;10;7;13;8;31;58;Inputs;1,1,1,1;0;0
Node;AmplifyShaderEditor.TexturePropertyNode;10;-2636.643,-426.1253;Float;True;Property;_Splat2;Splat2;4;0;Create;True;0;0;False;0;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;7;-2646.643,-868.1251;Float;True;Property;_Splat0;Splat0;2;0;Create;True;0;0;False;0;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;13;-2638.187,-210.5692;Float;True;Property;_Splat3;Splat3;5;0;Create;True;0;0;False;0;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;8;-2641.643,-636.1255;Float;True;Property;_Splat1;Splat1;3;0;Create;True;0;0;False;0;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;31;-2646.643,-1090.125;Float;True;Property;_Control0;Control0;1;0;Create;True;0;0;False;0;None;None;False;black;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.CommentaryNode;65;-2707.217,82.32843;Inherit;False;1217.75;531.1187;;9;40;41;39;38;42;67;55;60;61;Albedo, Metallic, Smoothness;1,1,1,1;0;0
Node;AmplifyShaderEditor.ColorNode;58;-2648.181,-1280.629;Float;False;Property;_Color;Color;0;0;Create;True;0;0;False;0;1,1,1,1;1,1,1,1;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.RegisterLocalVarNode;12;-2340.186,-206.5692;Float;False;_Splat3;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;6;-2348.642,-864.1251;Float;False;_Splat0;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;11;-2338.642,-422.1253;Float;False;_Splat2;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;9;-2343.642,-632.1255;Float;False;_Splat1;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;26;-2348.642,-1086.125;Float;False;_Control;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;41;-2641.59,430.8285;Inherit;False;11;_Splat2;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;39;-2645.59,270.8285;Inherit;False;6;_Splat0;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;38;-2648.59,190.8285;Inherit;False;26;_Control;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;42;-2640.59,508.8288;Inherit;False;12;_Splat3;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;40;-2644.59,350.8284;Inherit;False;9;_Splat1;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;59;-2353.028,-1282.264;Float;False;_Color;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.FunctionNode;67;-2343.82,308.0544;Inherit;False;Sample4Splats;-1;;1;563b5268ffef6d8479bb5dc663a94e53;0;5;54;SAMPLER2D;0;False;55;SAMPLER2D;0;False;56;SAMPLER2D;0;False;57;SAMPLER2D;0;False;58;SAMPLER2D;0;False;1;COLOR;0
Node;AmplifyShaderEditor.GetLocalVarNode;61;-2245.136,166.0216;Inherit;False;59;_Color;1;0;OBJECT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;60;-1968.135,270.0217;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;55;-1730.163,264.757;Float;False;albedo;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.GetLocalVarNode;62;-309.2018,0.01220703;Inherit;False;55;albedo;1;0;OBJECT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.StandardSurfaceOutputNode;66;0,0;Half;False;True;-1;2;;0;0;Lambert;Polaris/BuiltinRP/Terrain/Lambert_4Splats;False;False;False;False;False;False;False;False;False;False;False;False;False;True;False;False;False;True;False;False;False;Back;0;False;-1;0;False;-1;False;0;False;-1;0;False;-1;False;0;Opaque;0.5;True;True;0;False;Opaque;;Geometry;All;14;all;True;True;True;True;0;False;-1;False;0;False;-1;255;False;-1;255;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;False;2;15;10;25;False;0.5;True;0;0;False;-1;0;False;-1;0;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;0;0,0,0,0;VertexOffset;True;False;Cylindrical;False;Relative;0;;-1;-1;-1;-1;0;False;0;0;False;-1;-1;0;False;-1;0;0;0;False;0.1;False;-1;0;False;-1;15;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;2;FLOAT3;0,0,0;False;3;FLOAT;0;False;4;FLOAT;0;False;6;FLOAT3;0,0,0;False;7;FLOAT3;0,0,0;False;8;FLOAT;0;False;9;FLOAT;0;False;10;FLOAT;0;False;13;FLOAT3;0,0,0;False;11;FLOAT3;0,0,0;False;12;FLOAT3;0,0,0;False;14;FLOAT4;0,0,0,0;False;15;FLOAT3;0,0,0;False;0
WireConnection;12;0;13;0
WireConnection;6;0;7;0
WireConnection;11;0;10;0
WireConnection;9;0;8;0
WireConnection;26;0;31;0
WireConnection;59;0;58;0
WireConnection;67;54;38;0
WireConnection;67;55;39;0
WireConnection;67;56;40;0
WireConnection;67;57;41;0
WireConnection;67;58;42;0
WireConnection;60;0;61;0
WireConnection;60;1;67;0
WireConnection;55;0;60;0
WireConnection;66;0;62;0
ASEEND*/
//CHKSM=2DB8BD90FE1D6E291D0B2220537DA7A8E6E053A0

View File

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

View File

@@ -0,0 +1,141 @@
// Made with Amplify Shader Editor
// Available at the Unity Asset Store - http://u3d.as/y3X
Shader "Polaris/BuiltinRP/Terrain/Lambert_4Splats4Normals"
{
Properties
{
_Color("Color", Color) = (1,1,1,1)
_Control0("Control0", 2D) = "black" {}
_Splat0("Splat0", 2D) = "white" {}
_Splat1("Splat1", 2D) = "white" {}
_Splat2("Splat2", 2D) = "white" {}
_Splat3("Splat3", 2D) = "white" {}
_Normal0("Normal0", 2D) = "bump" {}
_Normal1("Normal1", 2D) = "bump" {}
_Normal2("Normal2", 2D) = "bump" {}
_Normal3("Normal3", 2D) = "bump" {}
[HideInInspector] _texcoord( "", 2D ) = "white" {}
[HideInInspector] __dirty( "", Int ) = 1
}
SubShader
{
Tags{ "RenderType" = "Opaque" "Queue" = "Geometry+0" "DisableBatching" = "True" }
Cull Back
CGPROGRAM
#pragma target 3.0
#pragma surface surf Lambert keepalpha addshadow fullforwardshadows noinstancing
struct Input
{
float2 uv_texcoord;
};
uniform sampler2D _Normal0;
uniform sampler2D _Splat0;
uniform float4 _Splat0_ST;
uniform sampler2D _Control0;
uniform sampler2D _Normal1;
uniform sampler2D _Splat1;
uniform float4 _Splat1_ST;
uniform sampler2D _Normal2;
uniform sampler2D _Splat2;
uniform float4 _Splat2_ST;
uniform sampler2D _Normal3;
uniform sampler2D _Splat3;
uniform float4 _Splat3_ST;
uniform float4 _Color;
void surf( Input i , inout SurfaceOutput o )
{
float2 uv0_Splat0 = i.uv_texcoord * _Splat0_ST.xy + _Splat0_ST.zw;
half4 tex2DNode31_g15 = tex2D( _Control0, i.uv_texcoord );
half4 break125_g15 = tex2DNode31_g15;
float2 uv0_Splat1 = i.uv_texcoord * _Splat1_ST.xy + _Splat1_ST.zw;
float2 uv0_Splat2 = i.uv_texcoord * _Splat2_ST.xy + _Splat2_ST.zw;
float2 uv0_Splat3 = i.uv_texcoord * _Splat3_ST.xy + _Splat3_ST.zw;
half3 lerpResult128_g15 = lerp( float3(0,0,0.5) , UnpackNormal( ( ( tex2D( _Normal0, uv0_Splat0 ) * break125_g15.r ) + ( tex2D( _Normal1, uv0_Splat1 ) * break125_g15.g ) + ( tex2D( _Normal2, uv0_Splat2 ) * break125_g15.b ) + ( tex2D( _Normal3, uv0_Splat3 ) * break125_g15.a ) ) ) , ( break125_g15.r + break125_g15.g + break125_g15.b + break125_g15.a ));
float3 normalVector114_g15 = lerpResult128_g15;
float3 normalVector80 = normalVector114_g15;
o.Normal = normalVector80;
float4 _Color59 = _Color;
half4 break34_g15 = tex2DNode31_g15;
float4 splatColor52_g15 = ( ( tex2D( _Splat0, uv0_Splat0 ) * break34_g15.r ) + ( tex2D( _Splat1, uv0_Splat1 ) * break34_g15.g ) + ( tex2D( _Splat2, uv0_Splat2 ) * break34_g15.b ) + ( tex2D( _Splat3, uv0_Splat3 ) * break34_g15.a ) );
float4 albedo55 = ( _Color59 * splatColor52_g15 );
o.Albedo = albedo55.rgb;
o.Alpha = 1;
}
ENDCG
}
Fallback "Diffuse"
CustomEditor "ASEMaterialInspector"
}
/*ASEBEGIN
Version=18000
1244;197;1906;885;5893.356;1293.213;4.729704;True;False
Node;AmplifyShaderEditor.CommentaryNode;5;-2582.276,-1258.525;Inherit;False;1849.843;1153.783;;20;73;72;71;70;69;68;67;66;11;9;6;12;8;13;10;7;59;26;58;31;Inputs;1,1,1,1;0;0
Node;AmplifyShaderEditor.TexturePropertyNode;69;-1303.146,-751.9892;Float;True;Property;_Normal1;Normal1;7;0;Create;True;0;0;False;0;None;None;False;bump;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;66;-1308.146,-983.9891;Float;True;Property;_Normal0;Normal0;6;0;Create;True;0;0;False;0;None;None;False;bump;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;10;-1862.24,-544.5253;Float;True;Property;_Splat2;Splat2;4;0;Create;True;0;0;False;0;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;31;-1872.24,-1208.525;Float;True;Property;_Control0;Control0;1;0;Create;True;0;0;False;0;None;None;False;black;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;13;-1863.784,-328.9691;Float;True;Property;_Splat3;Splat3;5;0;Create;True;0;0;False;0;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;68;-1299.69,-326.4331;Float;True;Property;_Normal3;Normal3;9;0;Create;True;0;0;False;0;None;None;False;bump;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;7;-1872.24,-986.5253;Float;True;Property;_Splat0;Splat0;2;0;Create;True;0;0;False;0;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;8;-1867.24,-754.5253;Float;True;Property;_Splat1;Splat1;3;0;Create;True;0;0;False;0;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;67;-1298.146,-541.9893;Float;True;Property;_Normal2;Normal2;8;0;Create;True;0;0;False;0;None;None;False;bump;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;71;-1010.146,-979.9891;Float;False;_Normal0;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;6;-1574.24,-982.5253;Float;False;_Splat0;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;26;-1574.24,-1204.525;Float;False;_Control;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;72;-1005.146,-747.9892;Float;False;_Normal1;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;12;-1565.784,-324.9691;Float;False;_Splat3;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;73;-1000.146,-537.9894;Float;False;_Normal2;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;70;-1001.69,-322.4331;Float;False;_Normal3;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;11;-1564.24,-540.5253;Float;False;_Splat2;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.ColorNode;58;-2524.98,-1184.629;Float;False;Property;_Color;Color;0;0;Create;True;0;0;False;0;1,1,1,1;1,1,1,1;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.CommentaryNode;65;-2670.415,123.9284;Inherit;False;1408.794;881.6259;;14;77;79;76;38;42;41;78;40;39;84;80;55;60;61;Albedo, Normal, Metallic, Smoothness;1,1,1,1;0;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;9;-1569.24,-750.5253;Float;False;_Splat1;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;78;-2499.586,662.4363;Inherit;False;71;_Normal0;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;76;-2495.586,822.4363;Inherit;False;73;_Normal2;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;38;-2502.589,251.9284;Inherit;False;26;_Control;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;41;-2495.589,491.9284;Inherit;False;11;_Splat2;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;42;-2494.589,569.9283;Inherit;False;12;_Splat3;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;40;-2498.589,411.9284;Inherit;False;9;_Splat1;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;77;-2497.286,739.8362;Inherit;False;72;_Normal1;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;59;-2193.028,-1186.264;Float;False;_Color;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.GetLocalVarNode;79;-2494.586,900.4363;Inherit;False;70;_Normal3;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;39;-2499.589,331.9284;Inherit;False;6;_Splat0;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.FunctionNode;84;-2116.618,505.0056;Inherit;False;Sample4Splats4Normals;-1;;15;45f7d1aa5e9d58743aec839bd3751783;0;9;54;SAMPLER2D;0;False;55;SAMPLER2D;0;False;56;SAMPLER2D;0;False;57;SAMPLER2D;0;False;58;SAMPLER2D;0;False;100;SAMPLER2D;0;False;101;SAMPLER2D;0;False;105;SAMPLER2D;0;False;102;SAMPLER2D;0;False;2;COLOR;0;FLOAT3;132
Node;AmplifyShaderEditor.GetLocalVarNode;61;-2006.835,362.3217;Inherit;False;59;_Color;1;0;OBJECT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;60;-1729.835,466.3217;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;80;-1490.6,559.9918;Float;False;normalVector;-1;True;1;0;FLOAT3;0,0,0;False;1;FLOAT3;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;55;-1491.863,461.057;Float;False;albedo;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.GetLocalVarNode;62;-329.2018,-75.98779;Inherit;False;55;albedo;1;0;OBJECT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.GetLocalVarNode;81;-357.1204,12.14795;Inherit;False;80;normalVector;1;0;OBJECT;0;False;1;FLOAT3;0
Node;AmplifyShaderEditor.StandardSurfaceOutputNode;83;0,0;Half;False;True;-1;2;ASEMaterialInspector;0;0;Lambert;Polaris/BuiltinRP/Terrain/Lambert_4Splats4Normals;False;False;False;False;False;False;False;False;False;False;False;False;False;True;False;False;False;True;False;False;False;Back;0;False;-1;0;False;-1;False;0;False;-1;0;False;-1;False;0;Opaque;0.5;True;True;0;False;Opaque;;Geometry;All;14;all;True;True;True;True;0;False;-1;False;0;False;-1;255;False;-1;255;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;False;2;15;10;25;False;0.5;True;0;0;False;-1;0;False;-1;0;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;0;0,0,0,0;VertexOffset;True;False;Cylindrical;False;Relative;0;;-1;-1;-1;-1;0;False;0;0;False;-1;-1;0;False;-1;0;0;0;False;0.1;False;-1;0;False;-1;15;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;2;FLOAT3;0,0,0;False;3;FLOAT;0;False;4;FLOAT;0;False;6;FLOAT3;0,0,0;False;7;FLOAT3;0,0,0;False;8;FLOAT;0;False;9;FLOAT;0;False;10;FLOAT;0;False;13;FLOAT3;0,0,0;False;11;FLOAT3;0,0,0;False;12;FLOAT3;0,0,0;False;14;FLOAT4;0,0,0,0;False;15;FLOAT3;0,0,0;False;0
WireConnection;71;0;66;0
WireConnection;6;0;7;0
WireConnection;26;0;31;0
WireConnection;72;0;69;0
WireConnection;12;0;13;0
WireConnection;73;0;67;0
WireConnection;70;0;68;0
WireConnection;11;0;10;0
WireConnection;9;0;8;0
WireConnection;59;0;58;0
WireConnection;84;54;38;0
WireConnection;84;55;39;0
WireConnection;84;56;40;0
WireConnection;84;57;41;0
WireConnection;84;58;42;0
WireConnection;84;100;78;0
WireConnection;84;101;77;0
WireConnection;84;105;76;0
WireConnection;84;102;79;0
WireConnection;60;0;61;0
WireConnection;60;1;84;0
WireConnection;80;0;84;132
WireConnection;55;0;60;0
WireConnection;83;0;62;0
WireConnection;83;1;81;0
ASEEND*/
//CHKSM=D795A960BA64D4A8B091C859EC8E5EC086ED2A60

View File

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

View File

@@ -0,0 +1,161 @@
// Made with Amplify Shader Editor
// Available at the Unity Asset Store - http://u3d.as/y3X
Shader "Polaris/BuiltinRP/Terrain/Lambert_8Splats"
{
Properties
{
_Color("Color", Color) = (1,1,1,1)
_Control0("Control0", 2D) = "black" {}
_Control1("Control1", 2D) = "black" {}
_Splat0("Splat0", 2D) = "white" {}
_Splat1("Splat1", 2D) = "white" {}
_Splat2("Splat2", 2D) = "white" {}
_Splat3("Splat3", 2D) = "white" {}
_Splat4("Splat4", 2D) = "white" {}
_Splat5("Splat5", 2D) = "white" {}
_Splat6("Splat6", 2D) = "white" {}
_Splat7("Splat7", 2D) = "white" {}
[HideInInspector] _texcoord( "", 2D ) = "white" {}
[HideInInspector] __dirty( "", Int ) = 1
}
SubShader
{
Tags{ "RenderType" = "Opaque" "Queue" = "Geometry+0" "DisableBatching" = "True" }
Cull Back
CGPROGRAM
#pragma target 3.0
#pragma surface surf Lambert keepalpha addshadow fullforwardshadows noinstancing
struct Input
{
float2 uv_texcoord;
};
uniform float4 _Color;
uniform sampler2D _Splat0;
uniform float4 _Splat0_ST;
uniform sampler2D _Control0;
uniform sampler2D _Splat1;
uniform float4 _Splat1_ST;
uniform sampler2D _Splat2;
uniform float4 _Splat2_ST;
uniform sampler2D _Splat3;
uniform float4 _Splat3_ST;
uniform sampler2D _Splat4;
uniform float4 _Splat4_ST;
uniform sampler2D _Control1;
uniform sampler2D _Splat5;
uniform float4 _Splat5_ST;
uniform sampler2D _Splat6;
uniform float4 _Splat6_ST;
uniform sampler2D _Splat7;
uniform float4 _Splat7_ST;
void surf( Input i , inout SurfaceOutput o )
{
float4 _Color59 = _Color;
float2 uv0_Splat0 = i.uv_texcoord * _Splat0_ST.xy + _Splat0_ST.zw;
half4 break34_g20 = tex2D( _Control0, i.uv_texcoord );
float2 uv0_Splat1 = i.uv_texcoord * _Splat1_ST.xy + _Splat1_ST.zw;
float2 uv0_Splat2 = i.uv_texcoord * _Splat2_ST.xy + _Splat2_ST.zw;
float2 uv0_Splat3 = i.uv_texcoord * _Splat3_ST.xy + _Splat3_ST.zw;
float4 splatColor52_g20 = ( ( tex2D( _Splat0, uv0_Splat0 ) * break34_g20.r ) + ( tex2D( _Splat1, uv0_Splat1 ) * break34_g20.g ) + ( tex2D( _Splat2, uv0_Splat2 ) * break34_g20.b ) + ( tex2D( _Splat3, uv0_Splat3 ) * break34_g20.a ) );
float4 splatColor055 = splatColor52_g20;
float2 uv0_Splat4 = i.uv_texcoord * _Splat4_ST.xy + _Splat4_ST.zw;
half4 break34_g19 = tex2D( _Control1, i.uv_texcoord );
float2 uv0_Splat5 = i.uv_texcoord * _Splat5_ST.xy + _Splat5_ST.zw;
float2 uv0_Splat6 = i.uv_texcoord * _Splat6_ST.xy + _Splat6_ST.zw;
float2 uv0_Splat7 = i.uv_texcoord * _Splat7_ST.xy + _Splat7_ST.zw;
float4 splatColor52_g19 = ( ( tex2D( _Splat4, uv0_Splat4 ) * break34_g19.r ) + ( tex2D( _Splat5, uv0_Splat5 ) * break34_g19.g ) + ( tex2D( _Splat6, uv0_Splat6 ) * break34_g19.b ) + ( tex2D( _Splat7, uv0_Splat7 ) * break34_g19.a ) );
float4 splatColor1117 = splatColor52_g19;
float4 albedoColor125 = ( _Color59 * ( splatColor055 + splatColor1117 ) );
o.Albedo = albedoColor125.rgb;
o.Alpha = 1;
}
ENDCG
}
Fallback "Diffuse"
}
/*ASEBEGIN
Version=18000
1244;197;1906;885;3486.251;957.113;2.223665;True;False
Node;AmplifyShaderEditor.CommentaryNode;5;-2709.488,-2432.581;Inherit;False;1792.826;1170.514;;22;59;58;9;6;26;12;71;72;73;70;84;11;10;8;31;7;68;83;66;67;69;13;Inputs;1,1,1,1;0;0
Node;AmplifyShaderEditor.TexturePropertyNode;31;-2079.251,-2382.581;Float;True;Property;_Control0;Control0;1;0;Create;True;0;0;False;0;None;None;False;black;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;10;-2069.251,-1718.582;Float;True;Property;_Splat2;Splat2;5;0;Create;True;0;0;False;0;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;7;-2079.251,-2160.582;Float;True;Property;_Splat0;Splat0;3;0;Create;True;0;0;False;0;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;68;-1506.701,-1500.49;Float;True;Property;_Splat7;Splat7;10;0;Create;True;0;0;False;0;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;8;-2074.251,-1928.582;Float;True;Property;_Splat1;Splat1;4;0;Create;True;0;0;False;0;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;66;-1515.157,-2158.046;Float;True;Property;_Splat4;Splat4;7;0;Create;True;0;0;False;0;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;67;-1505.157,-1716.046;Float;True;Property;_Splat6;Splat6;9;0;Create;True;0;0;False;0;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;13;-2070.795,-1503.025;Float;True;Property;_Splat3;Splat3;6;0;Create;True;0;0;False;0;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;83;-1515.058,-2377.599;Float;True;Property;_Control1;Control1;2;0;Create;True;0;0;False;0;None;None;False;black;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;69;-1510.157,-1926.045;Float;True;Property;_Splat5;Splat5;8;0;Create;True;0;0;False;0;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;70;-1208.702,-1496.49;Float;False;_Splat7;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;72;-1212.158,-1922.045;Float;False;_Splat5;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;73;-1207.158,-1712.046;Float;False;_Splat6;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;71;-1217.158,-2154.046;Float;False;_Splat4;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;84;-1217.058,-2373.599;Float;False;_Control1;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;11;-1771.251,-1714.582;Float;False;_Splat2;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.CommentaryNode;102;-3088.116,-454.5433;Inherit;False;962.8787;466.6581;;7;117;137;113;114;115;110;112;Second layer;1,1,1,1;0;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;6;-1781.251,-2156.582;Float;False;_Splat0;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.CommentaryNode;65;-3024.415,-1017.926;Inherit;False;882.7046;478.625;;7;55;41;38;39;40;42;136;First layer;1,1,1,1;0;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;12;-1772.795,-1499.026;Float;False;_Splat3;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;26;-1781.251,-2378.581;Float;False;_Control0;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;9;-1776.251,-1924.582;Float;False;_Splat1;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;114;-3013.49,-324.5442;Inherit;False;71;_Splat4;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;42;-2973.511,-640.7599;Inherit;False;12;_Splat3;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;112;-3008.49,-86.54466;Inherit;False;70;_Splat7;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;113;-3012.49,-244.5443;Inherit;False;72;_Splat5;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;110;-3016.49,-404.5437;Inherit;False;84;_Control1;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;38;-2981.511,-958.7596;Inherit;False;26;_Control0;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;39;-2978.511,-878.7599;Inherit;False;6;_Splat0;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;40;-2977.511,-798.7598;Inherit;False;9;_Splat1;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;41;-2974.511,-718.7598;Inherit;False;11;_Splat2;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;115;-3009.49,-164.5444;Inherit;False;73;_Splat6;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.FunctionNode;137;-2677.408,-287.2572;Inherit;False;Sample4Splats;-1;;19;563b5268ffef6d8479bb5dc663a94e53;0;5;54;SAMPLER2D;0;False;55;SAMPLER2D;0;False;56;SAMPLER2D;0;False;57;SAMPLER2D;0;False;58;SAMPLER2D;0;False;1;COLOR;0
Node;AmplifyShaderEditor.FunctionNode;136;-2711.357,-831.6314;Inherit;False;Sample4Splats;-1;;20;563b5268ffef6d8479bb5dc663a94e53;0;5;54;SAMPLER2D;0;False;55;SAMPLER2D;0;False;56;SAMPLER2D;0;False;57;SAMPLER2D;0;False;58;SAMPLER2D;0;False;1;COLOR;0
Node;AmplifyShaderEditor.ColorNode;58;-2645.673,-2373.899;Float;False;Property;_Color;Color;0;0;Create;True;0;0;False;0;1,1,1,1;1,1,1,1;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.RegisterLocalVarNode;117;-2372.176,-284.4217;Float;False;splatColor1;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;55;-2359.53,-838.5478;Float;False;splatColor0;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.CommentaryNode;134;-1923.133,-1016.12;Inherit;False;993.3678;323.2437;;6;125;124;123;122;120;121;Blend Addictive;1,1,1,1;0;0
Node;AmplifyShaderEditor.GetLocalVarNode;120;-1869.316,-915.3834;Inherit;False;55;splatColor0;1;0;OBJECT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.GetLocalVarNode;121;-1870.723,-819.7946;Inherit;False;117;splatColor1;1;0;OBJECT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;59;-2313.72,-2375.534;Float;False;_Color;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.GetLocalVarNode;123;-1615.276,-966.1201;Inherit;False;59;_Color;1;0;OBJECT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.SimpleAddOpNode;122;-1562.87,-874.6176;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;124;-1378.276,-882.1201;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;125;-1172.276,-887.1201;Float;False;albedoColor;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.GetLocalVarNode;62;-1506.905,-528.8466;Inherit;False;125;albedoColor;1;0;OBJECT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.StandardSurfaceOutputNode;135;-1217.387,-533.661;Half;False;True;-1;2;;0;0;Lambert;Polaris/BuiltinRP/Terrain/Lambert_8Splats;False;False;False;False;False;False;False;False;False;False;False;False;False;True;False;False;False;True;False;False;False;Back;0;False;-1;0;False;-1;False;0;False;-1;0;False;-1;False;0;Opaque;0.5;True;True;0;False;Opaque;;Geometry;All;14;all;True;True;True;True;0;False;-1;False;0;False;-1;255;False;-1;255;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;False;2;15;10;25;False;0.5;True;0;0;False;-1;0;False;-1;0;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;0;0,0,0,0;VertexOffset;True;False;Cylindrical;False;Relative;0;;-1;-1;-1;-1;0;False;0;0;False;-1;-1;0;False;-1;0;0;0;False;0.1;False;-1;0;False;-1;15;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;2;FLOAT3;0,0,0;False;3;FLOAT;0;False;4;FLOAT;0;False;6;FLOAT3;0,0,0;False;7;FLOAT3;0,0,0;False;8;FLOAT;0;False;9;FLOAT;0;False;10;FLOAT;0;False;13;FLOAT3;0,0,0;False;11;FLOAT3;0,0,0;False;12;FLOAT3;0,0,0;False;14;FLOAT4;0,0,0,0;False;15;FLOAT3;0,0,0;False;0
WireConnection;70;0;68;0
WireConnection;72;0;69;0
WireConnection;73;0;67;0
WireConnection;71;0;66;0
WireConnection;84;0;83;0
WireConnection;11;0;10;0
WireConnection;6;0;7;0
WireConnection;12;0;13;0
WireConnection;26;0;31;0
WireConnection;9;0;8;0
WireConnection;137;54;110;0
WireConnection;137;55;114;0
WireConnection;137;56;113;0
WireConnection;137;57;115;0
WireConnection;137;58;112;0
WireConnection;136;54;38;0
WireConnection;136;55;39;0
WireConnection;136;56;40;0
WireConnection;136;57;41;0
WireConnection;136;58;42;0
WireConnection;117;0;137;0
WireConnection;55;0;136;0
WireConnection;59;0;58;0
WireConnection;122;0;120;0
WireConnection;122;1;121;0
WireConnection;124;0;123;0
WireConnection;124;1;122;0
WireConnection;125;0;124;0
WireConnection;135;0;62;0
ASEEND*/
//CHKSM=3A54688BF5BFC95ACA00909E4FD4E6A28FFE6FE2

View File

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

View File

@@ -0,0 +1,50 @@
// Made with Amplify Shader Editor
// Available at the Unity Asset Store - http://u3d.as/y3X
Shader "Polaris/BuiltinRP/Terrain/Lambert_ColorMap"
{
Properties
{
_MainTex("_MainTex", 2D) = "white" {}
[HideInInspector] _texcoord( "", 2D ) = "white" {}
[HideInInspector] __dirty( "", Int ) = 1
}
SubShader
{
Tags{ "RenderType" = "Opaque" "Queue" = "Geometry+0" }
Cull Back
CGPROGRAM
#pragma target 3.0
#pragma surface surf Lambert keepalpha addshadow fullforwardshadows noinstancing
struct Input
{
float2 uv_texcoord;
};
uniform sampler2D _MainTex;
uniform half4 _MainTex_ST;
void surf( Input i , inout SurfaceOutput o )
{
float2 uv_MainTex = i.uv_texcoord * _MainTex_ST.xy + _MainTex_ST.zw;
o.Albedo = tex2D( _MainTex, uv_MainTex ).rgb;
o.Alpha = 1;
}
ENDCG
}
Fallback "Diffuse"
}
/*ASEBEGIN
Version=18000
1244;197;1906;885;1397.986;364.9311;1;True;False
Node;AmplifyShaderEditor.TexturePropertyNode;1;-1015.986,-327.9311;Inherit;True;Property;_MainTex;_MainTex;0;0;Create;True;0;0;False;0;None;None;False;white;Auto;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;3;-1024.986,-25.93106;Inherit;True;Property;_MetallicGlossMap;_MetallicGlossMap;1;0;Create;True;0;0;False;0;None;None;False;white;Auto;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.SamplerNode;2;-669.9861,-289.9311;Inherit;True;Property;_TextureSample0;Texture Sample 0;1;0;Create;True;0;0;False;0;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;6;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;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.SamplerNode;4;-695.9861,-9.931061;Inherit;True;Property;_TextureSample1;Texture Sample 1;2;0;Create;True;0;0;False;0;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;6;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;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.StandardSurfaceOutputNode;0;0,0;Half;False;True;-1;2;;0;0;Lambert;Polaris/BuiltinRP/Terrain/Lambert_ColorMap;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;False;False;False;Back;0;False;-1;0;False;-1;False;0;False;-1;0;False;-1;False;0;Opaque;0.5;True;True;0;False;Opaque;;Geometry;All;14;all;True;True;True;True;0;False;-1;False;0;False;-1;255;False;-1;255;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;False;2;15;10;25;False;0.5;True;0;0;False;-1;0;False;-1;0;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;0;0,0,0,0;VertexOffset;True;False;Cylindrical;False;Relative;0;;-1;-1;-1;-1;0;False;0;0;False;-1;-1;0;False;-1;0;0;0;False;0.1;False;-1;0;False;-1;15;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;2;FLOAT3;0,0,0;False;3;FLOAT;0;False;4;FLOAT;0;False;6;FLOAT3;0,0,0;False;7;FLOAT3;0,0,0;False;8;FLOAT;0;False;9;FLOAT;0;False;10;FLOAT;0;False;13;FLOAT3;0,0,0;False;11;FLOAT3;0,0,0;False;12;FLOAT3;0,0,0;False;14;FLOAT4;0,0,0,0;False;15;FLOAT3;0,0,0;False;0
WireConnection;2;0;1;0
WireConnection;4;0;3;0
WireConnection;0;0;2;0
ASEEND*/
//CHKSM=4E3FF19461DAEEC36B8E3569FAD47DCA04F2D11F

View File

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

View File

@@ -0,0 +1,245 @@
// Made with Amplify Shader Editor
// Available at the Unity Asset Store - http://u3d.as/y3X
Shader "Polaris/BuiltinRP/Terrain/Lambert_GradientLookup"
{
Properties
{
_Color("Color", Color) = (1,1,1,1)
_ColorByHeight("Color By Height", 2D) = "white" {}
_ColorByNormal("Color By Normal", 2D) = "white" {}
_ColorBlend("ColorBlend", 2D) = "white" {}
_Dimension("Dimension", Vector) = (1,1,1,0)
_MainTex("MainTex", 2D) = "white" {}
[HideInInspector] _texcoord( "", 2D ) = "white" {}
[HideInInspector] __dirty( "", Int ) = 1
}
SubShader
{
Tags{ "RenderType" = "Opaque" "Queue" = "Geometry+0" "DisableBatching" = "True" }
Cull Back
CGINCLUDE
#include "UnityShaderVariables.cginc"
#include "UnityPBSLighting.cginc"
#include "Lighting.cginc"
#pragma target 3.0
struct Input
{
float3 worldPos;
half3 worldNormal;
float2 uv_texcoord;
};
uniform sampler2D _ColorByHeight;
uniform float3 _Dimension;
uniform sampler2D _ColorBlend;
uniform sampler2D _ColorByNormal;
uniform sampler2D _MainTex;
uniform float4 _Color;
void surf( Input i , inout SurfaceOutput o )
{
float3 ase_vertex3Pos = mul( unity_WorldToObject, float4( i.worldPos , 1 ) );
float _Height22 = _Dimension.y;
float heightFraction59 = (0.0 + (ase_vertex3Pos.y - 0.0) * (1.0 - 0.0) / (_Height22 - 0.0));
half2 appendResult25 = (half2(heightFraction59 , 0.5));
float4 colorByHeightResult30 = tex2D( _ColorByHeight, appendResult25 );
half2 appendResult63 = (half2(heightFraction59 , 0.5));
half4 tex2DNode65 = tex2D( _ColorBlend, appendResult63 );
half3 ase_worldNormal = i.worldNormal;
half3 ase_vertexNormal = mul( unity_WorldToObject, float4( ase_worldNormal, 0 ) );
half2 appendResult41 = (half2(saturate( ase_vertexNormal.y ) , 0.5));
float4 colorByNormalResult43 = tex2D( _ColorByNormal, appendResult41 );
float4 mainTexColor53 = tex2D( _MainTex, i.uv_texcoord );
float4 _Color9 = _Color;
float4 albedoResult78 = ( ( ( ( ( colorByHeightResult30 * ( 1.0 - tex2DNode65.r ) ) + ( colorByNormalResult43 * tex2DNode65.r ) ) * ( 1.0 - mainTexColor53.a ) ) + mainTexColor53 ) * _Color9 );
o.Albedo = albedoResult78.rgb;
o.Alpha = 1;
}
ENDCG
CGPROGRAM
#pragma surface surf Lambert keepalpha fullforwardshadows noinstancing
ENDCG
Pass
{
Name "ShadowCaster"
Tags{ "LightMode" = "ShadowCaster" }
ZWrite On
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma target 3.0
#pragma multi_compile_shadowcaster
#pragma multi_compile UNITY_PASS_SHADOWCASTER
#pragma skip_variants FOG_LINEAR FOG_EXP FOG_EXP2
#include "HLSLSupport.cginc"
#if ( SHADER_API_D3D11 || SHADER_API_GLCORE || SHADER_API_GLES || SHADER_API_GLES3 || SHADER_API_METAL || SHADER_API_VULKAN )
#define CAN_SKIP_VPOS
#endif
#include "UnityCG.cginc"
#include "Lighting.cginc"
#include "UnityPBSLighting.cginc"
struct v2f
{
V2F_SHADOW_CASTER;
float2 customPack1 : TEXCOORD1;
float3 worldPos : TEXCOORD2;
float3 worldNormal : TEXCOORD3;
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
};
v2f vert( appdata_full v )
{
v2f o;
UNITY_SETUP_INSTANCE_ID( v );
UNITY_INITIALIZE_OUTPUT( v2f, o );
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO( o );
UNITY_TRANSFER_INSTANCE_ID( v, o );
Input customInputData;
float3 worldPos = mul( unity_ObjectToWorld, v.vertex ).xyz;
half3 worldNormal = UnityObjectToWorldNormal( v.normal );
o.worldNormal = worldNormal;
o.customPack1.xy = customInputData.uv_texcoord;
o.customPack1.xy = v.texcoord;
o.worldPos = worldPos;
TRANSFER_SHADOW_CASTER_NORMALOFFSET( o )
return o;
}
half4 frag( v2f IN
#if !defined( CAN_SKIP_VPOS )
, UNITY_VPOS_TYPE vpos : VPOS
#endif
) : SV_Target
{
UNITY_SETUP_INSTANCE_ID( IN );
Input surfIN;
UNITY_INITIALIZE_OUTPUT( Input, surfIN );
surfIN.uv_texcoord = IN.customPack1.xy;
float3 worldPos = IN.worldPos;
half3 worldViewDir = normalize( UnityWorldSpaceViewDir( worldPos ) );
surfIN.worldPos = worldPos;
surfIN.worldNormal = IN.worldNormal;
SurfaceOutput o;
UNITY_INITIALIZE_OUTPUT( SurfaceOutput, o )
surf( surfIN, o );
#if defined( CAN_SKIP_VPOS )
float2 vpos = IN.pos;
#endif
SHADOW_CASTER_FRAGMENT( IN )
}
ENDCG
}
}
Fallback "Diffuse"
}
/*ASEBEGIN
Version=18000
1244;197;1906;885;3184.679;220.5051;1;True;False
Node;AmplifyShaderEditor.CommentaryNode;19;-3470.578,-1284.338;Inherit;False;689.7617;1306.715;;13;18;16;15;12;14;13;10;22;17;9;7;33;32;Properties;1,1,1,1;0;0
Node;AmplifyShaderEditor.Vector3Node;17;-3370.049,-193.8653;Float;False;Property;_Dimension;Dimension;4;0;Create;True;0;0;False;0;1,1,1;500,150,500;0;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
Node;AmplifyShaderEditor.CommentaryNode;29;-4462.73,222.3531;Inherit;False;1705.197;471.512;;9;21;20;23;59;27;26;28;25;30;Sample Color By Height;1,1,1,1;0;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;22;-3010.162,-101.5121;Float;False;_Height;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.PosVertexDataNode;20;-4431.73,366.4063;Inherit;False;0;0;5;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.GetLocalVarNode;21;-4420.388,526.8657;Inherit;False;22;_Height;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.CommentaryNode;46;-4251.19,848.2155;Inherit;False;1479.913;393.3013;;7;44;38;45;40;41;42;43;Sample Color By Normal;1,1,1,1;0;0
Node;AmplifyShaderEditor.NormalVertexDataNode;44;-4201.19,985.4062;Inherit;False;0;5;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.TexturePropertyNode;10;-3411.312,-826.9905;Float;True;Property;_ColorByHeight;Color By Height;1;0;Create;True;0;0;False;0;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TFHCRemapNode;23;-4154.533,369.3532;Inherit;False;5;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;3;FLOAT;0;False;4;FLOAT;1;False;1;FLOAT;0
Node;AmplifyShaderEditor.TexturePropertyNode;32;-3414.7,-1039.444;Float;True;Property;_MainTex;MainTex;5;0;Create;True;0;0;False;0;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;13;-3413.915,-622.4089;Float;True;Property;_ColorByNormal;Color By Normal;2;0;Create;True;0;0;False;0;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.CommentaryNode;81;-5233.805,1785.144;Inherit;False;2426.761;752.334;;19;62;64;66;63;65;61;73;60;70;69;71;77;72;76;75;74;80;79;78;Blending;1,1,1,1;0;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;59;-3919.558,376.0131;Float;False;heightFraction;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.TexturePropertyNode;15;-3414.915,-403.4093;Float;True;Property;_ColorBlend;ColorBlend;3;0;Create;True;0;0;False;0;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;33;-3015.051,-1030.608;Float;False;_MainTex;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.CommentaryNode;56;-4035.565,1390.725;Inherit;False;1219.639;322.5514;;4;53;49;50;47;Sample Color Map;1,1,1,1;0;0
Node;AmplifyShaderEditor.RangedFloatNode;26;-3838.534,551.3537;Float;False;Constant;_Float0;Float 0;5;0;Create;True;0;0;False;0;0.5;0;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;38;-3893.935,1126.517;Float;False;Constant;_Float1;Float 1;5;0;Create;True;0;0;False;0;0.5;0;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;14;-3011.122,-621.2454;Float;False;_ColorByNormal;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.SaturateNode;45;-3887.889,985.4063;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;12;-3008.519,-825.827;Float;False;_ColorByHeight;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TextureCoordinatesNode;47;-3977.185,1555.253;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.GetLocalVarNode;28;-3708.534,272.3531;Inherit;False;12;_ColorByHeight;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.DynamicAppendNode;25;-3615.534,379.3532;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.RegisterLocalVarNode;16;-3012.122,-402.2459;Float;False;_ColorBlend;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;40;-3757.434,898.2155;Inherit;False;14;_ColorByNormal;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;50;-3933.888,1440.725;Inherit;False;33;_MainTex;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.DynamicAppendNode;41;-3664.434,1005.216;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.GetLocalVarNode;62;-5183.805,2038.893;Inherit;False;59;heightFraction;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;64;-5133.621,2129.977;Float;False;Constant;_Float2;Float 2;7;0;Create;True;0;0;False;0;0.5;0;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.SamplerNode;49;-3538.628,1451.898;Inherit;True;Property;_TextureSample2;Texture Sample 2;7;0;Create;True;0;0;False;0;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;6;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;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.SamplerNode;42;-3421.434,933.2155;Inherit;True;Property;_TextureSample1;Texture Sample 1;5;0;Create;True;0;0;False;0;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;6;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;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.SamplerNode;27;-3372.534,307.3531;Inherit;True;Property;_TextureSample0;Texture Sample 0;5;0;Create;True;0;0;False;0;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;6;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;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.GetLocalVarNode;66;-5168.621,1956.977;Inherit;False;16;_ColorBlend;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.DynamicAppendNode;63;-4954.622,2042.977;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.RegisterLocalVarNode;53;-3047.001,1457.485;Float;False;mainTexColor;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;43;-3060.277,935.2553;Float;False;colorByNormalResult;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;30;-3011.377,309.393;Float;False;colorByHeightResult;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.SamplerNode;65;-4679.621,1953.977;Inherit;True;Property;_TextureSample4;Texture Sample 4;7;0;Create;True;0;0;False;0;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;6;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;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.GetLocalVarNode;61;-4645.817,2188.26;Inherit;False;43;colorByNormalResult;1;0;OBJECT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.GetLocalVarNode;60;-4642.066,1835.144;Inherit;False;30;colorByHeightResult;1;0;OBJECT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.GetLocalVarNode;73;-4599.287,2422.477;Inherit;False;53;mainTexColor;1;0;OBJECT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.OneMinusNode;70;-4333.625,1985.977;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.BreakToComponentsNode;77;-4250.572,2275.761;Inherit;False;COLOR;1;0;COLOR;0,0,0,0;False;16;FLOAT;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4;FLOAT;5;FLOAT;6;FLOAT;7;FLOAT;8;FLOAT;9;FLOAT;10;FLOAT;11;FLOAT;12;FLOAT;13;FLOAT;14;FLOAT;15
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;71;-4138.626,2140.977;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;69;-4135.626,1912.978;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.SimpleAddOpNode;72;-3930.628,2002.977;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.ColorNode;7;-3399.708,-1232.622;Float;False;Property;_Color;Color;0;0;Create;True;0;0;False;0;1,1,1,1;1,1,1,1;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.OneMinusNode;76;-3935.575,2155.761;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;9;-3028.91,-1234.338;Float;False;_Color;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;75;-3708.765,2001.316;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.GetLocalVarNode;80;-3520.034,2185.513;Inherit;False;9;_Color;1;0;OBJECT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.SimpleAddOpNode;74;-3476.92,1997.653;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;79;-3257.034,2000.514;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;78;-3050.051,1991.049;Float;False;albedoResult;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.GetLocalVarNode;31;-2429.736,122.1925;Inherit;False;78;albedoResult;1;0;OBJECT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;18;-3008.649,-192.5653;Float;False;_Dimension;-1;True;1;0;FLOAT3;0,0,0;False;1;FLOAT3;0
Node;AmplifyShaderEditor.StandardSurfaceOutputNode;82;-2051.866,136.1994;Half;False;True;-1;2;;0;0;Lambert;Polaris/BuiltinRP/Terrain/Lambert_GradientLookup;False;False;False;False;False;False;False;False;False;False;False;False;False;True;False;False;False;True;False;False;False;Back;0;False;-1;0;False;-1;False;0;False;-1;0;False;-1;False;0;Opaque;0.5;True;True;0;False;Opaque;;Geometry;All;14;all;True;True;True;True;0;False;-1;False;0;False;-1;255;False;-1;255;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;False;2;15;10;25;False;0.5;True;0;0;False;-1;0;False;-1;0;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;0;0,0,0,0;VertexOffset;True;False;Cylindrical;False;Relative;0;;-1;-1;-1;-1;0;False;0;0;False;-1;-1;0;False;-1;0;0;0;False;0.1;False;-1;0;False;-1;15;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;2;FLOAT3;0,0,0;False;3;FLOAT;0;False;4;FLOAT;0;False;6;FLOAT3;0,0,0;False;7;FLOAT3;0,0,0;False;8;FLOAT;0;False;9;FLOAT;0;False;10;FLOAT;0;False;13;FLOAT3;0,0,0;False;11;FLOAT3;0,0,0;False;12;FLOAT3;0,0,0;False;14;FLOAT4;0,0,0,0;False;15;FLOAT3;0,0,0;False;0
WireConnection;22;0;17;2
WireConnection;23;0;20;2
WireConnection;23;2;21;0
WireConnection;59;0;23;0
WireConnection;33;0;32;0
WireConnection;14;0;13;0
WireConnection;45;0;44;2
WireConnection;12;0;10;0
WireConnection;25;0;59;0
WireConnection;25;1;26;0
WireConnection;16;0;15;0
WireConnection;41;0;45;0
WireConnection;41;1;38;0
WireConnection;49;0;50;0
WireConnection;49;1;47;0
WireConnection;42;0;40;0
WireConnection;42;1;41;0
WireConnection;27;0;28;0
WireConnection;27;1;25;0
WireConnection;63;0;62;0
WireConnection;63;1;64;0
WireConnection;53;0;49;0
WireConnection;43;0;42;0
WireConnection;30;0;27;0
WireConnection;65;0;66;0
WireConnection;65;1;63;0
WireConnection;70;0;65;1
WireConnection;77;0;73;0
WireConnection;71;0;61;0
WireConnection;71;1;65;1
WireConnection;69;0;60;0
WireConnection;69;1;70;0
WireConnection;72;0;69;0
WireConnection;72;1;71;0
WireConnection;76;0;77;3
WireConnection;9;0;7;0
WireConnection;75;0;72;0
WireConnection;75;1;76;0
WireConnection;74;0;75;0
WireConnection;74;1;73;0
WireConnection;79;0;74;0
WireConnection;79;1;80;0
WireConnection;78;0;79;0
WireConnection;18;0;17;0
WireConnection;82;0;31;0
ASEEND*/
//CHKSM=1A2DE3B2E8BC2085F8F947F9E1F0D69EAC288929

View File

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

View File

@@ -0,0 +1,56 @@
// Made with Amplify Shader Editor
// Available at the Unity Asset Store - http://u3d.as/y3X
Shader "Polaris/BuiltinRP/Terrain/Lambert_VertexColor"
{
Properties
{
_Color("Color", Color) = (1,1,1,1)
[HideInInspector] __dirty( "", Int ) = 1
}
SubShader
{
Tags{ "RenderType" = "Opaque" "Queue" = "Geometry+0" "DisableBatching" = "True" }
Cull Back
CGPROGRAM
#pragma target 3.0
#pragma surface surf Lambert keepalpha addshadow fullforwardshadows noinstancing
struct Input
{
float4 vertexColor : COLOR;
};
uniform float4 _Color;
void surf( Input i , inout SurfaceOutput o )
{
float4 _Color5 = _Color;
float4 albedo10 = ( _Color5 * i.vertexColor );
o.Albedo = albedo10.rgb;
o.Alpha = 1;
}
ENDCG
}
Fallback "Diffuse"
}
/*ASEBEGIN
Version=18000
1244;197;1906;885;1708.705;595.2894;1;True;False
Node;AmplifyShaderEditor.CommentaryNode;6;-991,-650;Inherit;False;556;232;;2;5;4;Properties;1,1,1,1;0;0
Node;AmplifyShaderEditor.ColorNode;4;-941,-600;Float;False;Property;_Color;Color;0;0;Create;True;0;0;False;0;1,1,1,1;1,1,1,1;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.CommentaryNode;11;-1162.788,-390.7913;Inherit;False;731;378;;4;7;8;9;10;Albedo;1,1,1,1;0;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;5;-655,-597;Float;False;_Color;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.VertexColorNode;7;-1101.788,-214.7913;Inherit;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.GetLocalVarNode;8;-1112.788,-340.7913;Inherit;False;5;_Color;1;0;OBJECT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;9;-865.7881,-279.7913;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;10;-674.7881,-279.7913;Float;False;albedo;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.GetLocalVarNode;16;-207.7881,-420.7913;Inherit;False;10;albedo;1;0;OBJECT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.StandardSurfaceOutputNode;19;69,-386;Half;False;True;-1;2;;0;0;Lambert;Polaris/BuiltinRP/Terrain/Lambert_VertexColor;False;False;False;False;False;False;False;False;False;False;False;False;False;True;False;False;False;True;False;False;False;Back;0;False;-1;0;False;-1;False;0;False;-1;0;False;-1;False;0;Opaque;0.5;True;True;0;False;Opaque;;Geometry;All;14;all;True;True;True;True;0;False;-1;False;0;False;-1;255;False;-1;255;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;False;2;15;10;25;False;0.5;True;0;0;False;-1;0;False;-1;0;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;0;0,0,0,0;VertexOffset;True;False;Cylindrical;False;Relative;0;;-1;-1;-1;-1;0;False;0;0;False;-1;-1;0;False;-1;0;0;0;False;0.1;False;-1;0;False;-1;15;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;2;FLOAT3;0,0,0;False;3;FLOAT;0;False;4;FLOAT;0;False;6;FLOAT3;0,0,0;False;7;FLOAT3;0,0,0;False;8;FLOAT;0;False;9;FLOAT;0;False;10;FLOAT;0;False;13;FLOAT3;0,0,0;False;11;FLOAT3;0,0,0;False;12;FLOAT3;0,0,0;False;14;FLOAT4;0,0,0,0;False;15;FLOAT3;0,0,0;False;0
WireConnection;5;0;4;0
WireConnection;9;0;8;0
WireConnection;9;1;7;0
WireConnection;10;0;9;0
WireConnection;19;0;16;0
ASEEND*/
//CHKSM=DA67832A0CB0B9D9881C4FDF5079BA853F047650

View File

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

View File

@@ -0,0 +1,191 @@
// Made with Amplify Shader Editor
// Available at the Unity Asset Store - http://u3d.as/y3X
Shader "Polaris/BuiltinRP/Terrain/PBR_4Splats"
{
Properties
{
_Color("Color", Color) = (1,1,1,1)
_Control0("Control0", 2D) = "black" {}
_Splat0("Splat0", 2D) = "white" {}
_Splat1("Splat1", 2D) = "white" {}
_Splat2("Splat2", 2D) = "white" {}
_Splat3("Splat3", 2D) = "white" {}
_Metallic0("Metallic0", Range( 0 , 1)) = 0
_Metallic1("Metallic1", Range( 0 , 1)) = 0
_Metallic2("Metallic2", Range( 0 , 1)) = 0
_Metallic3("Metallic3", Range( 0 , 1)) = 0
_Smoothness0("Smoothness0", Range( 0 , 1)) = 0
_Smoothness1("Smoothness1", Range( 0 , 1)) = 0
_Smoothness2("Smoothness2", Range( 0 , 1)) = 0
_Smoothness3("Smoothness3", Range( 0 , 1)) = 0
[HideInInspector] _texcoord( "", 2D ) = "white" {}
[HideInInspector] __dirty( "", Int ) = 1
}
SubShader
{
Tags{ "RenderType" = "Opaque" "Queue" = "Geometry+0" "DisableBatching" = "True" }
Cull Back
CGPROGRAM
#pragma target 3.0
#pragma surface surf Standard keepalpha addshadow fullforwardshadows noinstancing
struct Input
{
float2 uv_texcoord;
};
uniform float4 _Color;
uniform sampler2D _Splat0;
uniform float4 _Splat0_ST;
uniform sampler2D _Control0;
uniform sampler2D _Splat1;
uniform float4 _Splat1_ST;
uniform sampler2D _Splat2;
uniform float4 _Splat2_ST;
uniform sampler2D _Splat3;
uniform float4 _Splat3_ST;
uniform float _Metallic0;
uniform float _Metallic1;
uniform float _Metallic2;
uniform float _Metallic3;
uniform float _Smoothness0;
uniform float _Smoothness1;
uniform float _Smoothness2;
uniform float _Smoothness3;
void surf( Input i , inout SurfaceOutputStandard o )
{
float4 _Color59 = _Color;
float2 uv_Splat0 = i.uv_texcoord * _Splat0_ST.xy + _Splat0_ST.zw;
half4 tex2DNode31_g11 = tex2D( _Control0, i.uv_texcoord );
half4 break34_g11 = tex2DNode31_g11;
float2 uv_Splat1 = i.uv_texcoord * _Splat1_ST.xy + _Splat1_ST.zw;
float2 uv_Splat2 = i.uv_texcoord * _Splat2_ST.xy + _Splat2_ST.zw;
float2 uv_Splat3 = i.uv_texcoord * _Splat3_ST.xy + _Splat3_ST.zw;
float4 splatColor52_g11 = ( ( tex2D( _Splat0, uv_Splat0 ) * break34_g11.r ) + ( tex2D( _Splat1, uv_Splat1 ) * break34_g11.g ) + ( tex2D( _Splat2, uv_Splat2 ) * break34_g11.b ) + ( tex2D( _Splat3, uv_Splat3 ) * break34_g11.a ) );
float4 albedo55 = ( _Color59 * splatColor52_g11 );
o.Albedo = albedo55.rgb;
float _Metallic014 = _Metallic0;
float _Metallic013_g11 = _Metallic014;
half4 break67_g11 = tex2DNode31_g11;
float _Metallic119 = _Metallic1;
float _Metallic116_g11 = _Metallic119;
float _Metallic222 = _Metallic2;
float _Metallic221_g11 = _Metallic222;
float _Metallic316 = _Metallic3;
float _Metallic326_g11 = _Metallic316;
float metallicValue77_g11 = ( ( _Metallic013_g11 * break67_g11.r ) + ( _Metallic116_g11 * break67_g11.g ) + ( _Metallic221_g11 * break67_g11.b ) + ( _Metallic326_g11 * break67_g11.a ) );
float metallicValue56 = metallicValue77_g11;
o.Metallic = metallicValue56;
float _Smoothness027 = _Smoothness0;
float _Smoothness014_g11 = _Smoothness027;
half4 break80_g11 = tex2DNode31_g11;
float _Smoothness118 = _Smoothness1;
float _Smoothness119_g11 = _Smoothness118;
float _Smoothness223 = _Smoothness2;
float _Smoothness223_g11 = _Smoothness223;
float _Smoothness315 = _Smoothness3;
float _Smoothness327_g11 = _Smoothness315;
float smoothnessValue82_g11 = ( ( _Smoothness014_g11 * break80_g11.r ) + ( _Smoothness119_g11 * break80_g11.g ) + ( _Smoothness223_g11 * break80_g11.b ) + ( _Smoothness327_g11 * break80_g11.a ) );
float smoothnessValue57 = smoothnessValue82_g11;
o.Smoothness = smoothnessValue57;
o.Alpha = 1;
}
ENDCG
}
Fallback "Diffuse"
}
/*ASEBEGIN
Version=18400
835;319;1906;879;1313.265;197.4003;1;True;False
Node;AmplifyShaderEditor.CommentaryNode;5;-2582.276,-1258.525;Inherit;False;1261.038;1159.556;;28;31;30;29;28;27;26;25;24;23;22;21;20;19;18;17;16;15;14;13;12;11;10;9;8;7;6;58;59;Inputs;1,1,1,1;0;0
Node;AmplifyShaderEditor.TexturePropertyNode;13;-1863.784,-328.9691;Float;True;Property;_Splat3;Splat3;5;0;Create;True;0;0;False;0;False;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;2;SAMPLER2D;0;SAMPLERSTATE;1
Node;AmplifyShaderEditor.TexturePropertyNode;10;-1862.24,-544.5253;Float;True;Property;_Splat2;Splat2;4;0;Create;True;0;0;False;0;False;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;2;SAMPLER2D;0;SAMPLERSTATE;1
Node;AmplifyShaderEditor.RangedFloatNode;17;-2527.276,-662.0006;Float;False;Property;_Smoothness1;Smoothness1;11;0;Create;True;0;0;False;0;False;0;0;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;25;-2530.276,-894.5005;Float;False;Property;_Smoothness0;Smoothness0;10;0;Create;True;0;0;False;0;False;0;0;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;21;-2520.276,-444.0007;Float;False;Property;_Smoothness2;Smoothness2;12;0;Create;True;0;0;False;0;False;0;0;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.TexturePropertyNode;8;-1867.24,-754.5253;Float;True;Property;_Splat1;Splat1;3;0;Create;True;0;0;False;0;False;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;2;SAMPLER2D;0;SAMPLERSTATE;1
Node;AmplifyShaderEditor.RangedFloatNode;20;-2522.276,-533.0005;Float;False;Property;_Metallic2;Metallic2;8;0;Create;True;0;0;False;0;False;0;0;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;29;-2529.276,-751.0005;Float;False;Property;_Metallic1;Metallic1;7;0;Create;True;0;0;False;0;False;0;0;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;24;-2518.366,-319.5409;Float;False;Property;_Metallic3;Metallic3;9;0;Create;True;0;0;False;0;False;0;0;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.TexturePropertyNode;31;-1872.24,-1208.525;Float;True;Property;_Control0;Control0;1;0;Create;True;0;0;False;0;False;None;None;False;black;LockedToTexture2D;Texture2D;-1;0;2;SAMPLER2D;0;SAMPLERSTATE;1
Node;AmplifyShaderEditor.RangedFloatNode;30;-2532.276,-983.5005;Float;False;Property;_Metallic0;Metallic0;6;0;Create;True;0;0;False;0;False;0;0;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;28;-2516.366,-230.5408;Float;False;Property;_Smoothness3;Smoothness3;13;0;Create;True;0;0;False;0;False;0;0;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.TexturePropertyNode;7;-1872.24,-986.5253;Float;True;Property;_Splat0;Splat0;2;0;Create;True;0;0;False;0;False;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;2;SAMPLER2D;0;SAMPLERSTATE;1
Node;AmplifyShaderEditor.CommentaryNode;65;-2670.415,123.9284;Inherit;False;1445.194;1141.626;;19;38;39;42;41;52;53;49;46;40;51;50;48;47;54;61;60;55;56;57;Albedo, Metallic, Smoothness;1,1,1,1;0;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;23;-2192.277,-442.0007;Float;False;_Smoothness2;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;6;-1574.24,-982.5253;Float;False;_Splat0;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;18;-2199.277,-660.0006;Float;False;_Smoothness1;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;27;-2202.277,-892.5005;Float;False;_Smoothness0;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;19;-2196.277,-748.0005;Float;False;_Metallic1;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;15;-2188.367,-228.5408;Float;False;_Smoothness3;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;26;-1574.24,-1204.525;Float;False;_Control;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;11;-1564.24,-540.5253;Float;False;_Splat2;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.ColorNode;58;-2524.98,-1184.629;Float;False;Property;_Color;Color;0;0;Create;True;0;0;False;0;False;1,1,1,1;1,1,1,1;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.RegisterLocalVarNode;16;-2190.367,-317.5409;Float;False;_Metallic3;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;9;-1569.24,-750.5253;Float;False;_Splat1;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;12;-1565.784,-324.9691;Float;False;_Splat3;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;22;-2194.277,-531.0005;Float;False;_Metallic2;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;14;-2204.277,-981.5005;Float;False;_Metallic0;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;41;-2591.789,413.9284;Inherit;False;11;_Splat2;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;40;-2594.789,333.9284;Inherit;False;9;_Splat1;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;51;-2616.415,1072.555;Inherit;False;23;_Smoothness2;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;49;-2589.415,821.5549;Inherit;False;16;_Metallic3;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;47;-2590.415,743.555;Inherit;False;22;_Metallic2;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;46;-2593.415,663.555;Inherit;False;19;_Metallic1;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;48;-2594.415,583.555;Inherit;False;14;_Metallic0;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;53;-2615.415,1150.555;Inherit;False;15;_Smoothness3;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;59;-2193.028,-1186.264;Float;False;_Color;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.GetLocalVarNode;42;-2590.789,491.9283;Inherit;False;12;_Splat3;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;50;-2619.415,992.555;Inherit;False;18;_Smoothness1;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;39;-2595.789,253.9284;Inherit;False;6;_Splat0;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;52;-2620.415,912.555;Inherit;False;27;_Smoothness0;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;38;-2598.789,173.9284;Inherit;False;26;_Control;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;61;-2006.835,362.3217;Inherit;False;59;_Color;1;0;OBJECT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.FunctionNode;54;-2147.638,489.7514;Inherit;False;Sample4SplatsPBR;-1;;11;a6f307978ba7ac84eb0587d072b0df93;0;13;54;SAMPLER2D;0;False;55;SAMPLER2D;0;False;56;SAMPLER2D;0;False;57;SAMPLER2D;0;False;58;SAMPLER2D;0;False;59;FLOAT;0;False;61;FLOAT;0;False;63;FLOAT;0;False;65;FLOAT;0;False;60;FLOAT;0;False;62;FLOAT;0;False;64;FLOAT;0;False;66;FLOAT;0;False;3;COLOR;0;FLOAT;79;FLOAT;92
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;60;-1729.835,466.3217;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;57;-1493.221,664.9777;Float;False;smoothnessValue;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;55;-1491.863,461.057;Float;False;albedo;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;56;-1489.193,560.8465;Float;False;metallicValue;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;63;-346.2018,101.0122;Inherit;False;56;metallicValue;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;62;-309.2018,0.01220703;Inherit;False;55;albedo;1;0;OBJECT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.GetLocalVarNode;64;-365.2018,201.0122;Inherit;False;57;smoothnessValue;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.StandardSurfaceOutputNode;66;0,0;Half;False;True;-1;2;;0;0;Standard;Polaris/BuiltinRP/Terrain/PBR_4Splats;False;False;False;False;False;False;False;False;False;False;False;False;False;True;False;False;False;True;False;False;False;Back;0;False;-1;0;False;-1;False;0;False;-1;0;False;-1;False;0;Opaque;0.5;True;True;0;False;Opaque;;Geometry;All;14;all;True;True;True;True;0;False;-1;False;0;False;-1;255;False;-1;255;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;False;2;15;10;25;False;0.5;True;0;1;False;-1;1;False;-1;0;1;False;-1;1;False;-1;1;False;-1;1;False;-1;0;False;0;0,0,0,0;VertexOffset;True;False;Cylindrical;False;Relative;0;;-1;-1;-1;-1;0;False;0;0;False;-1;-1;0;False;-1;0;0;0;False;0.1;False;-1;0;False;-1;False;16;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;2;FLOAT3;0,0,0;False;3;FLOAT;0;False;4;FLOAT;0;False;5;FLOAT;0;False;6;FLOAT3;0,0,0;False;7;FLOAT3;0,0,0;False;8;FLOAT;0;False;9;FLOAT;0;False;10;FLOAT;0;False;13;FLOAT3;0,0,0;False;11;FLOAT3;0,0,0;False;12;FLOAT3;0,0,0;False;14;FLOAT4;0,0,0,0;False;15;FLOAT3;0,0,0;False;0
WireConnection;23;0;21;0
WireConnection;6;0;7;0
WireConnection;18;0;17;0
WireConnection;27;0;25;0
WireConnection;19;0;29;0
WireConnection;15;0;28;0
WireConnection;26;0;31;0
WireConnection;11;0;10;0
WireConnection;16;0;24;0
WireConnection;9;0;8;0
WireConnection;12;0;13;0
WireConnection;22;0;20;0
WireConnection;14;0;30;0
WireConnection;59;0;58;0
WireConnection;54;54;38;0
WireConnection;54;55;39;0
WireConnection;54;56;40;0
WireConnection;54;57;41;0
WireConnection;54;58;42;0
WireConnection;54;59;48;0
WireConnection;54;61;46;0
WireConnection;54;63;47;0
WireConnection;54;65;49;0
WireConnection;54;60;52;0
WireConnection;54;62;50;0
WireConnection;54;64;51;0
WireConnection;54;66;53;0
WireConnection;60;0;61;0
WireConnection;60;1;54;0
WireConnection;57;0;54;92
WireConnection;55;0;60;0
WireConnection;56;0;54;79
WireConnection;66;0;62;0
WireConnection;66;3;63;0
WireConnection;66;4;64;0
ASEEND*/
//CHKSM=12598FE64267B9D0A77AA67F359DB06E05EEDE3E

View File

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

View File

@@ -0,0 +1,228 @@
// Made with Amplify Shader Editor
// Available at the Unity Asset Store - http://u3d.as/y3X
Shader "Polaris/BuiltinRP/Terrain/PBR_4Splats4Normals"
{
Properties
{
_Color("Color", Color) = (1,1,1,1)
_Control0("Control0", 2D) = "black" {}
_Splat0("Splat0", 2D) = "white" {}
_Splat1("Splat1", 2D) = "white" {}
_Splat2("Splat2", 2D) = "white" {}
_Splat3("Splat3", 2D) = "white" {}
_Normal0("Normal0", 2D) = "bump" {}
_Normal1("Normal1", 2D) = "bump" {}
_Normal2("Normal2", 2D) = "bump" {}
_Normal3("Normal3", 2D) = "bump" {}
_Metallic0("Metallic0", Range( 0 , 1)) = 0
_Metallic1("Metallic1", Range( 0 , 1)) = 0
_Metallic2("Metallic2", Range( 0 , 1)) = 0
_Metallic3("Metallic3", Range( 0 , 1)) = 0
_Smoothness0("Smoothness0", Range( 0 , 1)) = 0
_Smoothness1("Smoothness1", Range( 0 , 1)) = 0
_Smoothness2("Smoothness2", Range( 0 , 1)) = 0
_Smoothness3("Smoothness3", Range( 0 , 1)) = 0
[HideInInspector] _texcoord( "", 2D ) = "white" {}
[HideInInspector] __dirty( "", Int ) = 1
}
SubShader
{
Tags{ "RenderType" = "Opaque" "Queue" = "Geometry+0" "DisableBatching" = "True" }
Cull Back
CGPROGRAM
#pragma target 3.0
#pragma surface surf Standard keepalpha addshadow fullforwardshadows noinstancing
struct Input
{
float2 uv_texcoord;
};
uniform sampler2D _Normal0;
uniform sampler2D _Splat0;
uniform float4 _Splat0_ST;
uniform sampler2D _Control0;
uniform sampler2D _Normal1;
uniform sampler2D _Splat1;
uniform float4 _Splat1_ST;
uniform sampler2D _Normal2;
uniform sampler2D _Splat2;
uniform float4 _Splat2_ST;
uniform sampler2D _Normal3;
uniform sampler2D _Splat3;
uniform float4 _Splat3_ST;
uniform float4 _Color;
uniform float _Metallic0;
uniform float _Metallic1;
uniform float _Metallic2;
uniform float _Metallic3;
uniform float _Smoothness0;
uniform float _Smoothness1;
uniform float _Smoothness2;
uniform float _Smoothness3;
void surf( Input i , inout SurfaceOutputStandard o )
{
float2 uv0_Splat0 = i.uv_texcoord * _Splat0_ST.xy + _Splat0_ST.zw;
half4 tex2DNode31_g14 = tex2D( _Control0, i.uv_texcoord );
half4 break125_g14 = tex2DNode31_g14;
float2 uv0_Splat1 = i.uv_texcoord * _Splat1_ST.xy + _Splat1_ST.zw;
float2 uv0_Splat2 = i.uv_texcoord * _Splat2_ST.xy + _Splat2_ST.zw;
float2 uv0_Splat3 = i.uv_texcoord * _Splat3_ST.xy + _Splat3_ST.zw;
half3 lerpResult128_g14 = lerp( float3(0,0,0.5) , UnpackNormal( ( ( tex2D( _Normal0, uv0_Splat0 ) * break125_g14.r ) + ( tex2D( _Normal1, uv0_Splat1 ) * break125_g14.g ) + ( tex2D( _Normal2, uv0_Splat2 ) * break125_g14.b ) + ( tex2D( _Normal3, uv0_Splat3 ) * break125_g14.a ) ) ) , ( break125_g14.r + break125_g14.g + break125_g14.b + break125_g14.a ));
float3 normalVector114_g14 = lerpResult128_g14;
float3 normalVector80 = normalVector114_g14;
o.Normal = normalVector80;
float4 _Color59 = _Color;
half4 break34_g14 = tex2DNode31_g14;
float4 splatColor52_g14 = ( ( tex2D( _Splat0, uv0_Splat0 ) * break34_g14.r ) + ( tex2D( _Splat1, uv0_Splat1 ) * break34_g14.g ) + ( tex2D( _Splat2, uv0_Splat2 ) * break34_g14.b ) + ( tex2D( _Splat3, uv0_Splat3 ) * break34_g14.a ) );
float4 albedo55 = ( _Color59 * splatColor52_g14 );
o.Albedo = albedo55.rgb;
float _Metallic014 = _Metallic0;
float _Metallic013_g14 = _Metallic014;
half4 break67_g14 = tex2DNode31_g14;
float _Metallic119 = _Metallic1;
float _Metallic116_g14 = _Metallic119;
float _Metallic222 = _Metallic2;
float _Metallic221_g14 = _Metallic222;
float _Metallic316 = _Metallic3;
float _Metallic326_g14 = _Metallic316;
float metallicValue77_g14 = ( ( _Metallic013_g14 * break67_g14.r ) + ( _Metallic116_g14 * break67_g14.g ) + ( _Metallic221_g14 * break67_g14.b ) + ( _Metallic326_g14 * break67_g14.a ) );
float metallicValue56 = metallicValue77_g14;
o.Metallic = metallicValue56;
float _Smoothness027 = _Smoothness0;
float _Smoothness014_g14 = _Smoothness027;
half4 break80_g14 = tex2DNode31_g14;
float _Smoothness118 = _Smoothness1;
float _Smoothness119_g14 = _Smoothness118;
float _Smoothness223 = _Smoothness2;
float _Smoothness223_g14 = _Smoothness223;
float _Smoothness315 = _Smoothness3;
float _Smoothness327_g14 = _Smoothness315;
float smoothnessValue82_g14 = ( ( _Smoothness014_g14 * break80_g14.r ) + ( _Smoothness119_g14 * break80_g14.g ) + ( _Smoothness223_g14 * break80_g14.b ) + ( _Smoothness327_g14 * break80_g14.a ) );
float smoothnessValue57 = smoothnessValue82_g14;
o.Smoothness = smoothnessValue57;
o.Alpha = 1;
}
ENDCG
}
Fallback "Diffuse"
}
/*ASEBEGIN
Version=18000
1244;197;1906;885;1272.526;278.2686;1;True;False
Node;AmplifyShaderEditor.CommentaryNode;5;-2582.276,-1258.525;Inherit;False;1849.843;1153.783;;36;73;72;71;70;69;68;67;66;11;9;6;12;8;13;10;7;59;23;26;58;22;16;15;14;18;19;27;31;24;29;30;17;21;25;28;20;Inputs;1,1,1,1;0;0
Node;AmplifyShaderEditor.TexturePropertyNode;68;-1299.69,-326.4331;Float;True;Property;_Normal3;Normal3;9;0;Create;True;0;0;False;0;None;None;False;bump;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;69;-1303.146,-751.9892;Float;True;Property;_Normal1;Normal1;7;0;Create;True;0;0;False;0;None;None;False;bump;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;66;-1308.146,-983.9891;Float;True;Property;_Normal0;Normal0;6;0;Create;True;0;0;False;0;None;None;False;bump;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;10;-1862.24,-544.5253;Float;True;Property;_Splat2;Splat2;4;0;Create;True;0;0;False;0;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RangedFloatNode;21;-2520.276,-444.0007;Float;False;Property;_Smoothness2;Smoothness2;16;0;Create;True;0;0;False;0;0;0;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;17;-2527.276,-662.0006;Float;False;Property;_Smoothness1;Smoothness1;15;0;Create;True;0;0;False;0;0;0;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.TexturePropertyNode;13;-1863.784,-328.9691;Float;True;Property;_Splat3;Splat3;5;0;Create;True;0;0;False;0;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;67;-1298.146,-541.9893;Float;True;Property;_Normal2;Normal2;8;0;Create;True;0;0;False;0;None;None;False;bump;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;31;-1872.24,-1208.525;Float;True;Property;_Control0;Control0;1;0;Create;True;0;0;False;0;None;None;False;black;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RangedFloatNode;24;-2518.366,-319.5409;Float;False;Property;_Metallic3;Metallic3;13;0;Create;True;0;0;False;0;0;0;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.TexturePropertyNode;7;-1872.24,-986.5253;Float;True;Property;_Splat0;Splat0;2;0;Create;True;0;0;False;0;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;8;-1867.24,-754.5253;Float;True;Property;_Splat1;Splat1;3;0;Create;True;0;0;False;0;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RangedFloatNode;29;-2529.276,-751.0005;Float;False;Property;_Metallic1;Metallic1;11;0;Create;True;0;0;False;0;0;0;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;25;-2530.276,-894.5005;Float;False;Property;_Smoothness0;Smoothness0;14;0;Create;True;0;0;False;0;0;0;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;28;-2516.366,-230.5408;Float;False;Property;_Smoothness3;Smoothness3;17;0;Create;True;0;0;False;0;0;0;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;20;-2522.276,-533.0005;Float;False;Property;_Metallic2;Metallic2;12;0;Create;True;0;0;False;0;0;0;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;30;-2532.276,-983.5005;Float;False;Property;_Metallic0;Metallic0;10;0;Create;True;0;0;False;0;0;0;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;70;-1001.69,-322.4331;Float;False;_Normal3;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;22;-2194.277,-531.0005;Float;False;_Metallic2;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;16;-2190.367,-317.5409;Float;False;_Metallic3;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;19;-2196.277,-748.0005;Float;False;_Metallic1;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;18;-2199.277,-660.0006;Float;False;_Smoothness1;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.ColorNode;58;-2524.98,-1184.629;Float;False;Property;_Color;Color;0;0;Create;True;0;0;False;0;1,1,1,1;1,1,1,1;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.RegisterLocalVarNode;11;-1564.24,-540.5253;Float;False;_Splat2;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;12;-1565.784,-324.9691;Float;False;_Splat3;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;6;-1574.24,-982.5253;Float;False;_Splat0;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;14;-2204.277,-981.5005;Float;False;_Metallic0;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;26;-1574.24,-1204.525;Float;False;_Control;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;23;-2192.277,-442.0007;Float;False;_Smoothness2;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;71;-1010.146,-979.9891;Float;False;_Normal0;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;72;-1005.146,-747.9892;Float;False;_Normal1;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.CommentaryNode;65;-2670.415,123.9284;Inherit;False;1423.094;1443.226;;23;50;52;53;51;46;48;47;49;79;78;77;76;42;39;40;41;38;57;56;55;60;61;80;Albedo, Normal, Metallic, Smoothness;1,1,1,1;0;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;9;-1569.24,-750.5253;Float;False;_Splat1;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;27;-2202.277,-892.5005;Float;False;_Smoothness0;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;15;-2188.367,-228.5408;Float;False;_Smoothness3;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;73;-1000.146,-537.9894;Float;False;_Normal2;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;42;-2590.789,491.9283;Inherit;False;12;_Splat3;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;77;-2594.786,664.4363;Inherit;False;72;_Normal1;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;51;-2617.415,1408.555;Inherit;False;23;_Smoothness2;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;39;-2595.789,253.9284;Inherit;False;6;_Splat0;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;40;-2594.789,333.9284;Inherit;False;9;_Splat1;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;78;-2595.786,584.4363;Inherit;False;71;_Normal0;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;52;-2621.415,1248.555;Inherit;False;27;_Smoothness0;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;41;-2591.789,413.9284;Inherit;False;11;_Splat2;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;53;-2616.415,1486.555;Inherit;False;15;_Smoothness3;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;48;-2595.415,919.555;Inherit;False;14;_Metallic0;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;59;-2193.028,-1186.264;Float;False;_Color;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.GetLocalVarNode;47;-2591.415,1079.555;Inherit;False;22;_Metallic2;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;46;-2594.415,999.5549;Inherit;False;19;_Metallic1;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;49;-2590.415,1157.555;Inherit;False;16;_Metallic3;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;76;-2591.786,744.4363;Inherit;False;73;_Normal2;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;79;-2590.786,822.4363;Inherit;False;70;_Normal3;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;50;-2620.415,1328.555;Inherit;False;18;_Smoothness1;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;38;-2598.789,173.9284;Inherit;False;26;_Control;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.FunctionNode;82;-2130.286,499.9363;Inherit;False;Sample4Splats4NormalsPBR;-1;;14;194e84b9304a1e045b74746905759949;0;17;54;SAMPLER2D;0;False;55;SAMPLER2D;0;False;56;SAMPLER2D;0;False;57;SAMPLER2D;0;False;58;SAMPLER2D;0;False;100;SAMPLER2D;0;False;101;SAMPLER2D;0;False;105;SAMPLER2D;0;False;102;SAMPLER2D;0;False;59;FLOAT;0;False;61;FLOAT;0;False;63;FLOAT;0;False;65;FLOAT;0;False;60;FLOAT;0;False;62;FLOAT;0;False;64;FLOAT;0;False;66;FLOAT;0;False;4;COLOR;0;FLOAT3;132;FLOAT;79;FLOAT;92
Node;AmplifyShaderEditor.GetLocalVarNode;61;-2006.835,362.3217;Inherit;False;59;_Color;1;0;OBJECT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;60;-1729.835,466.3217;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;55;-1491.863,461.057;Float;False;albedo;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;80;-1490.6,559.9918;Float;False;normalVector;-1;True;1;0;FLOAT3;0,0,0;False;1;FLOAT3;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;56;-1491.193,662.8465;Float;False;metallicValue;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;57;-1514.221,760.9777;Float;False;smoothnessValue;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;63;-346.2018,101.0122;Inherit;False;56;metallicValue;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;64;-365.2018,201.0122;Inherit;False;57;smoothnessValue;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;62;-329.2018,-75.98779;Inherit;False;55;albedo;1;0;OBJECT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.GetLocalVarNode;81;-357.1204,12.14795;Inherit;False;80;normalVector;1;0;OBJECT;0;False;1;FLOAT3;0
Node;AmplifyShaderEditor.StandardSurfaceOutputNode;83;0,0;Half;False;True;-1;2;;0;0;Standard;Polaris/BuiltinRP/Terrain/PBR_4Splats4Normals;False;False;False;False;False;False;False;False;False;False;False;False;False;True;False;False;False;True;False;False;False;Back;0;False;-1;0;False;-1;False;0;False;-1;0;False;-1;False;0;Opaque;0.5;True;True;0;False;Opaque;;Geometry;All;14;all;True;True;True;True;0;False;-1;False;0;False;-1;255;False;-1;255;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;False;2;15;10;25;False;0.5;True;0;0;False;-1;0;False;-1;0;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;0;0,0,0,0;VertexOffset;True;False;Cylindrical;False;Relative;0;;-1;-1;-1;-1;0;False;0;0;False;-1;-1;0;False;-1;0;0;0;False;0.1;False;-1;0;False;-1;16;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;2;FLOAT3;0,0,0;False;3;FLOAT;0;False;4;FLOAT;0;False;5;FLOAT;0;False;6;FLOAT3;0,0,0;False;7;FLOAT3;0,0,0;False;8;FLOAT;0;False;9;FLOAT;0;False;10;FLOAT;0;False;13;FLOAT3;0,0,0;False;11;FLOAT3;0,0,0;False;12;FLOAT3;0,0,0;False;14;FLOAT4;0,0,0,0;False;15;FLOAT3;0,0,0;False;0
WireConnection;70;0;68;0
WireConnection;22;0;20;0
WireConnection;16;0;24;0
WireConnection;19;0;29;0
WireConnection;18;0;17;0
WireConnection;11;0;10;0
WireConnection;12;0;13;0
WireConnection;6;0;7;0
WireConnection;14;0;30;0
WireConnection;26;0;31;0
WireConnection;23;0;21;0
WireConnection;71;0;66;0
WireConnection;72;0;69;0
WireConnection;9;0;8;0
WireConnection;27;0;25;0
WireConnection;15;0;28;0
WireConnection;73;0;67;0
WireConnection;59;0;58;0
WireConnection;82;54;38;0
WireConnection;82;55;39;0
WireConnection;82;56;40;0
WireConnection;82;57;41;0
WireConnection;82;58;42;0
WireConnection;82;100;78;0
WireConnection;82;101;77;0
WireConnection;82;105;76;0
WireConnection;82;102;79;0
WireConnection;82;59;48;0
WireConnection;82;61;46;0
WireConnection;82;63;47;0
WireConnection;82;65;49;0
WireConnection;82;60;52;0
WireConnection;82;62;50;0
WireConnection;82;64;51;0
WireConnection;82;66;53;0
WireConnection;60;0;61;0
WireConnection;60;1;82;0
WireConnection;55;0;60;0
WireConnection;80;0;82;132
WireConnection;56;0;82;79
WireConnection;57;0;82;92
WireConnection;83;0;62;0
WireConnection;83;1;81;0
WireConnection;83;3;63;0
WireConnection;83;4;64;0
ASEEND*/
//CHKSM=2ABE3EE18BD72489DE7741F481B3709643BD298F

View File

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

View File

@@ -0,0 +1,349 @@
// Made with Amplify Shader Editor
// Available at the Unity Asset Store - http://u3d.as/y3X
Shader "Polaris/BuiltinRP/Terrain/PBR_8Splats"
{
Properties
{
_Color("Color", Color) = (1,1,1,1)
_Control0("Control0", 2D) = "black" {}
_Control1("Control1", 2D) = "black" {}
_Splat0("Splat0", 2D) = "white" {}
_Splat1("Splat1", 2D) = "white" {}
_Splat2("Splat2", 2D) = "white" {}
_Splat3("Splat3", 2D) = "white" {}
_Splat4("Splat4", 2D) = "white" {}
_Splat5("Splat5", 2D) = "white" {}
_Splat6("Splat6", 2D) = "white" {}
_Splat7("Splat7", 2D) = "white" {}
_Metallic0("Metallic0", Range( 0 , 1)) = 0
_Metallic1("Metallic1", Range( 0 , 1)) = 0
_Metallic2("Metallic2", Range( 0 , 1)) = 0
_Metallic3("Metallic3", Range( 0 , 1)) = 0
_Metallic4("Metallic4", Range( 0 , 1)) = 0
_Metallic5("Metallic5", Range( 0 , 1)) = 0
_Metallic6("Metallic6", Range( 0 , 1)) = 0
_Metallic7("Metallic7", Range( 0 , 1)) = 0
_Smoothness0("Smoothness0", Range( 0 , 1)) = 0
_Smoothness1("Smoothness1", Range( 0 , 1)) = 0
_Smoothness2("Smoothness2", Range( 0 , 1)) = 0
_Smoothness3("Smoothness3", Range( 0 , 1)) = 0
_Smoothness4("Smoothness4", Range( 0 , 1)) = 0
_Smoothness5("Smoothness5", Range( 0 , 1)) = 0
_Smoothness6("Smoothness6", Range( 0 , 1)) = 0
_Smoothness7("Smoothness7", Range( 0 , 1)) = 0
[HideInInspector] _texcoord( "", 2D ) = "white" {}
[HideInInspector] __dirty( "", Int ) = 1
}
SubShader
{
Tags{ "RenderType" = "Opaque" "Queue" = "Geometry+0" "DisableBatching" = "True" }
Cull Back
CGPROGRAM
#pragma target 3.0
#pragma surface surf Standard keepalpha addshadow fullforwardshadows noinstancing
struct Input
{
float2 uv_texcoord;
};
uniform float4 _Color;
uniform sampler2D _Splat0;
uniform float4 _Splat0_ST;
uniform sampler2D _Control0;
uniform sampler2D _Splat1;
uniform float4 _Splat1_ST;
uniform sampler2D _Splat2;
uniform float4 _Splat2_ST;
uniform sampler2D _Splat3;
uniform float4 _Splat3_ST;
uniform sampler2D _Splat4;
uniform float4 _Splat4_ST;
uniform sampler2D _Control1;
uniform sampler2D _Splat5;
uniform float4 _Splat5_ST;
uniform sampler2D _Splat6;
uniform float4 _Splat6_ST;
uniform sampler2D _Splat7;
uniform float4 _Splat7_ST;
uniform float _Metallic0;
uniform float _Metallic1;
uniform float _Metallic2;
uniform float _Metallic3;
uniform float _Metallic4;
uniform float _Metallic5;
uniform float _Metallic6;
uniform float _Metallic7;
uniform float _Smoothness0;
uniform float _Smoothness1;
uniform float _Smoothness2;
uniform float _Smoothness3;
uniform float _Smoothness4;
uniform float _Smoothness5;
uniform float _Smoothness6;
uniform float _Smoothness7;
void surf( Input i , inout SurfaceOutputStandard o )
{
float4 _Color59 = _Color;
float2 uv0_Splat0 = i.uv_texcoord * _Splat0_ST.xy + _Splat0_ST.zw;
half4 tex2DNode31_g17 = tex2D( _Control0, i.uv_texcoord );
half4 break34_g17 = tex2DNode31_g17;
float2 uv0_Splat1 = i.uv_texcoord * _Splat1_ST.xy + _Splat1_ST.zw;
float2 uv0_Splat2 = i.uv_texcoord * _Splat2_ST.xy + _Splat2_ST.zw;
float2 uv0_Splat3 = i.uv_texcoord * _Splat3_ST.xy + _Splat3_ST.zw;
float4 splatColor52_g17 = ( ( tex2D( _Splat0, uv0_Splat0 ) * break34_g17.r ) + ( tex2D( _Splat1, uv0_Splat1 ) * break34_g17.g ) + ( tex2D( _Splat2, uv0_Splat2 ) * break34_g17.b ) + ( tex2D( _Splat3, uv0_Splat3 ) * break34_g17.a ) );
float4 splatColor055 = splatColor52_g17;
float2 uv0_Splat4 = i.uv_texcoord * _Splat4_ST.xy + _Splat4_ST.zw;
half4 tex2DNode31_g16 = tex2D( _Control1, i.uv_texcoord );
half4 break34_g16 = tex2DNode31_g16;
float2 uv0_Splat5 = i.uv_texcoord * _Splat5_ST.xy + _Splat5_ST.zw;
float2 uv0_Splat6 = i.uv_texcoord * _Splat6_ST.xy + _Splat6_ST.zw;
float2 uv0_Splat7 = i.uv_texcoord * _Splat7_ST.xy + _Splat7_ST.zw;
float4 splatColor52_g16 = ( ( tex2D( _Splat4, uv0_Splat4 ) * break34_g16.r ) + ( tex2D( _Splat5, uv0_Splat5 ) * break34_g16.g ) + ( tex2D( _Splat6, uv0_Splat6 ) * break34_g16.b ) + ( tex2D( _Splat7, uv0_Splat7 ) * break34_g16.a ) );
float4 splatColor1117 = splatColor52_g16;
float4 albedoColor125 = ( _Color59 * ( splatColor055 + splatColor1117 ) );
o.Albedo = albedoColor125.rgb;
float _Metallic014 = _Metallic0;
float _Metallic013_g17 = _Metallic014;
half4 break67_g17 = tex2DNode31_g17;
float _Metallic119 = _Metallic1;
float _Metallic116_g17 = _Metallic119;
float _Metallic222 = _Metallic2;
float _Metallic221_g17 = _Metallic222;
float _Metallic316 = _Metallic3;
float _Metallic326_g17 = _Metallic316;
float metallicValue77_g17 = ( ( _Metallic013_g17 * break67_g17.r ) + ( _Metallic116_g17 * break67_g17.g ) + ( _Metallic221_g17 * break67_g17.b ) + ( _Metallic326_g17 * break67_g17.a ) );
float metallicValue056 = metallicValue77_g17;
float _Metallic499 = _Metallic4;
float _Metallic013_g16 = _Metallic499;
half4 break67_g16 = tex2DNode31_g16;
float _Metallic5100 = _Metallic5;
float _Metallic116_g16 = _Metallic5100;
float _Metallic696 = _Metallic6;
float _Metallic221_g16 = _Metallic696;
float _Metallic797 = _Metallic7;
float _Metallic326_g16 = _Metallic797;
float metallicValue77_g16 = ( ( _Metallic013_g16 * break67_g16.r ) + ( _Metallic116_g16 * break67_g16.g ) + ( _Metallic221_g16 * break67_g16.b ) + ( _Metallic326_g16 * break67_g16.a ) );
float metallicValue1118 = metallicValue77_g16;
float metallic129 = ( metallicValue056 + metallicValue1118 );
o.Metallic = metallic129;
float _Smoothness027 = _Smoothness0;
float _Smoothness014_g17 = _Smoothness027;
half4 break80_g17 = tex2DNode31_g17;
float _Smoothness118 = _Smoothness1;
float _Smoothness119_g17 = _Smoothness118;
float _Smoothness223 = _Smoothness2;
float _Smoothness223_g17 = _Smoothness223;
float _Smoothness315 = _Smoothness3;
float _Smoothness327_g17 = _Smoothness315;
float smoothnessValue82_g17 = ( ( _Smoothness014_g17 * break80_g17.r ) + ( _Smoothness119_g17 * break80_g17.g ) + ( _Smoothness223_g17 * break80_g17.b ) + ( _Smoothness327_g17 * break80_g17.a ) );
float smoothnessValue057 = smoothnessValue82_g17;
float _Smoothness494 = _Smoothness4;
float _Smoothness014_g16 = _Smoothness494;
half4 break80_g16 = tex2DNode31_g16;
float _Smoothness595 = _Smoothness5;
float _Smoothness119_g16 = _Smoothness595;
float _Smoothness698 = _Smoothness6;
float _Smoothness223_g16 = _Smoothness698;
float _Smoothness793 = _Smoothness7;
float _Smoothness327_g16 = _Smoothness793;
float smoothnessValue82_g16 = ( ( _Smoothness014_g16 * break80_g16.r ) + ( _Smoothness119_g16 * break80_g16.g ) + ( _Smoothness223_g16 * break80_g16.b ) + ( _Smoothness327_g16 * break80_g16.a ) );
float smoothnessValue1119 = smoothnessValue82_g16;
float smoothness133 = ( smoothnessValue057 + smoothnessValue1119 );
o.Smoothness = smoothness133;
o.Alpha = 1;
}
ENDCG
}
Fallback "Diffuse"
}
/*ASEBEGIN
Version=18000
1244;197;1906;885;2236.417;106.7359;1;True;False
Node;AmplifyShaderEditor.CommentaryNode;5;-3537.489,-2432.581;Inherit;False;2620.827;1205.286;;54;92;95;96;98;88;99;84;100;89;90;83;93;91;94;87;73;66;67;68;69;58;70;71;72;85;97;86;59;19;23;22;14;18;16;11;15;6;9;12;27;26;31;17;21;7;13;10;24;8;25;29;20;30;28;Inputs;1,1,1,1;0;0
Node;AmplifyShaderEditor.RangedFloatNode;88;-2842.811,-1488.449;Float;False;Property;_Metallic7;Metallic7;18;0;Create;True;0;0;False;0;0;0;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;21;-3475.489,-1618.057;Float;False;Property;_Smoothness2;Smoothness2;21;0;Create;True;0;0;False;0;0;0;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.TexturePropertyNode;83;-1515.058,-2377.599;Float;True;Property;_Control1;Control1;2;0;Create;True;0;0;False;0;None;None;False;black;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RangedFloatNode;92;-2844.721,-1612.909;Float;False;Property;_Smoothness6;Smoothness6;25;0;Create;True;0;0;False;0;0;0;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;87;-2853.721,-1919.909;Float;False;Property;_Metallic5;Metallic5;16;0;Create;True;0;0;False;0;0;0;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.TexturePropertyNode;13;-2070.795,-1503.025;Float;True;Property;_Splat3;Splat3;6;0;Create;True;0;0;False;0;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RangedFloatNode;89;-2856.721,-2152.409;Float;False;Property;_Metallic4;Metallic4;15;0;Create;True;0;0;False;0;0;0;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.TexturePropertyNode;67;-1505.157,-1716.046;Float;True;Property;_Splat6;Splat6;9;0;Create;True;0;0;False;0;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RangedFloatNode;86;-2854.721,-2063.409;Float;False;Property;_Smoothness4;Smoothness4;23;0;Create;True;0;0;False;0;0;0;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.TexturePropertyNode;69;-1510.157,-1926.045;Float;True;Property;_Splat5;Splat5;8;0;Create;True;0;0;False;0;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RangedFloatNode;85;-2846.721,-1701.909;Float;False;Property;_Metallic6;Metallic6;17;0;Create;True;0;0;False;0;0;0;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.TexturePropertyNode;68;-1506.701,-1500.49;Float;True;Property;_Splat7;Splat7;10;0;Create;True;0;0;False;0;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;66;-1515.157,-2158.046;Float;True;Property;_Splat4;Splat4;7;0;Create;True;0;0;False;0;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RangedFloatNode;90;-2840.811,-1399.449;Float;False;Property;_Smoothness7;Smoothness7;26;0;Create;True;0;0;False;0;0;0;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;28;-3471.579,-1404.597;Float;False;Property;_Smoothness3;Smoothness3;22;0;Create;True;0;0;False;0;0;0;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.TexturePropertyNode;10;-2069.251,-1718.582;Float;True;Property;_Splat2;Splat2;5;0;Create;True;0;0;False;0;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RangedFloatNode;17;-3482.489,-1836.057;Float;False;Property;_Smoothness1;Smoothness1;20;0;Create;True;0;0;False;0;0;0;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;24;-3473.579,-1493.597;Float;False;Property;_Metallic3;Metallic3;14;0;Create;True;0;0;False;0;0;0;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;30;-3487.489,-2157.557;Float;False;Property;_Metallic0;Metallic0;11;0;Create;True;0;0;False;0;0;0;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;25;-3485.489,-2068.557;Float;False;Property;_Smoothness0;Smoothness0;19;0;Create;True;0;0;False;0;0;0;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;20;-3477.489,-1707.057;Float;False;Property;_Metallic2;Metallic2;13;0;Create;True;0;0;False;0;0;0;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.TexturePropertyNode;8;-2074.251,-1928.582;Float;True;Property;_Splat1;Splat1;4;0;Create;True;0;0;False;0;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;31;-2079.251,-2382.581;Float;True;Property;_Control0;Control0;1;0;Create;True;0;0;False;0;None;None;False;black;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;7;-2079.251,-2160.582;Float;True;Property;_Splat0;Splat0;3;0;Create;True;0;0;False;0;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RangedFloatNode;91;-2851.721,-1830.909;Float;False;Property;_Smoothness5;Smoothness5;24;0;Create;True;0;0;False;0;0;0;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;29;-3484.489,-1925.057;Float;False;Property;_Metallic1;Metallic1;12;0;Create;True;0;0;False;0;0;0;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;15;-3143.58,-1402.597;Float;False;_Smoothness3;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;96;-2518.722,-1699.909;Float;False;_Metallic6;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;100;-2520.722,-1916.909;Float;False;_Metallic5;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;93;-2512.812,-1397.449;Float;False;_Smoothness7;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;84;-1217.058,-2373.599;Float;False;_Control1;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;94;-2526.722,-2061.409;Float;False;_Smoothness4;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;73;-1207.158,-1712.046;Float;False;_Splat6;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;98;-2516.722,-1610.909;Float;False;_Smoothness6;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;97;-2514.812,-1486.449;Float;False;_Metallic7;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;72;-1212.158,-1922.045;Float;False;_Splat5;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;70;-1208.702,-1496.49;Float;False;_Splat7;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;11;-1771.251,-1714.582;Float;False;_Splat2;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;99;-2528.722,-2150.409;Float;False;_Metallic4;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;71;-1217.158,-2154.046;Float;False;_Splat4;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;18;-3154.49,-1834.057;Float;False;_Smoothness1;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.CommentaryNode;102;-3547.73,304.941;Inherit;False;1423.094;1149.181;;17;119;118;117;116;115;114;113;112;111;110;109;108;107;106;105;104;103;Second layer;1,1,1,1;0;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;19;-3151.49,-1922.057;Float;False;_Metallic1;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;14;-3159.49,-2155.557;Float;False;_Metallic0;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;23;-3147.49,-1616.057;Float;False;_Smoothness2;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;16;-3145.58,-1491.597;Float;False;_Metallic3;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;12;-1772.795,-1499.026;Float;False;_Splat3;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;22;-3149.49,-1705.057;Float;False;_Metallic2;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;26;-1781.251,-2378.581;Float;False;_Control0;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;95;-2523.722,-1828.909;Float;False;_Smoothness5;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;9;-1776.251,-1924.582;Float;False;_Splat1;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.CommentaryNode;65;-3539.165,-1017.926;Inherit;False;1423.094;1149.181;;17;38;47;46;52;49;48;50;51;53;57;56;55;40;42;41;39;101;First layer;1,1,1,1;0;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;6;-1781.251,-2156.582;Float;False;_Splat0;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;27;-3157.49,-2066.557;Float;False;_Smoothness0;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;115;-3469.104,594.9399;Inherit;False;73;_Splat6;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;110;-3476.104,354.9407;Inherit;False;84;_Control1;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;108;-3479.545,857.0566;Inherit;False;100;_Metallic5;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;42;-3459.539,-649.9265;Inherit;False;12;_Splat3;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;103;-3502.545,1266.058;Inherit;False;98;_Smoothness6;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;111;-3505.545,1186.058;Inherit;False;95;_Smoothness5;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;106;-3475.545,1015.058;Inherit;False;97;_Metallic7;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;107;-3501.545,1344.058;Inherit;False;93;_Smoothness7;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;40;-3463.539,-807.9264;Inherit;False;9;_Splat1;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;112;-3468.104,672.9397;Inherit;False;70;_Splat7;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;104;-3506.545,1106.058;Inherit;False;94;_Smoothness4;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;47;-3467.98,-385.8093;Inherit;False;22;_Metallic2;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;39;-3464.539,-887.9265;Inherit;False;6;_Splat0;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;105;-3480.545,777.0569;Inherit;False;99;_Metallic4;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;51;-3493.98,-56.80935;Inherit;False;23;_Smoothness2;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;41;-3460.539,-727.9264;Inherit;False;11;_Splat2;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;50;-3496.98,-136.8093;Inherit;False;18;_Smoothness1;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;38;-3467.539,-967.9264;Inherit;False;26;_Control0;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;49;-3466.98,-307.8093;Inherit;False;16;_Metallic3;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;114;-3473.104,434.9402;Inherit;False;71;_Splat4;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;46;-3470.98,-465.8095;Inherit;False;19;_Metallic1;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;52;-3497.98,-216.8092;Inherit;False;27;_Smoothness0;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;113;-3472.104,514.9401;Inherit;False;72;_Splat5;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;48;-3471.98,-545.8093;Inherit;False;14;_Metallic0;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;53;-3492.98,21.19055;Inherit;False;15;_Smoothness3;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;109;-3476.545,937.0574;Inherit;False;96;_Metallic6;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.FunctionNode;116;-3008.601,647.4875;Inherit;False;Sample4SplatsPBR;-1;;16;a6f307978ba7ac84eb0587d072b0df93;0;13;54;SAMPLER2D;0;False;55;SAMPLER2D;0;False;56;SAMPLER2D;0;False;57;SAMPLER2D;0;False;58;SAMPLER2D;0;False;59;FLOAT;0;False;61;FLOAT;0;False;63;FLOAT;0;False;65;FLOAT;0;False;60;FLOAT;0;False;62;FLOAT;0;False;64;FLOAT;0;False;66;FLOAT;0;False;3;COLOR;0;FLOAT;79;FLOAT;92
Node;AmplifyShaderEditor.FunctionNode;101;-3000.036,-675.3787;Inherit;False;Sample4SplatsPBR;-1;;17;a6f307978ba7ac84eb0587d072b0df93;0;13;54;SAMPLER2D;0;False;55;SAMPLER2D;0;False;56;SAMPLER2D;0;False;57;SAMPLER2D;0;False;58;SAMPLER2D;0;False;59;FLOAT;0;False;61;FLOAT;0;False;63;FLOAT;0;False;65;FLOAT;0;False;60;FLOAT;0;False;62;FLOAT;0;False;64;FLOAT;0;False;66;FLOAT;0;False;3;COLOR;0;FLOAT;79;FLOAT;92
Node;AmplifyShaderEditor.CommentaryNode;134;-1923.133,-1016.12;Inherit;False;1003;688.0636;;14;121;120;122;124;123;125;126;127;128;129;131;132;130;133;Blend Addictive;1,1,1,1;0;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;55;-2495.613,-678.7977;Float;False;splatColor0;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;117;-2504.178,644.0685;Float;False;splatColor1;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.ColorNode;58;-3480.193,-2358.685;Float;False;Property;_Color;Color;0;0;Create;True;0;0;False;0;1,1,1,1;1,1,1,1;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.RegisterLocalVarNode;56;-2492.943,-580.0084;Float;False;metallicValue0;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;59;-3148.241,-2360.32;Float;False;_Color;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.GetLocalVarNode;120;-1869.316,-915.3834;Inherit;False;55;splatColor0;1;0;OBJECT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;119;-2498.536,842.989;Float;False;smoothnessValue1;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;118;-2501.508,742.8578;Float;False;metallicValue1;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;57;-2489.971,-479.8773;Float;False;smoothnessValue0;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;121;-1870.723,-819.7946;Inherit;False;117;splatColor1;1;0;OBJECT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.GetLocalVarNode;130;-1868.133,-532.0562;Inherit;False;57;smoothnessValue0;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;127;-1870.133,-632.5565;Inherit;False;118;metallicValue1;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;126;-1865.133,-721.5565;Inherit;False;56;metallicValue0;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleAddOpNode;122;-1562.87,-874.6176;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.GetLocalVarNode;123;-1615.276,-966.1201;Inherit;False;59;_Color;1;0;OBJECT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.GetLocalVarNode;131;-1873.133,-443.0561;Inherit;False;119;smoothnessValue1;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleAddOpNode;132;-1569.133,-493.0561;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;124;-1378.276,-882.1201;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.SimpleAddOpNode;128;-1566.133,-682.5565;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;125;-1172.276,-887.1201;Float;False;albedoColor;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;133;-1166.133,-494.0561;Float;False;smoothness;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;129;-1163.133,-683.5565;Float;False;metallic;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;63;-1498.471,190.0957;Inherit;False;129;metallic;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;62;-1522.471,67.09568;Inherit;False;125;albedoColor;1;0;OBJECT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.GetLocalVarNode;64;-1517.471,305.0956;Inherit;False;133;smoothness;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.StandardSurfaceOutputNode;135;-1206.269,100.0835;Half;False;True;-1;2;;0;0;Standard;Polaris/BuiltinRP/Terrain/PBR_8Splats;False;False;False;False;False;False;False;False;False;False;False;False;False;True;False;False;False;True;False;False;False;Back;0;False;-1;0;False;-1;False;0;False;-1;0;False;-1;False;0;Opaque;0.5;True;True;0;False;Opaque;;Geometry;All;14;all;True;True;True;True;0;False;-1;False;0;False;-1;255;False;-1;255;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;False;2;15;10;25;False;0.5;True;0;0;False;-1;0;False;-1;0;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;0;0,0,0,0;VertexOffset;True;False;Cylindrical;False;Relative;0;;-1;-1;-1;-1;0;False;0;0;False;-1;-1;0;False;-1;0;0;0;False;0.1;False;-1;0;False;-1;16;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;2;FLOAT3;0,0,0;False;3;FLOAT;0;False;4;FLOAT;0;False;5;FLOAT;0;False;6;FLOAT3;0,0,0;False;7;FLOAT3;0,0,0;False;8;FLOAT;0;False;9;FLOAT;0;False;10;FLOAT;0;False;13;FLOAT3;0,0,0;False;11;FLOAT3;0,0,0;False;12;FLOAT3;0,0,0;False;14;FLOAT4;0,0,0,0;False;15;FLOAT3;0,0,0;False;0
WireConnection;15;0;28;0
WireConnection;96;0;85;0
WireConnection;100;0;87;0
WireConnection;93;0;90;0
WireConnection;84;0;83;0
WireConnection;94;0;86;0
WireConnection;73;0;67;0
WireConnection;98;0;92;0
WireConnection;97;0;88;0
WireConnection;72;0;69;0
WireConnection;70;0;68;0
WireConnection;11;0;10;0
WireConnection;99;0;89;0
WireConnection;71;0;66;0
WireConnection;18;0;17;0
WireConnection;19;0;29;0
WireConnection;14;0;30;0
WireConnection;23;0;21;0
WireConnection;16;0;24;0
WireConnection;12;0;13;0
WireConnection;22;0;20;0
WireConnection;26;0;31;0
WireConnection;95;0;91;0
WireConnection;9;0;8;0
WireConnection;6;0;7;0
WireConnection;27;0;25;0
WireConnection;116;54;110;0
WireConnection;116;55;114;0
WireConnection;116;56;113;0
WireConnection;116;57;115;0
WireConnection;116;58;112;0
WireConnection;116;59;105;0
WireConnection;116;61;108;0
WireConnection;116;63;109;0
WireConnection;116;65;106;0
WireConnection;116;60;104;0
WireConnection;116;62;111;0
WireConnection;116;64;103;0
WireConnection;116;66;107;0
WireConnection;101;54;38;0
WireConnection;101;55;39;0
WireConnection;101;56;40;0
WireConnection;101;57;41;0
WireConnection;101;58;42;0
WireConnection;101;59;48;0
WireConnection;101;61;46;0
WireConnection;101;63;47;0
WireConnection;101;65;49;0
WireConnection;101;60;52;0
WireConnection;101;62;50;0
WireConnection;101;64;51;0
WireConnection;101;66;53;0
WireConnection;55;0;101;0
WireConnection;117;0;116;0
WireConnection;56;0;101;79
WireConnection;59;0;58;0
WireConnection;119;0;116;92
WireConnection;118;0;116;79
WireConnection;57;0;101;92
WireConnection;122;0;120;0
WireConnection;122;1;121;0
WireConnection;132;0;130;0
WireConnection;132;1;131;0
WireConnection;124;0;123;0
WireConnection;124;1;122;0
WireConnection;128;0;126;0
WireConnection;128;1;127;0
WireConnection;125;0;124;0
WireConnection;133;0;132;0
WireConnection;129;0;128;0
WireConnection;135;0;62;0
WireConnection;135;3;63;0
WireConnection;135;4;64;0
ASEEND*/
//CHKSM=EA81135A233BBC75B4F502C18DFCC4DCA6848CA6

View File

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

View File

@@ -0,0 +1,59 @@
// Made with Amplify Shader Editor
// Available at the Unity Asset Store - http://u3d.as/y3X
Shader "Polaris/BuiltinRP/Terrain/PBR_ColorMap"
{
Properties
{
_MainTex("_MainTex", 2D) = "white" {}
_MetallicGlossMap("_MetallicGlossMap", 2D) = "white" {}
[HideInInspector] _texcoord( "", 2D ) = "white" {}
[HideInInspector] __dirty( "", Int ) = 1
}
SubShader
{
Tags{ "RenderType" = "Opaque" "Queue" = "Geometry+0" }
Cull Back
CGPROGRAM
#pragma target 3.0
#pragma surface surf Standard keepalpha addshadow fullforwardshadows noinstancing
struct Input
{
float2 uv_texcoord;
};
uniform sampler2D _MainTex;
uniform half4 _MainTex_ST;
uniform sampler2D _MetallicGlossMap;
uniform half4 _MetallicGlossMap_ST;
void surf( Input i , inout SurfaceOutputStandard o )
{
float2 uv_MainTex = i.uv_texcoord * _MainTex_ST.xy + _MainTex_ST.zw;
o.Albedo = tex2D( _MainTex, uv_MainTex ).rgb;
float2 uv_MetallicGlossMap = i.uv_texcoord * _MetallicGlossMap_ST.xy + _MetallicGlossMap_ST.zw;
half4 tex2DNode4 = tex2D( _MetallicGlossMap, uv_MetallicGlossMap );
o.Metallic = tex2DNode4.r;
o.Smoothness = tex2DNode4.a;
o.Alpha = 1;
}
ENDCG
}
Fallback "Diffuse"
}
/*ASEBEGIN
Version=18000
1244;197;1906;885;1397.986;367.9311;1;True;False
Node;AmplifyShaderEditor.TexturePropertyNode;1;-1015.986,-327.9311;Inherit;True;Property;_MainTex;_MainTex;0;0;Create;True;0;0;False;0;None;None;False;white;Auto;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;3;-1024.986,-25.93106;Inherit;True;Property;_MetallicGlossMap;_MetallicGlossMap;1;0;Create;True;0;0;False;0;None;None;False;white;Auto;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.SamplerNode;2;-669.9861,-289.9311;Inherit;True;Property;_TextureSample0;Texture Sample 0;1;0;Create;True;0;0;False;0;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;6;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;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.SamplerNode;4;-695.9861,-9.931061;Inherit;True;Property;_TextureSample1;Texture Sample 1;2;0;Create;True;0;0;False;0;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;6;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;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.StandardSurfaceOutputNode;0;0,0;Half;False;True;-1;2;;0;0;Standard;Polaris/BuiltinRP/Terrain/PBR_ColorMap;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;True;False;False;False;Back;0;False;-1;0;False;-1;False;0;False;-1;0;False;-1;False;0;Opaque;0.5;True;True;0;False;Opaque;;Geometry;All;14;all;True;True;True;True;0;False;-1;False;0;False;-1;255;False;-1;255;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;False;2;15;10;25;False;0.5;True;0;0;False;-1;0;False;-1;0;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;0;0,0,0,0;VertexOffset;True;False;Cylindrical;False;Relative;0;;-1;-1;-1;-1;0;False;0;0;False;-1;-1;0;False;-1;0;0;0;False;0.1;False;-1;0;False;-1;16;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;2;FLOAT3;0,0,0;False;3;FLOAT;0;False;4;FLOAT;0;False;5;FLOAT;0;False;6;FLOAT3;0,0,0;False;7;FLOAT3;0,0,0;False;8;FLOAT;0;False;9;FLOAT;0;False;10;FLOAT;0;False;13;FLOAT3;0,0,0;False;11;FLOAT3;0,0,0;False;12;FLOAT3;0,0,0;False;14;FLOAT4;0,0,0,0;False;15;FLOAT3;0,0,0;False;0
WireConnection;2;0;1;0
WireConnection;4;0;3;0
WireConnection;0;0;2;0
WireConnection;0;3;4;1
WireConnection;0;4;4;4
ASEEND*/
//CHKSM=737DA3374B43A1C3B2823EE86F27FA740651D45D

View File

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

View File

@@ -0,0 +1,267 @@
// Made with Amplify Shader Editor
// Available at the Unity Asset Store - http://u3d.as/y3X
Shader "Polaris/BuiltinRP/Terrain/PBR_GradientLookup"
{
Properties
{
_Color("Color", Color) = (1,1,1,1)
_ColorByHeight("Color By Height", 2D) = "white" {}
_ColorByNormal("Color By Normal", 2D) = "white" {}
_ColorBlend("ColorBlend", 2D) = "white" {}
_Dimension("Dimension", Vector) = (1,1,1,0)
_MainTex("MainTex", 2D) = "black" {}
_MetallicGlossMap("MetallicGlossMap", 2D) = "black" {}
[HideInInspector] _texcoord( "", 2D ) = "white" {}
[HideInInspector] __dirty( "", Int ) = 1
}
SubShader
{
Tags{ "RenderType" = "Opaque" "Queue" = "Geometry+0" "DisableBatching" = "True" }
Cull Back
CGINCLUDE
#include "UnityShaderVariables.cginc"
#include "UnityPBSLighting.cginc"
#include "Lighting.cginc"
#pragma target 3.0
struct Input
{
float3 worldPos;
half3 worldNormal;
float2 uv_texcoord;
};
uniform sampler2D _ColorByHeight;
uniform float3 _Dimension;
uniform sampler2D _ColorBlend;
uniform sampler2D _ColorByNormal;
uniform sampler2D _MainTex;
uniform float4 _Color;
uniform sampler2D _MetallicGlossMap;
void surf( Input i , inout SurfaceOutputStandard o )
{
float3 ase_vertex3Pos = mul( unity_WorldToObject, float4( i.worldPos , 1 ) );
float _Height22 = _Dimension.y;
float heightFraction59 = (0.0 + (ase_vertex3Pos.y - 0.0) * (1.0 - 0.0) / (_Height22 - 0.0));
half2 appendResult25 = (half2(heightFraction59 , 0.5));
float4 colorByHeightResult30 = tex2D( _ColorByHeight, appendResult25 );
half2 appendResult63 = (half2(heightFraction59 , 0.5));
half4 tex2DNode65 = tex2D( _ColorBlend, appendResult63 );
half3 ase_worldNormal = i.worldNormal;
half3 ase_vertexNormal = mul( unity_WorldToObject, float4( ase_worldNormal, 0 ) );
half2 appendResult41 = (half2(saturate( ase_vertexNormal.y ) , 0.5));
float4 colorByNormalResult43 = tex2D( _ColorByNormal, appendResult41 );
float4 mainTexColor53 = tex2D( _MainTex, i.uv_texcoord );
float4 _Color9 = _Color;
float4 albedoResult78 = ( ( ( ( ( colorByHeightResult30 * ( 1.0 - tex2DNode65.r ) ) + ( colorByNormalResult43 * tex2DNode65.r ) ) * ( 1.0 - mainTexColor53.a ) ) + mainTexColor53 ) * _Color9 );
o.Albedo = albedoResult78.rgb;
half4 tex2DNode51 = tex2D( _MetallicGlossMap, i.uv_texcoord );
float metallicValue54 = tex2DNode51.r;
o.Metallic = metallicValue54;
float smoothnessValue55 = tex2DNode51.a;
o.Smoothness = smoothnessValue55;
o.Alpha = 1;
}
ENDCG
CGPROGRAM
#pragma surface surf Standard keepalpha fullforwardshadows noinstancing
ENDCG
Pass
{
Name "ShadowCaster"
Tags{ "LightMode" = "ShadowCaster" }
ZWrite On
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma target 3.0
#pragma multi_compile_shadowcaster
#pragma multi_compile UNITY_PASS_SHADOWCASTER
#pragma skip_variants FOG_LINEAR FOG_EXP FOG_EXP2
#include "HLSLSupport.cginc"
#if ( SHADER_API_D3D11 || SHADER_API_GLCORE || SHADER_API_GLES || SHADER_API_GLES3 || SHADER_API_METAL || SHADER_API_VULKAN )
#define CAN_SKIP_VPOS
#endif
#include "UnityCG.cginc"
#include "Lighting.cginc"
#include "UnityPBSLighting.cginc"
struct v2f
{
V2F_SHADOW_CASTER;
float2 customPack1 : TEXCOORD1;
float3 worldPos : TEXCOORD2;
float3 worldNormal : TEXCOORD3;
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
};
v2f vert( appdata_full v )
{
v2f o;
UNITY_SETUP_INSTANCE_ID( v );
UNITY_INITIALIZE_OUTPUT( v2f, o );
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO( o );
UNITY_TRANSFER_INSTANCE_ID( v, o );
Input customInputData;
float3 worldPos = mul( unity_ObjectToWorld, v.vertex ).xyz;
half3 worldNormal = UnityObjectToWorldNormal( v.normal );
o.worldNormal = worldNormal;
o.customPack1.xy = customInputData.uv_texcoord;
o.customPack1.xy = v.texcoord;
o.worldPos = worldPos;
TRANSFER_SHADOW_CASTER_NORMALOFFSET( o )
return o;
}
half4 frag( v2f IN
#if !defined( CAN_SKIP_VPOS )
, UNITY_VPOS_TYPE vpos : VPOS
#endif
) : SV_Target
{
UNITY_SETUP_INSTANCE_ID( IN );
Input surfIN;
UNITY_INITIALIZE_OUTPUT( Input, surfIN );
surfIN.uv_texcoord = IN.customPack1.xy;
float3 worldPos = IN.worldPos;
half3 worldViewDir = normalize( UnityWorldSpaceViewDir( worldPos ) );
surfIN.worldPos = worldPos;
surfIN.worldNormal = IN.worldNormal;
SurfaceOutputStandard o;
UNITY_INITIALIZE_OUTPUT( SurfaceOutputStandard, o )
surf( surfIN, o );
#if defined( CAN_SKIP_VPOS )
float2 vpos = IN.pos;
#endif
SHADOW_CASTER_FRAGMENT( IN )
}
ENDCG
}
}
Fallback "Diffuse"
}
/*ASEBEGIN
Version=18000
1244;197;1906;885;4343.742;1521.234;1.3;True;False
Node;AmplifyShaderEditor.CommentaryNode;19;-3470.578,-1465.357;Inherit;False;705.3615;1527.715;;15;15;13;14;16;18;12;10;22;17;35;33;34;32;9;7;Properties;1,1,1,1;0;0
Node;AmplifyShaderEditor.Vector3Node;17;-3364.849,-146.0849;Float;False;Property;_Dimension;Dimension;4;0;Create;True;0;0;False;0;1,1,1;500,100,500;0;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
Node;AmplifyShaderEditor.CommentaryNode;29;-4462.73,222.3531;Inherit;False;1705.197;471.512;;9;21;20;23;59;27;26;28;25;30;Sample Color By Height;1,1,1,1;0;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;22;-3004.962,-53.73154;Float;False;_Height;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.PosVertexDataNode;20;-4431.73,366.4063;Inherit;False;0;0;5;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.GetLocalVarNode;21;-4420.388,526.8657;Inherit;False;22;_Height;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.CommentaryNode;46;-4251.19,848.2155;Inherit;False;1479.913;393.3013;;7;44;38;45;40;41;42;43;Sample Color By Normal;1,1,1,1;0;0
Node;AmplifyShaderEditor.TFHCRemapNode;23;-4154.533,369.3532;Inherit;False;5;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;3;FLOAT;0;False;4;FLOAT;1;False;1;FLOAT;0
Node;AmplifyShaderEditor.TexturePropertyNode;10;-3406.112,-779.2103;Float;True;Property;_ColorByHeight;Color By Height;1;0;Create;True;0;0;False;0;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.NormalVertexDataNode;44;-4201.19,985.4062;Inherit;False;0;5;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.TexturePropertyNode;13;-3408.715,-574.6287;Float;True;Property;_ColorByNormal;Color By Normal;2;0;Create;True;0;0;False;0;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.TexturePropertyNode;32;-3414.7,-1220.463;Float;True;Property;_MainTex;MainTex;5;0;Create;True;0;0;False;0;None;None;False;black;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RangedFloatNode;38;-3893.935,1126.517;Float;False;Constant;_Float1;Float 1;5;0;Create;True;0;0;False;0;0.5;0;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.SaturateNode;45;-3887.889,985.4063;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.TexturePropertyNode;15;-3409.715,-355.6289;Float;True;Property;_ColorBlend;ColorBlend;3;0;Create;True;0;0;False;0;None;None;False;white;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RangedFloatNode;26;-3838.534,551.3537;Float;False;Constant;_Float0;Float 0;5;0;Create;True;0;0;False;0;0.5;0;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;33;-3015.051,-1211.627;Float;False;_MainTex;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;59;-3919.558,376.0131;Float;False;heightFraction;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;12;-3003.319,-778.0468;Float;False;_ColorByHeight;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.CommentaryNode;56;-4035.565,1390.725;Inherit;False;1267.739;563.0514;;8;49;47;50;53;51;52;54;55;Sample Color Map and Metallic Map;1,1,1,1;0;0
Node;AmplifyShaderEditor.CommentaryNode;81;-5200.423,2113.417;Inherit;False;2426.761;752.334;;19;62;64;66;63;65;61;73;60;70;69;71;77;72;76;75;74;80;79;78;Blending;1,1,1,1;0;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;14;-3005.922,-573.4653;Float;False;_ColorByNormal;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RangedFloatNode;64;-5100.239,2458.251;Float;False;Constant;_Float2;Float 2;7;0;Create;True;0;0;False;0;0.5;0;0;0;0;1;FLOAT;0
Node;AmplifyShaderEditor.TextureCoordinatesNode;47;-3977.185,1555.253;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.DynamicAppendNode;25;-3615.534,379.3532;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.GetLocalVarNode;50;-3933.888,1440.725;Inherit;False;33;_MainTex;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;40;-3757.434,898.2155;Inherit;False;14;_ColorByNormal;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;16;-3006.922,-354.4655;Float;False;_ColorBlend;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.GetLocalVarNode;28;-3708.534,272.3531;Inherit;False;12;_ColorByHeight;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.DynamicAppendNode;41;-3664.434,1005.216;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.GetLocalVarNode;62;-5150.423,2367.167;Inherit;False;59;heightFraction;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.SamplerNode;42;-3421.434,933.2155;Inherit;True;Property;_TextureSample1;Texture Sample 1;5;0;Create;True;0;0;False;0;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;6;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;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.GetLocalVarNode;66;-5135.239,2285.251;Inherit;False;16;_ColorBlend;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.SamplerNode;27;-3372.534,307.3531;Inherit;True;Property;_TextureSample0;Texture Sample 0;5;0;Create;True;0;0;False;0;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;6;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;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.SamplerNode;49;-3538.628,1451.898;Inherit;True;Property;_TextureSample2;Texture Sample 2;7;0;Create;True;0;0;False;0;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;6;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;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.DynamicAppendNode;63;-4921.24,2371.251;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.RegisterLocalVarNode;43;-3060.277,935.2553;Float;False;colorByNormalResult;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.SamplerNode;65;-4646.239,2282.251;Inherit;True;Property;_TextureSample4;Texture Sample 4;7;0;Create;True;0;0;False;0;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;6;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;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.RegisterLocalVarNode;53;-3047.001,1457.485;Float;False;mainTexColor;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;30;-3011.377,309.393;Float;False;colorByHeightResult;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.GetLocalVarNode;60;-4608.684,2163.417;Inherit;False;30;colorByHeightResult;1;0;OBJECT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.OneMinusNode;70;-4300.243,2314.251;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;73;-4565.905,2750.751;Inherit;False;53;mainTexColor;1;0;OBJECT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.GetLocalVarNode;61;-4612.435,2516.534;Inherit;False;43;colorByNormalResult;1;0;OBJECT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.BreakToComponentsNode;77;-4217.19,2604.035;Inherit;False;COLOR;1;0;COLOR;0,0,0,0;False;16;FLOAT;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4;FLOAT;5;FLOAT;6;FLOAT;7;FLOAT;8;FLOAT;9;FLOAT;10;FLOAT;11;FLOAT;12;FLOAT;13;FLOAT;14;FLOAT;15
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;71;-4105.244,2469.251;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;69;-4102.244,2241.251;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.SimpleAddOpNode;72;-3897.244,2331.251;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.TexturePropertyNode;34;-3397.986,-997.0757;Float;True;Property;_MetallicGlossMap;MetallicGlossMap;6;0;Create;True;0;0;False;0;None;None;False;black;LockedToTexture2D;Texture2D;-1;0;1;SAMPLER2D;0
Node;AmplifyShaderEditor.OneMinusNode;76;-3902.191,2484.035;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.ColorNode;7;-3399.708,-1413.641;Float;False;Property;_Color;Color;0;0;Create;True;0;0;False;0;1,1,1,1;0.8705882,0.8705882,0.8705882,1;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;75;-3675.381,2329.59;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;35;-3031.346,-994.3598;Float;False;_MetallicGlossMap;-1;True;1;0;SAMPLER2D;;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;9;-3028.91,-1415.357;Float;False;_Color;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.GetLocalVarNode;80;-3486.65,2513.787;Inherit;False;9;_Color;1;0;OBJECT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.GetLocalVarNode;52;-3985.566,1732.629;Inherit;False;35;_MetallicGlossMap;1;0;OBJECT;0;False;1;SAMPLER2D;0
Node;AmplifyShaderEditor.SimpleAddOpNode;74;-3443.536,2325.927;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;79;-3223.65,2328.787;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.SamplerNode;51;-3535.835,1706.093;Inherit;True;Property;_TextureSample3;Texture Sample 3;7;0;Create;True;0;0;False;0;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;6;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;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.RegisterLocalVarNode;78;-3016.667,2319.323;Float;False;albedoResult;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;54;-3033.034,1713.076;Float;False;metallicValue;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;55;-3051.191,1841.57;Float;False;smoothnessValue;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;18;-3003.449,-144.7849;Float;False;_Dimension;-1;True;1;0;FLOAT3;0,0,0;False;1;FLOAT3;0
Node;AmplifyShaderEditor.GetLocalVarNode;57;-2427.393,217.5707;Inherit;False;54;metallicValue;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;31;-2429.736,122.1925;Inherit;False;78;albedoResult;1;0;OBJECT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.GetLocalVarNode;58;-2456.393,317.5708;Inherit;False;55;smoothnessValue;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.StandardSurfaceOutputNode;82;-2051.866,136.1994;Half;False;True;-1;2;;0;0;Standard;Polaris/BuiltinRP/Terrain/PBR_GradientLookup;False;False;False;False;False;False;False;False;False;False;False;False;False;True;False;False;False;True;False;False;False;Back;0;False;-1;0;False;-1;False;0;False;-1;0;False;-1;False;0;Opaque;0.5;True;True;0;False;Opaque;;Geometry;All;14;all;True;True;True;True;0;False;-1;False;0;False;-1;255;False;-1;255;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;False;2;15;10;25;False;0.5;True;0;0;False;-1;0;False;-1;0;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;0;0,0,0,0;VertexOffset;True;False;Cylindrical;False;Relative;0;;-1;-1;-1;-1;0;False;0;0;False;-1;-1;0;False;-1;0;0;0;False;0.1;False;-1;0;False;-1;16;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;2;FLOAT3;0,0,0;False;3;FLOAT;0;False;4;FLOAT;0;False;5;FLOAT;0;False;6;FLOAT3;0,0,0;False;7;FLOAT3;0,0,0;False;8;FLOAT;0;False;9;FLOAT;0;False;10;FLOAT;0;False;13;FLOAT3;0,0,0;False;11;FLOAT3;0,0,0;False;12;FLOAT3;0,0,0;False;14;FLOAT4;0,0,0,0;False;15;FLOAT3;0,0,0;False;0
WireConnection;22;0;17;2
WireConnection;23;0;20;2
WireConnection;23;2;21;0
WireConnection;45;0;44;2
WireConnection;33;0;32;0
WireConnection;59;0;23;0
WireConnection;12;0;10;0
WireConnection;14;0;13;0
WireConnection;25;0;59;0
WireConnection;25;1;26;0
WireConnection;16;0;15;0
WireConnection;41;0;45;0
WireConnection;41;1;38;0
WireConnection;42;0;40;0
WireConnection;42;1;41;0
WireConnection;27;0;28;0
WireConnection;27;1;25;0
WireConnection;49;0;50;0
WireConnection;49;1;47;0
WireConnection;63;0;62;0
WireConnection;63;1;64;0
WireConnection;43;0;42;0
WireConnection;65;0;66;0
WireConnection;65;1;63;0
WireConnection;53;0;49;0
WireConnection;30;0;27;0
WireConnection;70;0;65;1
WireConnection;77;0;73;0
WireConnection;71;0;61;0
WireConnection;71;1;65;1
WireConnection;69;0;60;0
WireConnection;69;1;70;0
WireConnection;72;0;69;0
WireConnection;72;1;71;0
WireConnection;76;0;77;3
WireConnection;75;0;72;0
WireConnection;75;1;76;0
WireConnection;35;0;34;0
WireConnection;9;0;7;0
WireConnection;74;0;75;0
WireConnection;74;1;73;0
WireConnection;79;0;74;0
WireConnection;79;1;80;0
WireConnection;51;0;52;0
WireConnection;51;1;47;0
WireConnection;78;0;79;0
WireConnection;54;0;51;1
WireConnection;55;0;51;4
WireConnection;18;0;17;0
WireConnection;82;0;31;0
WireConnection;82;3;57;0
WireConnection;82;4;58;0
ASEEND*/
//CHKSM=9779332916E9A851E71EA1C01C6579878B5AE694

View File

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

View File

@@ -0,0 +1,74 @@
// Made with Amplify Shader Editor
// Available at the Unity Asset Store - http://u3d.as/y3X
Shader "Polaris/BuiltinRP/Terrain/PBR_VertexColor"
{
Properties
{
_Color("Color", Color) = (1,1,1,1)
_Metallic("Metallic", Range( 0 , 1)) = 0
_Smoothness("Smoothness", Range( 0 , 1)) = 0
[HideInInspector] __dirty( "", Int ) = 1
}
SubShader
{
Tags{ "RenderType" = "Opaque" "Queue" = "Geometry+0" "DisableBatching" = "True" }
Cull Back
CGPROGRAM
#pragma target 3.0
#pragma surface surf Standard keepalpha addshadow fullforwardshadows noinstancing
struct Input
{
float4 vertexColor : COLOR;
};
uniform float4 _Color;
uniform float _Metallic;
uniform float _Smoothness;
void surf( Input i , inout SurfaceOutputStandard o )
{
float4 _Color5 = _Color;
float4 albedo10 = ( _Color5 * i.vertexColor );
o.Albedo = albedo10.rgb;
float _Metallic13 = _Metallic;
o.Metallic = _Metallic13;
float _Smoothness14 = _Smoothness;
o.Smoothness = _Smoothness14;
o.Alpha = 1;
}
ENDCG
}
Fallback "Diffuse"
}
/*ASEBEGIN
Version=18000
1244;197;1906;885;1264.705;627.2894;1;True;False
Node;AmplifyShaderEditor.CommentaryNode;6;-991,-650;Inherit;False;569;434;;6;5;4;12;13;14;15;Properties;1,1,1,1;0;0
Node;AmplifyShaderEditor.ColorNode;4;-941,-600;Float;False;Property;_Color;Color;0;0;Create;True;0;0;False;0;1,1,1,1;1,1,1,1;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.CommentaryNode;11;-1154.788,-185.7913;Inherit;False;731;378;;4;7;8;9;10;Albedo;1,1,1,1;0;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;5;-655,-597;Float;False;_Color;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.VertexColorNode;7;-1093.788,-9.79129;Inherit;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
Node;AmplifyShaderEditor.GetLocalVarNode;8;-1104.788,-135.7913;Inherit;False;5;_Color;1;0;OBJECT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.SimpleMultiplyOpNode;9;-857.7881,-74.79129;Inherit;False;2;2;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.RangedFloatNode;15;-970.2881,-325.7913;Float;False;Property;_Smoothness;Smoothness;2;0;Create;True;0;0;False;0;0;0;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.RangedFloatNode;12;-971.7881,-412.7913;Float;False;Property;_Metallic;Metallic;1;0;Create;True;0;0;False;0;0;0;0;1;0;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;10;-666.7881,-74.79129;Float;False;albedo;-1;True;1;0;COLOR;0,0,0,0;False;1;COLOR;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;13;-658.7881,-412.7913;Float;False;_Metallic;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.RegisterLocalVarNode;14;-657.2881,-325.7913;Float;False;_Smoothness;-1;True;1;0;FLOAT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;18;-233.7881,-211.7913;Inherit;False;14;_Smoothness;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.GetLocalVarNode;16;-207.7881,-420.7913;Inherit;False;10;albedo;1;0;OBJECT;0;False;1;COLOR;0
Node;AmplifyShaderEditor.GetLocalVarNode;17;-208.7881,-314.7913;Inherit;False;13;_Metallic;1;0;OBJECT;0;False;1;FLOAT;0
Node;AmplifyShaderEditor.StandardSurfaceOutputNode;19;69,-386;Half;False;True;-1;2;;0;0;Standard;Polaris/BuiltinRP/Terrain/PBR_VertexColor;False;False;False;False;False;False;False;False;False;False;False;False;False;True;False;False;False;True;False;False;False;Back;0;False;-1;0;False;-1;False;0;False;-1;0;False;-1;False;0;Opaque;0.5;True;True;0;False;Opaque;;Geometry;All;14;all;True;True;True;True;0;False;-1;False;0;False;-1;255;False;-1;255;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;-1;False;2;15;10;25;False;0.5;True;0;0;False;-1;0;False;-1;0;0;False;-1;0;False;-1;0;False;-1;0;False;-1;0;False;0;0,0,0,0;VertexOffset;True;False;Cylindrical;False;Relative;0;;-1;-1;-1;-1;0;False;0;0;False;-1;-1;0;False;-1;0;0;0;False;0.1;False;-1;0;False;-1;16;0;FLOAT3;0,0,0;False;1;FLOAT3;0,0,0;False;2;FLOAT3;0,0,0;False;3;FLOAT;0;False;4;FLOAT;0;False;5;FLOAT;0;False;6;FLOAT3;0,0,0;False;7;FLOAT3;0,0,0;False;8;FLOAT;0;False;9;FLOAT;0;False;10;FLOAT;0;False;13;FLOAT3;0,0,0;False;11;FLOAT3;0,0,0;False;12;FLOAT3;0,0,0;False;14;FLOAT4;0,0,0,0;False;15;FLOAT3;0,0,0;False;0
WireConnection;5;0;4;0
WireConnection;9;0;8;0
WireConnection;9;1;7;0
WireConnection;10;0;9;0
WireConnection;13;0;12;0
WireConnection;14;0;15;0
WireConnection;19;0;16;0
WireConnection;19;3;17;0
WireConnection;19;4;18;0
ASEEND*/
//CHKSM=67F1915525D47C3257AE39109D8482249F0E780F

View File

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

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b322ca1053265bc44b76fdd7a5811861
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,129 @@
#ifndef GRIFFIN_CG_INCLUDED
#define GRIFFIN_CG_INCLUDED
float2 GradientNoise_dir(float2 p)
{
p = p % 289;
float x = (34 * p.x + 1) * p.x % 289 + p.y;
x = (34 * x + 1) * x % 289;
x = frac(x / 41) * 2 - 1;
return normalize(float2(x - floor(x + 0.5), abs(x) - 0.5));
}
float GradientNoise(float2 p)
{
float2 ip = floor(p);
float2 fp = frac(p);
float d00 = dot(GradientNoise_dir(ip), fp);
float d01 = dot(GradientNoise_dir(ip + float2(0, 1)), fp - float2(0, 1));
float d10 = dot(GradientNoise_dir(ip + float2(1, 0)), fp - float2(1, 0));
float d11 = dot(GradientNoise_dir(ip + float2(1, 1)), fp - float2(1, 1));
fp = fp * fp * fp * (fp * (fp * 6 - 15) + 10);
return lerp(lerp(d00, d01, fp.y), lerp(d10, d11, fp.y), fp.x);
}
float InverseLerpUnclamped(float a, float b, float value)
{
//adding a==b check if needed
return (value - a) / (b - a + 0.0000001);
}
float RandomValue(float seed)
{
return frac(sin(dot(float2(seed, seed+1), float2(12.9898, 78.233)))*43758.5453);
}
float RandomValue(float u, float v)
{
return frac(sin(dot(float2(u, v), float2(12.9898, 78.233)))*43758.5453);
}
float2 VoronoiRandomVector (float2 UV, float offset)
{
float2x2 m = float2x2(15.27, 47.63, 99.41, 89.98);
UV = frac(sin(mul(UV, m)) * 46839.32);
return float2(sin(UV.y*+offset)*0.5+0.5, cos(UV.x*offset)*0.5+0.5);
}
float Voronoi(float2 UV, float AngleOffset, float CellDensity)
{
float2 g = floor(UV * CellDensity);
float2 f = frac(UV * CellDensity);
float t = 8.0;
float3 res = float3(8.0, 0.0, 0.0);
float noiseValue = 0;
for(int y=-1; y<=1; y++)
{
for(int x=-1; x<=1; x++)
{
float2 lattice = float2(x,y);
float2 offset = VoronoiRandomVector(lattice + g, AngleOffset);
float d = distance(lattice + offset, f);
if(d < res.x)
{
res = float3(d, offset.x, offset.y);
noiseValue = res.x;
}
}
}
return noiseValue;
}
inline float ValueNoiseInterpolate (float a, float b, float t)
{
return (1.0-t)*a + (t*b);
}
inline float ValueNoise (float2 uv)
{
float2 i = floor(uv);
float2 f = frac(uv);
f = f * f * (3.0 - 2.0 * f);
uv = abs(frac(uv) - 0.5);
float2 c0 = i + float2(0.0, 0.0);
float2 c1 = i + float2(1.0, 0.0);
float2 c2 = i + float2(0.0, 1.0);
float2 c3 = i + float2(1.0, 1.0);
float r0 = RandomValue(c0.x, c0.y);
float r1 = RandomValue(c1.x, c1.y);
float r2 = RandomValue(c2.x, c2.y);
float r3 = RandomValue(c3.x, c3.y);
float bottomOfGrid = ValueNoiseInterpolate(r0, r1, f.x);
float topOfGrid = ValueNoiseInterpolate(r2, r3, f.x);
float t = ValueNoiseInterpolate(bottomOfGrid, topOfGrid, f.y);
return t;
}
float4 MoveTowards(float4 current, float4 target, float maxDistanceDelta)
{
float4 a = target - current;
float magnitude = length(a);
if (magnitude <= maxDistanceDelta || magnitude == 0)
{
return target;
}
return current + a / magnitude * maxDistanceDelta;
}
// Encoding/decoding [0..1) floats into 8 bit/channel RG. Note that 1.0 will not be encoded properly.
inline float2 GriffinEncodeFloatRG(float v)
{
float2 kEncodeMul = float2(1.0, 255.0);
float kEncodeBit = 1.0 / 255.0;
float2 enc = kEncodeMul * v;
enc = frac(enc);
enc.x -= enc.y * kEncodeBit;
return enc;
}
inline float GriffinDecodeFloatRG(float2 enc)
{
float2 kDecodeDot = float2(1.0, 1 / 255.0);
return dot(enc, kDecodeDot);
}
#endif //GRIFFIN_CG_INCLUDED

View File

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

View File

@@ -0,0 +1,68 @@
#ifndef GRIFFIN_GRASS_COMMON_INCLUDED
#define GRIFFIN_GRASS_COMMON_INCLUDED
#include "UnityCG.cginc"
float _WaveDistance;
float4 _Wind;
fixed _BendFactor;
sampler2D _VectorField;
float4x4 _WorldToNormalized;
struct Input
{
float2 uv_MainTex;
float2 texcoord;
float4 vertexColor: COLOR;
};
float2 GradientNoise_dir(float2 p)
{
p = p % 289;
float x = (34 * p.x + 1) * p.x % 289 + p.y;
x = (34 * x + 1) * x % 289;
x = frac(x / 41) * 2 - 1;
return normalize(float2(x - floor(x + 0.5), abs(x) - 0.5));
}
float GradientNoise(float2 p)
{
float2 ip = floor(p);
float2 fp = frac(p);
float d00 = dot(GradientNoise_dir(ip), fp);
float d01 = dot(GradientNoise_dir(ip + float2(0, 1)), fp - float2(0, 1));
float d10 = dot(GradientNoise_dir(ip + float2(1, 0)), fp - float2(1, 0));
float d11 = dot(GradientNoise_dir(ip + float2(1, 1)), fp - float2(1, 1));
fp = fp * fp * fp * (fp * (fp * 6 - 15) + 10);
return lerp(lerp(d00, d01, fp.y), lerp(d10, d11, fp.y), fp.x);
}
void GrassVert(inout appdata_full i, out Input o)
{
i.normal = fixed3(0,1,0);
UNITY_INITIALIZE_OUTPUT(Input, o);
o.texcoord = i.texcoord;
fixed4 worldPos = mul(unity_ObjectToWorld, i.vertex);
fixed4 interactiveGrassOffset = 0;
#if INTERACTIVE_GRASS
fixed4 normPos = mul(_WorldToNormalized, worldPos);
fixed4 bendVector = tex2Dlod(_VectorField, fixed4(normPos.x, normPos.z, 0, 0));
bendVector = fixed4(bendVector.x*2-1, bendVector.y*2-1, bendVector.z*2-1, 0);
interactiveGrassOffset = bendVector*i.color.a*_BendFactor;
#endif
fixed2 windDir = normalize(_Wind.xy);
fixed2 sampleOrigin = fixed2(worldPos.x, worldPos.z) - windDir*_Wind.z*_Time.y;
fixed2 samplePos = sampleOrigin/_Wind.w;
fixed noiseValue = GradientNoise(samplePos);
fixed multiplier = noiseValue*i.color.a;
fixed4 windWorldOffset = multiplier*_WaveDistance*_BendFactor*float4(windDir.x, multiplier*0.5, windDir.y, 0);
fixed4 offset = mul(unity_WorldToObject, windWorldOffset) + interactiveGrassOffset;
i.vertex += offset;
i.vertex.y = max(0, i.vertex.y);
}
#endif //GRIFFIN_GRASS_COMMON_INCLUDED

View File

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

View File

@@ -0,0 +1,65 @@
#ifndef GRIFFIN_SPLAT_COMMON_INCLUDED
#define GRIFFIN_SPLAT_COMMON_INCLUDED
#include "UnityCG.cginc"
#include "Lighting.cginc"
#include "AutoLight.cginc"
struct Input
{
float2 uv_Control0;
};
void Sample4Splats(
sampler2D _Control0,
sampler2D _Splat0, sampler2D _Splat1, sampler2D _Splat2, sampler2D _Splat3,
fixed4 _Splat0_ST, fixed4 _Splat1_ST, fixed4 _Splat2_ST, fixed4 _Splat3_ST,
float2 uv, inout fixed4 control, inout fixed4 splat, inout fixed weight)
{
control = tex2D(_Control0, uv);
fixed2 uv_Splat0 = fixed2(uv.x*_Splat0_ST.x, uv.y*_Splat0_ST.y)+_Splat0_ST.zw;
fixed2 uv_Splat1 = fixed2(uv.x*_Splat1_ST.x, uv.y*_Splat1_ST.y)+_Splat1_ST.zw;
fixed2 uv_Splat2 = fixed2(uv.x*_Splat2_ST.x, uv.y*_Splat2_ST.y)+_Splat2_ST.zw;
fixed2 uv_Splat3 = fixed2(uv.x*_Splat3_ST.x, uv.y*_Splat3_ST.y)+_Splat3_ST.zw;
fixed4 splat0 = tex2D(_Splat0, uv_Splat0)*control.r;
fixed4 splat1 = tex2D(_Splat1, uv_Splat1)*control.g;
fixed4 splat2 = tex2D(_Splat2, uv_Splat2)*control.b;
fixed4 splat3 = tex2D(_Splat3, uv_Splat3)*control.a;
splat = splat0 + splat1 + splat2 + splat3;
weight = control.r + control.g + control.b + control.a;
}
void Sample4Splats4Normals(
sampler2D _Control0,
sampler2D _Splat0, sampler2D _Splat1, sampler2D _Splat2, sampler2D _Splat3,
fixed4 _Splat0_ST, fixed4 _Splat1_ST, fixed4 _Splat2_ST, fixed4 _Splat3_ST,
sampler2D _Normal0, sampler2D _Normal1, sampler2D _Normal2, sampler2D _Normal3,
float2 uv, inout fixed4 control, inout fixed4 splat, inout fixed3 normal, inout fixed weight)
{
control = tex2D(_Control0, uv);
fixed2 uv_Splat0 = fixed2(uv.x*_Splat0_ST.x, uv.y*_Splat0_ST.y)+_Splat0_ST.zw;
fixed2 uv_Splat1 = fixed2(uv.x*_Splat1_ST.x, uv.y*_Splat1_ST.y)+_Splat1_ST.zw;
fixed2 uv_Splat2 = fixed2(uv.x*_Splat2_ST.x, uv.y*_Splat2_ST.y)+_Splat2_ST.zw;
fixed2 uv_Splat3 = fixed2(uv.x*_Splat3_ST.x, uv.y*_Splat3_ST.y)+_Splat3_ST.zw;
fixed4 splat0 = tex2D(_Splat0, uv_Splat0)*control.r;
fixed4 splat1 = tex2D(_Splat1, uv_Splat1)*control.g;
fixed4 splat2 = tex2D(_Splat2, uv_Splat2)*control.b;
fixed4 splat3 = tex2D(_Splat3, uv_Splat3)*control.a;
splat = splat0 + splat1 + splat2 + splat3;
weight = control.r + control.g + control.b + control.a;
fixed4 normal0 = tex2D(_Normal0, uv_Splat0)*control.r;
fixed4 normal1 = tex2D(_Normal1, uv_Splat1)*control.g;
fixed4 normal2 = tex2D(_Normal2, uv_Splat2)*control.b;
fixed4 normal3 = tex2D(_Normal3, uv_Splat3)*control.a;
fixed3 nrm = UnpackNormal(normal0 + normal1 + normal2 + normal3);
normal = lerp(normal, nrm, weight);
}
#endif //GRIFFIN_SPLAT_COMMON_INCLUDED

View File

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

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c5084fc572b8b3e4da2e41bc10e2325f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 9bf6ac87932cb754c908fe9795a0dbec
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,59 @@
Shader "Griffin/~Internal/Billboard Creator/Atlas"
{
Properties
{
_Color ("_Color", Color) = (1,1,1,1)
_MainTex ("_Texture", 2D) = "white" {}
}
SubShader
{
Tags { "RenderType"="Opaque" "Queue"="AlphaTest+0"}
LOD 100
Pass
{
//Blend SrcAlpha OneMinusSrcAlpha
Cull Off
//ZWrite Off
//ZTest LEqual
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
};
float4 _Color;
sampler2D _MainTex;
float4 _MainTex_ST;
v2f vert (appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = TRANSFORM_TEX(v.uv, _MainTex);
return o;
}
fixed4 frag (v2f i) : SV_Target
{
// sample the texture
fixed4 col = tex2D(_MainTex, i.uv)*_Color;
clip(col.a-0.5);
return col;
}
ENDCG
}
}
}

View File

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

View File

@@ -0,0 +1,63 @@
Shader "Griffin/~Internal/Billboard Creator/Normal"
{
Properties
{
}
SubShader
{
Tags { "RenderType"="Opaque" "Queue"="AlphaTest"}
LOD 100
Pass
{
ZWrite On
ZTest LEqual
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
float3 normal : NORMAL;
};
struct v2f
{
float4 vertex : SV_POSITION;
float3 normal : NORMAL;
};
#define CAMERA_RIGHT UNITY_MATRIX_V[0].xyz
#define CAMERA_UP UNITY_MATRIX_V[1].xyz
#define CAMERA_FORWARD UNITY_MATRIX_V[2].xyz
v2f vert (appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.normal = UnityObjectToWorldNormal(v.normal);
return o;
}
fixed4 frag (v2f i) : SV_Target
{
float3 normal = normalize(i.normal);
float r = (dot(normal, CAMERA_RIGHT) + 1)*0.5f;
float g = (dot(normal, CAMERA_UP) + 1)*0.5f;
float b = (dot(normal, CAMERA_FORWARD) + 1)*0.5f;
float a = 1;
fixed4 col = float4(r,g,b,a);
#if UNITY_COLORSPACE_GAMMA
return col;
#else
return float4(GammaToLinearSpace(col.rgb), 1);
#endif
}
ENDCG
}
}
}

View File

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

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 92165c30f01a6794984527bf358bcf05
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,68 @@
Shader "Hidden/Polaris/ApplyErosion"
{
Properties
{
_HeightMap ("Height Map", 2D) = "white" {}
_SimulationData("Simulation Data", 2D) = "black"{}
_FalloffTexture("Falloff", 2D) = "black"{}
_Bounds("Bounds", Vector) = (1,1,1,1)
}
SubShader
{
Tags { "RenderType"="Opaque" }
LOD 100
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "ErosionToolCommon.cginc"
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
float4 localPos : TEXCOORD1;
};
sampler2D _HeightMap;
sampler2D _SimulationData;
sampler2D _FalloffTexture;
float4 _Bounds;
v2f vert (appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.localPos = v.vertex;
o.uv = v.uv;
return o;
}
float4 frag (v2f i) : SV_Target
{
float4 data = tex2D(_HeightMap, i.localPos);
float currentHeight = DecodeFloatRG(data.rg);
float simHeight = tex2D(_SimulationData, i.uv).r/_Bounds.y;
float f = saturate(2*length(i.uv - float2(0.5,0.5)));
float falloff = tex2D(_FalloffTexture, float2(f, 0.5)).r;
float h = lerp(currentHeight, simHeight, falloff);
data.rg = EncodeFloatRG(min(0.999999, h));
return data;
}
ENDCG
}
}
}

View File

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

View File

@@ -0,0 +1,60 @@
Shader "Hidden/Polaris/ErosionDataView"
{
Properties
{
_MainTex ("Texture", 2D) = "white" { }
_Scale ("Scale", float) = 1
_Channel ("Channel", float) = 0
}
SubShader
{
Tags { "RenderType" = "Opaque" }
LOD 100
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct appdata
{
float4 vertex: POSITION;
float2 uv: TEXCOORD0;
};
struct v2f
{
float2 uv: TEXCOORD0;
float4 vertex: SV_POSITION;
};
sampler2D _MainTex;
float _Scale;
float _Channel;
v2f vert(appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = v.uv;
return o;
}
float4 frag(v2f i): SV_Target
{
float4 data = tex2D(_MainTex, i.uv);
float value = data[_Channel] * _Scale;
float4 tint = float4(1, 0, 0, 1) * (_Channel == 0) + float4(0, 1, 0, 1) * (_Channel == 1) + float4(0, 0, 1, 1) * (_Channel == 2) + float4(1, 1, 1, 1) * (_Channel == 3);
return tint * value;
}
ENDCG
}
}
}

View File

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

View File

@@ -0,0 +1,139 @@
Shader "Hidden/Polaris/ErosionTexturer"
{
Properties { }
CGINCLUDE
#pragma vertex vert
#include "UnityCG.cginc"
struct appdata
{
float4 vertex: POSITION;
float2 uv: TEXCOORD0;
};
struct v2f
{
float2 uv: TEXCOORD0;
float4 vertex: SV_POSITION;
float4 localPos: TEXCOORD1;
};
sampler2D _MainTex;
sampler2D _ErosionMap;
sampler2D _FalloffTexture;
float4 _ErosionAlbedo;
float _ErosionMetallic;
float _ErosionSmoothness;
float _ErosionChannelIndex;
float _ErosionIntensity;
float _ErosionExponent;
float4 _DepositionAlbedo;
float _DepositionMetallic;
float _DepositionSmoothness;
float _DepositionChannelIndex;
float _DepositionIntensity;
float _DepositionExponent;
v2f vert(appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = v.uv;
o.localPos = v.vertex;
return o;
}
ENDCG
SubShader
{
Tags { "RenderType" = "Opaque" }
LOD 100
Pass
{
Name "Splat"
CGPROGRAM
#pragma fragment fragSplat
float4 fragSplat(v2f i): SV_Target
{
float f = saturate(2 * length(i.uv - float2(0.5, 0.5)));
float falloff = tex2D(_FalloffTexture, float2(f, 0.5)).r;
float4 currentColor = tex2D(_MainTex, i.localPos);
float2 erosionData = tex2D(_ErosionMap, i.uv);
float erosionStrength = saturate(pow(erosionData.r * _ErosionIntensity * falloff, _ErosionExponent));
float4 erosionChannel = float4(_ErosionChannelIndex == 0, _ErosionChannelIndex == 1, _ErosionChannelIndex == 2, _ErosionChannelIndex == 3);
currentColor = lerp(currentColor, erosionChannel, erosionStrength);
float depositionStrength = saturate(pow(erosionData.g * _DepositionIntensity * falloff, _DepositionExponent));
float4 depositionChannel = float4(_DepositionChannelIndex == 0, _DepositionChannelIndex == 1, _DepositionChannelIndex == 2, _DepositionChannelIndex == 3);
currentColor = lerp(currentColor, depositionChannel, depositionStrength);
return currentColor;
}
ENDCG
}
Pass
{
Name "Albedo"
CGPROGRAM
#pragma fragment fragAlbedo
float4 fragAlbedo(v2f i): SV_Target
{
float f = saturate(2 * length(i.uv - float2(0.5, 0.5)));
float falloff = tex2D(_FalloffTexture, float2(f, 0.5)).r;
float4 currentColor = tex2D(_MainTex, i.localPos);
float2 erosionData = tex2D(_ErosionMap, i.uv);
float erosionStrength = saturate(pow(erosionData.r * _ErosionIntensity * falloff, _ErosionExponent));
currentColor = lerp(currentColor, _ErosionAlbedo, erosionStrength);
float depositionStrength = saturate(pow(erosionData.g * _DepositionIntensity * falloff, _DepositionExponent));
currentColor = lerp(currentColor, _DepositionAlbedo, depositionStrength);
return currentColor;
}
ENDCG
}
Pass
{
Name "Metallic Smoothness"
CGPROGRAM
#pragma fragment fragMetallicSmoothness
float4 fragMetallicSmoothness(v2f i): SV_Target
{
float f = saturate(2 * length(i.uv - float2(0.5, 0.5)));
float falloff = tex2D(_FalloffTexture, float2(f, 0.5)).r;
float4 currentColor = tex2D(_MainTex, i.localPos);
float2 erosionData = tex2D(_ErosionMap, i.uv);
float erosionStrength = saturate(pow(erosionData.r * _ErosionIntensity * falloff, _ErosionExponent));
float4 targetMS = float4(_ErosionMetallic, currentColor.g, currentColor.b, _ErosionSmoothness);
currentColor = lerp(currentColor, targetMS, erosionStrength);
float depositionStrength = saturate(pow(erosionData.g * _DepositionIntensity * falloff, _DepositionExponent));
targetMS = float4(_DepositionMetallic, currentColor.g, currentColor.b, _DepositionSmoothness);
currentColor = lerp(currentColor, targetMS, depositionStrength);
return currentColor;
}
ENDCG
}
}
}

View File

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

View File

@@ -0,0 +1,99 @@
#ifndef EROSION_COMMON_INCLUDED
#define EROSION_COMMON_INCLUDED
#define M2CM 100
#define CM2M 0.01
#define DT 1.0/30.0
#define G 9.8
#define FLOW_CONST 0.5
#define LEFT 0
#define TOP 1
#define RIGHT 2
#define BOTTOM 3
#define LEFT_TOP 0
#define TOP_RIGHT 1
#define RIGHT_BOTTOM 2
#define BOTTOM_LEFT 3
int To1DIndex(int x, int z, int width)
{
return z * width + x;
}
float4 SampleTextureBilinear(Texture2D<float4> buffer, float width, float height, float2 uv)
{
float4 value = 0;
float2 pixelCoord = float2(lerp(0, width - 1, uv.x), lerp(0, height - 1, uv.y));
//apply a bilinear filter
int xFloor = floor(pixelCoord.x);
int xCeil = ceil(pixelCoord.x);
int yFloor = floor(pixelCoord.y);
int yCeil = ceil(pixelCoord.y);
float4 f00 = buffer[uint2(xFloor, yFloor)];
float4 f01 = buffer[uint2(xFloor, yCeil)];
float4 f10 = buffer[uint2(xCeil, yFloor)];
float4 f11 = buffer[uint2(xCeil, yCeil)];
float2 unitCoord = float2(pixelCoord.x - xFloor, pixelCoord.y - yFloor);
value = f00 * (1 - unitCoord.x) * (1 - unitCoord.y) + f01 * (1 - unitCoord.x) * unitCoord.y + f10 * unitCoord.x * (1 - unitCoord.y) + f11 * unitCoord.x * unitCoord.y;
return value;
}
float4 SampleTextureBilinear(RWTexture2D<float4> buffer, float width, float height, float2 pixelCoord)
{
float4 value = 0;
pixelCoord.x = clamp(pixelCoord.x, 0, width - 1);
pixelCoord.y = clamp(pixelCoord.y, 0, height - 1);
//apply a bilinear filter
int xFloor = floor(pixelCoord.x);
int xCeil = ceil(pixelCoord.x);
int yFloor = floor(pixelCoord.y);
int yCeil = ceil(pixelCoord.y);
float4 f00 = buffer[uint2(xFloor, yFloor)];
float4 f01 = buffer[uint2(xFloor, yCeil)];
float4 f10 = buffer[uint2(xCeil, yFloor)];
float4 f11 = buffer[uint2(xCeil, yCeil)];
float2 unitCoord = float2(pixelCoord.x - xFloor, pixelCoord.y - yFloor);
value = f00 * (1 - unitCoord.x) * (1 - unitCoord.y) + f01 * (1 - unitCoord.x) * unitCoord.y + f10 * unitCoord.x * (1 - unitCoord.y) + f11 * unitCoord.x * unitCoord.y;
return value;
}
float DecodeFloatRG(float2 enc)
{
float2 kDecodeDot = float2(1.0, 1 / 255.0);
return dot(enc, kDecodeDot);
}
float2 EncodeFloatRG(float v)
{
float2 kEncodeMul = float2(1.0, 255.0);
float kEncodeBit = 1.0 / 255.0;
float2 enc = kEncodeMul * v;
enc = frac(enc);
enc.x -= enc.y * kEncodeBit;
return enc;
}
float RandomValue (float2 uv)
{
return frac(sin(dot(uv, float2(12.9898, 78.233)))*43758.5453);
}
float InverseLerpUnclamped(float a, float b, float value)
{
//adding a==b check if needed
return (value - a) / (b - a + 0.0000001);
}
#endif //GRIFFIN_GRASS_COMMON_INCLUDED

View File

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

View File

@@ -0,0 +1,97 @@
Shader "Hidden/Polaris/FetchWorldData"
{
Properties
{
_MainTex ("Texture", 2D) = "white" { }
_Bounds ("Bounds", Vector) = (1, 1, 1, 1)
_EnableTerrainMask ("Enable Terrain Mask", Float) = 0
}
CGINCLUDE
#include "ErosionToolCommon.cginc"
struct appdata
{
float4 vertex: POSITION;
float2 uv: TEXCOORD0;
};
struct v2f
{
float2 uv: TEXCOORD0;
float4 vertex: SV_POSITION;
};
sampler2D _MainTex;
float4 _Bounds;
float _EnableTerrainMask;
v2f vert(appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = v.uv;
return o;
}
ENDCG
SubShader
{
Tags { "RenderType" = "Opaque" }
LOD 100
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
float4 frag(v2f i): SV_Target
{
float2 enc = tex2D(_MainTex, i.uv).rg;
float h = DecodeFloatRG(enc) * _Bounds.y;
float4 color = float4(h, 0, h, 0);
return color;
}
ENDCG
}
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
float4 frag(v2f i): SV_Target
{
float4 mask = tex2D(_MainTex, i.uv);
float4 color = float4(mask.b, 1, 0, 1 - mask.r * _EnableTerrainMask); //water source, rain, unused, erosion strength
return color;
}
ENDCG
}
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
float4 frag(v2f i): SV_Target
{
return float4(0, 0, 0, 0);
}
ENDCG
}
}
}

View File

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

View File

@@ -0,0 +1,291 @@
#pragma kernel Simulate
#include "ErosionToolCommon.cginc"
float3 _Bounds;
RWTexture2D<float4> _SimulationData; //r: current height, g: suspended sediment, b: last height, a: water level
RWTexture2D<float4> _OutflowVHData;
RWTexture2D<float4> _OutflowDiagData;
RWTexture2D<float2> _VelocityData;
RWTexture2D<float2> _ErosionMap;
//RWTexture2D<float4> _VisualizeData;
float _WaterSourceAmount;
float _RainRate;
float _FlowRate;
float _ErosionRate;
float _DepositionRate;
float _EvaporationRate;
Texture2D<float4> _MaskMap; //r: water source, g: rain, b: unused, a: erosion intensity
float2 _MaskMapResolution;
float2 _RandomSeed;
float3 CalculateNormal(inout float4 srcData, inout uint3 id)
{
float3 centerPos = float3(id.x, 0, id.z);
centerPos.y = srcData.r;
float3 leftPos = float3(id.x - 1, 0, id.z);
float3 topPos = float3(id.x, 0, id.z + 1);
float3 rightPos = float3(id.x + 1, 0, id.z);
float3 bottomPos = float3(id.x, 0, id.z - 1);
float3 leftTopPos = float3(id.x - 1, 0, id.z + 1);
float3 topRightPos = float3(id.x + 1, 0, id.z + 1);
float3 rightBottomPos = float3(id.x + 1, 0, id.z - 1);
float3 bottomLeftPos = float3(id.x - 1, 0, id.z - 1);
leftPos.y = _SimulationData[leftPos.xz].r;
topPos.y = _SimulationData[topPos.xz].r;
rightPos.y = _SimulationData[rightPos.xz].r;
bottomPos.y = _SimulationData[bottomPos.xz].r;
leftTopPos.y = _SimulationData[leftTopPos.xz].r;
topRightPos.y = _SimulationData[topRightPos.xz].r;
rightBottomPos.y = _SimulationData[rightBottomPos.xz].r;
bottomLeftPos.y = _SimulationData[bottomLeftPos.xz].r;
float3 n0 = cross(leftPos - centerPos, leftTopPos - centerPos);
float3 n1 = cross(topPos - centerPos, topRightPos - centerPos);
float3 n2 = cross(rightPos - centerPos, rightBottomPos - centerPos);
float3 n3 = cross(bottomPos - centerPos, bottomLeftPos - centerPos);
float3 n4 = cross(leftTopPos - centerPos, topPos - centerPos);
float3 n5 = cross(topRightPos - centerPos, rightPos - centerPos);
float3 n6 = cross(rightBottomPos - centerPos, bottomPos - centerPos);
float3 n7 = cross(bottomLeftPos - centerPos, leftPos - centerPos);
float3 nc = (n0 + n1 + n2 + n3 + n4 + n5 + n6 + n7) / 8;
float3 normal = normalize(nc);
return normal;
}
void AddWaterSource(inout float4 srcData, float waterSourceMask)
{
float water = _WaterSourceAmount * waterSourceMask * DT;
srcData.a += water;
}
void Rain(inout float4 srcData, float2 uv, float rainMask)
{
float rand = RandomValue(uv + _RandomSeed);
float rainValue = rand < (_RainRate * rainMask);
srcData.a += rainValue * DT;
}
void Outflow(inout float4 srcData, inout uint3 id)
{
float srcHeight = srcData.r + srcData.a;
float F_CONST = DT * G * FLOW_CONST * _FlowRate;
float3 leftPos = float3(id.x - 1, 0, id.z);
float4 leftData = _SimulationData[leftPos.xz];
float deltaHeightL = srcHeight - leftData.r - leftData.a;
float fL = max(0, F_CONST * deltaHeightL) * (leftPos.x >= 0);
float3 topPos = float3(id.x, 0, id.z + 1);
float4 topData = _SimulationData[topPos.xz];
float deltaHeightT = srcHeight - topData.r - topData.a;
float fT = max(0, F_CONST * deltaHeightT) * (topPos.y < _Bounds.z);
float3 rightPos = float3(id.x + 1, 0, id.z);
float4 rightData = _SimulationData[rightPos.xz];
float deltaHeightR = srcHeight - rightData.r - rightData.a;
float fR = max(0, F_CONST * deltaHeightR) * (rightPos.x < _Bounds.x);
float3 bottomPos = float3(id.x, 0, id.z - 1);
float4 bottomData = _SimulationData[bottomPos.xz];
float deltaHeightB = srcHeight - bottomData.r - bottomData.a;
float fB = max(0, F_CONST * deltaHeightB) * (bottomPos.y >= 0);
float3 leftTopPos = float3(id.x - 1, 0, id.z + 1);
float4 leftTopData = _SimulationData[leftTopPos.xz];
float deltaHeightLT = srcHeight - leftTopData.r - leftTopData.a;
float fLT = max(0, F_CONST * deltaHeightLT) * (leftTopPos.x >= 0) * (leftTopPos.y < _Bounds.z);
float3 topRightPos = float3(id.x + 1, 0, id.z + 1);
float4 topRightData = _SimulationData[topRightPos.xz];
float deltaHeightTR = srcHeight - topRightData.r - topRightData.a;
float fTR = max(0, F_CONST * deltaHeightTR) * (topRightPos.x < _Bounds.x) * (topRightPos.y < _Bounds.z);
float3 rightBottomPos = float3(id.x + 1, 0, id.z - 1);
float4 rightBottomData = _SimulationData[rightBottomPos.xz];
float deltaHeightRB = srcHeight - rightBottomData.r - rightBottomData.a;
float fRB = max(0, F_CONST * deltaHeightRB) * (rightBottomPos.x < _Bounds.x) * (rightBottomPos.y >= 0);
float3 bottomLeftPos = float3(id.x - 1, 0, id.z - 1);
float4 bottomLeftData = _SimulationData[bottomLeftPos.xz];
float deltaHeightBL = srcHeight - bottomLeftData.r - bottomLeftData.a;
float fBL = max(0, F_CONST * deltaHeightBL) * (bottomLeftPos.x >= 0) * (bottomLeftPos.y >= 0);
float fSum = fL + fT + fR + fB + fLT + fTR + fRB + fBL;
float fScale = min(1, srcData.a / (fSum + 0.0001));
float4 fVH = float4(fL, fT, fR, fB) * fScale;
_OutflowVHData[id.xz] = fVH;
float4 fDiag = float4(fLT, fTR, fRB, fBL) * fScale;
_OutflowDiagData[id.xz] = fDiag;
srcData.a -= fSum * fScale;
}
void Inflow(inout float4 srcData, inout uint3 id)
{
float3 leftPos = float3(id.x - 1, 0, id.z);
float4 leftData = _OutflowVHData[leftPos.xz];
float fL = leftData[RIGHT];
float3 topPos = float3(id.x, 0, id.z + 1);
float4 topData = _OutflowVHData[topPos.xz];
float fT = topData[BOTTOM];
float3 rightPos = float3(id.x + 1, 0, id.z);
float4 rightData = _OutflowVHData[rightPos.xz];
float fR = rightData[LEFT];
float3 bottomPos = float3(id.x, 0, id.z - 1);
float4 bottomData = _OutflowVHData[bottomPos.xz];
float fB = bottomData[TOP];
float3 leftTopPos = float3(id.x - 1, 0, id.z + 1);
float4 leftTopData = _OutflowDiagData[leftTopPos.xz];
float fLT = leftTopData[RIGHT_BOTTOM];
float3 topRightPos = float3(id.x + 1, 0, id.z + 1);
float4 topRightData = _OutflowDiagData[topRightPos.xz];
float fTR = topRightData[BOTTOM_LEFT];
float3 rightBottomPos = float3(id.x + 1, 0, id.z - 1);
float4 rightBottomData = _OutflowDiagData[rightBottomPos.xz];
float fRB = rightBottomData[LEFT_TOP];
float3 bottomLeftPos = float3(id.x - 1, 0, id.z - 1);
float4 bottomLeftData = _OutflowDiagData[bottomLeftPos.xz];
float fBL = bottomLeftData[TOP_RIGHT];
float fSum = fL + fT + fR + fB + fLT + fTR + fRB + fBL;
srcData.a += fSum;
}
void UpdateVelocity(inout uint3 id)
{
float3 leftPos = float3(id.x - 1, 0, id.z);
float3 topPos = float3(id.x, 0, id.z + 1);
float3 rightPos = float3(id.x + 1, 0, id.z);
float3 bottomPos = float3(id.x, 0, id.z - 1);
float4 leftOutflow = _OutflowVHData[leftPos.xz];
float4 topOutflow = _OutflowVHData[topPos.xz];
float4 rightOutflow = _OutflowVHData[rightPos.xz];
float4 bottomOutflow = _OutflowVHData[bottomPos.xz];
float3 leftTopPos = float3(id.x - 1, 0, id.z + 1);
float3 topRightPos = float3(id.x + 1, 0, id.z + 1);
float3 rightBottomPos = float3(id.x + 1, 0, id.z - 1);
float3 bottomLeftPos = float3(id.x - 1, 0, id.z - 1);
float4 leftTopOutflow = _OutflowDiagData[leftTopPos.xz];
float4 topRightOutflow = _OutflowDiagData[topRightPos.xz];
float4 rightBottomOutflow = _OutflowDiagData[rightBottomPos.xz];
float4 bottomLeftOutflow = _OutflowDiagData[bottomLeftPos.xz];
float4 srcVHOutflow = _OutflowVHData[id.xz];
float4 srcDiagOutflow = _OutflowDiagData[id.xz];
float vX0 = leftTopOutflow[RIGHT_BOTTOM] + leftOutflow[RIGHT] + bottomLeftOutflow[TOP_RIGHT];
float vX1 = srcDiagOutflow[TOP_RIGHT] + srcVHOutflow[RIGHT] + srcDiagOutflow[RIGHT_BOTTOM];
float vX2 = srcDiagOutflow[LEFT_TOP] + srcVHOutflow[LEFT] + srcDiagOutflow[BOTTOM_LEFT];
float vX3 = topRightOutflow[BOTTOM_LEFT] + rightOutflow[LEFT] + rightBottomOutflow[LEFT_TOP];
float vX = vX0 + vX1 - vX2 - vX3;
float vY0 = bottomLeftOutflow[TOP_RIGHT] + bottomOutflow[TOP] + rightBottomOutflow[LEFT_TOP];
float vY1 = srcDiagOutflow[LEFT_TOP] + srcVHOutflow[TOP] + srcDiagOutflow[TOP_RIGHT];
float vY2 = srcDiagOutflow[BOTTOM_LEFT] + srcVHOutflow[BOTTOM] + srcDiagOutflow[RIGHT_BOTTOM];
float vY3 = leftTopOutflow[RIGHT_BOTTOM] + topOutflow[BOTTOM] + topRightOutflow[BOTTOM_LEFT];
float vY = vY0 + vY1 - vY2 - vY3;
float2 v = float2(vX, vY);
_VelocityData[id.xz] = v;
}
void ErosionAndDeposition(inout float4 srcData, inout uint3 id, float erosionMask)
{
float2 velocity = _VelocityData[id.xz];
float3 surfaceNormal = CalculateNormal(srcData, id);
float2 nextPixel = float2(id.x + velocity.x, id.z + velocity.y);
float nextHeight = SampleTextureBilinear(_SimulationData, _Bounds.x, _Bounds.z, nextPixel).b;
float deltaHeight = max(0, srcData.r - nextHeight);
//float erosionFactor = pow(abs(1 - surfaceNormal.y), 1.0 / 10.0);
//erosionFactor = 1;
float erosionFactor = 1;
float erodedAmount = _ErosionRate * erosionMask * saturate(erosionFactor * length(velocity)) * DT;
erodedAmount = clamp(erodedAmount, 0, deltaHeight);
erodedAmount = clamp(erodedAmount, 0, srcData.r);
srcData.r -= erodedAmount;
srcData.g += erodedAmount;
float depositFactor = surfaceNormal.y;
float depositAmount = _DepositionRate * depositFactor * DT;
depositAmount = clamp(depositAmount, 0, srcData.g);
srcData.r += depositAmount;
srcData.g -= depositAmount;
float2 erosionMapData = _ErosionMap[id.xz];
erosionMapData.r = max(0, erosionMapData.r + erodedAmount);
erosionMapData.g = max(0, erosionMapData.g + depositAmount - erodedAmount);
_ErosionMap[id.xz] = erosionMapData;
}
void SedimentTransportation(inout float4 srcData, inout uint3 id)
{
float2 velocity = _VelocityData[id.xz];
float2 pixelCoord = float2(id.x - velocity.x, id.z - velocity.y);
float sediment = SampleTextureBilinear(_SimulationData, _Bounds.x, _Bounds.z, pixelCoord).g;
srcData.g = sediment;
}
void Evaporate(inout float4 srcData)
{
srcData.a = max(0, srcData.a - _EvaporationRate * DT);
}
void UpdateSimData(inout float4 srcData, inout uint3 id)
{
srcData.b = srcData.r;
_SimulationData[id.xz] = srcData;
}
[numthreads(8, 1, 8)]
void Simulate(uint3 id: SV_DISPATCHTHREADID)
{
float2 uv = id.xz / _Bounds.xz;
float4 mask = SampleTextureBilinear(_MaskMap, _MaskMapResolution.x, _MaskMapResolution.y, uv);
float4 srcData = _SimulationData[id.xz];
AddWaterSource(srcData, mask.r);
Rain(srcData, uv, mask.g);
UpdateSimData(srcData, id);
GroupMemoryBarrierWithGroupSync(); //Outflow read water data
Outflow(srcData, id);
GroupMemoryBarrierWithGroupSync(); //Inflow read outflow data
Inflow(srcData, id);
UpdateVelocity(id);
GroupMemoryBarrierWithGroupSync(); //Erosion read velocity data
ErosionAndDeposition(srcData, id, mask.a);
UpdateSimData(srcData, id);
GroupMemoryBarrierWithGroupSync(); //Sediment transport read source data
SedimentTransportation(srcData, id);
Evaporate(srcData);
UpdateSimData(srcData, id);
}

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 5a8f6fd8bb447824185ed7786e38a535
ComputeShaderImporter:
externalObjects: {}
currentAPIMask: 4
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,20 @@
#pragma kernel Init
#include "ErosionToolCommon.cginc"
Texture2D<float4> _HeightMap;
int _HeightMapResolution;
float3 _TerrainSize;
RWTexture2D<float4> _SimulationData; //r: current height, g: suspended sediment, b: last height, a: water level
[numthreads(8, 1, 8)]
void Init(uint3 id: SV_DISPATCHTHREADID)
{
float2 uv = id.xz / _TerrainSize.xz;
float2 encHeight = SampleTextureBilinear(_HeightMap, _HeightMapResolution, _HeightMapResolution, uv).rg;
float h = DecodeFloatRG(encHeight) * _TerrainSize.y;
float4 data = float4(h, 0, h, 0);
_SimulationData[id.xz] = data;
}

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 36498da77a2c00540b0cf4547b5400a3
ComputeShaderImporter:
externalObjects: {}
currentAPIMask: 4
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,191 @@
#pragma kernel Simulate
#include "ErosionToolCommon.cginc"
RWTexture2D<float4> _SimulationData;
RWTexture2D<float4> _SoilVHData;
RWTexture2D<float4> _SoilDiagData;
RWTexture2D<float2> _ErosionMap;
float3 _Bounds;
float _ErosionRate;
float _RestingAngle;
Texture2D<float4> _MaskMap;
float2 _MaskMapResolution;
void Outflow(inout float4 srcData, inout uint3 id, float erosionMask)
{
float F_CONST = DT * G * _ErosionRate * 0.5;
float3 centerPos = float3(id.x, srcData.r, id.z);
float3 downVector = float3(0, -1, 0);
float3 direction;
float angleFactor;
float minFactor = sin(radians(_RestingAngle));
float maxDh = -10000;
float3 leftPos = float3(id.x - 1, 0, id.z);
float4 leftData = _SimulationData[leftPos.xz];
leftPos.y = leftData.r;
direction = normalize(leftPos - centerPos);
angleFactor = saturate(dot(direction, downVector));
angleFactor = saturate(InverseLerpUnclamped(minFactor, 1, angleFactor));
float deltaHeightL = srcData.r - leftData.r;
maxDh = max(maxDh, deltaHeightL);
float fL = max(0, F_CONST * angleFactor * deltaHeightL) * (leftPos.x >= 0);
float3 topPos = float3(id.x, 0, id.z + 1);
float4 topData = _SimulationData[topPos.xz];
topPos.y = topData.r;
direction = normalize(topPos - centerPos);
angleFactor = saturate(dot(direction, downVector));
angleFactor = saturate(InverseLerpUnclamped(minFactor, 1, angleFactor));
float deltaHeightT = srcData.r - topData.r;
maxDh = max(maxDh, deltaHeightT);
float fT = max(0, F_CONST * angleFactor * deltaHeightT) * (topPos.y < _Bounds.z);
float3 rightPos = float3(id.x + 1, 0, id.z);
float4 rightData = _SimulationData[rightPos.xz];
rightPos.y = rightData.r;
direction = normalize(rightPos - centerPos);
angleFactor = saturate(dot(direction, downVector));
angleFactor = saturate(InverseLerpUnclamped(minFactor, 1, angleFactor));
float deltaHeightR = srcData.r - rightData.r;
maxDh = max(maxDh, deltaHeightR);
float fR = max(0, F_CONST * angleFactor * deltaHeightR) * (rightPos.x < _Bounds.x);
float3 bottomPos = float3(id.x, 0, id.z - 1);
float4 bottomData = _SimulationData[bottomPos.xz];
bottomPos.y = bottomData.r;
direction = normalize(bottomPos - centerPos);
angleFactor = saturate(dot(direction, downVector));
angleFactor = saturate(InverseLerpUnclamped(minFactor, 1, angleFactor));
float deltaHeightB = srcData.r - bottomData.r;
maxDh = max(maxDh, deltaHeightB);
float fB = max(0, F_CONST * angleFactor * deltaHeightB) * (bottomPos.y >= 0);
//---
float3 leftTopPos = float3(id.x - 1, 0, id.z + 1);
float4 leftTopData = _SimulationData[leftTopPos.xz];
leftTopPos.y = leftTopData.r;
direction = normalize(leftTopPos - centerPos);
angleFactor = saturate(dot(direction, downVector));
angleFactor = saturate(InverseLerpUnclamped(minFactor, 1, angleFactor));
float deltaHeightLT = srcData.r - leftTopData.r;
maxDh = max(maxDh, deltaHeightLT);
float fLT = max(0, F_CONST * angleFactor * deltaHeightLT) * (leftTopPos.x >= 0) * (leftTopPos.y < _Bounds.z);
float3 topRightPos = float3(id.x + 1, 0, id.z + 1);
float4 topRightData = _SimulationData[topRightPos.xz];
topRightPos.y = topRightData.r;
direction = normalize(topRightPos - centerPos);
angleFactor = saturate(dot(direction, downVector));
angleFactor = saturate(InverseLerpUnclamped(minFactor, 1, angleFactor));
float deltaHeightTR = srcData.r - topRightData.r;
maxDh = max(maxDh, deltaHeightTR);
float fTR = max(0, F_CONST * angleFactor * deltaHeightTR) * (topRightPos.x < _Bounds.x) * (topRightPos.y < _Bounds.z);
float3 rightBottomPos = float3(id.x + 1, 0, id.z - 1);
float4 rightBottomData = _SimulationData[rightBottomPos.xz];
rightBottomPos.y = rightBottomData.r;
direction = normalize(rightBottomPos - centerPos);
angleFactor = saturate(dot(direction, downVector));
angleFactor = saturate(InverseLerpUnclamped(minFactor, 1, angleFactor));
float deltaHeightRB = srcData.r - rightBottomData.r;
maxDh = max(maxDh, deltaHeightRB);
float fRB = max(0, F_CONST * angleFactor * deltaHeightRB) * (rightBottomPos.x < _Bounds.x) * (rightBottomPos.y >= 0);
float3 bottomLeftPos = float3(id.x - 1, 0, id.z - 1);
float4 bottomLeftData = _SimulationData[bottomLeftPos.xz];
bottomLeftPos.y = bottomLeftData.r;
direction = normalize(bottomLeftPos - centerPos);
angleFactor = saturate(dot(direction, downVector));
angleFactor = saturate(InverseLerpUnclamped(minFactor, 1, angleFactor));
float deltaHeightBL = srcData.r - bottomLeftData.r;
maxDh = max(maxDh, deltaHeightBL);
float fBL = max(0, F_CONST * angleFactor * deltaHeightBL) * (bottomLeftPos.x >= 0) * (bottomLeftPos.y >= 0);
float fSum = fL + fT + fR + fB + fLT + fTR + fRB + fBL;
float fScale = erosionMask * min(1, maxDh / (fSum + 0.0001));
float4 fVH = float4(fL, fT, fR, fB) * fScale;
_SoilVHData[id.xz] = fVH;
float4 fDiag = float4(fLT, fTR, fRB, fBL) * fScale;
_SoilDiagData[id.xz] = fDiag;
srcData.r = max(0, srcData.r - fSum * fScale);
float2 erosionMapData = _ErosionMap[id.xz];
erosionMapData.r += fSum * fScale;
//erosionMapData.g -= fSum * fScale;
_ErosionMap[id.xz] = erosionMapData;
}
void Inflow(inout float4 srcData, inout uint3 id)
{
float3 leftPos = float3(id.x - 1, 0, id.z);
float4 leftData = _SoilVHData[leftPos.xz];
float fL = leftData[RIGHT];
float3 topPos = float3(id.x, 0, id.z + 1);
float4 topData = _SoilVHData[topPos.xz];
float fT = topData[BOTTOM];
float3 rightPos = float3(id.x + 1, 0, id.z);
float4 rightData = _SoilVHData[rightPos.xz];
float fR = rightData[LEFT];
float3 bottomPos = float3(id.x, 0, id.z - 1);
float4 bottomData = _SoilVHData[bottomPos.xz];
float fB = bottomData[TOP];
float3 leftTopPos = float3(id.x - 1, 0, id.z + 1);
float4 leftTopData = _SoilDiagData[leftTopPos.xz];
float fLT = leftTopData[RIGHT_BOTTOM];
float3 topRightPos = float3(id.x + 1, 0, id.z + 1);
float4 topRightData = _SoilDiagData[topRightPos.xz];
float fTR = topRightData[BOTTOM_LEFT];
float3 rightBottomPos = float3(id.x + 1, 0, id.z - 1);
float4 rightBottomData = _SoilDiagData[rightBottomPos.xz];
float fRB = rightBottomData[LEFT_TOP];
float3 bottomLeftPos = float3(id.x - 1, 0, id.z - 1);
float4 bottomLeftData = _SoilDiagData[bottomLeftPos.xz];
float fBL = bottomLeftData[TOP_RIGHT];
float fSum = fL + fT + fR + fB + fLT + fTR + fRB + fBL;
srcData.r += fSum;
float2 erosionMapData = _ErosionMap[id.xz];
erosionMapData.r -= fSum;
erosionMapData.g += fSum;
erosionMapData.r = max(0, erosionMapData.r);
erosionMapData.g = max(0, erosionMapData.g);
_ErosionMap[id.xz] = erosionMapData;
}
void UpdateSimData(inout float4 srcData, inout uint3 id)
{
//srcData.b = srcData.r;
_SimulationData[id.xz] = srcData;
}
[numthreads(8, 1, 8)]
void Simulate(uint3 id: SV_DISPATCHTHREADID)
{
float2 uv = id.xz / _Bounds.xz;
float4 mask = SampleTextureBilinear(_MaskMap, _MaskMapResolution.x, _MaskMapResolution.y, uv);
float4 srcData = _SimulationData[id.xz];
Outflow(srcData, id, mask.a);
UpdateSimData(srcData, id);
GroupMemoryBarrierWithGroupSync();
Inflow(srcData, id);
UpdateSimData(srcData, id);
}

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 26b74d9d4e2359445b3f198ab5431a8b
ComputeShaderImporter:
externalObjects: {}
currentAPIMask: 4
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 67678e22d4ef9234bb3e6c9cc189fa97
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,150 @@
Shader "Hidden/Griffin/ErosionGeometryLivePreview"
{
Properties
{
_Transparency ("Transparency", Range(0, 1)) = 0.5
_FadeDistance ("Fade Distance", Float) = 0.5
_SimulationData ("Sim Data", 2D) = "black" { }
_FalloffTexture ("Falloff Texture", 2D) = "black" { }
_HeightMap ("Height Map", 2D) = "black" { }
_Height ("Height", Float) = 1
_ErosionMap ("Erosion Map", 2D) = "black" { }
_ErosionSplat ("Erosion Splat", 2D) = "black" { }
_DepositionSplat ("Deposition Splat", 2D) = "black" { }
}
SubShader
{
Tags { "Queue" = "Transparent" "RenderType" = "Transparent" }
Blend SrcAlpha OneMinusSrcAlpha
ZTest Off
Offset -1, -1
LOD 100
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma multi_compile_fog
#pragma shader_feature_local SHOW_TEXTURE
#pragma shader_feature_local SHOW_COLOR
#include "UnityCG.cginc"
#include "LivePreviewCommon.cginc"
struct appdata
{
float4 vertex: POSITION;
float2 uv: TEXCOORD0;
};
struct v2f
{
float2 uv: TEXCOORD0;
UNITY_FOG_COORDS(1)
float4 vertex: SV_POSITION;
float4 worldPos: TEXCOORD2;
float4 vertexColor: TEXCOORD3;
};
float _Transparency;
float _FadeDistance;
float4x4 _WorldToSim;
float4x4 _WorldToTerrainUV;
sampler2D _SimulationData;
sampler2D _FalloffTexture;
sampler2D _HeightMap;
float _Height;
sampler2D _ErosionMap;
sampler2D _ErosionSplat;
float4 _ErosionSplat_ST;
float _ErosionIntensity;
float4 _ErosionAlbedo;
sampler2D _DepositionSplat;
float4 _DepositionSplat_ST;
float _DepositionIntensity;
float4 _DepositionAlbedo;
v2f vert(appdata v)
{
v2f o;
float4 worldPos = mul(unity_ObjectToWorld, v.vertex);
float4 simPos = mul(_WorldToSim, float4(worldPos.xyz, 1));
float2 terrainUV = mul(_WorldToTerrainUV, float4(worldPos.xyz, 1)).xz;
float oldHeight = GriffinDecodeFloatRG(tex2Dlod(_HeightMap, float4(terrainUV, 0, 0)).rg) * _Height;
float2 simUv = simPos.xz + float2(0.5, 0.5);
float newHeight = tex2Dlod(_SimulationData, float4(simUv, 0, 0));
float f = saturate(2 * length(simUv - float2(0.5, 0.5)));
float falloff = tex2Dlod(_FalloffTexture, float4(f, 0.5, 0, 0)).r;
newHeight = lerp(oldHeight, newHeight, falloff);
v.vertex.y = newHeight;
o.uv = simUv;
o.vertex = UnityObjectToClipPos(v.vertex);
o.worldPos = mul(unity_ObjectToWorld, v.vertex);
o.vertexColor = float4(
1, 1, 1,
clamp(abs(newHeight - oldHeight) / _FadeDistance, 0, 1)
);
UNITY_TRANSFER_FOG(o, o.vertex);
return o;
}
fixed4 frag(v2f i): SV_Target
{
int isInside = (i.uv.x >= 0) * (i.uv.x <= 1) * (i.uv.y >= 0) * (i.uv.y <= 1);
if (isInside == 0)
{
discard;
}
float4 color = 0;
#if SHOW_TEXTURE || SHOW_COLOR
float4 simPos = mul(_WorldToSim, float4(i.worldPos.xyz, 1));
float2 simUv = simPos.xz + float2(0.5, 0.5);
float2 terrainUV = mul(_WorldToTerrainUV, float4(i.worldPos.xyz, 1)).xz;
float f = saturate(2 * length(simUv - float2(0.5, 0.5)));
float falloff = tex2Dlod(_FalloffTexture, float4(f, 0.5, 0, 0)).r;
float2 erosionData = tex2D(_ErosionMap, simUv).rg;
float4 erosionColor = 0;
#if SHOW_TEXTURE
erosionColor = tex2D(_ErosionSplat, terrainUV * _ErosionSplat_ST.xy + _ErosionSplat_ST.zw);
#elif SHOW_COLOR
erosionColor = _ErosionAlbedo;
#endif
color = lerp(float4(0, 0, 0, 0), erosionColor, saturate(_ErosionIntensity * erosionData.r));
float4 depositionColor = 0;
#if SHOW_TEXTURE
depositionColor = tex2D(_DepositionSplat, terrainUV * _DepositionSplat_ST.xy + _DepositionSplat_ST.zw);
#elif SHOW_COLOR
depositionColor = _DepositionAlbedo;
#endif
color = lerp(color, depositionColor, saturate(_DepositionIntensity * erosionData.g));
color.a = saturate(falloff * max(_ErosionIntensity * erosionData.r, _DepositionIntensity * erosionData.g));
#else
float3 dpdx = ddx(i.worldPos);
float3 dpdy = ddy(i.worldPos);
float3 normal = normalize(cross(dpdy, dpdx));
color = float4((normal.x + 1) * 0.5, (normal.z + 1) * 0.5, (normal.y + 1) * 0.5, _Transparency * i.vertexColor.a);
#endif
UNITY_APPLY_FOG(i.fogCoord, col);
return color;
}
ENDCG
}
}
}

View File

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

View File

@@ -0,0 +1,98 @@
Shader "Hidden/Griffin/GeometryLivePreview"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_OldHeightMap ("Old Height Map", 2D) = "black" {}
_NewHeightMap ("New Height Map", 2D) = "black" {}
_Height ("Height", Float) = 1
_Transparency ("Transparency", Range(0,1)) = 0.5
_BoundMin ("Bound Min", Vector) = (0,0,0,1)
_BoundMax ("Bound Max", Vector) = (1,1,1,1)
_FadeDistance ("Fade Distance", Float) = 2
}
SubShader
{
Tags { "Queue"="Transparent" "RenderType"="Transparent"}
Blend SrcAlpha OneMinusSrcAlpha
ZTest Off
Offset -1, -1
LOD 100
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma multi_compile_fog
#include "UnityCG.cginc"
#include "LivePreviewCommon.cginc"
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float2 uv : TEXCOORD0;
UNITY_FOG_COORDS(1)
float4 vertex : SV_POSITION;
float4 worldPos : TEXCOORD2;
float4 vertexColor : TEXCOORD3;
};
sampler2D _MainTex;
float4 _MainTex_ST;
sampler2D _OldHeightMap;
sampler2D _NewHeightMap;
float _Height;
float _Transparency;
float4 _BoundMin;
float4 _BoundMax;
float _FadeDistance;
v2f vert (appdata v)
{
v2f o;
o.uv = TRANSFORM_TEX(v.uv, _MainTex);
float4 worldPos = mul(unity_ObjectToWorld, v.vertex);
float4 heightMapUv = float4(
(worldPos.x-_BoundMin.x)/(_BoundMax.x-_BoundMin.x),
(worldPos.z-_BoundMin.z)/(_BoundMax.z-_BoundMin.z),
0, 0
);
float oldHeight = GriffinDecodeFloatRG(tex2Dlod(_OldHeightMap, heightMapUv).rg)*_Height;
float newHeight = GriffinDecodeFloatRG(tex2Dlod(_NewHeightMap, heightMapUv).rg)*_Height;
v.vertex.y = newHeight;
o.vertex = UnityObjectToClipPos(v.vertex);
o.worldPos = mul(unity_ObjectToWorld, v.vertex);
o.vertexColor = float4(
1,1,1,
clamp(abs(newHeight-oldHeight)/_FadeDistance,0,1)
);
UNITY_TRANSFER_FOG(o,o.vertex);
return o;
}
fixed4 frag (v2f i) : SV_Target
{
float3 dpdx = ddx(i.worldPos);
float3 dpdy = ddy(i.worldPos);
float3 normal = normalize(cross(dpdy, dpdx));
float4 col = float4(
(normal.x + 1)*0.5,
(normal.z + 1)*0.5,
(normal.y + 1)*0.5,
_Transparency*i.vertexColor.a);
UNITY_APPLY_FOG(i.fogCoord, col);
return col;
}
ENDCG
}
}
}

View File

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

View File

@@ -0,0 +1,68 @@
Shader "Hidden/Griffin/~Internal/GrassPreview"
{
Properties
{
_Color ("Color", Color) = (0, 1, 0, 0.5)
//_MainTex ("Main Texture", 2D) = "white" {}
}
SubShader
{
Tags { "Queue"="Transparent" "RenderType"="Transparent"}
Blend SrcAlpha OneMinusSrcAlpha
Cull Off
ZWrite Off
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma multi_compile_instancing
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct v2f
{
float4 vertex : SV_POSITION;
//UNITY_VERTEX_INPUT_INSTANCE_ID
};
//UNITY_INSTANCING_BUFFER_START(Props)
//UNITY_DEFINE_INSTANCED_PROP(float4, _Color)
//UNITY_DEFINE_INSTANCED_PROP(sampler2D, _MainTex)
//UNITY_INSTANCING_BUFFER_END(Props)
//CBUFFER_START(UnityPerMaterial)
float4 _Color;
//CBUFFER_END
//sampler2D _MainTex;
v2f vert (appdata v)
{
v2f o;
UNITY_SETUP_INSTANCE_ID(v);
//UNITY_TRANSFER_INSTANCE_ID(v, o);
o.vertex = UnityObjectToClipPos(v.vertex);
//o.uv = v.uv;
return o;
}
fixed4 frag (v2f i) : SV_Target
{
//UNITY_SETUP_INSTANCE_ID(i);
//float4 texColor = tex2D(UNITY_ACCESS_INSTANCED_PROP(Props, _MainTex), i.uv);
///float4 col = float4(texColor.rgb*_Color.rgb, texColor.a*_Color.a);
//return col;
return _Color;
//return float4(0,1,0,0.5);
}
ENDCG
}
}
}

View File

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

View File

@@ -0,0 +1,129 @@
#ifndef LIVE_PREVIEW_COMMON_INCLUDED
#define LIVE_PREVIEW_COMMON_INCLUDED
float2 GradientNoise_dir(float2 p)
{
p = p % 289;
float x = (34 * p.x + 1) * p.x % 289 + p.y;
x = (34 * x + 1) * x % 289;
x = frac(x / 41) * 2 - 1;
return normalize(float2(x - floor(x + 0.5), abs(x) - 0.5));
}
float GradientNoise(float2 p)
{
float2 ip = floor(p);
float2 fp = frac(p);
float d00 = dot(GradientNoise_dir(ip), fp);
float d01 = dot(GradientNoise_dir(ip + float2(0, 1)), fp - float2(0, 1));
float d10 = dot(GradientNoise_dir(ip + float2(1, 0)), fp - float2(1, 0));
float d11 = dot(GradientNoise_dir(ip + float2(1, 1)), fp - float2(1, 1));
fp = fp * fp * fp * (fp * (fp * 6 - 15) + 10);
return lerp(lerp(d00, d01, fp.y), lerp(d10, d11, fp.y), fp.x);
}
float InverseLerpUnclamped(float a, float b, float value)
{
//adding a==b check if needed
return (value - a) / (b - a + 0.0000001);
}
float RandomValue(float seed)
{
return frac(sin(dot(float2(seed, seed+1), float2(12.9898, 78.233)))*43758.5453);
}
float RandomValue(float u, float v)
{
return frac(sin(dot(float2(u, v), float2(12.9898, 78.233)))*43758.5453);
}
float2 VoronoiRandomVector (float2 UV, float offset)
{
float2x2 m = float2x2(15.27, 47.63, 99.41, 89.98);
UV = frac(sin(mul(UV, m)) * 46839.32);
return float2(sin(UV.y*+offset)*0.5+0.5, cos(UV.x*offset)*0.5+0.5);
}
float Voronoi(float2 UV, float AngleOffset, float CellDensity)
{
float2 g = floor(UV * CellDensity);
float2 f = frac(UV * CellDensity);
float t = 8.0;
float3 res = float3(8.0, 0.0, 0.0);
float noiseValue = 0;
for(int y=-1; y<=1; y++)
{
for(int x=-1; x<=1; x++)
{
float2 lattice = float2(x,y);
float2 offset = VoronoiRandomVector(lattice + g, AngleOffset);
float d = distance(lattice + offset, f);
if(d < res.x)
{
res = float3(d, offset.x, offset.y);
noiseValue = res.x;
}
}
}
return noiseValue;
}
inline float ValueNoiseInterpolate (float a, float b, float t)
{
return (1.0-t)*a + (t*b);
}
inline float ValueNoise (float2 uv)
{
float2 i = floor(uv);
float2 f = frac(uv);
f = f * f * (3.0 - 2.0 * f);
uv = abs(frac(uv) - 0.5);
float2 c0 = i + float2(0.0, 0.0);
float2 c1 = i + float2(1.0, 0.0);
float2 c2 = i + float2(0.0, 1.0);
float2 c3 = i + float2(1.0, 1.0);
float r0 = RandomValue(c0.x, c0.y);
float r1 = RandomValue(c1.x, c1.y);
float r2 = RandomValue(c2.x, c2.y);
float r3 = RandomValue(c3.x, c3.y);
float bottomOfGrid = ValueNoiseInterpolate(r0, r1, f.x);
float topOfGrid = ValueNoiseInterpolate(r2, r3, f.x);
float t = ValueNoiseInterpolate(bottomOfGrid, topOfGrid, f.y);
return t;
}
float4 MoveTowards(float4 current, float4 target, float maxDistanceDelta)
{
float4 a = target - current;
float magnitude = length(a);
if (magnitude <= maxDistanceDelta || magnitude == 0)
{
return target;
}
return current + a / magnitude * maxDistanceDelta;
}
// Encoding/decoding [0..1) floats into 8 bit/channel RG. Note that 1.0 will not be encoded properly.
inline float2 GriffinEncodeFloatRG(float v)
{
float2 kEncodeMul = float2(1.0, 255.0);
float kEncodeBit = 1.0 / 255.0;
float2 enc = kEncodeMul * v;
enc = frac(enc);
enc.x -= enc.y * kEncodeBit;
return enc;
}
inline float GriffinDecodeFloatRG(float2 enc)
{
float2 kDecodeDot = float2(1.0, 1 / 255.0);
return dot(enc, kDecodeDot);
}
#endif //GRIFFIN_CG_INCLUDED

View File

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

View File

@@ -0,0 +1,87 @@
Shader "Hidden/Griffin/Mask4Channels"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{
Tags { "Queue"="Transparent" "RenderType"="Transparent"}
Blend SrcAlpha OneMinusSrcAlpha
ZWrite Off
ZTest LEqual
Offset -1, -1
LOD 100
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma multi_compile_fog
#include "UnityCG.cginc"
#include "LivePreviewCommon.cginc"
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float4 pos : SV_POSITION;
float2 uv : TEXCOORD0;
float4 screenPos : TEXCOORD1;
UNITY_FOG_COORDS(2)
};
sampler2D _MainTex;
float4 _MainTex_ST;
v2f vert (appdata v)
{
v2f o;
o.uv = v.uv;
o.pos = UnityObjectToClipPos(v.vertex);
o.screenPos = ComputeScreenPos(o.pos);
return o;
}
fixed4 Blend(fixed4 src, fixed4 des)
{
return src*src.a + des*(1-src.a);
}
fixed4 frag(v2f i) : SV_Target
{
float2 screenPos = i.screenPos.xy / i.screenPos.w;
float2 pixel = screenPos.xy * _ScreenParams.xy;
if (floor(pixel.x) % 2 != 0 || floor(pixel.y) % 2 != 0)
{
discard;
}
fixed4 texColor = tex2D(_MainTex, i.uv);
fixed4 baseColor = fixed4(0,0,0,0);
fixed4 red = fixed4(1,0,0,texColor.r);
fixed4 green = fixed4(0,1,0,texColor.g);
fixed4 blue = fixed4(0,0,1,texColor.b);
fixed4 alpha = fixed4(0.8, 0.8, 0.8, texColor.a);
fixed4 rgb=baseColor;
rgb = Blend(red, rgb);
rgb = Blend(green,rgb);
rgb = Blend(blue, rgb);
rgb = Blend(alpha, rgb);
rgb.a = max(max(red.a, green.a), max(blue.a, alpha.a));
UNITY_APPLY_FOG(i.fogCoord, rgb);
return rgb;
}
ENDCG
}
}
}

View File

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

View File

@@ -0,0 +1,75 @@
Shader "Hidden/Griffin/MaskVisualizer"
{
Properties
{
_Color ("Color", Color) = (1,0,0,1)
_MainTex ("Texture", 2D) = "white" {}
_Channel ("Channel", Int) = 0
}
SubShader
{
Tags { "Queue"="Transparent" "RenderType"="Transparent"}
Blend SrcAlpha OneMinusSrcAlpha
ZWrite Off
ZTest LEqual
Offset -1, -1
LOD 100
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma multi_compile_fog
#include "UnityCG.cginc"
#include "LivePreviewCommon.cginc"
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float4 pos : SV_POSITION;
float2 uv : TEXCOORD0;
float4 screenPos : TEXCOORD1;
UNITY_FOG_COORDS(2)
};
fixed4 _Color;
sampler2D _MainTex;
float4 _MainTex_ST;
int _Channel;
v2f vert (appdata v)
{
v2f o;
o.uv = v.uv;
o.pos = UnityObjectToClipPos(v.vertex);
o.screenPos = ComputeScreenPos(o.pos);
return o;
}
fixed4 frag(v2f i) : SV_Target
{
float2 screenPos = i.screenPos.xy / i.screenPos.w;
float2 pixel = screenPos.xy * _ScreenParams.xy;
if (floor(pixel.x) % 2 != 0 || floor(pixel.y) % 2 != 0)
{
discard;
}
fixed4 texColor = tex2D(_MainTex, i.uv);
fixed4 col = float4(_Color.rgb, _Color.a*texColor[_Channel]);
UNITY_APPLY_FOG(i.fogCoord, col);
return col;
}
ENDCG
}
}
}

View File

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

View File

@@ -0,0 +1,89 @@
Shader "Hidden/Griffin/SubdivLivePreview2"
{
Properties
{
_Color ("Line Color", Color) = (1,1,1,1)
_HeightMap ("Height Map", 2D) = "black" {}
_Dimension ("Dimension", Vector) = (0,0,0,0)
_SubdivMap ("Subdiv Map", 2D) = "black" {}
_SubdivRange("Subdiv Range", Vector) = (0,0,0,0)
_Mask ("Mask", 2D) = "white" {}
}
SubShader
{
Pass
{
Tags { "RenderType"="Transparent" "Queue"="Transparent" }
Blend SrcAlpha OneMinusSrcAlpha
ZWrite Off
ZTest Always
LOD 200
CGPROGRAM
#include "UnityCG.cginc"
#include "LivePreviewCommon.cginc"
#pragma vertex vert
#pragma fragment frag
struct v2f
{
float4 pos : POSITION; // vertex position
float2 heightMapUv : TEXCOORD1;
float4 worldPos : TEXCOORD2;
};
float4 _Color;
sampler2D _HeightMap;
float4 _Dimension;
float4 _BoundMin;
float4 _BoundMax;
sampler2D _SubdivMap;
float4 _SubdivRange;
sampler2D _Mask;
float4x4 _WorldPointToMask;
v2f vert(appdata_base v)
{
v2f output;
float4 worldPos = mul(unity_ObjectToWorld, v.vertex);
float4 heightMapUv = float4(
(worldPos.x-_BoundMin.x)/(_BoundMax.x-_BoundMin.x),
(worldPos.z-_BoundMin.z)/(_BoundMax.z-_BoundMin.z),
0, 0
);
float newHeight = GriffinDecodeFloatRG(tex2Dlod(_HeightMap, heightMapUv).rg)*_Dimension.y;
v.vertex.y = newHeight;
output.pos = UnityObjectToClipPos(v.vertex);
output.heightMapUv = heightMapUv;
output.worldPos = worldPos;
return output;
}
float4 frag(v2f input) : COLOR
{
float2 maskUv = mul(_WorldPointToMask, input.worldPos).xz;
if (maskUv.x < 0) discard;
if (maskUv.x > 1) discard;
if (maskUv.y < 0) discard;
if (maskUv.y > 1) discard;
float4 col = _Color;
float subdivValue = tex2D(_SubdivMap, input.heightMapUv.xy).r;
float maskValue = tex2D(_Mask, maskUv).r;
col.a *= col.a*maskValue*(subdivValue >= _SubdivRange.x)*(subdivValue <= _SubdivRange.y);
return col;
}
ENDCG
}
}
}

View File

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

View File

@@ -0,0 +1,102 @@
Shader "Hidden/Griffin/VisibilityLivePreview2"
{
Properties
{
_Color ("Line Color", Color) = (1,1,1,1)
_HeightMap ("Height Map", 2D) = "black" {}
_Dimension ("Dimension", Vector) = (0,0,0,0)
_SubdivMap ("Subdiv Map", 2D) = "black" {}
_SubdivRange("Subdiv Range", Vector) = (0,0,0,0)
_Mask ("Mask", 2D) = "white" {}
}
SubShader
{
Pass
{
Tags { "RenderType"="AlphaTest" "Queue"="Overlay" }
Blend SrcAlpha OneMinusSrcAlpha
ZWrite Off
ZTest Always
LOD 200
CGPROGRAM
#include "UnityCG.cginc"
#include "LivePreviewCommon.cginc"
#pragma vertex vert
#pragma fragment frag
#pragma multi_compile _ USE_MASK
struct v2f
{
float4 pos : POSITION;
float2 heightMapUv : TEXCOORD1;
float4 worldPos : TEXCOORD2;
};
float4 _Color;
sampler2D _HeightMap;
float4 _Dimension;
float4 _BoundMin;
float4 _BoundMax;
sampler2D _SubdivMap;
float4 _SubdivRange;
sampler2D _Mask;
float4x4 _WorldPointToMask;
v2f vert(appdata_base v)
{
v2f output;
float4 worldPos = mul(unity_ObjectToWorld, v.vertex);
float4 heightMapUv = float4(
(worldPos.x-_BoundMin.x)/(_BoundMax.x-_BoundMin.x),
(worldPos.z-_BoundMin.z)/(_BoundMax.z-_BoundMin.z),
0, 0
);
float newHeight = GriffinDecodeFloatRG(tex2Dlod(_HeightMap, heightMapUv).rg)*_Dimension.y;
v.vertex.y = newHeight;
output.pos = UnityObjectToClipPos(v.vertex);
output.heightMapUv = heightMapUv;
output.worldPos = worldPos;
return output;
}
float4 frag(v2f input) : COLOR
{
#if USE_MASK
float2 maskUv = mul(_WorldPointToMask, input.worldPos).xz;
if (maskUv.x < 0) discard;
if (maskUv.x > 1) discard;
if (maskUv.y < 0) discard;
if (maskUv.y > 1) discard;
#endif
float visibilityValue = tex2D(_HeightMap, input.heightMapUv.xy).a;
if (visibilityValue >= 0.5)
discard;
float subdivValue = tex2D(_SubdivMap, input.heightMapUv.xy).r;
#if USE_MASK
float maskValue = tex2D(_Mask, maskUv).r;
#else
float maskValue = 1;
#endif
float4 col = _Color;
col.a *= col.a*maskValue*(subdivValue >= _SubdivRange.x)*(subdivValue <= _SubdivRange.y);
return col;
}
ENDCG
}
}
}

View File

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

View File

@@ -0,0 +1,113 @@
Shader "Hidden/Griffin/Wireframe"
{
Properties
{
_Color("Line Color", Color) = (1,1,1,1)
_MainTex("Main Texture", 2D) = "white" {}
_Thickness("Thickness", Float) = 1
}
SubShader
{
Pass
{
Tags { "RenderType" = "Opaque" "Queue" = "Geometry" }
Blend SrcAlpha OneMinusSrcAlpha
LOD 200
CGPROGRAM
#pragma target 5.0
#include "UnityCG.cginc"
#pragma vertex vert
#pragma fragment frag
#pragma geometry geom
struct v2g
{
float4 pos : POSITION; // vertex position
float2 uv : TEXCOORD0; // vertex uv coordinate
};
struct g2f
{
float4 pos : POSITION; // fragment position
float2 uv : TEXCOORD0; // fragment uv coordinate
float3 dist : TEXCOORD1; // distance to each edge of the triangle
};
float _Thickness = 1; // Thickness of the wireframe line rendering
float4 _Color = {1,1,1,1}; // Color of the line
float4 _MainTex_ST; // For the Main Tex UV transform
sampler2D _MainTex; // Texture used for the line
v2g vert(appdata_base v)
{
v2g output;
output.pos = UnityObjectToClipPos(v.vertex);
output.uv = TRANSFORM_TEX(v.texcoord, _MainTex);//v.texcoord;
return output;
}
[maxvertexcount(3)]
void geom(triangle v2g p[3], inout TriangleStream<g2f> triStream)
{
//points in screen space
float2 p0 = _ScreenParams.xy * p[0].pos.xy / p[0].pos.w;
float2 p1 = _ScreenParams.xy * p[1].pos.xy / p[1].pos.w;
float2 p2 = _ScreenParams.xy * p[2].pos.xy / p[2].pos.w;
//edge vectors
float2 v0 = p2 - p1;
float2 v1 = p2 - p0;
float2 v2 = p1 - p0;
//area of the triangle
float area = abs(v1.x * v2.y - v1.y * v2.x);
//values based on distance to the edges
float dist0 = area / length(v0);
float dist1 = area / length(v1);
float dist2 = area / length(v2);
g2f pIn;
//add the first point
pIn.pos = p[0].pos;
pIn.uv = p[0].uv;
pIn.dist = float3(dist0,0,0);
triStream.Append(pIn);
//add the second point
pIn.pos = p[1].pos;
pIn.uv = p[1].uv;
pIn.dist = float3(0,dist1,0);
triStream.Append(pIn);
//add the third point
pIn.pos = p[2].pos;
pIn.uv = p[2].uv;
pIn.dist = float3(0,0,dist2);
triStream.Append(pIn);
}
float4 frag(g2f input) : COLOR
{
//find the smallest distance
float val = min(input.dist.x, min(input.dist.y, input.dist.z));
//calculate power to 2 to thin the line
val = exp2(-1 / _Thickness * val * val);
//blend between the lines and the negative space to give illusion of anti aliasing
float4 targetColor = _Color * tex2D(_MainTex, input.uv);
float4 transCol = _Color * tex2D(_MainTex, input.uv);
transCol.a = 0;
return val * targetColor + (1 - val) * transCol;
}
ENDCG
}
}
}

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