So for a simple surface shader, you can use vertex modifier:
void vert (inout appdata_full v) {
v.vertex.xyz += v.normal * _Amount;
}
I was thinking the same would work as vertex shader:
// vertex shader
VectexOutput vert (VectexInput i) {
// init output
VectexOutput o;
UNITY_INITIALIZE_OUTPUT(VectexOutput, o);
// vertex extrusion
i.vertex.xyz += i.normal * _Multiplier;
// world space normal
half3 normal = UnityObjectToWorldNormal(i.normal);
// standard diffuse lighting
half nl = max(0, dot(normal, _WorldSpaceLightPos0.xyz));
// input to output
o.vertex = UnityObjectToClipPos(i.vertex);
o.color = i.color;
o.diff = nl * _LightColor0;
o.diff.rgb += ShadeSH9(half4(normal, 1));
o.uv = TRANSFORM_TEX(i.uv, _MainTex);
return o;
}
But it doesn't, and since surface shader is compiled to vertex/fragment shader, I am wondering what am I missing?