it turns out that the surface depth is calcuated in the vertex shade before the vertex offset is applied
Example:
- Code: Select all
o.eyeDepth = -UnityObjectToViewPos( v.vertex.xyz ).z;
v.vertex.xyz += float3(4,4,4);
i think this problem can occur on multiple occasions and might need some special execution priority.
(for example passing world position before and after vertex offset into the pixel shader using vertex to fragment node)