Radium Engine  1.5.20
Loading...
Searching...
No Matches
Ra::Engine::Data::LambertianMaterial Class Referencefinal

Implementation of the Lambertian Material BSDF. More...

#include <Engine/Data/LambertianMaterial.hpp>

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

Public Member Functions

 LambertianMaterial (const std::string &instanceName)
 Construct a named Lambertian material.
 
void updateFromParameters () override
 Update the attributes of the ShaderParameterProvider to their actual values stored in the renderParameters.
 
nlohmann::json getParametersMetadata () const override
 Get a json containing metadata about the parameters.
 
- Public Member Functions inherited from Ra::Engine::Data::SimpleMaterial
 SimpleMaterial (const std::string &instanceName, const std::string &materialName, MaterialAspect aspect=MaterialAspect::MAT_OPAQUE)
 Construct a named material.
 
void updateGL () override final
 Update the openGL state of the material.
 
void setColoredByVertexAttrib (bool state) override
 Makes the Material take its base color from the VERTEX_COLOR attribute of the rendered geometry.
 
bool isColoredByVertexAttrib () const override
 Indicates if the material takes the VERTEX_COLOR attribute into account.
 
void setColor (Core::Utils::Color c)
 
- Public Member Functions inherited from Ra::Engine::Data::Material
virtual ~Material ()=default
 
const std::stringgetInstanceName () const
 
const std::stringgetMaterialName () const
 
void setMaterialAspect (const MaterialAspect &aspect)
 
const MaterialAspectgetMaterialAspect () const
 Get the aspect (MAT_OPAQUE or MAT_TRANSPARENT) of the material.
 
virtual bool isTransparent () const
 
std::list< std::stringgetPropertyList () const override
 Get the list of properties the material migh use in a shader.
 
void needUpdate ()
 Mark the Material as needing update before the next OpenGL call.
 
- Public Member Functions inherited from Ra::Engine::Data::ShaderParameterProvider
virtual RenderParametersgetParameters ()
 
virtual const RenderParametersgetParameters () const
 
- Public Member Functions inherited from Ra::Engine::Data::ParameterSetEditingInterface
- Public Member Functions inherited from Ra::Engine::Data::MaterialTextureSet< TextureSemantics::SimpleMaterial >
void addTexture (const TextureSemantics::SimpleMaterial &semantic, const TextureManager::TextureHandle &texture)
 
void addTexture (const TextureSemantics::SimpleMaterial &semantic, const TextureParameters &texture)
 Add texture to TextureManager fisrt, then to the texture set.
 
TexturegetTexture (const TextureSemantics::SimpleMaterial &semantic) const
 Texture getter from semantic.
 

Static Public Member Functions

static void registerMaterial ()
 Register the material in the material library.
 
static void unregisterMaterial ()
 Remove the material from the material library.
 
- 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
using TextureSemantic = TextureSemantics::SimpleMaterial
 
- Public Types inherited from Ra::Engine::Data::Material
enum class  MaterialAspect { MAT_OPAQUE , MAT_TRANSPARENT , MAT_DENSITY }
 Identifies the type of the material. More...
 
- Protected Member Functions inherited from Ra::Engine::Data::Material
 Material (const std::string &instanceName, const std::string &materialName, MaterialAspect aspect=MaterialAspect::MAT_OPAQUE)
 Creates a named material with the given aspect.
 
void setMaterialName (std::string newName)
 Change the material name.
 
bool isDirty ()
 Return dirty state.
 
void setDirty ()
 Set dirty state to true.
 
void setClean ()
 Set dirty state to false.
 
- Static Protected Member Functions inherited from Ra::Engine::Data::SimpleMaterial
static void loadMetaData (nlohmann::json &destination)
 Load the material parameter description.
 

Detailed Description

Implementation of the Lambertian Material BSDF.

This material implements a lambertian diffuse BSDF. 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 26 of file LambertianMaterial.hpp.

Constructor & Destructor Documentation

◆ LambertianMaterial()

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

Construct a named Lambertian material.

Parameters
instanceNameThe name of the material

Definition at line 18 of file LambertianMaterial.cpp.

Member Function Documentation

◆ getParametersMetadata()

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

Get a json containing metadata about the parameters.

Returns
the metadata in json format

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

Definition at line 68 of file LambertianMaterial.cpp.

◆ registerMaterial()

void Ra::Engine::Data::LambertianMaterial::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 21 of file LambertianMaterial.cpp.

+ Here is the call graph for this function:

◆ unregisterMaterial()

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

Remove the material from the material library.

After removal, the material is no more available, ...

Definition at line 58 of file LambertianMaterial.cpp.

◆ updateFromParameters()

void Ra::Engine::Data::LambertianMaterial::updateFromParameters ( )
overridevirtual

Update the attributes of the ShaderParameterProvider to their actual values stored in the renderParameters.

Reimplemented from Ra::Engine::Data::ShaderParameterProvider.

Definition at line 62 of file LambertianMaterial.cpp.

+ Here is the call graph for this function:

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