Page tree

Versions Compared


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


The SIMD version of OSL is optimized to execute 16 samples at a time with Intel® Advanced Vector Extensions 512 (Intel® AVX-512). It can also execute using Intel® Advanced Vector Extensions 2 (Intel® AVX2), Intel® Advanced Vector Extensions (Intel® AVX), or Intel® Streaming SIMD Extensions 4.2 (Intel® SSE4.2) at reduced performance levels. The SIMD version of OSL supports all OSL 1.8 language features and library calls supported by RenderMan.

It is enabled with the following user optionfollowing option

Code Block
Option "userosl" "int osl:batched" [1]

Also, the cost of compiling the shaders and shader networks at runtime can become a significant, especially since this compilation phase will prevent multiple threads from running at their highest efficiency. Normally for scenes that take a while to render, this cost is effectively amortized. However, if there are hundreds of thousands of unique shader instances, that cost can start to impact final render times. The Batched mode may have a greater impact on startup time than non-batched but for complex scenes the overall benefit is worthwhile.


There are a couple of options that control the behavior of OSL and it's usage in RenderMan.

  • Option “user” “osl” “int osl: verbose” [0-5] – Controls the verbosity of OSL message echoed by RenderMan. 0 is off, and 1-5 each add one more class of OSL messages to what is printed. Those classes are 1 – SEVERE, 2 – ERROR, 3 – MESSAGE, 4 – WARNING and 5 – INFO.

  • Option “user” “osl” “int osl: statisticslevel” - This is similar to the “osl:statistics:level” attribute, but it controls the level of statistics tracked by RenderMan for the integration of the OSL shading system as a whole.

Note a number of OSL attributes options are available to be set within a RIB file. The following attributes options are supported:

  • Option "user" "int osl:debug" [0]
  • Option "user" "int osl:optimize" [1]
  • Option "user" "int osl:lockgeom" [1]
  • Option "user" "int osl:debug_nan" [0]
  • Option "user" "int osl:debug_uninit" [0]
  • Option "user" "int osl:compile_report" [0]
  • Option   "user" "int osl:statistics:levelrange_checking" [0]

Refer to the OSL documentation for details on their usage.  You can read more about the current version of OSL by visiting OpenShadingLanguage.

Utilizing the trace() shadeop:

Limited support for the trace() shadeop is included.  The trace() shadeop cannot be called during displacement, presence, and opacity shading.  The trace() shadeop is also limited to retrieving geometric values, as we disallow recursive shading so the optional "shade" parameter is ignored and always assumed to be 0. After a trace(), getmessage() can retrieve the "hit", "hitdist", and "geom:name" values, as well as values for primvars on the hit geometry.

Accessing Shading Contexts