ShaderDataGenerator Class Reference

The underlying data of a shader is generated. More...

#include <ShaderDataGenerator.h>

Inherits IShaderData.

Public Types

typedef std::unordered_map< std::string, std::string > TextureMap
 
typedef std::unordered_map< std::string, std::string > CubeRelflectionMap
 
typedef std::unordered_map< std::string, vmml::Vector3f > Vector3Map
 
typedef std::unordered_map< std::string, GLfloat > ScalarMap
 

Public Member Functions

 ShaderDataGenerator ()
 Constructor. More...
 
 ShaderDataGenerator (GLuint maxLights, bool ambientLighting, const MaterialData &materialData, bool variableNumberOfLights, bool isText)
 Constructor. More...
 
 ShaderDataGenerator (const ShaderGeneratorSettings &shaderGeneratorSettings)
 Constructor. More...
 
virtual ~ShaderDataGenerator ()
 Virtual destructor. More...
 
ShaderDataGeneratorcreate (const ShaderGeneratorSettings &shaderGeneratorSettings)
 Constructor. More...
 
std::string getVertShaderSrc () const
 Gets the source code of the vertex shader as a string. More...
 
std::string getFragShaderSrc () const
 Gets the source code of the fragment shader as a string. More...
 
GLuint getMaxLights () const
 Get the maximum number of lights. More...
 
bool supportsVariableNumberOfLights () const
 Returns true if the number of lights is variable in the shader. More...
 
bool supportsAmbientLighting () const
 Returns true if the shader supports ambient lighting. More...
 
bool supportsDiffuseLighting () const
 Returns true if the shader supports diffuse lighting. More...
 
bool supportsSpecularLighting () const
 Returns true if the shader supports specular lighting. More...
 
bool supportsCubicReflectionMap () const
 Returns true if the shader supports a cubic reflection map. More...
 
bool isValid () const
 Returns true if the shader is valid. More...
 
- Public Member Functions inherited from IShaderData
virtual ~IShaderData ()
 Virtual destructor. More...
 

Detailed Description

The underlying data of a shader is generated.

Author
Benjamin Buergisser

Member Typedef Documentation

typedef std::unordered_map<std::string, std::string> ShaderDataGenerator::CubeRelflectionMap
typedef std::unordered_map<std::string, GLfloat> ShaderDataGenerator::ScalarMap
typedef std::unordered_map<std::string, std::string> ShaderDataGenerator::TextureMap
typedef std::unordered_map<std::string, vmml::Vector3f> ShaderDataGenerator::Vector3Map

Constructor & Destructor Documentation

ShaderDataGenerator::ShaderDataGenerator ( )

Constructor.

ShaderDataGenerator::ShaderDataGenerator ( GLuint  maxLights,
bool  ambientLighting,
const MaterialData materialData,
bool  variableNumberOfLights,
bool  isText 
)

Constructor.

Parameters
[in]maxLightsThe maximum number of light sources to be used
[in]ambientLightingSet true if the shader should support ambient lighting
[in]materialDataAll necessary information for the shader is read from the material data
[in]variableNumberOfLightsSet true if the number of lights may vary, otherwise the number of lights has to be the same as specified as maximum number of lights
[in]isTextSet true if the shader should be used for displaying text
ShaderDataGenerator::ShaderDataGenerator ( const ShaderGeneratorSettings shaderGeneratorSettings)

Constructor.

Parameters
[in]shaderGeneratorSettingsThe settings defining the abilities the generated shader should have
virtual ShaderDataGenerator::~ShaderDataGenerator ( )
inlinevirtual

Virtual destructor.

Member Function Documentation

ShaderDataGenerator & ShaderDataGenerator::create ( const ShaderGeneratorSettings shaderGeneratorSettings)

Constructor.

Parameters
[in]shaderGeneratorSettingsThe settings defining the abilities the generated shader should have
std::string ShaderDataGenerator::getFragShaderSrc ( ) const
inlinevirtual

Gets the source code of the fragment shader as a string.

Implements IShaderData.

GLuint ShaderDataGenerator::getMaxLights ( ) const
inlinevirtual

Get the maximum number of lights.

Implements IShaderData.

std::string ShaderDataGenerator::getVertShaderSrc ( ) const
inlinevirtual

Gets the source code of the vertex shader as a string.

Implements IShaderData.

bool ShaderDataGenerator::isValid ( ) const
inlinevirtual

Returns true if the shader is valid.

Implements IShaderData.

bool ShaderDataGenerator::supportsAmbientLighting ( ) const
inlinevirtual

Returns true if the shader supports ambient lighting.

Implements IShaderData.

bool ShaderDataGenerator::supportsCubicReflectionMap ( ) const
inlinevirtual

Returns true if the shader supports a cubic reflection map.

Implements IShaderData.

bool ShaderDataGenerator::supportsDiffuseLighting ( ) const
inlinevirtual

Returns true if the shader supports diffuse lighting.

Implements IShaderData.

bool ShaderDataGenerator::supportsSpecularLighting ( ) const
inlinevirtual

Returns true if the shader supports specular lighting.

Implements IShaderData.

bool ShaderDataGenerator::supportsVariableNumberOfLights ( ) const
inlinevirtual

Returns true if the number of lights is variable in the shader.

Implements IShaderData.