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 &);
21 Loader(PbrMaterial &, Collection &);
24 virtual void init_actions();
28 Property<Color> base_color;
29 Property<Vector3> normal;
30 Property<float> metalness;
31 Property<float> roughness;
32 Property<float> occlusion;
33 Property<Color> emission;
34 const Texture2D &fresnel_lookup;
35 const Sampler &fresnel_sampler;
37 static const Tag texture_tags[];
43 static const Texture2D &get_or_create_fresnel_lookup();
46 virtual void fill_program_info(std::string &, std::map<std::string, int> &) const;
49 virtual const Tag *get_texture_tags() const { return texture_tags; }
50 virtual const Texture *get_texture(Tag) const;
51 virtual const Sampler *get_sampler(Tag) const;
53 void set_base_color(const Color &);
54 void set_base_color_map(const Texture *);
55 void set_normal_map(const Texture *);
56 void set_metalness(float);
57 void set_metalness_map(const Texture *);
58 void set_roughness(float);
59 void set_roughness_map(const Texture *);
60 void set_occlusion_map(const Texture *);
61 void set_emission(const Color &);
62 void set_emission_map(const Texture *);