Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
Divide::Material Class Referencefinal

#include <Material.h>

+ Inheritance diagram for Divide::Material:

Classes

struct  Properties
 
struct  RenderStateBlockEntry
 
struct  ShaderData
 
struct  TextureInfo
 

Public Types

enum class  UpdatePriority : U8 { Default , Medium , High , COUNT }
 
using SpecularGlossiness = vec2< F32 >
 
using ComputeShaderCBK = DELEGATE_STD< ShaderProgramDescriptor, Material *, RenderStagePass >
 
using ComputeRenderStateCBK = DELEGATE_STD< void, Material *, RenderStagePass, RenderStateBlock & >
 
using RecomputeShadersCBK = DELEGATE_STD< void >
 
template<typename T >
using StatesPerVariant = eastl::array< T, to_base(RenderStagePass::VariantType::COUNT)>
 
template<typename T >
using StateVariantsPerPass = eastl::array< StatesPerVariant< T >, to_base(RenderPassType::COUNT)>
 
template<typename T >
using StatePassesPerStage = eastl::array< StateVariantsPerPass< T >, to_base(RenderStage::COUNT)>
 

Public Member Functions

 Material (const ResourceDescriptor< Material > &descriptor)
 
Handle< Materialclone (const std::string_view nameSuffix)
 Return a new instance of this material with the name composed of the base material's name and the give name suffix (clone calls CreateResource internally!).
 
bool load (PlatformContext &context) override
 Loading and unloading interface.
 
bool unload () override
 
U32 update (U64 deltaTimeUS)
 Returns a bit mask composed of UpdateResult flags.
 
void rebuild ()
 
void clearRenderStates ()
 
void updateCullState ()
 
void setPipelineLayout (PrimitiveTopology topology, const AttributeMap &shaderAttributes)
 
bool setSampler (TextureSlot textureUsageSlot, SamplerDescriptor sampler)
 
bool setTexture (TextureSlot textureUsageSlot, Handle< Texture > texture, SamplerDescriptor sampler, TextureOperation op, bool useInGeometryPasses=false)
 
bool setTexture (TextureSlot textureUsageSlot, const ResourceDescriptor< Texture > &texture, SamplerDescriptor sampler, TextureOperation op, bool useInGeometryPasses=false)
 
void setTextureOperation (TextureSlot textureUsageSlot, TextureOperation op)
 
void lockInstancesForRead () const noexcept
 
void unlockInstancesForRead () const noexcept
 
void lockInstancesForWrite () const noexcept
 
void unlockInstancesForWrite () const noexcept
 
const vector< Handle< Material > > & getInstancesLocked () const noexcept
 
const vector< Handle< Material > > & getInstances () const
 
void setRenderStateBlock (const RenderStateBlock &renderStateBlock, RenderStage stage, RenderPassType pass, RenderStagePass::VariantType variant=RenderStagePass::VariantType::COUNT)
 
void getData (U32 bestProbeID, NodeMaterialData &dataOut)
 
FColour4 getBaseColour (bool &hasTextureOverride, Handle< Texture > &textureOut) const noexcept
 
FColour3 getEmissive (bool &hasTextureOverride, Handle< Texture > &textureOut) const noexcept
 
FColour3 getAmbient (bool &hasTextureOverride, Handle< Texture > &textureOut) const noexcept
 
FColour3 getSpecular (bool &hasTextureOverride, Handle< Texture > &textureOut) const noexcept
 
F32 getMetallic (bool &hasTextureOverride, Handle< Texture > &textureOut) const noexcept
 
F32 getRoughness (bool &hasTextureOverride, Handle< Texture > &textureOut) const noexcept
 
F32 getOcclusion (bool &hasTextureOverride, Handle< Texture > &textureOut) const noexcept
 
const TextureInfogetTextureInfo (TextureSlot usage) const
 
const RenderStateBlockgetOrCreateRenderStateBlock (RenderStagePass renderStagePass)
 
Handle< TexturegetTexture (TextureSlot textureUsage) const
 
