You are on page 1of 14

1 INTRODUCTION

Hi, thank you for purchasing my Naturally Real Shaders. I


want to begin by giving an overview of the thoughts that
went into the design of this product. Hopefully, by getting
some insight into the “why”, you will gain a better grasp of
the “how.”

iFabric is based on the same core design as iMetal, meaning


there are two base components. The first is a metallic BSDF,
driven by a Complex IOR. The second is a diffuse BSDF
with specular reflectivity provided by an IOR-driven Glossy
Layer.

In principle, these core aspects align with the default


behavior of the Iray Uber Shader. However, the final results
are more precise and based on real-world numbers. For
instance, in the Iray Uber Shader, the reflectivity of the
metallic component can only be controlled by the brightness
of the Base Color. There is no means to change the index of
refraction of the metal. Perhaps that may seem to be a small
detail to worry over. However, it does matter when it comes
to realism because it forces you to play a guessing game,
rather than knowing you have made a physically correct
material.

Likewise, in the Iray Uber Shader, you have the Glossy


Reflectivity parameter, which is similar in concept to the
Glossy IOR parameter of iMetal and iFabric. However, using
a precise IOR value that you can research online to be
certain you have the realistic result you are after is always a
better strategy for achieving realism.
So, if you wanted to sum up the difference in design philosophies it comes down to knowing
your settings are correct, rather than eyeballing it and hoping for the best.

That said, while the foundations are similar, the details can be very different. Both Naturally
Real shaders were created to tackle specific roadblocks to achieving realism in Iray. In the
case of iFabric, it is the issue of creating a surface that has the visual softness of fabrics. The
primary solution to this is the Sheen features of iFabric, which is a recently added feature to
Iray. However, many other tools are there to aid in the task of creating a wide variety of fabric
looks. So, even if you don't use Sheen, you can get more realistic fabrics in iFabric.

My secondary design goal was to limit the number of shader parameters irrelevant to the
desired realism of metal or fabric. I made every effort to streamline these shaders, keeping
the focus on the parameters that matter. That said, there may be things you should know
upfront you will not be able to do with iFabric. First, you cannot use iFabric to make light-
emitting materials. Second, you cannot create single-sided SSS materials with iFabric. In both
cases, if I get enough user feedback asking for these features, I may go back and rework the
shader to add those more esoteric functions.

Finally, these shaders are merchant resources. You are encouraged to utilize these shaders
in the creation of your DAZ products. My goal has always been to make products that help
users create more realistic renders, with less effort.
2 THE SHADER PARAMETERS

2.1 BASE COLOR AND GRAZING COLOR

The reflectance of a material is its surface color and


intensity. Which, in iFabric, is defined by the Base Color
(Reflectance 0º, the color at camera facing angles) and the
Glancing Color (Reflectance 90º, the color at glancing
angles).

A pure white reflectance (RGB 255) would mean that all the light that falls on the object is
reflected. Black reflectance (RGB 0) means that all the light is absorbed. While the
reflectance colors control the amount of light the surface reflects, they do not control how that
light is reflected (diffusely or specularly). For that, read about the Roughness parameter
controls instead.

The Base Color is the object's primary color, and in most cases might be all you need to
change. However, in iFabric, there is a legitimate need for a Grazing Color. A division of
reflectance colors allows you to create a material that is one color when viewed straight and
another at sharper angles, such as fabrics like taffeta, silk, and velvet.

Realism Tip: Avoid setting the Base Color too bright. Pure white (RGB 255) means this
material will reflect almost all the light it receives, which does not happen in the real world.
That reflected light will end up producing noisier renders and result in a surface with very little
three-dimensionality. A more realistic setting, even for very bright materials, would be RGB
225-235. As an example, the reflectance of a white sheet of paper is around RGB 225.
However, this is only true for the Base Color. The Grazing Color can, and often should be, set
at pure white (RGB 255).

Likewise, setting the Base Color for pure black (RGB 0) will lead to unrealistic results that lack
form. A typical minimum reflectance for a black surface is RGB 13.
2.1.1 Metallic Reflectance & Roughness

In a metallic material, the Roughness setting and, to a certain degree, the Nd control how
much influence the balance between the Base Color and the Grazing Color has on the final
look. When the material's Roughness is very high, primarily the Base Color determines the
overall color of the material, and the Grazing Color has very little influence. Conversely, as
you decrease the Roughness, the Grazing Color will become more prominent.

For most materials, the Grazing Color is white. However, materials like metals usually have
tinted reflections. In which case, if you would like to create a red material, you should use a
lighter red, instead of white, for the Grazing Color so that the specular reflections become
tinted as well.

