Radium Engine
1.5.20
|
represent material data loaded by a file loader. Material data must be identified by a unique name. Radium Engine reserves the following names "AbstractMaterial" --> unknown material, might serve for error management "BlinnPhong" --> standar Blinn-Phong Material More...
#include <Core/Asset/MaterialData.hpp>
Public Member Functions | |
MaterialData (const std::string &name="", const std::string &type="AbstractMaterial") | |
MATERIAL DATA. | |
void | setName (const std::string &name) |
NAME. | |
std::string | getType () const |
TYPE. | |
void | setType (const std::string &type) |
virtual void | displayInfo () const |
DEBUG. | |
Public Member Functions inherited from Ra::Core::Asset::AssetData | |
AssetData (const std::string &name) | |
Construct an asset data given its name. | |
AssetData (const AssetData &other)=default | |
Copy constructor. Default here. | |
virtual | ~AssetData () |
Simple delete operator. | |
virtual const std::string & | getName () const |
Acces to the name of the asset. | |
Additional Inherited Members | |
Protected Attributes inherited from Ra::Core::Asset::AssetData | |
std::string | m_name |
represent material data loaded by a file loader. Material data must be identified by a unique name. Radium Engine reserves the following names "AbstractMaterial" --> unknown material, might serve for error management "BlinnPhong" --> standar Blinn-Phong Material
When extending the material system with a loader plugin (or something similar) : Define your own "Asset" class derived from Ra::Core::Asset::MaterialData with the "type" that identifies it uniquely and corresponding to the external format of your material (in the file you load). Define your own "Engine" class, derived from Ra::Engine::Material.
Make your plugin register the converter function from "Asset" to "Engine" for this material. This function may be everithing that is of the same type than
std::function<RadiumMaterialPtr(AssetMaterialPtr)> Make your plugin register the default technique builder for this material. This will require to write some GLSL shaders and make them accessible from the application search directory. See example in RadiumEngine.cpp (RadiumEngine::initialize()) that defins default BlinnPhong Material.
Make your loader instantiate the right "Asset" MaterialData class while loading material
data from a file.
The active system (GeometrySystem is the Radium Default), will then automatically use your
new material and technique so that the rendering will be fine. When writing your own system, see GeometrySystem implementation as an example.
That's all folks.
Definition at line 39 of file MaterialData.hpp.
Ra::Core::Asset::MaterialData::MaterialData | ( | const std::string & | name = "", |
const std::string & | type = "AbstractMaterial" ) |
|
virtual |
Definition at line 12 of file MaterialData.cpp.
|
virtual |
DEBUG.
Definition at line 15 of file MaterialData.cpp.
|
inline |
TYPE.
Definition at line 79 of file MaterialData.hpp.
|
inline |
|
inline |
Definition at line 83 of file MaterialData.hpp.