Cloudy to fiery – Volumetric effects in Cinema 4D (Part 2)

In this two-part series of articles, we will provide the experienced Cinema 4D user with in-depth insights into the creation of volumetric effects with the onboard tools of C4D – without any plug-ins, particles or PyroCluster. In the second part of the series, we will first deepen our knowledge of volumetric texturing of visible lights and then turn to a mograph-based technique.

In the first part of this article series, we learned that a visible volumetric light can be used as an “aquarium” for volumetric shaders such as 3D noises and 3D colour gradients. With such a light container, we are able to create thin clouds or even complex self-luminous structures such as stellar nebulae. With the same technique, however, we are also able to create complex animated structures such as an animated solar corona with its characteristic eruptions. In the following, we will take “the magic of visible lights” one step further and create a realistic, fiery and detailed solar corona.

Case study: ZDF Terra X, a question of time (sun)

Looking at contemporary science fiction films or VFX-heavy TV documentaries, one might think that the depiction of a realistically animated sun is a task that causes many sleepless nights in a VFX studio as a classic scenario for particles and simulations.
The intro sequence of this project for the TV documentary series ZDF “Terra X” (see cover picture) stages the sun as a place of stellar nuclear fusion, but only uses the techniques we have learnt so far – and at this point we can sleep soundly again.
If you take a look at NASA footage of the sun, you will realise that the surface of the sun contains a lot of visual details that are comparable to C4D’s noise shaders. For example, the so-called granulation of the sun’s photosphere can easily be reproduced by a noise shader called “Voronoi 3”, which is distorted in a distorter shader with a VL noise (image 01).

Bild 01: Sonnen-Phänomene und ihre Entsprechungen in C4D: Granule (links) können in C4D leicht erzeugt werden, indem man in einem Distorter Shader ein Voronoi-3-Noise mit einem VL-Noise verzerrt (Foto Granule: NASA, genutzt unter Creative-Common-Lizenz).
Image 01: Solar phenomena and their equivalents in C4D: Granules (left) can be easily created in C4D by distorting a Voronoi 3 noise with a VL noise in a distorter shader (photo granule: NASA, used under Creative Commons licence)

If you distort the result again in a plane shader using a plane effect “Distorter” with a turbulence noise, you get a structure that comes quite close to the real model (image 02).

Bild 02: Granule finalisiert: Den fertigen Distorter Shader packt man in einen Ebene-Shader, wendet den Ebenen-Effekt Distorter für eine weitere leichte Verzerrung an und färbt das ganze mit dem Ebenen-Effekt Colorizer.
Image 02: Granule finalised: Put the finished Distorter shader into a layer shader, apply the Distorter layer effect for another slight distortion and colour the whole thing with the Colorizer layer effect

The same applies to phenomena that are obviously volumetric, such as corona, solar flares, etc.: visible volumetric light can be used as an “aquarium” for noises and 3D colour gradients, with the mathematical functions behind the noises always resembling their natural models.

Simple components

As is so often the case with visual effects, the complexity of the final sun results from the superimposition and combination of various simple elements: For all visual phenomena such as light rays of different sizes, eruptions, etc., we only use one point light at a time, whose visible light is more or less larger than the solar body itself. The astonishing thing is that the complexity of the final result is only achieved with 8 volumetric point lights (Fig. 03).

Bild 03: Nur acht volumetrische Punktlichter mit entspr. volumetrischen Texturen mimen komplexe Eruptionen. Einfacher geht’s nicht.
Image 03: Only eight volumetric point lights with corresponding volumetric textures mimic complex eruptions. It couldn’t be simpler

Concentric masking

Corona, light rays and eruptions are thus applied as textures to volumetric point lights using the technique we are familiar with. As the “Visibility” tab of the respective point light contains the parameters “Inner distance” and “Outer distance”, volumetric effects can be faded out concentrically from the surface of the sun into space (Figure 04).

