]> git.tdb.fi Git - libs/gl.git/blobdiff - source/materials/material.h
Implement alpha cutoff for materials
[libs/gl.git] / source / materials / material.h
index ff7f53c0d3ffdb23acf15f55c649f6aacaa1708d..75ff972cd4e1312de7e6d63a74480bf3c3b0409a 100644 (file)
@@ -27,6 +27,7 @@ private:
                virtual void init_actions();
 
        private:
+               void alpha_cutoff(float);
                void sampler(const std::string &);
        };
 
@@ -72,9 +73,10 @@ public:
 
 protected:
        const Sampler *sampler = 0;
+       float alpha_cutoff = 0.0f;
        ProgramData shdata;
 
-       Material() = default;
+       Material();
 public:
        virtual ~Material() = default;
 
@@ -96,6 +98,9 @@ public:
        virtual const Texture *get_texture(Tag) const = 0;
        virtual const Sampler *get_sampler(Tag) const { return sampler; }
 
+       void set_alpha_cutoff(float a);
+       float get_alpha_cutoff() const { return alpha_cutoff; }
+
        void set_debug_name(const std::string &);
 
        template<typename T>