X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fmaterial.h;h=17ea88391238ec31533261578c43ae244cf4e3a7;hb=a40fc85277dba5c34402a0e703d038efd30cc57b;hp=e1bfec4caa0707419941b88476394955ab651244;hpb=2fa1bb084e54af7134b44d3ee7512056e28de67e;p=libs%2Fgl.git diff --git a/source/material.h b/source/material.h index e1bfec4c..17ea8839 100644 --- a/source/material.h +++ b/source/material.h @@ -15,12 +15,9 @@ parameters, but does not include texturing. Materials interact with light soucres and ambient lighting to produce the base color of a surface. Textures can be used to add detail. -Material provides a set of uniform variables for use with shaders. Standard -shaders generated by ProgramBuilder only use it when legacy mode is disabled. - -In legacy mode, materials are applied with several calls to glMaterial. +Material provides a set of uniform variables for use with shaders. */ -class Material: public BindableWithDefault +class Material { public: class Loader: public DataFile::CollectionObjectLoader @@ -44,15 +41,6 @@ public: }; private: - enum ParameterMask - { - AMBIENT = 1, - DIFFUSE = 2, - SPECULAR = 4, - EMISSION = 8, - SHININESS = 16 - }; - Color ambient; Color diffuse; Color specular; @@ -64,10 +52,6 @@ private: public: Material(); -private: - void update_parameter(int) const; - -public: /** Sets the ambient color of the material. Provided to shaders with the name material.ambient. */ void set_ambient(const Color &); @@ -96,11 +80,8 @@ public: float get_shininess() const { return shininess; } float get_reflectivity() const { return reflectivity; } - /** Returns the uniforms for the material. Not needed for shaders that use - the legacy built-in uniform gl_FrontMaterial and have no reflections. */ + /** Returns the uniforms for the material. */ const ProgramData &get_shader_data() const { return shdata; } - - void bind() const; }; } // namespace GL