Search Results for

    Show / Hide Table of Contents

    Class MaterialInstance

    Instance of the

    Material

    with custom set of material parameter values.

    Inheritance
    Object
    ScriptingObject
    ManagedScriptingObject
    Asset
    BinaryAsset
    MaterialBase
    MaterialInstance
    Inherited Members
    Asset::_deleteFileOnUnload
    BinaryAsset::_dependantAssets
    ScriptingObject::_gcHandle
    BinaryAsset::_header
    ScriptingObject::_id
    BinaryAsset::_isSaving
    Asset::_isVirtual
    Asset::_loadingTask
    Asset::_loadState
    Asset::_refCount
    BinaryAsset::_storageRef
    ScriptingObject::_type
    BinaryAsset::AddDependency(BinaryAsset* asset)
    Asset::AddReference()
    Asset::Asset(const SpawnParams& params, const AssetInfo* info)
    ScriptingObject::CanCast(const ScriptingTypeHandle& from, const ScriptingTypeHandle& to)
    ScriptingObject::CanCast(const MClass* from, const MClass* to)
    Asset::CancelStreaming()
    ScriptingObject::Cast(ScriptingObject* obj)
    Asset::ChangeID(const Guid& newId)
    BinaryAsset::ClearDependencies()
    Asset::const
    BinaryAsset::createLoadingTask()
    Asset::CreateManaged()
    ScriptingObject::CreateManagedInternal()
    MaterialBase::CreateVirtualInstance()
    Asset::DECLARE_ENUM_7(LoadResult, Ok, Failed, MissingDataChunk, CannotLoadData, CannotLoadStorage, CannotLoadInitData, InvalidData)
    ScriptingObject::Deleted
    Asset::DeleteManaged()
    Object::DeleteObject(float timeToLive = 0.0f, bool useGameTime=false)
    Object::DeleteObjectNow()
    BinaryAsset::Dependencies
    Asset::DEPRECATED("Use GetReferences with assets and files parameter instead")
    Asset::DestroyManaged()
    MaterialInstance
    Object::Flags
    ScriptingObject::FromInterface(void* interfaceObj, const ScriptingTypeHandle& interfaceType)
    ScriptingObject::FromInterface(T* interfaceObj)
    BinaryAsset::GetChunk(int32 index)
    BinaryAsset::GetChunkData(int32 index, BytesContainer& data)
    BinaryAsset::GetChunkSize(int32 index)
    ScriptingObject::GetClass()
    ScriptingObject::GetID()
    BinaryAsset::GetImportMetadata(String& path, String& username)
    BinaryAsset::GetImportPath()
    ScriptingObject::GetManagedInstance()
    BinaryAsset::GetMemoryUsage()
    BinaryAsset::GetOrCreateChunk(int32 index)
    ScriptingObject::GetOrCreateManagedInstance()
    MaterialBase::GetParameter(const StringView& name)
    MaterialBase::GetParameters()
    MaterialBase::GetParameterValue(const StringView& name)
    BinaryAsset::GetPath()
    Asset::GetReferences(Array<Guid, HeapAllocation>& assets, Array<String, HeapAllocation>& files)
    Asset::GetReferences()
    Asset::GetReferencesCount()
    BinaryAsset::GetSerializedVersion()
    ScriptingObject::GetType()
    ScriptingObject::GetTypeHandle()
    Asset::GetTypeName()
    BinaryAsset::HasChunk(int32 index)
    BinaryAsset::HasChunkLoaded(int32 index)
    BinaryAsset::HasDependenciesModified()
    ScriptingObject::HasManagedInstance()
    MaterialBase::Info()
    BinaryAsset::Init(const FlaxStorageReference& storage, AssetHeader& header)
    BinaryAsset::Init(AssetInitData& initData)
    BinaryAsset::init(AssetInitData& initData)
    Asset::InitAsVirtual()
    BinaryAsset::InitVirtual(AssetInitData& initData)
    ScriptingObject::Is(const ScriptingTypeHandle& type)
    ScriptingObject::Is(const MClass* type)
    ScriptingObject::Is()
    IMaterial::IsDecal()
    IMaterial::IsDeformable()
    IMaterial::IsGUI()
    Asset::IsInternalType()
    Asset::IsLoaded()
    IMaterial::IsParticle()
    IMaterial::IsPostFx()
    ScriptingObject::IsRegistered()
    IMaterial::IsSurface()
    IMaterial::IsTerrain()
    Asset::IsVirtual()
    Asset::LastLoadFailed()
    BinaryAsset::loadAsset()
    BinaryAsset::LoadChunk(int32 chunkIndex)
    BinaryAsset::LoadChunks(AssetChunksFlag chunks)
    MaterialInstance
    Asset::Locker
    ManagedScriptingObject::ManagedScriptingObject(const SpawnParams& params)
    BinaryAsset::Metadata
    ScriptingObject::NewObject(const ScriptingTypeHandle& typeHandle)
    ScriptingObject::NewObject()
    Asset::OnCheckSave(const StringView& path=StringView::Empty)
    BinaryAsset::OnDeleteObject()
    BinaryAsset::OnDependencyModified(BinaryAsset* asset)
    Asset::onLoad(LoadAssetTask* task)
    Asset::onLoaded()
    Asset::OnLoaded
    Asset::onLoaded_MainThread()
    Asset::OnManagedInstanceDeleted()
    Asset::OnReloading
    BinaryAsset::onRename(const StringView& newPath)
    Asset::OnScriptingDispose()
    Asset::onUnload_MainThread()
    Asset::OnUnloaded
    MaterialBase::Params
    MaterialBase::ParamsChanged
    ScriptingObject::RegisterObject()
    BinaryAsset::Reimport()
    BinaryAsset::ReleaseChunk(int32 index)
    BinaryAsset::ReleaseChunks()
    BinaryAsset::releaseStorage()
    Asset::Reload()
    Asset::RemoveReference()
    BinaryAsset::RequestChunkDataAsync(int32 index)
    BinaryAsset::SaveAsset(AssetInitData& data, bool silentMode=false)
    BinaryAsset::SaveAsset(const StringView& path, AssetInitData& data, bool silentMode=false)
    BinaryAsset::SaveToAsset(const StringView& path, AssetInitData& data, bool silentMode=false)
    ScriptingObject::ScriptingObject(const SpawnParams& params)
    BinaryAsset::SetChunk(int32 index, const Span<byte>& data)
    ManagedScriptingObject::SetManagedInstance(MObject* instance)
    MaterialBase::SetParameterValue(const StringView& name, const Variant& value, bool warnIfMissing=true)
    Asset::ShouldDeleteFileOnUnload()
    MaterialInstance
    Asset::startLoading()
    BinaryAsset::Storage
    ScriptingObject::ToInterface(ScriptingObject* obj, const ScriptingTypeHandle& interfaceType)
    ScriptingObject::ToInterface(ScriptingObject* obj)
    ScriptingObject::ToManaged(const ScriptingObject* obj)
    ScriptingObject::ToNative(MObject* obj)
    Asset::ToString()
    ScriptingObject::UnregisterObject()
    Asset::WaitForLoaded(double timeoutInMilliseconds=30000.0)
    BinaryAsset::~BinaryAsset()
    Object::~Object()
    ScriptingObject::~ScriptingObject()
    Assembly: FlaxEngine.dll
    File: Engine/Content/Assets/MaterialInstance.h
    Syntax
    public class MaterialInstance : public MaterialBase

    Methods

    Bind(BindParameters& params)

    Binds the material state to the GPU pipeline. Should be called before the draw command.

    Declaration
    public virtual void Bind(BindParameters& params) override
    Parameters
    BindParameters params

    The material bind settings.

    Overrides
    IMaterial::Bind(BindParameters& params)

    CanUseInstancing(InstancingHandler& handler)

    Returns true if material can use draw calls instancing.

    Declaration
    public virtual bool CanUseInstancing(InstancingHandler& handler) const override
    Parameters
    InstancingHandler handler

    The output data for the instancing handling used to hash, batch and write draw calls. Valid only when function returns true.

    Returns
    bool

    True if can use instancing, otherwise false.

    Overrides
    IMaterial::CanUseInstancing(InstancingHandler& handler)

    CanUseLightmap()

    Returns true if material can use lightmaps (this includes lightmaps offline baking and sampling at runtime).

    Declaration
    public virtual bool CanUseLightmap() const override
    Returns
    bool

    True if can use lightmaps, otherwise false

    Overrides
    IMaterial::CanUseLightmap()

    GetBaseMaterial()

    Gets the base material. If value gets changed parameters collection is restored to the default values of the new material.

    Declaration
    public MaterialBase* GetBaseMaterial() const
    Returns
    MaterialBase

    getChunksToPreload()

    Gets packed chunks indices to preload before asset loading action

    Declaration
    protected virtual AssetChunksFlag getChunksToPreload() const override
    Returns
    AssetChunksFlag

    Chunks to load flags

    Overrides
    BinaryAsset::getChunksToPreload()

    GetDrawModes()

    Gets the mask of render passes supported by this material.

    Declaration
    public virtual DrawPass GetDrawModes() const override
    Returns
    DrawPass

    The draw passes supported by this material.

    Overrides
    IMaterial::GetDrawModes()

    GetInfo()

    Gets the material info, structure which describes material surface.

    Declaration
    public virtual MaterialInfo GetInfo() const override
    Returns
    MaterialInfo

    The constant reference to the material descriptor.

    Overrides
    IMaterial::GetInfo()

    GetReferences(Array<Guid>& assets, Array<String>& files)

    Declaration
    public void GetReferences(Array<Guid>& assets, Array<String>& files) const override
    Parameters
    Array<Guid> assets

    Array<String> files

    GetShader()

    Gets the shader resource.

    Declaration
    public virtual GPUShader* GetShader() const override
    Returns
    GPUShader

    The material shader resource.

    Overrides
    IMaterial::GetShader()

    IsMaterialInstance()

    Returns true if material is a material instance.

    Declaration
    public virtual bool IsMaterialInstance() const override
    Returns
    bool

    Overrides
    MaterialBase::IsMaterialInstance()

    IsReady()

    Returns true if material is ready for rendering.

    Declaration
    public virtual bool IsReady() const override
    Returns
    bool

    True if can render that material

    Overrides
    IMaterial::IsReady()

    load()

    Load data from the chunks

    Declaration
    protected virtual LoadResult load() override
    Returns
    LoadResult

    Loading result

    Overrides
    BinaryAsset::load()

    ResetParameters()

    Resets all parameters back to the base material (including disabling parameter overrides).

    Declaration
    public void ResetParameters()

    Save(const StringView& path=StringView::Empty)

    Saves this asset to the file. Supported only in Editor.

    Declaration
    public virtual bool Save(const StringView& path=StringView::Empty) override
    Parameters
    StringView path

    The custom asset path to use for the saving. Use empty value to save this asset to its own storage location. Can be used to duplicate asset. Must be specified when saving virtual asset.

    Returns
    bool

    True when cannot save data, otherwise false.

    Overrides
    Asset::Save(const StringView& path=StringView::Empty)

    SetBaseMaterial(MaterialBase* baseMaterial)

    Sets the base material. If value gets changed parameters collection is restored to the default values of the new material.

    Declaration
    public void SetBaseMaterial(MaterialBase* baseMaterial)
    Parameters
    MaterialBase baseMaterial

    The base material.

    unload(bool isReloading)

    Unloads asset data

    Declaration
    protected virtual void unload(bool isReloading) override
    Parameters
    bool isReloading

    True if asset is reloading data, otherwise false.

    Overrides
    Asset::unload(bool isReloading)
    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2012-2024 Wojciech Figat