2019-07-07 15:56:52 +00:00
|
|
|
Shader "Vertex Modifier" {
|
|
|
|
Properties {
|
|
|
|
_MainTex ("Texture", 2D) = "depth" {}
|
2019-07-07 20:00:44 +00:00
|
|
|
_Scale ("Scale", Float) = 1.0
|
2019-07-07 15:56:52 +00:00
|
|
|
}
|
|
|
|
SubShader {
|
|
|
|
Tags { "RenderType" = "Opaque" }
|
2019-07-07 20:00:44 +00:00
|
|
|
|
2019-07-07 15:56:52 +00:00
|
|
|
CGPROGRAM
|
|
|
|
#pragma surface surf Lambert vertex:vert
|
|
|
|
struct Input {
|
|
|
|
float2 uv_MainTex;
|
|
|
|
};
|
|
|
|
|
2019-07-07 20:00:44 +00:00
|
|
|
float _Scale;
|
2019-07-07 15:56:52 +00:00
|
|
|
sampler2D _MainTex;
|
|
|
|
|
|
|
|
void vert (inout appdata_full v){
|
2019-07-07 20:00:44 +00:00
|
|
|
v.vertex.z += _Scale * tex2Dlod(_MainTex, v.texcoord).r;
|
2019-07-07 15:56:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void surf (Input IN, inout SurfaceOutput o) {
|
|
|
|
o.Albedo = float4(1.0f, 1.0f, 1.0f, 1.0f);
|
|
|
|
}
|
|
|
|
ENDCG
|
|
|
|
}
|
|
|
|
}
|