Skip to content

Asset Client

The AssetClient handles the secure, encrypted streaming of content (Textures, Models, Shaders) from the Entropy Grid to the local application.

  • 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.

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);

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());
}
});

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.