I have a very simple shader that uses a texture that is written to from script to change the y value of vertices, simple displacement thing. All works great but when I change to Linear mode the whole mesh moves down a bit. The problem is the tex2dlod seems to give a different value in Linear mode than in Gamma mode. In the line below
v.vertex.y += (tex2Dlod(_HeightTex, float4(uv, 0, 0)).x - 0.5f) * _Length;
I have to change the -0.5f value to get the mesh to be at the right height, is there something I need to do so I can use the tex2Dlod value without any changes when I change between Linear and Gamma?