Assets and IO
Assets are loaded through browser-like APIs but resolved to native IO.
fetch
fetch resolves URLs relative to a configurable asset root. In the initial
phase, only local files are supported. Future phases may add HTTP support.
Guidelines:
- URL parsing is minimal; no redirects in phase 1.
- Responses expose
arrayBuffer()andtext()as needed by Three.js loaders. - Binary data stays in contiguous buffers owned by the host.
Images
ImageandcreateImageBitmapload common formats (PNG, JPEG).- Decode may be synchronous initially; later moved to background threads.
- Decoded pixel data is uploaded to GPU via the WebGL shim.
FileReader and Blobs
FileReadersupports the subset used for drag-and-drop assets.URL.createObjectURLreturns a short-lived token that maps to a host buffer.URL.revokeObjectURLreleases that buffer promptly.