I’ve been poking around in the town scene from the hello collision example and I’m a bit confused about texture coordinates
Why do the vertices in level.mesh.xml have two texture coordinates per vertex? Also, my understanding of texcoords is that they are within the range [0, 1] denoting how far into the texture we are, why is the first texcoord in the vertices outside that range? At first I thought it might have been referring to a bump map or some other uniform but there’s nothing like that in the example. Also, when I export a simple scene with uv mapped textures from blender myself, there’s only one texcoord per vertex.
You can have more than one texture buffer per mesh, it might be useful if you are using multiple textures, and they don’t have the same coords (generally you will only have 1).
The UV map coords go from 0 to 1, but you can reference outside this range. There are texture wrapping functions: repeat, clamp etc which will be used when you reference outside 0 -> 1. You will get 1 texcoord normally from Blender, unless you add extra UV maps to the same mesh.
Thanks wezrule, I understand the concept of sending multiple textures to the shader, it would be for stuff like decals and bumpmaps right? For when you need extra uniform textures that you can do stuff with in your shader. I just don’t get it in the town example what those extra texcoords reference because there doesn’t seem to be a second texture being sent anywhere, and the extra (first) texcoords seem to be random and arbitrary. This was leading me to believe there was something I wasn’t really understanding with these files
For example, here’s a submesh from that scene (it’s shorter than most of the others). Everything in this snippet makes sense to me except those extra texcoords