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

Re: [Public WebGL] Render to texture



Of course we're using WebGL so you the DOM available.  You could _technically_ rendering to one webgl canvas, and then load that webgl canvas as a texture into another one (and presumably if it were deemed important enough implementations would optimise that use case to avoid too much copying)

--Oliver

On Aug 30, 2010, at 10:31 AM, Kenneth Russell wrote:

> On Mon, Aug 30, 2010 at 8:29 AM,  <steve@sjbaker.org> wrote:
>> Are there any examples out there of the correct way to set up for
>> rendering to texture - and (especially) setting up rendering to and
>> reading back from depth buffer textures?   Getting the latter to work
>> portably is always a bitch...I'd like to get the 'official' way to do it.
> 
> Rendering to a depth texture isn't supported in core OpenGL ES 2.0 and
> therefore not in WebGL without an extension (GL_OES_depth_texture).
> However, you can approximate it by writing your normalized depth value
> into the color channels of an RGBA texture. One example of this
> technique is in the Shadow Mapping sample of the O3D/WebGL library;
> see http://code.google.com/p/o3d/wiki/Samples . There's another in
> SpiderGL; see http://www.spidergl.org/example.php?id=6 .
> 
> -Ken
> 
> -----------------------------------------------------------
> 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:
> 


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