80 lines
2.7 KiB
GLSL
80 lines
2.7 KiB
GLSL
Shader "HDRP/TerrainLit" {
|
|
Properties {
|
|
[ToggleUI] [HideInInspector] _EnableHeightBlend ("EnableHeightBlend", Float) = 0
|
|
_HeightTransition ("Height Transition", Range(0, 1)) = 0
|
|
[Enum(Off, 0, From Ambient Occlusion, 1)] [HideInInspector] _SpecularOcclusionMode ("Specular Occlusion Mode", Float) = 1
|
|
[HideInInspector] _StencilRef ("_StencilRef", Float) = 0
|
|
[HideInInspector] _StencilWriteMask ("_StencilWriteMask", Float) = 3
|
|
[HideInInspector] _StencilRefGBuffer ("_StencilRefGBuffer", Float) = 2
|
|
[HideInInspector] _StencilWriteMaskGBuffer ("_StencilWriteMaskGBuffer", Float) = 3
|
|
[HideInInspector] _StencilRefDepth ("_StencilRefDepth", Float) = 0
|
|
[HideInInspector] _StencilWriteMaskDepth ("_StencilWriteMaskDepth", Float) = 8
|
|
[HideInInspector] _ZWrite ("__zw", Float) = 1
|
|
[ToggleUI] [HideInInspector] _TransparentZWrite ("_TransparentZWrite", Float) = 0
|
|
[HideInInspector] _CullMode ("__cullmode", Float) = 2
|
|
[HideInInspector] _ZTestDepthEqualForOpaque ("_ZTestDepthEqualForOpaque", Float) = 4
|
|
[HideInInspector] _ZTestGBuffer ("_ZTestGBuffer", Float) = 4
|
|
[ToggleUI] _EnableInstancedPerPixelNormal ("Instanced per pixel normal", Float) = 1
|
|
[HideInInspector] _TerrainHolesTexture ("Holes Map (RGB)", 2D) = "white" {}
|
|
[HideInInspector] _EmissionColor ("Color", Vector) = (1,1,1,1)
|
|
[HideInInspector] _MainTex ("Albedo", 2D) = "white" {}
|
|
[HideInInspector] _Color ("Color", Vector) = (1,1,1,1)
|
|
[ToggleUI] [HideInInspector] _SupportDecals ("Support Decals", Float) = 1
|
|
[ToggleUI] [HideInInspector] _ReceivesSSR ("Receives SSR", Float) = 1
|
|
[ToggleUI] [HideInInspector] _AddPrecomputedVelocity ("AddPrecomputedVelocity", Float) = 0
|
|
}
|
|
//DummyShaderTextExporter
|
|
SubShader{
|
|
Tags { "RenderType"="Opaque" }
|
|
LOD 200
|
|
|
|
Pass
|
|
{
|
|
HLSLPROGRAM
|
|
#pragma vertex vert
|
|
#pragma fragment frag
|
|
|
|
float4x4 unity_ObjectToWorld;
|
|
float4x4 unity_MatrixVP;
|
|
float4 _MainTex_ST;
|
|
|
|
struct Vertex_Stage_Input
|
|
{
|
|
float4 pos : POSITION;
|
|
float2 uv : TEXCOORD0;
|
|
};
|
|
|
|
struct Vertex_Stage_Output
|
|
{
|
|
float2 uv : TEXCOORD0;
|
|
float4 pos : SV_POSITION;
|
|
};
|
|
|
|
Vertex_Stage_Output vert(Vertex_Stage_Input input)
|
|
{
|
|
Vertex_Stage_Output output;
|
|
output.uv = (input.uv.xy * _MainTex_ST.xy) + _MainTex_ST.zw;
|
|
output.pos = mul(unity_MatrixVP, mul(unity_ObjectToWorld, input.pos));
|
|
return output;
|
|
}
|
|
|
|
Texture2D<float4> _MainTex;
|
|
SamplerState sampler_MainTex;
|
|
float4 _Color;
|
|
|
|
struct Fragment_Stage_Input
|
|
{
|
|
float2 uv : TEXCOORD0;
|
|
};
|
|
|
|
float4 frag(Fragment_Stage_Input input) : SV_TARGET
|
|
{
|
|
return _MainTex.Sample(sampler_MainTex, input.uv.xy) * _Color;
|
|
}
|
|
|
|
ENDHLSL
|
|
}
|
|
}
|
|
Fallback "Hidden/HDRP/FallbackError"
|
|
//CustomEditor "UnityEditor.Rendering.HighDefinition.TerrainLitGUI"
|
|
} |