How to do glowing?

hi

Im my new space simulation I want to render several stars in a galaxy. Of course theses stars shall glow so that they look like real stars. In the solar system view the sun sphere shall glow too.

How can I achieve this? I found nothing in the Xith3D demos or in this forum.

Qudus

What I do is modify the emmisive color for the objects in question. I am guessing so simply want some eye catching color, not to actually say illiminate a solora system.

yeah - setting the emisse color is it, but you don’t get any light effects with that.

I got no effect setting the emissive color. Sorry. Here is my code sample:


Sphere sph = new Sphere(10, 10, TriangleArray.COORDINATES | TriangleArray.NORMALS, 1.0f);

Appearance a = new Appearance();

ColoringAttributes ca = new ColoringAttributes();
ca.setColor(new Color3f(0.91f, 0.27f, 0.27f));
a.setColoringAttributes(ca);

Material m = new Material();
m.setEmissiveColor(new Color3f(1, 1, 1));
m.setColorTarget(Material.EMISSIVE);
a.setMaterial(m);

sph.setAppearance(a);

hope you can see my problem in it. Thanks.

A real glow is a little more complicate then setten any material property because the glow effect is larger then your object and has to iluminate also the area around your object.

You may get some ideas how to do it based on this nVidia article: http://download.developer.nvidia.com/developer/SDK/Individual_Samples/featured_effects.html#corona

What you are probably after it a glowing halo around the object, to do this, you can use a billboard with a texture with alpha on it and set an emissive colour on that. Lesson 44 on NeHe goes alot further and shows how to do lens flare. But the basics are the same.

HTH

Endolf

Looks sweet. The corona is exactly what I want in my solar system view. And the tonemap effect could be the one I’m looking for for my galaxy view. But there isn’t any code. So I can only get the information that it’s possible.

I think this really is the right effect for my systems in the galaxy view. But it’s highly complicated and I don’t understand too much of it (There’s a reason why I don’t use Jogl but Xith). But it looks like some kind of standard coding for such an effect. Isn’t there anybody out there who has already done this for xith and is in a good will to share this piece of code with me? The Textures don’t look too complicated, so I think, I can make them with The Gimp. But the whole coding is too heavy for me.

Since I don’t understand the whole code, could you please tell me, which part of it is useful for my target. You said, it went a lot further.

In geat gratitude,

Qudus

I think I got it! Basically it’s just a plane always facing the view’s center with the glowing flair on it.

Am I right?

And this is quite easy. I got really nice results.

Thanks anyway.

But the corona-effect is still interesting and I don’t know how to produce it.

Qudus

Hi

Yup, thats exactly it :slight_smile:

I believe the effects that were linked, i think, are nvidia specific, although I’ve not looked that deeply, so putting those in would mean that only players with nvidia cards would see the effect.

I could be wrong on that last point though, like I said, i’ve not looked :slight_smile:

Endolf

I was wrong, they are directx specific, but work on any DX9 card

Endolf

Hi

Me again, it looks like you may be able to convert some of them from HLSL to GLSL using this, but i’ve not checked.

HTH

Endolf