Gormio
20-03-2008 08:01:49
I would like to get some clarification on the tactics that oFusion takes when exporting the UV map channels of a mesh. I haven't seen any exported mesh include more than six UV coordinate sets so I'm assuming this is some kind of an upper limit? Sometimes one or more of these exported coordinate sets include totally unusable data such as all zeros or all ones or some other useless combination of these. It would save some space on the exported meshes to get rid of those coordinate sets.
But how does the exporter choose what data to include in those UV coordinate sets? Are these always the map channels 1 to 6 in Max or is there some sophisticated heuristics used?
As an example: I have some object that contain usable UV data on map channels 10, 12, 15 and 25. What should I do in order to get a mesh that has this data put on texture coordinate sets 0 through 3 (in Ogre parlance)?
Why do you need so many UV channels, and why didn't you number them sensibly in the beginning.
Anyway, you can just take your unwrap UV and change the number of the channel to the one you want.
If its a real mess, I'd just copy the original mesh, and use the remove UVW utiity, to clean the copy and then copy the UVW map channels from the original mesh to the new one where 3dsmx channel 10 becomes channel 1, 12=2, 15=3, 25=4
Seems a bit silly to spread your channels around like that. It's pretty rare to need more than 4 channels, I mostly only use 1-3 shared between various texture laters.
Lioric
21-03-2008 01:13:26
Supported are 8 channels of texture coords, but Ogre uses a hard limit of 6 channels (can be modified, if not using the Ogre sdk but from sources)
Before adding any texture channel to the mesh, the max internal system is queried for the number of channels being used on an object (the color and alpha channels are handled differently), then each channel is queried individualy for being supported and if its in current use, after this the data is added to the mesh as a texcoord buffer
There is no sensible way of determining if the data of each channel reported as currently being used by the object is actually data created by the user or can be removed from the mesh, as there is common to have objects in that some channels have actual texture data and others are placeholders (with zeroed values) for dynamic data that will be added or modified in the user application to be used by the shaders
As noted in the post above, it might be better if you organize (and standarize) your texture channels in a way that data that will be used by the Ogre engine are in the first, contiguous channels, and any other data needed at design time in the next channels
There are some tools to verify and modify each map (texture coord) channel before exporting your scene, you can move data between channels or define what value each vetex in the channel has
If you have a scene where objects are being produced with incorrect map channel values, provide us with the scene and we will review it asap
What number of channels do you need?
Gormio
21-03-2008 12:55:20
Why do you need so many UV channels, and why didn't you number them sensibly in the beginning.
Well, the material comes from an external provider and we weren't wise enough to instruct them properly about these kind of things

So the damage is already done - now we need to cope with the assets we have.
Anyway, you can just take your unwrap UV and change the number of the channel to the one you want.
If its a real mess, I'd just copy the original mesh, and use the remove UVW utiity, to clean the copy and then copy the UVW map channels from the original mesh to the new one where 3dsmx channel 10 becomes channel 1, 12=2, 15=3, 25=4
Yep, I probably need to do something like that.
Seems a bit silly to spread your channels around like that. It's pretty rare to need more than 4 channels, I mostly only use 1-3 shared between various texture laters.
I totally agree. Next time we'll be smarter to instruct our graphics providers better.
Thanks for the valuable input.
Gormio
21-03-2008 13:04:17
@Lioric: thanks for the clarification.
What number of channels do you need?
The available number of channels suffices well. Most of the time one channel is enough but occasionally three or four might be needed.