29 #ifndef __PHONGSHADER_H__
30 #define __PHONGSHADER_H__
176 Inst< SFNode > _metadata = 0,
177 Inst< SFBool > _isSelected = 0,
178 Inst< SFBool > _isValid = 0,
179 Inst< SFBool > _activate = 0,
180 Inst< SFString > _language = 0,
181 Inst< MFShaderPart > _parts = 0,
182 Inst< SFBool > _suppressUniformWarnings = 0,
183 Inst< MFString > _fragmentShaderString = 0,
184 Inst< MFString > _vertexShaderString = 0,
185 Inst< SFTexture2DNode > _ambientMap = 0,
186 Inst< SFTexture2DNode > _diffuseMap = 0,
187 Inst< SFTexture2DNode > _emissionMap = 0,
188 Inst< SFTexture2DNode > _normalMap = 0,
189 Inst< SFString > _normalMapCoordSpace = 0,
190 Inst< SFMatrix4f > _normalMapMatrix = 0,
191 Inst< SFTexture2DNode > _specularMap = 0,
192 Inst< SFTexture2DNode > _glossMap = 0,
193 Inst< SFTexture2DNode > _specularColorRamp = 0,
194 Inst< SFString > _specularColorRampMode = 0,
195 Inst< SFTexture2DNode > _diffuseColorRamp = 0,
196 Inst< SFString > _diffuseColorRampMode = 0,
197 Inst< SFFloat > _fresnel = 0,
198 Inst< SFBool > _modulateMaps = 0,
199 Inst< SFTexture2DNode > _backAmbientMap = 0,
200 Inst< SFTexture2DNode > _backDiffuseMap = 0,
201 Inst< SFTexture2DNode > _backEmissionMap = 0,
202 Inst< SFTexture2DNode > _backNormalMap = 0,
203 Inst< SFString > _backNormalMapCoordSpace = 0,
204 Inst< SFMatrix4f > _backNormalMapMatrix = 0,
205 Inst< SFTexture2DNode > _backSpecularMap = 0,
206 Inst< SFTexture2DNode > _backGlossMap = 0,
207 Inst< SFTexture2DNode > _backSpecularColorRamp = 0,
208 Inst< SFString > _backSpecularColorRampMode = 0,
209 Inst< SFTexture2DNode > _backDiffuseColorRamp = 0,
210 Inst< SFString > _backDiffuseColorRampMode = 0,
211 Inst< SFFloat > _backFresnel = 0,
212 Inst< SFBool > _backModulateMaps = 0,
213 Inst< SFBool > _separateBackColor = 0,
214 Inst< SFString > _model = 0 );
674 string uniqueLightFieldName(
const string &field_name,
696 virtual string getFunctionShaderString();
699 virtual void getVaryingVariables( vector< VaryingVariable > &variables );
702 virtual void getAttributes( vector< Attribute > &attributes );
705 virtual string getFragmentShaderString();
710 virtual string getBaseDiffuseColor(
const string &diffuse_color,
711 const string &back_diffuse_color );
716 virtual string getBaseEmissionColor(
const string &emission_color,
717 const string &back_emission_color );
722 virtual string getBaseAmbientColor(
const string &ambient_color,
723 const string &back_ambient_color );
728 virtual string getBaseSpecularColor(
const string &specular_color,
729 const string &back_specular_color );
734 virtual string getBaseShininess(
const string &shininess,
735 const string &back_shininess );
740 virtual string getBaseNormal(
const string &normal,
741 const string &back_normal );
746 virtual string getBaseColors(
const string &emission_color,
747 const string &shininess,
748 const string &ambient_color,
749 const string &diffuse_color,
750 const string &specular_color,
751 const string &normal,
752 const string &back_emission_color,
753 const string &back_shininess,
754 const string &back_ambient_color,
755 const string &back_diffuse_color,
756 const string &back_specular_color,
757 const string &back_normal );
770 virtual string getLightContribution(
X3DLightNode *light,
775 string ambient_color,
776 string diffuse_color,
777 string specular_color );
786 unsigned int gl_index );
Header file for H3DGeneratedFragmentShaderNode.
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
DependentSFNode are modified TypedSFNode fields where the field dirty status is dependent on fields i...
Definition: DependentNodeFields.h:294
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 PhongShader node defines a shader for using the Phong illumination model.
Definition: PhongShader.h:162
H3DUniquePtr< SFTexture2DNode > ambientMap
Defines the Ma part in the Phong illumination model specified above.
Definition: PhongShader.h:235
H3DUniquePtr< SFMatrix4f > normalMapMatrix
Defines the transformation from RGB values of the normalMap(in range [0,1]) to the actual normals in ...
Definition: PhongShader.h:290
unsigned int current_nr_lightsources
The number of light sources the shader currently handles(including headlight)
Definition: PhongShader.h:671
H3DUniquePtr< SFString > backSpecularColorRampMode
The backSpecularColorRampMode defines what value should be used to lookup up into the backSpecularCol...
Definition: PhongShader.h:607
AutoPtrVector< SFMatrix4f > current_light_node_transforms
The transform matrices for all lights with index > maximum number lightsources supported by OpenGL fi...
Definition: PhongShader.h:668
H3DUniquePtr< SFString > backNormalMapCoordSpace
The normalMapCoordSpace field defines which coordinate space the normals in the normalMap are specifi...
Definition: PhongShader.h:517
H3DUniquePtr< SFString > specularColorRampMode
The specularColorRampMode defines what value should be used to lookup up into the specularColorRamp t...
Definition: PhongShader.h:395
H3DUniquePtr< SFBool > backModulateMaps
The modulateMaps field determines if the map values should be modulated with the corresponding Materi...
Definition: PhongShader.h:628
H3DUniquePtr< SFTexture2DNode > backGlossMap
Defines the Mshininess part in the Phong illumination model specified above for back facing polygons.
Definition: PhongShader.h:549
H3DUniquePtr< SFFloat > backFresnel
The backFresnel field specifies the fresnel value for back facing polygons when separateBackColor is ...
Definition: PhongShader.h:617
H3DUniquePtr< SFTexture2DNode > backDiffuseMap
Defines the Md part in the Phong illumination model specified above for back facing polygons.
Definition: PhongShader.h:456
H3DUniquePtr< SFTexture2DNode > normalMap
Defines the normal(N) in the Phong illumination model specified above.
Definition: PhongShader.h:278
H3DUniquePtr< SFTexture2DNode > backSpecularColorRamp
The specularColorRamp can be used to control the specular color gradient across a material for back f...
Definition: PhongShader.h:593
H3DUniquePtr< SFString > backDiffuseColorRampMode
The backDiffuseColorRampMode defines what value should be used to lookup up into the backDiffuseColor...
Definition: PhongShader.h:578
H3DUniquePtr< SFTexture2DNode > backSpecularMap
Defines the Ms part in the Phong illumination model specified above for back facing polygons.
Definition: PhongShader.h:533
H3DUniquePtr< SFMatrix4f > backNormalMapMatrix
Defines the transformation from RGB values of the normalMap(in range [0,1]) to the actual normals in ...
Definition: PhongShader.h:499
H3DUniquePtr< SFFloat > fresnel
The fresnel field specifies if the fresnel effect should be used in the lighting model and if so how ...
Definition: PhongShader.h:414
H3DUniquePtr< SFTexture2DNode > backDiffuseColorRamp
The diffuseColorRamp can be used to control the diffuse color gradient across a material for back fac...
Definition: PhongShader.h:564
H3DUniquePtr< SFString > diffuseColorRampMode
The diffuseColorRampMode defines what value should be used to lookup up into the diffuseColorRamp tex...
Definition: PhongShader.h:366
H3DUniquePtr< SFTexture2DNode > backAmbientMap
Defines the Ma part in the Phong illumination model specified above for back facing polygons.
Definition: PhongShader.h:440
H3DUniquePtr< SFTexture2DNode > specularColorRamp
The specularColorRamp can be used to control the specular color gradient across a material.
Definition: PhongShader.h:380
H3DUniquePtr< SFString > normalMapCoordSpace
The normalMapCoordSpace field defines which coordinate space the normals in the normalMap are specifi...
Definition: PhongShader.h:307
H3DUniquePtr< SFTexture2DNode > backEmissionMap
Defines the Me part in the Phong illumination model specified above for back facing polygons.
Definition: PhongShader.h:471
DependentSFNode< X3DTexture2DNode, FieldRef< H3DDisplayListObject, H3DDisplayListObject::DisplayList, &H3DDisplayListObject::displayList >, true > SFTexture2DNode
The SFTexture2DNode field is dependent on the displayList field of the containing X3DTexture2DNode no...
Definition: PhongShader.h:172
H3DUniquePtr< SFString > model
The shading model to use.
Definition: PhongShader.h:653
H3DUniquePtr< SFTexture2DNode > glossMap
Defines the Mshininess part in the Phong illumination model specified above.
Definition: PhongShader.h:337
H3DUniquePtr< SFTexture2DNode > specularMap
Defines the Ms part in the Phong illumination model specified above.
Definition: PhongShader.h:322
TraverseInfo::LightVector current_light_nodes
The X3DLightNode instances that this shader is built for.
Definition: PhongShader.h:662
H3DUniquePtr< SFTexture2DNode > diffuseMap
Defines the Md part in the Phong illumination model specified above.
Definition: PhongShader.h:250
H3DUniquePtr< SFTexture2DNode > emissionMap
Defines the Me part in the Phong illumination model specified above.
Definition: PhongShader.h:264
H3DUniquePtr< SFBool > modulateMaps
The modulateMaps field determines if the map values should be modulated with the corresponding Materi...
Definition: PhongShader.h:424
H3DUniquePtr< SFTexture2DNode > backNormalMap
Defines the normal(N) in the Phong illumination model specified above for back facing polygons.
Definition: PhongShader.h:486
H3DUniquePtr< SFBool > separateBackColor
If the separateBackColor field is set to TRUE, then the rendering shall render the front and back fac...
Definition: PhongShader.h:640
static H3DNodeDatabase database
The H3DNodeDatabase for this node.
Definition: PhongShader.h:656
H3DUniquePtr< SFTexture2DNode > diffuseColorRamp
The diffuseColorRamp can be used to control the diffuse color gradient across a material.
Definition: PhongShader.h:352
TraverseInfo is a structure that is passed along when traversing the scene graph.
Definition: TraverseInfo.h:57
vector< LightInfo > LightVector
Used to get all the X3DLightNodes that are global.
Definition: TraverseInfo.h:441
The X3DLightNode abstract node type is the base type from which all node types that serve as light so...
Definition: X3DLightNode.h:70
This abstract node type is the base type for all node types which specify 2D sources for texture imag...
Definition: X3DTexture2DNode.h:46
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