Results 1 to 2 of 2

Thread: Can I pass a JavaScript byte array to glTexImage2D?

  1. #1
    Junior Member
    Join Date
    Dec 2010
    Posts
    5

    Can I pass a JavaScript byte array to glTexImage2D?

    I intend to continuously generate images in memory, then send them to glTexImage2D.

    Is it possible to send JavaScript arrays directly? Because all the WebGL examples I saw are using HTML Image objects. That's not what I need.

    Also, some people suggested the use of the Canvas object, but seems that Canvas is slow. Since I already have all the pixels in an array, do I really need a Canvas as mediator?

  2. #2

    Re: Can I pass a JavaScript byte array to glTexImage2D?

    Quote Originally Posted by zexx
    I intend to continuously generate images in memory, then send them to glTexImage2D.

    Is it possible to send JavaScript arrays directly? Because all the WebGL examples I saw are using HTML Image objects. That's not what I need.

    Also, some people suggested the use of the Canvas object, but seems that Canvas is slow. Since I already have all the pixels in an array, do I really need a Canvas as mediator?
    I cannot give you an exact how to however I know it is possible to create image objects from byte arrays.

Similar Threads

  1. Can we use WebGL only by Javascript?
    By lfyos in forum WebGL - General
    Replies: 5
    Last Post: 11-30-2011, 07:56 AM
  2. Replies: 3
    Last Post: 07-04-2010, 02:57 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •