Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

447 lines (394 sloc) 21.798 kB
Release 1.3.0 - 14 Feb 2013 (compared to 1.2)
Language, standard libary, and compiler changes (for shader writers):
* pointcloud_write() allows shaders to write data and save it as a point
* spline now accepts a "constant" interpolation type, which interpolates
with discrete steps.
* isconnected(var) returns true if var is a shader parameter and is
connected to an earlier layer. This is helpful in having shader logic
that can discern between a connected parameter versus a default.
* Whole-array assignment is now supported. That is, if A and B are arrays
of the same type and length(A) >= length(B), it is legal to write
A=B without needing to write a loop to copy each element separately.
* stoi() and stof() convert strings to int or float types, respectively
(just like the identically-named functions in C++11). These do properly
constant-fold during runtime optimization if their inputs can be deduced.
* split() splits a string into tokens and stores them in the elements of an
array of strings (and does constant-fold!).
* distance(point A, point B, point Q) gives the distance from Q to the
line segment joining A and B. This was described by the OSL spec all
along, but somehow was not properly implemented.
ShadingSystem API changes and new options (for renderer writers):
* Default implementation of all the pointcloud_*() functions in
RendererServices, if Partio is found at build time.
* ShadingSystem attribute "compile_report" controls whether information
should be sent to the renderer for each shading group as it compiles.
(The default is now to be more silent, set this to nonzero if you want
to see the old per-group status messages.)
* ShadingSystem attribute "countlayerexecs" adds debugging code to count
the total number of shader layer executions (off by default; it slows
shader execution down slightly, is only meant for debugging).
* Add a parameter to OSLCompiler::compile to specify the path to the
stdosl.h file.
* New call: ShadingSystem::LoadMemoryCompiledShader() loads a shader with
OSO data from a memory buffer, rather than from a file.
Performance improvements:
* Reduce instance symbol memory use, lowering OSL-related memory by 1/2-2/3
for large scenes.
* Identical shader instances within a shader group are automatically
merged -- this can have substiantial performance and memory
improvements for very complex shader groups that may (inadvertently,
for convenience, or as an artifact of certain lookdev tools) have
multiple instances with identical input parameters and connections.
We have seen some shots that render up to 20% faster with this change.
* Better constant-folding for pointcloud_get (if indices are known).
* Speed up implementation of exp() for some Linux platform (works around
a known glibc issue).
* Speed up of mix() by making it a built-in function (rather than defined
in stdosl.h) and doing aggressive constant folding on it. Also some special
cases to try to avoid having mix() unnecessarily trigger execution of
earlier layers when one or both of its arguments is a connected shader
param and the mix value turns out to be 0 or 1.
* Runtime optimization now includes constant-folding of getattribute()
calls, for those attributes which are scene-wide (such as renderer options
that apply to the whole frame).
* Improvements in the algorithm that tracks which symbols need to carry
derivatives around results in MUCH faster compile times for extremely
complex shaders.
* Improve bad performance for shaders that call warning() prolifically, by
imposing a maximum number of shader warnings that are echoed back to the
renderer (controlled by ShadingSystem attribute "max_warnings_per_thread",
which defaults to 100; 0 means that there is no maximum).
Bug fixes and minor improvements:
* Fix incorrect oso output of matrix parameter initialization. (This did
not affect shader execution, but could result in oslquery/oslinfo not
reporting default matrix parameter values correctly.)
* Bug fix: oslinfo didn't print int metadata values properly.
* oslc better error checking when calling a variable as if it were a
* Parsing of oso files was broken for compiled shaders that had string
metadata whose metadata value contained the '}' character.
* Pointcloud function bug fixes: now robust to being passed empty filenames,
or calling pointcloud_get when count=0.
* Fix crash with C preprocessor when #include fails or no shader function
is defined.
* Improve error reporting when parsing oso, especially in improving the
error messages when an old renderer tries to load a .oso file created by
a "newer" oslc, and the oso contains new instruction opcodes that the
older renderer didn't know about.
* oslc now gives a helpful error message, rather than hitting an assertion,
if you try to index into a non-array or non-component type.
* Broken "XYZ" color space transformations because of confusion between
"xyz" and "XYZ" names.
* oslc: correctly catch errors with integer literals that overflow.
* oslc: proper error, rather than assertion, for
'closure color * closure color'.
* oslc: proper handling of preprocessor errors when stdosl.h is in a path
containing spaces.
* Fix bugs in the OSL exit() function.
* Don't error/warn if metadata name masks a global scope name.
Under the hood:
* Simplify code generation of binary ops involving closures.
Build & test system improvements and developer goodies:
* Many, many fixes to enable building and correct running of OSL on
Windows. Too many to list individually, let's just say that OSL 1.3
builds and runs pretty robustly on Windows, older versions did not.
* Remove unused OpenGL and GLEW searching from CMake files.
* Fix a variety of compiler warnings, particularly on newer compilers,
32 bit platforms, and Windows.
* Find LLVM correctly even when using "svn" LLVM versions.
* Adjust failure threshold on some tests to account for minor platform
* New minimum OIIO version: 1.1.
* CMake fixes: Simplify searching for and using IlmBase, and remove
unneeded search for OpenEXR.
* Find Partio (automatically, or using 'make PARTIO_HOME=...'), and if
found, use it to provide default RendererServices implementations of
all the pointcloud-related functions.
* Make/CMake STOP_ON_WARNING flag (set to 0 or 1) controls whether the
build will stop upon any compiler warning (default) or if it should
keep going (=0).
* Fixed bad interaction between weave preprocessor, OIIO::Strutil::format,
and gcc 4.7.2.
* Fixes for static linkage of liboslcomp.
* Addressed compilation errors on g++ 4.7.2.
* Improved logic and error reporting for finding OpenImageIO at build time.
* Add support for linking to static LLVM libraries, and for specifying
a particular LLVM version to be used.
* New BUILDSTATIC option for CMake/Make allows building of static OSL
* Fixes to allow OSL to use LLVM 3.2.
* Fixes to allow OSL to be compiled by clang 3.2.
* Fixes to allow building on Windows with MinGW.
* Fix for building from a chroot where the host may be, e.g., 64 bit, but
the target is 32 bit.
* Minimize cmake output clutter for things that aren't errors, unless
* Various fixes to get OSL building and running on FreeBSD.
* Cmake/make option USE_LLVM_BITCODE to be able to force LLVM bitcode
compilation on or off (defaults to on for Windows, off for Unix/Linux).
* Clarify that documentation is licensed under Creative Commons 3.0 BY.
* Clean up OSL Spec discussion of built-in material closures.
* Overhaul the suggested metadata conventions in the OSL spec (now
conforms to the conventions used by Katana).
Release 1.2.1 - 6 Nov, 2012 (compared to 1.2.0)
* Fix incorrect oso output of matrix parameter initialization. (This did
not affect shader execution, but could result in oslquery/oslinfo not
reporting default matrix parameter values correctly.)
* Build: remove unused OpenGL and GLEW searching from CMake files.
* Build: Fix a variety of compiler warnings, particularly on newer compilers,
32 bit platforms, and Windows.
* Build: Find LLVM correctly even when using "svn" LLVM versions.
* Bug fix: oslinfo didn't print int metadata values properly.
Release 1.2.0 - Aug 30, 2012 (compared to 1.1)
Note: this is more or less the production-hardened version of OSL that
was used to complete Men in Black 3, The Amazing Spider-Man, and Hotel
New tools/utilities:
* New program "testrender" is a tiny ray-tracing renderer that uses OSL
for shading. Features are very minimal (only spheres are permitted at
this time) and there has been no attention to performance, but it
demonstrates how the OSL libraries may be integrated into a working
renderer, what interfaces the renderer needs to supply, and how the
BSDFs/radiance closures should be evaluated and integrated (including
with multiple importance sampling).
* shaders/ubersurface.osl is an example of a general purpose surface
Language, standard libary, and compiler changes:
* texture()/texture3d() support for subimage/face selection by name as
well as by numeric index.
* getattribute() performs automatic type conversions that mostly
correspond to the kind of automatic type casting you would get from
ordinary assignments in OSL. For example, getattribute("attrib",mycolor)
used to fail if "attrib" turned out to be a float rather than a color;
but now it succeeds and copies the float value to all three channels
of mycolor.
ShadingSystem API changes and new options:
* Remove unused 'size' parameter from the register_closure API.
Optimization improvements:
* Constant-fold pointcloud_search calls when the position is a constant if
the search returns few enough results, by doing the query at optimization
time and putting the results into new constant arrays.
* Matrix parameters initialized by m=matrix(constA,constB,...) now
statically initialize, and no longer need to run initialization code
each time the shader executes.
Bug fixes and minor improvements:
* Fix pointcloud_search to optionally take a 'sort' parameter, as
originally documented.
* Unit tests weren't properly run as part of the testsuite.
* Track local+temp memory usage of optimized shaders and consider it an
error if a shader needs more than a maximum amount at runtime, set with
the "max_local_mem_KB" attribute.
* Add pointcloud statistics.
* Fix derivative error for sincos() when the inputs have no derivatives but
the outputs do.
* Bug fix to vector-returning Gabor noise (it could previously generate
different values for different platforms).
* printf() of closures built from other closures allows for proper
recursive printing of the closure tree.
Build & test system improvements and developer goodies:
* Simplify the namespace scheme.
* Remove support for certain old dependencies: OIIO versions < 0.10,
LLVM < 3.0, and Boost < 1.40.
* Lots of little fixes to solve compiler warnings on various compilers.
* Support for newer OSX releases, particularly if /usr/bin/cpp-4.2 is not
* Better support for Boost::wave (portable C preprocessor replacement).
Build with 'make USE_BOOST_WAVE=1' to force Wave use instead of system
* You can select a custom LLVM namespace with 'make LLVM_NAMESPACE=...'.
* Symbols that are not part of the OSL public APIs are now hidden from the
linker in Linux/OSX if the CMake variable HIDE_SYMBOLS is on.
* New Makefile/CMake option LLVM_STATIC can be used to use static LLVM
libraries rather than the default dynamic libraries.
* Support for LLVM 3.1.
* Support for building with Clang 3.1 (lots of warning fixes).
* Makefile/CMake variable EXTRA_CPP_DEFINITIONS allows you to inject
additional compiler flags that you may need to customize the build for
your site or a choice of unusual compiler.
* Add support for 'PROFILE=1' builds that are appropriate for use with
a profile.
Release 1.1.0 - Mar 14, 2012 (compared to 1.0.0)
Language, standard libary, and compiler changes:
* Allow closures as parameters to closures.
* New constants: M_2PI, M_4PI
* Generic noise: noise("noisetype",coords,...)
* Gabor noise (anisotropic, automatically antialiased) via noise("gabor").
* Fix mod/fmod discrepancy: fmod() now matches C, mod() always returns a
positive result like in RSL.
* Allow "if (closure): and "if (!closure)" to test if a closure is empty
or not.
* New optional parameter to trace(): "traceset" allows you to specify a
named geometry set for tracing.
ShadingSystem API changes and new options:
* New "greedyjit" option will optimize & JIT all shader groups up front,
concurrently, without locking.
* Add a way to name shader groups.
* attribute("options",...) lets you set a bunch of options at once.
* Options to enable/disable individual optimizations (mostly useful for
Optimization improvements:
* Allow block alias tracking on non-constants when it's safe.
* Track "stale" values to eliminate pointless assignments.
* Eliminate redundant "useparam" ops.
* Assignments to output parameters that are not connected to any
downstream layers are now eliminated.
* More aggressive elision of ops that only write to symbols that won't
be subsequently used.
* More careful identification and removal of parameters (input and output)
that are both unused in the shader and not connected downstream.
Bug fixes and minor improvements:
* Minor blackbody fixes.
* Bug fix: don't mark constants as having their derivatives taken.
* Clamp splineinverse() for out-of-knot-range x input.
* Bug fix: the optimization of "a=b; a=c" was incorrect if c was an
alias for a (it incorrectly eliminated the first assignment).
* Bug fix: work around LLVM thread safety issues during JIT.
* Bug fix: symbol_data() wasn't returning the right address for non-heap
* Bug fix: optimization errors related to break, continue, and return not
properly marking the next instruction as a new basic block.
* Bug fix: luminance() with derivatives didn't work.
* Bug fix: in code generation of structure initializers.
* Improved error messages from ConnectShaders.
* Bug fix: type checking bug could case non-exactly-matching polymorphic
functions to coerce a return value even when that was not intended.
* Type checking improvements: Make sure point-point is a vector
expression, and point+vector & point-vector are point expressions.
Build & test system improvements and developer goodies:
* testsuite overhauls:
- run each test both optimized and not
- generate all tests in build, not directly in ./testsuite
- greatly simplify the scripts
* Much more detailed debugging logs of the optimization process.
* Upgrade to clang/llvm 3.0.
* Lots of infrastructure to make debugging the optimizer easier.
Including new options debug_groupname, debug_layername, only_groupname.
* Improved the build system's LLVM-finding logic.
* Fix warnings from gcc 4.6.
Release 1.0.0 - Oct 12, 2011
* Modified testshade (and the underlying SimpleRender class) to handle
several standard named coordinate systems such as "camera", "screen",
"NDC", "raster."
* blackbody() and wavelength_color().
* New ShadingSystem configuration attribute: "colorspace" lets you explain
to OSL what RGB really means (e.g., "Rec709", "sRGB", "NTSC", etc.).
The luminance(), blackbody(), wavelength_color, and conversion to/from
XYZ now takes this into account correctly.
* rotate() (always in spec, never implemented)
Release 0.6.2 - Sept 29, 2011
* Statistics overhaul -- added optimization stats, eliminated unused ones.
* Allow a shader parameter to mask a global built-in function with
only a warning, and improve scope conflict errors by pointing out the
file and line of the previous definition.
* Altered the RendererServices API to add transform_points() method, which
allows renderers to support nonlinear transformations (i.e., those that
are not expressible as a 4x4 matrix).
* Issue a renderer error when unknown coordinate system names are used
(can be turned of by setting the new ShadingSystem attribute
"unknown_coordsys_error" to false).
* New OSL built-in function: splineinverse().
Release 0.6.1 - Sept 20, 2011
* Be more aggressive in freeing shader instance memory that's no longer
needed after optimization and LLVM JIT. This greatly reduces
OSL-related memory consumption for scenes with large numbers of very
complicated shading networks.
* Add Dz() which is helpful for apps that use OSL to shade volumes. At
present, we only correctly compute Dz(P), all other Dz() queries
return 0.
* Additional statistics on how many instances and groups compile, and
how many are empty after all optimizations are performed.
* Make sure all the relevant statistics can be queried via
Release 0.6.0 - Sept 9, 2011
* ShadeExec API overhaul -- an app using it no longer needs
ShadingSystemImpl internal knowledge.
* Thread-parallel runtime optimization and LLVM JIT of different shader
* Optimizations: runtime constant folding of arraylength and regex_search,
new instruction 'arraycopy' will copy an entire array at once.
* Renamed patterns.h to oslutil.h.
* Do not generate unnecessary code when optional texture parameters are set
to their default values.
* Restore long-lost ability for layers to run unconditionally (not lazily)
if they were marked as "non-lazy" (for example, if they write to globals.
* Make the "debugnan" attribute work again -- when turned on, code will
be inserted after every op to be sure that no NaN or Inf values are
generated, and also verify that shader inputs (globals) don't have NaN
or Inf values passed in by the renderer. A similar facility existed a
long time ago, but we lost that functionality when we switched from
the interpreter to LLVM.
* Looks for release versions of LLVM-2.9 (allows using a Macports LLVM
Release 0.5.4 - Jul 21, 2011
* Several fixes related to arrays of structs, and structs containing
other structs.
* Fixed arrays of closures.
* Removed support for old LLVM 2.7, nobody seemed to be using it any more.
* Changed the definition of dict_find() to return -1 for an invalid
dictionary, to distinguish it from 0 meaning that the query failed but
the dictionary itself was valid.
* Make array parameters safe to convert to constants during runtime
* Support derivatives in pointcloud searches.
* Fixed several runtime optimizer bugs.
* Fixed a bug where environment() calls with an optional "alpha" parameter
that has derivatives was overwriting memory.
* Fixed code generation bug for a*=b and a/=b.
* Automatically initialize all local string variables to NULL, to avoid
bad pointers for uninitialized strings.
* Bug fix: dict_value() wasn't properly marking its argument as writable.
* Automatic range checking of array and component access.
* Fix uninitialized derivatives for pointcloud().
* Speed up getattribute() calls by caching information about failed
getattribute queries in the ShadingContext.
* Fix to constant folding of gettextureinfo: a failed lookup should not
fold, because we want the error to occur in shader execution, not during
* Refactor, clean up, and comment testshade.
* oslc now gives an error on non-void functions that fail to return a value.
* Fixed implementation of area() that could generate an assertion.
* Fix escape sequences in string literals: we were handling it correctly
for printf-like format strings, but not other string literals.
* break and continue now work properly (just like in C/C++).
* You can now return from anywhere in a user function (multiple times if
you want), just like C/C++, and are no longer restricted to the only
return statement being the last statement of the function.
* New include file for shaders: patterns.h. Now, it only includes a handy
'wireframe()' function, but will expand for other useful things.
* New function: int getmatrix(from,to,M) is like the matrix(from,to)
constructor, but returns a success value so a shader can tell if the
named coordinate systems failed to be found by the renderer.
Release 0.5.3 - Apr 19, 2011
* Fix missing derivatives for sign() function.
* Fix closure color type size (crashes).
* Fix bug with environment() when passed "alpha" pointers with derivatives.
* Improve error messages for getmessage/setmessage to catch the most
common sources of non-deterministic behavior.
* Bug fix when constant-folding gettextureinfo().
* Fix mismatched prototype for subsurface() closure.
* Texture errors encountered in shader constant folding are now properly
reported to the renderer.
* Allow functions to have array parameters of unspecified length.
* Fix subtle bug related to lifetime analysis of variables in loops (led
to incorrect optimizations).
Release 0.5.2 - Mar 14, 2011
* Windows: use boost::wave instead of external cpp; various other Windows
compilation fixes.
* texture & environment now take an optional "interp" parameter that
overrides the interpolation/filtering method (valid arguments:
"smartcubic", "cubic", "linear", "closest").
* Bug fixes to getmessage() and its handling of derivatives, which includes
a slight RendererServices API change.
Jump to Line
Something went wrong with that request. Please try again.