1 Shader "Hidden/HDRP/TerrainLit_Basemap_Gen"
5 [HideInInspector] _DstBlend("DstBlend", Float) = 0.0
10 Tags { "SplatCount" = "8" }
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
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
31 #include "Packages/com.unity.render-pipelines.high-definition/Runtime/Material/TerrainLit/TerrainLitSplatCommon.hlsl"
34 float3 vertex : POSITION;
35 float2 texcoord : TEXCOORD0;
40 float4 positionCS : SV_POSITION;
41 float2 texcoord : TEXCOORD0;
55 ZTest Always Cull Off ZWrite Off
63 Varyings Vert(Attributes input)
66 output.positionCS = TransformWorldToHClip(input.vertex);
67 output.texcoord = input.texcoord;
71 float4 Frag(Varyings input) : SV_Target
77 TerrainSplatBlend(input.texcoord, float3(0, 0, 0), float3(0, 0, 0),
78 albedo.xyz, normalTS, albedo.w, metallic, ao);
90 "Name" = "_MetallicTex"
95 ZTest Always Cull Off ZWrite Off
101 #pragma fragment Frag
103 Varyings Vert(Attributes input)
106 output.positionCS = TransformWorldToHClip(input.vertex);
107 output.texcoord = input.texcoord;
111 float2 Frag(Varyings input) : SV_Target
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);