Stride

OPEN / CLOSE
  • Features
  • Blog
  • Documentation
  • Community
(icon) Download

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

OPEN / CLOSE
  • English
  • 日本語
    Show / Hide Table of Contents

    StreamingManager Class

    Namespace: Stride.Streaming
    Assembly: Stride.Rendering.dll

    Performs content streaming.

    System.Object → DisposeBase → ComponentBase → GameSystemBase → StreamingManager
    Derived from StreamingManager:

    public class StreamingManager : GameSystemBase, IDisposable, ICollectorHolder, IGameSystemBase, IComponent, IReferencable, IUpdateable, IDrawable, IContentable, IStreamingManager, ITexturesStreamingProvider
    Name Description
    Constructors
    StreamingManager(IServiceRegistry)

    Initializes a new instance of the StreamingManager class.

    Fields
    ManagerUpdatesInterval

    The interval between StreamingManager updates.

    MaxResourcesPerUpdate

    The maximum number of resources updated per streaming manager tick. Used to balance performance/streaming speed.

    ResourceLiveTimeout

    The StreamableResource live timeout. Resources that aren't used for a while are downscaled in quality.

    TargetedMemoryBudget

    The targeted memory budget of the streaming system in MB. If the memory allocated by streaming system is under this budget it will not try to unload not visible resources.

    Properties
    AllocatedMemory

    Gets the memory currently allocated by streamable resources in MB.

    AllocatedMemoryBytes

    Gets the extact memory amount allocated by streamable resources in bytes.

    ContentStreaming

    Gets the content streaming service.

    Resources

    List with all registered streamable resources.

    Methods
    Destroy()

    Disposes of object resources.

    Get(Texture)

    Gets the StreamingTexture corresponding to the given texture object.

    Get<T>(Object)

    Gets the StreamableResource corresponding to the given resource object.

    RegisterMemoryUsage(Int64)

    Notify the streaming manager of the change memory used by the resources.

    SetResourceStreamingOptions(Texture, Nullable<StreamingOptions>)

    Set the streaming options for the resources

    SetResourceStreamingOptions(ParameterCollection, Nullable<StreamingOptions>)

    Set the streaming options for the resources

    SetResourceStreamingOptions(RenderMesh, Nullable<StreamingOptions>)

    Set the streaming options for the resources

    SetStreamingSettings(StreamingSettings)
    StreamResources(Texture, Nullable<StreamingOptions>)

    Called when texture is submitted to rendering. Registers referenced resources to stream them.

    StreamResources(ParameterCollection, Nullable<StreamingOptions>)

    Called when material parameters are submitted to rendering. Registers referenced resources to stream them.

    StreamResources(RenderMesh, Nullable<StreamingOptions>)

    Called when render mesh is submitted to rendering. Registers referenced resources to stream them.

    Update(GameTime)
    Explicit Interface Implementations
    IStreamingManager.FullyLoadResource(Object)

    Puts request to load given resource up to the maximum residency level.

    ITexturesStreamingProvider.FullyLoadTexture(Texture, ref ImageDescription, ref ContentStorageHeader)

    Loads the texture in a streaming service.

    ITexturesStreamingProvider.RegisterTexture(Texture, ref ImageDescription, ref ContentStorageHeader)

    Registers the texture in a streaming service.

    ITexturesStreamingProvider.UnregisterTexture(Texture)

    Unregisters the texture.

    | Improve this Doc View Source

    Constructors


    StreamingManager(IServiceRegistry)

    Initializes a new instance of the StreamingManager class.

    public StreamingManager(IServiceRegistry services)
    Parameters
    Type Name Description
    IServiceRegistry services

    The servicies registry.

    Remarks

    The GameSystem expects the following services to be registered: IGame and IContentManager.

    | Improve this Doc View Source

    Fields


    ManagerUpdatesInterval

    The interval between StreamingManager updates.

    public TimeSpan ManagerUpdatesInterval
    Field Value
    Type Description
    System.TimeSpan

    MaxResourcesPerUpdate

    The maximum number of resources updated per streaming manager tick. Used to balance performance/streaming speed.

    public int MaxResourcesPerUpdate
    Field Value
    Type Description
    System.Int32

    ResourceLiveTimeout

    The StreamableResource live timeout. Resources that aren't used for a while are downscaled in quality.

    public TimeSpan ResourceLiveTimeout
    Field Value
    Type Description
    System.TimeSpan

    TargetedMemoryBudget

    The targeted memory budget of the streaming system in MB. If the memory allocated by streaming system is under this budget it will not try to unload not visible resources.

    public int TargetedMemoryBudget
    Field Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    Properties


    AllocatedMemory

    Gets the memory currently allocated by streamable resources in MB.

    public float AllocatedMemory { get; }
    Property Value
    Type Description
    System.Single

    AllocatedMemoryBytes

    Gets the extact memory amount allocated by streamable resources in bytes.

    public long AllocatedMemoryBytes { get; }
    Property Value
    Type Description
    System.Int64

    ContentStreaming

    Gets the content streaming service.

    public ContentStreamingService ContentStreaming { get; }
    Property Value
    Type Description
    ContentStreamingService

    Resources

    List with all registered streamable resources.

    public ICollection<StreamableResource> Resources { get; }
    Property Value
    Type Description
    System.Collections.Generic.ICollection<StreamableResource>
    | Improve this Doc View Source

    Methods


    Destroy()

    Disposes of object resources.

    protected override void Destroy()
    Overrides
    ComponentBase.Destroy()

    Get(Texture)

    Gets the StreamingTexture corresponding to the given texture object.

    public StreamingTexture Get(Texture obj)
    Parameters
    Type Name Description
    Texture obj

    The texture object.

    Returns
    Type Description
    StreamingTexture

    Streamable texture, or null if it can't be found.


    Get<T>(Object)

    Gets the StreamableResource corresponding to the given resource object.

    public T Get<T>(object obj)
        where T : StreamableResource
    Parameters
    Type Name Description
    System.Object obj

    The object.

    Returns
    Type Description
    T

    Streamable resource, or null if it can't be found.

    Type Parameters
    Name Description
    T

    The type of the streamable resource.


    RegisterMemoryUsage(Int64)

    Notify the streaming manager of the change memory used by the resources.

    public void RegisterMemoryUsage(long memoryUsedChange)
    Parameters
    Type Name Description
    System.Int64 memoryUsedChange

    The change of memory used in bytes. This value can be positive of negative.


    SetResourceStreamingOptions(Texture, Nullable<StreamingOptions>)

    Set the streaming options for the resources

    public void SetResourceStreamingOptions(Texture texture, StreamingOptions? options = null)
    Parameters
    Type Name Description
    Texture texture

    The texture.

    System.Nullable<StreamingOptions> options

    The streaming options when streaming those resources


    SetResourceStreamingOptions(ParameterCollection, Nullable<StreamingOptions>)

    Set the streaming options for the resources

    public void SetResourceStreamingOptions(ParameterCollection parameters, StreamingOptions? options = null)
    Parameters
    Type Name Description
    ParameterCollection parameters

    The material parameters.

    System.Nullable<StreamingOptions> options

    The streaming options when streaming those resources


    SetResourceStreamingOptions(RenderMesh, Nullable<StreamingOptions>)

    Set the streaming options for the resources

    public void SetResourceStreamingOptions(RenderMesh renderMesh, StreamingOptions? options = null)
    Parameters
    Type Name Description
    RenderMesh renderMesh

    The render mesh.

    System.Nullable<StreamingOptions> options

    The streaming options when streaming those resources


    SetStreamingSettings(StreamingSettings)

    public void SetStreamingSettings(StreamingSettings streamingSettings)
    Parameters
    Type Name Description
    StreamingSettings streamingSettings

    StreamResources(Texture, Nullable<StreamingOptions>)

    Called when texture is submitted to rendering. Registers referenced resources to stream them.

    public void StreamResources(Texture texture, StreamingOptions? options = null)
    Parameters
    Type Name Description
    Texture texture

    The texture.

    System.Nullable<StreamingOptions> options

    The streaming options when streaming those resources


    StreamResources(ParameterCollection, Nullable<StreamingOptions>)

    Called when material parameters are submitted to rendering. Registers referenced resources to stream them.

    public void StreamResources(ParameterCollection parameters, StreamingOptions? options = null)
    Parameters
    Type Name Description
    ParameterCollection parameters

    The material parameters.

    System.Nullable<StreamingOptions> options

    The streaming options when streaming those resources


    StreamResources(RenderMesh, Nullable<StreamingOptions>)

    Called when render mesh is submitted to rendering. Registers referenced resources to stream them.

    public void StreamResources(RenderMesh renderMesh, StreamingOptions? options = null)
    Parameters
    Type Name Description
    RenderMesh renderMesh

    The render mesh.

    System.Nullable<StreamingOptions> options

    The streaming options when streaming those resources


    Update(GameTime)

    public override void Update(GameTime gameTime)
    Parameters
    Type Name Description
    GameTime gameTime
    Overrides
    GameSystemBase.Update(GameTime)
    | Improve this Doc View Source

    Explicit Interface Implementations


    IStreamingManager.FullyLoadResource(Object)

    Puts request to load given resource up to the maximum residency level.

    void IStreamingManager.FullyLoadResource(object obj)
    Parameters
    Type Name Description
    System.Object obj

    The streamable resource object.


    ITexturesStreamingProvider.FullyLoadTexture(Texture, ref ImageDescription, ref ContentStorageHeader)

    Loads the texture in a streaming service.

    void ITexturesStreamingProvider.FullyLoadTexture(Texture obj, ref ImageDescription imageDescription, ref ContentStorageHeader storageHeader)
    Parameters
    Type Name Description
    Texture obj

    The texture object.

    ImageDescription imageDescription

    The image description.

    ContentStorageHeader storageHeader

    The storage header.


    ITexturesStreamingProvider.RegisterTexture(Texture, ref ImageDescription, ref ContentStorageHeader)

    Registers the texture in a streaming service.

    void ITexturesStreamingProvider.RegisterTexture(Texture obj, ref ImageDescription imageDescription, ref ContentStorageHeader storageHeader)
    Parameters
    Type Name Description
    Texture obj

    The texture object.

    ImageDescription imageDescription

    The image description.

    ContentStorageHeader storageHeader

    The storage header.


    ITexturesStreamingProvider.UnregisterTexture(Texture)

    Unregisters the texture.

    void ITexturesStreamingProvider.UnregisterTexture(Texture obj)
    Parameters
    Type Name Description
    Texture obj

    The texture object.


    Inherited Members

    GameSystemBase.Game
    GameSystemBase.Services
    GameSystemBase.Content
    GameSystemBase.GraphicsDevice
    GameSystemBase.DrawOrderChanged
    GameSystemBase.VisibleChanged
    GameSystemBase.BeginDraw()
    GameSystemBase.Draw(GameTime)
    GameSystemBase.EndDraw()
    GameSystemBase.Visible
    GameSystemBase.DrawOrder
    GameSystemBase.Initialize()
    GameSystemBase.InitGraphicsDeviceService()
    GameSystemBase.EnabledChanged
    GameSystemBase.UpdateOrderChanged
    GameSystemBase.Enabled
    GameSystemBase.UpdateOrder
    GameSystemBase.OnDrawOrderChanged(Object, EventArgs)
    GameSystemBase.OnUpdateOrderChanged(Object, EventArgs)
    GameSystemBase.IContentable.LoadContent()
    GameSystemBase.IContentable.UnloadContent()
    GameSystemBase.LoadContent()
    GameSystemBase.UnloadContent()
    ComponentBase.Tags
    ComponentBase.Name
    ComponentBase.ICollectorHolder.Collector
    ComponentBase.OnNameChanged()
    ComponentBase.ToString()
    DisposeBase.Dispose()
    DisposeBase.IsDisposed
    DisposeBase.IReferencable.ReferenceCount
    DisposeBase.IReferencable.AddReference()
    DisposeBase.IReferencable.Release()
    DisposeBase.OnAddReference()
    DisposeBase.OnReleaseReference()

    Extension Methods

    ComponentBaseExtensions.DisposeBy<T>(T, ICollectorHolder)
    ComponentBaseExtensions.RemoveDisposeBy<T>(T, ICollectorHolder)

    See Also

    GameSystemBase
    ITexturesStreamingProvider
    • Improve this Doc
    • View Source
    In This Article

    Back to top

    Copyright © 2019-2021 .NET Foundation and Contributors
    Supported by the .NET Foundation