[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Public WebGL] Matrix objects in JavaScript



That's a helpful resource, thanks for pointing it out!

I still question whether a straight emscripten build would outperform a hand written JS lib, primarily because you'll want to interact with a wrapper layer of marshaling functions. But if you can cleanly map your matrices to views I think asm.js enabled browsers would have a good shot at taking the performance crown in this case.

I'd love to see some benchmarks on this!


On Thu, Mar 21, 2013 at 9:59 AM, Benoit Jacob <bjacob@mozilla.com> wrote:
On 13-03-21 12:54 PM, Brandon Jones wrote:
On Thu, Mar 21, 2013 at 9:40 AM, Benoit Jacob <bjacob@mozilla.com> wrote:

Can't you just create a typed array view on the part of the heap ArrayBuffer that is of interest to you?


Yes, although you have to ensure that the heap pointers are aligned on 4 byte boundaries (assuming you're using floats). Not sure if emscripten's allocation systems would allow for that nicely. Do you have any insight on that?

Based on limited understanding of https://github.com/kripken/emscripten/wiki/Code-Generation-Modes and some common sense (don't take my word from granted) I would say you're safe.

Benoit


--Brandon