Umbra::Runtime class

Main runtime class.

The Runtime class is the main entry point to the Umbra runtime API. It is responsible for creating other runtime classes as well as streaming data from network or disk into memory. It also provides jobs for decompressing and handling assets to the application.

Public types

struct StreamingState
Statistics on asset streaming.
enum Flags { UncachedAssetMemory = 1 << 0, NeverUnload = 1 << 1, UmbraExclusiveRendering = 1 << 2, UmbraDebug = 1 << 31 }
Runtime flags.

Public static functions

static auto create(UmbraClient* context, const EnvironmentInfo& env, const char* fileCachePath = NULL, const char* configPath = NULL, uint32_t flags = 0) -> Runtime*
Create runtime.
static void destroy(Runtime* runtime)

Constructors, destructors, conversion operators

~Runtime() virtual

Public functions

auto createScene() -> Scene* pure virtual
Create an empty scene object.
void destroy(Scene*) pure virtual
auto createView() -> View* pure virtual
Create a view.
void destroy(View*) pure virtual
auto copyScene(SceneCopy::Destination dst, SceneCopy::Source src, EnvironmentInfo* env) -> SceneCopy* pure virtual
Offline sync support.
auto copyScene(SceneCopy::Destination dst, SceneCopy::Source src, EnvironmentInfo* env, const Float3* sphereCenter, float sphereRadius, int lodLevel) -> SceneCopy* pure virtual
void destroy(SceneCopy*) pure virtual
void update() pure virtual
Per-frame update of the streaming state.
auto getNextAssetJob() -> AssetJob* pure virtual
Get next asset load/unload request.
void getDebugInfo(char* out, int len) pure virtual
void getState(StreamingState& state) pure virtual
Get statistics on currently active streaming operations.

Enum details

enum Umbra::Runtime::Flags

Runtime flags.

Enumerators
UncachedAssetMemory

Assume that reading back from asset unpack buffers is expensive, as is generally the case when loading asset data directly into mapped video memory.

Setting this is equivalent to forcing bool uncachedMemory to true for all functions that accept it

NeverUnload

Never unload data once it has been loaded. May be useful for small data sets.

UmbraExclusiveRendering

Exclusive Umbra rendering mode, used for optimzing shadow receiver volumes.

UmbraDebug

Function details

static Runtime* Umbra::Runtime::create(UmbraClient* context, const EnvironmentInfo& env, const char* fileCachePath = NULL, const char* configPath = NULL, uint32_t flags = 0)

Create runtime.

Parameters
context Context and platform integration utilities to use
env Other platform details and preferences
fileCachePath Directory path for disk cache
configPath Directory path for configuration
flags Flags

AssetJob* Umbra::Runtime::getNextAssetJob() pure virtual

Get next asset load/unload request.

Returns Pointer to an AssetJob that should be completed by user code or NULL if all available assets have been processed.

Finds an asset that needs loading or unloading based on parameters from previous Scene or View updates. Asset loading attempts to keep an asset set that allows rendering all views, with their last updated quality and position, resident in memory. In general assets that are visible or close to any View origins are loaded and others unloaded. AssetJobs do.

This function may be called as many or as few times as desired during a frame. AssetJobs are returned in priority order, with unloads before loads.