本文整理匯總了TypeScript中neuroglancer/webgl/shader.ShaderProgram.attribute方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript ShaderProgram.attribute方法的具體用法?TypeScript ShaderProgram.attribute怎麽用?TypeScript ShaderProgram.attribute使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類neuroglancer/webgl/shader.ShaderProgram
的用法示例。
在下文中一共展示了ShaderProgram.attribute方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: disableCountingBuffer
export function disableCountingBuffer(gl: GL, shader: ShaderProgram, instanced = false) {
const location = shader.attribute('aIndexRaw');
if (location >= 0) {
if (instanced) {
gl.vertexAttribDivisor(location, 0);
}
gl.disableVertexAttribArray(location);
}
}
示例2: bind
bind(shader: ShaderProgram, divisor = 0) {
const location = shader.attribute('aIndexRaw');
if (location >= 0) {
this.bindToVertexAttrib(location);
if (divisor !== 0) {
this.gl.vertexAttribDivisor(location, divisor);
}
}
}
示例3: draw
draw(shader: ShaderProgram, numInstances: number) {
const aSphereVertex = shader.attribute('aSphereVertex');
this.vertexBuffer.bindToVertexAttrib(
aSphereVertex, /*components=*/3, /*attributeType=*/WebGL2RenderingContext.FLOAT,
/*normalized=*/false);
this.indexBuffer.bind();
shader.gl.drawElementsInstanced(
WebGL2RenderingContext.TRIANGLES, this.numIndices, WebGL2RenderingContext.UNSIGNED_SHORT,
/*offset=*/0, numInstances);
shader.gl.disableVertexAttribArray(aSphereVertex);
}
示例4: disable
disable(shader: ShaderProgram) {
shader.gl.disableVertexAttribArray(shader.attribute(this.name));
}