Jump to content
  • Advertisement
  • entries
    232
  • comments
    1463
  • views
    961377

Gas giants part II

Sign in to follow this  
Ysaneya

1001 views

I am continuying my work on gas giants.

I have finished the color table generation code. My first try was using a lookup table that maps a density ( in the range [0-1] ) to a color, that interpolated colors based on 4 to 7 "color keys". Each color key was determined randomly.. as expected, it didn't look very good. I decided to use another approach: generate a start color for density 0; generate an end color for density 1; then use the mid-point displacement algorithm in 1D to generate the intermediate values.

Here's an example of a color table ( stretched in 2D to see the colors better ).

And Here's an example of a gas giant texture ( there are 6 per layer, and 6 layers total -> there's 36 of those ) with the applied color table.

I also rewrote the color table lookup code itself, to use a simple 256-values array, and pre-computing the colors and the alpha for each value. Then, to texture the gas giant, I only need 1 line: get the density, convert it to an integer in the 0-255 range, then lookup the RGBA values. It provided a nice performance boost ( 5 times faster than the previous method ). You wouldn't notice a difference though, because this part of the algorithm wasn't a bottleneck to start with.

I rewrote the atmospheric scattering shaders in GLSL. Here's a gas giant with its 6 layers ( each cloud layer is moving at different speeds, although it's subtle ). Notice how the scattering on the top-right makes the atmosphere go yellow-ish:



Last but not least, I've been trying to get good results when entering inside the atmosphere of the gas giant. It's still very experimental, at the moment my main problem is to blend the atmosphere look from space and from inside.. and I haven't succeeded yet. But that's how it looks:

In the upper atmosphere:


In the medium atmosphere:



In the deep atmosphere, you probably won't be able to go deeper in a spaceship anyway:
Sign in to follow this  


16 Comments


Recommended Comments

Great work, I love it.

"you probably won't be able to go deeper in a spaceship anyway:" why not? I find interesting to fight in a blind environment.

Share this comment


Link to comment
Quote:
Original post by tamat
"you probably won't be able to go deeper in a spaceship anyway:" why not? I find interesting to fight in a blind environment.


A spacecraft would likely be crushed at such a depth.

Great work, as always, by the way!

Share this comment


Link to comment
I have been wondering what geometry you use for your planets? Is it a geosphere, a standard stack and slice sphere, or is it generated in the pixel shader? Would you mind posting a wireframe shot of one of these scenes some time? I think it would be interesting to see exactly what you are starting with to generate these excellent screenshots! Thanks in advance and keep up the great work!

Share this comment


Link to comment
Very nice! Any plans for volumetric clouds? Perhaps it would be overkill, but a station similar to Lando's sweet-ass pad in RotJ would be a nice touch. ;-)

Share this comment


Link to comment
Quote:
Original post by coderx75
Very nice! Any plans for volumetric clouds? Perhaps it would be overkill, but a station similar to Lando's sweet-ass pad in RotJ would be a nice touch. ;-)

That would be the Empire Strikes Back [smile]

And as always, lookin damn purty man.

Share this comment


Link to comment
So how much base texture space does one of these gas giants take up? (I mean before detail refinement or whatever)
I am guessing that is 6 layers, each a 1024x1024 cubemap?

edit: 1201st post in the journal, that's a lot of data :)

Share this comment


Link to comment
I don't know what the heck such things should look like, but you've sure made them look cool. This is one hell of a project, sure to make many drop a jaw by the time it hits the net :-).

Congrats!

Share this comment


Link to comment
Quote:
I have been wondering what geometry you use for your planets? Is it a geosphere, a standard stack and slice sphere, or is it generated in the pixel shader? Would you mind posting a wireframe shot of one of these scenes some time?


I have already posted wireframe shots before, so you'd have to browse the screenshots directory or the journal archives to find one.. the planet is generated from a cube map that is morphed into a sphere. That means that the terrain algorithm is similar to geo-mipmapping, except it works in "deformed" space. But at heart, it's still working in 2D with a standard heightmap. It's also very GPU friendly.

Quote:
Very nice! Any plans for volumetric clouds? Perhaps it would be overkill, but a station similar to Lando's sweet-ass pad in RotJ would be a nice touch. ;-)


I'm going to rework on volumetric clouds soon - I've already some old code, see the first journal entry back 2 years ago :)

Quote:
So how much base texture space does one of these gas giants take up? (I mean before detail refinement or whatever)
I am guessing that is 6 layers, each a 1024x1024 cubemap?


Since this post, I've reduced the number of layers to 3 to speed performance up, and it still looks as good. So that's currently 1024x1024x6 x3.

Quote:
I don't know what the heck such things should look like, but you've sure made them look cool.


Look at "Hot Jupiters" on this page:
http://extrasolar.net/speculations.html

It's interesting to note that I didn't try to replicate the look seen in that webpage. The results I have are directly coming from atmospheric scattering equations. With a couple of tricks to "look good", or to hide transitions, of course :)

Share this comment


Link to comment
Guest Anonymous Poster

Posted

Absolutely beautiful.

Share this comment


Link to comment
Quote:
Original post by Ysaneya
Quote:
So how much base texture space does one of these gas giants take up? (I mean before detail refinement or whatever)
I am guessing that is 6 layers, each a 1024x1024 cubemap?


Since this post, I've reduced the number of layers to 3 to speed performance up, and it still looks as good. So that's currently 1024x1024x6 x3.


So around 55 Megabytes of textures even before refinement. And if we are flying around a planetary system, one probably needs at least 2-3 gas giants loaded, so maybe a couple of hundred Megabytes before we even get close to a planet. Ouch, I guess memory is cheap now for good reason :)

Share this comment


Link to comment
Guest Anonymous Poster

Posted

Quote:
Original post by swiftcoder
Quote:
Original post by Ysaneya
Quote:
So how much base texture space does one of these gas giants take up? (I mean before detail refinement or whatever)
I am guessing that is 6 layers, each a 1024x1024 cubemap?


Since this post, I've reduced the number of layers to 3 to speed performance up, and it still looks as good. So that's currently 1024x1024x6 x3.


So around 55 Megabytes of textures even before refinement. And if we are flying around a planetary system, one probably needs at least 2-3 gas giants loaded, so maybe a couple of hundred Megabytes before we even get close to a planet. Ouch, I guess memory is cheap now for good reason :)



LOD

/TruB

Share this comment


Link to comment
Fantastic! I would make the medium atmosphere thicker so that its possible to hide in such gas planets. :)

Share this comment


Link to comment
Not directly related to this post, but I wonder where are you when it comes to DirectX 10?

I would be interested in knowing your opinion about this much hyped graphics library...

Share this comment


Link to comment
Quote:
Original post by Anonymous Poster
Quote:
Original post by swiftcoder
Quote:
Original post by Ysaneya
Quote:
So how much base texture space does one of these gas giants take up? (I mean before detail refinement or whatever)
I am guessing that is 6 layers, each a 1024x1024 cubemap?


Since this post, I've reduced the number of layers to 3 to speed performance up, and it still looks as good. So that's currently 1024x1024x6 x3.


So around 55 Megabytes of textures even before refinement. And if we are flying around a planetary system, one probably needs at least 2-3 gas giants loaded, so maybe a couple of hundred Megabytes before we even get close to a planet. Ouch, I guess memory is cheap now for good reason :)



LOD

/TruB


Ja, but this is before LOD even comes into play, by my understanding ;)

Share this comment


Link to comment
DX10 features are available on Windows XP in OpenGL through the extensions mechanism; while to use DX10, you need to be on Vista. That's enough for me to stick to OpenGL.. for now.

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 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!