100 lines
3.7 KiB
GLSL
100 lines
3.7 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" {}
|
|
[NoScaleOffset] _DetailNoise ("Detail Noise (Lum/Normal)", 2D) = "grey" {}
|
|
_DetailNoiseScaleStrengthFade ("Detail Scale", Vector) = (4,0.5,5,0)
|
|
[NoScaleOffset] _DistanceNoise ("Detail Noise (Lum/Normal)", 2D) = "grey" {}
|
|
_DistanceNoiseScaleStrengthFade ("Detail Scale", Vector) = (0.25,0.5,100,250)
|
|
_NoiseHeight ("Noise Texture", 2D) = "grey" {}
|
|
_NoiseHeightData ("Noise Height Data", Vector) = (1,0.15,0,0)
|
|
_ResampleDistanceParams ("ResampleDistanceParams", Vector) = (0.25,180,500,0)
|
|
_DistanceResampleAlbedoStrength ("Resampled Albedo Strength", Range(0.1, 1)) = 1
|
|
_DistanceResampleNormalStrength ("Resampled Normal Strength", Range(0.1, 1.3)) = 1
|
|
[NoScaleOffset] _NormalNoise ("Normal Noise", 2D) = "bump" {}
|
|
_NormalNoiseScaleStrength ("Normal Scale", Vector) = (8,0.5,0,0)
|
|
[NoScaleOffset] _NormalNoise2 ("Normal Noise 2", 2D) = "bump" {}
|
|
_NormalNoiseScaleStrength2 ("Normal Scale 2", Vector) = (8,0.5,0,0)
|
|
_GeoTex ("Gradient", 2D) = "white" {}
|
|
_GeoNormal ("Normal", 2D) = "bump" {}
|
|
_GeoSlopeTex ("GeoSlopeTex", 2D) = "white" {}
|
|
_GeoNormalStrength ("Str", Range(0.01, 1.5)) = 1
|
|
_GeoParams ("Blend/World Scale/Offset", Vector) = (1,0.01,0,0)
|
|
_GeoRange ("Blend fade params", Vector) = (0,0,0,0)
|
|
_GeoCurveParams ("Geo Curve Scale/Offset/Rotation", Vector) = (512,0,0,0)
|
|
_GeoCurve ("Geo Curve", 2D) = "white" {}
|
|
_GeoHeightContrast ("Geo Height Contrast", Float) = 10
|
|
_GlobalTintTex ("Global Tint", 2D) = "white" {}
|
|
_GlobalTintFade ("Global Normmal Fade", Vector) = (50,150,1,1)
|
|
_GlobalTintUVScale ("UV Scale", Vector) = (1,1,0,0)
|
|
_GlobalTextureParams ("Tint Blend/Normal Blend", Vector) = (0.5,0.5,0.5,0.5)
|
|
_GlobalSlopeTex ("GlobalSlopeTex", 2D) = "white" {}
|
|
_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_Base1718083899"
|
|
//CustomEditor "MicroSplatShaderGUI"
|
|
} |