Sign in to follow this  
wasssup1990

Best graphics API for scientific purposes

Recommended Posts

Ok I have tried OpenGL 2.0 and Direct3D9 and now I would like opinions on the most suitable graphics API for a physics simulator that I am making. It is scientific kind of simulator. The reason why I am asking this is because I don't know what trouble I might run into if I choose OpenGL or Direct3D down the long road of development for this project of mine. I'm wondering what other scientifically based simulations are using for thier graphics... Your opinions are all needed here! Thanks (:

Share this post


Link to post
Share on other sites
I believe the main reason (for scientific applications) to pick either OpenGL or Direct3D would be the platform where the application will run in the end, which is usually UNIX and so usually OpenGL...

Now it also depends of what kind of hardware you'll target and features you'll want from said hardware. For example if you want tesselation and geometry shaders, I'd avoid OpenGL for the time being until they get more standard/available extensions...

But if you say you're using Direct3D 9.x and OpenGL 2.x, it shouldn't really matter as both have fairly similar features...

Share this post


Link to post
Share on other sites
Thanks Rewdew, full marks on your user rating.

Question:
Can other Graphics APIs be used for scientific purposes other than OpenGL and Direct3D?

Your opinions are all needed here!
Thanks (:

Share this post


Link to post
Share on other sites
If you want to make use of the graphic card accelleration features, I fear that there are no alternatives than OGL or DX. And for scientific applications, I would use OGL for the same reasons already explained by Rewdew: portability of the code.

Share this post


Link to post
Share on other sites
Quote:
Original post by wasssup1990
Can other Graphics APIs be used for scientific purposes other than OpenGL and Direct3D?
*Any* graphics API can be used for scientific visualisation. However, if you want hardware-accelerated 3D graphics, then OpenGL and D3D are your only low-level choices. There are however many graphics solutions built on top of one or the other (or even both).

Share this post


Link to post
Share on other sites
Rewdew already threw up the main question you need to answer to find the answer to your original question: What hardware are you targeting at?

Or to be more specific: Do you only pump out boring gray polygons that lack all kind of eye candy (over exagerating of course) or do you need to impress the viewer's eyes with graphics effects only supported by latest hardware?

If you are to use eye candy that I would strongly recommend using DirectX which works more out of a box as opposed to OpenGL's extension checking and binding stuff. But if graphics effects are none of your concern its basically boils down to which API is a better fit to our own coding style.

Finally, I understand that you are targeting Windows only because on Linux there's no DirectX and you would have to go with OpenGL.

Share this post


Link to post
Share on other sites
Why would you need any graphics API for physics simulation? It's quite unrelated to graphics (apart from being able to actually visualize what's going on, but that's quite unrelated to the core)

Share this post


Link to post
Share on other sites
If you're not too fussed about CPU performance and have no problems with starting using an already existing framework you could have a look at VTK ( http://www.vtk.org ) . Crossplatform and multiple language bindings are available.
Or just to have some comparison ...

Share this post


Link to post
Share on other sites
My 2 cts:

In case of gaming, where you're mostly going to use vertex/index buffers and complex state blocks, I personally find Direct3D a bit better, just because it seems to be a bit more consistent, but the difference between them is really small.

For scientific visualization, I do think OpenGL is quite a bit nicer though, due to it's really easy to use immediate mode (ie, calling glVertex a bunch of times), where in Direct3D you'd have to fill a buffer, with the vertex data, then set that buffer as stream source, and call DrawPrimitive on it (preferably on a bigger set of vertex data, as calling DrawPrimitive again for each triangle or line will be fatal for your performance). This Direct3D model is fine for games, but in scientific visualization, your vertices are more often than not directly generated from code, and also, a slight performance hit isn't the biggest concern, so there I think OpenGL really is quite a bit nicer to work with.

Share this post


Link to post
Share on other sites
i wonder if maybe you aren't thinking that perhaps you need something like ray-tracing to show a more accurate and real relationship between objects.

if you are only wanting to show a close representation of data then the render method you choose shouldn't carry too much weight apart from what has been mentioned about portability, as long the the underlying data being referenced is correct. trying to take measurements from a visual representation is probably a bad bad way to go if that's what you are thinking though.

Share this post


Link to post
Share on other sites
wasssup1990, from my experience thus far in the scientific community, OpenGL seems the most dominate due to the widespread use of Linux (clusters, etc). The ability for platform agnostic code is obvious important when collaborating with many individuals.

Depending on what you are doing, visualization software such as IDL or Matlab might be more suited to your needs. It does all the heavy lifting in the background for you, so you can do your visualization without the tedium of graphics coding. AFAIK, they have dll's which can be called from C++ code so your backend can remain as is, with a, for example, matlab supplied front end.

Share this post


Link to post
Share on other sites
Thanks for all of your replies! You all get full marks on your user ratings.

I have chosen to go with OpenGL, and this time I'm sticking with it.
See ya.

Share this post


Link to post
Share on other sites

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