4.11. sloargs — Interrogate shader parameters from compiled RenderMan shaders

This module can be used to query shader parameters from compiled shaders. This is done by using the shared libraries that ship with the RenderMan renderers which means you can only parse shaders if you have the respective renderer installed on your system. The module has built-in support for shaders compiled by PRMan, 3Delight, Aqsis and Pixie. The module can be extended to support other renderers as well.

Usually, you don’t have to use this module explicitly as it is used internally by the slparams module which is the main module for querying shaders.

cgkit.sloargs.slparams(shader)

Read shader parameters.

See slparams.slparams() for more details.

cgkit.sloargs.getSloLib(sloSuffix)

Return the library name that manages a particular type of compiled shaders.

sloSuffix is the suffix of the compiled shader. The return value is the library name that is used to read the parameters from compiled shaders of the given suffix.

When called before a shader was parsed, the return value is the library name that will be used when the library is loaded. This value can be set by calling setSloLib(). When the function is called after a shader was already parsed, the return value is the absolute path to the actual library that is used to read parameters.

cgkit.sloargs.setSloLib(sloSuffix, libName)

Set the library name that should be used for reading shader parameters.

Shaders with the suffix sloSuffix (case-insensitive) will be handled by the library libName. This function has no effect if a shader of the given suffix has already been read. You must call this function at the beginning of your application when slparams() hasn’t been called yet.

cgkit.sloargs.registerSloArgs(sloSuffix, sloArgsCls)

Register a SloArgs class for a particular renderer.

sloSuffix is the suffix (without dot) that is used for the compiled shaders of this renderer. sloArgsCls is the SloArgs class that can read compiled shaders for this renderer.

Previous topic

4.10. slparams — Extracting RenderMan Shader parameters

Next topic

4.12. glslangtokenize — Tokenizer for the OpenGL 2 shading language

This Page