29 #ifndef __SHADERPART_H__
30 #define __SHADERPART_H__
83 Types<MFString,SFBool>, AnyNumber< Field > > {
85 virtual void update();
90 virtual bool doFullRebuild();
96 bool modifyShaderConstants(
Field* field);
101 Inst< MFString > _url = 0,
102 Inst< SFString > _type = 0,
103 Inst< SFShaderString > _shaderString = 0,
104 Inst< SFBool > _forceReload = 0);
109 virtual GLhandleARB compileShader();
116 return parent_composed_shader;
122 bool modifyShaderConstants(
Field* field);
129 bool replaceString(
string &string_to_update,
130 const std::string& string_start,
131 const std::string& string_end,
132 const std::string& to_insert,
133 const std::string& conditional_string =
"");
138 return shader_handle;
143 virtual bool isCompiled ();
194 GLhandleARB compileShaderPart();
197 bool getConstantVariableString(
Field*
const in_variable,
198 std::string& out_name, std::string& out_type, std::string& out_field_value);
201 std::string shaderStringFromURL (
const std::string& shader_url );
212 std::string preProcess (
const std::string& input,
const std::string& _url,
int depth= 0 );
219 void updateShaderConstantValues( std::string &input,
bool update_all_values );
222 void updateSinglePassStereoValues( std::string &input );
224 bool printShaderLog();
227 virtual void initialize();
Header file for DebugOptions.
Contains the SFBool field class.
Contains the SFInt32 field class.
Contains the SFString field class.
Header file for X3DNode, X3D scene-graph node.
Header file for X3DUrlObject, X3D scene-graph node.
The ComposedShader node defines a shader where the individual source files are not individually progr...
Definition: ComposedShader.h:77
Specifies parameters for if displaying debug information like bounding boxes, haptically rendered tri...
Definition: DebugOptions.h:46
The Field class.
Definition: Field.h:46
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< SFBool > forceReload
The forceReload field is used to force the reloading of this shaderPart and also cause the composed s...
Definition: ShaderPart.h:172
H3DUniquePtr< SFString > type
The type field indicates whether this object shall be compiled as a vertex shader,...
Definition: ShaderPart.h:152
ComposedShader * getParentComposedShader()
Get the ComposedShader instance that this ShaderPart is a child to.
Definition: ShaderPart.h:115
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
virtual string defaultXMLContainerField()
Returns the default xml containerField attribute value.
Definition: ShaderPart.h:176
GLhandleARB getShaderHandle()
Get the handle to the shader object that currently is used for this ShaderPart.
Definition: ShaderPart.h:137
static H3DNodeDatabase database
The H3DNodeDatabase for this node.
Definition: ShaderPart.h:186
GLhandleARB shader_handle
The handle to the shader object used for this ShaderPart.
Definition: ShaderPart.h:193
ComposedShader * parent_composed_shader
The ComposedShader instance that this ShaderPart is a child to.
Definition: ShaderPart.h:190
A template modifier class for adding type checking on the routes to any Field class.
Definition: TypedField.h:84
This abstract node type is the base type for all nodes in the X3D system.
Definition: X3DNode.h:65
This abstract interface is inherited by all nodes that contain data located on the World Wide Web,...
Definition: X3DUrlObject.h:51
LoadStatus
The load status of the given url.
Definition: X3DUrlObject.h:60
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