...
Section | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Differences in Form
Consider the following simplified "glass" shader and compare it to the "glass" shader distributed with OSL:
...
As you can see, there are no fresnel terms and no backfacing()
call. 3Delight will take the proper decision, based on many factors including the fresnel factors, to properly sample the surface.
Supported Closures
3Delight supports all the most advanced closures. Some of the BRDF went through extensive research in order to extend them beyond the original specs. As an example, 3Delight's GTR can also model refractions, allowing to render realistic frosted glass and other effects.
Closure | Description | Ray Types |
---|---|---|
microfacet – ggx | Models isotropic or anisotropic GGX BRDF. This model can handle reflection, refraction or both at the same time. | reflection, refraction, glossy |
microfacet – gtr | Models isotropic GTR BRDF. A "gamma" parameter can be supplied to control the "tail" of the highlight to model highly realistic materials. | reflection, refraction, glossy |
microfacet – cooktorrance | Models an anisotropic Cook-Torrance BRDF. | reflection, glossy |
microfacet – blinn | Models a Blinn specular BRDF | reflection, glossy |
oren_nayar | Models a diffuse reflector based on the Oren-Nayar model. | diffuse |
diffuse | Models a diffuse reflector. | diffuse |
reflection | Models a perfect reflector. Note that fresnel factor is automatically computed by 3Delight. If no fresnel component is wanted, one can pass 0 as the "eta" parameter. | reflection |
refraction | Models a refraction. Fresnel factor is included by 3Delight. | refraction |
hair | Models a Marschner BRDF for hair. Simulates the R, TT and TRT lobe as suitable for a monte carlo simulation. | reflection, refraction, glossy. |
subsurface | Starts a subsurface simulation to model a BSSRDF. | subsurface |
emitter | omnidirectional emitter | -- |
hair | Marschner hair model. This closure works with sub-closures. Refer to The Hair Closure chapter below. | hair |
3Delight Extension to Closures
Some of the closures, for examples GGX and GTR, have been extended to render some relatively difficult effects. In particular, a lot of research have been done to render "thin film interference" on metallic surfaces. The 3Delight Metal material is a good example of usage.
...
Here is an example render of a steel sphere with a thin film of oxide ferum. It is rendered with varying roughness.
R=0.05 | R=0.1 |
---|---|
R=0.2 | R=0.4 |
Arbitrary Output Variables
Any closure can be output to a special outputvariable()
function to be output as an AOV.
...
Info |
---|
Note that AOVs can be output in any node of the OSL tree. If two different OSL nodes contribute to the specular_aov variable, 3Delight will correctly blend their contribution together in the final output and in the AOV. |
AOV Forwarding
3Delight introduces the concept of AOV forwarding to solve a classical problem with reflection, refraction and transmission AOVs. For example, a diffuse surface reflected by a mirror will usually appear in the reflection AOV. In some cases it is much more practical to see that diffuse surfaces in the diffuse AOV, leaving the reflection AOV black for that surface. This feature is not part of OSL language but is an attribute that users can set on a per-object basis. This means that there is no need to change your shaders in order to benefit from this feature.
...
Without forwarding | With forwarding | |
---|---|---|
RGBA | ||
diffuse | ||
reflection | ||
refraction | ||
emission |
Gone is lockgeom
A remnant of the RenderMan way of doing things is the 'lockgeom
' parameter which hints of symbolic linking of data defined on the geometry to parameters defined in the shader. From our point of view, this feature is useless, as-is, in the OSL world:
...
- Don't output the
getattribute()
node when the primitive variable is not present. - Output the proper default value in the
getattribute()
node in case the primitive variable is not present. This involves shader node interrogation.
The Hair Closure
The hair BSDF is a fairly complex function which simulates several effects observed on real hair fibers. It supports a variable number of major lobes, usually named R, TT, TRT, etc which specify different paths that a light ray can take inside a hair fiber. We choose to break down the model into sub-components with each component being one lobe of the BRDF and is specified by a closure. The general form of the hair closure looks like this:
...