X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fmaterials%2Fbasicmaterial.h;h=4fe4e10c2012bc9be0c3e2171bd39f01e8e341a5;hp=ef7d1526726c48d101e8ca8c232d63b903794521;hb=HEAD;hpb=842c817bb679a5a0abc05e8149e2e6e0ae1a0412 diff --git a/source/materials/basicmaterial.h b/source/materials/basicmaterial.h index ef7d1526..4fe4e10c 100644 --- a/source/materials/basicmaterial.h +++ b/source/materials/basicmaterial.h @@ -6,6 +6,13 @@ namespace Msp { namespace GL { +/** +A basic and cheap material using the Phong shading model. Results are roughly +equivalent to legacy OpenGL materials. + +In addition to the usual properties of the Phong shading model, normal mapping +and reflections are supported. Reflections require an EnvironmentMap effect. +*/ class BasicMaterial: public Material { public: @@ -15,7 +22,6 @@ public: static ActionMap shared_actions; public: - Loader(BasicMaterial &); Loader(BasicMaterial &, Collection &); private: @@ -29,7 +35,8 @@ private: Property normal; Property emission; Property reflectivity; - bool receive_shadows; + + static const Tag texture_tags[]; public: BasicMaterial(); @@ -38,7 +45,8 @@ protected: virtual void fill_program_info(std::string &, std::map &) const; public: - virtual void attach_textures_to(Texturing &, ProgramData &) const; + virtual const Tag *get_texture_tags() const { return texture_tags; } + virtual const Texture *get_texture(Tag) const; void set_diffuse(const Color &); void set_diffuse_map(const Texture *); @@ -51,7 +59,6 @@ public: void set_shininess_map(const Texture *); void set_reflectivity(float); void set_reflectivity_map(const Texture *); - void set_receive_shadows(bool); }; } // namespace GL