Clarisse 5.0 SP8 SDK  5.0.5.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | List of all members
OSLRendererServices Class Reference
Inheritance diagram for OSLRendererServices:

Public Member Functions

 OSLRendererServices (OIIO::TextureSystem *texture_system=nullptr)
 
virtual bool get_matrix (OSL::ShaderGlobals *sg, OSL::Matrix44 &result, OSL::TransformationPtr xform, float time)
 
virtual bool get_matrix (OSL::ShaderGlobals *sg, OSL::Matrix44 &result, OSL::TransformationPtr xform)
 
virtual bool get_matrix (OSL::ShaderGlobals *sg, OSL::Matrix44 &result, OSL::ustring from, float time)
 
virtual bool get_matrix (OSL::ShaderGlobals *sg, OSL::Matrix44 &result, OSL::ustring from)
 
virtual bool get_attribute (OSL::ShaderGlobals *sg, bool derivatives, OSL::ustring object, OSL::TypeDesc type, OSL::ustring name, void *val)
 
virtual bool get_array_attribute (OSL::ShaderGlobals *sg, bool derivatives, OSL::ustring object, OSL::TypeDesc type, OSL::ustring name, int index, void *val)
 
virtual bool get_userdata (bool derivatives, OSL::ustring name, OSL::TypeDesc type, OSL::ShaderGlobals *sg, void *val)
 
virtual bool has_userdata (OSL::ustring name, OSL::TypeDesc type, OSL::ShaderGlobals *sg)
 Does the current object have the named user-data associated with it?
 
virtual bool trace (TraceOpt &options, OSL::ShaderGlobals *sg, const OSL::Vec3 &P, const OSL::Vec3 &dPdx, const OSL::Vec3 &dPdy, const OSL::Vec3 &R, const OSL::Vec3 &dRdx, const OSL::Vec3 &dRdy)
 
virtual bool getmessage (OSL::ShaderGlobals *sg, OSL::ustring source, OSL::ustring name, OSL::TypeDesc type, void *val, bool derivatives)
 

Member Function Documentation

bool OSLRendererServices::get_array_attribute ( OSL::ShaderGlobals *  sg,
bool  derivatives,
OSL::ustring  object,
OSL::TypeDesc  type,
OSL::ustring  name,
int  index,
void *  val 
)
virtual

Similar to get_attribute(); this method will return the 'index' element of an attribute array.

bool OSLRendererServices::get_attribute ( OSL::ShaderGlobals *  sg,
bool  derivatives,
OSL::ustring  object,
OSL::TypeDesc  type,
OSL::ustring  name,
void *  val 
)
virtual

Get the named attribute from the renderer and if found then write it into 'val'. Otherwise, return false. If no object is specified (object == OSL::ustring()), then the renderer should search first for the attribute on the currently shaded object, and next, if unsuccessful, on the currently shaded "scene".

Note to renderers: if sg is NULL, that means get_attribute is being called speculatively by the runtime optimizer, and it doesn't know which object the shader will be run on. Be robust to this situation, return 'true' (retrieve the attribute) if you can (known object and attribute name), but otherwise just fail by returning 'false'.

virtual bool OSLRendererServices::get_matrix ( OSL::ShaderGlobals *  sg,
OSL::Matrix44 &  result,
OSL::TransformationPtr  xform,
float  time 
)
virtual

Get the 4x4 matrix that transforms by the specified transformation at the given time. Return true if ok, false on error.

virtual bool OSLRendererServices::get_matrix ( OSL::ShaderGlobals *  sg,
OSL::Matrix44 &  result,
OSL::TransformationPtr  xform 
)
virtual

Get the 4x4 matrix that transforms by the specified transformation. Return true if ok, false on error. Since no time value is given, also return false if the transformation may be time-varying.

virtual bool OSLRendererServices::get_matrix ( OSL::ShaderGlobals *  sg,
OSL::Matrix44 &  result,
OSL::ustring  from,
float  time 
)
virtual

Get the 4x4 matrix that transforms points from the named 'from' coordinate system to "common" space at the given time. Returns true if ok, false if the named matrix is not known.

virtual bool OSLRendererServices::get_matrix ( OSL::ShaderGlobals *  sg,
OSL::Matrix44 &  result,
OSL::ustring  from 
)
virtual

Get the 4x4 matrix that transforms 'from' to "common" space. Since there is no time value passed, return false if the transformation may be time-varying (as well as if it's not found at all).

bool OSLRendererServices::get_userdata ( bool  derivatives,
OSL::ustring  name,
OSL::TypeDesc  type,
OSL::ShaderGlobals *  sg,
void *  val 
)
virtual

Get the named user-data from the current object and write it into 'val'. If derivatives is true, the derivatives should be written into val as well. Return false if no user-data with the given name and type was found.

bool OSLRendererServices::getmessage ( OSL::ShaderGlobals *  sg,
OSL::ustring  source,
OSL::ustring  name,
OSL::TypeDesc  type,
void *  val,
bool  derivatives 
)
virtual

Get the named message from the renderer and if found then write it into 'val'. Otherwise, return false. This is only called for "sourced" messages, not ordinary intra-group messages.

bool OSLRendererServices::trace ( TraceOpt &  options,
OSL::ShaderGlobals *  sg,
const OSL::Vec3 &  P,
const OSL::Vec3 &  dPdx,
const OSL::Vec3 &  dPdy,
const OSL::Vec3 &  R,
const OSL::Vec3 &  dRdx,
const OSL::Vec3 &  dRdy 
)
virtual

Immediately trace a ray from P in the direction R. Return true if anything hit, otherwise false.