Chapter 22 | Volumetric and Environment Lighting


Virtual Tutor: Go to help > lights > create light to learn more about the volumetric lighting tool.

In Virtual CRASH, users can adjust environmental lighting to create nighttime sky effects and to emulate the effect of sun positioning. Users can also include volumetric lighting effects into animations and diagrams. The primary reason to include lighting in our scene is to improve the overall illumination of a scene, increase realism through realistic lighting and shadowing, and of course, model a light source such as a vehicle’s headlights and taillights. With the volumetric lighting tool, you can provide the viewer with visual indications that (1) an object in the 3D environment is providing a source of illumination, and (2) an object in the scene is being illuminated. 

Please note, the intent of the volumetric lighting tool is not to provide a predictive model of what is or is not visible by a human observer, nor is it to predict what effect visible light may or may not have on a human observer, but is intended to give the user a method to create visual cues for the audience regarding sources of light and objects under illumination within the 3D environment.  
 

Adjusting Environment Lighting

To modify the environment lighting, first deselect any selected object by right-clicking on its name, or by left-clicking (in [F2] or [F3] mode) in a region of your scene with no selectable objects. Next, under “properties”, go the “environment” menu in the left-side control panel. There you will find options to adjust the ambient lighting color and intensity as well as the sun (primary scene light) color, intensity, power, and concentration (see below). You’ll find additional options related to cloud cover and starfield.

As you make adjustments to these settings, you'll observe the quality of lighting and the sky adjusting in real-time in "Smooth+Texture" mode [Ctrl+7] and "Smooth" mode [Ctrl+5]. Fine-tune the settings as needed for your specific case.

Note, as you adjust the sun position, power, and concentration, the visual representation of the sun object will change accordingly. Active lighting and shadowing will update in real-time in [Ctrl+7] and [Ctrl+5] modes.

By default, scene lighting will also depend on the sky image, which is dynamically generated. To disable this dependency, deselect "image-based lighting".

Nighttime Sky

To create a nighttime sky, try lowering "sun intensity" and "sun power". Enable "use starfield" and adjust "starfield intensity" and "starfield density" as needed.

Adjusting the Sun Position

In the environment menu, deselecting “auto direction” allows the user to set the azimuth and altitude of the primary scene light (Sun). The azimuth sets the Sun’s horizontal angular position with respect to the global x-axis (see below), with the Sun’s distance from the scene effectively infinitely large. The altitude sets the Sun’s angular position with respect to the horizon. At an altitude of 90 degrees, the Sun is directly overhead. At 0 degrees, the Sun is at the horizon. Note, negative values for azimuth are also possible.

The video below illustrates the various sky customization features.

 

HDRI ImporT SUPPORT

If you prefer using HDRI files, simply drag and drop them directly from your Windows File Explorer into the sky area, or use the “background image” button to load the file. To remove the file and revert to using the sky control settings, press the “x” button. This process is illustrated in the video below.

In the video below, an HDRI file was used for the background and sky.

 

Creating Lights

To create a light, go to Create > Extended Primitives 3D > Light (see below). 

You will then see a lightbulb icon following your mouse cursor. Simply left-click in your scene to place the light. Alternatively, you can hold and left-click to place the light, then move your mouse upward or downward to adjust its z position, and release to finalize its placement. Continue placing lights as needed by left-clicking again. Right-click to stop placing lights in the scene. By left-clicking on a vehicle object, you can attach a light to it.

Please note, the position at which Virtual CRASH mounts a light is determined by the location of the mouse cursor at the moment the left mouse button is pressed. This position can be adjusted using your mouse or by entering values in the position-local input fields on the left-side control panel. Virtual CRASH will select from the “front”, “back”, “directional”, “siren”, and “candelabrum” presets, based on the direction the selected polygon surface is facing at the time of placement. It is the user's responsibility to ensure that light positions and orientations are suitable for the specific vehicle.

Like any other object in Virtual CRASH, lights possess both position-local and rotation-local attributes. This allows you to place lights anywhere in your scene or to adjust them by left-clicking on the light and dragging. If a light is attached to a vehicle or another object, its position and rotation-local values will be relative to the parent object.

As you place lights into the scene or modify their various attributes, you'll see the real-time rendered display actively updating.

Below we see shadow effects from the light. 

Customizing lights

The light objects have many attributes which can be customized. These are reviewed below. 

Decay

