Radium Engine
1.5.20
|
#include <Engine/Data/BlinnPhongMaterial.hpp>
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::Color & | getDiffuseColor () |
const Core::Utils::Color & | getSpecularColor () |
Scalar | getSpecularExponent () |
bool | isRenderAsSplat () |
void | setAlpha (Scalar a) |
Scalar | getAlpha () |
Public Member Functions inherited from Ra::Engine::Data::Material | |
virtual | ~Material ()=default |
const std::string & | getInstanceName () const |
const std::string & | getMaterialName () const |
void | setMaterialAspect (const MaterialAspect &aspect) |
const MaterialAspect & | getMaterialAspect () const |
Get the aspect (MAT_OPAQUE or MAT_TRANSPARENT) of the material. | |
std::list< std::string > | getPropertyList () 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 RenderParameters & | getParameters () |
virtual const RenderParameters & | getParameters () 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. | |
Texture * | getTexture (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. | |
Implementation of the Blinn-Phong Material BSDF.
Definition at line 36 of file BlinnPhongMaterial.hpp.
Definition at line 44 of file BlinnPhongMaterial.hpp.
|
explicit |
Construct a named BlinnPhongMaterial.
instanceName | The name of this instance of the material |
Definition at line 19 of file BlinnPhongMaterial.cpp.
|
inline |
Definition at line 85 of file BlinnPhongMaterial.hpp.
|
inline |
Definition at line 80 of file BlinnPhongMaterial.hpp.
|
inlineoverridevirtual |
Get a json containing metadata about the parameters.
Implements Ra::Engine::Data::ParameterSetEditingInterface.
Definition at line 69 of file BlinnPhongMaterial.hpp.
|
inline |
Definition at line 81 of file BlinnPhongMaterial.hpp.
|
inline |
Definition at line 82 of file BlinnPhongMaterial.hpp.
|
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.
|
inline |
Definition at line 83 of file BlinnPhongMaterial.hpp.
|
overridevirtual |
Reimplemented from Ra::Engine::Data::Material.
Definition at line 65 of file BlinnPhongMaterial.cpp.
|
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.
|
inline |
Definition at line 142 of file BlinnPhongMaterial.hpp.
|
inlineoverridevirtual |
Makes the Material take its base color from the VERTEX_COLOR attribute of the rendered geometry.
state | activate (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.
|
inline |
Definition at line 130 of file BlinnPhongMaterial.hpp.
|
inline |
Definition at line 135 of file BlinnPhongMaterial.hpp.
|
inline |
Definition at line 125 of file BlinnPhongMaterial.hpp.
|
inline |
Definition at line 120 of file BlinnPhongMaterial.hpp.
|
static |
Remove the material from the material library. After removal, the material is no more available, ...
Definition at line 127 of file BlinnPhongMaterial.cpp.
|
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.
|
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.
|
friend |
Definition at line 41 of file BlinnPhongMaterial.hpp.