H3D API  2.4.1
ComposedGeneratedShader.h
Go to the documentation of this file.
1 // Copyright 2004-2019, SenseGraphics AB
3 //
4 // This file is part of H3D API.
5 //
6 // H3D API is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 2 of the License, or
9 // (at your option) any later version.
10 //
11 // H3D API is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with H3D API; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 //
20 // A commercial license is also available. Please contact us at
21 // www.sensegraphics.com for more information.
22 //
23 //
27 //
29 #ifndef __COMPOSEDGENERATEDSHADER_H__
30 #define __COMPOSEDGENERATEDSHADER_H__
31 
34 
35 namespace H3D {
36 
60  class H3DAPI_API ComposedGeneratedShader :
61  public H3DGeneratedShaderNode {
62  public:
63 
68  true >
70 
75  true >
77 
79  ComposedGeneratedShader( Inst< DisplayList > _displayList = 0,
80  Inst< SFNode > _metadata = 0,
81  Inst< SFBool > _isSelected = 0,
82  Inst< SFBool > _isValid = 0,
83  Inst< SFBool > _activate = 0,
84  Inst< SFString > _language = 0,
85  Inst< MFShaderPart > _parts = 0,
86  Inst< SFBool > _suppressUniformWarnings = 0,
87  Inst< MFString > _fragmentShaderString = 0,
88  Inst< MFString > _vertexShaderString = 0,
89  Inst< MFGeneratedFragmentShaderNode > _fragmentShaders = 0,
90  Inst< MFGeneratedVertexShaderNode > _vertexShaders = 0 );
91 
93  virtual void traverseSG( TraverseInfo &ti );
94 
104  H3DUniquePtr< MFGeneratedFragmentShaderNode > fragmentShaders;
105 
114  H3DUniquePtr< MFGeneratedVertexShaderNode > vertexShaders;
115 
118  protected:
123  virtual string addUniformFields( ComposedShader * );
124 
127  virtual string getFunctionShaderString();
128 
130  virtual void getVaryingVariables( vector< VaryingVariable > &variables );
131 
133  virtual void getAttributes( vector< Attribute > &attributes );
134 
136  virtual string getVertexShaderString();
137 
139  virtual string getFragmentShaderString();
140  };
141 }
142 
143 #endif
Header file for H3DGeneratedFragmentShaderNode.
Header file for H3DGeneratedVertexShaderNode.
The ComposedGeneratedShader node composes vertex shader manipulator shaders with fragment shaders.
Definition: ComposedGeneratedShader.h:61
H3DUniquePtr< MFGeneratedVertexShaderNode > vertexShaders
The vertexShaders field specifies a number of H3DGeneratedVertexShaderNode instances that modify the ...
Definition: ComposedGeneratedShader.h:114
H3DUniquePtr< MFGeneratedFragmentShaderNode > fragmentShaders
The fragmentShaders field specifies a number of H3DGeneratedFragmentShaderNode instances that build u...
Definition: ComposedGeneratedShader.h:104
static H3DNodeDatabase database
The H3DNodeDatabase for this node.
Definition: ComposedGeneratedShader.h:117
The ComposedShader node defines a shader where the individual source files are not individually progr...
Definition: ComposedShader.h:77
DependentMFNode are modified TypedMFNode fields where the field dirty status is dependent on fields i...
Definition: DependentNodeFields.h:336
Class used for specifying a field member of a node in a DependentSFNode or DependentMFNode specificat...
Definition: DependentNodeFields.h:48
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
The H3DGeneratedFragmentShaderNode node is the base class for shader generator nodes that specify a f...
Definition: H3DGeneratedFragmentShaderNode.h:44
The H3DGeneratedShaderNode node is the base class for nodes that generates GLSL shaders for use in pl...
Definition: H3DGeneratedShaderNode.h:113
The H3DGeneratedVertexShaderNode node is the base class for shader generator nodes that only modify t...
Definition: H3DGeneratedVertexShaderNode.h:44
TraverseInfo is a structure that is passed along when traversing the scene graph.
Definition: TraverseInfo.h:57
H3D API namespace.
Definition: Anchor.h:38
The H3DNodeDatabase contains a mapping between a name of a Node and the constructor for the Node with...
Definition: H3DNodeDatabase.h:194