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

Re: [Public WebGL] 2d canvas context to WebGL



There is definitely code in Chrome to make Canvas -> WebGL uploads
efficient (as well as the reverse direction), but I believe there are
still some slow paths. See
https://code.google.com/p/chromium/issues/detail?id=233205 for
example. I don't know how much of this made it in to Safari.



On Wed, Apr 24, 2013 at 1:59 PM, Rik Cabanier <cabanier@gmail.com> wrote:
> Great!
> So Safari and Chrome implement this efficiently? Also is this documented
> somewhere?
>
>
> On Wed, Apr 24, 2013 at 1:47 PM, Benoit Jacob <bjacob@mozilla.com> wrote:
>>
>>
>> A 2D canvas can be passed directly to WebGL texImage2D.
>>
>> This happens to be slow in Firefox at the moment (the canvas is
>> currently read back and re-uploaded), but that could probably be fixed
>> if there is real-world pressure in that direction.
>>
>> Benoit
>>
>> On 13-04-24 04:23 PM, Rik Cabanier wrote:
>> > All,
>> >
>> > Sorry if this is already documented but is there a way to efficiently
>> > use a 2d canvas context in WebGL?
>> > We've seen cases where people want to apply effects on 2d contexts and
>> > they're doing this by copying the 2d canvas to a buffer, running a
>> > shader on it and getting the result back.
>> > This is an expensive workflow both in time and memory.
>> >
>> > Since the 2d canvas is already on the GPU (on most browsers), is there
>> > a way to directly access it from WebGL?
>> >
>> > Thanks!
>>
>>
>> -----------------------------------------------------------
>> 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
>> -----------------------------------------------------------
>>
>

-----------------------------------------------------------
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
-----------------------------------------------------------