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

Re: [Public WebGL] Depth Texture Extension




On 2012-01-24, at 4:20 PM, Florian Bösch wrote:

So to summarize:

With target TEXTURE_2D depth textures are possible right now for these conditions:
- OpenGL ES 2.0: OES_depth_texture with and UNSIGNED_SHORT or UNSIGNED_INT
- Direct3D 9: INTZ and DF16
Just INTZ is strictly speaking sufficient.

- OpenGL: GL_ARB_depth_texture and DEPTH_COMPONENT16 or DEPTH_COMPONENT32
With target TEXTURE_CUBE_MAP it should be possible in OpenGL ES 2.0 and OpenGL but not in Direct 3D 9. To address this issue we can seek these remedies:
1) We exclude TEXTURE_CUBE_MAP from accepting calls with the texture2D entry point, effectively excluding depth cubemap support
This is what ARB_depth_texture does.

2) We could split the extension into two parts (for TEXTURE_2D and TEXTURE_CUBE_MAP)
This is the same as 1), but with a second extension to add in the removed stuff.

3) We perform the check of support at validation time of the FBO which would fail on Direct3D 9 for TEXTURE_CUBE_MAP

This is not an appropriate use of FRAMEBUFFER_UNSUPPORTED.  In D3D9 you can't even create a depth cube texture so there is no point in waiting to draw-time to enforce that.

/Daniel/


I personally prefer option 3, because it leaves it open to use depth cubemaps on implementations that support them, and FBO validation has to happen anyway.

Supported mobile devices: OES_depth_texutre is supported by 326 devices (attachment support.txt).
<support.txt>

---
                        Daniel Koch -+- daniel@transgaming.com
Senior Graphics Architect -+- TransGaming Inc.  -+- www.transgaming.com