DescriptorSetgetDescriptorSet (const RenderStagePass &renderStagePass)
 
Handle< ShaderProgramgetProgramHandle (RenderStagePass renderStagePass) const
 
Handle< ShaderProgramcomputeAndGetProgramHandle (RenderStagePass renderStagePass)
 
bool hasTransparency () const noexcept
 
bool isReflective () const noexcept
 
bool isRefractive () const noexcept
 
bool canDraw (RenderStagePass renderStagePass, bool &shaderJustFinishedLoading)
 
const ModuleDefinesshaderDefines (ShaderType type) const
 
void addShaderDefine (ShaderType type, const string &define, bool addPrefix)
 
void saveToXML (const std::string &entryName, boost::property_tree::ptree &pt) const
 
void loadFromXML (const std::string &entryName, const boost::property_tree::ptree &pt)
 
 PROPERTY_RW (Properties, properties)
 
 PROPERTY_RW (ShaderData, baseShaderData)
 
 PROPERTY_RW (ComputeShaderCBK, computeShaderCBK)
 
 PROPERTY_RW (ComputeRenderStateCBK, computeRenderStateCBK)
 
 PROPERTY_RW (RecomputeShadersCBK, recomputeShadersCBK)
 
 POINTER_R_IW (Material, baseMaterial, nullptr)
 
 PROPERTY_RW (UpdatePriority, updatePriorirty, UpdatePriority::Default)
 
 PROPERTY_R_IW (DescriptorSet, descriptorSetSecondaryPass)
 
 PROPERTY_R_IW (DescriptorSet, descriptorSetMainPass)
 
 PROPERTY_R_IW (DescriptorSet, descriptorSetPrePass)
 
 PROPERTY_R_IW (DescriptorSet, descriptorSetShadow)
 
 PROPERTY_RW (bool, ignoreXMLData, false)
 
 PROPERTY_RW (bool, ignoreShaderCache, false)
 Useful for debugging.
 
 PROPERTY_R_IW (AttributeMap, shaderAttributes)
 
 PROPERTY_R_IW (PrimitiveTopology, topology, PrimitiveTopology::COUNT)
 
- Public Member Functions inherited from Divide::CachedResource
 CachedResource (const ResourceDescriptorBase &descriptor, std::string_view typeName)
 
virtual bool load (PlatformContext &context)
 Loading and unloading interface.
 
virtual bool postLoad ()
 
virtual bool unload ()
 
void setState (ResourceState currentState) final
 
- Public Member Functions inherited from Divide::Resource
 Resource (std::string_view resourceName, std::string_view typeName)
 
ResourceState getState () const noexcept
 
 PROPERTY_R (Str< 32 >, typeName)
 
 PROPERTY_R (Str< 256 >, resourceName)
 
- Public Member Functions inherited from Divide::GUIDWrapper
 GUIDWrapper () noexcept
 
 GUIDWrapper (const GUIDWrapper &old) noexcept
 
 GUIDWrapper (GUIDWrapper &&old) noexcept
 
virtual ~GUIDWrapper ()=default
 
FORCE_INLINE I64 getGUID () const noexcept
 
GUIDWrapperoperator= (const GUIDWrapper &old)=delete
 
GUIDWrapperoperator= (GUIDWrapper &&other)=delete
 

Static Public Member Functions

static void OnStartup ()
 
static void OnShutdown ()
 
static void RecomputeShaders ()
 
static void Update (U64 deltaTimeUS)
 
- Static Public Member Functions inherited from Divide::GUIDWrapper
static I64 generateGUID () noexcept
 

Static Public Attributes

static constexpr F32 MAX_SHININESS = 255.f
 

Private Member Functions

void getSortKeys (RenderStagePass renderStagePass, I64 &shaderKey, I64 &textureKey, bool &transparencyFlag) const
 
void addShaderDefineInternal (ShaderType type, const string &define, bool addPrefix)
 
void updateTransparency ()
 
void recomputeShaders ()
 
