3#include <Core/Asset/MaterialData.hpp>
4#include <Core/Utils/Color.hpp>
5#include <Core/Utils/Log.hpp>
12class RA_CORE_API BlinnPhongMaterialData :
public MaterialData
15 explicit BlinnPhongMaterialData(
const std::string& name =
"" );
18 inline void displayInfo() const final;
21 inline
bool hasDiffuse() const;
23 inline
bool hasSpecular() const;
25 inline
bool hasShininess() const;
27 inline
bool hasOpacity() const;
29 inline
bool hasDiffuseTexture() const;
31 inline
bool hasSpecularTexture() const;
33 inline
bool hasShininessTexture() const;
35 inline
bool hasNormalTexture() const;
37 inline
bool hasOpacityTexture() const;
40 Core::Utils::Color m_diffuse;
41 Core::Utils::Color m_specular;
44 std::
string m_texDiffuse;
45 std::
string m_texSpecular;
46 std::
string m_texShininess;
47 std::
string m_texNormal;
48 std::
string m_texOpacity;
54 bool m_hasTexSpecular;
55 bool m_hasTexShininess;
63inline
bool BlinnPhongMaterialData::hasDiffuse()
const {
67inline bool BlinnPhongMaterialData::hasSpecular()
const {
71inline bool BlinnPhongMaterialData::hasShininess()
const {
72 return m_hasShininess;
75inline bool BlinnPhongMaterialData::hasOpacity()
const {
79inline bool BlinnPhongMaterialData::hasDiffuseTexture()
const {
80 return m_hasTexDiffuse;
83inline bool BlinnPhongMaterialData::hasSpecularTexture()
const {
84 return m_hasTexSpecular;
87inline bool BlinnPhongMaterialData::hasShininessTexture()
const {
88 return m_hasTexShininess;
91inline bool BlinnPhongMaterialData::hasNormalTexture()
const {
92 return m_hasTexNormal;
95inline bool BlinnPhongMaterialData::hasOpacityTexture()
const {
96 return m_hasTexOpacity;
100inline void BlinnPhongMaterialData::displayInfo()
const {
101 using namespace Core::Utils;
102 auto print = [](
bool ok,
const std::string& name,
const auto& value ) {
103 if ( ok ) { LOG( logINFO ) << name << value; }
104 else { LOG( logINFO ) << name <<
"NO"; }
107 LOG( logINFO ) <<
"======== MATERIAL INFO ========";
108 print( hasDiffuse(),
" Kd : ", m_diffuse.transpose() );
109 print( hasSpecular(),
" Ks : ", m_specular.transpose() );
110 print( hasShininess(),
" Ns : ", m_shininess );
111 print( hasOpacity(),
" Opacity : ", m_opacity );
112 print( hasDiffuseTexture(),
" Kd Texture : ", m_texDiffuse );
113 print( hasSpecularTexture(),
" Ks Texture : ", m_texSpecular );
114 print( hasShininessTexture(),
" Ns Texture : ", m_texShininess );
115 print( hasNormalTexture(),
" Normal Texture : ", m_texNormal );
116 print( hasOpacityTexture(),
" Alpha Texture : ", m_texOpacity );
hepler function to manage enum as underlying types in VariableSet