]> git.tdb.fi Git - libs/gl.git/blobdiff - source/materials/pbrmaterial.h
Check the flat qualifier from the correct member
[libs/gl.git] / source / materials / pbrmaterial.h
index dadda9b52358c0b029f46971fcf4d2da73d088f1..e96236d2af8501597336d7e72037ba73a22ceba7 100644 (file)
@@ -8,6 +8,15 @@ namespace GL {
 
 class Texture2D;
 
+/**
+A physically-based material using the Cook-Torrance BRDF.
+
+The material is characterized by base color, metalness and roughness.  Fully
+metallic materials have no diffuse reflection and their specular reflection is
+tinted by the base color.  For fully dielectric materials base color determines
+the color of the diffuse reflection; specular reflection is untinted.
+Roughness affects how blurry specular reflections are.
+*/
 class PbrMaterial: public Material
 {
 public:
@@ -17,7 +26,6 @@ public:
                static ActionMap shared_actions;
 
        public:
-               Loader(PbrMaterial &);
                Loader(PbrMaterial &, Collection &);
 
        private:
@@ -26,19 +34,20 @@ public:
        
 private:
        Property<Color> base_color;
+       Property<Color> tint;
        Property<Vector3> normal;
        Property<float> metalness;
        Property<float> roughness;
        Property<float> occlusion;
        Property<Color> emission;
        const Texture2D &fresnel_lookup;
+       const Sampler &fresnel_sampler;
 
        static const Tag texture_tags[];
 
 public:
        PbrMaterial();
 
-private:
        static const Texture2D &get_or_create_fresnel_lookup();
 
 protected:
@@ -47,9 +56,11 @@ protected:
 public:
        virtual const Tag *get_texture_tags() const { return texture_tags; }
        virtual const Texture *get_texture(Tag) const;
+       virtual const Sampler *get_sampler(Tag) const;
 
        void set_base_color(const Color &);
        void set_base_color_map(const Texture *);
+       void set_tint(const Color &);
        void set_normal_map(const Texture *);
        void set_metalness(float);
        void set_metalness_map(const Texture *);