void setShaderProgramInternal (ShaderProgramDescriptor shaderDescriptor, RenderStagePass stagePass)
 
void computeAndAppendShaderDefines (ShaderProgramDescriptor &shaderDescriptor, RenderStagePass renderStagePass) const
 
ShaderProgramInfoshaderInfo (RenderStagePass renderStagePass)
 
const ShaderProgramInfoshaderInfo (RenderStagePass renderStagePass) const
 
void saveRenderStatesToXML (const std::string &entryName, boost::property_tree::ptree &pt) const
 
void loadRenderStatesFromXML (const std::string &entryName, const boost::property_tree::ptree &pt)
 
void saveTextureDataToXML (const std::string &entryName, boost::property_tree::ptree &pt) const
 
void loadTextureDataFromXML (const std::string &entryName, const boost::property_tree::ptree &pt)
 
bool setTextureLocked (TextureSlot textureUsageSlot, Handle< Texture > texture, SamplerDescriptor sampler, TextureOperation op, bool useInGeometryPasses)
 
bool setTextureLocked (TextureSlot textureUsageSlot, const ResourceDescriptor< Texture > &texture, SamplerDescriptor sampler, TextureOperation op, bool useInGeometryPasses)
 
bool usesTextureInShader (TextureSlot slot, bool isPrePass, bool isShadowPass) const noexcept
 

Private Attributes

GFXDevice_context = nullptr
 
StatePassesPerStage< ShaderProgramInfo_shaderInfo {}
 
StatePassesPerStage< RenderStateBlockEntry_defaultRenderStates {}
 
std::array< ModuleDefines, to_base(ShaderType::COUNT)> _extraShaderDefines {}
 
SharedMutex _textureLock {}
 
SharedMutex _instanceLock
 
vector< Handle< Material > > _instances {}
 
std::array< TextureInfo, to_base(TextureSlot::COUNT)> _textures
 
size_t _shaderAttributesHash { 0u }
 

Static Private Attributes

static bool s_shadersDirty = false
 

Friends

class Attorney::MaterialRenderBin
 

Additional Inherited Members

- Protected Member Functions inherited from Divide::CachedResource
 PROPERTY_RW (ResourcePath, assetLocation)
 
 PROPERTY_RW (Str< 256 >, assetName)
 
 PROPERTY_R (size_t, descriptorHash)
 
virtual void setState (ResourceState currentState)
 
- Protected Attributes inherited from Divide::CachedResource
Mutex _callbackLock {}
 
- Protected Attributes inherited from Divide::Resource
std::atomic< ResourceState_resourceState
 
- Protected Attributes inherited from Divide::GUIDWrapper
const I64 _guid
 

Detailed Description

Definition at line 125 of file Material.h.

Member Typedef Documentation

◆ ComputeRenderStateCBK

◆ ComputeShaderCBK

◆ RecomputeShadersCBK

Definition at line 134 of file Material.h.

◆ SpecularGlossiness

Definition at line 131 of file Material.h.

◆ StatePassesPerStage

Definition at line 138 of file Material.h.

◆ StatesPerVariant

template<typename T >
using Divide::Material::StatesPerVariant = eastl::array<T, to_base(RenderStagePass::VariantType::COUNT)>

Definition at line 136 of file Material.h.

◆ StateVariantsPerPass

Definition at line 137 of file Material.h.

Member Enumeration Documentation

◆ UpdatePriority

enum class Divide::Material::UpdatePriority : U8
strong
Enumerator
Default 
Medium 
High 
COUNT 

Definition at line 140 of file Material.h.

Constructor & Destructor Documentation

◆ Material()

Divide::Material::Material ( const ResourceDescriptor< Material > &  descriptor)
explicit

Definition at line 141 of file Material.cpp.

Member Function Documentation

◆ addShaderDefine()

void Divide::Material::addShaderDefine ( ShaderType  type,
const string define,
bool  addPrefix = true 
)
inline

Definition at line 102 of file Material.inl.

◆ addShaderDefineInternal()

void Divide::Material::addShaderDefineInternal ( ShaderType  type,
const string define,
bool  addPrefix 
)
inlineprivate

Definition at line 122 of file Material.inl.

◆ canDraw()

bool Divide::Material::canDraw ( RenderStagePass  renderStagePass,
bool &  shaderJustFinishedLoading 
)

Definition at line 554 of file Material.cpp.

◆ clearRenderStates()

void Divide::Material::clearRenderStates ( )

Definition at line 301 of file Material.cpp.

◆ clone()

Handle< Material > Divide::Material::clone ( const std::string_view  nameSuffix)

Return a new instance of this material with the name composed of the base material's name and the give name suffix (clone calls CreateResource internally!).

Definition at line 222 of file Material.cpp.

◆ computeAndAppendShaderDefines()

void Divide::Material::computeAndAppendShaderDefines ( ShaderProgramDescriptor shaderDescriptor,
RenderStagePass  renderStagePass 
) const
private

Definition at line 607 of file Material.cpp.

◆ computeAndGetProgramHandle()

Handle< ShaderProgram > Divide::Material::computeAndGetProgramHandle ( RenderStagePass  renderStagePass)

Definition at line 516 of file Material.cpp.

◆ getAmbient()

FColour3 Divide::Material::getAmbient ( bool &  hasTextureOverride,
Handle< Texture > &  textureOut 
) const
noexcept

Definition at line 1034 of file Material.cpp.

◆ getBaseColour()

FColour4 Divide::Material::getBaseColour ( bool &  hasTextureOverride,
Handle< Texture > &  textureOut 
) const
noexcept

Definition at line 1010 of file Material.cpp.

◆ getData()

void Divide::Material::getData ( U32  bestProbeID,
NodeMaterialData dataOut 
)

< For PHONG_SPECULAR

Definition at line 1086 of file Material.cpp.

◆ getDescriptorSet()

DescriptorSet & Divide::Material::getDescriptorSet ( const RenderStagePass renderStagePass)

Definition at line 1127 of file Material.cpp.

◆ getEmissive()

FColour3 Divide::Material::getEmissive ( bool &  hasTextureOverride,
Handle< Texture > &  textureOut 
) const
noexcept

Definition at line 1022 of file Material.cpp.

◆ getInstances()

const vector< Handle< Material > > & Divide::Material::getInstances ( ) const
inline

Definition at line 62 of file Material.inl.

◆ getInstancesLocked()

const vector< Handle< Material > > & Divide::Material::getInstancesLocked ( ) const
inlinenoexcept

Definition at line 57 of file Material.inl.

◆ getMetallic()

F32 Divide::Material::getMetallic ( bool &  hasTextureOverride,
Handle< Texture > &  textureOut 
) const
noexcept

Definition at line 1053 of file Material.cpp.

◆ getOcclusion()

F32 Divide::Material::getOcclusion ( bool &  hasTextureOverride,
Handle< Texture > &  textureOut 
) const
noexcept

Definition at line 1075 of file Material.cpp.

◆ getOrCreateRenderStateBlock()

const RenderStateBlock & Divide::Material::getOrCreateRenderStateBlock ( RenderStagePass  renderStagePass)

Definition at line 940 of file Material.cpp.

◆ getProgramHandle()

Handle< ShaderProgram > Divide::Material::getProgramHandle ( RenderStagePass  renderStagePass) const

Definition at line 539 of file Material.cpp.

◆ getRoughness()

F32 Divide::Material::getRoughness ( bool &  hasTextureOverride,
Handle< Texture > &  textureOut 
) const
noexcept

Definition at line 1064 of file Material.cpp.

◆ getSortKeys()

void Divide::Material::getSortKeys ( RenderStagePass  renderStagePass,
I64 shaderKey,
I64 textureKey,
bool &  transparencyFlag 
) const
private

Definition at line 995 of file Material.cpp.

◆ getSpecular()

FColour3 Divide::Material::getSpecular ( bool &  hasTextureOverride,
Handle< Texture > &  textureOut 
) const
noexcept

Definition at line 1042 of file Material.cpp.

◆ getTexture()

Handle< Texture > Divide::Material::getTexture ( TextureSlot  textureUsage) const
inline

Definition at line 68 of file Material.inl.

◆ getTextureInfo()

const Material::TextureInfo & Divide::Material::getTextureInfo ( TextureSlot  usage) const
inline

Definition at line 117 of file Material.inl.

◆ hasTransparency()

bool Divide::Material::hasTransparency ( ) const
inlinenoexcept

Definition at line 74 of file Material.inl.

◆ isReflective()

bool Divide::Material::isReflective ( ) const
inlinenoexcept

Definition at line 80 of file Material.inl.

◆ isRefractive()

bool Divide::Material::isRefractive ( ) const
inlinenoexcept

Definition at line 86 of file Material.inl.

◆ load()

bool Divide::Material::load ( PlatformContext context)
overridevirtual

Loading and unloading interface.

Reimplemented from Divide::CachedResource.

Definition at line 214 of file Material.cpp.

◆ loadFromXML()

void Divide::Material::loadFromXML ( const std::string &  entryName,
const boost::property_tree::ptree &  pt 
)

Definition at line 1192 of file Material.cpp.

◆ loadRenderStatesFromXML()

void Divide::Material::loadRenderStatesFromXML ( const std::string &  entryName,
const boost::property_tree::ptree &  pt 
)
private

Definition at line 1255 of file Material.cpp.

◆ loadTextureDataFromXML()

void Divide::Material::loadTextureDataFromXML ( const std::string &  entryName,
const boost::property_tree::ptree &  pt 
)
private

Definition at line 1324 of file Material.cpp.

◆ lockInstancesForRead()

void Divide::Material::lockInstancesForRead ( ) const
inlinenoexcept

Definition at line 37 of file Material.inl.

◆ lockInstancesForWrite()

void Divide::Material::lockInstancesForWrite ( ) const
inlinenoexcept

Definition at line 47 of file Material.inl.

◆ OnShutdown()

void Divide::Material::OnShutdown ( )
static

Definition at line 126 of file Material.cpp.

◆ OnStartup()

void Divide::Material::OnStartup ( )
static

Definition at line 121 of file Material.cpp.

◆ POINTER_R_IW()

Divide::Material::POINTER_R_IW ( Material  ,
baseMaterial  ,
nullptr   
)

◆ PROPERTY_R_IW() [1/6]

Divide::Material::PROPERTY_R_IW ( AttributeMap  ,
shaderAttributes   
)

◆ PROPERTY_R_IW() [2/6]

Divide::Material::PROPERTY_R_IW ( DescriptorSet  ,
descriptorSetMainPass   
)

◆ PROPERTY_R_IW() [3/6]

Divide::Material::PROPERTY_R_IW ( DescriptorSet  ,
descriptorSetPrePass   
)

◆ PROPERTY_R_IW() [4/6]

Divide::Material::PROPERTY_R_IW ( DescriptorSet  ,
descriptorSetSecondaryPass   
)

◆ PROPERTY_R_IW() [5/6]

Divide::Material::PROPERTY_R_IW ( DescriptorSet  ,
descriptorSetShadow   
)

◆ PROPERTY_R_IW() [6/6]

Divide::Material::PROPERTY_R_IW ( PrimitiveTopology  ,
topology  ,
PrimitiveTopology::COUNT   
)

◆ PROPERTY_RW() [1/8]

Divide::Material::PROPERTY_RW ( bool  ,
ignoreShaderCache  ,
false   
)

Useful for debugging.

◆ PROPERTY_RW() [2/8]

Divide::Material::PROPERTY_RW ( bool  ,
ignoreXMLData  ,
false   
)

◆ PROPERTY_RW() [3/8]

Divide::Material::PROPERTY_RW ( ComputeRenderStateCBK  ,
computeRenderStateCBK   
)

◆ PROPERTY_RW() [4/8]

Divide::Material::PROPERTY_RW ( ComputeShaderCBK  ,
computeShaderCBK   
)

◆ PROPERTY_RW() [5/8]

Divide::Material::PROPERTY_RW ( Properties  ,
properties   
)

◆ PROPERTY_RW() [6/8]

Divide::Material::PROPERTY_RW ( RecomputeShadersCBK  ,
recomputeShadersCBK   
)

◆ PROPERTY_RW() [7/8]

Divide::Material::PROPERTY_RW ( ShaderData  ,
baseShaderData   
)

◆ PROPERTY_RW() [8/8]

Divide::Material::PROPERTY_RW ( UpdatePriority  ,
updatePriorirty  ,
UpdatePriority::Default   
)

◆ rebuild()

void Divide::Material::rebuild ( )

Definition at line 1162 of file Material.cpp.

◆ RecomputeShaders()

void Divide::Material::RecomputeShaders ( )
static

Definition at line 131 of file Material.cpp.

◆ recomputeShaders()

void Divide::Material::recomputeShaders ( )
private

Definition at line 488 of file Material.cpp.

◆ saveRenderStatesToXML()

void Divide::Material::saveRenderStatesToXML ( const std::string &  entryName,
boost::property_tree::ptree &  pt 
) const
private

Definition at line 1211 of file Material.cpp.

◆ saveTextureDataToXML()

void Divide::Material::saveTextureDataToXML ( const std::string &  entryName,
boost::property_tree::ptree &  pt 
) const
private

Definition at line 1287 of file Material.cpp.

◆ saveToXML()

void Divide::Material::saveToXML ( const std::string &  entryName,
boost::property_tree::ptree &  pt 
) const

Definition at line 1183 of file Material.cpp.

◆ setPipelineLayout()

void Divide::Material::setPipelineLayout ( PrimitiveTopology  topology,
const AttributeMap shaderAttributes 
)

Definition at line 331 of file Material.cpp.

◆ setRenderStateBlock()

void Divide::Material::setRenderStateBlock ( const RenderStateBlock renderStateBlock,
RenderStage  stage,
RenderPassType  pass,
RenderStagePass::VariantType  variant = RenderStagePass::VariantType::COUNT 
)

Add the specified renderStateBlock to specific RenderStagePass parameters. Use "COUNT" and/or "g_AllVariantsID" for global options e.g. a RenderPassType::COUNT will use the block in the specified stage+variant combo but for all of the passes

Definition at line 883 of file Material.cpp.

◆ setSampler()

bool Divide::Material::setSampler ( TextureSlot  textureUsageSlot,
SamplerDescriptor  sampler 
)

Definition at line 348 of file Material.cpp.

◆ setShaderProgramInternal()

void Divide::Material::setShaderProgramInternal ( ShaderProgramDescriptor  shaderDescriptor,
RenderStagePass  stagePass 
)
private

Definition at line 437 of file Material.cpp.

◆ setTexture() [1/2]

bool Divide::Material::setTexture ( TextureSlot  textureUsageSlot,
const ResourceDescriptor< Texture > &  texture,
SamplerDescriptor  sampler,
TextureOperation  op,
bool  useInGeometryPasses = false 
)

Definition at line 405 of file Material.cpp.

◆ setTexture() [2/2]

bool Divide::Material::setTexture ( TextureSlot  textureUsageSlot,
Handle< Texture texture,
SamplerDescriptor  sampler,
TextureOperation  op,
bool  useInGeometryPasses = false 
)

Definition at line 415 of file Material.cpp.

◆ setTextureLocked() [1/2]

bool Divide::Material::setTextureLocked ( TextureSlot  textureUsageSlot,
const ResourceDescriptor< Texture > &  texture,
SamplerDescriptor  sampler,
TextureOperation  op,
bool  useInGeometryPasses 
)
private

Definition at line 355 of file Material.cpp.

◆ setTextureLocked() [2/2]

bool Divide::Material::setTextureLocked ( TextureSlot  textureUsageSlot,
Handle< Texture texture,
SamplerDescriptor  sampler,
TextureOperation  op,
bool  useInGeometryPasses 
)
private

