14#ifndef FOOLSENGINE_MATERIAL_H
15#define FOOLSENGINE_MATERIAL_H
91 static std::shared_ptr<Material>
ApplyOverrides(
const nlohmann::json& materialOverrides, std::shared_ptr<Material> material=std::shared_ptr<Material>(
new Material{}));
307 std::map<std::string, std::shared_ptr<Texture>> mTextureProperties {};
375 std::shared_ptr<IResource>
createResource(
const nlohmann::json& methodParameters)
override;
MaterialFromDescription()
Constructs a new MaterialFromDescription object.
Definition material.hpp:356
std::shared_ptr< IResource > createResource(const nlohmann::json &methodParameters) override
The method actually responsible for constructing a Material from its JSON description.
Definition material.cpp:147
static std::string getResourceConstructorName()
The resource constructor type string associated with this object.
Definition material.hpp:365
A collection of key value pairs used to control the behaviour of the rendering system when rendering ...
Definition material.hpp:50
std::map< std::string, float > mFloatProperties
All float property overrides used in this Material instance.
Definition material.hpp:289
glm::vec4 getVec4Property(const std::string &name)
Gets a glm::vec4 property.
Definition material.cpp:87
void updateIntProperty(const std::string &name, int value)
Updates an int property.
Definition material.cpp:62
static void RegisterFloatProperty(const std::string &name, float defaultValue)
Registers a project-wide float property.
Definition material.cpp:106
Material()
Constructs a new Material object.
Definition material.cpp:14
std::map< std::string, glm::vec2 > mVec2Properties
All glm::vec2 property overrides used in this Material instance.
Definition material.hpp:306
std::shared_ptr< Texture > getTextureProperty(const std::string &name)
Gets the texture property of an object.
Definition material.cpp:99
void releaseResource()
Releases the resources used by this material so that another material or part of the program can clai...
Definition material.cpp:139
virtual ~Material()
Destroys the material object.
Definition material.cpp:12
static Material * defaultMaterial
A material instantiated at the start of the application, intended to hold all of the material propert...
Definition material.hpp:283
int getIntProperty(const std::string &name)
Gets an int property.
Definition material.cpp:66
static void RegisterTextureHandleProperty(const std::string &name, std::shared_ptr< Texture > defaultValue)
Registers a project-wide texture property.
Definition material.cpp:118
void destroyResource()
Destroys the resources used by this material (say, during destruction).
Definition material.cpp:135
static void RegisterIntProperty(const std::string &name, int defaultValue)
Registers a project-wide int property.
Definition material.cpp:109
std::map< std::string, glm::vec4 > mVec4Properties
All glm::vec4 property overrides used in this Material instance.
Definition material.hpp:300
void updateVec4Property(const std::string &name, const glm::vec4 &value)
Updates a glm::vec4 property.
Definition material.cpp:82
glm::vec2 getVec2Property(const std::string &name)
Gets a glm::vec2 property.
Definition material.cpp:76
void updateFloatProperty(const std::string &name, float value)
Updates a float property.
Definition material.cpp:52
static void Clear()
Clears all of this project's material system properties, to be called prior to application shutdown.
Definition material.cpp:127
void updateTextureProperty(const std::string &name, std::shared_ptr< Texture > value)
Updates a texture property.
Definition material.cpp:94
static std::shared_ptr< Material > ApplyOverrides(const nlohmann::json &materialOverrides, std::shared_ptr< Material > material=std::shared_ptr< Material >(new Material{}))
Overrides various material related properties based on a JSON description of the overrides.
Definition material.cpp:153
static void Init()
Initializes the material system, to be called at the start of the application before material propert...
Definition material.cpp:122
static std::string getResourceTypeName()
Gets the resource type string for this object.
Definition material.hpp:261
static void RegisterVec2Property(const std::string &name, const glm::vec2 &defaultValue)
Registers a project-wide glm::vec2 property.
Definition material.cpp:115
static void RegisterVec4Property(const std::string &name, const glm::vec4 &defaultValue)
Registers a project-wide glm::vec4 property.
Definition material.cpp:112
void updateVec2Property(const std::string &name, const glm::vec2 &value)
Updates a glm::vec2 property.
Definition material.cpp:72
std::map< std::string, int > mIntProperties
All int property overrides used in this Material instance.
Definition material.hpp:294
float getFloatProperty(const std::string &name)
Gets a float property.
Definition material.cpp:56
Material & operator=(const Material &other)
Material copy constructor.
Definition material.cpp:30
ResourceConstructor(int explicitlyInitializeMe)
Definition resource_database.hpp:491
Resource(int explicitlyInitializeMe)
Definition resource_database.hpp:389
Namespace containing all class definitions and functions related to the ToyMaker engine.
Definition camera_system.hpp:20
Headers relating to resources and their management for a given project.
Header containing definitions of classes and functions related to loading and using Texture resources...