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

Re: [Public WebGL] Render to texture

> On Mon, Aug 30, 2010 at 12:20 PM,  <steve@sjbaker.org> wrote:
>> So is going via the DOM/canvas mechanism likely to hurt performance with
>> present implementations?  Would the image be copied from place to place?
>> (I confess my knowledge of what's going on here is a little vague -
>> please
>> educate me!)  Is there no way to render directly into a texture without
>> involving a canvas?
> Yes, there will currently be a significant performance penalty
> involved with rendering WebGL to one canvas and then uploading it as a
> texture to another one (or even within the same context -- although
> you can get the same effect with copyTexSubImage2D). This is true at
> least in the WebKit WebGL implementation.

I suppose there is at least some hope that copyTexSubImage2D would happen
entirely within the GPU...that might not be too terrible.

> The recommended way to perform render-to-texture of the color buffers
> in WebGL is to allocate an FBO and attach a texture as the color
> attachment. This functionality is supposed to be guaranteed on any
> platform claiming WebGL support. Note though the OpenGL ES 2.0 NPOT
> restrictions; see
> http://khronos.org/webgl/wiki/WebGL_and_OpenGL_Differences .
> -Ken

Is there an example someplace that uses the 'recommended' FBO approach?

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: