H3D API  2.4.1
Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | List of all members
H3D::RenderTargetTexture Class Reference

The RenderTargetTexture is a wrapper node to use one of the render targets(color textures) from a FrameBufferTextureGenerator directly as a texture. More...

#include <H3D/RenderTargetTexture.h>

Inheritance diagram for H3D::RenderTargetTexture:
Inheritance graph

Public Member Functions

 RenderTargetTexture (Inst< DisplayList > _displayList=0, Inst< SFNode > _metadata=0, Inst< SFFrameBufferTextureGenerator > _generator=0, Inst< SFInt32 > _index=0)
 Constructor.
 
virtual ~RenderTargetTexture ()
 Destructor.
 
virtual void render ()
 Overridden virtual function to perform the same function on the correct texture from the generator.
 
virtual void postRender ()
 Overridden virtual function to perform the same function on the correct texture from the generator.
 
virtual void preRender ()
 Overridden virtual function to perform the same function on the correct
More...
 
virtual void enableTexturing ()
 Overridden virtual function to perform the same function on the correct
More...
 
virtual void disableTexturing ()
 Overridden virtual function to perform the same function on the correct
More...
 
virtual GLuint getTextureId ()
 Overridden virtual function to perform the same function on the correct texture from the generator.
 
virtual GLuint getTextureUnit ()
 Overridden virtual function to perform the same function on the correct texture from the generator.
 
virtual GLenum getTextureTarget ()
 Overridden virtual function to perform the same function on the correct texture from the generator.
 
virtual int getTextureWidth ()
 Overridden virtual function to perform the same function on the correct texture from the generator.
 
virtual int getTextureHeight ()
 Overridden virtual function to perform the same function on the correct texture from the generator.
 
virtual int getTextureDepth ()
 Overridden virtual function to perform the same function on the correct texture from the generator.
 
virtual void setTextureId (GLuint id)
 Overridden virtual function to perform the same function on the correct texture from the generator.
 
virtual void setTextureUnit (GLint unit)
 Overridden virtual function to perform the same function on the correct texture from the generator.
 
virtual void setTextureTarget (GLenum target)
 Overridden virtual function to perform the same function on the correct texture from the generator.
 
virtual bool makeResident ()
 Make the texture resident as a bindless texture.
 
virtual void makeNonResident ()
 Make the texture non-resident.
 
virtual bool isResident ()
 Returns true if the texture is resident in GPU memory or false otherwise.
 
virtual GLuint64 getTextureHandle ()
 Get the bindless texture handle, or 0 if not resident.
 
virtual void invalidateTextureHandle ()
 This should be called if the texture object is to be replaced. More...
 
virtual void inUse ()
 Call to signify that this texture is currently in use. More...
 
- Public Member Functions inherited from H3D::H3DSingleTextureNode
 H3DSingleTextureNode (Inst< DisplayList > _displayList=0, Inst< SFNode > _metadata=0, Inst< UpdateSaveToURL > _saveToUrl=0, Inst< SFBool > _saveSuccess=0, Inst< SFInt32 > _saveHeight=0, Inst< SFInt32 > _saveWidth=0)
 Constructor.
 
virtual ~H3DSingleTextureNode ()
 Destructor.
 
virtual void setTextureWidth (int _width)
 Set the texture width.
 
virtual void setTextureHeight (int _height)
 Set the texture height.
 
virtual void setTextureDepth (int _depth)
 Set the texture depth.
 
void addShaderField (Field &_field)
 Add a shader field which contains this texture node. More...
 
void removeShaderField (Field &_field)
 Remove a shader field which contains this texture node. More...
 
- Public Member Functions inherited from H3D::X3DTextureNode
 X3DTextureNode (Inst< DisplayList > _displayList=0, Inst< SFNode > _metadata=0, Inst< UpdateSaveToURL > _saveToUrl=0, Inst< SFBool > _saveSuccess=0, Inst< SFInt32 > _saveHeight=0, Inst< SFInt32 > _saveWidth=0)
 Constructor.
 
virtual string defaultXMLContainerField ()
 Returns the default xml containerField attribute value. More...
 
virtual GLbitfield getAffectedGLAttribs ()
 Returns a bitmask of the OpenGL attrib bits that will be affected by this node. More...
 
virtual Vec3f textureSize ()
 Sometimes the texture represents a volume in space, e.g. More...
 
virtual GLuint renderImage (Image *image, GLenum texture_target, bool scale_to_power_of_two)
 Installs the image as a OpenGL texture. More...
 
virtual GLint glInternalFormat (Image *image)
 Returns the internal OpenGL format to use given an Image, e.g. More...
 
virtual GLenum glPixelFormat (Image *image)
 Returns the OpenGL pixel format to use given an Image, e.g. More...
 
