Cortex
10.0.0-a4
|
#include <Renderer.h>
Public Member Functions | |
IE_CORE_DECLARERUNTIMETYPEDEXTENSION (IECoreGL::Renderer, RendererTypeId, IECore::Renderer) | |
void | setOption (const std::string &name, IECore::ConstDataPtr value) override |
IECore::ConstDataPtr | getOption (const std::string &name) const override |
Get the value of a previously set option. | |
void | camera (const std::string &name, const IECore::CompoundDataMap ¶meters) override |
void | display (const std::string &name, const std::string &type, const std::string &data, const IECore::CompoundDataMap ¶meters) override |
void | worldBegin () override |
void | worldEnd () override |
Finishes the world block. | |
ScenePtr | scene () |
void | transformBegin () override |
void | transformEnd () override |
Returns to the transform state saved by the last transformBegin() call. | |
void | setTransform (const Imath::M44f &m) override |
Sets the current transform. | |
void | setTransform (const std::string &coordinateSystem) override |
Imath::M44f | getTransform () const override |
Returns the current transform. | |
Imath::M44f | getTransform (const std::string &coordinateSystem) const override |
Returns the transform associated with the named coordinate system. | |
void | concatTransform (const Imath::M44f &m) override |
Concatenates the specified transform onto the current transform. | |
void | coordinateSystem (const std::string &name) override |
void | attributeBegin () override |
void | attributeEnd () override |
Return to the attribute state saved by the last call to attributeBegin(). | |
void | setAttribute (const std::string &name, IECore::ConstDataPtr value) override |
IECore::ConstDataPtr | getAttribute (const std::string &name) const override |
Return the value of the named attribute. | |
void | shader (const std::string &type, const std::string &name, const IECore::CompoundDataMap ¶meters) override |
void | light (const std::string &name, const std::string &handle, const IECore::CompoundDataMap ¶meters) override |
Specifies a light to apply to subsequent primitives. | |
void | illuminate (const std::string &lightHandle, bool on) override |
Turns the specified light on or off for the current attribute state. | |
void | motionBegin (const std::set< float > ×) override |
void | motionEnd () override |
void | points (size_t numPoints, const IECore::PrimitiveVariableMap &primVars) override |
void | disk (float radius, float z, float thetaMax, const IECore::PrimitiveVariableMap &primVars) override |
void | curves (const IECore::CubicBasisf &basis, bool periodic, IECore::ConstIntVectorDataPtr numVertices, const IECore::PrimitiveVariableMap &primVars) override |
void | text (const std::string &font, const std::string &text, float kerning=1.0f, const IECore::PrimitiveVariableMap &primVars=IECore::PrimitiveVariableMap()) override |
Renders some text. | |
void | sphere (float radius, float zMin, float zMax, float thetaMax, const IECore::PrimitiveVariableMap &primVars) override |
void | image (const Imath::Box2i &dataWindow, const Imath::Box2i &displayWindow, const IECore::PrimitiveVariableMap &primVars) override |
void | mesh (IECore::ConstIntVectorDataPtr vertsPerFace, IECore::ConstIntVectorDataPtr vertIds, const std::string &interpolation, const IECore::PrimitiveVariableMap &primVars) override |
void | nurbs (int uOrder, IECore::ConstFloatVectorDataPtr uKnot, float uMin, float uMax, int vOrder, IECore::ConstFloatVectorDataPtr vKnot, float vMin, float vMax, const IECore::PrimitiveVariableMap &primVars) override |
Not implemented. | |
void | patchMesh (const IECore::CubicBasisf &uBasis, const IECore::CubicBasisf &vBasis, int nu, bool uPeriodic, int nv, bool vPeriodic, const IECore::PrimitiveVariableMap &primVars) override |
Not implemented. | |
void | geometry (const std::string &type, const IECore::CompoundDataMap &topology, const IECore::PrimitiveVariableMap &primVars) override |
Not implemented. | |
void | procedural (IECore::Renderer::ProceduralPtr proc) override |
void | instanceBegin (const std::string &name, const IECore::CompoundDataMap ¶meters) override |
Starts the description of a portion of a scene to be instanced. | |
void | instanceEnd () override |
Ends the description of an instance. | |
void | instance (const std::string &name) override |
IECore::DataPtr | command (const std::string &name, const IECore::CompoundDataMap ¶meters) override |
void | editBegin (const std::string &name, const IECore::CompoundDataMap ¶meters) override |
void | editEnd () override |
Ends the current scene edit. | |
ShaderLoader * | shaderLoader () |
TextureLoader * | textureLoader () |
![]() | |
IE_CORE_DECLARERUNTIMETYPED (Renderer, RunTimeTyped) | |
IE_CORE_DECLAREPTR (Procedural) | |
IE_CORE_DECLAREPTR (ExternalProcedural) | |
virtual void | procedural (ProceduralPtr proc)=0 |
Renders a piece of procedural geometry. | |
virtual void | setOption (const std::string &name, ConstDataPtr value)=0 |
Set an option. Must not be called after worldBegin(). | |
virtual void | setAttribute (const std::string &name, ConstDataPtr value)=0 |
virtual void | curves (const CubicBasisf &basis, bool periodic, ConstIntVectorDataPtr numVertices, const IECore::PrimitiveVariableMap &primVars)=0 |
Renders a set of curves. | |
virtual void | mesh (ConstIntVectorDataPtr vertsPerFace, ConstIntVectorDataPtr vertIds, const std::string &interpolation, const PrimitiveVariableMap &primVars)=0 |
virtual void | nurbs (int uOrder, ConstFloatVectorDataPtr uKnot, float uMin, float uMax, int vOrder, ConstFloatVectorDataPtr vKnot, float vMin, float vMax, const PrimitiveVariableMap &primVars)=0 |
Renders a nurbs surface. | |
![]() | |
IE_CORE_DECLAREMEMBERPTR (RunTimeTyped) | |
virtual TypeId | typeId () const |
virtual const char * | typeName () const |
virtual bool | isInstanceOf (TypeId typeId) const |
virtual bool | isInstanceOf (const char *typeName) const |
![]() | |
IE_CORE_DECLAREMEMBERPTR (RefCounted) | |
void | addRef () const |
Add a reference to the current object. | |
void | removeRef () const |
Remove a reference from the current object. | |
RefCount | refCount () const |
Returns the current reference count. | |
Additional Inherited Members | |
![]() | |
typedef RefCounted | BaseClass |
A typedef for the class this class derives from. All RunTimeTyped classes define this typedef. | |
![]() | |
typedef size_t | RefCount |
![]() | |
static TypeId | staticTypeId () |
Returns the TypeId for this class, without needing an instance. | |
static const char * | staticTypeName () |
Returns the type name for this class, without needing an instance. | |
static TypeId | baseTypeId () |
static const char * | baseTypeName () |
static bool | inheritsFrom (TypeId typeId) |
Returns true if this class inherits from the specified type. | |
static bool | inheritsFrom (const char *typeName) |
Returns true if this class inherits from the specified type. | |
static bool | inheritsFrom (TypeId type, TypeId baseType) |
Returns true if type inherits from baseType. | |
static bool | inheritsFrom (const char *typeName, const char *baseTypeName) |
Returns true if typeName inherits from baseTypeName. | |
static TypeId | baseTypeId (TypeId typeId) |
Returns the base type of the given type, or InvalidTypeId if no such base exists. | |
static const std::vector< TypeId > & | baseTypeIds (TypeId typeId) |
static const std::set< TypeId > & | derivedTypeIds (TypeId typeId) |
static TypeId | typeIdFromTypeName (const char *typeName) |
static const char * | typeNameFromTypeId (TypeId typeId) |
static void | registerType (TypeId derivedTypeId, const char *derivedTypeName, TypeId baseTypeId) |
Allows external modules to register their own type ids. | |
![]() | |
typedef std::map< TypeId, TypeId > | BaseTypeRegistryMap |
typedef std::map< TypeId, std::vector< TypeId > > | BaseTypesRegistryMap |
typedef std::map< TypeId, std::set< TypeId > > | DerivedTypesRegistryMap |
typedef tbb::spin_rw_mutex | Mutex |
typedef std::map< TypeId, std::string > | TypeIdsToTypeNamesMap |
typedef std::map< std::string, TypeId > | TypeNamesToTypeIdsMap |
![]() | |
static BaseTypeRegistryMap & | baseTypeRegistry () |
static DerivedTypesRegistryMap & | derivedTypesRegistry () |
static BaseTypesRegistryMap & | completeBaseTypesRegistry () |
static DerivedTypesRegistryMap & | completeDerivedTypesRegistry () |
static void | derivedTypeIdsWalk (TypeId typeId, std::set< TypeId > &) |
static TypeIdsToTypeNamesMap & | typeIdsToTypeNames () |
static TypeNamesToTypeIdsMap & | typeNamesToTypeIds () |
![]() | |
static Mutex | g_baseTypeIdsMutex |
static Mutex | g_derivedTypeIdsMutex |
The IECoreGL::Renderer class implements the IECore::Renderer interface to allow rendering to OpenGL. Immediate mode rendering allows the generation of images and deferred mode rendering allows scenes to be captured for later interactive display.
|
overridevirtual |
Push a new attribute state onto the attribute stack. This is identical to the current state, but subsequent calls to setAttribute() will be discarded by the matching attributeEnd().
Implements IECore::Renderer.
|
overridevirtual |
Implements IECore::Renderer.
|
overridevirtual |
"removeObject"
Expects a StringData parameter named "name", which specifies the name of an object to remove from the scene. This only has any effect in deferred mode. "editBegin"
This parameter-less command marks the start of an edit to an existing scene, and should be called before any other changes are made when re-using an existing renderer, that has already reached worldEnd. "editEnd"
This parameter-less command marks the end of an edit to an existing scene, and should be called after other changes have been made when re-using an existing renderer. Note that if a scene has been drawn with renderer->scene()->render() prior to this edit, then it is essential that editEnd is called by the same thread on which drawing was performed, so that GL resources can be released in the appropriate context. "editQuery"
This parameter-less command returns BoolData( true ) if an edit is in progress, and BoolData( false ) otherwise.
Implements IECore::Renderer.
|
overridevirtual |
Creates a named coordinate system from the current transform. Coordinate systems are scoped by attributeBegin/attributeEnd blocks.
Implements IECore::Renderer.
|
override |
Supports the following primitive variables :
Vertex V3fVectorData "P" Constant FloatData "width"
|
overridevirtual |
Renders a disk of the specified radius on the xy plane, at the specified z value. If the "rightHandedOrientation" attribute is true then the normal faces down positive z, otherwise it faces down negative z.
Implements IECore::Renderer.
|
overridevirtual |
Specifies an image to be output from the renderer. In the case of file outputs name specified the filename. type specifies the type of output to create and data specifies the data to be output, for instance "rgba". parameters provides an implementation specific set of parameters to control other aspects of the image created. It is only valid to call this before worldBegin.
Implements IECore::Renderer.
|
overridevirtual |
Implements IECore::Renderer.
|
overridevirtual |
Supports the following image formats specified as primitive variables :
"R", "G", "B", "A" : UCharVectorData "R", "G", "B", "A" : CharVectorData "R", "G", "B", "A" : UIntVectorData "R", "G", "B", "A" : IntVectorData "R", "G", "B", "A" : HalfVectorData "R", "G", "B", "A" : FloatVectorData "R", "G", "B", "A" : DoubleVectorData
As a convenience the names "r", "g", "b", "a" or "red", "green", "blue", "alpha" can appear in place of "R", "G", "B", "A".
Currently assumes dataWindow==displayWindow.
Implements IECore::Renderer.
|
overridevirtual |
Instantiates a previously described instance at the current transform position, and using the current attribute state.
Implements IECore::Renderer.
|
override |
All meshes are treated as having interpolation=="linear".
|
overridevirtual |
Starts a new motion block. You should then make times.size() calls to one of the primitive or transform functions to specify the motion for the block.
Implements IECore::Renderer.
|
overridevirtual |
Ends a motion block. Should be called when times.size() calls to an appropriate primitive or transform function have been made following a motionBegin() call.
Implements IECore::Renderer.
|
overridevirtual |
Supports the following primitive variables :
Vertex V3fVectorData "P"
Uniform StringData "type" Used to determine how the points are rendered. Supported types are :
"gl:point" Rendered as GL_POINTS "particle" (the default) "disk" "blobby" Rendered as camera facing disks. The "width" and "constantwidth" variables are supported. Blobby is provided for vague compatibility with the IECoreRI::RIRenderer and 3delight. "patch" Rendered as camera facing patches. Supports the "width" and "constantwidth" variables and in addition the "patchaspectratio" and "patchrotation" variables. See the 3delight documentation for a description of how these can be used. "sphere" Rendered as spheres. Supports "width" and "constantwidth" variables to define the sizes of the spheres. Constant FloatData "constantwidth"
Vertex|Varying FloatVectorData "width"
Constant|Vertex|Varying FloatData|FloatVectorData "patchaspectratio" Constant|Vertex|Varying FloatData|FloatVectorData "patchrotation" These two are used only by the "patch" type.
Implements IECore::Renderer.
ScenePtr IECoreGL::Renderer::scene | ( | ) |
When in deferred mode (see setOption above), this method will return the Scene that was generated.
Referenced by IECoreMaya.FnProceduralHolder::componentNames().
|
override |
|
override |
"gl:mode" StringData Valid values are "immediate" or "deferred". In immediate mode rendering is performed in a streaming fashion, drawing each primitive as it is specified. In deferred mode rendering is performed by building a Scene object which can be retrieved for further use by using the scene() method after the render is complete. Future versions may support advanced features such as motion blur and depth of field when in deferred mode but not in immediate mode.
"searchPath:shader" StringData "gl:searchPath:shader" StringData Specifies a set of colon separated paths on which to search for GLSL shaders. The default value is obtained from the environment variable IECOREGL_SHADER_PATHS.
"searchPath:shaderInclude" StringData "gl:searchPath:shaderInclude" StringData Specifies a set of colon separated paths on which to search for include files for GLSL shaders. The default value is obtained from the environment variable IECOREGL_SHADER_INCLUDE_PATHS.
"searchPath:texture" StringData "gl:searchPath:texture" StringData Specifies a set of colon separated paths on which to search for textures. The default value is obtained from the environment variable IECOREGL_TEXTURE_PATHS. Any image file format for which an IECore::Reader is available is suitable for use as a texture.
"shutter" V2fData
"gl:drawCoordinateSystems" BoolData false When this is true, coordinate systems created with the coordinateSystem() method will be visualised.
|
overridevirtual |
Sets the current transform to a coordinate system previously created with a call to coordinateSystem().
Implements IECore::Renderer.
|
overridevirtual |
Supports only shader type "surface" or "gl:surface", looking for "name.vert" and "name.frag" GLSL source files in the paths defined by the "searchPath:shader" option. Alternatively if the parameter list contains "gl:vertexSource" and/or a "gl:fragmentSource" StringData then a new shader is created using the source provided. For shaders with sampler2D parameters, texture files for these parameters may be specified by passing the filename to an image as StringData.
Implements IECore::Renderer.
ShaderLoader* IECoreGL::Renderer::shaderLoader | ( | ) |
Returns the internal ShaderLoader object used to load the shaders for this renderer. If called before worldBegin it returns 0.
|
overridevirtual |
Renders a sphere of the specified radius. zMin and zMax are measured as a proportion of the radius - so no matter what the radius, the default values will always give a full sphere. If the "rightHandedOrientation" attribute is true then the normals point outwards, otherwise they point inwards.
Implements IECore::Renderer.
TextureLoader* IECoreGL::Renderer::textureLoader | ( | ) |
Returns the internal TextureLoader object. If called before worldBegin it returns 0.
|
overridevirtual |
Push a new transform state identical to the current one. Modifications can then be made locally before calling transformEnd() to return to the previous transform state.
Implements IECore::Renderer.
|
overridevirtual |
Starts the world block and resets the current transform to the identity.
Implements IECore::Renderer.