Multitexture UV coords?
Blitz3D Forums/Blitz3D Programming/Multitexture UV coords?
| ||
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? |
| ||
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. |
| ||
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? |
| ||
See the TextureCoords command. |
| ||
Ah! That was what I was missing. Thanks! |
| ||
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. |
| ||
Yup, 8 texture stages but only 2 UV sets....strange no? ;) |
| ||
Well environment maps don't use UV sets, so you can use one ( or more ) of those without needing any additional UV coords. |
| ||
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.. ;) |
| ||
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. |
| ||
Hmmm vertex alpha splatted terrains...you must mean this.. |