GSnap, Polished

While preparing a paper introducing GSnap to the world, I have refined several of the features. The code has also become more modular and the source documentation is now more detailed. Here's a brief overview of what has been done:

Used the Qt Framework's QtScript functionality to add a nice scripting interface. The base scripting language is ECMAScript (JavaScript). This is augmented with custom functions which manipulate GSnap's internal objects.

Re-implemented the depth of field effect as a separate class rather than a large, complicated member function of the volume rendering class. The new depth of field effect uses a faster Gaussian blur algorithm and produces much better results because larger blur radii are now practical.

Improved the performance and memory usage of the volume renderer for a given quality level by using a std::priority_queue to accelerate the neighbor search. This allows higher-quality volume rendering in a reasonable amount of time.

Finished the gas temperature computation and color mapping feature.

Redesigned the snapshot I/O to make it easier to add other snapshot format readers.

Added a new visualization option, "--view stars," which is intermediate between "--view particles" and "--view flux." Star particles are rendered as points, but they are rendered in the context of the volume renderer. This means that interstellar dust is able to obscure and redden the starlight. The results are somewhat similar to Sunrise output. This option is better than the "--view flux" option for simulations containing hundreds of millions of billions of star particles

In addition to that, many of the code formatting rules are now automatically enforced using AStyle and the coding guide now discourages the use of exceptions and RTTI (as do Google, the LLVM project, and others). Several GCC-specific features have been exploited in order to improve the performance of the code when it is compiled with g++. Overall, the final binary file is smaller by about 30% and the volume rendering code runs about 10% faster just because of the GCC-specific pragmas and function attributes combined with the set of compiler flags that are now used. The performance of the velocity dispersion statistics functionality improved negligibly. The "hot" and "cold" function attributes were particularly helpful.

Here are a few sample renderings...

First, a demonstration of the improved color mapping and depth of field features. The gas in the foreground galaxy is in focus while the gas in the background galaxy is blurred. This draws attention to the foreground object without the need to remove the background object from the scene. Also, note: dark red = cold gas, white = warm gas.

Without the depth of field effect, your attention is not as focussed on the foreground object, since the background object is equally in focus.

Of course, foreground objects are also blurred. This is the same system as above, but rotated so that the background object is now in the front:

The effect works equally well with visual renderings:

Now, here's a demonstration of the new --view stars option without including any gas in the rendering:

That's pretty basic. Including gas (and dust) in the rendering process makes this looks more like a galaxy:

But in a real galaxy, you can't see the individual stars like this. In fact, the particles in the simulation don't really represent stars; they are more like tracer particles which represent the density field in a statistical sense. For a more realistic representation, we use the full volume renderer, which smooths the particles into a continuum:

For a bit more fun, we can look at the gas distribution, and then do some post-processing. Here's the gas by itself:

If we add the gas image to the star image using photo editing software like ImageMagick, GIMP, or Photoshop, we get:

The distribution of stars relative to the gas is interesting. Finally, if we add the dust-attenuated star image to the gas image, we get this nifty looking rendering:

This entry was posted
on Sunday, September 8th, 2013 at 3:46 am and is filed under regular update.
You can follow any responses to this entry through the RSS 2.0 feed.
You can skip to the end and leave a response. Pinging is currently not allowed.

Our education is makes us emerge from whatever remains of the world. Individuals give more significance to the informed persons. It acts as a scaffold in the middle of us and the objectives and goals of our life.

All the health related fields of education are very important in our life because the health of all living beings depend on this field owing to the wide spread diseases and health problems. Our good research paper title will emphasize on the importance of medical education.

Just two years ago, virtual reality (VR) was the chosen one of the VR/AR tech pairing, and Pokémon Go was nothing but whispers and safely-guarded intellectual property. Back then, it seemed as if only futurists were bullish on augmented reality (AR), the offshoot of VR that places virtualized objects into real environments. citrusbits.com/augmented-reality-developm...