[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Public WebGL] After installing latest Minefield : VertexAttribPointer: index out of range




----- Original Message -----
> 2010/10/18 Vladimir Vukicevic <vladimir@mozilla.com>:
> > Do you know which version you were using previously?
> >
> I just installed Firefox 4.0b3 and : it works with that.
> 
> >Also, what are the arguments to the VertexAttribPointer call?
> shaderProgram.normal = gl.getAttribLocation(shaderProgram, "normal");
> gl.enableVertexAttribArray(shaderProgram.normal);
> ...
> 
> gl.bindBuffer(gl.ARRAY_BUFFER, this.normalBuffer);
> gl.vertexAttribPointer(shaderProgram.normal, 3, gl.FLOAT, false, 0,
> 0);
> 
> 
> just above the bindBuffer i got a binding for positions, which is
> working without problems:
> 
> gl.bindBuffer(gl.ARRAY_BUFFER, this.positionBuffer);
> gl.vertexAttribPointer(shaderProgram.position, 3, gl.FLOAT, false, 0,
> 0);

Yep, though I would dump the values of shaderProgram.normal and shaderProgram.position.  If the attrib isn't actually in use by the program, then getAttribLocation will return -1.  Regardless, this will raise a GL error, but shouldn't have any effect on the rendering.

> > The two problems are likely seperate -- getAttribLocation is
> > returning -1 (that is, saying that the attrib isn't in use by the
> > program), so calling VertexAttribPointer with -1 as a location is
> > invalid. However, this is likely not the cause of your error.
> >
> 
> var normalMatrix=mat4.inverse(mvMatrix);
> normalMatrix=mat4.transpose(normalMatrix)
> gl.uniformMatrix4fv(shaderProgram.nMatrixUniform, false,
> normalMatrix); //At this point the UniformMatrix4fv error comes
> along..

Is shaderProgram.nMatrixUniform null?  If so, then same case as the -1 -- for whatever reason, the shader compiler doesn't think that the particular uniform is actually in use by the program.  Note that these might be related -- they have to do with the normal matrix uniform as well as your normal array, so sounds like that's being optimized/compiled out for some reason.  Can you post the shader program in question?

    - Vlad

> > ----- Original Message -----
> >> Hi, no that I've installed Minefield 4.0b08pre an error occurs :
> >> VertexAttribPointer: index out of range - -1 >= 16
> >> UniformMatrix4fv: location: null object passed as argument
> >>
> >> The scene is not ligthened any more. So the UniformMatrix4fv error
> >> is
> >> related to the normal matrix.
> >> But I changed nothing since the last time it worked. I just
> >> installed
> >> the newest minefield browser.
> >>
> >> Actually there is no error shown in Minefield (but still no light
> >> function) , i'ts shown only in Firefox 4.0b6.
> >>
> >> In chromium 7.0.518.0 (58673) everything is fine.. no such error
> >>
> >>
> >> What is responsible for that error?
> >>
> >>
> >> regards
> >> m.sirin
> >> -----------------------------------------------------------
> >> You are currently subscribed to public_webgl@khronos.org.
> >> To unsubscribe, send an email to majordomo@khronos.org with
> >> the following command in the body of your email:
> >
-----------------------------------------------------------
You are currently subscribed to public_webgl@khronos.org.
To unsubscribe, send an email to majordomo@khronos.org with
the following command in the body of your email: