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::MaterialPropertyCollection Class Reference

Represents the runtime state of a set of material properties for a given MaterialPropertiesLayout. More...

#include <MaterialPropertyCollection.h>

Public Member Functions

bool Init (RHI::ConstPtr< MaterialPropertiesLayout > layout, const AZStd::vector< MaterialPropertyValue > &defaultValues)
 
template<typename Type >
bool SetPropertyValue (MaterialPropertyIndex index, const Type &value)
 
template<typename Type >
const Type & GetPropertyValue (MaterialPropertyIndex index) const
 Gets the value of a material property. The template data type must match the property's data type.
 
bool SetPropertyValue (MaterialPropertyIndex index, const MaterialPropertyValue &value)
 
const MaterialPropertyValueGetPropertyValue (MaterialPropertyIndex index) const
 Returns the value of a material property.
 
const AZStd::vector< MaterialPropertyValue > & GetPropertyValues () const
 
const MaterialPropertyFlags & GetPropertyDirtyFlags () const
 Gets flags indicating which properties have been modified.
 
void SetAllPropertyDirtyFlags ()
 Marks all properties as dirty.
 
void ClearAllPropertyDirtyFlags ()
 Marks all properties as not dirty.
 
RHI::ConstPtr< MaterialPropertiesLayoutGetMaterialPropertiesLayout () const
 Gets the material properties layout.
 

Detailed Description

Represents the runtime state of a set of material properties for a given MaterialPropertiesLayout.

Member Function Documentation

◆ Init()

bool AZ::RPI::MaterialPropertyCollection::Init ( RHI::ConstPtr< MaterialPropertiesLayout layout,
const AZStd::vector< MaterialPropertyValue > &  defaultValues 
)

Initialize or re-initialize the properties. If reinitializing, any values that were set via SetPropertyValue() before will be preserved and re-applied on top of the @defaultValues. Note this does not touch the property dirty flags, the calling code must call SetAllPropertyDirtyFlags() or ClearAllPropertyDirtyFlags() as needed.

◆ SetPropertyValue() [1/2]

bool AZ::RPI::MaterialPropertyCollection::SetPropertyValue ( MaterialPropertyIndex  index,
const MaterialPropertyValue value 
)

Sets the value of a material property. The @value data type must match the property's data type.

Returns
true if property value was changed

◆ SetPropertyValue() [2/2]

template<typename Type >
bool AZ::RPI::MaterialPropertyCollection::SetPropertyValue ( MaterialPropertyIndex  index,
const Type &  value 
)

Sets the value of a material property. The template data type must match the property's data type.

Returns
true if property value was changed

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