X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fmaterial.h;h=ead11618c2c9abdf8d82ca29b63d7e241bfd7beb;hb=b13f1bced27e0ad3e4661e645f6bafed38359120;hp=e1bfec4caa0707419941b88476394955ab651244;hpb=c51030d1cb2308d30db80303a561de1774dfdb76;p=libs%2Fgl.git diff --git a/source/material.h b/source/material.h index e1bfec4c..ead11618 100644 --- a/source/material.h +++ b/source/material.h @@ -2,7 +2,6 @@ #define MSP_GL_MATERIAL_H_ #include -#include "bindable.h" #include "color.h" #include "programdata.h" @@ -12,15 +11,12 @@ namespace GL { /** Stores basic material properties. This includes color and reflection parameters, but does not include texturing. Materials interact with light -soucres and ambient lighting to produce the base color of a surface. Textures +sources 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 +40,6 @@ public: }; private: - enum ParameterMask - { - AMBIENT = 1, - DIFFUSE = 2, - SPECULAR = 4, - EMISSION = 8, - SHININESS = 16 - }; - Color ambient; Color diffuse; Color specular; @@ -64,10 +51,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 +79,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