Fling Engine  0.00.1
Fling Engine is a game engine written in Vulkan
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | Friends
Fling::Material Class Reference

A material represents what properties should be given to a set of shaders. More...

#include <Material.h>

Inherits Fling::JsonFile.

Public Types

enum  Type : UINT8 { Type::Default, Type::Cubemap, Type::Reflection, Type::Debug }
 

Public Member Functions

 Material (Guid t_ID)
 
const PBRTexturesGetPBRTextures () const
 
Material::Type GetType () const
 
- Public Member Functions inherited from Fling::JsonFile
 JsonFile (Guid t_ID)
 Construct a new JsonFile object. More...
 
virtual ~JsonFile ()=default
 
FORCEINLINE nlohmann::json & GetJsonData ()
 Get a reference to the current JSON data that is loaded from this file. More...
 
void Write ()
 Write the contents of this JSON file out to given name. More...
 
- Public Member Functions inherited from Fling::Resource
 Resource (Fling::Guid t_ID)
 
virtual ~Resource ()=default
 
Fling::Guid_Handle GetGuidHandle () const
 Get GUID handle (just an int) for this resources guid. More...
 
const std::string & GetGuidString () const
 Get the human-readable string representation of this GUID. More...
 
std::string GetFilepathReleativeToAssets () const
 Returns the full file path that is relative to the assets path based on the GUID of this resource. More...
 

Static Public Member Functions

static std::shared_ptr< Fling::MaterialCreate (Guid t_ID)
 
static std::shared_ptr< Fling::MaterialGetDefaultMat ()
 
static Material::Type GetTypeFromStr (const std::string &t_Str)
 
static const std::string & GetStringFromType (const Material::Type)
 
- Static Public Member Functions inherited from Fling::JsonFile
static std::shared_ptr< Fling::JsonFileCreate (Guid t_ID)
 

Private Member Functions

void LoadMaterial ()
 

Private Attributes

PBRTextures m_Textures = {}
 
Material::Type m_Type = Type::Default
 
float m_Shininiess = 0.5f
 

Static Private Attributes

static std::unordered_map< std::string, Material::TypeTypeMap
 

Friends

class Renderer
 

Additional Inherited Members

- Protected Member Functions inherited from Fling::JsonFile
void LoadJsonFile ()
 Loads the JsonFile based on Guid path. More...
 
- Protected Attributes inherited from Fling::JsonFile
nlohmann::json m_JsonData
 
- Protected Attributes inherited from Fling::Resource
Fling::Guid m_Guid
 
std::string m_HumanReadableName
 

Detailed Description

A material represents what properties should be given to a set of shaders.

This is referenced by the MeshRednerer and Renderer::DrawFrame

Member Enumeration Documentation

◆ Type

Enumerator
Default 
Cubemap 
Reflection 
Debug 

Constructor & Destructor Documentation

◆ Material()

Fling::Material::Material ( Guid  t_ID)
explicit

Member Function Documentation

◆ Create()

std::shared_ptr< Fling::Material > Fling::Material::Create ( Guid  t_ID)
static

◆ GetDefaultMat()

std::shared_ptr< Fling::Material > Fling::Material::GetDefaultMat ( )
static

◆ GetPBRTextures()

const PBRTextures& Fling::Material::GetPBRTextures ( ) const
inline

◆ GetStringFromType()

const std::string & Fling::Material::GetStringFromType ( const Material::Type  t_Type)
static

◆ GetType()

Material::Type Fling::Material::GetType ( ) const
inline

◆ GetTypeFromStr()

Material::Type Fling::Material::GetTypeFromStr ( const std::string &  t_Str)
static

◆ LoadMaterial()

void Fling::Material::LoadMaterial ( )
private

Friends And Related Function Documentation

◆ Renderer

friend class Renderer
friend

Field Documentation

◆ m_Shininiess

float Fling::Material::m_Shininiess = 0.5f
private

◆ m_Textures

PBRTextures Fling::Material::m_Textures = {}
private

◆ m_Type

Material::Type Fling::Material::m_Type = Type::Default
private

◆ TypeMap

std::unordered_map< std::string, Material::Type > Fling::Material::TypeMap
staticprivate
Initial value:
=
{
{ "DEFAULT", Type::Default },
{ "CUBEMAP" , Type::Cubemap},
{ "REFLECTION", Type::Reflection },
{ "DEBUG", Type::Debug },
}

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