...
Here, it is important to distinguish between two types of plugins: ones that need to create many lightweight instances over the course of a render, and ones that do not. RixBxdf
, RixDisplacement
, and RixLight
represent lightweight instances that may be created many times during the course of a single render, and therefore are not directly subclasses of RixShadingPlugin
. Instead, these plugins instancees of those classes are returned by the appropriate Factory (e.g. RixBxdfFactory
), with the Factory itself being the subclass of RixShadingPlugin
.
...
All RixShadingPlugins
share common methods related to initialization, synchronization with the renderer, and management of lightweight instances.
Initialization
In order to initialize the plugin, the renderer will call Init()
once. Even if the plugin is evoked multiple times during the render with different arguments, Init()
will still be called only once during the lifetime of the render. The RixContext
parameter can be used by the plugin to request any RixInterfaces
services provided by the renderer. Any expensive memory allocations or operations that can be reused during the lifetime of the plugin can be performed in this routine. Upon successful initialization, this routine should return a zero status.
...