X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fmaterials%2Fbasicmaterial.h;fp=source%2Fmaterials%2Fbasicmaterial.h;h=95259f476b233198856c49a42391049f54f6b0b5;hb=7aaec9a70b8d7733429bec043f8e33e02956f266;hp=0000000000000000000000000000000000000000;hpb=bec07999d95b76f4b47cffcc564d0cd0afc0435e;p=libs%2Fgl.git diff --git a/source/materials/basicmaterial.h b/source/materials/basicmaterial.h new file mode 100644 index 00000000..95259f47 --- /dev/null +++ b/source/materials/basicmaterial.h @@ -0,0 +1,60 @@ +#ifndef MSP_GL_BASICMATERIAL_H_ +#define MSP_GL_BASICMATERIAL_H_ + +#include "material.h" + +namespace Msp { +namespace GL { + +class BasicMaterial: public Material +{ +public: + class Loader: public DataFile::DerivedObjectLoader > + { + private: + static ActionMap shared_actions; + + public: + Loader(BasicMaterial &); + Loader(BasicMaterial &, Collection &); + + private: + virtual void init_actions(); + }; + +private: + Property diffuse; + Property specular; + Property shininess; + Property normal; + Property emission; + Property reflectivity; + bool receive_shadows; + +public: + BasicMaterial(); + +protected: + virtual std::string create_program_source() const; + +public: + virtual void attach_textures_to(Texturing &, ProgramData &) const; + + void set_diffuse(const Color &); + void set_diffuse_map(const Texture *); + void set_specular(const Color &); + void set_specular_map(const Texture *); + void set_normal_map(const Texture *); + void set_emission(const Color &); + void set_emission_map(const Texture *); + void set_shininess(float); + void set_shininess_map(const Texture *); + void set_reflectivity(float); + void set_reflectivity_map(const Texture *); + void set_receive_shadows(bool); +}; + +} // namespace GL +} // namespace Msp + +#endif