operator< had wrong brackets, changed it now to be more clear.
Fix#33404: crash GPU rendering with OSL option still enabled. There was a check
to disable OSL in this case, but it shouldn't have modified scene->params because
this is used for comparison in scene->modified().
Also some simple OSL optimization, passing thread data pointer directly instead
of via thread local storage, and creating ustrings for attribute lookup.
Documentation here:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/OSLhttp://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.65/Cycles
These changes require an OSL build from this repository:
https://github.com/DingTo/OpenShadingLanguage
The lib/ OSL has not been updated yet, so you might want to keep OSL disabled
until that is done.
Still todo:
* Auto update for external .osl files not working currently, press update manually
* Node could indicate better when a refresh is needed
* Attributes like UV or generated coordinates may be missing when requested from
an OSL shader, need a way to request them to be loaded by cycles
* Expose string, enum and other non-socket parameters
* Scons build support
Thanks to Thomas, Lukas and Dalai for the implementation.
The sampled color ramp data is passed to OSL as a color array. This has to be done as actual float[3] array though, since the Cycles float3 type actually contains 4 floats, leading to shifting color components in the array.
Additional parameter set functions for arrays have been added to the Cycles OSL interface for this purpose.