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 1018292 of EXT_blend_minmax

  • Revision slug: Web/API/EXT_blend_minmax
  • Revision title: EXT_blend_minmax
  • Revision id: 1018292
  • Created:
  • Creator: fscholz
  • Is current revision? No
  • Comment new page - bug 973815

Revision Content

{{APIRef("WebGL")}}

The EXT_blend_minmax extension is part of the WebGL API and extends blending capabilities by adding two new blend equations: the minimum or maximum color components of the source and destination colors.

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

Availability: This extension is only available to {{domxref("WebGLRenderingContext", "WebGL1", "", 1)}} contexts. In {{domxref("WebGL2RenderingContext", "WebGL2", "", 1)}}, the functionality of this extension is available on the WebGL2 context by default. The constants in WebGL2 are gl.MIN and gl.MAX.

Constants

This extension adds two new constants:

ext.MIN_EXT
Produces the minimum color components of the source and destination colors.
ext.MAX_EXT
Produces the maximum color components of the source and destination colors.

Extended methods

This extension extends {{domxref("WebGLRenderingContext.blendEquation()")}} and {{domxref("WebGLRenderingContext.blendEquationSeparate()")}}:

  • The mode, modeRGB and modeAlpha parameters now accept ext.MIN_EXT and ext.MAX_EXT.

Examples

var ext = gl.getExtension("EXT_blend_minmax");

gl.blendEquation(ext.MIN_EXT);
gl.blendEquation(ext.MAX_EXT);

gl.blendEquationSeparate(ext.MIN_EXT, ext.MAX_EXT);

Specifications

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

Browser compatibility

{{CompatibilityTable}}
Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support {{CompatUnknown}} {{CompatGeckoDesktop("33.0")}} {{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}}

See also

  • {{domxref("WebGLRenderingContext.getExtension()")}}
  • {{domxref("WebGLRenderingContext.blendEquation()")}}
  • {{domxref("WebGLRenderingContext.blendEquationSeparate()")}}

Revision Source

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

<p>The <code><strong>EXT_blend_minmax</strong></code> extension is part of the <a href="/en-US/docs/Web/API/WebGL_API">WebGL API</a> and extends blending capabilities by adding two new blend equations: the minimum or maximum color components of the source and destination colors.</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>

<div class="note">
<p><strong>Availability:</strong> This extension is only available to {{domxref("WebGLRenderingContext", "WebGL1", "", 1)}} contexts. In {{domxref("WebGL2RenderingContext", "WebGL2", "", 1)}}, the functionality of this extension is available on the WebGL2 context by default. The constants in WebGL2 are <code>gl.MIN</code> and <code>gl.MAX</code>.</p>
</div>

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

<p>This extension adds two new constants:</p>

<dl>
 <dt><code>ext.MIN_EXT</code></dt>
 <dd>Produces the minimum color components of the source and destination colors.</dd>
 <dt><code>ext.MAX_EXT</code></dt>
 <dd>Produces the maximum color components of the source and destination colors.</dd>
</dl>

<h2 id="Extended_methods">Extended methods</h2>

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

<ul>
 <li>The <code>mode</code>, <code>modeRGB</code> and <code>modeAlpha</code> parameters now accept <code>ext.MIN_EXT</code> and <code>ext.MAX_EXT</code>.</li>
</ul>

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

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

gl.blendEquation(ext.MIN_EXT);
gl.blendEquation(ext.MAX_EXT);

gl.blendEquationSeparate(ext.MIN_EXT, ext.MAX_EXT);
</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('EXT_blend_minmax', '', 'EXT_blend_minmax')}}</td>
   <td>{{Spec2('EXT_blend_minmax')}}</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("33.0")}}</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>

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

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