To create this effect, start by modifying the duplicated shader:
- Let's start by adding a property to our shader, which will be used to modulate its extrusion. The range presented here goes from -0.0001 to 0.0001, but you might have to adjust this according to your own needs:
__Amount ("Extrusion Amount", Range(-0.0001, 0.0001)) = 0
- Couple the property with its respective variable:
float _Amount;
- Change the #pragma directive so that it now uses a vertex modifier. You can do this by adding vertex:function_name at the end of it. In our case, we have called the vert: function:
#pragma surface surf Standard vertex:vert
- Add the following vertex modifier:
void vert (inout appdata_full v) { v.vertex.xyz += v.normal * _Amount; ...