set_specular(0);
set_emission(0);
set_shininess(0);
+ set_reflectivity(0);
}
void Material::update_parameter(int mask) const
update_parameter(SHININESS);
}
+void Material::set_reflectivity(float r)
+{
+ reflectivity = r;
+ shdata.uniform("reflectivity", reflectivity);
+}
+
void Material::bind() const
{
if(set_current(this))
add("specular", &Loader::specular);
add("emission", &Loader::emission);
add("shininess", &Loader::shininess);
+ add("reflectivity", &Loader::reflectivity);
}
Color Material::Loader::make_color(float r, float g, float b, float a)
obj.set_shininess(s);
}
+void Material::Loader::reflectivity(float r)
+{
+ obj.set_reflectivity(r);
+}
+
} // namespace GL
} // namespace Msp
void specular(float, float, float, float);
void emission(float, float, float, float);
void shininess(float);
+ void reflectivity(float);
};
private:
Color specular;
Color emission;
float shininess;
+ float reflectivity;
ProgramData shdata;
public:
void set_specular(const Color &s);
void set_emission(const Color &e);
void set_shininess(float s);
+ void set_reflectivity(float);
const Color &get_ambient() const { return ambient; }
const Color &get_diffuse() const { return diffuse; }
const Color &get_specular() const { return specular; }
const Color &get_emission() const { return emission; }
float get_shininess() const { return shininess; }
+ float get_reflectivity() const { return reflectivity; }
const ProgramData &get_shader_data() const { return shdata; }
void bind() const;
};
{ UNIFORM, "normalmap", "sampler2D", 0, 0 },
{ UNIFORM, "environment", "samplerCube", 0, 0 },
{ UNIFORM, "EnvMap::env_eye_matrix", "mat3", 0, 0 },
- { UNIFORM, "EnvMap::reflectivity", "float", 0, 0 },
+ { UNIFORM, "Material::reflectivity", "float", 0, 0 },
{ UNIFORM, "eye_obj_matrix", "mat4", "gl_ModelViewMatrix", 0 },
{ UNIFORM, "eye_obj_normal_matrix", "mat3", "gl_NormalMatrix", 0 },
{ UNIFORM, "projection_matrix", "mat4", "gl_ProjectionMatrix", 0 },