In my shader, I calculate uv by multiplying vertex.position to some matrix. This looks fine if I dont move my object, but once I move my object or scale the object, the vertex position will change and uv will be wrong.
If there is a way for shader to store parameters, like this, so that I can only calculate uv at the first time, and then I just use that uv value.
if( ifCalculated==false)
{
ifCalculated=true;
uv=CalculateUV();
temp = uv;
}
else
{
uv = temp;
}