Open 3D Engine Atom Gem API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AZ::RPI::ShaderCollection::Item Class Reference

#include <ShaderCollection.h>

Public Member Functions

 AZ_TYPE_INFO (Item, "{64C7F381-3313-46E8-B23B-D7AA9A915F35}")
 
 Item ()
 Required for use in containers; not meant to be called directly.
 
 Item (const Data::Asset< ShaderAsset > &shaderAsset, const AZ::Name &shaderTag, ShaderVariantId variantId=ShaderVariantId{})
 
 Item (Data::Asset< ShaderAsset > &&shaderAsset, const AZ::Name &shaderTag, ShaderVariantId variantId=ShaderVariantId{})
 
const Data::Asset< ShaderAsset > & GetShaderAsset () const
 
const ShaderVariantIdGetShaderVariantId () const
 Return the ID of the shader variant to be used, based on the configured shader options.
 
const AZ::Data::AssetId & GetShaderAssetId () const
 Returns the asset id associated to this shader item.
 
const AZ::RPI::ShaderOptionGroupGetShaderOptionGroup () const
 
const ShaderOptionGroupGetShaderOptions () const
 Return the set of shader options used to select a specific shader variant.
 
ShaderOptionGroupGetShaderOptions ()
 
bool MaterialOwnsShaderOption (const AZ::Name &shaderOptionName) const
 
bool MaterialOwnsShaderOption (ShaderOptionIndex shaderOptionIndex) const
 
const RHI::RenderStatesGetRenderStatesOverlay () const
 Return the runtime render states overlay. Properties that are not overwritten are invalid.
 
RHI::RenderStatesGetRenderStatesOverlay ()
 
RHI::DrawListTag GetDrawListTagOverride () const
 Return the runtime draw list tag override.
 
void SetDrawListTagOverride (RHI::DrawListTag drawList)
 Set the runtime draw list tag.
 
void SetDrawListTagOverride (const AZ::Name &drawListName)
 
void SetEnabled (bool enabled)
 Controls whether this shader/pass will be used for rendering a material.
 
bool IsEnabled () const
 
const AZ::Name & GetShaderTag () const
 Returns the shader tag used to identify this item.
 
void TryReplaceShaderAsset (const Data::Asset< ShaderAsset > &newShaderAsset)
 
bool InitializeShaderOptionGroup ()
 

Static Public Member Functions

static void Reflect (AZ::ReflectContext *context)
 

Friends

class MaterialTypeAssetCreator
 
class ShaderVariantReferenceSerializationEvents
 
class ShaderCollection
 
class MaterialTypeAsset
 

Detailed Description

Contains shader asset and configures how that shader should be used at runtime, especially which variant of the shader to use.

Constructor & Destructor Documentation

◆ Item()

AZ::RPI::ShaderCollection::Item::Item ( const Data::Asset< ShaderAsset > &  shaderAsset,
const AZ::Name &  shaderTag,
ShaderVariantId  variantId = ShaderVariantId{} 
)
Parameters
shaderAssetThe ShaderAsset represented by this item.
shaderTagUnique tag to identify this item.
variantIdThe the initial state of shader option values for use with this shader item.

Member Function Documentation

◆ MaterialOwnsShaderOption()

bool AZ::RPI::ShaderCollection::Item::MaterialOwnsShaderOption ( const AZ::Name &  shaderOptionName) const

Returns whether the material owns the indicate shader option in this Item. Material-owned shader options can be connected to material properties (either directly or through functors). They cannot be accessed externally (for example, through the Material::SetSystemShaderOption() function).

◆ TryReplaceShaderAsset()

void AZ::RPI::ShaderCollection::Item::TryReplaceShaderAsset ( const Data::Asset< ShaderAsset > &  newShaderAsset)

If the AssetId of @newShaderAsset matches the AssetId of @m_shaderAsset, then @m_shaderAsset will be updated to @newShaderAsset, AND m_shaderOptionGroup will be updated too.


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