Advanced Ambient Lighting for DAZ Studio

Contents

A clay ambient occlusion render of a race car. Introduction Important Concepts Quick Start Quick Tips Parameter Settings Tips for Baking Occlusion Known Issues

Introduction

DAZ Studio render of renaissance tough looking night watchman holding a lantern.

The AoA Advanced Ambient Light for DAZ Studio works by itself to create beautiful, soft lighting or along with other lights to help provide extra accent lighting and detail with ambient occlusion.

Wanting more lighting flexibility in DAZ Studio, I created this light for use in my own projects. Over the years I added more features as needs arose. These features mainly focus on control and rendering speed optimizations. Other features include settings to adjust the softness of occlusion and lighting functions to allow for the proper baking of ambient occlusion to texture maps.

At first glance it my not appear particularly special but, with use, I believe the extra control that this light offers will become indispensable. Almost every Daz Studio render I have created over the last few years has used a version of this light as either the only illumination in the scene or as the scene's principle fill light.


Important Concepts

Three renders showing the differences between a spotlight and the advanced ambient light.

Instead of behaving like a lightbulb where the light emanates from a single point shining outward, the Advanced Ambient Light works like a sphere of light shining inward, from all directions.

To allow for more control over what areas of the scene are illuminated, the Advanced Ambient Light includes illumination range and falloff blend features. Although this is not a physically correct way for light to behave, the effect is very pleasing and believable.

The ambient fall off effect can be used in conjunction with standard directional lights to produce a very convincing "Bounce" light appearance without the long render times associated with full indirect lighting.

Roman pool scene illuminated by 3 lights.

Although attempts have been made to clearly label the settings and make the light as intuitive as possible, the additional controls make this a light intended for advanced lighting.

The advanced features of the light may be a little confusing at first. However, the light's dials have been set to defaults which should work well in most situations right out of the box.

Please note that the lighting and occlusion will work on any surface but some of the advanced, surface flagging features will only recognize materials which use the DAZ Studio Default, Ubersurface, HumanSurface, SimpleSurface or the AoA Subsurface Shader. These shaders are used for the overwhelming majority of DAZ Studio based materials so it is rare that a user will encounter any limitation with the light.


Quick Start

DAZ Studio screen capture showing the ambient light loaded into a scene.

The light can be found in the content folder under Light Presets - Age of Armour - Ambient Light.

The radius of the distance falloff begins at the light's icon which appears like a wireframe "C" with 6 spikes pointing in all directions. If you wish to use the light with falloff, move the light to the point where you wish the brightest illumination and adjust the Light Radius setting (Found in the 'Parameters' tab) to encompass the area of the scene you wish to illuminate.

If you prefer to illuminate everything in the scene evenly, simply set the Light Radius to 0.00. This overrides the falloff function and causes the light to behave similarly to an environment light.

As with the default DAZ Studio lights, the illumination drop-down list allows setting the light to selectively cast diffuse and/or specular lighting. The Intensity and Light color also work the same as standard DS lights.

The most important settings to keep in mind are AO Samples, AO Shading Rate and AO Max Error. These settings all work in conjunction as speed and quality throttles.

The higher the AO Samples the slower the render but the smoother the appearance. Shading Rate and Max Error work the same way but in the opposite direction where lower values produce quality results and higher values will render faster.

The remaining settings allow for more advanced customization and control over the light and are explained in detail below.


Quick Tips

General


Parameter Settings

Light Group

3d rendering of a television illustrating the light colors and falloff settings of the Advanced Ambient Light.

The parameters of the Light group contain settings which are familiar to, and work much the same as, those of standard DAZ Studio Lights.

In this group you can adjust the color and intensity of the light as well as control the range of the light. Occlusion is not calculated beyond the radius ensuring that renders are as fast as possible.

The Falloff Color sets the color of the light which is beyond the Light Radius. A falloff color of black will probably be the most common usage but control is available to adjust the light color outside the radius should a special need arise.

Occlusion Group

A chart of renders illustrating the effects of various ambient occlusion sample and irradiance shading rates. Click here for a larger image.

The parameters in the Occlusion group adjust the appearance and quality of the occlusion based shadows.

There are several speed enhancements, such as adaptive sampling and primitive hitmode. These enhancements may not look good in all situations.

Fortunately, because of the advanced lighting controls of the light, you can selectively illuminate different objects with different settings or different lights. This allows for the speed enhancements to be turned off for surfaces where higher quality settings are needed yet keep the fast rendering optimizations for surfaces where the enhancements will have no negative effect.


Click the buttons to toggle the effect of each setting An illustration showing the basic concept of raytracing and occlusion based shadows.

Lighting Control

3d fashion portrait render using 3 lights. Each light uses different quality settings to speed up the processing.

The features available under the Lighting Control group allow you to set how the light behaves for different surfaces and objects. This is where I feel the benefits of the Advanced Ambient Light really come through.

The light examines all the shaders in the scene and looks for certain settings or "flags." The light can then, at your discretion, adjust the lighting differently for the flagged surfaces.

The light can be told to use lower samples for flagged surfaces, illuminate them at different strengths or even completely ignore those surfaces. It is also simple to have the light only illuminate surfaces which have been flagged. This allows for different surfaces to be illuminated by different lights for ultimate control of your lighting.

A render showing how one object can be flagged to use fewer shadow samples than on another object.

Tips for Baking Occlusion Maps

