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 995091 of WebGLFramebuffer

  • Revision slug: Web/API/WebGLFramebuffer
  • Revision title: WebGLFramebuffer
  • Revision id: 995091
  • Created:
  • Creator: fscholz
  • Is current revision? Yes
  • Comment Available to workers behind a pref (bug 709490)
Tags: 

Revision Content

{{APIRef("WebGL")}}

The WebGLFramebuffer interface is part of the WebGL API and represents a collection of buffers that serve as a rendering destination.

Description

The WebGLFramebuffer object does not define any methods or properties of its own and its content is not directly accessible. When working with WebGLFramebuffer objects, the following methods of the {{domxref("WebGLRenderingContext")}} are useful:

  • {{domxref("WebGLRenderingContext.bindFramebuffer()")}}
  • {{domxref("WebGLRenderingContext.createFramebuffer()")}}
  • {{domxref("WebGLRenderingContext.deleteFramebuffer()")}}
  • {{domxref("WebGLRenderingContext.isFramebuffer()")}}

Examples

Creating a frame buffer

var canvas = document.getElementById("canvas");
var gl = canvas.getContext("webgl");
var buffer = gl.createFramebuffer();

Specifications

Specification Status Comment
{{SpecName('WebGL', "#5.5", "WebGLFramebuffer")}} {{Spec2('WebGL')}} Initial definition.

Browser compatibility

{{CompatibilityTable}}
Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support {{CompatChrome("9")}} {{CompatGeckoDesktop("2.0")}} {{CompatIE("11")}} {{CompatOpera("12")}} {{CompatSafari("5.1")}}
Available in workers {{CompatNo}} {{CompatGeckoDesktop(44)}} [1] {{CompatNo}} {{CompatNo}} {{CompatNo}}
Feature Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support {{CompatUnknown}} 25 {{CompatVersionUnknown}} {{CompatUnknown}} 12 8.1
Available in workers {{CompatNo}} {{CompatNo}} {{CompatGeckoMobile(44)}} [1] {{CompatNo}} {{CompatNo}} {{CompatNo}}

[1] This feature is behind a feature preference setting. In about:config, set gfx.offscreencanvas.enabled to true.

See also

  • {{domxref("WebGLRenderingContext.bindFramebuffer()")}}
  • {{domxref("WebGLRenderingContext.createFramebuffer()")}}
  • {{domxref("WebGLRenderingContext.deleteFramebuffer()")}}
  • {{domxref("WebGLRenderingContext.isFramebuffer()")}}
  • Other buffers: {{domxref("WebGLBuffer")}}, {{domxref("WebGLRenderbuffer")}}

Revision Source

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

<p>The <strong>WebGLFramebuffer</strong> interface is part of the <a href="/en-US/docs/Web/API/WebGL_API">WebGL API</a> and represents a collection of buffers that serve as a rendering destination.</p>

<h2 id="Description">Description</h2>

<p>The <code>WebGLFramebuffer</code> object does not define any methods or properties of its own and its content is not directly accessible. When working with <code>WebGLFramebuffer</code> objects, the following methods of the {{domxref("WebGLRenderingContext")}} are useful:</p>

<ul>
 <li>{{domxref("WebGLRenderingContext.bindFramebuffer()")}}</li>
 <li>{{domxref("WebGLRenderingContext.createFramebuffer()")}}</li>
 <li>{{domxref("WebGLRenderingContext.deleteFramebuffer()")}}</li>
 <li>{{domxref("WebGLRenderingContext.isFramebuffer()")}}</li>
</ul>

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

<h3 id="Creating_a_frame_buffer">Creating a frame buffer</h3>

<pre class="brush: js">
var canvas = document.getElementById("canvas");
var gl = canvas.getContext("webgl");
var buffer = gl.createFramebuffer();
</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', "#5.5", "WebGLFramebuffer")}}</td>
   <td>{{Spec2('WebGL')}}</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>{{CompatChrome("9")}}</td>
   <td>{{CompatGeckoDesktop("2.0")}}</td>
   <td>{{CompatIE("11")}}</td>
   <td>{{CompatOpera("12")}}</td>
   <td>{{CompatSafari("5.1")}}</td>
  </tr>
  <tr>
   <td>Available in workers</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatGeckoDesktop(44)}} [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>{{CompatUnknown}}</td>
   <td>25</td>
   <td>{{CompatVersionUnknown}}</td>
   <td>{{CompatUnknown}}</td>
   <td>12</td>
   <td>8.1</td>
  </tr>
  <tr>
   <td>Available in workers</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatGeckoMobile(44)}} [1]</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
   <td>{{CompatNo}}</td>
  </tr>
 </tbody>
</table>
</div>

<p>[1] This feature is behind a feature preference setting. In about:config, set <code>gfx.offscreencanvas.enabled</code> to <code>true</code>.</p>

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

<ul>
 <li>{{domxref("WebGLRenderingContext.bindFramebuffer()")}}</li>
 <li>{{domxref("WebGLRenderingContext.createFramebuffer()")}}</li>
 <li>{{domxref("WebGLRenderingContext.deleteFramebuffer()")}}</li>
 <li>{{domxref("WebGLRenderingContext.isFramebuffer()")}}</li>
 <li>Other buffers: {{domxref("WebGLBuffer")}}, {{domxref("WebGLRenderbuffer")}}</li>
</ul>
Revert to this revision