Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: Problem using generic attributes

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2004
    Location
    Cologne, Germany
    Posts
    27

    Problem using generic attributes

    Hello,

    I'm currently having a problem using generic attributes.
    Alright here it comes:
    this is my vertex shader:
    Code :
    uniform float nuMin;"+
    uniform float nuMax;
    attribute vec3 re;
    void main() {
        gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;	
     
    gl_FrontColor = vec4(re.x, 0.0, 0.0, 1.0);
    }
    and this is my fragment-shader:
    Code :
    void main() {
        gl_FragColor = gl_Color;
    }
    ]
    if I run them with my terrain (this is just a minimal test-case for a geomorphing shader that tripped it up), the rendered mesh looks right, except I do get some kind of flickering, even when I don't move the camera at all.
    Once I remove the reference to the generic attribute "re" from the gl_FrontColor call, it runs just fine.
    Even just doing a
    float tmp = re.x;
    results in the mentioned flickering (looks like the background shining through in certain frames).
    I'm passing the VertexAttrib as a vertex array. The values appear to be right (at least the resulting colors seem right to me).
    I'm running an ATI Radeon 9800 with Catalyst 4.2.

    is anybody else experiencing something similar or has any idea, what could cause this?

    Thanks a lot for your answers as I just can't think of anymore to try.

    Jan

  2. #2
    Member Regular Contributor
    Join Date
    Apr 2002
    Location
    Austria
    Posts
    328

    Re: Problem using generic attributes

    Hello!

    I got exactly the same problem!! Try to pass the vec3 as a gl_MultiTexCloordX like this:

    Code :
     
    uniform float nuMin;"+
     
    uniform float nuMax;
     
    //attribute vec3 re;
    #define re vec3(gl_MultiTexCoord1)
     
    void main() {
     
        gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
     
     
    gl_FrontColor = vec4(re.x, 0.0, 0.0, 1.0);
     
    }
    And then pass the values via glTexCoordPointer(). This worked for me.

    I think that's an ATI driver bug. I sent a mail at devrel@ati.com 3 days ago but till now no answer...
    There is a theory which states that if ever anybody discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable.

    There is another theory which states that this has already happened...

  3. #3
    Junior Member Newbie
    Join Date
    Feb 2004
    Location
    Cologne, Germany
    Posts
    27

    Re: Problem using generic attributes

    Always good to know, you are not the only one and are not just too stupid to get it to run.

    I guess now, ATI has two reports (had already send out mine).
    Let's hope, they'll fix it soon. Thanks for the tip with the MultitexCoord, I'll just do that.

    Jan

  4. #4
    Member Regular Contributor
    Join Date
    Apr 2002
    Location
    Austria
    Posts
    328

    Re: Problem using generic attributes

    I just got a mail from ATI devrel. They said that it will be resolved in one the next releases.
    There is a theory which states that if ever anybody discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable.

    There is another theory which states that this has already happened...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •