Multitexture UV coords?

Blitz3D Forums/Blitz3D Programming/Multitexture UV coords?

Al Mackey(Posted 2003) [#1]
I hope one of the gurus here will be able to help me..

I've been looking at the command reference, trying to learn more about multitexturing and UV coords. My goal is to have a mesh that has two layers of texture that both have their own UV coordinate sets, where the top layer of texture is multiplied against the bottom. I'd want to have direct control over both sets of UV coords, not just a position/rotation per layer like you can get using Textures. There's a tiny mention of a coordinate set in VertexTexCoords, but no mention of what this does. Does anyone know how this works?


jfk EO-11110(Posted 2003) [#2]
Up to 8 Sets are supported, 0 to 7. Default is Zero. A second UV Set would use 1. If you can manage it to set the default Set correctly then any furter sets are made easily.


Al Mackey(Posted 2003) [#3]
I've managed to get one texture on level 0 and one on level 1, but they both seem to be using the same UV coords. For example, a statement like this will affect both textures:
VertexTexCoords(surf, vertex, u, v, 0, 0)

and this will affect neither:
VertexTexCoords(surf, vertex, u, v, 0, 1)

What am I doing wrong?


skidracer(Posted 2003) [#4]
See the TextureCoords command.


Al Mackey(Posted 2003) [#5]
Ah! That was what I was missing. Thanks!


jhocking(Posted 2003) [#6]
I thought only two UV sets were supported. You can have up to 8 texture layers but only 2 UV sets; obviously the sets of UV coordinates would be used by more than one texture layer.


Shambler(Posted 2003) [#7]
Yup, 8 texture stages but only 2 UV sets....strange no? ;)


Gabriel(Posted 2003) [#8]
Well environment maps don't use UV sets, so you can use one ( or more ) of those without needing any additional UV coords.


Mustang(Posted 2003) [#9]
And I think that you could also do "tiling splatted terrains" with many layers of (alphaed) textures, or maybe additive lightmap effects (as it would use the same UV than "regular" lightmap). Having only two UV-sets is not that restricting than it might initially seem to be... and if that is not enough you can always render stuff using multiple passes.. ;)


jhocking(Posted 2003) [#10]
Yeah, I find 2 UV sets plenty for just about everything. And lest anyone start complaining, note that most low-cost game dev only have a single set of UV coordinates.


Shambler(Posted 2003) [#11]
Hmmm vertex alpha splatted terrains...you must mean this..