Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 1017383 of WEBGL_depth_texture

  • Revision slug: Web/API/WEBGL_depth_texture
  • Revision title: WEBGL_depth_texture
  • Revision id: 1017383
  • Created:
  • Creator: fscholz
  • Is current revision? No
  • Comment

Revision Content

{{APIRef("WebGL")}}

The WEBGL_depth_texture extension is part of the WebGL API and defines 2D depth and depth-stencil textures.

WebGL extensions are available using the {{domxref("WebGLRenderingContext.getExtension()")}} method. For more information, see also Using Extensions in the WebGL tutorial.

Constants

This extension adds a new constant:

ext.UNSIGNED_INT_24_8_WEBGL
Unsigned integer type for 24-bit depth texture data.

Extended methods

This extension extends {{domxref("WebGLRenderingContext.texImage2D()")}}:

  • The format and internalformat parameters now accept gl.DEPTH_COMPONENT and gl.DEPTH_STENCIL.
  • The type parameter now accepts gl.UNSIGNED_SHORT, gl.UNSIGNED_INT, and ext.UNSIGNED_INT_24_8_WEBGL.
  • The pixels parameter now accepts an ArrayBufferView of type Uint16Array and Uint32Array.

This extension extends {{domxref("WebGLRenderingContext.framebufferTexture2D()")}}:

  • The target parameter now accepts gl.DEPTH_ATTACHMENT and gl.DEPTH_STENCIL_ATTACHMENT.

Examples

var ext = gl.getExtension("WEBGL_depth_texture");
// TBD

Specifications

Specification Status Comment
{{SpecName('WEBGL_depth_texture', "", "WEBGL_depth_texture")}} {{Spec2('WEBGL_depth_texture')}} Initial definition.

Browser compatibility

{{CompatibilityTable}}
Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support {{CompatUnknown}} {{CompatGeckoDesktop("22.0")}} [1] {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}
Feature Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}} {{CompatUnknown}}

[1] This extension was prefixed with MOZ_ in prior versions.

See also

  • {{domxref("WebGLRenderingContext.getExtension()")}}
  • {{domxref("WebGLRenderingContext.texImage2D()")}}
  • {{domxref("WebGLRenderingContext.framebufferTexture2D()")}}

Revision Source

<div>{{APIRef("WebGL")}}</div>

<p>The <code><strong>WEBGL_depth_texture</strong></code> extension is part of the <a href="/en-US/docs/Web/API/WebGL_API">WebGL API</a> and defines 2D depth and depth-stencil textures.</p>

<p>WebGL extensions are available using the {{domxref("WebGLRenderingContext.getExtension()")}} method. For more information, see also <a href="/en-US/docs/Web/API/WebGL_API/Using_Extensions">Using Extensions</a> in the <a href="/en-US/docs/Web/API/WebGL_API/Tutorial">WebGL tutorial</a>.</p>

<h2 id="Constants">Constants</h2>

<p>This extension adds a new constant:</p>

<dl>
 <dt><code>ext.UNSIGNED_INT_24_8_WEBGL</code></dt>
 <dd>Unsigned integer type for 24-bit depth texture data.</dd>
</dl>

<h2>Extended methods</h2>

<p>This extension extends {{domxref("WebGLRenderingContext.texImage2D()")}}:</p>

<ul>
 <li>The <code>format</code> and <code>internalformat</code> parameters now accept <code>gl.DEPTH_COMPONENT</code> and <code>gl.DEPTH_STENCIL</code>.</li>
 <li>The <code>type</code> parameter now accepts <code>gl.UNSIGNED_SHORT</code>, <code>gl.UNSIGNED_INT</code>, and <code>ext.UNSIGNED_INT_24_8_WEBGL</code>.</li>
 <li>The <code>pixels</code> parameter now accepts an <code>ArrayBufferView</code> of type <code>Uint16Array</code> and <code>Uint32Array</code>.</li>
</ul>

<p>This extension extends {{domxref("WebGLRenderingContext.framebufferTexture2D()")}}:</p>

<ul>
 <li>The <code>target</code> parameter now accepts <code>gl.DEPTH_ATTACHMENT</code> and <code>gl.DEPTH_STENCIL_ATTACHMENT</code>.</li>
</ul>

<h2 id="Examples">Examples</h2>

<pre class="brush:js">
var ext = gl.getExtension("WEBGL_depth_texture");
// TBD
</pre>

<h2 id="Specifications">Specifications</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
  <tr>
   <td>{{SpecName('WEBGL_depth_texture', "", "WEBGL_depth_texture")}}</td>
   <td>{{Spec2('WEBGL_depth_texture')}}</td>
   <td>Initial definition.</td>
  </tr>
 </tbody>
</table>

<h2 id="Browser_compatibility">Browser compatibility</h2>

<div>{{CompatibilityTable}}</div>

<div id="compat-desktop">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Chrome</th>
   <th>Firefox (Gecko)</th>
   <th>Internet Explorer</th>
   <th>Opera</th>
   <th>Safari</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatGeckoDesktop("22.0")}} [1]</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
  </tr>
 </tbody>
</table>
</div>

<div id="compat-mobile">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Android</th>
   <th>Chrome for Android</th>
   <th>Firefox Mobile (Gecko)</th>
   <th>IE Mobile</th>
   <th>Opera Mobile</th>
   <th>Safari Mobile</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>{{CompatUnknown}}</td>
  </tr>
 </tbody>
</table>
</div>

<p>[1] This extension was prefixed with <code>MOZ_</code> in prior versions.</p>

<h2 id="See_also">See also</h2>

<ul>
 <li>{{domxref("WebGLRenderingContext.getExtension()")}}</li>
 <li>{{domxref("WebGLRenderingContext.texImage2D()")}}</li>
 <li>{{domxref("WebGLRenderingContext.framebufferTexture2D()")}}</li>
</ul>
Revert to this revision