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

Re: [Public WebGL] Matrix objects in JavaScript

I agree that for all of the specialist math functions (inverse and such),
we're better off letting JavaScript handle it.  There are plenty of good
libraries out there - and if there is browser-engineer time available, I'd
rather it was spent on making JS faster than on writing and maintaining a
library like this.


The place where having some API support would be useful is in bulk

If I have 1,000 matrices that all need to be transformed in some way - or
if I have a bunch of vertices that need to be multiplied by matrices -
then there are massive gains to be had with machine-code that uses
specialised CPU instruction sets and GPU OpenCL stuff that the JS
optimizer is unlikely to be able to spot and take advantage of.  WebCL may
be able to handle that - but I doubt we'll get comprehensive support for
it on every platform as soon as we could get a set of simple operations
for bulk matrix/vector work.

So I think there would be value in defining a very minimal matrix library
to handle a minimal set of operations (multiply, translate, rotate maybe)
on large arrays of vertices and matrices.

  -- Steve

Benoit Jacob wrote:
> I have been arguing on public-fx that we are better off without a
> browser-supported matrix library because this is best done in JS both
> from the perspective of performance (giving it a bit of time for JS
> toolchains to solve roadblocks) and from the perspective of flexibility
> and not blessing an arbitrary choice of matrix library over other ones
> (and a poor one at that).
> Benoit
> On 13-03-21 07:04 AM, Si Robertson wrote:
>> I have to say I can not think of any reason for native matrix objects
>> to be implemented by browser vendors unless those objects (a) provide
>> a significant performance gain over custom code, and (b) are
>> compatible with WebGL.
>> Matrix operations that work on typed arrays are very fast already if
>> the code is optimised, and it is relatively easily to avoid creating
>> new type arrays when needed.
>> On 21 March 2013 10:24, Florian Bösch <pyalot@gmail.com
>> <mailto:pyalot@gmail.com>> wrote:
>>     On Thu, Mar 21, 2013 at 11:19 AM, Kirill Prazdnikov
>>     <kirill.prazdnikov@jetbrains.com
>>     <mailto:kirill.prazdnikov@jetbrains.com>> wrote:
>>         Will it be a helper library or part of WebGL API ?
>>     Neither. It would be implemented in the browser, not related to
>>     WebGL, and in  my opinion, unusable for it.

 -- Steve

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