Improved Starfield !!

BlitzMax Forums/BlitzMax Programming/Improved Starfield !!

Scaremonger(Posted 2008) [#1]
I'm trying to get a starfield background to look a little more interesting. Can anyone suggest a way to make them twinkle, or glow, or something that might look better? (and yes, i know stars don't twinkle in space).

In the example below; stars are game objects of a random colour simply plotted to the screen.

Any idea's?




tonyg(Posted 2008) [#2]
Draw a slightly larger alpha and light blended version over the top of the star or do the same with a 'twinkle' image.


sswift(Posted 2008) [#3]
I spin my stars and scale them up and down slightly. Looks nice.


Czar Flavius(Posted 2008) [#4]
Stars look different the closer the are. A random size might help but try this kind of effect if you can:

(the fact it's about a neutron star isn't significant, it was just the first google image result that fitted my point :P)

And no ' in ideas.


ImaginaryHuman(Posted 2008) [#5]
I would probably just animate the color that you set before drawing each star, perhaps from a precomputed array of slightly randomized colors.


Scaremonger(Posted 2008) [#6]
@tonyg: Do you have a sample?

@sswift: Scaling them randomly makes them twinkle nicely.

@Czar Flavius: I wish I could figure out how to produce that!

@ImaginaryHuman: Strangely that didn't make the stars flicker much!


Scaremonger(Posted 2008) [#7]
I've coded in a random speed for each star relative to the players ship to give a perception of depth, and incorporated sswift's scaling idea for the twinkle.

Improvements anyone?




tonyg(Posted 2008) [#8]
It's really the same suggestion as SSwift :

Thought it would look better than that though.


Scaremonger(Posted 2008) [#9]
@tonyg: Modified your version slightly.