ANGLE_instanced_arrays: vertexAttribDivisorANGLE() method

فهرست فصل‌ها دانلود آرشیوناشر

MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونه‌کد

{{APIRef("WebGL")}}{{AvailableInWorkers}}

The ANGLE_instanced_arrays.vertexAttribDivisorANGLE() method of the WebGL API modifies the rate at which generic vertex attributes advance when rendering multiple instances of primitives with {{domxref("ANGLE_instanced_arrays.drawArraysInstancedANGLE()", "ext.drawArraysInstancedANGLE()")}} and {{domxref("ANGLE_instanced_arrays.drawElementsInstancedANGLE()", "ext.drawElementsInstancedANGLE()")}}.

توجه: When using {{domxref("WebGL2RenderingContext", "WebGL2")}}, this method is available as {{domxref("WebGL2RenderingContext.vertexAttribDivisor()", "gl.vertexAttribDivisor()")}} by default.

Syntax

js-nolint
vertexAttribDivisorANGLE(index, divisor)

Parameters

  • index
  • : A {{domxref("WebGL_API/Types", "GLuint")}} specifying the index of the generic vertex attributes.
  • divisor
  • : A {{domxref("WebGL_API/Types", "GLuint")}} specifying the number of instances that will pass between updates of the generic attribute.

Return value

None ({{jsxref("undefined")}}).

Examples

js
const ext = gl.getExtension("ANGLE_instanced_arrays");
ext.vertexAttribDivisorANGLE(0, 2);

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also

  • {{domxref("ANGLE_instanced_arrays.drawArraysInstancedANGLE()", "ext.drawArraysInstancedANGLE()")}}
  • {{domxref("ANGLE_instanced_arrays.drawElementsInstancedANGLE()", "ext.drawElementsInstancedANGLE()")}}
  • {{domxref("WebGLRenderingContext.drawArrays()")}}
  • {{domxref("WebGLRenderingContext.drawElements()")}}
  • {{domxref("WebGL2RenderingContext.drawArraysInstanced()")}}
  • {{domxref("WebGL2RenderingContext.drawElementsInstanced()")}}
  • {{domxref("WebGL2RenderingContext.vertexAttribDivisor()")}}