void PbrMaterial::fill_program_info(string &module_name, map<string, int> &spec_values) const
{
- module_name = "cooktorrance.glsl";
+ module_name = "pbr_material.glsl";
spec_values["use_base_color_map"] = (base_color.texture!=0);
spec_values["use_normal_map"] = (normal.texture!=0);
spec_values["use_metalness_map"] = (metalness.texture!=0);
base_color.texture = tex;
}
+void PbrMaterial::set_tint(const Color &color)
+{
+ tint.value = color;
+ shdata.uniform("pbr_material.tint", color);
+}
+
void PbrMaterial::set_normal_map(const Texture *tex)
{
normal.texture = tex;
add_property("roughness", &PbrMaterial::set_roughness, &PbrMaterial::set_roughness_map);
add_property("occlusion", &PbrMaterial::set_occlusion_map);
add_property("emission", &PbrMaterial::set_emission, &PbrMaterial::set_emission_map, false);
+ add_property("tint", &PbrMaterial::set_tint, 0, true);
}
} // namespace GL