How to Render a Planet Atmosphere

 

This tutorial demonstrates how to render a planet atmosphere, using HtoA. However, this method can be applied to the other Arnold plugins. The examples in this guide are created with ACES. If you want to use ACES, you will need to download OpenColorIO (OCIO) configuration package and create an OCIO variable in Houdini.env, in User preference. Example: OCIO = C:\OCIO\aces_1.0.3\config.ocio. Many thanks to Slava Sych for this tutorial.

The scene files can be found here.
Earth
Spherical Geometry 
Clouds
Atmosphere

Start

  • First, start HoudiniFX and create a new scene.
  • Go to the SHOP context and create 3 Arnold Shader Networks.
  • Rename them as earth, clouds, and atmosphere.

Preparing the Geometry

  • Create a File node in the OBJ context, rename it to Planet and open it. Inside it create a Box primitive. We use a Box because we will create a part of the planet in camera. We will show how to prepare the geometry for a complete spherical planet at the end of this example.
  • Connect the Box node to a Transform. Box->Transform.

Transform Node

  • Set Scale Y parameter to 0.5.
  • Set Uniform Scale to 5.
  • Connect the Transform to a Subdivide node. Transform->Subdivide

Subdivide

  • Set the Depth to 4.
  • Connect the Subdivide to a Blast node. Subdivide->Blast.

Blast

  • Selection in Group 0-1279 primitives.
  • Connect the Blast to a uvtexture node, and the uvtexture to the Subdivide. Blast->UVTexture->Subdivide.

 

Subdivide

  • Set Depth to 3.

Now we have the base shape for our planet.

  • Now, create three different branches from the last Subdivide node.
  • Create three null nodes, and rename them to atmo, earth, and cloud.

Earth 

Null->Material->Null


Earth Material

In the Material parameters set the path to the earth material in the shop context.

Spherical Geometry 

 

UVTexture

Sphere

Transform

Subdivide

Set Depth to 4.

Cloud_transform

Set Uniform Scale 1.002.

Atmo_transform

Set Uniform Scale 1.003.

Preparing the Scene

  • Go to the OBJ context.
  • Now create a camera and set the following transformations:

Translate: -0.790778 1.13185 3.00743
Rotate: -1.66924 -13.6321 5.43062e-09

 

 

  • Go to View and set the Resolution to 1920x1080.
  • Create an Arnold Light and set the following transformations:

Translate: -0.0490026 0.686259 0.158599
Rotate: -150.418 16.6297 16.5069

 

  • Change the Light Type to Distant.
  • Set the Color to 1 1 0.811.
  • Change the Exposure to 3.3.
  • Change the Angle to 60. This will give the light a softer shadow.

Render Settings

  • Go to the out context.
  • Create an Arnold node and set the following parameters:

Sampling

  • AA: 8-16.
  • SSS: 5.
  • Volume Indirect: 3
  • Enable Autobump for SSS


Ray Depth

  • Volume: 1


Earth

  • Go back to the Planet sop in the OBJ context and select the null (earth_out). We will start shading this part of the geometry.
  • Go to the SHOP context and open the Arnold Shader Network (earth).
  • Create a standard_surface shader and connect it to the OUT_material surface.


Now create three Image nodes and call them diff, water_mask, and bump.
Load the textures using the $HIP variable.
Examples:

  • diff: $HIP/tex/earth_diff_01.jpg
  • water_mask: $HIP/tex/earth_water_mask.png
  • bump: $HIP/tex/earth_bump.png


Diffuse

Image(diff)->ColorCorrect->SurfaceShader
Connect the Image (diff) rgba to the input of the ColorCorrect and the ColorCorrect rgba to base_color in the Surface Shader.

ColorCorrect

  • Gamma: 0.8.
  • Hue Shift: -0.048.
  • Saturation: 0.7.

Specular

Image (water_mask) -> Range -> SurfaceShader.

  • Connect the Image (water_mask) rgba to Range input, and Range r to the Standard Surface specular.

Range

  • Output Min: 0.2.
  • Output Max: 0.1.
  • Enable Smoothstep.

Bump

Image (bump) -> bump2d -> Standard Surface.
Connect Image (bump) rgba to bump2d bump_map, and bump2d vector to the Standard Surface normal.

Bump2d

  • Bump Height: 0.01.


Select the Standard Surface and set the following parameter values:

Base

  • Base: 1.
  • Diffuse Roughness: 0.3.

Specular

  • Roughness: 0.45.
  • IOR: 1.2.

 

  • Go to the Render View, make sure you select the Arnold Rop, and start the render.

You will get something like this:

Clouds

Cloud

Null->Transform->Material->Null.

Transform

  • Set Translate Y to 0.003.

Cloud Material