Left-click on your light object. In the left-side control panel, you will find the “decay” menu. Users can create light decay by setting “type:inverse” or “type:inverse square”. Using “type:inverse” will cause the intensity as a function of distance to be multiplied by a factor of 1/R outside of the “start” distance. Using “type:inverse square” will multiply the intensity function by a factor of 1/R^2 outside of the “start” distance (see below). In the figure below, the start distance is set to the same distance as the circle’s radius for reference. 

Note, the “show” option will provide a visual indication of a light’s “start” distance whether the light is actively selected or not. If “show” is not enabled, the “start” distance indicator will only be visible when the light is selected. 

Far Attenuation

The user can force light to attenuate based on distance through options in the "far attenuation" menu. Light intensity will decrease to 0, starting from the "start" distance and concluding at the "end" distance. Virtual CRASH provides a visual indication of the start and end distance radii with white and black circles, respectively (see below). This feature is ideal for ensuring that objects beyond the "end" distance receive no illumination from the selected light source.

Light Types, Intensity, and Color

In the “misc” menu, the user can change the state of a light to either on or off by toggling the on/off button directly, or by using the square button dropdown menu, much like the traffic signal device. This is useful for timing sequences of lights, such as siren lights, turn signals, muzzle flashes, etc.  

In the “misc” menu, the user can change between point light (“omni”) and spotlight using the “type” dropdown menu (see below). The spot light feature is a great way to precisely control the direction of illumination.  

Using the “intensity” and “color” inputs, the user can control both the initial light intensity and the light color (see below). Note, using the square-shaped dropdown menu next to “intensity”, the intensity of a light can be varied as a function of time using the diagram tool. 

Using the “shadow” toggle, one can also disable shadow effects.

Note, the “size” and “distance” attributes allow the user to increase the size of the light icon and the visual indication of the light’s extent within the scene. This is simply to make editing within the 3D workspace easier for the user. 

In the “presets” dropdown, one will find a number of preset lights available, such as headlight (“front light”), taillight (“back light”), turn signals (“directional indicator”), siren lights, and street lights (“candelabrum”). These presets are simply to aid the user in quickly rigging vehicles with lights and are not intended to model any specific vehicle lighting system. Once the user has rigged a vehicle with lights, the user can then customize the light settings as needed for the subject vehicle. Rigging vehicles is discussed further below. 

Note, when the spot light is used, an additional menu command becomes available, “source”. The source option allows the user to also give a spot light an omni light effect, which can be attenuated using the “start” and end” options (see below).

Spot lights also offer the ability to customize the angular attenuation of the light cone. Within the "light cone" menu, users will find settings for "hotspot" and "falloff". When editing in the 3D workspace, the hotspot size is represented by a black cone, and the falloff by a white cone. The intensity, as a function of the angle away from the spotlight’s forward direction, decreases starting from the hotspot angle and concluding at the falloff angle.

Using the “shape” dropdown menu, spotlights can also take on a rectangular shape rather than circular. Use the “aspect” input value to modify the ratio of length to width (see below). 

Volumetric Lighting Effect

Users can enhance the realism of their animations and diagrams by using volumetric lighting. This feature allows light to scatter in all directions within a specified volume. This allows one to emulate the effects of fog, smoke, or other particulates that would also be normally illuminated when close to a light source. The volumetric lighting feature is also a great way to create a Sun-like object in the 3D simulation environment. Both omni and spotlights can use volumetric lighting. Simply left-click to select your light object, then in the left-side control panel, go to the “volume” menu. Use “start” and “end” to customize the volume around your light within which you would like volumetric lighting to be applied. Increasing the “density” has the effect of increasing the intensity of light emanating from the specified volume. Increasing the number of “samples” improves the volumetric lighting quality but can slow render time. The color of the light emanating from the specified volume can be made its own color independent of the light source itself. The color of the light volume at the end of the attenuation envelope can also be customized. These features allow open many possibilities for creating incredible special effects within an animation.  

 

Emissive Lighting effect

Emissive materials emit light as if they are light sources themselves (note: they do not produce actual illumination in the scene as of the initial release of VC6), independent of external light sources. Therefore, you will typically want to use emissive materials in conjunction with volumetric light objects. The emissive property is useful for creating objects that appear to glow, such as screens, light bulbs, or other visual effects. The emissive property can define both the color and the intensity of the perceived light emitted by the material. The emissive PBR material property is discussed in Chapter 23. When using emissive materials, you will typically want to enable the global bloom effect discussed in Chapter 2.

Many of the features discussed above are shown in the video below.