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)
This commit is contained in:
Gaëtan Renaudeau 2015-08-20 23:01:14 +02:00
parent 40199f405a
commit 03e88788b1
2 changed files with 4 additions and 4 deletions

View File

@ -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();

View File

@ -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));
}
`;