};
PbrMaterial::PbrMaterial():
- fresnel_lookup(get_or_create_fresnel_lookup())
+ fresnel_lookup(get_or_create_fresnel_lookup()),
+ fresnel_sampler(Resources::get_global().get<Sampler>("_linear_clamp.samp"))
{
set_base_color(0.8f);
set_metalness(0.0f);
spec_values["use_emission_map"] = (emission.texture!=0);
}
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-void PbrMaterial::attach_textures_to(Texturing &texturing, ProgramData &tex_shdata) const
-{
- attach_texture_to(base_color.texture, texturing, tex_shdata, "base_color_map");
- attach_texture_to(metalness.texture, texturing, tex_shdata, "metalness_map");
- attach_texture_to(roughness.texture, texturing, tex_shdata, "roughness_map");
- attach_texture_to(normal.texture, texturing, tex_shdata, "normal_map");
- attach_texture_to(occlusion.texture, texturing, tex_shdata, "occlusion_map");
- attach_texture_to(emission.texture, texturing, tex_shdata, "emission_map");
-}
-#pragma GCC diagnostic pop
-
const Texture *PbrMaterial::get_texture(Tag tag) const
{
if(tag==texture_tags[0])
return 0;
}
+const Sampler *PbrMaterial::get_sampler(Tag tag) const
+{
+ if(tag==texture_tags[6])
+ return &fresnel_sampler;
+ else
+ return sampler;
+}
+
void PbrMaterial::set_base_color(const Color &color)
{
base_color.value = color;