#include <MaterialTypeAssetCreator.h>
Inherits AZ::RPI::AssetCreator< MaterialTypeAsset >.
Public Member Functions | |
void | Begin (const Data::AssetId &assetId) |
Begin creating a MaterialTypeAsset. | |
void | AddShader (const AZ::Data::Asset< ShaderAsset > &shaderAsset, const ShaderVariantId &shaderVariantId={}, const AZ::Name &shaderTag={}, const AZ::Name &materialPipelineName=MaterialPipelineNone) |
void | SetVersion (uint32_t version) |
Sets the version of the MaterialTypeAsset. | |
void | AddVersionUpdate (const MaterialVersionUpdate &materialVersionUpdate) |
Adds a version update object into the MaterialTypeAsset. | |
void | ClaimShaderOptionOwnership (const Name &shaderOptionName) |
void | BeginMaterialProperty (const Name &materialPropertyName, MaterialPropertyDataType dataType, const AZ::Name &materialPipelineName=MaterialPipelineNone) |
void | ConnectMaterialPropertyToShaderInput (const Name &shaderInputName) |
Adds an output mapping from the current material property to a ShaderResourceGroup input. | |
void | ConnectMaterialPropertyToShaderOptions (const Name &shaderOptionName) |
void | ConnectMaterialPropertyToShaderEnabled (const Name &shaderTag) |
void | SetMaterialPropertyEnumNames (const AZStd::vector< AZStd::string > &enumNames) |
Store the enum names if a property is an enum type. | |
void | EndMaterialProperty () |
Finishes creating a material property. | |
void | SetPropertyValue (const Name &name, const Data::Asset< ImageAsset > &imageAsset, const AZ::Name &materialPipelineName=MaterialPipelineNone) |
void | SetPropertyValue (const Name &name, const Data::Asset< StreamingImageAsset > &imageAsset, const AZ::Name &materialPipelineName=MaterialPipelineNone) |
void | SetPropertyValue (const Name &name, const Data::Asset< AttachmentImageAsset > &imageAsset, const AZ::Name &materialPipelineName=MaterialPipelineNone) |
void | SetPropertyValue (const Name &name, const MaterialPropertyValue &value, const AZ::Name &materialPipelineName=MaterialPipelineNone) |
void | AddMaterialFunctor (const Ptr< MaterialFunctor > &functor, const AZ::Name &materialPipelineName=MaterialPipelineNone) |
void | AddUvName (const RHI::ShaderSemantic &shaderInput, const Name &uvName) |
Adds UV name for a shader input. | |
const MaterialPropertiesLayout * | GetMaterialPropertiesLayout (const AZ::Name &materialPipelineName=MaterialPipelineNone) const |
const RHI::ShaderResourceGroupLayout * | GetMaterialShaderResourceGroupLayout () const |
bool | End (Data::Asset< MaterialTypeAsset > &result) |
Public Member Functions inherited from AZ::RPI::AssetCreator< MaterialTypeAsset > | |
void | SetElevateWarnings (bool elevated) |
When true, treat all subsequent warnings as errors. Any warnings already reported will not be elevated. | |
bool | GetElevateWarnings () const |
int | GetErrorCount () const |
int | GetWarningCount () const |
bool | IsFailed () const |
void | ReportError (const char *format, Args... args) |
void | ReportWarning (const char *format, Args... args) |
Additional Inherited Members | |
Protected Member Functions inherited from AZ::RPI::AssetCreator< MaterialTypeAsset > | |
AZ_DISABLE_COPY_MOVE (AssetCreator) | |
void | BeginCommon (const Data::AssetId &assetId) |
bool | EndCommon (Data::Asset< MaterialTypeAsset > &result) |
bool | ValidateIsReady () |
bool | ValidateNotNull (void *pointer, const char *name) |
Reports errors when a pointer is null. | |
bool | ValidateNotNull (const AZ::Data::Asset< AZ::Data::AssetData > &pointer, const char *name) |
bool | ValidateNotNull (const AZStd::intrusive_ptr< T > &pointer, const char *name) |
Protected Attributes inherited from AZ::RPI::AssetCreator< MaterialTypeAsset > | |
Data::Asset< MaterialTypeAsset > | m_asset |
This is the asset that subclass creators will build. | |
Use a MaterialAssetCreator to create and configure a new MaterialAsset. The MaterialAsset will be based on a MaterialTypeAsset, which provides the necessary data to define the layout and behavior of the material. The MaterialAsset itself only provides property values. The MaterialAsset may optionally inherit from another 'parent' MaterialAsset, which provides the MaterialTypeAsset and default property values.
void AZ::RPI::MaterialTypeAssetCreator::AddMaterialFunctor | ( | const Ptr< MaterialFunctor > & | functor, |
const AZ::Name & | materialPipelineName = MaterialPipelineNone |
||
) |
Adds a MaterialFunctor. Material functors provide custom logic and calculations to configure shaders, render states, and more.See MaterialFunctor.h for details.
materialPipelineName | Identifies a MaterialPipelinePayload that this functor should be added to. For MaterialPipelineNone, the functor will be used for the main ShaderCollection that applies to all pipelines. |
void AZ::RPI::MaterialTypeAssetCreator::AddShader | ( | const AZ::Data::Asset< ShaderAsset > & | shaderAsset, |
const ShaderVariantId & | shaderVariantId = {} , |
||
const AZ::Name & | shaderTag = {} , |
||
const AZ::Name & | materialPipelineName = MaterialPipelineNone |
||
) |
Adds a shader to the built-in shader collection, which will be run for this material.
shaderTag | Must be unique within the material type's list of shaders. |
materialPipelineName | Identifies a specific MaterialPipelinePayload that this shader should be added to. For MaterialPipelineNone, the shader will be used for all pipelines. |
void AZ::RPI::MaterialTypeAssetCreator::BeginMaterialProperty | ( | const Name & | materialPropertyName, |
MaterialPropertyDataType | dataType, | ||
const AZ::Name & | materialPipelineName = MaterialPipelineNone |
||
) |
Starts creating a material property. Note that EndMaterialProperty() must be called before calling SetMaterialPropertyValue(). Similarly, The property will not appear in GetMaterialPropertiesLayout() until EndMaterialProperty() is called.
materialPipelineName | For internal material properties, this indicates which material pipeline the property is for. For main material properties, use MaterialPipelineNone. |
void AZ::RPI::MaterialTypeAssetCreator::ClaimShaderOptionOwnership | ( | const Name & | shaderOptionName | ) |
Indicates that this MaterialType will own the specified shader option. 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). Note that ConnectMaterialPropertyToShaderOptions() automatically claims ownership; so ClaimShaderOptionOwnership() only needs to be called for options used by material functors.
void AZ::RPI::MaterialTypeAssetCreator::ConnectMaterialPropertyToShaderEnabled | ( | const Name & | shaderTag | ) |
Adds an output mapping from the current material property to a Enabled flag of a specific shader.
shaderTag | The tag name that unique identifies a shader in the material type. |
void AZ::RPI::MaterialTypeAssetCreator::ConnectMaterialPropertyToShaderOptions | ( | const Name & | shaderOptionName | ) |
Adds output mappings from the current material property to a shader option in multiple shaders. Will add one mapping for every ShaderAsset that has a matching shader option.
const MaterialPropertiesLayout * AZ::RPI::MaterialTypeAssetCreator::GetMaterialPropertiesLayout | ( | const AZ::Name & | materialPipelineName = MaterialPipelineNone | ) | const |
This provides access to the MaterialPropertiesLayout while the MaterialTypeAsset is still being built. This is needed by MaterialTypeSourceData to initialize functor objects.
materialPipelineName | For internal material properties, this indicates which MaterialPipelinePayload's property layout to query. For main material properties, use MaterialPipelineNone. |
const RHI::ShaderResourceGroupLayout * AZ::RPI::MaterialTypeAssetCreator::GetMaterialShaderResourceGroupLayout | ( | ) | const |
This provides access to the material ShaderResourceGroupLayout being used for the MaterialTypeAsset. This is needed by MaterialTypeSourceData to initialize functor objects. The same layout object can be retrieved from the ShaderAssets passed to the creator, but this function is provided for convenience.
void AZ::RPI::MaterialTypeAssetCreator::SetPropertyValue | ( | const Name & | name, |
const Data::Asset< ImageAsset > & | imageAsset, | ||
const AZ::Name & | materialPipelineName = MaterialPipelineNone |
||
) |
materialPipelineName | For internal material properties, this indicates which MaterialPipelinePlayload's property to update. For main material properties, use MaterialPipelineNone. |
void AZ::RPI::MaterialTypeAssetCreator::SetPropertyValue | ( | const Name & | name, |
const MaterialPropertyValue & | value, | ||
const AZ::Name & | materialPipelineName = MaterialPipelineNone |
||
) |
Sets a property value using data in AZStd::variant-based MaterialPropertyValue. The contained data must match the data type of the property. For type Image, the value must be a Data::Asset<ImageAsset>.
materialPipelineName | For internal material properties, this indicates which MaterialPipelinePayload's property to update. For main material properties, use MaterialPipelineNone. |