X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fpbrmaterial.h;fp=source%2Fpbrmaterial.h;h=0002888b080cccdb4eff14d0dbd31469689dfbbe;hb=f7d6481be3511153ded018e119bcac852faa0766;hp=0000000000000000000000000000000000000000;hpb=146df2d02940a04aeafe854bdd981a1489cc80b3;p=libs%2Fgl.git diff --git a/source/pbrmaterial.h b/source/pbrmaterial.h new file mode 100644 index 00000000..0002888b --- /dev/null +++ b/source/pbrmaterial.h @@ -0,0 +1,59 @@ +#ifndef MSP_GL_PBRMATERIAL_H_ +#define MSP_GL_PBRMATERIAL_H_ + +#include "material.h" + +namespace Msp { +namespace GL { + +class PbrMaterial: public Material +{ +public: + class Loader: public DataFile::DerivedObjectLoader > + { + private: + static ActionMap shared_actions; + + public: + Loader(PbrMaterial &); + Loader(PbrMaterial &, Collection &); + + private: + virtual void init_actions(); + }; + +private: + Property base_color; + Property normal; + Property metalness; + Property roughness; + Property occlusion; + Property emission; + bool receive_shadows; + +public: + PbrMaterial(); + +protected: + virtual std::string create_program_source() const; + +public: + virtual void attach_textures_to(Texturing &, ProgramData &) const; + + void set_base_color(const Color &); + void set_base_color_map(const Texture *); + void set_normal_map(const Texture *); + void set_metalness(float); + void set_metalness_map(const Texture *); + void set_roughness(float); + void set_roughness_map(const Texture *); + void set_occlusion_map(const Texture *); + void set_emission(const Color &); + void set_emission_map(const Texture *); + void set_receive_shadows(bool); +}; + +} // namespace GL +} // namespace Msp + +#endif