Polyphase Game Engine
Loading...
Searching...
No Matches
MaterialLite Class Reference

#include <MaterialLite.h>

Inheritance diagram for MaterialLite:
Material Asset Object

Public Member Functions

 DECLARE_ASSET (MaterialLite, Material)
 
 MaterialLite ()
 
 ~MaterialLite ()
 
virtual void LoadStream (Stream &stream, Platform platform) override
 
virtual void SaveStream (Stream &stream, Platform platform) override
 
virtual void Create () override
 
virtual void Destroy () override
 
virtual bool Import (const std::string &path, ImportOptions *options) override
 
virtual void GatherProperties (std::vector< Property > &outProps) override
 
virtual glm::vec4 GetTypeColor () override
 
virtual const char * GetTypeName () override
 
virtual bool DrawCustomProperty (Property &prop) override
 
virtual bool IsLite () const override
 
void SaveLiteParams (Stream &stream)
 
void LoadLiteParams (Stream &stream, uint32_t version)
 
virtual bool HasNodeGraph () const override
 
virtual NodeGraphGetNodeGraph () override
 
virtual void ApplyGraphValues (NodeGraph *graph) override
 
NodeGraphGetGraph ()
 
const NodeGraphGetGraph () const
 
void SetUseNodeGraph (bool use)
 
void ApplyGraphToParams ()
 
const MaterialLiteParamsGetLiteParams () const
 
void SetLiteParams (const MaterialLiteParams &params)
 
void SetTexture (uint32_t slot, Texture *texture)
 
TextureGetTexture (uint32_t slot)
 
ShadingModel GetShadingModel () const
 
void SetShadingModel (ShadingModel shadingModel)
 
virtual BlendMode GetBlendMode () const override
 
void SetBlendMode (BlendMode blendMode)
 
VertexColorMode GetVertexColorMode () const
 
void SetVertexColorMode (VertexColorMode mode)
 
glm::vec2 GetUvOffset (int32_t uvIndex=0) const
 
void SetUvOffset (glm::vec2 offset, int32_t uvIndex=0)
 
glm::vec2 GetUvScale (int32_t uvIndex=0) const
 
void SetUvScale (glm::vec2 scale, int32_t uvIndex=0)
 
glm::vec4 GetColor () const
 
void SetColor (const glm::vec4 &color)
 
glm::vec4 GetFresnelColor () const
 
void SetFresnelColor (const glm::vec4 &color)
 
float GetEmission () const
 
void SetEmission (float emission)
 
float GetWrapLighting () const
 
void SetWrapLighting (float wrapLighting)
 
float GetFresnelPower () const
 
void SetFresnelPower (float power)
 
float GetSpecular () const
 
void SetSpecular (float specular)
 
uint32_t GetToonSteps () const
 
void SetToonSteps (uint32_t steps)
 
float GetOpacity () const
 
void SetOpacity (float opacity)
 
virtual float GetMaskCutoff () const override
 
void SetMaskCutoff (float cutoff)
 
float GetShininess () const
 
void SetShininess (float shininess)
 
virtual int32_t GetSortPriority () const override
 
void SetSortPriority (int32_t priority)
 
virtual bool IsDepthTestDisabled () const override
 
void SetDepthTestDisabled (bool depthTest)
 
bool IsFresnelEnabled () const
 
void SetFresnelEnabled (bool enable)
 
virtual bool ShouldApplyFog () const override
 
void SetApplyFog (bool applyFog)
 
virtual CullMode GetCullMode () const override
 
void SetCullMode (CullMode cullMode)
 
uint32_t GetUvMap (uint32_t textureSlot)
 
void SetUvMap (uint32_t textureSlot, uint32_t uvMapIndex)
 
TevMode GetTevMode (uint32_t textureSlot)
 
void SetTevMode (uint32_t textureSlot, TevMode mode)
 
- Public Member Functions inherited from Material
 DECLARE_ASSET (Material, Asset)
 
virtual bool ShouldSnapshotForPie () const override
 
MaterialResourceGetResource ()
 
virtual bool IsBase () const
 
