Simulant  21.12-553
A portable game engine for Windows, OSX, Linux, Dreamcast, and PSP
Classes | Public Member Functions | Static Public Attributes | Protected Member Functions | Friends | List of all members
smlt::Material Class Reference
Inheritance diagram for smlt::Material:
smlt::Asset smlt::Loadable smlt::generic::Identifiable< MaterialID > smlt::RefCounted< Material > smlt::Updateable smlt::MaterialObject smlt::ChainNameable< Material > smlt::Nameable smlt::TwoPhaseConstructed smlt::MaterialPropertyOverrider smlt::Nameable

Classes

struct  BuiltIns
 

Public Member Functions

 Material (MaterialID id, AssetManager *asset_manager)
 
bool set_pass_count (uint8_t pass_count)
 
uint8_t pass_count () const
 
MaterialPasspass (uint8_t pass)
 
void each (std::function< void(uint32_t, MaterialPass *)> callback)
 
void update (float dt) override
 
const std::unordered_map< MaterialPropertyNameHash, MaterialPropertyType > & custom_properties () const
 
const std::set< MaterialPropertyNameHash > & texture_properties () const
 
bool property_name (MaterialPropertyNameHash hsh, std::string &name) const
 
- Public Member Functions inherited from smlt::Asset
 Asset (AssetManager *manager)
 
AssetManagerasset_manager ()
 
const AssetManagerasset_manager () const
 
int age () const
 
void set_garbage_collection_method (GarbageCollectMethod method)
 
- Public Member Functions inherited from smlt::Nameable
void set_name (const std::string &name)
 
const std::string & name () const
 
bool has_name () const
 
- Public Member Functions inherited from smlt::generic::Identifiable< MaterialID >
 Identifiable (MaterialID id)
 
MaterialID id () const
 
virtual bool operator== (const Identifiable< MaterialID > &rhs) const
 
virtual bool operator< (const Identifiable< MaterialID > &rhs) const
 
void _bind_id_pointer (ResourceTypePtr ptr)
 
void _overwrite_id (MaterialID new_id)
 
- Public Member Functions inherited from smlt::TwoPhaseConstructed
virtual bool init ()
 
virtual void clean_up ()
 
- Public Member Functions inherited from smlt::Updateable
virtual void _update_thunk (float dt)
 
virtual void _late_update_thunk (float dt)
 
virtual void _fixed_update_thunk (float step)
 
- Public Member Functions inherited from smlt::MaterialObject
 MaterialObject (MaterialObject *parent)
 
void set_specular (const Colour &colour)
 
void set_ambient (const Colour &colour)
 
void set_diffuse (const Colour &colour)
 
void set_emission (const Colour &colour)
 
void set_shininess (float shininess)
 
void set_diffuse_map (TexturePtr texture)
 
void set_light_map (TexturePtr texture)
 
void set_specular_map (TexturePtr texture)
 
void set_normal_map (TexturePtr texture)
 
const Mat4diffuse_map_matrix () const
 
const Mat4light_map_matrix () const
 
const Mat4normal_map_matrix () const
 
const Mat4specular_map_matrix () const
 
void set_diffuse_map_matrix (const Mat4 &mat)
 
void set_light_map_matrix (const Mat4 &mat)
 
void set_normal_map_matrix (const Mat4 &mat)
 
void set_specular_map_matrix (const Mat4 &mat)
 
const TexturePtr & diffuse_map () const
 
const TexturePtr & light_map () const
 
const TexturePtr & normal_map () const
 
const TexturePtr & specular_map () const
 
void set_fog_density (float density)
 
void set_fog_start (float start)
 
void set_fog_end (float end)
 
void set_fog_mode (FogMode mode)
 
void set_fog_colour (const Colour &colour)
 
float fog_density () const
 
float fog_start () const
 
float fog_end () const
 
FogMode fog_mode () const
 
const Colourfog_colour () const
 
const Colourspecular () const
 
const Colourambient () const
 
const Colouremission () const
 
const Colourdiffuse () const
 
float shininess () const
 
bool is_blending_enabled () const
 
void set_blend_func (BlendType b)
 
BlendType blend_func () const
 
void set_depth_func (DepthFunc b)
 
DepthFunc depth_func () const
 
void set_depth_write_enabled (bool v)
 
bool is_depth_write_enabled () const
 
void set_cull_mode (CullMode mode)
 
CullMode cull_mode () const
 
void set_depth_test_enabled (bool v)
 
bool is_depth_test_enabled () const
 
void set_lighting_enabled (bool v)
 
bool is_lighting_enabled () const
 
void set_textures_enabled (EnabledTextureMask v)
 
int32_t textures_enabled () const
 
float point_size () const
 
void set_polygon_mode (PolygonMode mode)
 
PolygonMode polygon_mode () const
 
void set_shade_model (ShadeModel model)
 
ShadeModel shade_model () const
 
ColourMaterial colour_material () const
 
void set_colour_material (ColourMaterial cm)
 
const MaterialObjectparent_material_object () const
 
- Public Member Functions inherited from smlt::MaterialPropertyOverrider
 MaterialPropertyOverrider (const MaterialPropertyOverrider *parent)
 
