X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fmaterials%2Fmaterial.h;fp=source%2Fmaterials%2Fmaterial.h;h=ff7f53c0d3ffdb23acf15f55c649f6aacaa1708d;hp=98baaa54ff2faf41b7975427dc4412306ac2e906;hb=190a7e11237351f6b730c28f7b16f183e8adc69c;hpb=be6ffe96ecb4707599fe1a6f620c348760213d46 diff --git a/source/materials/material.h b/source/materials/material.h index 98baaa54..ff7f53c0 100644 --- a/source/materials/material.h +++ b/source/materials/material.h @@ -13,6 +13,9 @@ namespace GL { class Sampler; +/** +Base class for materials. Subclasses provide different shading models. +*/ class Material { private: @@ -75,15 +78,21 @@ protected: public: virtual ~Material() = default; + /** Returns a shader appropriate for this material. The same shader is + returned for materials with the same set of features. Additional + specialization values can be passed in to customize the shader. */ virtual const Program *create_compatible_shader(const std::map & = std::map()) const; protected: virtual void fill_program_info(std::string &, std::map &) const = 0; public: - /** Returns the uniforms for the material. */ + /** Returns the uniform values for the material. */ const ProgramData &get_shader_data() const { return shdata; } + /** Returns texture tags used by the material. The returned array is + terminated by an empty tag. */ virtual const Tag *get_texture_tags() const = 0; + virtual const Texture *get_texture(Tag) const = 0; virtual const Sampler *get_sampler(Tag) const { return sampler; }