- Home /
Tiling texture on its UV instead of texture length?
The diffuse shader gives the option to tile a texture that is applied to a mesh which is quite useful, the problem I have though is that the way it tiles is on the textures entire length rather than just a section of the UV that is applied to the mesh so in a texture sheet with multiple textures tiling results in other textures being included.
Is it possible to mirror on the UV?
Answer by Jessy · Jun 16, 2012 at 03:07 PM
No.
All that "Tiling" and "Offset" represent, is a multiply-add operation:
http://www.opengl.org/wiki/GLSL_Optimizations#Get_MAD
http://en.wikipedia.org/wiki/Multiply–accumulate_operation
Your UVs are first scaled, from the origin – Tiling.
Then a Vector2 is added to the result – Offset.
So, for an atlasing approach such that you have going on, tiling and offset are generally useless; the words they represent, but don't quite match, will need to be performed in the UV creation stage. "Scale" and "Position", like a Transform has, would have been more accurate names.
Answer by Bunny83 · Jun 16, 2012 at 03:23 PM
It is possible, but only at shader level in a fragment shader. The tile information has to be passed differently. In the other question michael used a shader variable (offset).
Your answer
Follow this Question
Related Questions
Question about draw distance and texture tiling 2 Answers
Multiple Shaders vs. One Diffuse Map 1 Answer
Texture Tiling broken in Unity 2019.2 LWRP 1 Answer
How to correctly access and use terrain texture tiling from custom terrain shader? 0 Answers
Some textures not affected by light? (With screenshots) 5 Answers