virtual bool IsInstance () const
 
MaterialLiteAsLite ()
 
std::vector< ShaderParameter > & GetParameters ()
 
void SetScalarParameter (const std::string &name, float value)
 
void SetVectorParameter (const std::string &name, glm::vec4 value)
 
void SetTextureParameter (const std::string &name, Texture *value)
 
float GetScalarParameter (const std::string &name)
 
glm::vec4 GetVectorParameter (const std::string &name)
 
TextureGetTextureParameter (const std::string &name)
 
void WriteShaderUniformParams (uint8_t *outData, uint32_t &outSize)
 
- Public Member Functions inherited from Asset
 DECLARE_FACTORY_MANAGER (Asset)
 
 DECLARE_FACTORY (Asset, Asset)
 
 DECLARE_OBJECT (Asset, Object)
 
 Asset ()
 
virtual ~Asset ()
 
virtual void Copy (Asset *srcAsset)
 
const std::string & GetName () const
 
bool IsLoaded () const
 
bool IsRefCounted () const
 
int32_t GetRefCount () const
 
bool IsEmbedded () const
 
void SetEmbedded (bool embed)
 
bool IsEngineAsset () const
 
void SetEngineAsset (bool engineAsset)
 
void SetName (const std::string &name)
 
void IncrementRefCount ()
 
void DecrementRefCount ()
 
void LoadFile (const char *path, AsyncLoadRequest *request=nullptr)
 
void LoadEmbedded (const EmbeddedFile *embeddedAsset, AsyncLoadRequest *request=nullptr)
 
void SaveFile (const char *path, Platform platform)
 
virtual const char * GetTypeImportExt ()
 
bool IsTransient () const
 
void SetTransient (bool transient)
 
uint64_t GetUuid () const
 
void SetUuid (uint64_t uuid)
 
void EnsureUuid ()
 
void WriteHeader (Stream &stream)
 
- Public Member Functions inherited from Object
virtual ~Object ()=default
 
virtual const char * RuntimeName () const =0
 
virtual const char * RuntimeParentName () const =0
 
virtual RuntimeId InstanceRuntimeId () const =0
 
virtual ObjectQueryInterface (RuntimeId id) const
 
virtual bool Is (RuntimeId id) const
 
virtual bool Is (const char *name) const
 
template<typename T >
T * As () const
 
virtual bool Equals (const Object *rhs) const
 

Static Public Member Functions

static MaterialLiteNew (Material *src=nullptr)
 
static bool HandlePropChange (Datum *datum, uint32_t index, const void *newValue)
 
- Static Public Member Functions inherited from Material
static MaterialLiteAsLite (Material *material)
 
static void OverwriteShaderParameters (std::vector< ShaderParameter > &dst, const std::vector< ShaderParameter > &src)
 
- Static Public Member Functions inherited from Asset
static AssetHeader ReadHeader (Stream &stream)
 
static std::string GetNameFromPath (const std::string &path)
 
static std::string GetDirectoryFromPath (const std::string &path)
 
static const char * GetNameFromTypeId (TypeId id)
 
static TypeId GetTypeIdFromName (const char *name)
 
- Static Public Member Functions inherited from Object
static const char * ClassRuntimeName ()
 

Protected Attributes

MaterialLiteParams mLiteParams
 
NodeGraph mGraph
 
bool mUseNodeGraph = false
 
- Protected Attributes inherited from Material
std::vector< ShaderParametermParameters
 
MaterialResource mResource
 
- Protected Attributes inherited from Asset
uint32_t mVersion = 0
 
TypeId mType = INVALID_TYPE_ID
 
uint64_t mUuid = 0
 
bool mEmbedded = false
 
bool mLoaded = false
 
bool mEnableRefCount = true
 
bool mEngineAsset = false
 
bool mTransient = false
 
std::string mName = "Asset"
 
int32_t mRefCount = 0
 

Constructor & Destructor Documentation

◆ MaterialLite()

MaterialLite::MaterialLite ( )

◆ ~MaterialLite()

MaterialLite::~MaterialLite ( )

Member Function Documentation

