Jump to content
  • Advertisement
Sign in to follow this  
soofian

[.net] how to improve performance

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

i m working on C# with OpenGL. i have drawn some molecular views based on cylinders and spheres(3D objects). in fact i stored every atom as object. if 2000 atoms are there then 2000 objects are allocated space in memory with its member data types(like int, string etc). the problem is that when i render the image it is taking alot of time and transformation is also very slow. tell me is this a problem of memory or something else?

Share this post


Link to post
Share on other sites
Advertisement
Without looking at your source, I'd say it has to do with how you render your geometry, as opposed to how you store it.

Are you using textures? If so, try to draw all the parts with the same texture at the same time - flipping back and forth between them is expensive.

Also, are you using index buffers? If not, that should speed things up.

If the whole molecule isn't always visible at the same time, you should add frustrum culling.

Just a couple of thoughts. Depending on what you are doing, you might find it easier to use a pre-existing 3D engine (like Ogre) rather than deal with these issues yourself.

Or it could be that your hardware is 4 years old. Try cutting down on the number of subdivisions in your cylinders and spheres. If that makes your program run faster, you need a new video card.

Share this post


Link to post
Share on other sites
Are you rendering the particles from a static vertex buffer or updating the vertex buffer every frame?

Try to use the writeonly flag if you are updating your vb dynamically, and use the sliding window approach with nooverwrite for updating while you're still rendering from parts of the VB.

I assume you're not rendering each particle individually [grin]. And I agree with Telemon's suggestions.

Good luck in solving your problem!

Share this post


Link to post
Share on other sites
I would guess the problem is with the draw calls. You can't reasonably expect to get even average performance with 2000 draw calls per frame, as I am guessing every object is rendered by itself.

nVidia recommends a maximum of 1000 draw calls per frame and that is really pushing it and you must have top end hardware. You need to batch render or use instancing if you want to reasonably render 2000 objects. If you have more than 800-1000 draw calls per frame than you are not rendering optimally for the hardware and are completely stalling the pipeline with the CPU.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!