- Home /
Question by
fherbst · Aug 12, 2011 at 03:41 AM ·
shadertextureuvmovietexture
Difference between TRANSFORM_TEX and MultiplyUV
The manual seems to be quite unclear about which is the current and right method to calculate the uv coordinates for the tiling and offset set up for the texture:
o.uv = TRANSFORM_TEX(v.texcoord, _MainTex);
or
o.uv = MultiplyUV(UNITY_MATRIX_TEXTURE0, v.texcoord);
What are the differences between these two? Currently I have an example (applying offset and scale to a MovieTexture) where neither does what I would expect (and what e.g. the Diffuse shader does). Is this an error in the MovieTexture or have I to do more things to use tiling&offset like the Diffuse shader does?
EDIT: Finally, I would like to have something like the Unlit/Texture shader, but as a vertex/fragment shader (not surface shader). I will try using a surface shader (which does all of this automagically), but I'm still curious what the right way is :).
Comment