◆ ApplyGraphToParams()

void MaterialLite::ApplyGraphToParams ( )

◆ ApplyGraphValues()

void MaterialLite::ApplyGraphValues ( NodeGraph graph)
overridevirtual

Reimplemented from Material.

◆ Create()

void MaterialLite::Create ( )
overridevirtual

Reimplemented from Material.

◆ DECLARE_ASSET()

MaterialLite::DECLARE_ASSET ( MaterialLite  ,
Material   
)

◆ Destroy()

void MaterialLite::Destroy ( )
overridevirtual

Reimplemented from Material.

◆ DrawCustomProperty()

bool MaterialLite::DrawCustomProperty ( Property prop)
overridevirtual

Reimplemented from Object.

◆ GatherProperties()

void MaterialLite::GatherProperties ( std::vector< Property > &  outProps)
overridevirtual

Reimplemented from Material.

◆ GetBlendMode()

BlendMode MaterialLite::GetBlendMode ( ) const
overridevirtual

Reimplemented from Material.

◆ GetColor()

glm::vec4 MaterialLite::GetColor ( ) const

◆ GetCullMode()

CullMode MaterialLite::GetCullMode ( ) const
overridevirtual

Reimplemented from Material.

◆ GetEmission()

float MaterialLite::GetEmission ( ) const

◆ GetFresnelColor()

glm::vec4 MaterialLite::GetFresnelColor ( ) const

◆ GetFresnelPower()

float MaterialLite::GetFresnelPower ( ) const

◆ GetGraph() [1/2]

NodeGraph & MaterialLite::GetGraph ( )
inline

◆ GetGraph() [2/2]

const NodeGraph & MaterialLite::GetGraph ( ) const
inline

◆ GetLiteParams()

const MaterialLiteParams & MaterialLite::GetLiteParams ( ) const

◆ GetMaskCutoff()

float MaterialLite::GetMaskCutoff ( ) const
overridevirtual

Reimplemented from Material.

◆ GetNodeGraph()

virtual NodeGraph * MaterialLite::GetNodeGraph ( )
inlineoverridevirtual

Reimplemented from Material.

◆ GetOpacity()

float MaterialLite::GetOpacity ( ) const

◆ GetShadingModel()

ShadingModel MaterialLite::GetShadingModel ( ) const

◆ GetShininess()

float MaterialLite::GetShininess ( ) const

◆ GetSortPriority()

int32_t MaterialLite::GetSortPriority ( ) const
overridevirtual

Reimplemented from Material.

◆ GetSpecular()

float MaterialLite::GetSpecular ( ) const

◆ GetTevMode()

TevMode MaterialLite::GetTevMode ( uint32_t  textureSlot)

◆ GetTexture()

Texture * MaterialLite::GetTexture ( uint32_t  slot)

◆ GetToonSteps()

uint32_t MaterialLite::GetToonSteps ( ) const

◆ GetTypeColor()

glm::vec4 MaterialLite::GetTypeColor ( )
overridevirtual

Reimplemented from Material.

◆ GetTypeName()

const char * MaterialLite::GetTypeName ( )
overridevirtual

Reimplemented from Material.

◆ GetUvMap()

uint32_t MaterialLite::GetUvMap ( uint32_t  textureSlot)

◆ GetUvOffset()

glm::vec2 MaterialLite::GetUvOffset ( int32_t  uvIndex = 0) const

◆ GetUvScale()

glm::vec2 MaterialLite::GetUvScale ( int32_t  uvIndex = 0) const

◆ GetVertexColorMode()

VertexColorMode MaterialLite::GetVertexColorMode ( ) const

◆ GetWrapLighting()

float MaterialLite::GetWrapLighting ( ) const

◆ HandlePropChange()

bool MaterialLite::HandlePropChange ( Datum datum,
uint32_t  index,
const void *  newValue 
)
static

◆ HasNodeGraph()

virtual bool MaterialLite::HasNodeGraph ( ) const
inlineoverridevirtual

Reimplemented from Material.

◆ Import()

bool MaterialLite::Import ( const std::string &  path,
ImportOptions options 
)
overridevirtual

