H3D::X3DShaderNode Class Reference
[Abstract nodes.]

This abstract node type is the base type for all node types which specify a programmable shader. More...

#include <H3D/X3DShaderNode.h>

Inheritance diagram for H3D::X3DShaderNode:

Inheritance graph

List of all members.

Public Member Functions

 X3DShaderNode (Inst< DisplayList > _displayList=0, Inst< SFNode > _metadata=0, Inst< SFBool > _isSelected=0, Inst< SFBool > _isValid=0, Inst< SFBool > _activate=0, Inst< SFString > _language=0)
 Constructor.
virtual bool isSupported ()
 Returns true if the shader node type is supported by the browser.
void setSelected (bool selected)
 Set the isSelected field.
virtual string defaultXMLContainerField ()
 Returns the default xml containerField attribute value.

Static Public Member Functions

static X3DShaderNodegetActiveShader ()
 Gets the currently active shader, i.e.

Public Attributes

auto_ptr< SFBoolisSelected
 The isSelected output field is used to indicate that this shader instance is the one selected for use by the browser.
auto_ptr< SFBoolisValid
 The isValid field is used to indicate whether the current shader objects can be run as a shader program.
auto_ptr< SFBoolactivate
 The activate field forces the shader to activate the contained objects.
auto_ptr< SFStringlanguage
 The language field is used to indicate to the browser which shading language is used for the source file(s).

Static Public Attributes

static H3DNodeDatabase database
 The H3DNodeDatabase for this node.


Detailed Description

This abstract node type is the base type for all node types which specify a programmable shader.

The isSelected output field is used to indicate that this shader instance is the one selected for use by the browser. A TRUE value indicates that this instance is in use. A FALSE value indicates that this instance is not in use.

The isValid field is used to indicate whether the current shader objects can be run as a shader program. For example, there are no syntax errors and the hardware can support all the required features. The definition of this field may also add additional semantics on a per-language basis.

The language field is used to indicate to the browser which shading language is used for the source file(s). This field may be used as a hint for the browser if the shading language is not immediately determinable from the source (e.g., a generic MIME type of text/plain is returned). A browser may use this field for determining which node instance will be selected and to ignore languages that it is not capable of supporting. H3D API only supports the "GLSL" language.


Member Function Documentation

virtual string H3D::X3DShaderNode::defaultXMLContainerField (  )  [inline, virtual]

Returns the default xml containerField attribute value.

For this node it is "shader".

Reimplemented from H3D::Node.

static X3DShaderNode* H3D::X3DShaderNode::getActiveShader (  )  [inline, static]

Gets the currently active shader, i.e.

the shader that is currently used in OpenGL. NULL us returned if no X3DShaderNode is used.

virtual bool H3D::X3DShaderNode::isSupported (  )  [inline, virtual]

Returns true if the shader node type is supported by the browser.

By default it checks that the language is GLSL.

Reimplemented in H3D::PackagedShader, and H3D::ProgramShader.

Referenced by H3D::Appearance::preRender().


Member Data Documentation

The activate field forces the shader to activate the contained objects.

Access type: inputOnly

Referenced by H3D::ComposedShader::ComposedShader(), H3D::PackagedShader::PackagedShader(), H3D::ProgramShader::ProgramShader(), H3D::ProgramShader::render(), H3D::ComposedShader::render(), and X3DShaderNode().

The isSelected output field is used to indicate that this shader instance is the one selected for use by the browser.

A TRUE value indicates that this instance is in use. A FALSE value indicates that this instance is not in use.

Access type: outputOnly

Referenced by H3D::Appearance::postRender(), H3D::Appearance::render(), and X3DShaderNode().

The isValid field is used to indicate whether the current shader objects can be run as a shader program.

For example, there are no syntax errors and the hardware can support all the required features.

Access type: outputOnly

Referenced by H3D::ComposedShader::render(), and X3DShaderNode().

The language field is used to indicate to the browser which shading language is used for the source file(s).

This field is ignored in H3D API since only "GLSL" source is allowed.

Access type: outputOnly

Referenced by H3D::PackagedShader::initCGShaderProgram(), and H3D::Appearance::preRender().


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

Generated on Fri Nov 7 10:31:30 2008 for H3D API by  doxygen 1.5.7