8 #ifndef META_OCEAN_RENDERING_SHADER_PROGRAM_H
9 #define META_OCEAN_RENDERING_SHADER_PROGRAM_H
174 virtual bool setShader(
const ShaderLanguage shaderLanguage,
const std::string& vertexShaderCode,
const std::string& fragmentShaderCode, std::string& errorMessage);
184 virtual bool setShader(
const ShaderLanguage shaderLanguage,
const std::vector<const char*>& vertexShaderCode,
const std::vector<const char*>& fragmentShaderCode, std::string& errorMessage);
243 virtual bool setParameter(
const std::string& name,
const double value);
260 virtual bool setParameter(
const std::string& name,
const float* value,
const unsigned int elements);
276 virtual bool setParameter(
const std::string& name,
const unsigned int value);
This class is the base class for all rendering attribute objects.
Definition: Attribute.h:39
ObjectType
Definition of different object type.
Definition: Object.h:63
This class implements a shader program attribute.
Definition: rendering/ShaderProgram.h:44
virtual bool setParameter(const std::string &name, const double value)
Sets a parameter by a given parameter name.
unsigned int SamplerIndex
Definition of a sampler index.
Definition: rendering/ShaderProgram.h:141
virtual unsigned int parameterElements(const std::string &name) const
Returns the number of elements of a specific parameter.
virtual bool setParameter(const std::string &name, const HomogenousMatrix4 &value)
Sets a parameter by a given parameter name.
virtual unsigned int samplerNumber() const
Returns the number of sampler parameters.
virtual bool setParameter(const std::string &name, const int value)
Sets a parameter by a given parameter name.
virtual bool setParameter(const std::string &name, const Vector2 &value)
Sets a parameter by a given parameter name.
virtual bool setShader(const ShaderLanguage shaderLanguage, const FilenamePairs &filenamePairs, std::string &errorMessage)
Sets the shader code.
ShaderLanguage
Definition of individual shader languages.
Definition: rendering/ShaderProgram.h:51
@ SL_GLSL
The GLSL shader language (e.g., used by OpenGL and OpenGL ES).
Definition: rendering/ShaderProgram.h:55
virtual bool setShader(const ShaderLanguage shaderLanguage, const std::vector< const char * > &vertexShaderCode, const std::vector< const char * > &fragmentShaderCode, std::string &errorMessage)
Sets the shader code.
virtual bool setParameter(const std::string &name, const SquareMatrix3 &value)
Sets a parameter by a given parameter name.
virtual ParameterType parameterType(const std::string &name) const
Returns the type of a specific parameter.
virtual bool setParameter(const std::string &name, const float value)
Sets a parameter by a given parameter name.
virtual bool setShader(const ShaderLanguage shaderLanguage, const std::string &vertexShaderCode, const std::string &fragmentShaderCode, std::string &errorMessage)
Sets the shader code.
ParameterType
Definition of a parameter types.
Definition: rendering/ShaderProgram.h:107
@ TYPE_MATRIX3
3x3 matrix parameter.
Definition: rendering/ShaderProgram.h:119
@ TYPE_SAMPLE1
1D sample parameter.
Definition: rendering/ShaderProgram.h:123
@ TYPE_VECTOR2
2D vector parameter.
Definition: rendering/ShaderProgram.h:131
@ TYPE_UNSUPPORTED
Unsupported parameter.
Definition: rendering/ShaderProgram.h:111
@ TYPE_SAMPLE2
2D sample parameter.
Definition: rendering/ShaderProgram.h:125
@ TYPE_SAMPLE3
3D sample parameter.
Definition: rendering/ShaderProgram.h:127
@ TYPE_VECTOR3
3D vector parameter.
Definition: rendering/ShaderProgram.h:133
@ TYPE_FLOAT
Float parameter.
Definition: rendering/ShaderProgram.h:115
@ TYPE_STRUCT
Struct parameter.
Definition: rendering/ShaderProgram.h:129
@ TYPE_MATRIX4
4x4 matrix parameter.
Definition: rendering/ShaderProgram.h:121
@ TYPE_BOOL
Boolean parameter.
Definition: rendering/ShaderProgram.h:113
@ TYPE_INTEGER
Integer parameter.
Definition: rendering/ShaderProgram.h:117
Textures shaderProgramTextures
Vector holding all registered texture samples.
Definition: rendering/ShaderProgram.h:369
std::vector< FilenamePair > FilenamePairs
Definition of a vector holding pairs combining filenames with shader types.
Definition: rendering/ShaderProgram.h:91
virtual bool setParameter(const std::string &name, const HomogenousMatrices4 &value)
Sets a parameter by a given parameter name.
virtual bool isCompiled() const
Returns whether this program holds a valid and successfully compiled and linked shader code.
std::pair< std::string, ShaderType > FilenamePair
Definition of a pair combining a filename with a shader type with.
Definition: rendering/ShaderProgram.h:86
virtual bool existParameter(const std::string &name) const
Returns whether this shader program has a specific parameter.
ShaderType
Definition of individual shader types.
Definition: rendering/ShaderProgram.h:64
@ ST_GEOMETRY
A geometry shader.
Definition: rendering/ShaderProgram.h:72
@ ST_TESSELLATION_EVALUATION
A Tessellation evaluation shader.
Definition: rendering/ShaderProgram.h:76
@ ST_VERTEX
A vertex shader.
Definition: rendering/ShaderProgram.h:78
@ ST_TESSELLATION_CONTROL
A Tessellation control shader.
Definition: rendering/ShaderProgram.h:74
@ ST_FRAGMENT
A fragment shader.
Definition: rendering/ShaderProgram.h:70
@ ST_COMPUTE
A compute shader.
Definition: rendering/ShaderProgram.h:68
ObjectType type() const override
Returns the type of this object.
virtual bool setSampler(const SamplerIndex index, const TextureRef &texture)
Sets the texture of a specified sampler.
std::vector< TextureRef > Textures
Definition of a vector holding sample objects.
Definition: rendering/ShaderProgram.h:153
std::pair< std::vector< const char * >, ShaderType > CodePair
Definition of a pair combining shader code parts with a shader type with.
Definition: rendering/ShaderProgram.h:96
virtual bool setParameter(const std::string &name, const float *value, const unsigned int elements)
Sets a parameter by a given parameter name.
~ShaderProgram() override
Destructs a shader program object.
virtual bool setParameter(const std::string &name, const unsigned int value)
Sets a parameter by a given parameter name.
virtual bool setParameter(const std::string &name, const SquareMatrices3 &value)
Sets a parameter by a given parameter name.
virtual bool setParameter(const std::string &name, const Vector3 &value)
Sets a parameter by a given parameter name.
ShaderProgram()
Creates a new shader program object.
std::vector< CodePair > CodePairs
Definition of a vector holding pairs combining shader codes with shader types.
Definition: rendering/ShaderProgram.h:101
virtual bool setParameter(const std::string &name, const SquareMatrix4 &value)
Sets a parameter by a given parameter name.
virtual SamplerIndex samplerIndex(const TextureRef &sampler) const
Returns the index of a registered texture sample object.
virtual bool setParameter(const std::string &name, const Vector4 &value)
Sets a parameter by a given parameter name.
virtual bool setShader(const ShaderLanguage shaderLanguage, const CodePairs &codePairs, std::string &errorMessage)
Sets the shader code.
This class implements a smart rendering object reference.
Definition: rendering/ObjectRef.h:34
This class implements a vector with four elements.
Definition: Vector4.h:97
std::vector< HomogenousMatrix4 > HomogenousMatrices4
Definition of a vector holding HomogenousMatrix4 objects.
Definition: HomogenousMatrix4.h:73
std::vector< SquareMatrix3 > SquareMatrices3
Definition of a vector holding SquareMatrix3 objects.
Definition: SquareMatrix3.h:71
SmartObjectRef< ShaderProgram > ShaderProgramRef
Definition of a smart object reference holding a shader program object.
Definition: rendering/ShaderProgram.h:30
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15