• Advertisement
  • entries
    232
  • comments
    1463
  • views
    959930

Nebulae, part III

Sign in to follow this  

1087 views

First of all, the answer from the previous journal: the code that generated this strange, mathematical looking image is the following:


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:






Sign in to follow this  


17 Comments


Recommended Comments

Very nice!

My only complaint is that your Bok globules are a little large and tend to over-dominate the visible cross-section of the nebula. But that's really subjective and only based on my (very, very vague) memories of looking at astronomical photos, so take that how you will [smile]

Share this comment


Link to comment
Guest Anonymous Poster

Posted

The video looks incredible.

Share this comment


Link to comment
Woah thats AWESOME!!! Have never seen something amazing like that.
This must look so great in combine with you engine!!!

You are a genius!!

Best of all, it is all mathematical... amazing how much beauty math can have :-)

Share this comment


Link to comment
Holy $h!t!!! You did it! I'm astonished that you've only recently started talking about this and already have something so breathtaking.

Share this comment


Link to comment
In the pics I didn't much care for the black parts, but watching the video, it's just amazing.

Share this comment


Link to comment
Guest Anonymous Poster

Posted

Awesome Awesome Awesome!
But the black blobs really suck and out of place. I think the reason is because you are not sorting and perhaps just blending in negative contribution from these as a last step it looks this way. Could you try reducing their contributing factor much lower?

Share this comment


Link to comment
Hi.

First of all - great work you've done so far.

Working on a similar project myself I had some tries with different approaches on generating nebulae (gas simulation, simulating gravity and last one is attractors).

Here are some screens from my implementation of attractors:

http://www.dqteam.net/img/gg1.jpg
http://www.dqteam.net/img/gg2.jpg

In second one, I've used same params posted by you in IOTD comments.

In previous journal post you've mentioned:

"I've added some code to deform the cloud point with some Perlin noise, to give a "turbulence" effect so that "straight lines" generated by strange attractors appear a bit more natural. Of course, as everything in the algorithm, the amount / type of distortion can be randomly generated to have more variety"

I'm familiar with Perline noise but had no success in adding it to an attractor to disturb those strait lines.

Therefore I humbly request your help in solving this issue :) as your results are great.

Thank you in advance.
Alexandru.

Share this comment


Link to comment
Heya Alexandru,

I can't see your images, it seems to be a restricted area asking for a login/password.

There's really nothing special going on for the Perlin noise deformation. You get a noise value for the x coordinate of each point, another noise value for the y coordinate, another for the z coordinate, you scale those by an arbitrary factor and add them back as an offset to the original point position.

Share this comment


Link to comment
Quote:
Original post by Anonymous Poster
Awesome Awesome Awesome!
But the black blobs really suck and out of place. I think the reason is because you are not sorting and perhaps just blending in negative contribution from these as a last step it looks this way. Could you try reducing their contributing factor much lower?


That's correct, and i even mentionned it in the description.

You have to keep in mind that sorting one million points is going to be slow, and that it's useless in game since you're never going to travel into the nebula as seen in the video: the nebulae will be rendered to a static sky box when you enter each star system.

All that matters at that stage is, does it look good on the screenshots ?

Share this comment


Link to comment
Thanks.

Actualy I've tried such a method, may be I did something wrong, anyway will try it again tommorrow.

As for links try these ones:

http://www.dqteam.com/img/gg1.jpg
http://www.dqteam.com/img/gg2.jpg

----------------------

Found the problem and now the shape is distorted properly.

Here few screens:
http://www.dqteam.com/img/gg1_1.jpg
http://www.dqteam.com/img/gg1_3.jpg

Thanks again for your small but usefull tip.

Regards,
Alexandru

Share this comment


Link to comment
Guest Anonymous Poster

Posted

Quote:
Original post by Ysaneya
All that matters at that stage is, does it look good on the screenshots ?

It pretty damned well does ! ;)
You could try making those black 'clouds' a bit more subtle though. On the first screenshot it looks great, but on the next two it's slightly overdone and distracting if you'd ask me.

Cheers,

P. Janssen

Share this comment


Link to comment

Would it be possible to see a picture with only the "emission" coloring and another with only the reflection coloring?

I am curious about the influence each has on the final render.

Also could you detail the workings of the lookups for the speed and angle?

Is speed simply = previous - current? Is it normalized in some fashion?
Is the angle = acos( normalize( previous - current ) DOT normalize( next - current )?

What do the lookup tables look like?

I apologize for the abundance of questions; the technical details here really interest me.

Share this comment


Link to comment

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

  • Advertisement