Something interesting was happening to my craptacular low poly meshes with equally craptacular low res textures I'm trying to tile on them.
I have a very simple rock outcropping mesh, and I exported it with a planar uvw mapping tiled x amount of times.
The model was brought from .x into our inhouse 3d format and displays the tiled texture just fine. But when we loaded the model into the game engine on device, the textures don't display properly anymore... in fact... we're not even sure what part of the texture it's displaying, but it looks extremely zoomed in on like a square of 10x10 pixels.
One of the developers opened up the .x file and mentioned the texture coordinates were not unit vectors (and perhaps the vertex coordinates as well) of numbers less than or equal to 1.
So if that's the case, is this one of those crazy things reset xforms fixes?
I created a box, edit poly, and attached the mesh in question, deleted the box (reseting xforms essentially) and rexported... and compared the numbers myself and looks like the numbers have magically become the delicious unit vectors that the devs are seeking.
edit... okay that didn't seem to work either, I'm at a loss to what could be effecting this, if it is at all a mesh problem or if it's an engine problem. I've tried both planar and box uvw mapping and neither seemed to work, and dev wants to tile a texture on the mesh, rather than having an unwrap... they want to scale the meshes and not have pixelation issues with the textures.
the textures display fine in max and our python editing tools. The game engine is java, and the only one of the 3 having issues with these objects.
Replies
If you use a single triangle, it's much easier to look at the coordinate data on those three verts and compare it between the four stages. Where does the data break?
Reseting xform seemed to not do anything, though it did seem to clean up some of the coordinates, the effect remains the same. But I'll try sending them a triangle like you suggested and see where it leads, some of these meshes aren't even more than 20 triangles. It's been labeled a low priority task though since they're trying to touch up the AI and physics so they can start playtesting.
Which means I get to sit around and do nothing
beyond .x, it's being converted to the inhouse format, but we're we know the info is intact because our python level editor shows the models properly.
At that point that is where my knowledge ends, if max is telling me it's right, and our editor is telling us it's right, there must be something on the java side that either doesn't like what we're doing (not supported or being picky) or max and python are lying to us. :P
I'm using kx xport to do the .x files if that helps at all.
Reset Xform doesn't affect the UVs at all, it only helps reset the transform data for the model, which can get screwy if you do non-uniform scaling or if you mirror the model (which is basically just a negative scale).
If your devs are saying texture coordinates have to be between 0 and 1 only, then that means you can't tile. You will have to create all the UVs in the 0-1 box. If you want tiling, you'll basically have to tile the mesh instead of the texture, subdividing the mesh.
But could you explain why if the UVs aren't tileable if the unit vector coordinates can't exceed 0-1? Is that a representation of where the texture coordinates are mapped to the actual texture file? So in going over 1 that means that the coordinates exist outside of the texture space?
edit: and that's exactly what it is... thanks for the help Eric... looks like J2ME does not support tiling textures... (lame) looks we'll have to figure out some other way... and by we I mean ME. :P