Class StreamingTexture
GPU texture object which can change it's resolution (quality) at runtime.
Inheritance
Assembly: FlaxEngine.dll
File: Engine/Graphics/Textures/StreamingTexture.h
Syntax
public class StreamingTexture : public Object, public StreamableResource
Constructors
~StreamingTexture()
Declaration
public ~StreamingTexture()
StreamingTexture(ITextureOwner* owner, const String& name)
Declaration
public StreamingTexture(ITextureOwner* owner, const String& name)
Parameters
ITextureOwner
owner
|
String
name
|
Fields
_header
_isBlockCompressed
Declaration
protected bool _isBlockCompressed
Field Value
bool
|
_minMipCountBlockCompressed
Declaration
protected int32 _minMipCountBlockCompressed
Field Value
int32
|
_owner
_streamingTasks
Declaration
protected Array<Task* , FixedAllocation<16>> _streamingTasks
Field Value
Array<Task , FixedAllocation<16>>
|
_texture
Methods
CanBeUpdated()
Determines whether this instance can be updated. Which means: no async streaming, no pending action in background.
Declaration
public virtual bool CanBeUpdated() const override
Returns
bool
|
Overrides
CancelStreamingTasks()
Cancels any streaming task (or tasks sequence) started for this resource.
Declaration
public virtual void CancelStreamingTasks() override
Overrides
Create(const TextureHeader& header)
Creates new texture
Declaration
public bool Create(const TextureHeader& header)
Parameters
TextureHeader
header
Texture header |
Returns
bool
True if cannot create texture, otherwise false |
CreateStreamingTask(int32 residency)
Creates streaming task (or tasks sequence) to perform resource streaming for the desire residency level.
Declaration
public virtual Task* CreateStreamingTask(int32 residency) override
Parameters
int32
residency
The target residency. |
Returns
Task
Async task or tasks that update resource residency level. Must be preceded with UpdateAllocation call. |
Overrides
GetAllocatedResidency()
Gets resource allocated residency level.
Declaration
public virtual int32 GetAllocatedResidency() const override
Returns
int32
|
Overrides
GetCurrentResidency()
Gets resource current residency level.
Declaration
public virtual int32 GetCurrentResidency() const override
Returns
int32
|
Overrides
GetFormatType()
Returns texture format type
Declaration
public TextureFormatType GetFormatType() const
Returns
TextureFormatType
|
GetHeader()
GetMaxResidency()
Gets resource maximum residency level.
Declaration
public virtual int32 GetMaxResidency() const override
Returns
int32
|
Overrides
GetOwner()
GetTexture()
GetTotalMemoryUsage()
Gets the total memory usage that texture may have in use (if loaded to the maximum quality). Exact value may differ due to memory alignment and resource allocation policy.
Declaration
public uint64 GetTotalMemoryUsage() const
Returns
uint64
The amount of bytes. |
IsCubeMap()
Returns true if it's a cube map texture
Declaration
public bool IsCubeMap() const
Returns
bool
|
IsInitialized()
Gets a value indicating whether this instance is initialized.
Declaration
public bool IsInitialized() const
Returns
bool
|
NeverStream()
Returns true if texture cannot be used during GPU resources streaming system
Declaration
public bool NeverStream() const
Returns
bool
|
operator->()
Size()
Gets texture size of Float2::Zero if not loaded.
Declaration
public Float2 Size() const
Returns
Float2
|
TextureMipIndexToTotalIndex(int32 textureMipIndex)
Converts allocated texture mip index to the absolute mip map index.
Declaration
public int32 TextureMipIndexToTotalIndex(int32 textureMipIndex) const
Parameters
int32
textureMipIndex
Index of the texture mip. |
Returns
int32
The index of the mip map. |
ToString()
Gets the string representation of this object.
Declaration
public virtual String ToString() const override
Returns
String
|
Overrides
TotalArraySize()
Gets total texture array size
Declaration
public int32 TotalArraySize() const
Returns
int32
|
TotalHeight()
Gets total texture height (in texels)
Declaration
public int32 TotalHeight() const
Returns
int32
|
TotalIndexToTextureMipIndex(int32 mipIndex)
Converts absolute mip map index to the allocated texture mip index.
Declaration
public int32 TotalIndexToTextureMipIndex(int32 mipIndex) const
Parameters
int32
mipIndex
Index of the texture mip. |
Returns
int32
The index of the mip map. |
TotalMipLevels()
Gets total texture mip levels count
Declaration
public int32 TotalMipLevels() const
Returns
int32
|
TotalWidth()
Gets total texture width (in texels)
Declaration
public int32 TotalWidth() const
Returns
int32
|
UnloadTexture()
Release texture
Declaration
public void UnloadTexture()
UpdateAllocation(int32 residency)
Updates the resource allocation to the given residency level. May not be updated now but in an async operation.
Declaration
public virtual Task* UpdateAllocation(int32 residency) override
Parameters
int32
residency
The target allocation residency. |
Returns
Task
Async task that updates resource allocation or null if already done it. Warning: need to call task start to perform allocation. |