public:
virtual ~Material() { }
- virtual Program *create_compatible_shader() const;
virtual const Program *create_compatible_shader(DataFile::Collection &) const;
protected:
- virtual std::string create_program_source() const = 0;
+ virtual void fill_program_info(std::string &, std::map<std::string, int> &) const = 0;
public:
/** Returns the uniforms for the material. */
void Material::PropertyLoader<C>::add_property(const std::string &kw, void (C::*set_value)(float), void (C::*set_texture)(const Texture *))
{
add(kw, &PropertyLoader<C>::property_value_scalar, set_value);
- add(kw+"_map", &PropertyLoader<C>::property_texture, set_texture);
+ if(set_texture)
+ add(kw+"_map", &PropertyLoader<C>::property_texture, set_texture);
}
template<typename C>
add(kw, &PropertyLoader<C>::property_value_rgba, set_value);
add(kw+"_srgb", &PropertyLoader<C>::property_value_srgb_alpha, set_value);
}
- add(kw+"_map", &PropertyLoader<C>::property_texture, set_texture);
+ if(set_texture)
+ add(kw+"_map", &PropertyLoader<C>::property_texture, set_texture);
}
template<typename C>