9
$\begingroup$

I'm currently trying to create a photorealistic model of planet earth. Texturing and "modeling" is of course no problem. More interesting is the question how to obtain a realistic looking atmosphere. In most tutorials it is done in the compositor by applying blurs to the render, but as a physicist I cannot be happy with those results as they obviously look fake in 99% of all cases.

There is one blend file in the internet, that implements ideas from GPU Gems that accurately recreates the atmosphere effect and looks realistic: http://www.blendernation.com/2009/11/05/atmospheric-scattering-blender-game-engine/ However, it was written for the Game engine and therefore cannot be used for Cycles renders.

With the introduction of volumetric rendering in 2.7 (which has a test build online) I would like to know if it is possible to create similar shaders to get a realistic atmosphere. I am aware of the fact that this will slow down the rendering time significantly by using volumetric rendering. Or does anyone else know a method to get realistic renders?

Thanks for your help!

$\endgroup$
  • $\begingroup$ Cycles also supports OSL, is it possible to translate the game engine shader into an OSL shader? $\endgroup$ – Mike Pan Mar 4 '14 at 20:01
  • $\begingroup$ I also thought about that, however I am not quite sure if the volumetric rendering is already included into the OSL pipeline. But thanks for your answer, I will have a look at this possibility. $\endgroup$ – crazyphysicist Mar 26 '14 at 12:26
  • $\begingroup$ Is this link any help? blenderartists.org/forum/… > All I needed was the light vector. Since the “getAttribute”-node > didn’t seem to work for this I have now just used a manual coordinate > in the node system (by making it a group I only have one place insert > the vector). With the light vector I have created a ramp that shades > from white to black via some orange and blue. Just adding this > groupnode on my pseudo-volumetric-cloud-shader I got nice looking > sunsets . $\endgroup$ – A. K-R Mar 28 '14 at 10:30
  • $\begingroup$ You could try making some sort of gradient based on this, but I don't think it would be physically accurate. $\endgroup$ – gandalf3 Mar 29 '14 at 1:52
10
$\begingroup$

I spent forever experimenting on getting a realistic volume atmosphere for a gas giant. My method will be explained step by step below.

** UPDATE ** While simplifying the node setup (easier to remember and faster renders), I discovered that the color ramp does nothing. Screenshots added.

The result Node setup

1: To get a realistic density gradient and to have the edges of the atmosphere taper, you will to connect the Object output to a Mapping node, and set that to point.

2: The scaling of that mapping node has to be the square root of the atmosphere sphere's size (in the sample scene, the sphere was 10 units, so the scaling was left at 1) or else the volume will go beyond the edges of the object. The result is a volume material that is smaller than the edges of the object.

3: Connect the mapping vector to the gradient texture node, and set that to spherical. Connect the Fac output to a multiply node.

4: The Multiply node needs to multiply the input by the square of the object's radius (which would be 10 in this example) x 10-100 (depending on how thick you want your atmosohere), and that the Multiply node in turn needs to be connected to both volume nodes.

6: Reileigh Scattering is easily emulated by using a combination of Scatter and Absorb nodes. Absorb has to have blue at 0.995, green at 0.088 and red at 0.024 (corresponding with the extinction coefficient of water; Neptune and Jupiter type planets have water and ammonia clouds and ices in them) and Scatter has to have Red at 0.224 Green at 454 and Blue at 0.950 (corresponding to the scattering probabilities of Lord Rayleigh). Absorb needs to go to the bottom input of the Mix Shader (before the one that controls density) and Scatter needs to go to the top one. The Mix Shader's Fac value should equal the albedo you want, which is 0.27 for Neptune and roughly the same for Earth. A rocky planet's atmosphere will not need the absorb node. Anisotropy for the scatter should be 0.250 to get the edge brightening that comes from peering through the atmosphere at a grazing angle.

7: For a rocky planet's atmosphere, it is helpful to simulate haze from dust. Add an addition scatter node and an extra mix shader. The different types of dust has different optical properties, so you will have to experiment. The new scatter node should plug into the top input of the mix shader and be no more than a few percent of the overall mix.

$\endgroup$
  • $\begingroup$ Thank you very much, this actually helps quite a lot! I am quite new to the whole node thing and the scattering, so I did not think about using the scattering probabilities, but it gives really amazing results out of the box. No composition techniques that gives that gives this fake-blue look for the atmosphere :) $\endgroup$ – crazyphysicist Oct 30 '14 at 7:33
  • 1
    $\begingroup$ You said the scaling has to be the square root of the atmosphere sphere's size. You said you left the scale at 1 because your sphere had a size of 10. This is confusing. The square root of 10 is about 3.1, not 1. Also, do you mean size or radius? $\endgroup$ – Lysol Mar 14 '15 at 16:05
2
$\begingroup$

Is this link any help?

http://blenderartists.org/forum/showthread.php?291644-Space-Earth-volumetric-cloud-shader-rayleight-scatter-etc

All I needed was the light vector. Since the “getAttribute”-node didn’t seem to work for this I have now just used a manual coordinate in the node system (by making it a group I only have one place insert the vector). With the light vector I have created a ramp that shades from white to black via some orange and blue. Just adding this groupnode on my pseudo-volumetric-cloud-shader I got nice looking sunsets .

$\endgroup$
  • $\begingroup$ First of all thanks for your answer! I am familar with this post, and it indeed is the most accurate way done in Blender so far. However, there are still a lot of things that give away that this image is fake...but maybe I will try to improve it a bit :) $\endgroup$ – crazyphysicist Apr 6 '14 at 17:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.