Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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:

Code Block
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 required3Delight will take the proper decision, based on many factors including the fresnel factors, to properly sample the surface. 

Functions 

The following functions are implemented differently than suggested in the OSL specifications.

Supported Closures

 

ClosureDescription
microfacet( "ggx") 
microfacet( "gtr" ) 
microfacet( "cooktorrance" )