Realism Tip: In most cases, it is easiest to keep the Base Color within realistic brightness
limits by using the HSV fields in the color picker. That way you can control the brightness
(reflectance) of the hue directly with the Value field. Controlling your overall brightness with a
single number while maintaining the same Hue and Saturation is far easier than trying to
balance three numbers in RGB.
2.1.1.1 Metal IOR (Nd) and Glossy IOR

The IOR is the index of refraction of the material. The term Nd is to denote an index of
refraction as measured at the wavelength of 589.3 nanometers. In the Iray Uber Shader, the
IOR is mostly used for transparent volume materials like glass or water. However, it is still
important for even solid materials because it defines the strength of surface reflections,
known as the Fresnel effect.

The Fresnel effect states that the strength of reflections on a surface is dependent on the
viewing angle. For instance, looking straight down into the water of a lake (0° viewing angle),
you will see very weak reflections, allowing you to see into the water. But if you look far
across the surface at an increased angle, the reflections will be stronger, and you will not be
able to see past the surface. That water has an Nd of 1.33. If we were to increase that Nd
number to something like 3 (which is “normal” for metal objects), the surface would become
equally reflective, no matter the viewing angle.

A typical value for clear-coated plastic is an IOR of 1.491, whereas freshwater has an IOR of
1.33. This means the 0° reflectivity of the two surfaces is different, with water having a less
reflective surface than an acrylic clear coat, when viewed from straight on (0°).
2.1.1.2 Metal IOR (Nd) and Base/Grazing Colors

When creating a material that has any amount of Metallicity,


the amount of light reflected by the object is primarily
controlled by the reflectance gradient created between the
Base Color (0º) and Grazing Color (90º), for whatever
portion of the material that is metallic. The Metal IOR (Nd)
parameter controls the Fresnel curve, or the influence of
these two reflectance colors, depending on the viewing
angle.

This allows for fine control over reflectivity falloff, enabling special effects in things like sci-fi or
fantasy materials. However, it is worth remembering that in reality, the IOR alone specifies
how much light the surface reflects, with a higher Nd signifying a more reflective material.
Alternately, consider using a real-world Complex IOR (Nd plus K) to achieve the most realistic
results, as I do in my iMetal presets.

2.1.1.3 Metal Extinction Coefficient (K)

When measured in the laboratory, the index of refraction is not just a plain number. For
maximum realism, we want both the Nd number, as well as its accompanying K value (known
as a Complex IOR).

The K is the extinction coefficient: the amount of absorption loss when an electromagnetic
wave propagates through a material. However, the use of the K value is optional. In most
non-metallic materials it is okay to use the Nd by itself. Only in situations like metals, where
the extinction effect is important, is it necessary to use the K parameter to get a more precise
result.

Realism Tip: All iMetal presets use measured values for Base Color, Nd, and K to recreate
their respective metal more realistically. Please refer to the values found in those presets if
you wish to create a specific metallic fabric.
2.1.1.4 Nd and Roughness

For metallic materials, the Nd has less influence on the


reflectance of an object the higher you set the Roughness.
Instead, it is the Base/Grazing Color gradient that matters
more and more.

Lambertian is a special mode that diffusely reflects all light.


It is the theoretical highest roughness a surface can have (meaning it does not exist in
reality). The Nd does not influence the look of the material at all when working with
Lambertian materials.

There are two ways to create a Lambertian material in iFabric: For a fully metallic material, set
the Roughness to 1. With a non-metallic material, set the Glossy layer weight to 0.

Realism Tip: As you increase the Roughness parameter, it is advisable to lower the Glossy
Layer Weight to avoid a "powdery" surface. A good trick for this when working with textures is
to load the same Roughness texture, but inverted, into the Glossy Layer Weight slot.

2.1.2 Glossy IOR and the Fresnel effect

When using iFabric in a non-metallic mode, the reflectance gradient between Base Color and
Grazing Color values is used only for diffuse reflectivity (brightness) and will be ignored for
specular reflection. Instead, the specular reflectivity will be controlled exclusively by the
Glossy IOR (Nd), applied as a physically correct Fresnel Glossy Layer. The underlying diffuse
surfaces gradient between the Base/Grazing Colors can be modified using the Falloff
Exponent.

2.1.3 Falloff Exponent

For metallic materials, the falloff gradient between Base Color and Grazing Color is controlled
by a complex interaction of the colors chosen as well as the Nd and Roughness parameters.
A high Nd number means more Grazing Color will be visible when using a low Roughness
value. However, as Roughness increases, the Grazing Color will begin to disappear until the
Grazing Color will essentially no longer be visible at all, no matter the Nd setting of the
material.

