Cortex
10.0.0-a4
|
#include <SXExecutor.h>
Inherits noncopyable.
Public Types | |
typedef std::vector< SxShader > | ShaderVector |
Public Member Functions | |
SXExecutor (const ShaderVector &shaders, SxContext context, const ShaderVector &coshaders, const ShaderVector &lights) | |
IECore::CompoundDataPtr | execute (const IECore::CompoundData *points) const |
IECore::CompoundDataPtr | execute (const IECore::CompoundData *points, const Imath::V2i &gridSize) const |
This class simplifies the execution of shaders using the Sx library by wrapping it to accept IECore datatypes for input and output.
IECoreRI::SXExecutor::SXExecutor | ( | const ShaderVector & | shaders, |
SxContext | context, | ||
const ShaderVector & | coshaders, | ||
const ShaderVector & | lights | ||
) |
Constructs an executor for the specified set of shaders - the shaders in the shaders parameter will be run in sequence, with the output from one forming the input to the next. Due to quirks of the Sx API, you must also pass the context the shaders were created in, and the coshaders and lights from that context. It is the caller's responsibility to ensure that the context and ShaderVectors remain alive for as long as the executor is in use.
IECore::CompoundDataPtr IECoreRI::SXExecutor::execute | ( | const IECore::CompoundData * | points | ) | const |
Executes the shaders for the specified points. The points are considered to have no specific connectivity, meaning that area and filtering functions will be effectively disabled during shader execution.
IECore::CompoundDataPtr IECoreRI::SXExecutor::execute | ( | const IECore::CompoundData * | points, |
const Imath::V2i & | gridSize | ||
) | const |
Executes the shaders for the specified points. The points are considered to have a grid topology of the specified dimensions in u and v space, and this topology will be used to implement proper filtering and area functions. u, v, du and dv shading variables will be automatically calculated if not provided but they may also be passed explicitly if desired. If gridSize is <=0 in either dimension then this method is equivalent to the method above, and no topology is assumed.