Struct webgl_stdweb::WEBGL_depth_texture
[−]
[src]
pub struct WEBGL_depth_texture(_);
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
Methods
impl WEBGL_depth_texture
[src]
pub const UNSIGNED_INT_24_8_WEBGL: GLenum
UNSIGNED_INT_24_8_WEBGL: GLenum = 34042
Trait Implementations
impl Debug for WEBGL_depth_texture
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Clone for WEBGL_depth_texture
[src]
fn clone(&self) -> WEBGL_depth_texture
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl AsRef<Reference> for WEBGL_depth_texture
[src]
impl ReferenceType for WEBGL_depth_texture
[src]
unsafe fn from_reference_unchecked(reference: Reference) -> Self
[src]
Converts a given reference into a concrete reference-like wrapper. Doesn't do any type checking; highly unsafe to use! Read more
impl From<WEBGL_depth_texture> for Reference
[src]
fn from(value: WEBGL_depth_texture) -> Self
[src]
Performs the conversion.
impl TryFrom<WEBGL_depth_texture> for Reference
[src]
type Error = Void
The type returned in the event of a conversion error.
fn try_from(value: WEBGL_depth_texture) -> Result<Self, Self::Error>
[src]
Performs the conversion.
impl TryFrom<Reference> for WEBGL_depth_texture
[src]
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(reference: Reference) -> Result<Self, Self::Error>
[src]
Performs the conversion.
impl<'_r> TryFrom<&'_r Reference> for WEBGL_depth_texture
[src]
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(reference: &Reference) -> Result<Self, Self::Error>
[src]
Performs the conversion.
impl TryFrom<Value> for WEBGL_depth_texture
[src]
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(value: Value) -> Result<Self, Self::Error>
[src]
Performs the conversion.
impl<'_r> TryFrom<&'_r Value> for WEBGL_depth_texture
[src]
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(value: &Value) -> Result<Self, Self::Error>
[src]
Performs the conversion.
impl JsSerialize for WEBGL_depth_texture
[src]
impl JsSerializeOwned for WEBGL_depth_texture
[src]
fn into_js_owned<'_a>(
value: &'_a mut Option<Self>,
arena: &'_a PreallocatedArena
) -> SerializedValue<'_a>
[src]
value: &'_a mut Option<Self>,
arena: &'_a PreallocatedArena
) -> SerializedValue<'_a>
fn memory_required_owned(&self) -> usize
[src]
impl<'_r> JsSerializeOwned for &'_r WEBGL_depth_texture
[src]
fn into_js_owned<'_a>(
value: &'_a mut Option<Self>,
arena: &'_a PreallocatedArena
) -> SerializedValue<'_a>
[src]
value: &'_a mut Option<Self>,
arena: &'_a PreallocatedArena
) -> SerializedValue<'_a>
fn memory_required_owned(&self) -> usize
[src]
impl InstanceOf for WEBGL_depth_texture
[src]
fn instance_of(reference: &Reference) -> bool
[src]
Checks whenever a given Reference if of type Self
.