5 images showing baked illumination texture maps and a 3d model using the baked occlusion textures for the shadowing.

DAZ Studio has a very handy built in feature to bake lighting onto a texture map. The process is a bit slow so it is not time efficient for use in rendering single images in most cases.

Baking ambient occlusion can, however, be a huge time saver for animations. Baked light maps can be produced for every item in a scene that does not move. The textures can then be used either in the Ambient Color or Diffuse Strength slots of surface shaders. This will eliminate the need for raytraced occlusion to be used for these surfaces when the animation is rendered. This could save minutes or even an hour per frame.

Baked AO maps can also be useful in the creation of diffuse textures. I find, bringing in the baked AO map as a layer into Photoshop serves as a good guide when painting textures. The occluded areas may be good places to add rust since they represent crevices which could trap water and dirt. The bright areas are more exposed surfaces where paint may be worn and chipped or where wood will have been sun bleached.

When baking ambient occlusion to a texture map the Polygon Facing Direction is very important. This should be set to Surface Normal. Without this setting, polygons facing away from the camera would automatically flip and receive the incorrect illumination.

Although it would not seem to work properly, setting the light to Hitsides - Both usually produces nicer light maps. The reason is a bit hard to explain but the result is that polygons which are inside other polygons will render as being in shadow. Without this setting those inner polygons would cast out rays yet not see the outer polygons covering them. This is because the ray collisions would be on the backside of the outer polygons which the Hit Sides - Front setting tells occlusion to ignore.

Not all surfaces will bake well in DAZ Studio. Models using UV coordinates outside the 0-1 range, models with geometry errors such as inconsistent surface normals, or overlapping UVs (within a single material) will likely produce unusable light maps.

Below is a screen capture showing the settings I commonly use when baking illumination in DAZ Studio. Since baking can sometimes be slow you may wish to use a smaller texture resolution while doing initial test bakes.

A screen grab of suggested settings for illumination baking in DAZ Studio.

It is important to note the Bake Surfaces Simultaneously mode. Without this setting surfaces will only bake their own occlusion, not the occlusion cast onto the surface by other objects. To have the bake include the occlusion cast by other objects onto the surface you must also select and bake those other surfaces at the same time. This is often inconvenient but it is simply how illumination baking is set up in DAZ Studio.

Also keep in mind that the resulting textures are saved using the surface's name. This will cause improper baking if two objects share the same surface name. For example, all DAZ Studio primitives have the surface name "default". To ensure a sphere primitive sitting on a plane primitive will properly bake to 2 different textures with unique filenames, you will need to rename one of the surfaces with either DAZ Studio's Polygon Group Editor Tool or use a modeling application.


Known Issues

A screen grab showing what the light looks like if the install was not successful.

Somewhat Rare - DAZ Installer - There have been reports that (on computers running Windows) the DAZ Install Manager does not always install a few of the necessary files to the correct location. If you load then select the light and it shows only two parameters, Light Color and Light Strength, then the light did not install correctly. You will need manually move some files into place.

Under the computer's Admin User's folder there must be the following:
C:\Users\AdminUserName\AppData\Roaming\DAZ 3D\Studio4\scripts\support\AgeOfArmour\Light

And in C:\Users\AdminUserName\AppData\Roaming\DAZ 3D\Studio4\shaders\AgeOfArmour\Light

When using UberSurface - The Advanced Ambient Light will see and respect the Occlusion Shading Rate and Override settings of the UberSurface shader in all cases except when Ubersurface's Occlusion Shading Rate is set to exactly 4. All other Occlusion Shading Rate settings will function properly. This was simply a limitation that had to be incorporated in order to allow for greater overall light flexibility.

Somewhat Common - At the time of this writing, all surface shaders will be properly illuminated by the Advanced Ambient Light but flags can only be read from surfaces which use the DS Default shader, UberSurface, HumanSurface, SimpleSurface and the AoA Subsurface Shader. I'm experimenting with some DAZ Studio scripting which may allow shaders which have been created in Shader Mixer to be updated and allow for proper flagging.

Somewhat Rare Conditions - Diffuse or specular artifacts may appear when multiple and overlapping Advanced Ambient Lights are used with different AO Max Distance or AO Cone Angle settings. Differing any other settings should not cause an issue. The cause is unknown at this time however, it is unlikely that the lights would be used in this manner very often.

Only when using Volumetric Atmosphere All functions of the light work with volumes with the exception of when a single light is set to have various intensities on different surfaces, such as using the Set Light Strength with Surface Ambient Strength feature. This is likely to cause artifacts surrounding lower intensity surfaces. The issue is a difficult one to resolve due to how atmospheric volumes work. I continue to experiment with volume code in the hopes of finding a fix.

When using Copy and Paste - Using copy from a default DS light which has shadows turned on then pasting onto the Advanced Ambient Light, will cause DAZ Studio to attempt to use its builtin shadow functions, which the ambient light does not support, such as Deep Shadow Maps. This will cause the light to render black.

This situation is easily resolved by setting DAZ studio to show hidden parameters, selecting the Advanced Ambient Light and changing the hidden Shadow Type (Warning DO NOT USE) dropdown to None. The light should then perform correctly.

It appears DAZ Studio requires this menu for all lights. When I removed it from the code, DS replaced it upon loading the light, haha. The best solution I could find was to hide the setting and add a warning not use it.


Top Introduction Important Concepts Quick Start Parameter Settings Baking Occlusion