Sunday, May 2, 2010

Gouraud Shading in JavaScript :-)

[Update I just changed demo to new version, now on my machine it reaches speed from 90 to 100-110 fps per second :-)]

I was wondering if it is even possible to create Gouraud Shading with JavaScript.

And answer is yes :-)

Here is a proof on youtube :-)

I was wondering also if it is possible to run it on G1 on Android 1.6, and answer is also yes:

As you can see on Chrome we have about 30-40 fps [when recording was of it was almost always near 50 fps on my laptop with Intel Core Duo 2 2.2 GHz on Chrome 5, 20-25 fps on Firefox], on G1 it was only 0.5 fps :-)

If you want to check how it will work on your machine you may try:

If you are reading this post by RSS or Buzz you may use direct link to demo :-)

It will work on Chrome, Chromium and Firefox. I don't know why it doesn't work on Opera :-(

Earlier versions of this worked about 5-10 times slower but it was caused by using fillRect(int,int,int,int) of Canvas object, now I'm working directly with pixels and this gives us big speed boost :-)

Similar postsbeta
Chrome OS and Java
Which language is fastest? ;-)
How to detect clickbaits?
Chrome2Chrome - lets move browser tabs between computers ;-)
OOo2GD - surveys results

No comments:

Post a Comment