However, there may be cases where you would like to have the Grazing Color visible at a
high Roughness. An example would be velvet, which has a high roughness, but a bright
"sheen" of a different color, which might not be possible to create without using the Falloff
Exponent.

Because the Falloff Exponent uses a simplified approach to calculating the Fresnel effect, the
default value of 3 gives "normal" opaque material results. A lower Falloff Exponent results in
the Grazing Color becoming more prominent, which takes over completely when the Falloff
Exponent reaches 0. Conversely, increasing the Falloff Exponent will restrict the Grazing
Color more to the edges. At very high values (above 40), the Grazing Color can disappear
entirely. In this way, the Falloff Exponent is a manual override of the Nd driven (and therefore
Roughness sensitive) control of the gradient between Base Color and Grazing Color. Perfect
for fine-tuning of results when creating color-shifting fabrics.

Realism Tip: the Falloff Exponent and the Sheen effect can work hand-in-hand to create
strongly color-shifting fabrics.

2.2 ROUGHNESS

Roughness simulates microscopic random height changes on the surface to make it reflect
light more diffusely. The Roughness of a surface can range from 0 (perfectly smooth) to 1
(pure diffuse).

You can also set a black and white texture to control the Roughness. Brighter values in the
texture create a higher roughness (a more diffuse surface). When using a texture, the
Roughness slider value represents the maximum Roughness the texture can achieve.

Realism Tip: The maximum realistic Roughness value is .97. I only use a Roughness value
of 1 (Lambertian) if using a texture to drive the Roughness parameter (and even then, only
rarely).
2.2.1 Multiscatter

Use the Multiscatter toggle to address situations where the material is getting too dark
because of light energy lost due to high roughness and anisotropy. This toggle will have a
particularly noticeable effect when working with a material that has a high amount of
Metallicity. However, the change will be visible on the glossy layer as well.

The underlying reason is the modeling of light rays meeting roughness. When the toggle is
disabled, we are working in the classic single scattering model, meaning light energy can
become terminated in the depths of highly rough surfaces. This model is faster rendering
(about 2.5% faster), and for low-roughness materials, you may even like the results better.
However, when the toggle is enabled, we enter a multiple scattering model. This model will be
slightly slower to render, but high-roughness and strongly anisotropic materials will become
noticeably brighter. That is because the light energy will now fully expend itself, bouncing
naturally inside the depths of the roughness model.

2.3 ANISOTROPY

By default, Roughness is an isotropic effect, meaning light is


scattered equally in all directions. However,
sometimes, like when you want to simulate the weave of a
fabric, you might want to pull the scattering of light in a specific direction, known as
Anisotropy.

Anisotropic reflections typically occur on surfaces with microgrooves or similar tiny details that
run in one dominant direction. Examples would be brushed metal or vinyl albums with single-
direction grooves that run in an organized circular pattern. Such surfaces will reflect light in a
specular way following the direction of the grooves, and in a more diffuse way in the direction
perpendicular to the grooves.

You can set the Anisotropy strength via the slider alone, or use a grayscale texture to control
the strength, with brighter values meaning stronger Anisotropy. When using a texture, the
slider sets the maximum anisotropy intensity.
2.3.1 Anisotropy Rotations

Specifies the main direction/angle of the reflected light. You can also use a grayscale texture
to control the anisotropy angle. Brighter values in the texture specify a larger angle, with some
gradients allowing for bending or circular anisotropic patterns. When using a texture, the
slider sets the maximum angle the texture can reach.

2.3.2 Anisotropy Weave Blend Weight

Fabric usually is woven, which consists of warp (vertical) and weft (horizontal) threads. These
two aspects of a weave can each have a unique anisotropic effect at the same time. So this
parameter was made to simulate the weave Anisotropy effect (horizontal added to vertical).
The default value of .5 indicates a 1:1 ratio of warp to weft weight. By raising or lowering this
slider you can change the ratio between warp and weft to simulate different fabric looks. At a
value of 0, the weave effect is disabled, and the anisotropy effect works the same as it would
in the Iray Uber Shader.

2.4 SHEEN

Sheen is an optional top-layer effect that produces the bright


edges typical of a low-roughness material while maintaining
the characteristic diffuse appearance of a high-roughness
material.

The intensity of the Sheen effect is also constrained by the


Glossy IOR parameter. So a way to create a rough fabric, like velvet, is to set the Glossy
Layer Weight to 0 and the Glossy IOR to 3, allowing the sheen effect to take more control.

2.4.1 Sheen Roughness

