Jump to content
  • Advertisement
Sign in to follow this  
laeuchli

Twinkling stars

This topic is 4008 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Dear All, I'm trying to make the stars in my night sky twinkle, but I'm unsure how to do this. My initial idea is to pick a star randomly, and change is brightness/size with sin(so have it brighten, then fade back to normal). Anyone try anything like this, or have a better suggestion? Does anyone think the color should change? Just looking for some tips before I start coding random things ;). Regards, Jesse

Share this post


Link to post
Share on other sites
Advertisement
I don't think fading in and out using a sine function will look right. I think it will look more realistic by simply changing the brightness and/or color of random stars very briefly.

Share this post


Link to post
Share on other sites
Thats doubtless what I'll end up doing, but it must be something lots of people have tried, so I'm just wondering what people found that looks convincing.

Share this post


Link to post
Share on other sites
Quote:
Original post by JohnBolton
I don't think fading in and out using a sine function will look right. I think it will look more realistic by simply changing the brightness and/or color of random stars very briefly.

How about sinn where n >= 2 is even (perhaps p ~ 10)? This will produce nice sharp infrequent peaks but maintains continuity [smile].

Admiral

Share this post


Link to post
Share on other sites
I don't think anything regular will produce good results. I would try something with Perlin noise, perhaps raised to some power like TheAdmiral suggests, or just passing it through a piecewise linear transfer function, which gives you much more control. You can apply these modifications both to intensity and position.

Share this post


Link to post
Share on other sites
For those intrested, a small chance every so often to increase the star size by 10% for half a second looked pretty convincing to me. I dont spend that much time star gazing though, so your milage my vary ;-).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!