home about gallery publications education links contact

..::nebula 2/2::..

In this part, we are going to be creating a large nebula to complement the starfield background.

There are a few ways we could go about this effect; some better than others. Firstly, we could use a simple Omni light as a node and generate a Fractal Fury glow post effect which would create a smokey or electric nebula. The problem with this is that the result is not very convincing as it looks very CG and, well, uniform unless we overlay a lot of fractal glow effects over each other to break up the uniform pattern. However, even though this might be okay for a 2D effect, if we want to fly through the nebula it is pretty useless because scaling is going to be an issue, plus if the light passes off camera, the effect is turned off almost like a switch.

Another way would be to generate a material effect; something similar to how we created the starfield effect for example, with nested Noise, Smoke and Cellular maps. Although this would create a realistic result with a bit of playing around with the settings, we still cannot fly through the nebula as it would either be applied to a sphere or direct to the environment background.

Therefore, we need to utilise 3ds max’s volumetric system to create some nice patchy clouds and illuminate them effectively to create the desired result. However this also creates a problem. Max’s volumetrics are, well, crap to say the least and are no where near as good as, say, Lightwave’s. This creates another problem: any clouds we create cannot actually be illuminated as there is no colour variation based on illumination, just the intensity determined by volumetric density (apart from the Fire Effect volumetric which distributes colours from inside to out and/or on timing). Therefore to create such an effect we will need to mix multiple volumetrics together. This also aids us to break up the uniform effect that a single volumetric would produce, and also to add extra detail in places as a standard volumetric does not generate that much detail when set to a large size; the amount of detail iterations can not be increased much, unlike in maps or a plugin solution (see the tips column).

The nebula will be constructed using several volumetric lights as this generates the best effect, plus we can tweak the colours used in the volumetric lights by using a Gradient Ramp map as a projector to distribute colour over the cloud effect. Firstly, we will start with the core volumetric. This will act as a base illumination for the nebula to simulate additional glow from the core and to act as large distribution of cloud break-up by using a low density and inverted volumetric noise, resulting in patches of cloud-shaped spaces in the volumetric, instead of just cloud and no main light beam(s). Next we will create the first of two cloud volumetrics, again using a volumetric light but with a different attenuation setting and Noise size; this one creates smaller broken patches of Fractal cloud which, due to the order of the environment volumetric effects, is overlaid on top of the existing effect. Finally, another noise size, this one with a Turbulence noise effect is applied to break up the distribution further. The generation of the effect, as illustrated, is very simple indeed, but the trick is to know how to control these effects; obviously check the manual if you are unsure, but a general rule of thumb is that they are very similar as to how you would control a Noise map with High / Low and Levels value settings.

The end result is quite effective, yet not complete without additional detail. For the accompanying image to this Q&A, I’ve scattered a few lights around the volumetric distribution using a test render as a guide to cloud density. Using these lights I’ve also added additional Glow and Star render effects to simulate intense stars distributed in and around the nebula, and have also doubled up the glows on a few of them to break up the uniform glow that would be present with only one global render effect applied.

Enlarge Screenshot Open up the nebula_start.max scene included in the resources zip file. Open the Material Editor, create a new Gradient Ramp map. Set the flag at position 0 to white, create a white flag at position 1, a yellow-orange colour at position 10, orange at position 30 and a darker orange-red at position 100. Set the Noise amount to 0.35, Size to 5, type to Fractal and set the Levels to 10.
Enlarge Screenshot Create an Omni light at 0,0,0 and label it Omni Core. Enable Inverse Square decay and set the Decay Start to 100. Enable Use and Show Far Attenuation and set its Start and End values to 100 and 500 respectively. Instance the Gradient Ramp map to the Projector Map slot in the light’s Advanced Effects rollout.
Enlarge Screenshot Copy the light and label the copy Omni Fractal. Amend the Decay Start and Far Attenuation Start to 50 and set the End value to 300. Copy the light again and label the new light Omni Turbulence. Set the Decay and Far Attenuation Start values to 50 and End to 400.
Enlarge Screenshot Open the Environment panel and add a new Volume Light Atmospheric Effect. Label it Volume Light Core. Enable Exponential, set the Density to 7, Max Light to 100 and enable Noise On. Set the Amount to 1, Type to Turbulence and enable Invert to generate the dark patches. Set the High to 0.1, Levels to 6 and Size to 500. Click on the Pick Light button and select the Omni Core light to add it to the Effect.
Enlarge Screenshot Add a new Volume Light Atmospheric Effect. Label it Volume Light Fractal. Enable Exponential, set the Density to 50 and enable Noise On. Set the Amount to 1 and Type to Fractal. Set the High to 0.4, Low to 0.35, Uniformity to 0.2, Levels to 6 and Size to 140. Click on the Pick Light button and select the Omni Fractal light to add it to the Effect.
Enlarge Screenshot Add a new Volume Light Atmospheric Effect. Label it Volume Light Turbulence. Enable Exponential, set the Density to 50, Max Light to 100 and enable Noise On. Set the Amount to 1 and Type to Turbulence. Set the High to 0.5, Low to 0.4, Levels to 6 and Size to 150. Click on the Pick Light button and select the Omni Turbulence light to add it to the Effect. Render off using the Camera Viewport.
Enlarge Screenshot The final part of the two stage Q&A creates a volumetric nebula which gives us the ability to fly through it if desired.
Download the max file! Zip file to accompany.


Even though this does give a convincing result, it is still not as detailed as we would like. To add extra elements to the nebula, try creating a particle system with facing particles and distribute them through the nebula to create some wispy smoke effects and trails. You might also want to try using billboard / facing particles with smoke maps applied to add extra densities in desired places.

Also, try adding some additional lights of varying sizes to create star clusters and different flare types to suggest stars of different sizes and compositions. These can all be driven by a few post effects and including / excluding a light from each one; increasing or decreasing the effect by adding or removing the light from each flare element, even if all of the lights are instanced.

There are scripts available to distribute volumetric gizmos (and other non-geometric items) using Particle Flow, although are relatively easy to code, can be downloaded from http://www.scriptspot.com/bobo . However we need to bear in mind that this simply places a volumetric gizmo in a specific location and does not deal with opacity control or cloud type; these still need to be set in the environment atmospheric effect so a range of different effects will still need to be created and assigned to create a more natural look.

A volumetric plugin solution is obviously available in the form of Afterburn, which will produce much nicer effects than the standard system as we have greater control over the volumetric distribution and can also implement shading using lights to drive the nebula’s illumination. We can also include shadowing cast by additional Afterburn elements to simulate dust clouds and/or distribute the entire system using a particle system to get more fluidic formations.

Initially published: 3D World magazine, Issue 60, January 2005.

Copyright Pete Draper, January 2005. Reproduction without permission prohibited.