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

Re: [Public WebGL] Render to texture



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: