- 高度细分shader
Shader "QQ/TerrainTessEdge" {
Properties{
_Color("Color", Color) = (1,1,1,1)
_HeightMap("高度图",2D) = "black"{}
_HeightAmount("高度比例",Range(0.0,5.0)) = 0.5
_EdgaLength("细分程度",Range(0.1,100)) = 50
_MainTex("底层图",2D) = "white"{}
_RTex("红色贴图", 2D) = "white" {}
_GTex("绿色贴图", 2D) = "white" {}
_BTex("蓝色贴图", 2D) = "white" {}
_ATex("Alpha贴图", 2D) = "white" {}
_RGBATex("通道图", 2D) = "white" {}
}
SubShader{
Tags { "RenderType" = "Opaque" }
LOD 300
CGPROGRAM
#pragma surface surf BlinnPhong addshadow vertex:disp tessellate:tessEdge//定义了点方法和细分方法
#include "Tessellation.cginc"//unity的细分API
#pragma target 4.0//3.0的贴图有限
struct appdata {
float4 vertex : POSITION
float4 t