Bild 04: Der Innenradius der Punktlichtquelle entspricht in etwa dem Sonnenradius. Der Außenradius bestimmt die Höhe des darüber hinausgehenden sichtbaren Effekts, also bis wohin Strahlen und Eruptionen über der Sonnenoberfläche sichtbar sein sollen, bzw. auf null abnehmen.
Figure 04: The inner radius of the point light source corresponds approximately to the radius of the sun. The outer radius determines the height of the visible effect beyond this, i.e. up to where rays and eruptions should be visible above the surface of the sun, or decrease to zero.

In order to have more control over this behaviour, we also apply a colour gradient in 3D spherical mode as a mask (Image 05). This colour gradient has the same radius as the “Outer distance” parameter of the point light source, but has the advantage that it fine-tunes the spatial fading of the effects and at the same time offers the option of applying turbulence (image 06).

Bild 05: Ein kugelförmiger 3D-Verlauf (Gradient) mit Radius des Außenradius wirkt durch den Ebenen-Modus Multiplizieren quasi maskierend und verfeinert die Abnahme mit einer leichten Turbulenz.
Image 05: A spherical 3D gradient with the radius of the outer radius has a quasi-masking effect using the Multiply layer mode and refines the reduction with a slight turbulence.
Bild 06: Wichtig ist bei dem kugelförmigen 3D-Verlauf das Bezugssystem Objekt.
Image 06: The reference system object is important for the spherical 3D gradient

Solar flares

This effect may look very complex, but it is actually quite simple: It consists of a visible volumetric point light that contains a large Naki noise in space object as a texture. The Naki contains a slight in-itself movement due to the “animation speed” parameter. It is located in a plane shader, where it is masked out by a 2D colour gradient of the polar caps and coloured by a colourizer effect (Figure 07).

Bild 07: Shader für größere Sonnen-Eruptionen: Zuunterst maskiert ein Ebenen-Ordner mit einem 2D-Gradienten das darüberliegende 3D-Noise von den Polkappen der Sonne aus. Obenauf fadet ein kugelförmiger Verlauf das ganze turbulent in den Raum aus.
Image 07: Shader for larger sun eruptions: At the bottom, a layer folder with a 2D gradient masks the overlying 3D noise from the polar caps of the sun. At the top, a spherical gradient fades the whole thing turbulently into space

The scaling of this Naki noise is then animated over time, meaning that the noise grows concentrically from the centre of the sun. This alone creates the illusion of large plasma-like structures.
In order to have more control over how the growing Naki is faded out in space, I masked it with a static but highly turbulent 3D colour gradient in 3D spherical mode, which is also applied to the space object (image 08). The result is that solar flares emerge from the sun and are faded out turbulently in space.

Bild 08: Vergleich der Wirkung des kugelförmigen 3D-Verlaufs: links schneidet die Begrenzung des sichtbaren Lichts die Noise-Textur einfach ab, rechts findet ein turbulentes Ausblenden statt.
Image 08: Comparison of the effect of the spherical 3D gradient: on the left, the boundary of the visible light simply cuts off the noise texture; on the right, turbulent fading takes place

The surface of the sun

Although this article is about volumetric effects, let’s take a quick look at the shader setup for the actual surface of the sun. Everything takes place in the glow channel of the sun material or in a layer shader placed there: noises, colour gradients and layer shader effects are stacked on top of each other with different layer modes and opacity levels. In addition, several layers are used to mask the layer above (image 09).

Bild 09: Die Oberfläche der Sonne: Ein gut gefüllter Ebene-Shader mit sinnfällig benannten Noises, Verläufen, Ebenen-Effekten und Ebenen-Ordner.
Image 09: The surface of the sun: A well-filled layer shader with clearly named noises, gradients, layer effects and layer folders

In the displacement channel, three noises in a layer shader deform the high-res geometry of the sun to match the details in the glow channel (image 10).

Bild 19: Das Naki im Raum Welt durchdringt den Mograph-Stapel. Es wird wolkig – allerdings noch mit Artefakten.
Image 19: The Naki in the space world penetrates the mograph stack. It becomes cloudy – but still with artefacts
Bild 10: Im Displacement-Kanal sorgen zwei Noises und eine Verlaufsmakse für eine leichte Verformung der Sonne gemäß den Details im Leuchten-Kanal.
Image 10: In the displacement channel, two noises and a gradient make for a slight deformation of the sun according to the details in the glow channel.

