Gas giants part II

Published February 25, 2007
Advertisement
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:
0 likes 16 comments

Comments

tamat
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.
February 25, 2007 05:50 PM
NLDEV
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!
February 26, 2007 04:25 AM
Jason Z
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!
February 26, 2007 05:42 AM
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. ;-)
February 26, 2007 01:37 PM
Gaiiden
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.
February 26, 2007 06:54 PM
swiftcoder
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 :)
February 26, 2007 08:33 PM
jollyjeffers
Just wow. Really, really looking good!

Jack
February 27, 2007 05:02 AM
Todo
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!
February 27, 2007 07:53 AM
Ysaneya
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 :)
February 27, 2007 12:01 PM
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 :)
March 02, 2007 10:09 AM
dali
Fantastic! I would make the medium atmosphere thicker so that its possible to hide in such gas planets. :)
March 09, 2007 10:22 AM
sinsro
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...
March 17, 2007 09:28 AM
swiftcoder
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 ;)
March 18, 2007 05:53 PM
Ysaneya
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.
March 19, 2007 05:25 AM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement