VertexTexCoords: coord_set (optional)

Blitz3D Forums/Blitz3D Programming/VertexTexCoords: coord_set (optional)

WillKoh(Posted 2004) [#1]
What is that [coord_set (optional)]?


Sunteam Software(Posted 2004) [#2]
It's helpful for doing things like having a mesh texture and a shadow texture on the same mesh. When you apply multiple textures to a mesh they use the UV coords of each vert to determine the layout of the texture on each face. By having 2 or more coord sets (limited by gfx card I believe) you can apply multiple textures with differing UV values per vert. This means that each texture is not constrained to use the same layout thus allowing for more conservative texture use.

The best and most common example is the use of shadow textures. Quite often the normal texture of the object is bigger than is required for a shadow texture. So by using a different coord set you can create shadow textures which are smaller more compact thus saving valuable gfx memory.

Have a look at some of the shadow rendering examples in the code archives if you feel brave enough. Though you will find quite often by choosing a solution in one of the already done pieces of software out there, they will automatically save the .B3D with both UV sets when creating the shadows for your model/world/level. So quite often you won't need to worry too much about handling this in your own code.

Ah I know, download and do some stuff in Maplet. The textures like walls etc... use 1 coord set, then if you create some lights and render shadows, then you'll notice when you export the .B3D you have an extra texture in the form of the shadows. When that texture is applied to the mesh it uses a different coord set so that it's dimensions can be more compact.