[][src]Struct ugli_webgl::WEBGL_depth_texture

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]

Trait Implementations

impl AsRef<Reference> for WEBGL_depth_texture[src]

impl Clone for WEBGL_depth_texture[src]

impl Debug for WEBGL_depth_texture[src]

impl Extension for WEBGL_depth_texture[src]

impl From<WEBGL_depth_texture> for Reference[src]

impl InstanceOf for WEBGL_depth_texture[src]

impl JsSerialize for WEBGL_depth_texture[src]

impl JsSerializeOwned for WEBGL_depth_texture[src]

impl<'_r> JsSerializeOwned for &'_r WEBGL_depth_texture[src]

impl ReferenceType for WEBGL_depth_texture[src]

impl<'_r> TryFrom<&'_r Reference> for WEBGL_depth_texture[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl<'_r> TryFrom<&'_r Value> for WEBGL_depth_texture[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl TryFrom<Reference> for WEBGL_depth_texture[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl TryFrom<Value> for WEBGL_depth_texture[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl TryFrom<WEBGL_depth_texture> for Reference[src]

type Error = Void

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.