View Single Post
Old 04-17-08, 11:04 AM   #554
skwasjer
The Old Man
 
Join Date: Apr 2007
Location: Netherlands
Posts: 1,547
Downloads: 26
Uploads: 3
Default

@DeepIron, you can download a 'private' v0.8 release a couple of posts back. You can install it next to v0.7.x.

@Anvart, heh, you again

I'll explain, I don't do real crazy stuff, but S3D does have to 'optimize' what it reads in from the different files. I named it 'optimize' just to keep it simple for everyone, but here's the technical reason:
  • Each file contains it's own list of texture coordinates (Vector2's)
  • Each file contains indices into that list
  • OBJ has string to/from float conversions (loss of precision)
  • UVW has binary floats (no loss of precision)
The problem is, all the texture coordinates must be put into one big list in the DAT-format as you know, and they are referenced by indices. But when I import each channel, I can't just build a big list by adding all the Vector2's and indices from all the imported files. You will end up with duplicate Vector2's in most cases, and you will very soon hit the 64K limit of allowed UV indices. So S3D removes all the duplicate Vector2's, and updates the indices table accordingly. This is the whole point of the 'indices' table, to reduce file size/memory usage (instead of having unique Vector2's for each and every vertex). It's just a form of compression/optimization.

As far as my original comment (the high precision): since floats are converted to/from strings (for OBJ), you lose some precision. But .UVW files are binary, so they don't lose precision. Comparing between all these Vector2's (to find duplicates) then becomes a problem if some digits have been cut off. With higher float precision for OBJ files, there will be more matches so smaller file sizes/less
memory usage for the game, and a lesser chance of hitting the 64K limit

Even when not using .UVW files but only .OBJ, optimization is still needed because, you can still have duplicates. Only you won't have a problem with precision, as long as they are the same for all files.

Anyway, like I said, it's an experimental release, and I really need feedback from 'the field'. So pleeeaaasseee try it out...

PS: this all wouldn't be necessary with formats like Collada
PS2: you may wonder then, why even include float precision as an option, why not just force high precision. Well, I provide it as choice. The default settings work best in my tests, but you can always choose otherwise...
PS3: Oh and yea, S3D only exports USED Vector2's in each channel, not the whole list (aka. unused ones). There's no point in exporting all the texture coordinates if they are not used for 'a channel', and there's no guarantee you get all of them back in one file either. Hence, the optimization feature :p

Last edited by skwasjer; 04-17-08 at 11:16 AM.
skwasjer is offline   Reply With Quote