Planet shader and atmosphere scattering

Example code here.





Thought I’d show my work in progress. I am just beginning with GLSL and JME3 (and CG in general) so bear with me :).



This is a screenshot of my very first non-exploding version of a planet shader with atmosphere scattering and animated surface and clouds. It is encapsulated in a jme3 material. There are still some nasty artifacts but my intention is to share the code here when it is worth sharing ;). Procedural surface and clouds are the next step. I am not aiming for seamless landing planets, but for highly immersive planets from a low orbit view. My landings will be a loading screen.



The atmosphere scattering algorithm is based on Sean O’Neil’s work.



Average FPS is around 800.











Cheers.

7 Likes

Cool! Cant wait for the shader contribution :wink:

This looks great. And with such high FPS is very usable. Does the planet get "lighter" when you move away from it?

I could tell you’d have something good in store for us the moment you jumped out of your lurker-hole ;D



The border of the globe looks a little bit pixelated. Is that the model or the shader?



Edit: Oh hey, I just realized, you could make your screenshot look twice as awesome using the Space Skybox Tool (credit to Eggsworth for linking). (Erm, I haven’t actually checked how it works, but I figured you could just use the tool to generate a neat skybox and apply that to your scene)



(Split the thread out from the jME3 screenshots topic because that one is actually for core feature pics only. Maybe some other day, he he)

It's quite good. Create your sky, export it as 1024, import it in the ati skygen, attach it untill its right(1 to 1, 2 to 2, they use the same numbering) and export as dds.



Here a sample so you can test, just set it as texture for the skymaterial, while settings m_sphere (or similar) to false



http://ul.to/9cmjgp

Very good!


Thanks for the comments.



As soon as I have some time I am going to try that skybox tool, looks very useful :).




ractoc said:

Does the planet get "lighter" when you move away from it?


Nope, but it would be cool. In the screenshot there is only space-to-sky scattering. Maybe when I get the space-to-surface shader working it can be adjusted to obtain this kind of brightness. It is a bit dark right now.

erlend_sh said:

The border of the globe looks a little bit pixelated. Is that the model or the shader?


I think it is the shader. I have to look at that (and other awful things that can't be appreciated in a static shot  :) ).

And here I was thinking I was going to have to do this by myself.



I am very happy to see someone else working on this for java as well :slight_smile:

very exciting.

Looks pretty cool :slight_smile:

The only thing that bother my eyes is the sharp border between atmosphere halo and planet surface. On the picture you have too bright halo in the space area, and no halo lightening the surface.



Taka a look here to see what I mean :slight_smile:



Anyway, it’s a nice job done, and we all hope to see your updates :slight_smile:

I had to do a double-take because I thought that was the real thing… Gorgeous.

Eggsworth said:

And here I was thinking I was going to have to do this by myself.



First of all, thanks a million for doing it before :). After looking at your work at Ogre3D's site I am tempted to ask you some questions, but I will keep them for me untill I find the correct, precise questions (so far it's a cloudy mess in my mind). I hope you don't mind me "taking notes" from your code  }:-@.

It's awesome that you made it work by the way. Anyway, I am immersed in a rather frustrating trial and error loop.  And the shader code is changing quite a bit from the original, since it didn't work for me, I feel as if I were cheating (normalizing, clamping, mixing...) not sure how generic it will end up being.


Kay said:

The only thing that bother my eyes is the sharp border between atmosphere halo and planet surface. On the picture you have too bright halo in the space area, and no halo lightening the surface.

Taka a look here to see what I mean :)


Yes, I see. I am working on the space-to-surface scattering, which adds some brightness and reduces contrast in the surface. I'll post something when I get something good enough.

Thanks for the feedback :).

jiyarza,



i apologize but i believe we have a misunderstanding.



You see, what I ment was, I was planning on creating what you have already created, and I am glad to see it is being developed in java none the less.



I havent actually made it yet :slight_smile:



sorry for any confusion

Duuuude! Improvements happening at an impressive pace :slight_smile:

Now all you need is a bunch of pictures from one consecutive day that can show the movement of clouds over the earth's surface :wink:

sbook said:

Now all you need is a bunch of pictures from one consecutive day that can show the movement of clouds over the earth's surface ;)

and also very interesting to see the picture of a planet, that have been partially hidden in the shadow (just like the first one).

erlend_sh said:

Duuuude! Improvements happening at an impressive pace :)

indeed! keep on going! Also it would be interesting to see how you did this. I am saying this because in my project I will definitely add such techniques. By the way, a starting point for many atmospheric scattering projects is Sean's o'Neil work, and the most realistic and powerful today seems this technique, but it soo complicated.
Kay said:

indeed! keep on going! Also it would be interesting to see how you did this. I am saying this because in my project I will definitely add such techniques. By the way, a starting point for many atmospheric scattering projects is Sean's o'Neil work, (...)


Allow me to answer your quoted questions with a quote:
jiyarza said:
There are still some nasty artifacts but my intention is to share the code here when it is worth sharing ;).
(...)
The atmosphere scattering algorithm is based on Sean O'Neil's work.
(...)
It's all good!  :D
erlend_sh said:

The atmosphere scattering algorithm is based on Sean O'Neil's work.

damn I'm blind.. XD
Kay said:

(...) a starting point for many atmospheric scattering projects is Sean's o'Neil work, and the most realistic and powerful today seems this technique, but it soo complicated.


Yes, the theory is overwhelming for me. I have read Bruneton's and others to at least understand the problem (and have some cultural background that never hurts), but my requeriments are not that demanding. I will be happy with beautiful close-up planets, at shuttle orbit altitude more or less.

So, all I am really doing is porting O'Neil's published shaders (check sandbox-src). They don't seem to work in nVidia cards such as mine and I am having all the fun artifacts known to man.


This one is not dead yet…





Earth





Still with artifacts.





@sbook, I read you about showing the clouds moving. Really, its not worth the bandwith at least just yet. All the shader is doing is rotating two textures in opposite directions (surface & clouds). I mean, it’s not clouds evolving and changing shape or something like that.





Cheers.

2 Likes

This really looks great. I hear you about “not dead yet”, I trust you to finish this :wink: