Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Fuzztrek

Mesh questions

This topic is 5671 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

Hello All, I''ve completed a XFile loader that loads both standard and skinned x files. It uses D3DX functions, and is based off of the "skinned mesh" example in the SDK. Currently I get 130 FPS rendering "tiny.x" (from the SDK) using an index buffer and vertex shaders (ie indexedvs in the skinned mesh example). I''m wondering if I could possibly get higher frame rates, because if I add another "tiny.x" to my program the frame rate drops more than half, to 60 FPS. I assume that if I had 30 meshes on the screen, the frame rate would be rather low. Is there some way that I can increase performance in my x file loader? If I load it manually, and handle everything manually (this may be nieve of me to ask, because I have no idea how I would do it, though I have loaded other types of models, with much help ), will the frame rate increase? Well, I know the loading doesn''t have much to do with it, but if heard that drawsubset is rather slow, so I assumed that if I loaded it differently I could just use drawprimitive. Which, again, I have no idea how to do but I''d like just like to know I''d also like to know about any other formats that are out there. I''ve only ever heard of x-, md2- and md3-files. What other types are out there? What are their advantages/disadvantages? I should really look at "Focus on 3D models". Any information is greatly appreciated! Thanks in advance. ¬_¬

Share this post


Link to post
Share on other sites
Advertisement
I don’t know the difference in performance between using D3DX and manual. But I wanted to at least point you to this article:

http://www.mvps.org/directx/articles/fps_versus_frame_time.htm

that describes why it can be bad to judge your performance based on FPS.

You should probably also list your system specs: CPU speed and graphics card.


[edited by - JimH on February 8, 2003 5:53:04 PM]

Share this post


Link to post
Share on other sites
I''ve actually read that article before, however I still think measuring FPS is a fairly good way of scaling performance.

My system specs:

Pentium 3 733 MHZ
512 MB ram
64 MB VRAM - GeForce 4 MX 440

I get the same frame rates with my program compared to the dx sample program, however I''d still like to know how I can increase performance.

Thanks for responding!

Share this post


Link to post
Share on other sites
Aside from possible optimization issues with DrawSubset, there is almost no correlation between performance and file type.

Try this: get the pointers to the mesh''s vertex and index buffers. Set a material and a texture and draw using everything in the index buffer (use mesh->GetNumFaces, etc. to get the values for the parameters of DrawIndexedPrimitive). Chances are that your meshes will have badly textured or colored regions, but you''ll get a rough idea of performance that it independent of DrawSubset.

If you notice a dramatic difference, two possibilities:

1. Optimize the mesh (look in the docs) - draw subset isn''t inherently slow, you need to optimize your buffers (which is a good idea anyway).

2. In my test above, I said to use one of the textures. It''s possible that some other texture is much larger and affects performance. If there is only one texture for a given mesh, this is not a factor.

Author, "Real Time Rendering Tricks and Techniques in DirectX", "Focus on Curves and Surfaces"

Share this post


Link to post
Share on other sites
My 2 cents:

1. The X File format is a generic format, thus it''s not optimum for specific projects. The generic thing affects the loading time, mainly.

For your game/engine, it might be better to work with any format you like until the "final" shipping, where you use a specialized mesh format that is optimized for your specific case.

2. DrawSubset will set the stream, index buffer, and the declaration for each call, which is somewhat bad.

Share this post


Link to post
Share on other sites
Using your quoted rendering times, each model costs about 9ms. What kind of hardware do you have and how complexed is the model?
Other formats:
Md2 is too restrictive for now days. It is frame based and has 256 possible vertex positions per axis per frame making detail hard to attain. The original md3 format was an almost upgraded version of md2 with tags so head, body and legs could be seperate. I think bones were added in team arena. You can always make your own. Milkshape is a nice and simple shareware modeler and those models could always be used though animation could be dodgy to build if you want the one model to hold it all.

Share this post


Link to post
Share on other sites
Thanks for all your input! I will definatly take this all into consideration, and I''ll be experimenting with fileformats and rendering methods in the future.

Thanks again!!

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!