Sign in to follow this  
Battagline

Solar Effects

Recommended Posts

Does anyone have any suggestions of how to make a realistic looking Sun without the use of Vertex or Pixel shaders? I'm writing a space game, and my sun looks rather bland right now... I'm looking for suggestions on how to spice it up. Thanks

Share this post


Link to post
Share on other sites
Quote:
Original post by Moe
Spice it up with a few nice textures and some alpha blending.

How are you drawing your sun right now?


Well, I'm using 4 textures. One that came with truespace, and the others are the same texture just kindof smudged around. I animate the sun by changing the textures every few milliseconds. Then I alpha blend 3 larger copies of the Sun to give it a little bit of a glow. It doesn't look terrible... just rather unimpressive. Maybe I just need better textures, or more of them. But I was hoping to get something that looked kindof like this:



any ideas?

Share this post


Link to post
Share on other sites
Quote:
Original post by demiurgeinc
Damn.. that looks rather nice. Kind of what I want to do next. Right now I'm doing a stupid 2D space game. Next I want to do a 3D space game.


Yeah, I thought so too. This is a screen shot from "Cell Block Squadrons" which is actually an indie game developed by a couple of brothers out of Australia. Check it out if you get a chance www.superfurious.com. One of them has actually helped me a little on my game. My game initially had a 80MB download, and he gave me some pointers that allowed me to get it down to around 15MB.

I may ask how they did this effect, but they're busy people and I hate to be a pest. Hopefully someone in this forum will have some good examples. It's possible that it's just a lot of billboards and alpha blending... but it still looks much better than what I'm doing with alpha blending and billboard. Maybe it's just because my art work is crappy.

Share this post


Link to post
Share on other sites
Wow, that is pretty impressive!

I do think a nice bright corona could add a bit to the look. Either that or crank the brightness of the sun up a bit more. If you think about how bright the real sun is, it is so bright that you can't even look at it for extended periods of time.

Looks good!

Share this post


Link to post
Share on other sites
Quote:
Original post by Specchum
That's a damn nice looking Sun. However, as a suggestion, perhaps you should cut down a bit on the dark bits and have a bit more of fire and orange stuff?


I agree. It looks more like like volcanic activity on a "newborn planet" than a sun.

I'm not sure how much realism you're looking for, but either the screen would be almost completely whiteish yellow (sun + glow), or if light-intensity was turned down (extremely powerful sunglasses) the sun would be completely yellow with some orange and small darker spots (sunspots) and the ship and the background would be totally black. Probably have a lot of glow as well, maybe so much that it would be hard to see the ship.

I think that a middle ground would be best though, and in that case I would have it like it is, but make the sun a lot brighter (almost white, but with a little yellow and darker colors).

If you're not going to use any shaders I would suggest making the sun about this color, and have a little darker spots in the texture. It should not be dependent on light sources (high ambient or diffuse color I think). I would also add a billboard with a corona, to give it a sense of glow.

Share this post


Link to post
Share on other sites
Quote:
Original post by Specchum
That's a damn nice looking Sun. However, as a suggestion, perhaps you should cut down a bit on the dark bits and have a bit more of fire and orange stuff?


I think everyone is misunderstanding the image I posted above... this is a kind of effect I would like. Unfortunately my sun looks no were near that good. I was wondering if anyone knew how to do something like that.

Sorry for the misunderstanding.

Share this post


Link to post
Share on other sites
Quote:
Original post by Battagline
this is a kind of effect I would like. Unfortunately my sun looks no were near that good. I was wondering if anyone knew how to do something like that.

Looks like there are two main graphical effects in that image.

1. High Dynamic Range Imagery - Look at the bits where the white flare (?) is next to the spaceship, the glow it gets/overlaps the foreground slightly.

2. Procedural/Noise Textures - This I can't be sure of, but that "molten lava" like effect looks like it could be done quite nicely with a few layers of perlin noise (of different colours/frequencies) blended together.


Number-1 above can be done properly in realtime on the very high end hardware (those with good floating point texture support), but obviously that limits the number of people that can actually experience such an effect. It can be faked using standard 32bit textures and a few pixel shaders, or (as DrunkenHyena) mentioned, some clever tricks using imposters.

Basically, HDRI gets the glowing effect by splitting the LDR and HDR colours (e.g. takes the very bright sections of an image) and blurs them before adding them back to the image. All as a post processing effect. The net result is that the bright parts of an image appear to glow - and being in screenspace, you get the nice "overlapping" type effect I pointed out above.


Number-2 is a fairly straightforward algorithm, bit more tricky to get done in realtime but still perfectly possible. Procedural textures work quite nicely here - and, if you can crack realtime, then you get easy animation possibilities.. The number of samples required can be relatively small, as you can rely on the hardware to interpolate the results by filtering the texture - so you can get pretty good results with a fairly simple algorithm.

hth
Jack

Share this post


Link to post
Share on other sites
Quote:
Original post by Battagline
Thanks, that's pretty helpful. Is perlin noise difficult to do real time?

No, not really. As I said - you can use the hardware texture filtering to "fake" more information than you have (provided blurry is ok!).

I'd hazard a guess that you could get good results from a 32x32 source texture - calculating 1024 values every couple of frames (or morphing accordingly) probably won't hurt performance too much.

This webpage has a very good explanation of the algorithm. It goes into a lot of detail on interpolation - but that is the part I'm talking about using the GPU to do for you [smile] so you can probably ignore it.

Also, the following from the Graphics Programming and Theory forum FAQ:
Perlin noise tutorial: Fast rendering of (faked) multi-octave Perlin noise textures (by Hugo Elias).
Improving Noise: Paper presenting the new Perlin noise reference implementation (by Ken Perlin).
Perlin noise reference implementation (source code).
Making noise: The history of Perlin noise.

Should be some good reading for you [grin]

Jack

Share this post


Link to post
Share on other sites

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

Sign in to follow this