imageworks/OpenShadingLanguage — pull request #167 by lgritz (2012-10-09 19:04:44+00:00)
Title: Use Partio to implement pointcloud_* functions

It has bugged me for a while that OSL defines pointcloud_search(), pointcloud_get(), and recently pointcloud_write(), but pushes the implementation completely onto the renderer with no default implementation working out of the box.

A very good library, Partio (http://www.disneyanimation.com/technology/partio.html) exists that can do all the heavy lifting, and in fact SPI's renderer-side implementation of those RendererServices methods are just the obvious wrappers around the Partio functionality.

So with this pull request, we change the OSL build system to try to find Partio (you can help it with PARTIO_HOME=..., or disable it with USE_PARTIO=0). If not found, it compiles stubs as it always did. But if Partio is found, the default RendererServices implementation of the pointcloud methods will use Partio underneath to give a working implementation. It's still possible, as before, for a particular renderer to override in its RendererServices subclass and provide its own implementation (say, if it has proprietary pointcloud formats it must support, or if it wants a different underlying library).