Radium Engine  1.5.0
Ra::Engine::Data::PlainMaterial Class Referencefinal

#include <Engine/Data/PlainMaterial.hpp>

+ Inheritance diagram for Ra::Engine::Data::PlainMaterial:
+ Collaboration diagram for Ra::Engine::Data::PlainMaterial:

Public Member Functions

 PlainMaterial (const std::string &instanceName)
 
 ~PlainMaterial () override
 
void updateFromParameters () override
 Update the attributes of the ShaderParameterProvider to their actual values stored in the renderParameters.
 
nlohmann::json getParametersMetadata () const override
 
- Public Member Functions inherited from Ra::Engine::Data::SimpleMaterial
 SimpleMaterial (const std::string &instanceName, const std::string &materialName, MaterialAspect aspect=MaterialAspect::MAT_OPAQUE)
 
 ~SimpleMaterial () override
 
void updateGL () override final
 
TextureParametersaddTexture (const TextureSemantic &semantic, const TextureParameters &texture)
 
void addTexture (const TextureSemantic &semantic, Texture *texture)
 
TexturegetTexture (const TextureSemantic &semantic) const
 
void setColoredByVertexAttrib (bool state) override
 Makes the Material take its base color from the VERTEX_COLOR attribute of the rendered geometry. More...
 
bool isColoredByVertexAttrib () const override
 Indicates if the material takes the VERTEX_COLOR attribute into account.
 
- Public Member Functions inherited from Ra::Engine::Data::Material
const std::string & getInstanceName () const
 
const std::string & getMaterialName () const
 
void setMaterialAspect (const MaterialAspect &aspect)
 
const MaterialAspectgetMaterialAspect () const
 
virtual bool isTransparent () const
 
std::list< std::string > getPropertyList () const override
 
void needUpdate ()
 
- Public Member Functions inherited from Ra::Engine::Data::ShaderParameterProvider
virtual RenderParametersgetParameters ()
 
virtual const RenderParametersgetParameters () const
 

Static Public Member Functions

static void registerMaterial ()
 
static void unregisterMaterial ()
 
- Static Public Member Functions inherited from Ra::Engine::Data::ParameterSetEditingInterface
static void loadMetaData (const std::string &basename, nlohmann::json &destination)
 Load the ParameterSet description.
 

Additional Inherited Members

- Public Types inherited from Ra::Engine::Data::SimpleMaterial
enum class  TextureSemantic { TEX_COLOR , TEX_MASK }
 Semantic of the texture : define which BSDF parameter is controled by the texture.
 
- Public Types inherited from Ra::Engine::Data::Material
enum class  MaterialAspect { MAT_OPAQUE , MAT_TRANSPARENT , MAT_DENSITY }
 
- Public Attributes inherited from Ra::Engine::Data::SimpleMaterial
Core::Utils::Color m_color { 0.9, 0.9, 0.9, 1.0 }
 The base color of the material.
 
bool m_perVertexColor { false }
 
- Protected Member Functions inherited from Ra::Engine::Data::Material
 Material (const std::string &instanceName, const std::string &materialName, MaterialAspect aspect=MaterialAspect::MAT_OPAQUE)
 
void setMaterialName (std::string newName)
 
- Static Protected Member Functions inherited from Ra::Engine::Data::SimpleMaterial
static void loadMetaData (nlohmann::json &destination)
 Load the material parameter description.
 
- Protected Attributes inherited from Ra::Engine::Data::Material
std::string m_instanceName {}
 Material instance name.
 
MaterialAspect m_aspect { MaterialAspect::MAT_OPAQUE }
 Material aspect.
 
bool m_isDirty { true }
 

Detailed Description

Implementation of the Plain Material BSDF. This material implements a flat color rendering. This material could not be loaded from a file and must be defined and associated to renderobjects programatically.

This Material is parameterized either globally, by setting the m_color base color or locally, by setting a vertex color attribute that define the per vertex color and setting m_perVertexColor to true.

Definition at line 19 of file PlainMaterial.hpp.

Constructor & Destructor Documentation

◆ PlainMaterial()

Ra::Engine::Data::PlainMaterial::PlainMaterial ( const std::string &  instanceName)
explicit

Construct a named Plain material

Parameters
nameThe name of the material

Definition at line 19 of file PlainMaterial.cpp.

◆ ~PlainMaterial()

Ra::Engine::Data::PlainMaterial::~PlainMaterial ( )
overridedefault

Destructor.

Note
The material does not have ownership on its texture nor its shaders. This destructor do not delete the associated textures and the corresponding shaders.

Member Function Documentation

◆ getParametersMetadata()

nlohmann::json Ra::Engine::Data::PlainMaterial::getParametersMetadata ( ) const
overridevirtual

Get a json containing metadata about the parameters of the material.

Returns
the metadata in json format

Implements Ra::Engine::Data::ParameterSetEditingInterface.

Definition at line 70 of file PlainMaterial.cpp.

◆ registerMaterial()

void Ra::Engine::Data::PlainMaterial::registerMaterial ( )
static

Register the material in the material library. After registration, the material could be instantiated by any Radium system, renderer, plugin, ...

Definition at line 24 of file PlainMaterial.cpp.

+ Here is the call graph for this function:

◆ unregisterMaterial()

void Ra::Engine::Data::PlainMaterial::unregisterMaterial ( )
static

Remove the material from the material library. After removal, the material is no more available, ...

Definition at line 60 of file PlainMaterial.cpp.


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