1 #ifndef MSP_GL_PBRMATERIAL_H_
2 #define MSP_GL_PBRMATERIAL_H_
11 class PbrMaterial: public Material
14 class Loader: public DataFile::DerivedObjectLoader<PbrMaterial, Material::PropertyLoader<PbrMaterial> >
17 static ActionMap shared_actions;
20 Loader(PbrMaterial &, Collection &);
23 virtual void init_actions();
27 Property<Color> base_color;
28 Property<Vector3> normal;
29 Property<float> metalness;
30 Property<float> roughness;
31 Property<float> occlusion;
32 Property<Color> emission;
33 const Texture2D &fresnel_lookup;
34 const Sampler &fresnel_sampler;
36 static const Tag texture_tags[];
42 static const Texture2D &get_or_create_fresnel_lookup();
45 virtual void fill_program_info(std::string &, std::map<std::string, int> &) const;
48 virtual const Tag *get_texture_tags() const { return texture_tags; }
49 virtual const Texture *get_texture(Tag) const;
50 virtual const Sampler *get_sampler(Tag) const;
52 void set_base_color(const Color &);
53 void set_base_color_map(const Texture *);
54 void set_normal_map(const Texture *);
55 void set_metalness(float);
56 void set_metalness_map(const Texture *);
57 void set_roughness(float);
58 void set_roughness_map(const Texture *);
59 void set_occlusion_map(const Texture *);
60 void set_emission(const Color &);
61 void set_emission_map(const Texture *);