You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

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:

3DelightOther 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);
}
surface glass
    [[ string help = "Simple dielectric material" ]]
(
    float Ks = 1,
    color Cs = 1,
    float eta = 1.5
  )
{
	float _eta = backfacing() ? 1/eta : eta;
	 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

 

ClosureDescriptionRay Types
microfacet – ggxModels isotropic or anisotropic GGX BRDF. This model can handle reflection, refraction or both at the same time.reflection, refraction, glossy
microfacet – gtrModels 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 – cooktorranceModels an anisotropic Cook-Torrance BRDF.reflection, glossy
microfacet – blinnModels a Blinn specular BRDFreflection, glossy
oren_nayarModels a diffuse reflector based on the Oren-Nayar model.diffuse
diffuseModels 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
refractionModels 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  

 

  • No labels