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

[TextureSemantics] More...

#include <Engine/Data/BlinnPhongMaterial.hpp>

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

Public Types

using TextureSemantic = TextureSemantics::BlinnPhongMaterial
 
- Public Types inherited from Ra::Engine::Data::Material
enum class  MaterialAspect { MAT_OPAQUE , MAT_TRANSPARENT , MAT_DENSITY }
 Identifies the type of the material. More...
 

Public Member Functions

 BlinnPhongMaterial (const std::string &instanceName)
 Construct a named BlinnPhongMaterial.
 
void updateGL () override
 Update the OpenGL states used by the ShaderParameterProvider.
 
void updateFromParameters () override
 Update the attributes of the ShaderParameterProvider to their actual values stored in the renderParameters.
 
bool isTransparent () const override
 
nlohmann::json getParametersMetadata () const override
 Get a json containing metadata about the parameters.
 
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 setDiffuseColor (Core::Utils::Color c)
 
void setSpecularColor (Core::Utils::Color c)
 
void setSpecularExponent (Scalar n)
 
void setRenderAsSplat (bool state)
 
const Core::Utils::ColorgetDiffuseColor ()
 
const Core::Utils::ColorgetSpecularColor ()
 
Scalar getSpecularExponent ()
 
bool isRenderAsSplat ()
 
void setAlpha (Scalar a)
 
Scalar getAlpha ()
 
- 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.
 
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::BlinnPhongMaterial >
void addTexture (const TextureSemantics::BlinnPhongMaterial &semantic, const TextureManager::TextureHandle &texture)
 
void addTexture (const TextureSemantics::BlinnPhongMaterial &semantic, const TextureParameters &texture)
 Add texture to TextureManager fisrt, then to the texture set.
 
TexturegetTexture (const TextureSemantics::BlinnPhongMaterial &semantic) const
 Texture getter from semantic.
 

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.
 

Friends

class BlinnPhongMaterialConverter
 

Additional Inherited Members

- 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.
 

Detailed Description

[TextureSemantics]

Implementation of the Blinn-Phong Material BSDF.

Todo
due to "Material.glsl" interface modification, must test this version with all plugins, apps, ... that uses Radium Renderer

Definition at line 36 of file BlinnPhongMaterial.hpp.

Member Typedef Documentation

◆ TextureSemantic

Constructor & Destructor Documentation

◆ BlinnPhongMaterial()

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

Construct a named BlinnPhongMaterial.

Parameters
instanceNameThe name of this instance of the material

Definition at line 19 of file BlinnPhongMaterial.cpp.

Member Function Documentation

◆ getAlpha()

Scalar Ra::Engine::Data::BlinnPhongMaterial::getAlpha ( )
inline

Definition at line 85 of file BlinnPhongMaterial.hpp.

◆ getDiffuseColor()

const Core::Utils::Color & Ra::Engine::Data::BlinnPhongMaterial::getDiffuseColor ( )
inline

Definition at line 80 of file BlinnPhongMaterial.hpp.

◆ getParametersMetadata()

nlohmann::json Ra::Engine::Data::BlinnPhongMaterial::getParametersMetadata ( ) const
inlineoverridevirtual

Get a json containing metadata about the parameters.

Returns
the metadata in json format

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

Definition at line 69 of file BlinnPhongMaterial.hpp.

◆ getSpecularColor()

const Core::Utils::Color & Ra::Engine::Data::BlinnPhongMaterial::getSpecularColor ( )
inline

Definition at line 81 of file BlinnPhongMaterial.hpp.

◆ getSpecularExponent()

Scalar Ra::Engine::Data::BlinnPhongMaterial::getSpecularExponent ( )
inline

Definition at line 82 of file BlinnPhongMaterial.hpp.

◆ isColoredByVertexAttrib()

bool Ra::Engine::Data::BlinnPhongMaterial::isColoredByVertexAttrib ( ) const
inlineoverridevirtual

Indicates if the material takes the VERTEX_COLOR attribute into account.

Reimplemented from Ra::Engine::Data::Material.

Definition at line 73 of file BlinnPhongMaterial.hpp.

◆ isRenderAsSplat()

bool Ra::Engine::Data::BlinnPhongMaterial::isRenderAsSplat ( )
inline

Definition at line 83 of file BlinnPhongMaterial.hpp.

◆ isTransparent()

bool Ra::Engine::Data::BlinnPhongMaterial::isTransparent ( ) const
overridevirtual
Returns
true if the material is transparent.

Reimplemented from Ra::Engine::Data::Material.

Definition at line 65 of file BlinnPhongMaterial.cpp.

+ Here is the call graph for this function:

◆ registerMaterial()

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

+ Here is the call graph for this function:

◆ setAlpha()

void Ra::Engine::Data::BlinnPhongMaterial::setAlpha ( Scalar a)
inline

Definition at line 142 of file BlinnPhongMaterial.hpp.

◆ setColoredByVertexAttrib()

void Ra::Engine::Data::BlinnPhongMaterial::setColoredByVertexAttrib ( bool state)
inlineoverridevirtual

Makes the Material take its base color from the VERTEX_COLOR attribute of the rendered geometry.

Parameters
stateactivate (true) or deactivate (false) VERTEX_COLOR attribute usage

Any material that support per-vertex color parameterization should implement this method accordingly

Reimplemented from Ra::Engine::Data::Material.

Definition at line 113 of file BlinnPhongMaterial.hpp.

+ Here is the call graph for this function:

◆ setDiffuseColor()

void Ra::Engine::Data::BlinnPhongMaterial::setDiffuseColor ( Core::Utils::Color c)
inline

Definition at line 130 of file BlinnPhongMaterial.hpp.

◆ setRenderAsSplat()

void Ra::Engine::Data::BlinnPhongMaterial::setRenderAsSplat ( bool state)
inline

Definition at line 135 of file BlinnPhongMaterial.hpp.

◆ setSpecularColor()

void Ra::Engine::Data::BlinnPhongMaterial::setSpecularColor ( Core::Utils::Color c)
inline

Definition at line 125 of file BlinnPhongMaterial.hpp.

◆ setSpecularExponent()

void Ra::Engine::Data::BlinnPhongMaterial::setSpecularExponent ( Scalar n)
inline

Definition at line 120 of file BlinnPhongMaterial.hpp.

◆ unregisterMaterial()

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

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

Definition at line 127 of file BlinnPhongMaterial.cpp.

+ Here is the call graph for this function:

◆ updateFromParameters()

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

◆ updateGL()

void Ra::Engine::Data::BlinnPhongMaterial::updateGL ( )
overridevirtual

Update the OpenGL states used by the ShaderParameterProvider.

These state could be the ones from an associated material (textures, precomputed tables or whatever data associated to the material) or some parameters that are specific to the provider semantic.

Implements Ra::Engine::Data::ShaderParameterProvider.

Definition at line 48 of file BlinnPhongMaterial.cpp.

+ Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ BlinnPhongMaterialConverter

friend class BlinnPhongMaterialConverter
friend

Definition at line 41 of file BlinnPhongMaterial.hpp.


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