X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fmaterials%2Fpbrmaterial.h;h=18719bd44e98f8616f2fb7e2e85aac79d2baccda;hb=b0db98d71aeb32d9e57315b8a06ff4068aeccbca;hp=dadda9b52358c0b029f46971fcf4d2da73d088f1;hpb=5b652353d545a3190ea2d86ba82a87b2e3382a0d;p=libs%2Fgl.git diff --git a/source/materials/pbrmaterial.h b/source/materials/pbrmaterial.h index dadda9b5..18719bd4 100644 --- a/source/materials/pbrmaterial.h +++ b/source/materials/pbrmaterial.h @@ -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: @@ -32,6 +40,7 @@ private: Property occlusion; Property emission; const Texture2D &fresnel_lookup; + const Sampler &fresnel_sampler; static const Tag texture_tags[]; @@ -47,6 +56,7 @@ 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 *);