template<typename T >
bool set_property_value (MaterialPropertyNameHash hsh, const char *name, const T &value)
 
template<typename T >
bool set_property_value (const char *name, const T &value)
 
bool set_property_value (const char *name, const Colour &value)
 
template<typename T >
bool property_value (const MaterialPropertyNameHash hsh, const T *&out) const
 
template<typename T >
void set_property_value (const std::string &str, const T &v)
 
template<typename T >
bool property_value (const std::string &str, const T *&out) const
 
template<typename T >
bool property_value (const char *name, const T *&out) const
 
bool clear_override (const char *name)
 
bool property_type (const char *property_name, MaterialPropertyType *type) const
 
- Public Member Functions inherited from smlt::ChainNameable< Material >
Materialset_name_and_get (const std::string &name)
 

Static Public Attributes

static const std::unordered_map< std::string, std::string > BUILT_IN_NAMES
 

Protected Member Functions

 Material (const Material &rhs)=delete
 
Materialoperator= (const Material &rhs)
 
- Protected Member Functions inherited from smlt::Asset
 Asset (const Asset &rhs)
 
Assetoperator= (const Asset &rhs)
 
- Protected Member Functions inherited from smlt::RefCounted< Material >
 RefCounted (Args &&...)
 
- Protected Member Functions inherited from smlt::MaterialPropertyOverrider
BasePropertyValuefind_core_property_value (const MaterialPropertyNameHash &hsh)
 
PropertyValueMemberPtr find_core_property (const MaterialPropertyNameHash &hsh) const
 
const BasePropertyValuefind_core_property_value (const MaterialPropertyNameHash &hsh) const
 
bool check_existance (const MaterialPropertyNameHash hsh) const
 
bool check_existance (const char *property_name) const
 
bool clear_override (const unsigned hsh)
 

Friends

class GenericRenderer
 
class _object_manager_impl::ObjectManagerBase< MaterialID, Material, std::shared_ptr< smlt::Material >, _object_manager_impl::ToSharedPtr< smlt::Material > >
 

Additional Inherited Members

- Public Types inherited from smlt::generic::Identifiable< MaterialID >
typedef MaterialID id_type
 
- Public Types inherited from smlt::RefCounted< Material >
typedef std::shared_ptr< Materialptr
 
typedef std::weak_ptr< Materialwptr
 
- Static Public Member Functions inherited from smlt::RefCounted< Material >
static RefCounted< Material >::ptr create (Args &&... args)
 
static RefCounted< Material >::ptr create ()
 
- Public Attributes inherited from smlt::Asset
Property< generic::DataCarrier Asset::* > data = {this, &Asset::data_}
 
- Protected Types inherited from smlt::MaterialPropertyOverrider
typedef BasePropertyValue MaterialPropertyOverrider::* PropertyValueMemberPtr
 
- Protected Attributes inherited from smlt::MaterialPropertyOverrider
PropertyValue< Vec4diffuse_property_
 
PropertyValue< Vec4ambient_property_
 
PropertyValue< Vec4emission_property_
 
PropertyValue< Vec4specular_property_
 
PropertyValue< float > shininess_property_
 
PropertyValue< float > point_size_property_
 
PropertyValue< bool > depth_write_enabled_property_
 
PropertyValue< bool > depth_test_enabled_property_
 
PropertyValue< bool > lighting_enabled_property_
 
PropertyValue< int32_t > textures_enabled_property_
 
PropertyValue< TexturePtr > diffuse_map_property_
 
PropertyValue< TexturePtr > specular_map_property_
 
PropertyValue< TexturePtr > light_map_property_
 
PropertyValue< TexturePtr > normal_map_property_
 
PropertyValue< Mat4diffuse_map_matrix_property_
 
PropertyValue< Mat4specular_map_matrix_property_
 
PropertyValue< Mat4light_map_matrix_property_
 
PropertyValue< Mat4normal_map_matrix_property_
 
PropertyValue< int32_t > blend_func_property_
 
PropertyValue< int32_t > polygon_mode_property_
 
PropertyValue< int32_t > shade_model_property_
 
PropertyValue< bool > colour_material_property_
 
PropertyValue< int32_t > cull_mode_property_
 
PropertyValue< Vec4fog_colour_property_
 
PropertyValue< float > fog_density_property_
 
PropertyValue< float > fog_start_property_
 
PropertyValue< float > fog_end_property_
 
PropertyValue< int32_t > fog_mode_property_
 
const MaterialPropertyOverriderparent_ = nullptr
 
std::unordered_map< MaterialPropertyNameHash, PropertyValue< void > > properties_
 

Member Data Documentation

◆ BUILT_IN_NAMES

const std::unordered_map< std::string, std::string > Material::BUILT_IN_NAMES
static
Initial value:
= {
{"DEFAULT", Material::BuiltIns::DEFAULT},
{"TEXTURE_ONLY", Material::BuiltIns::TEXTURE_ONLY},
{"DIFFUSE_ONLY", Material::BuiltIns::DIFFUSE_ONLY},
}

The documentation for this class was generated from the following files: