29 #ifndef __H3DGENERATEDSHADERNODE_H__
30 #define __H3DGENERATEDSHADERNODE_H__
118 public TypedField< SFBool, void, AnyNumber< Field > > {
129 Inst< SFNode > _metadata = 0,
130 Inst< SFBool > _isSelected = 0,
131 Inst< SFBool > _isValid = 0,
132 Inst< SFBool > _activate = 0,
133 Inst< SFString > _language = 0,
134 Inst< MFShaderPart > _parts = 0,
135 Inst< SFBool > _suppressUniformWarnings = 0,
136 Inst< MFString > _fragmentShaderString = 0,
137 Inst< MFString > _vertexShaderString = 0 );
140 virtual void buildShader();
144 virtual void preRender();
204 const string &_calculation ):
207 calculation( _calculation ) {
222 const string &_type ) :
241 virtual string getFinalFragmentShaderOutputString();
248 virtual string getVertexShaderString();
266 virtual string uniqueShaderName(
const string &base_name );
285 const string &glsl_type,
289 bool delete_unadded_field =
true );
294 T* copyAndRouteField(T *input) {
300 T* copyAndRouteField(
const H3DUniquePtr<T> &input) {
319 static unsigned int instance_count;
Header file for ComposedShader, X3D scene-graph node.
Contains the SFMatrix4f field class.
Header file for X3DTexture2DNode, X3D scene-graph node.
The ComposedShader node defines a shader where the individual source files are not individually progr...
Definition: ComposedShader.h:77
The Field class.
Definition: Field.h:46
AccessType
The different access types that a field can have.
Definition: Field.h:53
The H3DGeneratedShaderNode node is the base class for nodes that generates GLSL shaders for use in pl...
Definition: H3DGeneratedShaderNode.h:113
virtual string getVertexShaderHeader()
Return a string that is placed at the beginning of a vertex shader to specify minimum required versio...
Definition: H3DGeneratedShaderNode.h:316
H3DUniquePtr< MFString > vertexShaderString
Contains the generated vertex shader code.
Definition: H3DGeneratedShaderNode.h:158
static H3DNodeDatabase database
The H3DNodeDatabase for this node.
Definition: H3DGeneratedShaderNode.h:161
H3DUniquePtr< MFString > fragmentShaderString
Contains the generated fragment shader code.
Definition: H3DGeneratedShaderNode.h:151
virtual string getFunctionShaderString()
Get a string with GLSL function definitions to be used by the generated shader.
Definition: H3DGeneratedShaderNode.h:187
virtual void buildShader()
Rebuilds the generated shader, causing a full rebuild and relink of the shader.
Definition: H3DGeneratedShaderNode.cpp:121
H3DUniquePtr< RebuildShader > rebuildShader
Field used to update the shader code when an event is received.
Definition: H3DGeneratedShaderNode.h:168
virtual void getVaryingVariables(vector< VaryingVariable > &)
Get the varying variables used by the shader generator.
Definition: H3DGeneratedShaderNode.h:230
virtual void getAttributes(vector< Attribute > &)
Get the attribues used by the shader generator.
Definition: H3DGeneratedShaderNode.h:235
virtual string getFragmentShaderHeader()
Return a string that is placed at the beginning of a fragment shader to specify minimum required vers...
Definition: H3DGeneratedShaderNode.h:311
virtual string getFragmentShaderString()
Returns the shader code for the fragment shader.
Definition: H3DGeneratedShaderNode.h:256
A template modifier class for adding type checking on the routes to any Field class.
Definition: TypedField.h:84
H3D API namespace.
Definition: Anchor.h:38
Struct used to define an attribute in the shader.
Definition: H3DGeneratedShaderNode.h:213
string name
The name of the attribute.
Definition: H3DGeneratedShaderNode.h:215
Attribute(const string &_name, const string &_type)
Constructor.
Definition: H3DGeneratedShaderNode.h:221
string type
The glsl type of the variable(int, float, etc).
Definition: H3DGeneratedShaderNode.h:218
Specialized field that rebuilds the shader when it updates.
Definition: H3DGeneratedShaderNode.h:118
virtual void update()
Make the field up to date given that an event has occured.
Definition: H3DGeneratedShaderNode.h:120
Struct used to define a varying variable in the shader.
Definition: H3DGeneratedShaderNode.h:190
string name
The name of the variable.
Definition: H3DGeneratedShaderNode.h:192
string calculation
String defining glsl code to set the value of the varying variable.
Definition: H3DGeneratedShaderNode.h:199
VaryingVariable(const string &_name, const string &_type, const string &_calculation)
Constructor.
Definition: H3DGeneratedShaderNode.h:202
string type
The glsl type of the variable(int, mat3, sampler2D etc).
Definition: H3DGeneratedShaderNode.h:195
The H3DNodeDatabase contains a mapping between a name of a Node and the constructor for the Node with...
Definition: H3DNodeDatabase.h:194