Large plasma arcs were modelled procedurally: Spheres were distributed as mograph clones over the surface of the sun and arranged appropriately with a shader effect. The plug-in pCONNECTOR (tcastudios.com) was then used to connect these clones, and the resulting spline object was thrown into a sweep object. The resulting tubular connections between the clones were then bent into arcs using a shader-based displace deformer (Figure 11).

Bild 11: Prozedural modellierte Plasma-Bögen: das Plug-in pConnector schafft Verbindungen zwischen Klonen, ein Displace-Deformer erzeugt die Bogenstrukturen.
Figure 11: Procedurally modelled plasma arcs: the pConnector plug-in creates connections between clones, a displace deformer generates the arc structures

Diving into the sun

In min 00:11 of the animation, the moving camera enters the volume of the sun. This transition takes place in the compositing with a cross-fade to a sequence that is similar in technical approach to the stellar nebula in the last article. It is important to note that for this transition, the final speed of the outside camera must have the same direction and linear speed as the start of the inside camera.

Fast rendering with standard renderer

Sample-based volumetric light has been part of C4D for a small eternity, namely since Release 5 (1998). This old type of sample is of course handled differently by C4D than the modern samples of surface shadows, scattered reflections, ambient occlusion etc. Consequently, the rendering of this scene is much faster in the older standard renderer than in the more recent physical renderer.
In addition, the standard renderer has been accelerated by Intel Embree technology since release 19 (2017). Embree is a ray tracing library that is optimised for the latest Intel processors and significantly speeds up rendering – in some cases by up to 100% compared to Release 18. Embree breathes new life into the good old standard renderer, so to speak.
But that’s not all: noises and procedural shaders have high-quality SAT texture interpolation as standard, so there is no need to use anti-aliasing for rendering with the standard renderer. To put it in a nutshell: The standard renderer renders this scene at the speed of light – especially considering the volumetric complexity involved here.

Fluffy clouds with Mograph

The approach described for stellar nebulae and solar flares is based on the volume of a visible volumetric light source as an “aquarium” for 3D noises. While the use of such a light container is quite simple and straightforward, it has one major drawback: all structures and effects created are actually visible light without true opacity and without the possibility of casting a shadow. A cloud created in this way will therefore never cast a shadow on the ground or on itself.
So to create a shadow casting fluffy cloud for a sunny summer sky, we have to dive into a technique that is also based on the use of volumetric shaders, but uses a different container: a mograph cloner.

Mograph – procedural cloning and animation

Mograph, C4D’s proprietary toolset, provides motion designers with an extensive range of powerful tools for procedural non-destructive animation. A core function of Mograph is the cloning of objects according to certain rules, e.g. along a spline, in certain arrangements or on the surface of an object. Effectors such as randomness, shaders or time, among others, bring variation and movement to the cloning system and with the fields of Cinema4D R20, there are virtually no limits to the imagination and complexity.
Whilst Mograph offers a huge range of exciting functions and thus invites you to play and experiment, we will concentrate on what is probably the most boring function: cloning simple layers (i.e. polygon plates) into a linear stack. This will be the container for our 3D noises: a stack of cloned layers with only one polygon. Before we get into the cloud creation technique based on this, let’s see what you can do with it.

Case study: ZDF “Terra X”, Scotland

This project for the TV documentary series ZDF “Terra X”, episode “Scotland – the myth of the Highlands” (picture 13, 14, 15) shows the geographical origin of Scotland and England. Volumetric clouds in the close-up shots are created using the mograph-based technique, which we will now look at in the form of a short tutorial.

