/// <summary> /// Set the streaming options for the resources /// </summary> /// <param name="renderMesh">The render mesh.</param> /// <param name="options">The streaming options when streaming those resources</param> public void SetResourceStreamingOptions(RenderMesh renderMesh, StreamingOptions?options = null) { if (renderMesh.MaterialPass != null) { SetResourceStreamingOptions(renderMesh.MaterialPass.Parameters, options); } }
/// <summary> /// Set the streaming options for the resources /// </summary> /// <param name="parameters">The material parameters.</param> /// <param name="options">The streaming options when streaming those resources</param> public void SetResourceStreamingOptions(ParameterCollection parameters, StreamingOptions?options = null) { if (parameters.ObjectValues == null) { return; } // Register all binded textures foreach (var e in parameters.ObjectValues) { if (e is Texture t) { StreamResources(t, options); } } }
/// <summary> /// Set the streaming options for the resources /// </summary> /// <param name="texture">The texture.</param> /// <param name="options">The streaming options when streaming those resources</param> public void SetResourceStreamingOptions(Texture texture, StreamingOptions?options = null) { if (texture == null) { return; } var resource = Get(texture); if (resource != null) { if (options.HasValue) { SetResourceStreamingOptions(resource, options.Value, false); } } }
/// <summary> /// Called when texture is submitted to rendering. Registers referenced resources to stream them. /// </summary> /// <param name="texture">The texture.</param> /// <param name="options">The streaming options when streaming those resources</param> public void StreamResources(Texture texture, StreamingOptions?options = null) { if (texture == null) { return; } var resource = Get(texture); if (resource != null) { resource.LastTimeUsed = frameIndex; if (options.HasValue) { SetResourceStreamingOptions(resource, options.Value, true); } } }