Hacker News new | ask | show | jobs
by alexhaefner 4939 days ago
I respectfully disagree with your use of low level, though I do understand your analogy about the pixelbuffer being like a frame buffer.

But he's actually using Javascript arrays which can get passed around inside a javascript VM, and do not have a set size. Not very "low level".

I spent a moment and changed the arrays to Float32Arrays which have set sizes and sit in memory without being fucked with by the VM and sped the demo up dramatically.

http://jsfiddle.net/uzMPU/2612/

3 comments

If possible the map array should be uint8_t, while texmap uint32_t
Side by side, this is amazingly smoother than the OP.
For me, the difference is only visible using Firefox. Chromium even renders the inefficient original version smoothly.
The magic of Just In Time compilation perhaps?
Interesting -- this is slower on my iPad.