31 #define SHADER_MATERIAL_VARIABLE_OWNED (0x00000001) 38 for (
uint32 i = 0; i < varCount; ++i) {
108 if (textureUnitRecalc) {
122 if (textureUnitRecalc) {
130 if (textureUnitRecalc) {
143 if (textureUnitRecalc) {
175 for (
uint32 j = 1; j < 0x80000000; j<<=1, ++textureUnit)
238 glBlendFunc(GL_ZERO, GL_ONE_MINUS_SRC_COLOR);
244 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
250 glEnable(GL_CULL_FACE);
251 glEnable(GL_DEPTH_TEST);
252 glDepthMask(GL_TRUE);
264 case SHADER_VEC2: rval =
new float[2 * count];
break;
265 case SHADER_VEC3: rval =
new float[3 * count];
break;
266 case SHADER_VEC4: rval =
new float[4 * count];
break;
267 case SHADER_INT: rval =
new int[count];
break;
279 case SHADER_MAT2: rval =
new float[4 * count];
break;
280 case SHADER_MAT3: rval =
new float[9 * count];
break;
281 case SHADER_MAT4: rval =
new float[16 * count];
break;
327 case SHADER_VEC4:
delete [] (
static_cast<float *
>(data));
break;
331 case SHADER_IVEC4:
delete [] (
static_cast<int *
>(data));
break;
342 case SHADER_MAT4:
delete [] (
static_cast<float *
>(data));
break;
A class holding an UTF-8 string.
bool isVariableOwned(uint32 index) const
Shader::ShaderVariableType getVariableType(uint32 index) const
Shader::ShaderObject * getFragmentShader() const
void * getVariableData(uint32 index) const
ShaderMaterial(Shader::ShaderObject *fragShader, const Common::UString &name="unnamed")
Different to default blending. Maybe this should be extended one day.
void delMaterialVar(uint32 index)
void bindFade(Shader::ShaderProgram *program, float fade)
#define SHADER_MATERIAL_VARIABLE_OWNED
ShaderObject * fragmentObject
void setFlags(uint32 flags)
const Common::UString & getName() const
Shader material, responsible for tracking data relating to a fragment shader.
ShaderVariableType
Enum of all supported shader variable parsing and automatic binding.
Shader::ShaderObject * _fragShader
std::vector< GLint > fragmentVariableLocations
uint32 getVariableCount() const
void recalcTextureUnits()
void * genMaterialVar(uint32 index)
void bindProgram(Shader::ShaderProgram *program)
Shader sampler is used to bind a texture to a texture unit.
#define ShaderMan
Shortcut for accessing the shader manager.
void bindProgramNoFade(Shader::ShaderProgram *program)
void setVariableExternal(uint32 index, void *loc, bool textureUnitRecalc=true)
const Common::UString & getVariableName(uint32 index) const
std::vector< ShaderMaterialVariable > _variableData
void setVariableInternal(uint32 index, bool textureUnitRecalc=true)
std::vector< ShaderObject::ShaderObjectVariable > variablesCombined
uint32 getVariableFlags(uint32 index) const