H3D::ComposedShader Class Reference
[X3D node classes.]

The ComposedShader node defines a shader where the individual source files are not individually programmable. More...

#include <H3D/ComposedShader.h>

Inheritance diagram for H3D::ComposedShader:

Inheritance graph

List of all members.

Public Types

typedef DependentMFNode
< ShaderPart, FieldRef
< X3DUrlObject, MFString,&ShaderPart::url >
, true > 
MFShaderPart
 The MFShaderPart is dependent on the url field of the containing ShaderPart node.

Public Member Functions

 ComposedShader (Inst< DisplayList > _displayList=0, Inst< SFNode > _metadata=0, Inst< SFBool > _isSelected=0, Inst< SFBool > _isValid=0, Inst< SFBool > _activate=0, Inst< SFString > _language=0, Inst< MFShaderPart > _parts=0)
 Constructor.
virtual bool addField (const string &name, const Field::AccessType &access, Field *field)
 The addField method is specialized to add a route from the field added to the displayList field.
virtual void render ()
 Sets up the shader program and sets uniform variable values.
virtual void preRender ()
 Enables the shader program.
virtual void postRender ()
 Disables the shader program.

Public Attributes

auto_ptr< MFShaderPartparts
 The shader parts to use in the ComposedShader.

Static Public Attributes

static H3DNodeDatabase database
 The H3DNodeDatabase for this node.

Protected Attributes

GLhandleARB program_handle
 The handle to the program object used for the shader in OpenGL.
vector< GLhandleARB > current_shaders
 A vector of the handles to all shader objects that are currently linked into the program object.


Detailed Description

The ComposedShader node defines a shader where the individual source files are not individually programmable.

All access to the shading capabilities is defined through a single interface that applies to all parts.

In H3D API this is the shader node to use if you want to use the GLSL shading language. If you want to use CG, use either the ProgramShader or PackagedShader nodes.

The isValid field adds an additional semantic indicating whether the current shader parts can be linked together to form a complete valid shader program.

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

Internal routes:
ComposedShader.dot

Member Typedef Documentation

The MFShaderPart is dependent on the url field of the containing ShaderPart node.


Member Function Documentation

bool ComposedShader::addField ( const string &  name,
const Field::AccessType access,
Field field 
) [virtual]

The addField method is specialized to add a route from the field added to the displayList field.

Reimplemented from H3D::H3DDynamicFieldsObject.

References H3D::H3DDisplayListObject::displayList, and H3D::Field::route().


Member Data Documentation

vector< GLhandleARB > H3D::ComposedShader::current_shaders [protected]

A vector of the handles to all shader objects that are currently linked into the program object.

Referenced by render().

The shader parts to use in the ComposedShader.

Access type: outputOnly

ComposedShader_parts.dot

Referenced by ComposedShader(), and render().


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

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