Dear List,

I've been using Emscripten to port an OpenGL project and I am
impressed by how well it works, so far.

My original code decompresses JPEG images and loads them into
textures on background threads. For Emscripten I've disabled that,
and it does impact performance.

I am wondering whether the best solution to this would be to
download, decode and load the images in Javascript. Specifically,
MDN has an example here:

https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Tutorial/Using_textures_in_WebGL

Basically it creates an Image object, sets its src attribute
to the URL to download, and sets an onload handler that calls
gl.texImage2D to load it into a texture.

Potentially, this might use more efficient JPEG decoding and
might do that decoding on a different thread.

Has anyone tried anything like this? Does anyone know whether
browsers do, in practice, use secondary threads and/or faster
decoders than libjpeg-turbo, for decoding JPEGs?


Thanks,

Phil.




--
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/emscripten-discuss/1613328173462%40dmwebmail.dmwebmail.chezphil.org.

Reply via email to