Advanced Distant Light for DAZ Studio
The Advanced Distant for DAZ Studio adds new features to extend control over lighting for more creativity and faster rendering.
The main focus of the light's design is aimed at faster shadow calculation. In addition to optimized internal code, you have the ability to use of different
shadow quality settings for different surfaces. These features work together to make soft, ray traced shadows faster then ever.
The advanced settings of the light may be a little confusing at first and some features may take a bit of trial and experience before becoming part of a fast workflow.
However, the light's dials have been set to defaults which should work well and render faster in most situations right out of the box.
The base settings of the Advanced Distant Light are very similar to the default DAZ Studio distant light.
Settings such as intensity and light color work in the same way you expect from the DS default light.
The greatest benefit of the light is in the lighting control section which allows you to selectively adjust how the light behaves
when illuminating different objects or surfaces.
Selective illumination is achieved by instructing the light to look for particular settings on surfaces in the scene. For instance, the
light can be told to look for any surface which has a diffuse strength of 99%. If the light finds a surface which matches that criteria it
"flags" that surface as one that should be treated in a special way.
The light has a drop-down menu with several options telling the light what to do when it finds surfaces which have been flagged.
The light can use lower or higher quality settings for those surfaces, completely ignore those surfaces or illuminate only those surfaces.
Have you ever rendered a scene that went very fast except for one, very slow rendering item, such as transmapped hair?
The flagging feature of the Advanced Distant Light allows for faster shadow settings to be used on those troublesome surfaces.
Another common situation is when a little extra illumination is needed for just one surface, such as an additional rim light
on hair. Through flagging, you can tell the Advanced Light to only illuminate the hair.
The light can be found in the content folder under Light Presets - Age of Armour - Advanced Distant Light.
Aim the light just like you would a DS default distant light. I find that viewing through the light (In the view menu) is
often the easiest method to adjust the direction of the light.
By default, the light has shadows enabled. To disable shadows simply set the shadow strength to 0% or Shadow Samples to 0.
The light uses an optimized ray trace function for shadows which, with the proper settings, will render much faster than the ray traced
shadows of other DS lights. Mapped shadows are not available in this light.
The most important settings to keep in mind are Hitmode, Shadow Samples, Shading Rate and Max Error. These settings all work in conjunction
as speed vs quality throttles.
The higher the Shadow Samples the slower the render but the smoother soft shadows will look.
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.
Take note that the Shadow Samples in DAZ Studio's render settings have no effect on this light. This is intentional, allowing for different lights to have
different shadow sample counts for greater control over quality and render speed.
Also note that a Max Ray Trace Depth of 1 or higher, in the DS render settings, is required for shadows.
- A PDF version of this guide should be available in your DAZ Studio "ReadMes" folder. Additionally, you can download this guide for offline viewing
by right clicking any blank area of this page and selecting Save Page As...
- As with most lights, the illumination itself is fast to calculate but shadows can be slow. Rendering can be made faster
by setting Cast Shadows to off for little seen, or out of focus, background objects. By default the light will respect object shadow settings and
not calculate shadows for these items.
- A Shadow Samples setting of 0 disables shadow calculation. This can be used to selectively control which surfaces receive shadows
by flagging the surface then setting the light to Use Alt Samples for flagged surfaces and set the Alternate Samples to 0.
- Primitive hitmode can produce substantially faster renders than Shader hitmode. Using this setting for draft renders
or in scenes where no transparency maps are used can be a huge time saver.
- Since Primitive Hitmode may produce shadows which are too dark on or around transmapped surfaces, you
can flag the transmapped surfaces, and the surfaces receiving shadows from the transmapped items, then set the light so that it uses
Shader Hitmode for these surfaces only.
- Try a low Subsurface Samples setting since SSS will often look smooth even at far lower shadow sample rates than general diffuse surfaces.
This can greatly improve SSS lighting precalculation times.
- Different lights can be used to illuminate different surfaces. Try using a light with faster settings for transmapped surfaces.
- Holding Shift or Control (Command on a Mac) while selecting lights can allow for the settings of multiple lights to be adjusted at once.
- If you want to quickly match the settings on multiple lights, you can select one light, hit CTL+C to copy the light's settings
then, with the other lights selected, use CTL+V to paste the settings.
This can be useful for quickly setting up different lights to illuminate different surfaces. After matching the lights simply set one to
Illuminate Flagged Surfaces Only and the other to Don't Illuminate Flagged Surfaces
- Although rendering my be slightly slower, objects with Sub-D applied usually look significantly nicer in renders then those where the base mesh is used.
- Other than specular, 100% reflective or refractive objects, such as chrome and clear glass, often look the same even with
no light or shadows hitting them.
Rendering can go faster by flagging such items to not receive shadows (a setting on some surface shaders) or flagging
the surfaces so the light does not illuminate them at all.
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 light's color, intensity and whether it should cast specular, diffuse or both.
One parameter that may look unfamiliar is the __category text field. This setting can be largely ignored at this time.
It is included for forward compatibility of future, special purpose shaders.
- Illumination - Drop down menu to set the light to On (cast both diffuse and specular light)
Diffuse only, Specular only or Off.
- __category - A text name may be entered into this setting to allow special shaders, with custom illumination loops, to process
only lights with a matching category name.
- Light Intensity - Sets the overall strength of the light. The limits of this setting can be increased if a very bright light is necessary
or set to a negative value to create a light which darkens areas of the scene rather than illuminating them.
- Light Color - Color popup allowing overall hue adjustment of the light's illumination.
Click here for a larger image.
The parameters in the Shadow group adjust the appearance and quality of ray traced 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 control of the light, you can selectively illuminate different objects with different shadow settings or different lights.
This allows for the speed enhancements to be turned off for onlt surfaces where higher quality settings are needed yet keep the fast rendering optimizations
for surfaces where the enhancements will have no negative effect.
It is important to note that shadows are calculated by shooting rays from the surface toward the light rather than the other way around.
Because of this, the shadow settings for flagged surfaces will effect the shadows that those surfaces receive... not the shadows they cast.
When you use Alternate Samples settings on a surface, for instance hair, remember that the light will use lower samples only for
the shadows which the hair receives or casts onto itself. The shadows which the hair casts onto other objects will use the higher Shadow Samples
setting (unless those surfaces are also flagged to use the Alternate Samples setting.
That may sound counter intuitive but it is simply how RenderMan shading works. Shadows are calculated at points on the surface, comparing
their positions to the light source, and casting shadow rays to see if something is blocking the path between the surface and the light.
Although it may not seem that there would be a much of an improvement for a transmapped surface to lower the samples it receives rather than lowering
the samples of the shadows it casts, it does in fact, greatly reduce rendering times.
- Adaptive Sampling - When enabled, the light will use fewer shadow sample iterations in areas which may require fewer samples.
In these areas the sample count can be as low as 1/4 the Shadow Samples setting.
As shadow quality may suffer, it is recommended that this setting be used only when Shadow Samples is set to 64 or higher.
- Shadow Color - Sets the overall hue of shadows.
- Shadow Strength - Adjusts the strength, or contrast, of shadows. A setting of 0% will completely disable shadow calculations for the light.
- Shadow Softness - This setting causes shadows to spread softly with distance from the shadow casting object. Softer shadows should be
accompanied by higher Shadow Samples settings. Conversely, there is little or no benefit to having high sample counts when sharp shadows are used.
- Shadow Samples - Declares the highest number of rays which will be cast from a surface point to check for a shadow casting object.
Higher samples generally create shadows which are less grainy, though overall quality or speed is determined by a combination
of Shadow Samples, Shading Rate and Max Error. A setting of 0 disables shadow casting.
- Alternate Samples - This setting is the same as Shadow Samples but an alternate rate which can be used on
surfaces flagged conditionally with options in the Lighting Control Group. A setting of 0 disables
the receipt of shadows for surfaces flagged to use the Alternate Samples setting. This can be very useful to cause select surfaces to cast shadows but
not receive them.
- Subsurface Samples - Another alternate sample rate which will only be used in the pre-render, subsurface scattering calculation pass
in scenes containing subsurface shaders. The Shadow Samples setting will still be used for the diffuse portion of these shaders but
subsurface calculation will have a speed benefit from using a lower sample count (even as low as 1 or 2 samples) with little or no noticeable
quality loss. Setting this parameter to 0 will cause shadows to be disabled during the subsurface precalculation.
- Shading Rate - Similar to the setting of the same name located in DAZ Studio's render settings, this parameter adjusts how small of an area
an surface should check for shadows. Higher values render considerably faster but the results tend to look washed out and detail may be lost.
The setting is roughly based on geometry and screen space. At a Shading Rate of 1 the geometry under every image pixel will cast
rays to detect shadows. At a setting of 16, rays will be cast only, approximately, every 16th pixel and the result interpolated
over the area of the 16 pixel shading grid.
This setting, and overall shadow quality, is strongly influenced by Max Error and Shadow Samples.
- Max Error - A speed versus quality adjustment which sets the maximum allowable interpolation error of the Shading Rate.
Higher Max Error values will render substantially faster. Note: The light's Shading Rate setting must be greater than 2
for the Max Error speed benefit to kick in.
- Shadow Bias - Like the bias setting on other lights, this offsets the shadow calculation a slight distance away from the surface
to avoid self shadowing artifacts. If shadow artifacts do appear try increasing the bias, apply Sub-D to the geometry or use
Hit Sides - Front.
- Hitmode - This option tells the render whether it should examine a surface's transparency for every shadow ray
(Shader Hitmode) or if it should examine only the base Opacity Strength setting once.(Primitive Hitmode).
Because Shader Hitmode requires the entire surface shader code to be run and be examined it is usually much slower than
Primitive hitmode. The drawback to Primitive hitmode is that only the Opacity Strength of a surface is considered... transparency maps
and procedural transparencies are ignored. This causes things like transmapped hair to cast darker, inaccurate shadows.
In scenes where there are no transmapped surfaces, such as architectural renders, you may gain a substantial render speed benefit
from using Primitive Hitmode without any noticeable image quality loss.
- Hit Sides - This tells the shadow ray function which side of a polygon to consider in shadow calculation.
Front only casts rays from, or hits the side of faces where the shading normal points in a positive direction.
This can sometimes prove useful with creative application. It also works around a long time issue in DAZ Studio where non-subdivided
3d models would appear to have blocky artifacts where light hits curved surfaces at a glancing angle.
Back does the opposite, only casting rays from the negative geometric normal facing direction.
Although this setting generally does not produce desirable results, it can be employed selectively to speed up renders
by using it on "Proxy" or "Fantom" objects creating simplified shadows which cast in one direction only.
Setting this to Both casts shadow rays and considers hits from both sides of a micropolygon. This option usually produces the best results.
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 Distant Light really shine.
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 shadow 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.
- Set Light Strength with Surface Ambient Strength - When enabled, the Advanced Distant Light will multiply the
Light Intensity setting by the surface's Ambient Strength setting.
This allows the light strength to be fine tuned for each surface individually.
Only the surface's Ambient Strength setting is used, not the Ambient Color. Because of this, the surface's ambient color
can be set to black, ensuring the surface does not need to glow in order to use this feature.
- Object Cast Shadows - With this set to Respect Object Settings, shadows will not be cast from objects
which have their Cast Shadows switch set to off. The light will also respect the Receive Shadows setting available
on some surface shaders.
An object's Cast Shadows setting is found by selecting the object
or figure's root node and looking under the Display group in the Parameters tab.
When the light is set to Always Cast Shadows it will, as the name suggests, calculate shadows even for objects which are set
to not cast or receive shadows. This can be useful to have an object cast shadows from one light but not another light.
- Flag Surfaces With - This drop-down menu offers several options to instruct which surfaces the light should
flag and treat differently.
None disables flagging and the light will treat all surfaces in the same manner.
With the second option the light will flag surfaces which have their Diffuse Strength parameters set to a value matching the
Diffuse, Ambient or IOR Value setting immediately below.
The light can also flag any surface with its Ambient Strength or Index of Refraction parameter
set to the Diffuse, Ambient or IOR Value. Note that, for the AoA Subsurface Shader,
Reflection Index of Refraction is the parameter that the light examines, not the IOR in the Subsurface Scattering group.
The fifth option in the drop-down menu will have the light flag any hair which uses the Garibaldi hair shader.
Attempts were made for the light to recognize and flag the Look At My Hair shader but, unfortunately, due to the way
its hair shader works, it was not conducive to flagging.
The final option in the drop-down menu, Any of these, will cause the light to flag any and all surfaces where the light
finds a Diffuse Strength, Ambient Strength or Index of Refraction matching the Diffuse, Ambient or IOR Value
as well as any hair using the Garibaldi hair shader.
- Diffuse, Ambient or IOR Value - This is the setting that will be used to match values on surfaces which are to be flagged.
For instance, let's assume you have a slow rendering glass surface which has an index of refraction of 1.35 and you don't want to be illuminated by the light.
You would set the Flag Surface Shaders With to Index of Refraction Value Of..., then the Diffuse, Ambient or IOR Value to 135%
and If Surface is Flagged to Don't Illuminate
- If Surface is Flagged - This menu works in conjunction with the Flag Surfaces With and Diffuse, Ambient or IOR Value settings.
If a surface is flagged you can choose from several ways the light should react to that surface.
The first option, Don't Illuminate, will instruct the light to completely ignore any surface which has been flagged.
No light or self shadowing will be calculated for the flagged surfaces.
Illuminate Flagged Only will cause the light to do the opposite as the previous setting. The light will only illuminate
and calculate shadows for surfaces that are flagged. This and the above setting can be very useful to have different lights
responsible for illuminating different surfaces.
Use Alt Samples will instruct the light to illuminate all objects but use the Alternate Samples setting
for surfaces which are flagged. This can be used to improve rendering speed by flagging slow rendering or less important background objects.
Use Shader Hitmode can be used when the light's Hitmode is set to Primitive but one or two surfaces with transparency simply
do not look good under the Primitive hitmode. Those surfaces can be flagged to use the slower Shader hitmode
while still receiving the speed benefit of having all other surfaces use the faster Primitive htimode.
Use Primitive Hitmode is intended to provide a rendering speed improvement, when the light is in Shader Hitmode,
by flagging a few surfaces which can benefit from the Primitive hitmode without the image quality suffering.
Use Shader Hitmode and Alt Samples - This is primarily intended to improve the rendering speed of transmapped hair. It allows the surface
to use correctly calculated transparency maps but at a lower shadow sample count.
Use Primitive Hitmode and Alt Samples - Flagging a surface and using this setting will likely produce the fastest results for the
flagged surface. Because of the Primitive hitmode, this setting may not look correct for transparency mapped surfaces but could be useful for
background items or, simply, for setting transmapped hair to a fast rendering option during draft or test renders.
Very Rare Conditions - The Advanced Distant 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.
Only when using volumetric atmosphere All functions of the light work well with volumes (many of the images in this user guide were
rendered from my atmospheric cameras) with the exception of when the light is set to have different intensities for flagged surfaces such as using the
Set Light Strength with Surface Ambient Strength feature. This is likely to cause artifacts surrounding the lower intensity surface.
The issue is a difficult one to resolve due to how atmospheric volumes work. I continue to test new light and volume codes in the hopes of finding a fix.
Somewhat Common - At the time of this writing, all surface shaders will be properly illuminated by the Advanced Distant Light
but flags can only be read from surfaces which use the DS Default shader, UberSurface, pwSurface, pwCatch, HumanSurface, SimpleSurface and the AoA Subsurface Shader.
I'm experimenting with some DAZ Studio scripting which may allow shaders created in Shader Mixer to be updated and allow for proper flagging.
When using copy and paste - After using CTL+C and CTL+V to copy the settings from a default DS light and pasting those settings onto an Advanced Light,
if the Advanced Light is then turned off, using the eye icon in the Scene tab, you may not be able to turn the light back on again. This
bug is perplexing and I have not yet been able to track down the cause.
RenderMan (R) is a registered trademark of Pixar.