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

Re: [Public WebGL] Problems with vertexAttrib4fv



Hmm, would be interesting to know what attrib location getAttribLocation is returning, though of course, you can't know that :/

I wonder if this is something to do with attribute 0 needing to be an enabled array?  Is a_color the first attribute definition in your shader?  Though I thought we had error checks for 0 not being an enabled array.

    - Vlad

----- Original Message -----
> On Wed, Aug 11, 2010 at 10:05 AM, alan@mechnicality.com
> <alan@mechnicality.com> wrote:
> > Hi
> >
> > I'm seeing a problem with vertexAttrib4fv which manifests on Linux
> > x86_64/ATI Radeon 5770 but not on my WinXP32/GForce 8800 GTX
> >
> > The pseudo code is something like:
> >
> >
> >    if (! colorVertexAttributeData) {
> >
> >         int colorIndex = getAttribLocation(shader, "a_color")
> >         if (colorIndex != -1) {
> >                 disableVertexAttribArray(colorIndex)
> >                 vertexAttrib4fv(colorIndex, defaultColor)
> >         }
> >   }
> >
> >
> > where my shader has:
> >
> > attribute vec3 a_color;
> >
> > in the attribute definitions.
> >
> > The purpose behind the code is for the cases where the data doesn't
> > have a
> > color attribute channel (using Max speak) so that it is displayed
> > with a
> > default color, so I use a constant vertex attribute.
> >
> > This works fine in the win setup, but on the linux box Chrome
> > 6.0.472.25 dev
> > ignores the color and Firefox (3.7 -> 4.0 beta 2) just produces a
> > black
> > image. By "ignore the color" I've set a default value of
> > vec4(0.2,0.2,0.2,1.0) in the shader so I can see if anything is
> > happening.
> > In chrome, the objects are this color rather than the color provided
> > in the
> > vertexAttrib statement.
> 
> I don't have a really useful suggestion except to please try the top
> of tree Chromium build rather than the dev channel build. WebGL is
> still under rapid development. See the WebGL wiki for download
> instructions.
> 
> If you can boil this down into a small test case please post it.
> 
> -Ken
> 
> > It seems to me that the likely candidates are either the graphics
> > driver or
> > some issue with WebGL and X86_64 linux.
> >
> > When there is a color attribute channel in the vertex attray then
> > the
> > vertexAttribPointer correctly finds and displays the color on all
> > platforms.
> >
> > Regards
> >
> > Alan
> >
> >
> >
> >
> >
> >
> > -----------------------------------------------------------
> > 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:

-----------------------------------------------------------
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: