for (TUInt k = 0; k < 128; k++){ for (TUInt j = 0; j < 128; j++) { for (TUInt i = 0; i <128>) { SVec3D pos((TFloat)i / 127.0f, (TFloat)j / 127.0f, (TFloat)k / 127.0f); pos = pos * 2.0f - 1.0f; m_sprites[1]->addSprite(pos * 20.0f, SColor(1, 1, 1, 0.25f)); } }}
As you see, it simply creates a 128 * 128 * 128 voxel grid and generates one particle / point sprite for each cell. Nothing more. I'm guessing the strange looking aspect is coming from the particle texture ( which is smoke like ).
Going back to the "serious" stuff: i've been playing with various ways to light the nebulae. Before, each particle of the nebulae had its own color. That would make what is called "emission nebulae", ie. nebulae that emit lighting due to ionization of their particles when receiving light. What i've implemented now is "reflective nebulae", ie. a nebula that reflects color of the nearest stars, so it takes into account the position, distance and color to each star.
I've also added negative blending in order to simulate black dust / bok globules. The drawback is that, as there is no sorting, it can look a bit weird if you move quickly in 3D ( as in the coming video ), but in a sky box it won't be noticeable.
A very short video ( a few seconds long only ) is available here:
http://www.fl-tw.com/Infinity/Media/Videos/Infinity_nebula.avi
The nebulae are now considered close to being "complete". I still have some things to fix and redesign some code a bit, but the graphical aspect won't be improved much.
And, of course, mandatory screenies: