Struct webgl_stdweb::WEBGL_depth_texture
source · pub struct WEBGL_depth_texture(_);
Expand description
Extension
This extension exposes the ANGLE_depth_texture functionality to WebGL. ANGLE_depth_texture provides a subset of the functionality from the OpenGL ES 2.0 extensions OES_depth_texture and OES_packed_depth_stencil, with certain restrictions added for portability reasons. Specifically:
- ANGLE_depth_texture provides both depth and depth/stencil textures.
- ANGLE_depth_texture does not provide the DEPTH24_STENCIL8_OES renderbuffer internal format from the OES_packed_depth_stencil extension. The core WebGL specification already supports allocation of depth/stencil renderbuffers.
- ANGLE_depth_texture does not support loading image data via the TexImage or TexSubImage commands. Depth and depth/stencil textures created via this extension can only have their contents specified by rendering to them.
Consult the Errors section below for specific restrictions. The texImage2D entry point is extended to accept the format parameter DEPTH_COMPONENT and DEPTH_STENCIL The texImage2D entry point is extended to accept the internalFormat parameter DEPTH_COMPONENT and DEPTH_STENCIL The texImage2D entry point is extended to accept the type parameter UNSIGNED_SHORT, UNSIGNED_INT, and UNSIGNED_INT_24_8_WEBGL The framebufferTexture2D entry point is extended to accept the target parameter DEPTH_ATTACHMENT and DEPTH_STENCIL_ATTACHMENT The texImage2D entry point is extended to accept ArrayBufferView of type Uint16Array and Uint32Array
The WebGL-specific constraints about Framebuffer Object Attachments are extended:
- A texture attached to an FBO’s DEPTH_ATTACHMENT attachment point must be allocated with the DEPTH_COMPONENT internal format.
- A texture attached to the DEPTH_STENCIL_ATTACHMENT attachment point must be allocated with the DEPTH_STENCIL internal format.
In the WebGL API, it is an error to concurrently attach either renderbuffers or textures to the following combinations of attachment points:
- DEPTH_ATTACHMENT + DEPTH_STENCIL_ATTACHMENT
- STENCIL_ATTACHMENT + DEPTH_STENCIL_ATTACHMENT
- DEPTH_ATTACHMENT + STENCIL_ATTACHMENT
See the section Framebuffer Object Attachments in the WebGL specification for the behavior if these constraints are violated.
As per the OpenGL ES spec, there is no guarantee that the OpenGL ES implementation will use the texture type to determine how to store the depth texture internally. It may choose to downsample the 32-bit depth values to 16-bit or even 24-bit. When a depth or depth/stencil texture is attached to a framebuffer object, calls to getParameter with the DEPTH_BITS and STENCIL_BITS enums return the following: Texture Type DEPTH_BITS (GLint) STENCIL_BITS (GLint) UNSIGNED_SHORT >= 16 0 UNSIGNED_INT >= 16 0 UNSIGNED_INT_24_8_WEBGL >= 24 >= 8
Implementations
sourceimpl WEBGL_depth_texture
impl WEBGL_depth_texture
pub const UNSIGNED_INT_24_8_WEBGL: GLenum = 34_042u32
Trait Implementations
sourceimpl AsRef<Reference> for WEBGL_depth_texture
impl AsRef<Reference> for WEBGL_depth_texture
sourceimpl Clone for WEBGL_depth_texture
impl Clone for WEBGL_depth_texture
sourcefn clone(&self) -> WEBGL_depth_texture
fn clone(&self) -> WEBGL_depth_texture
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresourceimpl Debug for WEBGL_depth_texture
impl Debug for WEBGL_depth_texture
sourceimpl From<WEBGL_depth_texture> for Reference
impl From<WEBGL_depth_texture> for Reference
sourcefn from(value: WEBGL_depth_texture) -> Self
fn from(value: WEBGL_depth_texture) -> Self
sourceimpl InstanceOf for WEBGL_depth_texture
impl InstanceOf for WEBGL_depth_texture
sourcefn instance_of(_reference: &Reference) -> bool
fn instance_of(_reference: &Reference) -> bool
Self
.