Class MaterialShader
Represents material shader that can be used to render objects, visuals or effects. Contains a dedicated shader.
Inheritance
Assembly: FlaxEngine.dll
File: Engine/Graphics/Materials/MaterialShader.h
Syntax
public class MaterialShader : public IMaterial
Constructors
~MaterialShader()
MaterialShader(const StringView& name)
Init
Declaration
protected MaterialShader(const StringView& name)
Parameters
StringView
name
Material resource name |
Fields
_cb
_cbData
Declaration
protected Array<byte> _cbData
Field Value
Array<byte>
|
_info
_isLoaded
Declaration
protected bool _isLoaded
Field Value
bool
|
_shader
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
GetShader()
Gets the shader resource.
Declaration
public virtual GPUShader* GetShader() const override
Returns
GPUShader
The material shader resource. |
Overrides
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
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()