74 lines
2.0 KiB
GLSL
74 lines
2.0 KiB
GLSL
Shader "Terrain" {
|
|
Properties {
|
|
[HideInInspector] _Control0 ("Control0", 2D) = "red" {}
|
|
[HideInInspector] _Control1 ("Control1", 2D) = "black" {}
|
|
[HideInInspector] _Control2 ("Control2", 2D) = "black" {}
|
|
[HideInInspector] _Control3 ("Control3", 2D) = "black" {}
|
|
[NoScaleOffset] _Diffuse ("Diffuse Array", 2DArray) = "white" {}
|
|
[NoScaleOffset] _NormalSAO ("Normal Array", 2DArray) = "bump" {}
|
|
[NoScaleOffset] _PerTexProps ("Per Texture Properties", 2D) = "black" {}
|
|
[HideInInspector] _TerrainHolesTexture ("Holes Map (RGB)", 2D) = "white" {}
|
|
[HideInInspector] _PerPixelNormal ("Per Pixel Normal", 2D) = "bump" {}
|
|
_Contrast ("Blend Contrast", Range(0.01, 0.99)) = 0.4
|
|
_UVScale ("UV Scales", Vector) = (45,45,0,0)
|
|
_MainTex ("Unity Bug", 2D) = "white" {}
|
|
_TerrainHeightmapTexture ("", 2D) = "black" {}
|
|
_TerrainNormalmapTexture ("", 2D) = "bump" {}
|
|
_HybridHeightBlendDistance ("Hybrid Blend Distance", Float) = 300
|
|
_TessData1 ("TessData1", Vector) = (12,0.8,4,0)
|
|
_TessData2 ("TessData2", Vector) = (20,45,0.2,0.25)
|
|
}
|
|
//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;
|
|
|
|
struct Fragment_Stage_Input
|
|
{
|
|
float2 uv : TEXCOORD0;
|
|
};
|
|
|
|
float4 frag(Fragment_Stage_Input input) : SV_TARGET
|
|
{
|
|
return _MainTex.Sample(sampler_MainTex, input.uv.xy);
|
|
}
|
|
|
|
ENDHLSL
|
|
}
|
|
}
|
|
Fallback "Hidden/Terrain_Base-305687551"
|
|
//CustomEditor "MicroSplatShaderGUI"
|
|
} |