Radium Engine  1.5.20
Loading...
Searching...
No Matches
Ra::Core::Asset::MaterialData Class Reference

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>

+ Inheritance diagram for Ra::Core::Asset::MaterialData:
+ Collaboration diagram for Ra::Core::Asset::MaterialData:

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::stringgetName () const
 Acces to the name of the asset.
 

Additional Inherited Members

- Protected Attributes inherited from Ra::Core::Asset::AssetData
std::string m_name
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ MaterialData()

Ra::Core::Asset::MaterialData::MaterialData ( const std::string & name = "",
const std::string & type = "AbstractMaterial" )

MATERIAL DATA.

CONSTRUCTOR.

Definition at line 9 of file MaterialData.cpp.

◆ ~MaterialData()

Ra::Core::Asset::MaterialData::~MaterialData ( )
virtual

Definition at line 12 of file MaterialData.cpp.

Member Function Documentation

◆ displayInfo()

void Ra::Core::Asset::MaterialData::displayInfo ( ) const
virtual

DEBUG.

Definition at line 15 of file MaterialData.cpp.

◆ getType()

std::string Ra::Core::Asset::MaterialData::getType ( ) const
inline

TYPE.

Definition at line 79 of file MaterialData.hpp.

◆ setName()

void Ra::Core::Asset::MaterialData::setName ( const std::string & name)
inline

NAME.

MATERIAL ///.

NAME

Definition at line 74 of file MaterialData.hpp.

◆ setType()

void Ra::Core::Asset::MaterialData::setType ( const std::string & type)
inline

Definition at line 83 of file MaterialData.hpp.


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