Reimplemented from Material.

◆ IsDepthTestDisabled()

bool MaterialLite::IsDepthTestDisabled ( ) const
overridevirtual

Reimplemented from Material.

◆ IsFresnelEnabled()

bool MaterialLite::IsFresnelEnabled ( ) const

◆ IsLite()

bool MaterialLite::IsLite ( ) const
overridevirtual

Reimplemented from Material.

◆ LoadLiteParams()

void MaterialLite::LoadLiteParams ( Stream stream,
uint32_t  version 
)

◆ LoadStream()

void MaterialLite::LoadStream ( Stream stream,
Platform  platform 
)
overridevirtual

Reimplemented from Material.

◆ New()

MaterialLite * MaterialLite::New ( Material src = nullptr)
static

◆ SaveLiteParams()

void MaterialLite::SaveLiteParams ( Stream stream)

◆ SaveStream()

void MaterialLite::SaveStream ( Stream stream,
Platform  platform 
)
overridevirtual

Reimplemented from Material.

◆ SetApplyFog()

void MaterialLite::SetApplyFog ( bool  applyFog)

◆ SetBlendMode()

void MaterialLite::SetBlendMode ( BlendMode  blendMode)

◆ SetColor()

void MaterialLite::SetColor ( const glm::vec4 &  color)

◆ SetCullMode()

void MaterialLite::SetCullMode ( CullMode  cullMode)

◆ SetDepthTestDisabled()

void MaterialLite::SetDepthTestDisabled ( bool  depthTest)

◆ SetEmission()

void MaterialLite::SetEmission ( float  emission)

◆ SetFresnelColor()

void MaterialLite::SetFresnelColor ( const glm::vec4 &  color)

◆ SetFresnelEnabled()

void MaterialLite::SetFresnelEnabled ( bool  enable)

◆ SetFresnelPower()

void MaterialLite::SetFresnelPower ( float  power)

◆ SetLiteParams()

void MaterialLite::SetLiteParams ( const MaterialLiteParams params)

◆ SetMaskCutoff()

void MaterialLite::SetMaskCutoff ( float  cutoff)

◆ SetOpacity()

void MaterialLite::SetOpacity ( float  opacity)

◆ SetShadingModel()

void MaterialLite::SetShadingModel ( ShadingModel  shadingModel)

◆ SetShininess()

void MaterialLite::SetShininess ( float  shininess)

◆ SetSortPriority()

void MaterialLite::SetSortPriority ( int32_t  priority)

◆ SetSpecular()

void MaterialLite::SetSpecular ( float  specular)

◆ SetTevMode()

void MaterialLite::SetTevMode ( uint32_t  textureSlot,
TevMode  mode 
)

◆ SetTexture()

void MaterialLite::SetTexture ( uint32_t  slot,
Texture texture 
)

◆ SetToonSteps()

void MaterialLite::SetToonSteps ( uint32_t  steps)

◆ SetUseNodeGraph()

void MaterialLite::SetUseNodeGraph ( bool  use)

◆ SetUvMap()

void MaterialLite::SetUvMap ( uint32_t  textureSlot,
uint32_t  uvMapIndex 
)

◆ SetUvOffset()

void MaterialLite::SetUvOffset ( glm::vec2  offset,
int32_t  uvIndex = 0 
)

◆ SetUvScale()

void MaterialLite::SetUvScale ( glm::vec2  scale,
int32_t  uvIndex = 0 
)

◆ SetVertexColorMode()

void MaterialLite::SetVertexColorMode ( VertexColorMode  mode)

◆ SetWrapLighting()

void MaterialLite::SetWrapLighting ( float  wrapLighting)

◆ ShouldApplyFog()

bool MaterialLite::ShouldApplyFog ( ) const
overridevirtual

Reimplemented from Material.

Member Data Documentation

◆ mGraph

NodeGraph MaterialLite::mGraph
protected

◆ mLiteParams

MaterialLiteParams MaterialLite::mLiteParams
protected

◆ mUseNodeGraph

bool MaterialLite::mUseNodeGraph = false
protected

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