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 1045196 of WebGLTransformFeedback

  • Revision slug: Web/API/WebGLTransformFeedback
  • Revision title: WebGLTransformFeedback
  • Revision id: 1045196
  • Created:
  • Creator: fscholz
  • Is current revision? Yes
  • Comment new page

Revision Content

{{APIRef("WebGL")}} {{SeeCompatTable}}

The WebGLTransformFeedback interface is part of the WebGL 2 API and enables transform feedback, which is the process of capturing primitives generated by vertex processing. It allows to preserve the post-transform rendering state of an object and resubmit this data multiple times.

When working with WebGLTransformFeedback objects, the following methods of the {{domxref("WebGL2RenderingContext")}} are useful:

  • {{domxref("WebGL2RenderingContext.createTransformFeedback()")}}
  • {{domxref("WebGL2RenderingContext.deleteTransformFeedback()")}}
  • {{domxref("WebGL2RenderingContext.isTransformFeedback()")}}
  • {{domxref("WebGL2RenderingContext.bindTransformFeedback()")}}
  • {{domxref("WebGL2RenderingContext.beginTransformFeedback()")}}
  • {{domxref("WebGL2RenderingContext.endTransformFeedback()")}}
  • {{domxref("WebGL2RenderingContext.pauseTransformFeedback()")}}
  • {{domxref("WebGL2RenderingContext.resumeTransformFeedback()")}}
  • {{domxref("WebGL2RenderingContext.transformFeedbackVaryings()")}}
  • {{domxref("WebGL2RenderingContext.getTransformFeedbackVarying()")}}

Examples

Creating a WebGLTransformFeedback object

in this example, gl must be a {{domxref("WebGL2RenderingContext")}}. WebGLTransformFeedback objects are not available in WebGL 1.

var transformFeedback = gl.createTransformFeedback();

Specifications

Specification Status Comment
{{SpecName('WebGL2', "#3.5", "WebGLTransformFeedback")}} {{Spec2('WebGL2')}} Initial definition.

Browser compatibility

{{CompatibilityTable}}
Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support {{CompatNo}} [2] {{CompatNightly}} [1] {{CompatNo}} {{CompatNo}} {{CompatNo}}
Feature Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support {{CompatNo}} {{CompatNo}} {{CompatNo}} {{CompatNo}} {{CompatNo}} {{CompatNo}}

[1] WebGL 2 is enabled by default in Firefox Nightly. To enable it in a release version of Firefox, set the preference webgl.enable-prototype-webgl2 to true in about:config.

[2] To use an experimental implementation of WebGL 2 in Chrome, you have to start Chrome with the runtime flag --enable-unsafe-es3-apis.

Revision Source

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

<p>The <strong><code>WebGLTransformFeedback</code></strong> interface is part of the <a href="/en-US/docs/Web/API/WebGL_API">WebGL 2</a> API and enables transform feedback, which is the process of capturing primitives generated by vertex processing. It allows to preserve the post-transform rendering state of an object and resubmit this data multiple times.</p>

<p>When working with <code>WebGLTransformFeedback</code> objects, the following methods of the {{domxref("WebGL2RenderingContext")}} are useful:</p>

<ul>
 <li>{{domxref("WebGL2RenderingContext.createTransformFeedback()")}}</li>
 <li>{{domxref("WebGL2RenderingContext.deleteTransformFeedback()")}}</li>
 <li>{{domxref("WebGL2RenderingContext.isTransformFeedback()")}}</li>
 <li>{{domxref("WebGL2RenderingContext.bindTransformFeedback()")}}</li>
 <li>{{domxref("WebGL2RenderingContext.beginTransformFeedback()")}}</li>
 <li>{{domxref("WebGL2RenderingContext.endTransformFeedback()")}}</li>
 <li>{{domxref("WebGL2RenderingContext.pauseTransformFeedback()")}}</li>
 <li>{{domxref("WebGL2RenderingContext.resumeTransformFeedback()")}}</li>
 <li>{{domxref("WebGL2RenderingContext.transformFeedbackVaryings()")}}</li>
 <li>{{domxref("WebGL2RenderingContext.getTransformFeedbackVarying()")}}</li>
</ul>

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

<h3 id="Creating_a_WebGLSync_object">Creating a <code>WebGLTransformFeedback</code> object</h3>

<p>in this example, <code>gl</code> must be a {{domxref("WebGL2RenderingContext")}}. <code>WebGLTransformFeedback</code> objects are not available in WebGL 1.</p>

<pre class="brush: js">
var transformFeedback = gl.createTransformFeedback();</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('WebGL2', "#3.5", "WebGLTransformFeedback")}}</td>
   <td>{{Spec2('WebGL2')}}</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>{{CompatNo}} [2]</td>
   <td>{{CompatNightly}} [1]</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</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>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
  </tr>
 </tbody>
</table>
</div>

<p>[1] WebGL 2 is enabled by default in Firefox Nightly. To enable it in a release version of Firefox, set the preference <code>webgl.enable-prototype-webgl2</code> to <code>true</code> in about:config.</p>

<p>[2] To use an experimental implementation of WebGL 2 in Chrome, you have to start Chrome with the runtime flag <code>--enable-unsafe-es3-apis</code>.</p>
Revert to this revision