post processing
[WindSway-HDRP.git] / Library / PackageCache / com.unity.render-pipelines.high-definition@4.10.0-preview / Runtime / Material / TerrainLit / TerrainLit_Basemap_Gen.shader
blob17d1c89548f4e847891c37f7020cfc4352c73662
1 Shader "Hidden/HDRP/TerrainLit_Basemap_Gen"
3     Properties
4     {
5         [HideInInspector] _DstBlend("DstBlend", Float) = 0.0
6     }
8     SubShader
9     {
10         Tags { "SplatCount" = "8" }
12         HLSLINCLUDE
14         #pragma target 4.5
15         #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch
17         #define USE_LEGACY_UNITY_MATRIX_VARIABLES
18         #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
19         #include "Packages/com.unity.render-pipelines.high-definition/Runtime/ShaderLibrary/ShaderVariables.hlsl"
20         #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/Material.hlsl"
22         #pragma shader_feature _TERRAIN_8_LAYERS
23         #pragma shader_feature _TERRAIN_BLEND_HEIGHT
24         #pragma shader_feature _NORMALMAP
25         #pragma shader_feature _MASKMAP
27         #ifdef _MASKMAP
28             // Needed because unity tries to match the name of the used textures to samplers. Masks can be used without splats in Metallic pass.
29             #define OVERRIDE_SAMPLER_NAME sampler_Mask0
30         #endif
31         #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/TerrainLit/TerrainLitSplatCommon.hlsl"
33         struct Attributes {
34             float3 vertex : POSITION;
35             float2 texcoord : TEXCOORD0;
36         };
38         struct Varyings
39         {
40             float4 positionCS : SV_POSITION;
41             float2 texcoord : TEXCOORD0;
42         };
44         ENDHLSL
46         Pass
47         {
48             Tags
49             {
50                 "Name" = "_MainTex"
51                 "Format" = "ARGB32"
52                 "Size" = "1"
53             }
55             ZTest Always Cull Off ZWrite Off
56             Blend One [_DstBlend]
58             HLSLPROGRAM
60             #pragma vertex Vert
61             #pragma fragment Frag
63             Varyings Vert(Attributes input)
64             {
65                 Varyings output;
66                 output.positionCS = TransformWorldToHClip(input.vertex);
67                 output.texcoord = input.texcoord;
68                 return output;
69             }
71             float4 Frag(Varyings input) : SV_Target
72             {
73                 float4 albedo;
74                 float3 normalTS;
75                 float metallic;
76                 float ao;
77                 TerrainSplatBlend(input.texcoord, float3(0, 0, 0), float3(0, 0, 0),
78                     albedo.xyz, normalTS, albedo.w, metallic, ao);
80                 return albedo;
81             }
83             ENDHLSL
84         }
86         Pass
87         {
88             Tags
89             {
90                 "Name" = "_MetallicTex"
91                 "Format" = "RG16"
92                 "Size" = "1/4"
93             }
95             ZTest Always Cull Off ZWrite Off
96             Blend One [_DstBlend]
98             HLSLPROGRAM
100             #pragma vertex Vert
101             #pragma fragment Frag
103             Varyings Vert(Attributes input)
104             {
105                 Varyings output;
106                 output.positionCS = TransformWorldToHClip(input.vertex);
107                 output.texcoord = input.texcoord;
108                 return output;
109             }
111             float2 Frag(Varyings input) : SV_Target
112             {
113                 float4 albedo;
114                 float3 normalTS;
115                 float metallic;
116                 float ao;
117                 TerrainSplatBlend(input.texcoord, float3(0, 0, 0), float3(0, 0, 0),
118                     albedo.xyz, normalTS, albedo.w, metallic, ao);
120                 return float2(metallic, ao);
121             }
123             ENDHLSL
124         }
125     }
126     Fallback Off