Visualising scientific computations in 3D

Hi, I’m working in the field of computational science and now I’m implementing computatational and visualizational core for quite a complicated model of growth process.
Visualization in 3D is quite simple from theoretical point of view. In the size of the task is N, thin I have to draw big cube, which consists of NNN small cubes. All my science is in founding the color of each small cube :slight_smile: There are a lot of small cubes, which I haven’t draw at all (this means that there is no materia in corresponding point).
You can predict my question: drawing is awfully slow! Even for N=200 redrawing takes 15 seconds on my dual core Athlon64 X2 4800+ (NVidia 6600 256 Mb). I need some recomendations, how to speed it up.
Does the order of x, y, z axis traversal matters? Does blending slowing all down? And the most important: how can tell OpenGL not to drow small cubes, which are hidden from the user of my software by other cubes (which are close to the viewpoint).
Thanx a lot for any suggestions,
Dum

Usually this kind of visualization is done using 3D textures. Try to google for “volume rendering”.

Basically, you upload your color data to a 3D texture, and then you render parallel polygons “cutting” through your data. This way you get away with rendering only a few hundred polygons, instead of millions, and you get linear interpolation for free :wink:

  1. For Speed, Try display lists or VOB, read out there limitations and capabilites.

  2. For not displaying hidden cubes, search “Hidden surface Removal” as a key word in google. This is very much required to reduce the number of polygons and to speedup rendering process

Thanks
kumar.k

Dum, kumar’s advice is a bit too generic, although ultimately you may want to use those techniques it’d be a classic case of ‘premature optimization’. Go with overmind’s suggestion & search for “volume rendering”. You may also want to investigate isosurface extraction “Marching Cubes” but it depends on what kind of rendering you are looking for.

[http://www.cs.utah.edu/~jmk/sigg_crs_02/courses_0067.html](http://www.cs.utah.edu/~jmk/sigg_crs_02/courses_0067.html)    

There are also off the shelf libraries and products both commercial and free for processing and rendering scalar volumes such as yours that you may want to explore. For example:

http://web.mit.edu/jmorzins/www/volpack.html
http://www.slicer.org/

http://www.idoimaging.com/cgi-bin/imaging/program.pl?ident=139

I did a quick search and I’m surprised by the dearth of good software and proliferation of dead links. Things used to be better. Maybe I’m looking for the wrong stuff, in anycase you have enough to be getting on with.

Good luck.

Thank you all very much. I’ll think.

I have looked at links you sent to me and now, please, let me reformulate my question, according to what I have understood.
All of the tools I found are dealing with the data sets, which represents (in our domain) some computed solid. So, they are most suitable to VISUALIZE THE RESULT OF SCIENTIFIC MODEL.
I need to represent my solid DURING the computations (now computational step takes less time than drawing after the step). So, I do not want to build descriptive data set after every step of modeling, this this slow me code even more, but I want just to optimize my drawing routine. Do you know any library, which can help me or, probably, some can take me with the advice?

Dum,
As far as my knowledge there is no lib to optimize the drawing routine its more to do with your own way of showing the data quickly during the computations, and is individual representation and varies from one solution to other.

For example; google earth or online maps has got vast geometry to be rendered and has even got even computations(when you rotate,zoom,translate). When ever user changes the view by computing the new vieweing angle, first it wont load the entire geometry, what it shows is a blur image tiles which gets dowloaded slowly and loaded tile wise. In this case you can see that they are not making users to wait to finish the render process,They are several smilar cases like this example in the area of image processing where the computation takes very less time when compared to rendering, you should solve this with some kind of solution.

One more example for this is when we used to render large CAD geometry with millions of triangles, during the rotation or scaling with mouse move ,instead of applying the transformations to entire geometry , we render only exterior geometry with fewer polygons and then once the mouse button is UP and released then the transformation is applied to full geometry and displayed. This is some kind of techique followed in volume rendering and large data visulaization.

Try to find out smilar kind of solutions for your problem instead of searching for already avaiable lib for doing it.

Once again please study concepts like :–

VBO.
ViewPorts tileing.
Display lists.
Hidden surface Removal.
Incremental Rendering.

I am still new to graphics and in process of learing it extensively. I would like to see others replies to this. What i told might be a ‘premature optimization’ as dorbie said.

Thank you, Kumar K. I’ll be thankful for more comments too. Have anyone been doing things like this.

If you want to visualize a 3D grid of colors, i would do direct volume rendering(upload the grid as 3D texture and draw about N textured slices with alpha-blending).

To speed things up, you could easily reduce the resolution by 2(or 4 or 8) in each dimension before uploading it as texture. I think 64^3 - 128^3 should be maximum resolution you could show as “kind-of interactive” with a 6600GT that way(while the data remains static).

That is if your are interested in seeing the inside of the grid.

If you only want to see the opaque surface, extracting the visible triangles should be faster. Look for “Raycasting” for a start.