aboutsummaryrefslogtreecommitdiff
path: root/files/ru/web/api/webglrenderingcontext/enable/index.html
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:42:52 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:42:52 -0500
commit074785cea106179cb3305637055ab0a009ca74f2 (patch)
treee6ae371cccd642aa2b67f39752a2cdf1fd4eb040 /files/ru/web/api/webglrenderingcontext/enable/index.html
parentda78a9e329e272dedb2400b79a3bdeebff387d47 (diff)
downloadtranslated-content-074785cea106179cb3305637055ab0a009ca74f2.tar.gz
translated-content-074785cea106179cb3305637055ab0a009ca74f2.tar.bz2
translated-content-074785cea106179cb3305637055ab0a009ca74f2.zip
initial commit
Diffstat (limited to 'files/ru/web/api/webglrenderingcontext/enable/index.html')
-rw-r--r--files/ru/web/api/webglrenderingcontext/enable/index.html139
1 files changed, 139 insertions, 0 deletions
diff --git a/files/ru/web/api/webglrenderingcontext/enable/index.html b/files/ru/web/api/webglrenderingcontext/enable/index.html
new file mode 100644
index 0000000000..d7cc40db94
--- /dev/null
+++ b/files/ru/web/api/webglrenderingcontext/enable/index.html
@@ -0,0 +1,139 @@
+---
+title: WebGLRenderingContext.enable()
+slug: Web/API/WebGLRenderingContext/enable
+translation_of: Web/API/WebGLRenderingContext/enable
+---
+<div>{{APIRef("WebGL")}}</div>
+
+<p>Метод <strong><code>WebGLRenderingContext.enable()</code></strong> из <a href="/en-US/docs/Web/API/WebGL_API">WebGL API</a> активирует определенные возможности WebGL для текущего контекста.</p>
+
+<h2 id="Синтаксис">Синтаксис</h2>
+
+<pre class="syntaxbox">void <var>gl</var>.enable(<var>cap</var>);
+</pre>
+
+<h3 id="Параметры">Параметры</h3>
+
+<dl>
+ <dt><code>cap</code></dt>
+ <dd>A {{domxref("GLenum")}} specifying which WebGL capability to enable. Possible values:</dd>
+ <dd>
+ <table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">Константа</th>
+ <th scope="col">Описание</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td><code>gl.BLEND</code></td>
+ <td>Активирует с<span class="short_text" id="result_box" lang="ru"><span>мешение значений цветов вычисленного фрагмента</span></span>. Смотри {{domxref("WebGLRenderingContext.blendFunc()")}}.</td>
+ </tr>
+ <tr>
+ <td><code>gl.CULL_FACE</code></td>
+ <td>Активирует отбраковку полигонов. Смотри {{domxref("WebGLRenderingContext.cullFace()")}}.</td>
+ </tr>
+ <tr>
+ <td><code>gl.DEPTH_TEST</code></td>
+ <td>Активирует сравнения глубин и обновления для буфера глубины. Смотри {{domxref("WebGLRenderingContext.depthFunc()")}}.</td>
+ </tr>
+ <tr>
+ <td><code>gl.DITHER</code></td>
+ <td>Activates dithering of color components before they get written to the color buffer.</td>
+ </tr>
+ <tr>
+ <td><code>gl.POLYGON_OFFSET_FILL</code></td>
+ <td>Activates adding an offset to depth values of polygon's fragments. See {{domxref("WebGLRenderingContext.polygonOffset()")}}.</td>
+ </tr>
+ <tr>
+ <td><code>gl.SAMPLE_ALPHA_TO_COVERAGE</code></td>
+ <td>Activates the computation of a temporary coverage value determined by the alpha value.</td>
+ </tr>
+ <tr>
+ <td><code>gl.SAMPLE_COVERAGE</code></td>
+ <td>Activates ANDing the fragment's coverage with the temporary coverage value. See {{domxref("WebGLRenderingContext.sampleCoverage()")}}.</td>
+ </tr>
+ <tr>
+ <td><code>gl.SCISSOR_TEST</code></td>
+ <td>Activates the scissor test that discards fragments that are outside of the scissor rectangle. See {{domxref("WebGLRenderingContext.scissor()")}}.</td>
+ </tr>
+ <tr>
+ <td><code>gl.STENCIL_TEST</code></td>
+ <td>Activates stencil testing and updates to the stencil buffer. See {{domxref("WebGLRenderingContext.stencilFunc()")}}.</td>
+ </tr>
+ </tbody>
+ </table>
+ When using a {{domxref("WebGL2RenderingContext", "WebGL 2 context", "", 1)}}, the following values are available additionally:
+
+ <table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">Constant</th>
+ <th scope="col">Description</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td><code>gl.RASTERIZER_DISCARD</code></td>
+ <td>Primitives are discarded immediately before the rasterization stage, but after the optional transform feedback stage. <code>gl.clear()</code> commands are ignored.</td>
+ </tr>
+ </tbody>
+ </table>
+ </dd>
+</dl>
+
+<h3 id="Return_value">Return value</h3>
+
+<p>None.</p>
+
+<h2 id="Examples">Examples</h2>
+
+<pre class="brush: js">gl.enable(gl.DITHER);
+</pre>
+
+<p>To check if a capability is enabled, use the {{domxref("WebGLRenderingContext.isEnabled()")}} method:</p>
+
+<pre class="brush: js">gl.isEnabled(gl.DITHER);
+// true
+</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.14.3", "enable")}}</td>
+ <td>{{Spec2('WebGL')}}</td>
+ <td>Initial definition for WebGL.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('OpenGL ES 2.0', "glEnable.xml", "glEnable")}}</td>
+ <td>{{Spec2('OpenGL ES 2.0')}}</td>
+ <td>Man page of the OpenGL ES 2.0 API.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('OpenGL ES 3.0', "glEnable.xhtml", "glEnable")}}</td>
+ <td>{{Spec2('OpenGL ES 3.0')}}</td>
+ <td>Man page of the OpenGL ES 3.0 API.</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Browser_compatibility">Browser compatibility</h2>
+
+<p class="hidden">The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> and send us a pull request.</p>
+
+<p>{{Compat("api.WebGLRenderingContext.enable")}}</p>
+
+<h2 id="See_also">See also</h2>
+
+<ul>
+ <li>{{domxref("WebGLRenderingContext.disable()")}}</li>
+ <li>{{domxref("WebGLRenderingContext.isEnabled()")}}</li>
+</ul>