[−][src]Struct ugli_webgl::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
[src]
Trait Implementations
impl AsRef<Reference> for WEBGL_depth_texture
[src]
impl Clone for WEBGL_depth_texture
[src]
fn clone(&self) -> WEBGL_depth_texture
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for WEBGL_depth_texture
[src]
impl Extension for WEBGL_depth_texture
[src]
impl From<WEBGL_depth_texture> for Reference
[src]
fn from(value: WEBGL_depth_texture) -> Self
[src]
impl InstanceOf for WEBGL_depth_texture
[src]
fn instance_of(_reference: &Reference) -> bool
[src]
impl JsSerialize for WEBGL_depth_texture
[src]
impl JsSerializeOwned for WEBGL_depth_texture
[src]
fn into_js_owned<'_a>(value: &'_a mut Option<Self>) -> SerializedValue<'_a>
[src]
impl<'_r> JsSerializeOwned for &'_r WEBGL_depth_texture
[src]
fn into_js_owned<'_a>(value: &'_a mut Option<Self>) -> SerializedValue<'_a>
[src]
impl ReferenceType for WEBGL_depth_texture
[src]
unsafe fn from_reference_unchecked(reference: Reference) -> Self
[src]
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]
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]
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]
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]
impl TryFrom<WEBGL_depth_texture> for Reference
[src]
Auto Trait Implementations
impl RefUnwindSafe for WEBGL_depth_texture
impl Send for WEBGL_depth_texture
impl Sync for WEBGL_depth_texture
impl Unpin for WEBGL_depth_texture
impl UnwindSafe for WEBGL_depth_texture
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,