13
$\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$
4
  • $\begingroup$ Cycles also supports OSL, is it possible to translate the game engine shader into an OSL shader? $\endgroup$
    – Mike Pan
    Commented Mar 4, 2014 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$ Commented Mar 26, 2014 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
    Commented Mar 28, 2014 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
    Commented Mar 29, 2014 at 1:52

3 Answers 3

13
$\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 need 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 atmosphere), and that the Multiply node in turn needs to be connected to both volume nodes.

6: Rayleigh 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$
2
  • $\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$ Commented Oct 30, 2014 at 7:33
  • 2
    $\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
    Commented Mar 14, 2015 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$
1
  • 1
    $\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$ Commented Apr 6, 2014 at 17:54
2
$\begingroup$

In volumetric scattering node, there is an anisotropic option. If you want rayleigh scattering set that option to 0 if you want mie scattering, set to any value that very close to 1 but not 1. If want both, just use add shader to add them together.

Don't forget to go to light path > max bounce and turn volume from 0 to any that not 0, that makes it more realistic. For performance use 1 or 2 bounce

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .