Jump to content
  • Advertisement
Sign in to follow this  
nini

HowTo display an halo like the atmosphere around a sphere ?

This topic is 4811 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

Hi all , i would want to know how to proceed to display an atmosphere around a sphere object , i care only about the result of a blue gradient that fall into transparent. I don't want any physics , perhaps pixel shader / vertex shader ? thanx for your help in advance

Share this post


Link to post
Share on other sites
Advertisement
Maybe billboard a quad with a transparent texture in front of the sphere. The texture could be of a ring, with a gradient from blue (rim) to transparent (center). Take care to always billboard it in front of the sphere, and it will look fine from any angle. Being only one quad, it is also very cheap performance-wise.

Share this post


Link to post
Share on other sites
Quote:
Original post by Peregrin
Maybe billboard a quad with a transparent texture in front of the sphere. The texture could be of a ring, with a gradient from blue (rim) to transparent (center). Take care to always billboard it in front of the sphere, and it will look fine from any angle. Being only one quad, it is also very cheap performance-wise.


Thank you , i think i will try this , as you say this is cheap and i like when things are cheap for my poor GPU ;-)

Share this post


Link to post
Share on other sites
Why not build a triangle strip in a ring with the inner vertex colours blue, and solid and the outer vertices blue but alpha'd?

You could then pass a parameter in to the build or render function with the radius, perhaps even the vertex colours too for the inner and outer. Then you can use it on any sized sphere with no trouble at all. You might want to specify the outer radius too perhaps.

This will also be cheap, but give you more control and flexibility. You just need too build a billboard matrix to make it face the camera but that shouldn't be a problem.

Also be aware of these type of effects cutting through the floor/other objects etc...

Hope thats another angle on the idea for you.

GCoder

Share this post


Link to post
Share on other sites
Quote:
Original post by GCoder
Why not build a triangle strip in a ring with the inner vertex colours blue, and solid and the outer vertices blue but alpha'd?

You could then pass a parameter in to the build or render function with the radius, perhaps even the vertex colours too for the inner and outer. Then you can use it on any sized sphere with no trouble at all. You might want to specify the outer radius too perhaps.

This will also be cheap, but give you more control and flexibility. You just need too build a billboard matrix to make it face the camera but that shouldn't be a problem.

Also be aware of these type of effects cutting through the floor/other objects etc...

Hope thats another angle on the idea for you.

GCoder


I'm trying to make the billboard quad , but it lacks control (must tweak the quad position to be good on the sphere ) i think your solution is even better for control and exact positionning...

Thanx again , and long live to GameDev.net
i will post a screen with your technique Peregrin

Share this post


Link to post
Share on other sites
Just re-read your post...and Peregrins response...

If you used the technique I proposed you might actually want 2 strips so you can have a proper halo effect, as in a proper ring with alpha on the inside and outside vertices and solid vertices in the middle...I hadn't thought that bit through at the time ;) it's still damn cheap though...without needing a texture too :)

Good luck

GCoder

Share this post


Link to post
Share on other sites
Quote:
Original post by Peregrin
Let me know how it works out. I would be interested in seeing a screenshot of this technique.


Peeeww done with a lot of tweak and it is not good when the camera is going upon the earth because we see the ring vertically only and not horizontally ...

here is the screen that is okay :

Share this post


Link to post
Share on other sites
Great start, nini!

I found this photo of the Earth, that shows the atmoshpere nicely. I tried to create a texture to replicate that effect. If you are interested, you can find it here.
Hope this helps.

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!