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

#include <MaterialFunctorSourceData.h>

Inherits AZStd::intrusive_base.

Inherited by AZ::RPI::LuaMaterialFunctorSourceData, AZ::Render::ConvertEmissiveUnitFunctorSourceData, AZ::Render::SubsurfaceTransmissionParameterFunctorSourceData, AZ::Render::Transform2DFunctorSourceData, and AZ::Render::UseTextureFunctorSourceData.

Classes

struct  AssetDependency
 This generally corresponds to AssetBuilderSDK's Job Dependencies. More...
 
struct  EditorContext
 
struct  RuntimeContext
 

Public Types

using FunctorResult = Outcome< Ptr< MaterialFunctor > >
 

Public Member Functions

 AZ_RTTI (MaterialFunctorSourceData, "{2E8C6884-E136-4494-AEC1-5F23473278DC}")
 
 AZ_CLASS_ALLOCATOR (MaterialFunctorSourceData, AZ::SystemAllocator)
 
virtual FunctorResult CreateFunctor (const RuntimeContext &runtimeContext) const
 
virtual FunctorResult CreateFunctor (const EditorContext &editorContext) const
 
void AddMaterialPropertyDependency (Ptr< MaterialFunctor > functor, MaterialPropertyIndex index) const
 Add a new dependent property to this functor.
 
virtual AZStd::vector< AZ::Name > GetShaderOptionDependencies () const
 Returns a list of all shader options that this functor can set.
 
virtual AZStd::vector< AssetDependencyGetAssetDependencies () const
 

Static Public Member Functions

static void Reflect (AZ::ReflectContext *context)
 

Friends

class JsonMaterialFunctorSourceDataSerializer
 

Detailed Description

This is an abstract base class for initializing MaterialFunctor objects. Material functors provide custom logic and calculations to configure shaders, render states, and more. See MaterialFunctor.h for details.

Member Typedef Documentation

◆ FunctorResult

Creates a fully initialized MaterialFunctor object that is ready to be serialized to the cache. Override either or both, depending on where the functor should take place. The reason we provide two separate paths to create a functor is there could be different C++ build dependencies for the runtime vs editor functors. Otherwise it's fine to override both these functions and make them return the same MaterialFunctor. You could create one MaterialFunctor subclass that handles both runtime and editor processing. Or if there are performance or dependency reasons, create two separate MaterialFunctor subclasses for runtime and editor.

Member Function Documentation

◆ GetAssetDependencies()

virtual AZStd::vector< AssetDependency > AZ::RPI::MaterialFunctorSourceData::GetAssetDependencies ( ) const
inlinevirtual

Returns a list of other assets that this functor depends on. Any change to one of these assets will trigger the .materialtype to rebuild.

Reimplemented in AZ::RPI::LuaMaterialFunctorSourceData.

◆ GetShaderOptionDependencies()

virtual AZStd::vector< AZ::Name > AZ::RPI::MaterialFunctorSourceData::GetShaderOptionDependencies ( ) const
inlinevirtual

Returns a list of all shader options that this functor can set.

Reimplemented in AZ::Render::UseTextureFunctorSourceData, and AZ::RPI::LuaMaterialFunctorSourceData.


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