virtual GLenum glPixelComponentType (Image *image)
 Returns the OpenGL pixel compnent type to use given an Image, e.g. More...
 
virtual void glTexImage (Image *, GLenum, bool)
 Install the given image as a OpenGL texture with a call to a glTexImage function. More...
 
virtual ImagerenderToImage (H3DInt32 _width, H3DInt32 _height, bool output_float_texture=false)
 Create a new Image object which contains the result of rendering this texture. More...
 
- Public Member Functions inherited from H3D::X3DAppearanceChildNode
 X3DAppearanceChildNode (Inst< DisplayList > _displayList=0, Inst< SFNode > _metadata=0)
 Constructor.
 
- Public Member Functions inherited from H3D::X3DNode
 X3DNode (Inst< SFNode > _metadata=0)
 Constructor.
 
X3DMetadataObjectgetMetadataByName (const string &_name)
 Given a name, the first X3DMetadataObject in the metadata field that matches that name is returned. More...
 
- Public Member Functions inherited from H3D::Node
 Node ()
 Constructor.
 
virtual Nodeclone (bool deepCopy=true, DeepCopyMap *deepCopyMap=NULL)
 Returns a new instance of this node type with the same state as this one. More...
 
virtual ~Node ()
 Destructor.
 
X3DPrototypeInstancegetProtoInstanceParent ()
 If this node is the root node in the proto body of a X3DPrototypeInstance then this will return that node. More...
 
void setProtoInstanceParent (X3DPrototypeInstance *p)
 Set the X3DPrototypeInstance this node is the the root node if applicaple.
 
virtual void traverseSG (TraverseInfo &ti)
 traverseSG is called once per scenegraph loop on the scene in order to traverse the scenegraph. More...
 
virtual bool lineIntersect (const Vec3f &from, const Vec3f &to, LineIntersectResult &result)
 Detect intersection between a line segment and the Node. More...
 
virtual void closestPoint (const Vec3f &p, NodeIntersectResult &result)
 Find closest point on Node to p. More...
 
virtual bool movingSphereIntersect (H3DFloat radius, const Vec3f &from, const Vec3f &to, NodeIntersectResult &result)
 Detect collision between a moving sphere and the Node. More...
 
virtual FieldgetField (const string &_name) const
 return a pointer to the field specified by name within this instance
 
int addDestructCallback (void(*func)(Node *, void *), void *args)
 Add a callback function to be run on destruction of node. More...
 
int removeDestructCallback (void(*func)(Node *, void *), void *args)
 Add a callback function to be run on destruction of node. More...
 
- Public Member Functions inherited from H3D::H3DDisplayListObject
 H3DDisplayListObject (Inst< DisplayList > _displayList=0)
 Constructor.
 

Public Attributes

H3DUniquePtr< SFFrameBufferTextureGeneratorgenerator
 The generator field contains the FrameBufferTextureGenerator node from which to use a render target (color texture ). More...
 
H3DUniquePtr< SFInt32index
 The index field indicates which render target (color texture) to use from the FrameBufferTextureGenerator. More...
 
- Public Attributes inherited from H3D::X3DTextureNode
H3DUniquePtr< UpdateSaveToURLsaveToUrl
 When a new value is specified for saveToUrl the current texture is rendered to a buffer and saved to the specified filename. More...
 
H3DUniquePtr< SFBoolsaveSuccess
 Contains the result of the last save operation. More...
 
H3DUniquePtr< SFInt32saveHeight
 The height of the image to write to file when the saveToUrl field is used. More...
 
H3DUniquePtr< SFInt32saveWidth
 The width of the image to write to file when the saveToUrl field is used. More...
 
- Public Attributes inherited from H3D::X3DNode
H3DUniquePtr< SFNodemetadata
 Meta data about the node. More...
 
- Public Attributes inherited from H3D::H3DDisplayListObject
H3DUniquePtr< DisplayListdisplayList
 The DisplayList instance handling the OpenGL caching of this object.
 

Static Public Attributes

static H3DNodeDatabase database
 The H3DNodeDatabase for this node.
 
- Static Public Attributes inherited from H3D::X3DTextureNode
static bool load_images_in_separate_thread = true
 This is the default value for the GlobalSettings::loadTexturesInThread field. More...
 
static H3DNodeDatabase database
 The H3DNodeDatabase for this node.
 
- Static Public Attributes inherited from H3D::X3DNode
static H3DNodeDatabase database
 The H3DNodeDatabase for this node.
 

Protected Member Functions

virtual std::pair< H3DInt32, H3DInt32getDefaultSaveDimensions ()
 Override getDefaultSaveDimensions function to get current texture dimension for this RenderTargetTexture.
 
