RfK Plugin Technical Notes

RfK Plugin Technical Notes

This portion of the documentation is intended for those studios that need to recompile the plugin and understand the technical differences between The Foundry's PRMan17 plugin and the RfK PRMan19 plugin.


Compiling the plugin

Makefiles are included with the RfK plugin. Each Makefile details which environment variables it relies on. As a whole your environment should include the following in order for the Makefiles to find all of its dependencies:

KATANA_HOME
KATANA_RESOURCES  (for installation)
XML_HOME
BOOST_HOME

These makefiles also contain an install directive that will copy the compiled result into its appropriate location under $KATANA_RESOURCES.


General Code Changes

The PRMan18 plugin code is distributed with the RfK package in a format similar to that of the standard PRMan17 plugin. In the RfK package, under the lib/katana directory you will see the familiar /Resources and /Src directories, each containing the PRMan18 subtrees. Diving deeper into the /Src directory itself, however, you will see that the code has diverged significantly in order to support various improvements and upgrades for RPS 18 and beyond.

Of most interest:

  • Instead of linking with libprman.so and using Ri calls directly, the plugin now finds and loads the libprman.so based on the $RMANTREE environment variable, then uses Rix interfaces to control and communicate with the renderer.
  • ScenegraphLocationDelegates no longer separate plugins, they are compiled directly into KatanaProcedural.so.
  • In order to support advanced shader introspection there is code shared between RendererInfo and KatanaProcedural. This is located in the /RendererCommon subdirectory of Src/PRMan18.
  • The PRManProcedural namespace has been removed and the functions living in that namespace have been moved into PRManPluginState as member functions. As a result, the header files WriteRI_*.h have been removed.
  • PRManLiveRender has been significantly rewritten for performance, thread safety, and stability.
  • The code for reading global settings (PrmanGlobalSettings) and object settings (WriteRI_Statements) has been consolidated into WriteRI_Settings, which allows Ri Attributes to be written in either global or object scope.
  • A new procedural attribute - "immediatesubdivide" - is being used to immediately crack open the main procedural (PRManRender.cpp).

Further Code Changes for RPS19

A fair amount of infrastructure has been added in order to support the new RIS rendering paradigm introduced in RenderMan Pro Server 19.


  • Plugin shaders do not have a "sloinfo" equivalent so the plugin must rely on args files for shader introspection. We also currently rely on a "shaderManifest" in order to enumerate the shaders. This method is currently under review, however in the meantime a collection of supporting methods for reading the shader manifest and args files were placed into a new source file in RendererInfo called ShaderPreprocessing.cpp
  • PRManPluginState is extended to cache the shader parameters from the shader manifest and the args file. Ideally this information would be shared with RendererInfo but these have different lifetimes so they need to be maintained as separate caches.
  • RPS19 introduced the ability to add a light during rerendering. Katana does not recognize or send a specific update relating to a "new" light, therefore we've added infrastructure to WriteRI_Shaders and PRManLiveRender to recognize and handle new light updates.
  • The PRManRender method "launchPRMan" was renamed to "beginDirectRender" to correctly reflect the action taken. PRMan is no longer "launched" in the sense of forking a new process. The method is initiating a direct render session. A pedantic but important difference.
  • Remove gChannelMsg from MultiresDisplayDriver which was causing problems with AOV channels during live rendering.