Author Topic: JSFBGL :: Javascript Framebuffer Graphic Library  (Read 7656 times)

0 Members and 1 Guest are viewing this topic.

Offline benny!

  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4380
  • Karma: 228
  • in this place forever!
    • View Profile
    • bennyschuetz.com - mycroBlog
Re: JSFBGL :: Javascript Framebuffer Graphic Library
« Reply #20 on: April 25, 2007 »
Thanks for pointing this out. To be honest. I had the idea once to manipulate a tables
background cell color ... and the creation of this lib was pure fun. I didn't make any
research on the net if there are better ways to achieve the same fx.

But this link/idea sounds pretty interesting. Will have a look on it - if I have some spare
times and maybe rewrite the lib. Thanks a lot, p01 !!!
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Offline rdc

  • Pentium
  • *****
  • Posts: 1495
  • Karma: 140
  • Yes, it is me.
    • View Profile
    • Clark Productions
Re: JSFBGL :: Javascript Framebuffer Graphic Library
« Reply #21 on: April 25, 2007 »
Very cool indeed.

Offline p01

  • Atari ST
  • ***
  • Posts: 158
  • Karma: 51
    • View Profile
    • www.p01.org
Re: JSFBGL :: Javascript Framebuffer Graphic Library
« Reply #22 on: April 25, 2007 »
Glad you like the technique :)

To make it more like an LFB, you can store the BMP header, and have an array with one entry per pixel, then output the whole thing using:

Code: [Select]
targetImg.src = BMPHeader+LFBArray.join('');
The join() method is really fast, and this way you can maintain parts of the image and only update a few pixels with no overhead at all.


Offline p01

  • Atari ST
  • ***
  • Posts: 158
  • Karma: 51
    • View Profile
    • www.p01.org
Re: JSFBGL :: Javascript Framebuffer Graphic Library
« Reply #23 on: April 25, 2007 »
Quote
I had the idea once to manipulate a tables
background cell color ... and the creation of this lib was pure fun. I didn't make any research on the net if there are better ways to achieve the same fx.
Although that doesn't really mean anything, I've never seen anyone else generating images, let alone on the fly, using JavaScript and data: URL.


The one zillion DID/TD techniques on the other hand are widely spread. The good thing about them is that they are so basic that they work on any half decent browser. Unfortunately, even if you only update the necessary cells/pixels, it is quite slow. Don't expect to get a good framerate with anything around 64x64 or higher.


For instance, I coded a fire effect using both techniques. Here are the results on my crappy 800mhz laptop:

  • one zillion DIV/TD technique using 36x22 = 762 pixels = ~4 fps

  • BMP image generation using 96x48 = 4,608 pixels = ~14 fps


Offline benny!

  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4380
  • Karma: 228
  • in this place forever!
    • View Profile
    • bennyschuetz.com - mycroBlog
Re: JSFBGL :: Javascript Framebuffer Graphic Library
« Reply #24 on: April 25, 2007 »
...
For instance, I coded a fire effect using both techniques. Here are the results on my crappy 800mhz laptop:

  • one zillion DIV/TD technique using 36x22 = 762 pixels = ~4 fps

  • BMP image generation using 96x48 = 4,608 pixels = ~14 fps
...

This sounds great for sure. I really keep this in mind when I have some spare time to spend
some more time on it !!! Sounds very cool indeed!
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won: