Also some simple OSL optimization, passing thread data pointer directly instead
of via thread local storage, and creating ustrings for attribute lookup.
rays from the OSL shader. The "shade" parameter is not supported currently, but
attributes can be retrieved from the object that was hit using the
getmessage("trace", ..) function.
As mentioned in the OSL specification, this function can't be used instead of
lighting, the main purpose is to allow shaders to "probe" nearby geometry, for
example to apply a projected texture that can be blocked by geometry, apply
more “wear” to exposed geometry, or make other ambient occlusion-like effects.
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/OSL#Trace
Example .blend and render:
http://www.pasteall.org/blend/17347http://www.pasteall.org/pic/show.php?id=40066
This does not actually work: The context must not be shared between threads, but using the same context between different samples actually seems to prevent OSL from switching between shaders. The proper solution would be to ensure memory pooling works correctly.
This reverts commit 69f87e69258d6266dcb20f09f7e3d4021e663432.