Vertex shaders for v.vertex.xyz and realtime shadows? (Unity 3.3 standalone DX9)

Following the examples in the documentation, http://unity3d.com/support/documentation/Components/SL-SurfaceShaderExamples.html, specifically the Normal Extrusion with Vertex Modifier example with…

      void vert (inout appdata_full v) {
          v.vertex.xyz += v.normal * _Amount;
      }

The vertex shader works fine, but it’s only applied AFTER the realtime shadows are calculated. Since the vertex positions are pretty important to the shadow calculation, you get pretty bad mismatch between where the shadows are and where they should be.

So I’m wondering, where can I insert the vertex shader such that it affects the shadow passes as well?

  • Chad

this
#pragma surface surf Lambert vertex:vert addshadow

Excellent. Thank you very much.

i need some Battle Angel Alita i am very new in unity3D n trying to create Shader so plzz help me