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 10 of 21

Thread: VBO Problems

Hybrid View

  1. #1
    Junior Member Newbie
    Join Date
    Oct 2012
    Posts
    11

    VBO Problems

    Hello from germany

    I have stored some objects as VBOs an everything works fine.
    If i draw an additional text - created with wglUseOutlineFonts and stored as display lists
    the VBO color - which is not transparent alpah=255 becomes transparent and the
    normals look scrambled??
    Hoe is it possible to modify the content of a VBO without accessing its memory??

    kind regards
    Peter

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Apr 2010
    Location
    Germany
    Posts
    1,128
    Code please.

  3. #3
    Junior Member Newbie
    Join Date
    Oct 2012
    Posts
    11
    Hello

    any combination of VBOs with any color combinations etc. works fine.
    As soon as I display text the VBO colors are transparent.

    extern void Str_3D( Vertex_Struct* pos, char *str, int32_t fnt_ind, RGBA_Struct* col, BOOL cen_flag )
    {
    float lg = 0;
    uint32_t c1;

    if ( str == NULL ) return;

    glPushMatrix();
    if( cen_flag )
    {
    for( c1 = 0; c1 < strlen( str ); c1++ ) lg +=__gmf[ fnt_ind ][ str[ c1 ] ].gmfCellIncX;
    glTranslatef( -lg / 2.0f + pos->x, pos->y - 0.35f, pos->z + 0.005f );
    }
    else
    {
    glTranslatef( pos->x, pos->y - 0.35f, pos->z + 0.005f );
    }

    glPushAttrib( GL_LIST_BIT );
    glColor4ubv( &col->red );
    glListBase( __f_base[ fnt_ind ] );
    glCallLists( strlen( str ), GL_UNSIGNED_BYTE, str );
    glPopAttrib();
    glPopMatrix();
    }


    static void Draw_GL_Scene( void )
    {
    int32_t c1;
    int32_t c2;
    VBO_Data_Struct* vbd;

    glPushMatrix();
    glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );

    glRotatef( _c_ang, 1.0, 0.0, 0.0 );
    glCallList( _ax_3d );

    Str_3D( &vx_0, "CE_WIN", 0, &_col[ 1 ], TRUE );
    Draw_VBO( _vbo[ 0 ] );
    Draw_VBO( _vbo[ 1 ] );

    glPopMatrix();

    glFlush();

    _c_ang += 0.03f;


    }

    kind regards
    Peter

  4. #4
    Senior Member OpenGL Pro
    Join Date
    Apr 2010
    Location
    Germany
    Posts
    1,128
    Ah display lists, aren't they just fun?

    Have you tried

    Code :
    glPushAttrib(GL_ALL_ATTRIB_BITS);

    instead of

    Code :
    glPushAttrib(GL_LIST_BIT);

    ? If this changes everything back to normal, you can assume it's stuff in the WGL generated DLs that messes up your state.

    What state is set for the list called with
    Code :
    glCallList( _ax_3d );
    ?

    EDIT: Please format you post to use '['code']' ... '['/code']' tags. It's hard enough to read as it is.

  5. #5
    Junior Member Newbie
    Join Date
    Oct 2012
    Posts
    11
    Hi thanks for your reply

    if I change to GL_ALL_ATTRIB_BITS the text does not display any more
    I have taken out glCallList( _ax_3D )

    the first frame is rendered correct - the second is bad

    I've just seen you are from germany - me too -> so we can go on german???

    Is there any possibility to place the chars in VBOs - I need to rotate scale.. them

  6. #6
    Senior Member OpenGL Pro
    Join Date
    Apr 2010
    Location
    Germany
    Posts
    1,128
    so we can go on german???
    Nope, the language is this forum is English. Period.

    Can you revert the attrib push and post screen shots of correct vs. incorrect? I fail to see what's going wrong with your colors at the moment.

Tags for this Thread

Posting Permissions

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