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

MultiTexture enables the application of several individual textures to a 3D object to achieve a more complex visual effect. More...

#include <H3D/MultiTexture.h>

Inheritance diagram for H3D::MultiTexture:
Inheritance graph

Public Types

typedef DependentMFNode< X3DTextureNode, FieldRef< H3DDisplayListObject, H3DDisplayListObject::DisplayList, &H3DDisplayListObject::displayList >, true > MFTexture
 An MFNode where we make sure the type of the nodes contained is a subclass of X3DTextureNode.
 
- 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.
 

Public Member Functions

 MultiTexture (Inst< DisplayList > _displayList=0, Inst< SFFloat > _alpha=0, Inst< SFColor > _color=0, Inst< MFString > _function=0, Inst< SFNode > _metadata=0, Inst< MFString > _mode=0, Inst< MFString > _source=0, Inst< MFTexture > _texture=0)
 Constructor.
 
virtual void render ()
 Install the textures in OpenGL.
 
virtual void enableTexturing ()
 Enable texturing for all textures in the MultiTexture.
 
virtual void disableTexturing ()
 Disable texturing for all textures in the MultiTexture.
 
- 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 void preRender ()
 This function will be called by the X3DShapeNode before any rendering of geometry and before the call to the render function.
 
virtual void postRender ()
 This function will be called by the X3DShapeNode after the geometry has been rendered to restore the states to what it was before the call to preRender().
 
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< SFFloatalpha
 Base alpha value for SELECT mode operations. More...
 
H3DUniquePtr< SFColorcolor
 Base alpha value for SELECT mode operations. More...
 
H3DUniquePtr< MFStringfunction
 The function field defines an optional function to be applied to the argument after the mode has been evaluated. More...
 
H3DUniquePtr< MFStringmode
 The mode field controls the type of blending operation. More...
 
H3DUniquePtr< MFStringsource
 The source field determines the colour source for the second argument. More...
 
H3DUniquePtr< MFTexturetexture
 The texture field contains a list of X3DTextureNode instances (e.g., ImageTexture, PixelTexture and MultiTexture). 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.
 

Additional Inherited Members

- 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 Member Functions inherited from H3D::X3DTextureNode
virtual std::pair< H3DInt32, H3DInt32getDefaultSaveDimensions ()
 Returns the default dimensions to use when this texture is saved to file. More...
 
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...
 
- 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...
 

Detailed Description

MultiTexture enables the application of several individual textures to a 3D object to achieve a more complex visual effect.

MultiTexture can be used as a value for the texture field in an Appearance node. The texture field contains a list of texture nodes (e.g., ImageTexture, PixelTexture, MovieTexture, and MultiTexture). The texture field may not contain another MultiTexture node.

Examples:

Internal routes:

Member Data Documentation

◆ alpha

H3DUniquePtr< SFFloat > H3D::MultiTexture::alpha

Base alpha value for SELECT mode operations.

Access type: inputOutput
Default value: 1
Valid range: [0-1]

Referenced by MultiTexture(), and render().

◆ color

H3DUniquePtr< SFColor > H3D::MultiTexture::color

Base alpha value for SELECT mode operations.

Access type: inputOutput
Default value: RGB( 1, 1, 1 )
Valid range: [0-1]

Referenced by MultiTexture(), and render().

◆ function

H3DUniquePtr< MFString > H3D::MultiTexture::function

The function field defines an optional function to be applied to the argument after the mode has been evaluated.

This is not supported at this time.

Access type: inputOutput

Referenced by render().

◆ mode

H3DUniquePtr< MFString > H3D::MultiTexture::mode

The mode field controls the type of blending operation.

The only available mode at this time is "MODULATE".

Access type: inputOutput

Referenced by MultiTexture(), and render().

◆ source

H3DUniquePtr< MFString > H3D::MultiTexture::source

The source field determines the colour source for the second argument.

This is not supported at this time.

Access type: inputOutput

Referenced by MultiTexture(), and render().

◆ texture

H3DUniquePtr< MFTexture > H3D::MultiTexture::texture

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