View Full Version : How can I achieve this effect with OpenGL?

05-07-2013, 01:30 PM

I'm currently working on my program for my bachelors degree: I'm going to do a comparison of various (simpler) ways one could run a gravity simulation (with the most complex being Barnes-Hut ran with CUDA). I'm also including a GUI, witch which I'd like to display the simulation (or a playback of a precomputed simulation). I've got a control set up nicely and displaying the simulation simply as GL_POINTS:
What I would like to have is something like this:
I find the simulation visualizations above absolutely beautiful and would like to know how I could go about implementing them (or something similar to them) into my own program.

05-07-2013, 06:18 PM
These look like they have used a simple colour lookup for each data point and just coloured the vertices. If you don't want discrete points you have much bigger problem because you will need to to create a boundary surface around you data.

05-08-2013, 01:48 AM
If you are plotting points then color coding them could get you closer but there should be so many points in a serious simulation that rendering like this becomes impractical. One option is to construct a 3D texture of density and visualize that using volume rendering, and use a color look-up or ramp on the density (or other parameters like velocity, you are not limited to a volume of a single parameter)

OpenGL only draws the results as you know, for the actual simulation it seems like you understand what you need but it is not directly relevant to OpenGL.