Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for vao instanced bind #128

Merged
merged 2 commits into from
Mar 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ declare module '2gl' {

export class BufferChannel {
constructor(buffer: Buffer, options: Partial<BufferBindOptions>);
public bind(gl: WebGLRenderingContext, location?: number): this;
public bind(gl: WebGLRenderingContext, location?: number, options?: BufferBindOptions, instancesExt?: ANGLE_instanced_arrays): this;
}

export interface TextureOptions {
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "2gl",
"version": "0.13.2",
"version": "0.13.3",
"description": "WebGL library for 2GIS projects",
"repository": {
"type": "git",
Expand Down
4 changes: 2 additions & 2 deletions src/BufferChannel.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ class BufferChannel {
* Связывает данные с контекстом WebGL с нужными параметрами.
* Вызывает {@link Buffer#bind} исходного буфера.
*/
bind(gl, location, instancesExt) {
this._buffer.bind(gl, location, this.options, instancesExt);
bind(gl, location, options, instancesExt) {
this._buffer.bind(gl, location, options || this.options, instancesExt);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Vao.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class Vao {
if (shaderAttribute.index !== true) {
gl.enableVertexAttribArray(shaderAttribute.location);
}
attributes[name].bind(gl, shaderAttribute.location, instancesExt);
attributes[name].bind(gl, shaderAttribute.location, null, instancesExt);
}
if (this.indicesBuffer) {
this.indicesBuffer.bind(gl);
Expand Down