Class for creating a texture by rendering a scene graph More...
#include <Inventor/nodes/SoRenderToTextureProperty.h>
Public Types | |
enum | UpdatePolicy { EACH_FRAME, WHEN_NEEDED, ON_TRIGGER } |
enum | Component { RGB, RGB_TRANSPARENCY, RGB_ALPHA = RGB_TRANSPARENCY, DEPTH } |
Public Member Functions | |
virtual SoType | getTypeId () const |
SoRenderToTextureProperty () | |
void | setGLRenderAction (SoGLRenderAction *ra) |
SoGLRenderAction * | getGLRenderAction () const |
void | setGraphicConfigTemplate (SoGLGraphicConfigTemplate *gct) |
SoGLGraphicConfigTemplate * | getGraphicConfigTemplate () |
void | setContextForSharing (SoGLContext *context) |
Static Public Member Functions | |
static SoType | getClassTypeId () |
Public Attributes | |
SoMFNode | node |
SoMFPath | path |
SoSFEnum | updatePolicy |
SoSFColor | backgroundColor |
SoSFVec2s | size |
SoSFEnum | component |
SoSFTrigger | trigger |
This class is used to define an image for texture mapping which is created by rendering a scene graph.
It can be used with the classes SoTexture2 and SoTextureCubeMap. Create the SoRenderToTextureProperty node and assign it to the renderToTextureProperty field of the texture mapping node.
The SoRenderToTarget node can also be used to create texture images.
One of the two fields, node or path, must be defined.
The scene graph should normally contain a camera and at least one light. Unlike SoRenderToTarget, the children of SoRenderToTextureProperty do not inherit the camera, lights, etc from the main scene graph.
Note that the default image size is 0,0 (effectively disables rendering).
node | [] |
path | "" |
updatePolicy | WHEN_NEEDED |
backgroundColor | 0 0 0 |
size | 0 0 |
component | RGB |
SoRenderToTextureProperty::SoRenderToTextureProperty | ( | ) |
static SoType SoRenderToTextureProperty::getClassTypeId | ( | ) | [static] |
Returns the type identifier for this class.
Reimplemented from SoNode.
SoGLRenderAction* SoRenderToTextureProperty::getGLRenderAction | ( | ) | const |
Returns the render action used for rendering the scene.
SoGLGraphicConfigTemplate* SoRenderToTextureProperty::getGraphicConfigTemplate | ( | ) |
Returns the graphic config template used for rendering the scene.
virtual SoType SoRenderToTextureProperty::getTypeId | ( | ) | const [virtual] |
Returns the type identifier for this specific instance.
Reimplemented from SoNode.
void SoRenderToTextureProperty::setContextForSharing | ( | SoGLContext * | context | ) |
Set OpenGL render context for display list sharing.
Must be set before calling the create() method. There is no guarantee that sharing will be allowed.
void SoRenderToTextureProperty::setGLRenderAction | ( | SoGLRenderAction * | ra | ) |
Specifies a custom render action to use for rendering the scene.
void SoRenderToTextureProperty::setGraphicConfigTemplate | ( | SoGLGraphicConfigTemplate * | gct | ) |
Specifies a custom graphic config template to use for rendering the scene.
Background color used when rendering the scene graph.
Black by default.
Specifies the type of component(s) for the rendering.
Use enum Component. Default is RGB.
Specifies the scene graph(s) (SoNode(s)) to be rendered into the texture.
For use with SoTexture2, only one scene graph should be specified. For use with SoTextureCube map, six scene graphs must be specified, one for each face of the cube in the order:
The node field has priority over the path field. Null by default.
Specifies the scene graph(s) (SoPath(s)) to be rendered into the texture.
For use with SoTexture2, only one path should be specified. For use with SoTextureCube map, six paths must be specified, one for each face of the cube in the order:
The node field has priority over the path field. Null by default.
Size in pixels of the rendered texture.
If the size is not a power of two (e.g. 128 or 256) and the OpenGL extension texture_non_power_of_two is not supported by the GPU, the size will be automatically scaled to the next power of two (less effective). (0, 0) by default.
Trigger field to render the scene into the Pbuffer.
Effective only if updatePolicy is ON_TRIGGER.
Specifies the policy for rendering to the texture.
Use enum UpdatePolicy. Default is WHEN_NEEDED.