Bild 12: ZDF „Terra X“-Episode „Mythos der Highlands“ (https://vimeo.com/renderbaron/txschottland): fluffige volu­metrische Wolken durch Mograph-Kloner als Container für volumetrische Shader
Image 12: ZDF “Terra X” episode “Myth of the Highlands” (https://vimeo.com/renderbaron/txschottland): fluffy volumetric clouds using Mograph cloner as a container for volumetric shaders
Bild 13,: ZDF „Terra X“-Episode „Mythos der Highlands“ (https://vimeo.com/renderbaron/txschottland): fluffige volu­metrische Wolken durch Mograph-Kloner als Container für volumetrische Shader
Image 13: ZDF “Terra X” episode “Myth of the Highlands” (https://vimeo.com/renderbaron/txschottland): fluffy volumetric clouds using mograph cloners as containers for volumetric shaders
Bild 14: ZDF „Terra X“-Episode „Mythos der Highlands“ (https://vimeo.com/renderbaron/txschottland): fluffige volu­metrische Wolken durch Mograph-Kloner als Container für volumetrische Shader
Image 14: ZDF “Terra X” episode “Myth of the Highlands” (https://vimeo.com/renderbaron/txschottland): fluffy volumetric clouds using mograph cloners as containers for volumetric shaders

Tutorial – fluffy disc clouds

To not only understand the technique described below, but also to get your hands on it, follow a short tutorial.

Creating an environment

Create a new scene, create a simple sky object under Main menu > Create > Environment. Create a new material, deactivate all material channels, activate the glow channel and create a nice 2D-V colour gradient in typical sky colours, perhaps as shown in image 15.

Bild 15: Ein Farbverlauf im Leuchten-Kanal erzeugt eine einfache Textur für das Himmel-Objekt.
Image 15: A colour gradient in the glow channel creates a simple texture for the sky object

Place a plane object with 1 x 1 segments and dimensions of 1,200 x 1,200 cm at -100 cm Y-height of the world and apply a new material with a bluish colour to the plane. This slab will serve as our ground plane. Create a camera and view the scene from a flat top view. The empty scene should look something like Figure 16.

Bild 16: Ausgangspunkt zum Wolken-Bauen: unsere Szene mit Himmel-Objekt und Bodenplatte
Image 16: Starting point for cloud building: our scene with sky object and ground plane

Create an infinite light as the sun and apply raytraced shadows (hard) for the time being (just to achieve a quick shadow effect, no matter how unrealistic it is).

Stacked layers

Create a Mograph cloner under Main Menu > Mograph > Cloner. Assign a copy of the floor layer to the cloner. The layer is immediately duplicated three times along the Y-axis of the cloner. Click on the cloner in the object manager and view its settings in the attribute manager: You will notice that the cloning mode is set to linear by default, just as we want it. First set the number of clones to 10 and set the distance mode from Step to Endpoint. Set the distance under P.Y. to 50 cm. This will distribute all cloned planes along the Y-axis of the world within this range (Fig. 17).

Bild 17: Grundprinzip der Wolken: Platten als Mograph-Klone dienen quasi als Volumen-Samples.
Image 17: Basic principle of the clouds: Plates as mograph clones serve as volume samples

Creating a cloud material

Create a new material. Activate the alpha channel in the material and create a noise shader in it. In the noise shader, select the noise type Naki, select Object as the room and adjust the global size to 2,500%. Set the clipping at the bottom to 50% and the clipping at the top to 100%. This narrows the tonal gradient of the noise so that you get nicely distinguishable white and black areas (Fig. 18). This creates defined transparent areas (black) and opaque areas (white) in the alpha channel.

Bild 18: Der Wolken-Shader – ein einfaches Naki-Noise, zunächst im Raum Objekt
Image 18: The cloud shader – a simple Naki noise, initially in the room object

Optimising the C4D viewport

Before we continue with the cloud creation, we will briefly optimise our viewport so that we can view the first versions of our volumetric clouds in real time (!) in the viewport. To do this, select “Enhanced OpenGL” in the viewport menu under Options (if not already activated). Then activate Noise and Transparency. We’ll see the result in a moment.

Now it’s getting fluffy

Apply the material you created earlier to your cloner. You will then get 10 layers with exactly the same noise texture – even though we applied the Naki Noise to the room object! This is because the cloner is not a “real” object – the noise in the room object instead references the axis system of each layer and repeats the Naki noise with each clone. To change this, we go back to the Naki Noise and select Room World. Now we get a representation of the Naki Noise that changes from plane to plane – just the way we want it.
Now, step by step, increase your clone count to 50 and see what happens… Bingo! The slices of the Mograph Cloner – the layers – serve as a kind of spatial sample for the 3D noise, creating volumetric clouds. The more clones you use, the more homogeneous the result will be. The “Number” parameter in the cloner now functions as a kind of sample count.
With the previously optimised settings of the C4D viewport, you can view this first version of your volumetric clouds in real time (!).

Increasing the ray depth

When rendering, you will now get some nice cloud-like structures, which, however, show black, sharp artefacts here and there (Fig. 19). This is because the ray depth of the raytracer has been used up. This means that the raytracer beam stops after passing through a limited number of transparencies (our cloned layers with alpha channel) and renders a black pixel.

To avoid this, select the “Options” entry under Render presets (Ctrl B) and adjust the “Ray depth” parameter. You should select the number of your clones plus one as the value. The result already looks better (image 20). As the more frequent penetration of transparencies by the raytracer beam increases the rendering time, we will initially use a raytraced shadow for the sun light source created in step 01. For the final rendering, you can still use realistic area shadows.

Bild 20: Eine Erhöhung der Strahltiefe in den Optionen der Rendervoreinstellungen entfernt Artefakte.
Image 20: Increasing the ray depth in the render preset options removes artefacts

Vertical masking

What we can clearly see is that all the clouds above and below are abruptly cut off by the vertical boundaries of our cloner. To get around this, we mask our 3D noise with a vertical 3D colour gradient.
In the alpha channel of your cloud material, click on the triangle button next to Texture and select “Layer”. You have now moved your noise shader to a layer shader.
Go back briefly to your alpha channel and deactivate the “Alpha image” checkbox to ensure that the greyscale information of our layer shader is also interpreted as alpha information. Double-click on the noise in the layer shader and name it Cloud Noise. Then click on the “Shader” button, create a colour gradient shader and drag it above the cloud noise. Select 3D Linear as the type of gradient.
We now need to think about how to adjust the colour gradient correctly in order to spatially mask our cloud noise from bottom to top. As the bottom layer of our cloner is at Y=0 and the cloner with all layers has a thickness / height of 50 cm, we set the 3D colour gradient so that it starts along the Y axis at starting point 0 cm and ends at end point 50 cm. We select Space World as the reference system. The colour gradient runs along the world Y-axis from black at 0 cm to white and back to black at 50 cm (Fig. 21).

Bild 21: Ein linearer 3D-Verlauf in der Höhe des Mograph-Stapels sorgt für eine weiche vertikale Begrenzung.
Image 21: A linear 3D gradient in the height of the mograph stack provides a soft vertical boundary.

Back in the layer shader, we set the layer mode to Multiply. Now we can render.
The result is now much better, as we can now mask the cloud noise spatially from bottom to top and thus have control over its vertical shape (image 22). However, the mask is far too soft and too homogeneous. Instead of adding turbulence to our colour gradient, we will now do something more elegant with it.

Bild 22: Die vertikale Begrenzung der Wolken an ihrer Unter- und Oberseite ist noch zu weich.
Image 22: The vertical boundary of the clouds at the top and bottom is still too soft

Copy the cloud noise and paste it as a copy into your layer shader (right mouse button, Copy Shader / Paste Shader). Double-click on the pasted noise and name it Mask-Noise. Then drag the noise above the colour gradient.
Change the global scaling of the mask noise to 500% and invert the noise by setting the clipping at the bottom to 85% and the clipping at the top to 0%. Go back to the layer shader and set the layer mode of the gradient below to Normal. The setup should now look like Figure 23.

Bild 23: Eine kleinere, invertierte Version des Cloud-Noises liegt als Mask-Noise im Ebene-Shader oben auf.
Image 23: A smaller, inverted version of the cloud noise is applied as mask noise in the layer shader above

Now set the layer mode of the mask noise to Levr and see what happens, roughly speaking: A kind of high-contrast version of the mask noise is cut away from the gradient. Reduce the opacity of the mask noise to 70% to get a softer edge. Set the layer mode of the gradient back to Multiply (image 24). Before rendering, we adjust the Clipping bottom parameter in the cloud noise to 20%. Then we render again. The result should look something like Figure 25.

Bild 24: Das Mask-Noise im Ebenen-Modus Levr gibt dem Verlauf darunter mehr Struktur.
Image 24: The mask noise in Levr layer mode gives the gradient below more structure
Bild 25: Die vertikale Begrenzung der Wolken hat nun eine schön definierte Struktur.
Image 25: The vertical boundary of the clouds now has a nicely defined structure

Shadow Luminance

The clouds are now increasingly realistic, but still look grey and dark. Reason: Each Mograph clone casts a shadow on the underlying clone. In order to lighten only shadow areas, we use a shader setup that I created to simulate a kind of self-illumination on the shadow sides of objects: Shadow Luminance.
Although I originally developed this shader setup to simulate very diffuse light on shadow sides of objects, it can also be used to simulate a kind of subsurface scattering on our clouds.

Shadow Luminance consists of three important components:

  • The first component is a plane shader that serves as a container.
  • The second component is a Lumas shader that recognises where there is light and where there is shadow. Lumas does this through its tab shader, which behaves like the colour channel and says: “Show me where I am in the light.”
  • The third component is a colourizer shader into which Lumas is dropped. In the colourizer, the colour gradient is then set to white-black, which reverses the contained Lumas to “Show me where I am in the shadow”.

The colourizer fed with the Lumas is then used to mask any colour on the shadow side of an object and thus create a slight brightening of the shadow areas. Let’s put this into practice.
Activate the glow channel of your cloud material. Create a layer shader. Create a Luma shader within the layer shader. Deactivate all glow aspects of the Lumas shader. Under the Shader tab, select 100% lighting and set the colour to a bright white. Go back to the Layer Shader and place the Lumas in a Colorizer Shader by right-clicking on the Lumas and selecting Colorizer. Inside the Colorizer shader, set its colour gradient to white-black.
Go back to the layer shader, click on the “Shader” button and create a colour shader. Drag it above the colourizer. Set the colour of the colour shader to a light blue. Back in the layer shader, set the opacity of the colour layer to 8%. Select the layer mode Layer mask for the colourizer below.
The setup should now look like image 26. voilà! – You are now masking a light blue exclusively on the shadow sides of your clouds.

Bild 26: Aufhellung der Schattenseiten der Wolken durch Shadow Luminance
Image 26: Lightening the shadow sides of the clouds with Shadow Luminance

Increasing the light sensitivity

If you look at the colour channel of our cloud material, you will see that the drop-down menu is set to Lambert. Lambert is a so-called BSDF, a Bidirectional Scattering Distribution Function – or simply put: a function that describes how light is distributed over the surface of an object, from its brightest to the so-called terminator, the day-night boundary. Lambert simulates a perfectly diffuse surface, while the other available BSDF Oren-Nayar calculates additional micro-facets for a satin, roughened look. While Lambert is a good choice for our bright clouds, Oren-Nayar has an important advantage: the diffuse strength and roughness parameters. With roughness, you can seamlessly mix between Lambert (0% roughness) and Oren-Nayar (100% roughness) behaviour. And with diffuse strength you can virtually adjust the light sensitivity. With a combination of 0% roughness and 200% diffuse strength, we have a Lambertian BSDF with increased light sensitivity and thus increased albedo (Fig. 27).

Bild 27: Gesteigerte Lichtempfindlichkeit der Wolken durch 150% diffuse Stärke
Image 27: Increased light sensitivity of the clouds through 150% diffuse strength

With a further increased clone count (80), adjusted ray depth, shadow luminance for the ground material and area shadows for the sun light source, your final result should look like Figure 28.

Bild 28: Das Endergebnis: dichte, fluffige Schäfchen-Wolken
Image 28: The final result: dense, fluffy fleecy clouds

Conclusion

Fluffy disc clouds are a question of the number of clones and the beam depth. The more homogeneous the desired result, the longer it takes to render. Render times are increased again, especially when realistic surface shadows are used. The happy medium is therefore a balance between a low clone number/beam depth and homogeneous results – handle both with care!
The physical renderer is the best choice in this case, as it offers a high-quality anti-aliasing function, faster calculation of surface shadow samples and also Intel Embree acceleration.
By the way: You can find a live version of this short series of articles as a recording of the Maxon Supermeet 2018 at www.renderbaron.de/publikationen.