29 #ifndef __COMPOSEDSHADER_H__
30 #define __COMPOSEDSHADER_H__
90 virtual void onAdd(
Node *n );
93 typedef std::map< string , H3D::Shaders::UniformInfo > UniformFieldMap;
96 UniformFieldMap uniformFields;
111 virtual void onAdd(
Node *);
112 virtual void onRemove(
Node *);
117 class H3DAPI_API UpdateSaveShadersToUrl:
public OnNewValueSField < AutoUpdate < SFString > >
120 virtual void onNewValue(
const std::string &v );
128 Inst< SFNode > _metadata = 0,
129 Inst< SFBool > _isSelected = 0,
130 Inst< SFBool > _isValid = 0,
131 Inst< SFBool > _activate = 0,
132 Inst< SFString > _language = 0,
133 Inst< MFShaderPart > _parts = 0,
134 Inst< SFBool > _suppressUniformWarnings = 0,
135 Inst< SFString > _geometryInputType = 0,
136 Inst< SFString > _geometryOutputType = 0,
137 Inst< SFInt32 > _geometryVerticesOut = 0,
138 Inst< SFString > _transparencyDetectMode = 0,
139 Inst< MFString > _transformFeedbackVaryings = 0,
140 Inst< SFBool > _printShaderWarnings = 0,
141 Inst< SFShaderConstants > _shaderConstants = 0
144 Inst< UpdateSaveShadersToUrl > _saveShadersToUrl = 0
153 virtual bool addField(
const string &_name,
159 virtual bool removeField (
const string& _name );
168 virtual void render();
171 virtual void preRender();
174 virtual void postRender();
179 virtual GLbitfield getAffectedGLAttribs();
190 return program_handle;
195 H3DUniquePtr< UpdateSaveShadersToUrl > saveShadersToUrl;
308 virtual void update ();
311 static bool shader_support_checked;
325 static map<string, GLhandleARB> phandles_map;
326 static map<GLhandleARB, int> phandle_counts;
335 void setGeometryShaderParameters( GLenum _program_handle);
343 virtual void update();
348 map< Field *, NodeVector > fields_to_nodes;
364 virtual void onValueChange(
const bool &new_value );
368 H3DUniquePtr<UpdateCache> updateCache;
374 bool printShaderLog();
377 virtual void initialize();
Contains the DependentSFNode and DependentMFNode template classes.
Contains different templates to modify field behaviour.
Header file for H3DSingleTextureNode, X3D scene-graph node.
Contains the SField template class.
Header file for ShaderConstants.
Header file for help functions used by shader nodes.
Header file for ShaderPart, X3D scene-graph node.
Header file for X3DProgrammableShaderObject.
Header file for X3DShaderNode, X3D scene-graph node.
MFShaderPart is specialized to transfer a pointer from itself to the ShaderPart instances contained i...
Definition: ComposedShader.h:109
Class used to set up routes from nodes in SFNode and MFNode fields to correctly break cache.
Definition: ComposedShader.h:341
event collection field to update when global caching is update
Definition: ComposedShader.h:362
The ComposedShader node defines a shader where the individual source files are not individually progr...
Definition: ComposedShader.h:77
vector< GLhandleARB > current_shaders
A vector of the handles to all shader objects that are currently linked into the program object.
Definition: ComposedShader.h:322
H3DUniquePtr< SetupDynamicRoutes > setupDynamicRoutes
C++ fields only. Contains instance of SetupDynamicRoutes.
Definition: ComposedShader.h:352
DependentSFNode< ShaderConstants, FieldRef< H3DDisplayListObject, H3DDisplayListObject::DisplayList, &H3DDisplayListObject::displayList >, true > SFShaderConstantsBase
The SFShaderConstants field is dependent on the displayList field of the containing ShaderConstants n...
Definition: ComposedShader.h:86
H3DUniquePtr< MFString > transformFeedbackVaryings
List of varying names to capture during transform feedback.
Definition: ComposedShader.h:292
GLhandleARB program_handle
The handle to the program object used for the shader in OpenGL.
Definition: ComposedShader.h:318
DependentMFNode< ShaderPart, FieldRef< ShaderPart, ShaderPart::SFShaderString, &ShaderPart::shaderString >, true > MFShaderPartBase
The MFShaderPartBase is dependent on the url field of the containing ShaderPart node.
Definition: ComposedShader.h:105
H3DUniquePtr< MFShaderPart > parts
The shader parts to use in the ComposedShader.
Definition: ComposedShader.h:211
static bool tessellation_support_checked
True if a warning has already been output about missing tessellation shader support.
Definition: ComposedShader.h:315
GLhandleARB getProgramHandle()
Returns the OpenGL shader program handle used by the ComposedShader.
Definition: ComposedShader.h:189
static H3DNodeDatabase database
The H3DNodeDatabase for this node.
Definition: ComposedShader.h:303
H3DUniquePtr< SFInt32 > geometryVerticesOut
The number of vertices the geometry shader generates.
Definition: ComposedShader.h:257
list< H3DSingleTextureNode * > shader_textures
list of textures to be used by the composedshader
Definition: ComposedShader.h:355
H3DUniquePtr< SFBool > suppressUniformWarnings
Suppress the warnings printed to the console about setting uniform fields that do not exist in the sh...
Definition: ComposedShader.h:227
H3DUniquePtr< SFString > geometryInputType
The input geometry type of the geometry being rendered with a geometry shader.
Definition: ComposedShader.h:238
H3DUniquePtr< SFBool > printShaderWarnings
Always print shader warnings to console.
Definition: ComposedShader.h:300
H3DUniquePtr< SFString > geometryOutputType
The output geometry type of the geometry being rendered with a geometry shader.
Definition: ComposedShader.h:248
H3DUniquePtr< SFString > transparencyDetectMode
Determines how the render system will determine if the shader used generates any fragment that has an...
Definition: ComposedShader.h:280
H3DUniquePtr< UpdateUniforms > updateUniforms
A field used to update any uniforms from their corresponding fields.
Definition: ComposedShader.h:358
H3DUniquePtr< SFShaderConstants > shaderConstants
The shaderConstants field can contain a ShaderConstants node defining constants that can be used by a...
Definition: ComposedShader.h:204
Specifies parameters for if displaying debug information like bounding boxes, haptically rendered tri...
Definition: DebugOptions.h:46
DependentMFNode are modified TypedMFNode fields where the field dirty status is dependent on fields i...
Definition: DependentNodeFields.h:336
DependentSFNode are modified TypedSFNode fields where the field dirty status is dependent on fields i...
Definition: DependentNodeFields.h:294
The EventCollection field collects all fields routed to it that generates event between calls to the ...
Definition: FieldTemplates.h:145
Class used for specifying a field member of a node in a DependentSFNode or DependentMFNode specificat...
Definition: DependentNodeFields.h:48
The Field class.
Definition: Field.h:46
AccessType
The different access types that a field can have.
Definition: Field.h:53
We use the Field's lazy evaluation mechanisms to manage the GL display lists for rendering,...
Definition: H3DDisplayListObject.h:60
This abstract interface class is the base class for all node types that wants to create an OpenGL dis...
Definition: H3DDisplayListObject.h:54
H3DUniquePtr< DisplayList > displayList
The DisplayList instance handling the OpenGL caching of this object.
Definition: H3DDisplayListObject.h:256
Node is the base class for all classes that can be part of the H3D scene-graph.
Definition: Node.h:46
Template for adding the virtual function onNewValue that can be overridden in subclasses in order to ...
Definition: FieldTemplates.h:79
Template for adding the virtual function onValueChange that can be overridden in subclasses in order ...
Definition: FieldTemplates.h:49
The ShaderConstants node is a node will be used to gather all static shader inputs to be used in the ...
Definition: ShaderConstants.h:34
Update the string to use as shader depending from the urls given.
Definition: ShaderPart.h:83
The ShaderPart node defines the source for a single object to be used by a ComposedShader node.
Definition: ShaderPart.h:79
H3DUniquePtr< SFShaderString > shaderString
A field that contains the string loaded from file and to be used as input to the shader.
Definition: ShaderPart.h:163
TraverseInfo is a structure that is passed along when traversing the scene graph.
Definition: TraverseInfo.h:57
This is the base node type for all Material nodes.
Definition: X3DMaterialNode.h:41
This abstract node type is the base type for all node types that specify arbitrary fields for interfa...
Definition: X3DProgrammableShaderObject.h:64
This abstract node type is the base type for all node types which specify a programmable shader.
Definition: X3DShaderNode.h:61
H3D API namespace.
Definition: Anchor.h:38
The AutoUpdate field is a template to force the BaseField to update itself as soon as an event is rec...
Definition: FieldTemplates.h:130
The H3DNodeDatabase contains a mapping between a name of a Node and the constructor for the Node with...
Definition: H3DNodeDatabase.h:194