Game Development Community

Multiple UV sets/channels in a DTS?

by Robert Rose · in Torque Game Engine Advanced · 02/19/2008 (1:13 am) · 7 replies

I'd like to be able to create static shapes and character models with multiple UV channels. Why? Lightmaps, ambient occlusion maps.. lots of reasons. :-)

I've seen references to this being supported but I'm not finding any direct explanations how to do it.

Is this a limitation of the file format or the exporter?

#1
02/19/2008 (8:58 am)
Multiple UV channels and multi-texturing is the same
I know how to create it using Studio Max - use the Multi Sub Object Material.
That material creates different maps for each part of your dts, each map has its own UV coords.
Then expoting you will have a single dts with multiple diffuse maps. This is working (i allready did it). Shading (HLSL) too.
#2
03/12/2008 (7:38 am)
I don't really see how multi-texturing is the same as several UV-channels...?!

Yes, one can map more than one texture on a mesh with Multi Sub Object Material...but that does not mean another set of UV's - just assigning different materials to different polygons (with material ID's).
(And be aware that using Multi Sub Mat. will result in the engine actually renders the mesh for every additional material...hence it's best to have textures in one map).

What I think Robert is after, is the ability to have a rather high res. texture tiled several times on the mesh (keeping higher detailed textures)...and then for example multiply a lower res. lightmap on top of this. And this demands another UV-set for the mesh...since the you probably don't want/can have the lightmap tiled.

Since the engine/lightning kit does not support any fancier lightning (radiosity, global illumination, ambient occlusion etc)...I'm the first in line to cheer the person who will manage to extend the DTS-object to use multiple UV's. Then the baked lightning from for example 3DS Max can really boost the look of some things.

@Picasso:
I can be (hope I am) wrong here...but then I would like you to explain more about how I can use Multi Sub mat. for e.g. lightmaps.
#3
03/12/2008 (8:23 am)
"Multitexturing is the ablility to apply two or more textures (most modern graphics cards can do 8 textures) to the same primitive in a single pass. These textures can be combined through fixed funtion (knobs and switchs) or programmable pipelines. Fragment shading builds on multitexturing, it just bypasses the fixed function register combiners."


Now read here:
www.maxoncomputer.com/tutorial_detail.asp?tutorialID=307

May be you did not understood me. The theme was with another mean.
You are talking about multiple texcoords per vertex. That is possible too, i have the idea how to do that, but it is a bit complex work, we need to change the vertex definition to have a masive(or vector ... D3DXVECTOR2 texcoords[N_count];) of texcoords, then in vertex shader we just modalate that channels.
The VS processes N times per face(patch), 1 for each vertex.

Anyway Robert Rose got his answer in the other forum.
#4
03/12/2008 (9:30 am)
For clarification...this is what I mean;

niva3d.com/temp/multiple_uvs.jpg
To keep texture resolution, a 512x512 px texture tiled over the mesh...resulting polygons 'sharing same space'...
...and then a lower resolution lightmap 'modulated' over that (using a 2nd UV-channel where polygons have their 'unique' coordinates since light differs over the mesh).

I can't see how this would be made with just one UV-channel. As of now, to accomplish this, I render the lighting baked resulting in huuuuuge textures if one want to keep the resolution quite high.
#5
03/12/2008 (9:32 am)
Edit: Oh I see Tobias posted an example. Yeah, that's *exactly* what I'm trying to do.

To be clear, multiple UV channels and multiple textures are not the same thing. I'm not asking how to set this up in a 3D package--I've done that already. My problem is the DTS exporter for Max ignores them and only exports one UV channel. There doesn't appear to be any support in the DTS file format for multiple UV sets.

In another post (http://www.garagegames.com/mg/forums/result.thread.php?qt=26822) Adrian Tysoe says it's definitely not possible in TGEA but that he knows someone who's added support for it. Unfortunately the support hasn't been contributed back.
#6
03/12/2008 (10:25 am)
The effect you want to achieve can be done in another way. I don't understand why you want to export multiple UV channels in the DTS. This is not supported in the exporter, though this needs modifications to the SDK.
You can do the effect you want using shaders. Just export the model with the second map in your example picture above( the lightmap) and then mix the two map using different texcoords. the only disadvantage is that you will lose the bricks mapping on the object , but having in mind that it's a tiled texture(you can tile it and make it smaller and experiment in photoshop) you will achieve satisfying results.
#7
03/12/2008 (1:25 pm)
If I understand you correctly you're suggesting to use two maps and the same uv coords. Yes, technically this would work, but would require a great deal more texture memory. I don't believe this would be a very acceptable solution for larger objects. And besides, if you can combine the two textures into one and share the same uv coords then why not just combine the two textures in the modeling tool and only have one texture?

There are other reasons for wanting two uv channels also.