- Home /
Vertex transforms in custom shader don't work in Unity 5
I have vertex shader where I transform vertex positions like this:
Input vert(appdata_full a)
{
Input o;
float4 v = a.vertex;
float4 vPos = mul (UNITY_MATRIX_MV, v);
vPos += float4(xOffset, 0, 0, 0) * (vPos.z * vPos.z * someCoef);
vPos = mul(UNITY_MATRIX_P, vPos);
o.pos = vPos;
return o;
}
Code is pretty obvious, the further object from camera more vertex transformed.
It was working OK without any troubles. In Unity 5 it works only in Editor. When I deploy my project on device it seems like there is no vertex transformations at all! May be someone knows what the difference between new unity and unity 4 that causes this behaviour.
Your answer
Follow this Question
Related Questions
Left side of color spectrum from color picker not appearing in shader for game view [Shader Graph] 0 Answers
Cant get Alpha Channel to Work with Custom Shader 1 Answer
Mobile performance of splat map shader with distance blending 0 Answers
Changing shaders in a game during runtime 1 Answer
Is there any need of Shader Scripts in unity5 or PBS is enough? 1 Answer