mirror of
https://github.com/gre/gl-react.git
synced 2026-01-18 16:16:59 +00:00
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:
parent
40199f405a
commit
03e88788b1
@ -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();
|
||||
|
||||
@ -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));
|
||||
}
|
||||
`;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user