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

A PackagedShader node describes a single file that may contain a number of shaders and combined effects. More...

#include <H3D/PackagedShader.h>

Inheritance diagram for H3D::PackagedShader:

Inheritance graph

List of all members.

Public Member Functions

 PackagedShader (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< MFString > _url=0)
 Constructor.
virtual bool isSupported ()
 Returns true if the shader node type is supported by the browser.
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.
virtual void initCGShaderProgram ()
 Initialize a cg shader program from the current field values.

Static Public Attributes

static H3DNodeDatabase database
 The H3DNodeDatabase for this node.


Detailed Description

A PackagedShader node describes a single file that may contain a number of shaders and combined effects.

The shader source is read from the URL specified by the url field.

The language field may be used to optionally determine the language type. Only the CG language strings are supported by H3D API. If you want to use GLSL use the ComposedShader node.

The main function of the CG vertex shader must be named "vert_main" and the main function of the fragment shader must be named "frag_main".

Internal routes:
PackagedShader.dot

Member Function Documentation

bool PackagedShader::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().


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

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