3#include <Core/Asset/MaterialData.hpp>
4#include <Core/CoreMacros.hpp>
5#include <Core/RaCore.hpp>
6#include <Core/Utils/Color.hpp>
7#include <Core/Utils/Log.hpp>
17class RA_CORE_API BlinnPhongMaterialData :
public MaterialData
20 explicit BlinnPhongMaterialData(
const std::string& name =
"" );
23 inline void displayInfo() const final;
26 inline
bool hasDiffuse() const;
28 inline
bool hasSpecular() const;
30 inline
bool hasShininess() const;
32 inline
bool hasOpacity() const;
34 inline
bool hasDiffuseTexture() const;
36 inline
bool hasSpecularTexture() const;
38 inline
bool hasShininessTexture() const;
40 inline
bool hasNormalTexture() const;
42 inline
bool hasOpacityTexture() const;
45 Core::Utils::Color m_diffuse;
46 Core::Utils::Color m_specular;
49 std::
string m_texDiffuse;
50 std::
string m_texSpecular;
51 std::
string m_texShininess;
52 std::
string m_texNormal;
53 std::
string m_texOpacity;
59 bool m_hasTexSpecular;
60 bool m_hasTexShininess;
68inline
bool BlinnPhongMaterialData::hasDiffuse()
const {
72inline bool BlinnPhongMaterialData::hasSpecular()
const {
76inline bool BlinnPhongMaterialData::hasShininess()
const {
77 return m_hasShininess;
80inline bool BlinnPhongMaterialData::hasOpacity()
const {
84inline bool BlinnPhongMaterialData::hasDiffuseTexture()
const {
85 return m_hasTexDiffuse;
88inline bool BlinnPhongMaterialData::hasSpecularTexture()
const {
89 return m_hasTexSpecular;
92inline bool BlinnPhongMaterialData::hasShininessTexture()
const {
93 return m_hasTexShininess;
96inline bool BlinnPhongMaterialData::hasNormalTexture()
const {
97 return m_hasTexNormal;
100inline bool BlinnPhongMaterialData::hasOpacityTexture()
const {
101 return m_hasTexOpacity;
105inline void BlinnPhongMaterialData::displayInfo()
const {
106 using namespace Core::Utils;
107 auto print = [](
bool ok,
const std::string& name,
const auto& value ) {
108 if ( ok ) { LOG( logINFO ) << name << value; }
109 else { LOG( logINFO ) << name <<
"NO"; }
112 LOG( logINFO ) <<
"======== MATERIAL INFO ========";
113 print( hasDiffuse(),
" Kd : ", m_diffuse.transpose() );
114 print( hasSpecular(),
" Ks : ", m_specular.transpose() );
115 print( hasShininess(),
" Ns : ", m_shininess );
116 print( hasOpacity(),
" Opacity : ", m_opacity );
117 print( hasDiffuseTexture(),
" Kd Texture : ", m_texDiffuse );
118 print( hasSpecularTexture(),
" Ks Texture : ", m_texSpecular );
119 print( hasShininessTexture(),
" Ns Texture : ", m_texShininess );
120 print( hasNormalTexture(),
" Normal Texture : ", m_texNormal );
121 print( hasOpacityTexture(),
" Alpha Texture : ", m_texOpacity );
hepler function to manage enum as underlying types in VariableSet