General Guidelines
3Delight supports all the required functions to properly run OSL shaders. That being said, the philosophy of writing OSL shaders for 3Delight differs very slightly from other renderers. In a nutshell, the 3Delight rendering core is organized so that OSL shaders can remain as abstract as possible. For example, it is discouraged (and indeed wrong) to use functions such as backfacing()
to write shaders. Also, some shadeops have seen their definition slightly changed to simplify shader writing or to allow 3Delight make a better job at sampling the final image.
Consider the following simplified "glass" shader and compare it to the "glass" shader distributed with OSL:
3Delight | Other Systems |
---|---|
surface glass [[ string help = "Simple dielectric material" ]] ( float Ks = 1, color Cs = 1, float eta = 1.5 ) { Ci = Ks * reflection(N, eta) + Cs * refraction(N, eta); } |
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
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. | |
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 |
Unified Sampling
For the first time, a renderer provides only one sampling control for all the lighting components: specular, diffuse and light. By adjusting only one "shading samples" control, the artist can reduce noise without having to fiddle around with per-material or per-component sampling. 3Delight uses