Search Results for

    Show / Hide Table of Contents

    Class MaterialShader

    Represents material shader that can be used to render objects, visuals or effects. Contains a dedicated shader.

    Inheritance
    IMaterial
    MaterialShader
    Inherited Members
    IMaterial::Bind(BindParameters& params)
    IMaterial::CanUseInstancing(InstancingHandler& handler)
    IMaterial::CanUseLightmap()
    IMaterial::GetDrawModes()
    IMaterial::IsDecal()
    IMaterial::IsDeformable()
    IMaterial::IsGUI()
    IMaterial::IsParticle()
    IMaterial::IsPostFx()
    IMaterial::IsSurface()
    IMaterial::IsTerrain()
    Assembly: FlaxEngine.dll
    File: Engine/Graphics/Materials/MaterialShader.h
    Syntax
    public class MaterialShader : public IMaterial

    Constructors

    ~MaterialShader()

    Finalizes an instance of the MaterialShader class.

    Declaration
    public virtual ~MaterialShader()

    MaterialShader(const StringView& name)

    Init

    Declaration
    protected MaterialShader(const StringView& name)
    Parameters
    StringView name

    Material resource name

    Fields

    _cb

    Declaration
    protected GPUConstantBuffer* _cb
    Field Value
    GPUConstantBuffer

    _cbData

    Declaration
    protected Array<byte> _cbData
    Field Value
    Array<byte>

    _info

    Declaration
    protected MaterialInfo _info
    Field Value
    MaterialInfo

    _isLoaded

    Declaration
    protected bool _isLoaded
    Field Value
    bool

    _shader

    Declaration
    protected GPUShader* _shader
    Field Value
    GPUShader

    Methods

    Create(const StringView& name, MemoryReadStream& shaderCacheStream, const MaterialInfo& info)

    Creates and loads the material from the data.

    Declaration
    public static MaterialShader* Create(const StringView& name, MemoryReadStream& shaderCacheStream, const MaterialInfo& info)
    Parameters
    StringView name

    Material resource name

    MemoryReadStream shaderCacheStream

    Stream with compiled shader data

    MaterialInfo info

    Loaded material info structure

    Returns
    MaterialShader

    The created and loaded material or null if failed.

    CreateDummy(MemoryReadStream& shaderCacheStream, const MaterialInfo& info)

    Creates the dummy material used by the Null rendering backend to mock object but not perform any rendering.

    Declaration
    public static MaterialShader* CreateDummy(MemoryReadStream& shaderCacheStream, const MaterialInfo& info)
    Parameters
    MemoryReadStream shaderCacheStream

    The shader cache stream.

    MaterialInfo info

    The material information.

    Returns
    MaterialShader

    The created and loaded material or null if failed.

    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()

    GetShader()

    Gets the shader resource.

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

    The material shader resource.

    Overrides
    IMaterial::GetShader()

    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()

    Declaration
    protected virtual bool Load() = 0
    Returns
    bool

    Load(MemoryReadStream& shaderCacheStream, const MaterialInfo& info)

    Declaration
    protected bool Load(MemoryReadStream& shaderCacheStream, const MaterialInfo& info)
    Parameters
    MemoryReadStream shaderCacheStream

    MaterialInfo info

    Returns
    bool

    Unload()

    Clears the loaded data.

    Declaration
    public virtual void Unload()
    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2012-2024 Wojciech Figat