I am loading .obj models using the preload
EMSCRIPTEN flag so that I am able to use them in WASM/WebGL from C++/OpenGL ES, the memory consumption goes over the limit when loading a 64mb .obj, I am able to load smaller models but from that size onward I crash. What is the correct way of loading large files so that I can access them in C++? I also tried the embed
command but that doesn't work either.
Asked
Active
Viewed 187 times
0

Rabbid76
- 202,892
- 27
- 131
- 174

Felipe Gutierrez
- 675
- 6
- 17
1 Answers
0
For a large file, place it in the server as a static resource and use the Fetch API. You can let the browser cache it by using the EMSCRIPTEN_FETCH_PERSIST_FILE
flag. It uses the HTML5 IndexedDB designed to store large data, such as 1GB. See this question for the size limit.

relent95
- 3,703
- 1
- 14
- 17