1 #ifndef B_SHADER_DATA_GENERATOR_H
2 #define B_SHADER_DATA_GENERATOR_H
33 typedef std::unordered_map<std::string, std::string>
TextureMap;
35 typedef std::unordered_map<std::string, vmml::Vector3f>
Vector3Map;
36 typedef std::unordered_map<std::string, GLfloat>
ScalarMap;
108 void initializeSourceCommonVariables();
109 void createVertShader();
110 void createFragShader();
111 void readMaterialAttributes(GLuint maxLights,
bool variableNumberOfLights,
bool ambientLighting,
bool isText,
const TextureMap &t,
const Vector3Map &v,
const ScalarMap &s);
115 std::string _vertShaderSrc;
116 std::string _fragShaderSrc;
120 bool _variableNumberOfLights;
121 bool _ambientLighting;
122 bool _diffuseLighting;
123 bool _specularLighting;
130 bool _cubicReflectionMap;
131 bool _transparencyValue;
std::unordered_map< std::string, vmml::Vector3f > Vector3Map
Definition: ShaderDataGenerator.h:35
virtual ~ShaderDataGenerator()
Virtual destructor.
Definition: ShaderDataGenerator.h:60
bool ambientLighting
Definition: ShaderDataGenerator.h:11
bool supportsVariableNumberOfLights() const
Returns true if the number of lights is variable in the shader.
Definition: ShaderDataGenerator.h:81
std::unordered_map< std::string, std::string > CubeRelflectionMap
Definition: ShaderDataGenerator.h:34
bool isValid() const
Returns true if the shader is valid.
Definition: ShaderDataGenerator.h:101
bool normalMap
Definition: ShaderDataGenerator.h:18
bool isText
Definition: ShaderDataGenerator.h:22
bool transparencyValue
Definition: ShaderDataGenerator.h:20
std::unordered_map< std::string, std::string > TextureMap
Definition: ShaderDataGenerator.h:33
bool ambientColor
Definition: ShaderDataGenerator.h:14
std::string getVertShaderSrc() const
Gets the source code of the vertex shader as a string.
Definition: ShaderDataGenerator.h:69
bool diffuseMap
Definition: ShaderDataGenerator.h:17
An interface for the underlying data of a shader.
Definition: IShaderData.h:10
bool supportsAmbientLighting() const
Returns true if the shader supports ambient lighting.
Definition: ShaderDataGenerator.h:85
bool specularMap
Definition: ShaderDataGenerator.h:19
The underlying data of a shader is generated.
Definition: ShaderDataGenerator.h:28
bool diffuseLighting
Definition: ShaderDataGenerator.h:12
bool supportsDiffuseLighting() const
Returns true if the shader supports diffuse lighting.
Definition: ShaderDataGenerator.h:89
bool supportsSpecularLighting() const
Returns true if the shader supports specular lighting.
Definition: ShaderDataGenerator.h:93
ShaderDataGenerator()
Constructor.
Definition: ShaderDataGenerator.cpp:9
std::unordered_map< std::string, GLfloat > ScalarMap
Definition: ShaderDataGenerator.h:36
ShaderDataGenerator & create(const ShaderGeneratorSettings &shaderGeneratorSettings)
Constructor.
Definition: ShaderDataGenerator.cpp:27
bool variableNumberOfLights
Definition: ShaderDataGenerator.h:21
bool specularColor
Definition: ShaderDataGenerator.h:16
The underlying data of a material.
Definition: MaterialData.h:10
GLuint maxLights
Definition: ShaderDataGenerator.h:10
bool diffuseColor
Definition: ShaderDataGenerator.h:15
GLuint getMaxLights() const
Get the maximum number of lights.
Definition: ShaderDataGenerator.h:77
bool supportsCubicReflectionMap() const
Returns true if the shader supports a cubic reflection map.
Definition: ShaderDataGenerator.h:97
bool specularLighting
Definition: ShaderDataGenerator.h:13
std::string getFragShaderSrc() const
Gets the source code of the fragment shader as a string.
Definition: ShaderDataGenerator.h:73
Definition: ShaderDataGenerator.h:8