In the Material parameter set the path to the cloud material in the shop context.

  • Go back to the Planet sop and select the null (cloud_out).
  • Go back to the SHOP context and open the Arnold Shader Network (clouds).
  • Create a Standard Surface shader and connect shader to the OUT_material surface node.

  • Create an Image shader and load the Cloud texture.

 

Image->Bump2d->Standard Surface

  • Connect the Image rgba to Bump2d bump_map, and Bump2d vector to the Standard Surface normal.

Bump2d

  • Bump Height: 0.1


FacingRatio -> Range

Create a Facing Ratio and Range node. Connect the Facing Ratio float to the Range input.

Facing Ratio

  • Bias: 0.91.
  • Gain: 0.466.
  • Turn on Linear.

Range

  • Input Min: 0.205.
  • Input Max: 0.344.
  • Enable Smoothstep.

 

Range -> LayerRGBA
Image -> LayerRGBA

  • Create a LayerRGBA. Connect an Image rgba to LayerRGBA input1, Range rgb to LayerRGBA input2.

LayerRGBA

  • Set the Layer 2 Operation to Multiply.


LayerRGBA -> Range -> Standard Surface.

LayerRGBA -> Standard Surface.

  • Connect LayerRGBA rgba to the Range input and the Range rgb to Standard Surface emission.

Range

  • Input Min: 0.1.
  • Output Max: 0.43.
  • Connect LayerRGBA rgba to Standard Surface opacity.
  • Select the Standard Surface and set the following parameters:

Base

  • Base: 1.

Specular

  • Roughness: 0.7.
  • IOR: 1.2.

Subsurface

  • Type: Randomwalk.
  • Subsurface: 1.
  • Radius: 1 0.6955 0.391.

 

  • Now if we start rendering, we will get something like this.

Atmosphere 

Atmo

Null->Transform->PolyExtrude->Group->Transform->PolyFill->Material->Null.

Transform (pos)

  • Set Translate Y to -0.001.

PolyExtrude

  • Set Distance to 0.02.

Group 

  • Set name edge_grp in Group Name. 
  • Group Type change to Edges.
  • Turn on Keep by Normals and set Direction Y to -1 and Z to 0. 
  • Spread Angle set to 68 for procedural edge selection.

Transform (border_flatten)

 

  • Select in the Group parameter edge_grp

 

  • Set Translate Y to 0.610.

PolyFill

When working with a volume we will need some solid geometry without any holes.

  • Change Fill Mode to Quadrilateral Grid.

 

  • Turn off Deform Patch.

Atmosphere Material

  • Set the path to the atmosphere shader in the shop context.
  • Create a Merge and merge the branches into one, connect the merge to a null and call it OUT.
  • Go back to the Planet sop and select the last null in the node graph (OUT).

 

  • Go to the SHOP context and open Arnold Shader Network (atmosphere).
  • Create a Standard Surface shader. Connect shader to OUT_material surface.
  • When creating the atmosphere, we could use a surface shader and not a volume. This will give us more artistic control. We can use transmittance depth since it is also volume and it works with volume ray depth. This will give us more flexible settings, faster rendering and less noise than if we used surface conversion to volume VDB, without many voxels and volume artifacts. However, you must remember that this technique is suitable when you look at the atmosphere, if your camera passes through it, you will have to use volume VDB.


So let’s get started.
FacingRatio->Range->SurfaceShader

  • Create a Facing Ratio and a Range shader. Connect the Facing Ratio float to Range input and the Range rgb to Standard Surface transmission_depth.

Facing Ratio

  • Bias: 0.646.
  • Gain: 0.267.
  • Enable Linear.

 

Range

  • Output Min: 0.2.

FacingRatio -> Range -> ColorCorrect -> Standard Surface

  • Facing Ratio float to Range input, Range rgb to ColorCorrect input, ColorCorrect rgba to Standard Surface opacity.

Facing Ratio

  • Bias: 0.948.
  • Gain: 0.202.
  • Enable Linear.

Range

  • Output Max: 6.
  • Enable Smoothstep.
  • Bias: 0.173.
  • Gain: 0.7.

ColorCorrect

  • Gamma: 0.9.

Standard Surface shading network


Select the Standard Surface and set the following parameters:

  • Specular: 0.
  • Roughness: 0.
  • IOR: 1.
  • Transmission: 1.
  • Scatter: 0.358878 0.497024 1.07771.
  • Scatter Anisotropy: 0.7.

 

Now we can render the final planet atmosphere.

 

To reduce the emission intensity of the clouds on the dark side of the planet or to get a mask for the texture of the dark side of the planet we could use the Utility shader with the Shade Mode set to Lambert. Multiply the shader to the emission texture.

 

 

  • No labels