Asset Client
Feature: Asset Streaming
Section titled “Feature: Asset Streaming”The AssetClient handles the secure, encrypted streaming of content (Textures, Models, Shaders) from the Entropy Grid to the local application.
Key Concepts
Section titled “Key Concepts”- Progressive Loading: Assets are streamed in chunks, allowing applications to prioritize critical content or display lower-resolution proxies while high-fidelity data loads.
- Encrypted Storage: All content is encrypted at rest and in transit. The client handles decryption transparently.
- Deduplication: Assets are addressed by content hash (
AssetId). Identical files (e.g., a common texture used in multiple projects) are downloaded only once. - Local Cache: Frequently accessed assets are cached locally to minimize latency and bandwidth.
1. Resolution
Section titled “1. Resolution”The first step is to “Resolve” an asset ID. This checks the local cache and queries the server for metadata (size, hash, encryption key).
auto handle = client.assetClient()->resolve(myAssetId);2. Fetching
Section titled “2. Fetching”Once resolved, you request the content. The client manages the download, decryption, and reassembly.
client.assetClient()->fetch(myAssetId, [](std::optional<std::vector<uint8_t>> data, const std::string& error) { if (data) { Application::loadTexture(data.value()); }});3. Specialized Clients
Section titled “3. Specialized Clients”For complex data types, use the specialized interfaces:
- TextureClient: Streams mip-maps individually for optimal GPU usage.
- ShaderClient: Compiles and caches shader variants.
- UsdMeshExtractor: Extracts optimized geometry buffers from USD stages.