From 03e88788b1a01cd3f4e6f45dc036aa18cfd3a3fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Renaudeau?= Date: Thu, 20 Aug 2015 23:01:14 +0200 Subject: [PATCH] using '_p' instead of 'position' for the attribute (to hide it) in WebGL there seems to be collision if using uniform position (this does not happen in OpenGL) --- src/GLCanvas.js | 2 +- src/static.vert.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/GLCanvas.js b/src/GLCanvas.js index ef8074a..51bd827 100644 --- a/src/GLCanvas.js +++ b/src/GLCanvas.js @@ -135,7 +135,7 @@ class GLCanvas extends Component { } shader.bind(); gl.bindBuffer(gl.ARRAY_BUFFER, this.buffer); - shader.attributes.position.pointer(); + shader.attributes._p.pointer(); for (const t in this._textures) { this._textures[t].dispose(); diff --git a/src/static.vert.js b/src/static.vert.js index e71f3dc..c130f35 100644 --- a/src/static.vert.js +++ b/src/static.vert.js @@ -1,8 +1,8 @@ module.exports = ` -attribute vec2 position; +attribute vec2 _p; varying vec2 uv; void main() { - gl_Position = vec4(position,0.0,1.0); - uv = vec2(0.5, 0.5) * (position+vec2(1.0, 1.0)); + gl_Position = vec4(_p,0.0,1.0); + uv = vec2(0.5, 0.5) * (_p+vec2(1.0, 1.0)); } `;