Definition at line 360 of file Material.cpp.

◆ setTextureOperation()

void Divide::Material::setTextureOperation ( TextureSlot  textureUsageSlot,
TextureOperation  op 
)

Definition at line 425 of file Material.cpp.

◆ shaderDefines()

const ModuleDefines & Divide::Material::shaderDefines ( ShaderType  type) const
inline

Definition at line 138 of file Material.inl.

◆ shaderInfo() [1/2]

ShaderProgramInfo & Divide::Material::shaderInfo ( RenderStagePass  renderStagePass)
inlineprivate

Definition at line 92 of file Material.inl.

◆ shaderInfo() [2/2]

const ShaderProgramInfo & Divide::Material::shaderInfo ( RenderStagePass  renderStagePass) const
inlineprivate

Definition at line 97 of file Material.inl.

◆ unload()

bool Divide::Material::unload ( )
overridevirtual

Reimplemented from Divide::CachedResource.

Definition at line 843 of file Material.cpp.

◆ unlockInstancesForRead()

void Divide::Material::unlockInstancesForRead ( ) const
inlinenoexcept

Definition at line 42 of file Material.inl.

◆ unlockInstancesForWrite()

void Divide::Material::unlockInstancesForWrite ( ) const
inlinenoexcept

Definition at line 52 of file Material.inl.

◆ Update()

void Divide::Material::Update ( U64  deltaTimeUS)
static

Definition at line 136 of file Material.cpp.

◆ update()

U32 Divide::Material::update ( U64  deltaTimeUS)

Returns a bit mask composed of UpdateResult flags.

Definition at line 276 of file Material.cpp.

◆ updateCullState()

void Divide::Material::updateCullState ( )

Definition at line 313 of file Material.cpp.

◆ updateTransparency()

void Divide::Material::updateTransparency ( )
private

Definition at line 906 of file Material.cpp.

◆ usesTextureInShader()

bool Divide::Material::usesTextureInShader ( TextureSlot  slot,
bool  isPrePass,
bool  isShadowPass 
) const
privatenoexcept

Definition at line 785 of file Material.cpp.

Friends And Related Function Documentation

◆ Attorney::MaterialRenderBin

friend class Attorney::MaterialRenderBin
friend

Definition at line 126 of file Material.h.

Member Data Documentation

◆ _context

GFXDevice* Divide::Material::_context = nullptr
private

Definition at line 362 of file Material.h.

◆ _defaultRenderStates

StatePassesPerStage<RenderStateBlockEntry> Divide::Material::_defaultRenderStates {}
private

Definition at line 371 of file Material.h.

◆ _extraShaderDefines

std::array<ModuleDefines, to_base(ShaderType::COUNT)> Divide::Material::_extraShaderDefines {}
private

Definition at line 373 of file Material.h.

◆ _instanceLock

SharedMutex Divide::Material::_instanceLock
mutableprivate

Definition at line 376 of file Material.h.

◆ _instances

vector<Handle<Material> > Divide::Material::_instances {}
private

Definition at line 377 of file Material.h.

◆ _shaderAttributesHash

size_t Divide::Material::_shaderAttributesHash { 0u }
private

Definition at line 381 of file Material.h.

◆ _shaderInfo

StatePassesPerStage<ShaderProgramInfo> Divide::Material::_shaderInfo {}
private

Definition at line 370 of file Material.h.

◆ _textureLock

SharedMutex Divide::Material::_textureLock {}
mutableprivate

Definition at line 374 of file Material.h.

◆ _textures

std::array<TextureInfo, to_base(TextureSlot::COUNT)> Divide::Material::_textures
private

Definition at line 379 of file Material.h.

◆ MAX_SHININESS

constexpr F32 Divide::Material::MAX_SHININESS = 255.f
staticconstexpr

Definition at line 129 of file Material.h.

◆ s_shadersDirty

bool Divide::Material::s_shadersDirty = false
staticprivate

Definition at line 383 of file Material.h.


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