Sign in to follow this  

X Meshes?

This topic is 4840 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

As far as I know Xmeshes are sometimes used in the beginning of the development.

The disadvantages are that everyone can read an xmesh(no protection of 'your own' meshes) and that you want to add data that's not yet avaible.

But Xmeshes are perfect to start with.. once you see some disadvantages you can always create your own or add information to an xmesh.

Share this post


Link to post
Share on other sites
DirectMesh is a very easy-to-use model format (it doesn't support skinning, yet). The SDK includes complete documentation, samples, and tutorials. Unlike other file formats, DM is completely documented and open-source.

Professional developers do not use X-files, unless it's very early in the developement timeline. Most houses have their own custom model format.

Share this post


Link to post
Share on other sites
I think you might want to think of it this way. If you're just starting out, then the X File format is a good way to learn a how a well developed format provides skinning and hierarchical animation support. This allows you to implement your own hierarchy for transformations and perhaps attachments all the while being insulated from the implementation details of skinning (i.e you just call UpdateSkinnedMesh and supply your transformed bone matrices and vertices and it does the rest).

If you seperate this out correctly, then you could write classes that supply interfaces that can be used throughout your code. Then, when you choose to design your own format later you only need to change the implementation of these classes to your own and remove all the DX stuff. You'll probably want to place all file handling stuff in a seperate class as well (CMeshFileParser for example).

Of course, if you wanted to use X files for your entire development (you might be making a small or independent game for example) you can always pack those X files away in a virtual file system or .pak file or something similar. DX comes with a lot of useful functions for X files so I can see why one would want to use it for such a project.

Share this post


Link to post
Share on other sites
Quote:
Original post by Redline
Of course, if you wanted to use X files for your entire development (you might be making a small or independent game for example) you can always pack those X files away in a virtual file system or .pak file or something similar.
VFS's are a very useful feature of many modern-day engines (ie Quake(s), Half-Life(2), Farcry, ect...). Although pretty complicated to implement, they can be a great tool. Here are some articles on them:

Creating a PAK File Format
Programming a Virtual File System (1, 2, 3)

Share this post


Link to post
Share on other sites
Quote:
Original post by DarkZoulz
Is there any point in creating a custom mesh format? .x files seems to be very versatile or? Do professional developers use them?


Well pros do and do not use them. I've seen one development house that actually uses x files, but they dont use the standard xfile templates. They do use all the parsing iterfaces that come with d3dx though, since that's a big time saver. So that way, you couldnt really open *their* xfile since it didnt use the standard d3d templates. But I suppose most pro developers have their own format.

Quote:
Original post by DarkZoulz
In a learning point-of-view, x meshes does not seem to reveal much of the inner workings. Can anyone recommend a easy-to-use format for skinned meshes.


I don't know if anyone has documented the doom3 file format yet (md5 i think?) but i remember people trying to figure it out on some board and another person that got to rendering the bones. You may want to search around for that. And I dont know if there are any *easy* to use formats.

Quote:
Original post by circlesoft
DirectMesh is a very easy-to-use model format (it doesn't support skinning, yet). The SDK includes complete documentation, samples, and tutorials. Unlike other file formats, DM is completely documented and open-source.


niCe!! This is a really nice effort on your part cs. Any eta on skin mesh implementation in DM?

Share this post


Link to post
Share on other sites
The Cx File Format supports skinning information (and skeletons, and animation, and materials, and other stuff); it comes with a 3dsmax exporter and a RenderMonkey importing plug-in. It comes with MIT-style licensing. It does NOT come with code to load and render it, other than what's in the sample command-line dump tool, and the RenderMonkey geometry importer (which is enough to see how it works).

Share this post


Link to post
Share on other sites
Of note, .X is not only a format but it is a customizable format and is extremely versatile. I'm not sure that you'd need a custom format when .X is already providing you with the ability to customize it to your hearts content, with custom templates, as mentioned above. I discovered entirely by accident that if you include custom templates in your x files, any x file reader that doesn't support those templates will choke on them, making them more or less useless outside of your program.

Other ideas which I haven't taken the time to implement in any way:

1. 3dsconv can convert .3ds files into either text or binary format, but can't convert to binary "out of the box" if you're using custom templates. But I'm sure it can be rewritten to support your custom templates, so if you're using custom templates in binary format x files, users will not have the ability to open a text x file and simply remove any information related to the custom templates so that they can load it in a typical x file reader.

2. I'll bet you can append all of your x files into a single file so that to read them you'll need knowledge of how much data to process for each different file. Combine this with binary x-files (see above) and you have one large binary file that isn't human readable and is probably more trouble than it's worth for users to hack.

3. I've never done this but I'm sure there's a way to imbed your x files right into an executable so that they're not available outside of your app at all. Can anybody tell me how to do this? Combine this with #2 above and it really seems like less work for users to create their own .x files than to steal yours.

4. You can always rename your x files to something less enticing than .x.

5. Data encryption? I don't even have time to play with this but using data encryption I'll bet that you can make x files readable only to users with a decryption key, which of course would only be available with the app they were packaged with. I have no idea if this would work as I'm only vaguely familiar with data encryption.

Share this post


Link to post
Share on other sites
Quote:
Original post by DarkZoulz
Is there any point in creating a custom mesh format? .x files seems to be very versatile or? Do professional developers use them?


some companies use .X files for importing geometry. This way they don't have to spend time writing their own exporters for Max/Maya,etc. Then they simply dump the mesh out in their own format.

A lot of developers prefer to chunk their files. simply by loading everything into an array. that way you don't have to parse anything or do any CPU comps doing loading. additionally, most developers have grand dreams for their engines- they want their stuff to run on PS2, xbox, etc. for ex., just the other day our producer told us he wants our engine to run on Nintendo DS, xbox, PS2, PSP, ARM 9 machines, etc. so i think that is the only reason some devs continue to write their own.

[Edited by - vajuras on September 15, 2004 9:27:29 AM]

Share this post


Link to post
Share on other sites
Quote:
Original post by DarkZoulz
In a learning point-of-view, x meshes does not seem to reveal much of the inner workings. Can anyone recommend a easy-to-use format for skinned meshes.


Glad you asked :)

I have written some tutorials on creating your skinning animation formats from scratch.

Creating Exporters for 3DS Max
Software Skinning

The software skinning tutorial teaches how to transform bones/vertices from software (not using the GPU). however, once you master this topic you could easily transfer the code over to shaders.

Share this post


Link to post
Share on other sites
Quote:
Original post by IFooBar
niCe!! This is a really nice effort on your part cs. Any eta on skin mesh implementation in DM?
The next big release of DirectMesh will be skinned. Unfortunately, this means a change of file format specs, but it's neccessary. I went with keyframing for the 1.0 Beta simply because I didn't want to take too much work on (creating a file format, making samples, documentation, exporter, AND skinning).

Share this post


Link to post
Share on other sites

This topic is 4840 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this