Sheen Roughness does not control the visual "roughness" of the effect, so much as the
visibility falloff of the Sheen topcoat. Meaning, at low Sheen Roughness, the sheen effect is
seen at grazing edges only. Whereas, at higher Sheen Roughness values, the effect may
cover the entire surface.
2.4.2 Use Grazing Color

By default, the Sheen color is white, which is the appropriate color for most materials.
However, for some materials, it may be more appropriate to use another color for sheen
effects. Enabling the Use Grazing Color button will force the Sheen layer to use the currently
selected Grazing Color.

2.5 BUMP MAPPING

Bump Mapping, much like the Roughness parameter, allows


you to simulate height changes on a surface, but at a larger
scale. For example, you can use a Bump or Normal map to
simulate wood grain. However, Bump or Normal mapping
only simulates these changes on the surface, it does not
alter the geometry in any way, as displacement or a morph does.

2.5.1 Base Bump

A bump map is a simple grayscale image. Because bump mapping can only simulate the
up/down direction, it typically is considered inferior to normal mapping. However, because the
angles and intensity are not baked into a bump map, the results can often be more flexible if
you need to change the bump effect intensity on the fly.

2.5.2 Normal Map

While a grayscale bump map can simulate only the up/down direction of the changes to a
surface, a normal map has the additional advantage of specifying an angle, or the direction of
the sides of the bumps (called a normal). A normal map is an RGB texture, not grayscale.
Each channel (Red, Green, and Blue) specifies a unique part of the angles and strength of
the bump effect.
This added complexity is both a strength and a weakness of normal maps. Normal maps
should almost always have a slider setting of 1 for best results. When well made, normal
maps will give superior clarity and depth, compared to bump maps. However, if you require a
stronger or weaker bump effect from a normal map, it is advisable to re-bake the normal map
with the appropriate settings.

Realism Tip: Normal Maps should be output in OpenGL format for correct results.

2.6 DETAIL

The detail parameters in this shader function the same as in the DAZ PBR Skin Shader.
Namely, allowing seamlessly tileable textures to be loaded, which are then repeated at a high
rate. Thus creating high fidelity surface normal and specularity effects. Highly repetitive low
relief patterns, like fabric weaves, are particularly well suited for the detail parameters.

The results of the Detail Normal Map will be blended with


any existing bump or normal maps.

The Detail Specular Roughness Mult portion functions like


the Roughness parameter, meaning low values are smooth
and high values are rough. However, the resulting
"roughness" setting is multiplied (which darkens) over the
existing roughnesses (glossy and sheen). What this means
in practical terms is that the specular component of the detail
settings can only make your material less rough. Therefore,
if your Detail Specular Roughness Mult is a value of 1.0, and
you want a rougher material, you will need to increase your
base roughness settings.

One unique feature is the ability to toggle the Detail Specular


Roughness Mult on or off for either the Glossy layer or the Sheen layer. In the case of the
Sheen layer, the result of the multiplied detail specular image is areas of lower sheen. This
can be useful for breaking up the sheen, for effects like simulating the texture of velvet nap.
3 MANAGING REFLECTANCE

In the chart, we can see some


different ways to control reflectance. I
started with a black object to make
the reflectance easier to see. These
are all at maximum roughness, which
I would never use in an actual
material but, for the sake of
visualizing this comparison, is useful.

The goal in managing reflectance is to


have the resulting material reveal
both the character of the surface
(hard, soft, shiny, etc.) and the 3D
form. Too little reflectance and you
can lose definition of the form, too
much reflectance and you can lose
the character of the surface (in this
case, the black cloth becomes gray).

There isn't really a right or wrong


answer. It is more about finding
balances and compromises between
the different parameters until you
reach the desired look.

That said, I think it is safe to say both


the top and bottom row images are not good. All of the rest of them might be okay, depending
on what you are trying to recreate.

I will also point out that none of these examples use any Anisotropy. Because it redirects light
striking the surface, anisotropy should only be used at moderate roughness values (15 to 45).
High-Roughness Anisotropy will give darker results so, for rougher materials, it is typically
better to leave it out or enable the Multiscatter toggle, which will slightly increase render
times.
The reason I included this example was to give you a workflow for managing reflectance. I will
often begin with a simple black base like this when creating rougher fabrics. It helps to figure
out exactly how my material should respond to light. After I have those light reflectance
characteristics dialed in, I will add in my base color.

These parameters can all be mapped via a grayscale texture, and the approach would remain
the same: Figure out your Roughness, Glossy Layer Weight, Sheen, etc., before worrying
about your Base Color.

You might also like