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

Re: [Public WebGL] Matrix objects in JavaScript

Emscripten+ASM.js is a pretty good perf answer, especially given what optimizations can be done by llvm, templates, and friends.

I absolutely agree that adding a built-in matrix type to the browser is going to be cruft, especially compared to other things we could be doing.

I would also really like to see what usecases would even benefit from accelerating these operations. Especially for WebGL, the actual number of matrix computations done in client code is usually quite small.


----- Original Message -----
From: "Gregg Tavares" <gman@google.com>
To: "Brandon Jones" <bajones@google.com>
Cc: "Benoit Jacob" <bjacob@mozilla.com>, "Tony Parisi" <tparisi@gmail.com>, "Florian Bösch" <pyalot@gmail.com>, "public webgl" <public_webgl@khronos.org>
Sent: Thursday, March 21, 2013 10:14:05 AM
Subject: Re: [Public WebGL] Matrix objects in JavaScript

I don't think using emscripten to compile C++ to JS is really the answer. Rather I see the examples that emscripten and asm.js suggest for perf that means you can could write a JS library that gives you the perf you want. 

I'm absolutely against having a Matrix library built into the browser. It won't fit most use cases. It will be slower than ones like glMatrix. It will end up being cruft in the browser with a maintenance burden that means people will have to spend time on it when they could be spending time on more useful features. 

On Thu, Mar 21, 2013 at 9:54 AM, Brandon Jones < bajones@google.com > 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? 


You are currently subscribed to public_webgl@khronos.org.
To unsubscribe, send an email to majordomo@khronos.org with
the following command in the body of your email:
unsubscribe public_webgl