Improved Starfield !!
BlitzMax Forums/BlitzMax Programming/Improved Starfield !!
| ||
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? |
| ||
Draw a slightly larger alpha and light blended version over the top of the star or do the same with a 'twinkle' image. |
| ||
I spin my stars and scale them up and down slightly. Looks nice. |
| ||
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. |
| ||
I would probably just animate the color that you set before drawing each star, perhaps from a precomputed array of slightly randomized colors. |
| ||
@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! |
| ||
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? |
| ||
It's really the same suggestion as SSwift : Thought it would look better than that though. |
| ||
@tonyg: Modified your version slightly. |