8 #ifndef META_OCEAN_RENDERING_GLES_ATTRIBUTE_SET_H
9 #define META_OCEAN_RENDERING_GLES_ATTRIBUTE_SET_H
30 namespace GLESceneGraph
49 #if defined(OCEAN_GCC_VERSION) && OCEAN_GCC_VERSION > 0 && OCEAN_GCC_VERSION < 50000
98 inline bool containsAttribute(
const ObjectType attributeType)
const;
103 inline void resetShaderProgram();
135 bool shaderProgramTypeChanged_ =
true;
141 bool shaderProgramTypeIsBasedOnLight_ =
false;
This class is the base class for all attribute set objects.
Definition: AttributeSet.h:43
This class wraps a GLESceneGraph attribute object.
Definition: GLESAttribute.h:36
ProgramType
Definition of different shader functionalities.
Definition: GLESAttribute.h:43
@ PT_UNKNOWN
Not specified shader program.
Definition: GLESAttribute.h:45
This class implements a GLESceneGraph attribute set object.
Definition: GLESAttributeSet.h:40
~GLESAttributeSet() override
Destructs a GLESceneGraph attribute set object.
std::unordered_map< int, unsigned int > AttributeCounterMap
Definition of an unordered map mapping attribute types to counters.
Definition: GLESAttributeSet.h:50
AttributeCounterMap attributeCounterMap_
The map counting the number of attributes;.
Definition: GLESAttributeSet.h:138
std::unordered_map< ObjectType, unsigned int > AttributeCounterMap
Definition: GLESAttributeSet.h:52
GLESShaderProgramRef shaderProgram() const
Returns the shader of this attribute set.
Definition: GLESAttributeSet.h:144
GLESShaderProgramRef shaderProgram_
Shader program specific for this attribute set.
Definition: GLESAttributeSet.h:129
void resetShaderProgram()
Resets the shader program e.g., because child element has changed after the shader has been selected.
Definition: GLESAttributeSet.h:158
void addAttribute(const AttributeRef &attribute) override
Adds a new attribute to this attribute set.
bool containsAttribute(const ObjectType attributeType) const
Returns whether this attribute set contains at least one attribute of a specific type.
Definition: GLESAttributeSet.h:151
bool shaderProgramTypeChanged_
True, if the shader has been changed since the last usage.
Definition: GLESAttributeSet.h:135
GLESAttributeSet()
Creates a new GLESceneGraph attribute set object.
GLESAttribute::ProgramType determineShaderType(const Lights &lights, const GLESAttribute::ProgramType additionalProgramTypes=GLESAttribute::PT_UNKNOWN, const GLESAttribute *additionalAttribute=nullptr) const
Determines which shader program to use for this entire attribute set.
void unbindAttributes()
Unbinds all attributes of this set.
void removeAttribute(const AttributeRef &attribute) override
Removes a registered attribute from this attribute ses.
void bindAttributes(const GLESFramebuffer &framebuffer, const SquareMatrix4 &projection, const HomogenousMatrix4 &camera_T_model, const HomogenousMatrix4 &camera_T_world, const SquareMatrix3 &normalMatrix, const Lights &lights, const GLESAttribute::ProgramType additionalProgramTypes=GLESAttribute::PT_UNKNOWN, GLESAttribute *const additionalAttribute=nullptr)
Binds the attributes of this set to the internal OpenGL ES shader program as uniforms.
This class implements a class factory for all GLESceneGraph objects.
Definition: GLESFactory.h:30
This class implements a base for all GLESceneGraph framebuffers.
Definition: rendering/glescenegraph/GLESFramebuffer.h:34
This class is the base class for all GLESceneGraph objects.
Definition: GLESObject.h:57
Definition: GLESPhantomAttribute.h:30
Lock objectLock
Lock for the object.
Definition: Object.h:305
ObjectType
Definition of different object type.
Definition: Object.h:63
This class implements a smart rendering object reference.
Definition: rendering/ObjectRef.h:34
This class implements a scoped lock object for recursive lock objects.
Definition: Lock.h:135
std::vector< LightPair > Lights
Definition of a set holding light sources.
Definition: GLESLightSource.h:44
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15