- Protected Member Functions inherited from H3D::X3DTextureNode
GLint glCompressedInternalFormat (GLint _format, const std::string &_compression)
 Given a non-compressed internal format, return an equivelent compressed format based on the compression settings. More...
 
- Protected Member Functions inherited from H3D::Node
void cloneFieldValue (Field &_from, Field &_to, bool deepCopy, DeepCopyMap &deepCopyMap)
 A helper function for the clone() method. More...
 

Additional Inherited Members

- Public Types inherited from H3D::Node
typedef std::map< Node *, Node * > DeepCopyMap
 A map type used during a deep copy clone() to map from original nodes to cloned nodes.
 
- Static Public Member Functions inherited from H3D::H3DSingleTextureNode
static void makeUnusedTexturesNonResident (H3DTime _unusedTime)
 Look at all resident textures and make those that have not been used recently non-resident. More...
 
- Static Public Member Functions inherited from H3D::X3DTextureNode
static X3DTextureNodegetActiveTexture ()
 Gets the currently active texture, i.e. More...
 
static void setActiveTexture (X3DTextureNode *t)
 Set the active texture. More...
 
- Static Public Member Functions inherited from H3D::Node
static unsigned int nrNodesAlive ()
 Returns the nr of nodes currently alive, i.e. nodes created but not destructed.
 
static int nrNodesCreated ()
 Returns the number of nodes created in total since the start of the program.
 
- Protected Types inherited from H3D::H3DSingleTextureNode
typedef std::vector< H3DSingleTextureNode * > TextureVector
 }
 
- Static Protected Member Functions inherited from H3D::Node
static NodegetClonedInstance (Node *original, bool deepCopy, DeepCopyMap &deepCopyMap)
 A helper function for nodes that implement clone() More...
 
- Protected Attributes inherited from H3D::H3DSingleTextureNode
GLuint64 texture_handle
 The texture handle (GPU)
 
GLuint texture_id
 The OpenGL texture id of the installed texture, 0 if not installed.
 
GLint texture_unit
 The OpenGL texture unit that is used to render this texture. More...
 
GLenum texture_target
 The OpenGL texture target that is used to render this texture.
 
int texture_width
 texture width
 
int texture_height
 texture height
 
int texture_depth
 texture depth
 
Field::FieldVector shader_fields
 Shader fields which contain this texture.
 
H3DTime last_used
 Time-stamp at which this texture was last used.
 
bool is_resident
 True if this texture is currently resident.
 
- Static Protected Attributes inherited from H3D::H3DSingleTextureNode
static TextureVector resident_textures
 List of all currently resident textures.
 

Detailed Description

The RenderTargetTexture is a wrapper node to use one of the render targets(color textures) from a FrameBufferTextureGenerator directly as a texture.

The generator field contains the FrameBufferTextureGenerator node from which to use a render target (color texture ).

The index field indicates which render target (color texture) to use from the FrameBufferTextureGenerator.

Examples:

Internal routes:

Member Function Documentation

◆ disableTexturing()

void RenderTargetTexture::disableTexturing ( )
virtual

Overridden virtual function to perform the same function on the correct

texture from the generator.

Implements H3D::X3DTextureNode.

References H3D::FrameBufferTextureGenerator::colorTextures, generator, and index.

◆ enableTexturing()

void RenderTargetTexture::enableTexturing ( )
virtual

Overridden virtual function to perform the same function on the correct

texture from the generator.

Implements H3D::X3DTextureNode.

References H3D::FrameBufferTextureGenerator::colorTextures, generator, and index.

◆ inUse()

void RenderTargetTexture::inUse ( )
virtual

Call to signify that this texture is currently in use.

Textures that are not in use are periodically detected and made non-resident

Reimplemented from H3D::H3DSingleTextureNode.

References H3D::FrameBufferTextureGenerator::colorTextures, generator, and index.

◆ invalidateTextureHandle()

void RenderTargetTexture::invalidateTextureHandle ( )
virtual

This should be called if the texture object is to be replaced.

This will cause the texture to become non-resident and for the texture handle to be regenerated the next time the texture is made resident

Reimplemented from H3D::H3DSingleTextureNode.

References H3D::FrameBufferTextureGenerator::colorTextures, generator, and index.

◆ preRender()

void RenderTargetTexture::preRender ( )
virtual

Overridden virtual function to perform the same function on the correct

texture from the generator.

Reimplemented from H3D::X3DTextureNode.

References H3D::FrameBufferTextureGenerator::colorTextures, generator, index, and H3D::X3DTextureNode::preRender().

Member Data Documentation

◆ generator

H3DUniquePtr< SFFrameBufferTextureGenerator > H3D::RenderTargetTexture::generator

◆ index

H3DUniquePtr< SFInt32 > H3D::RenderTargetTexture::index

The documentation for this class was generated from the following files: