Results 1 to 4 of 4

Thread: VBO GL_DYNAMIC_DRAW and lighting problem

  1. #1
    Junior Member Newbie
    Join Date
    Aug 2010
    Posts
    5

    VBO GL_DYNAMIC_DRAW and lighting problem

    I've got a problem with dynamic vbo and lighting:

    I've got one stationary light and 2 vbo's. One vbo is static and transformed with matrix, this geometry is rotating nicely and shaded correctly.

    The other vbo is dynamic and isn't transformed with matrix but by updating vbo's vertex pos and normals. While the geometry comes up fine on this dynamic vbo, it's shading is "stuck", as if the light was rotating with it.

    Any ideas what might be causing this? I've tried stream mode too and switching order of vbo's drawn but the results are same.

  2. #2
    Senior Member OpenGL Pro Aleksandar's Avatar
    Join Date
    Jul 2009
    Posts
    1,214

    Re: VBO GL_DYNAMIC_DRAW and lighting problem

    AFAIK, GL_DYNAMIC_DRAW has nothing with incorrect drawing. It is just a hint. You have a problem with vales stored in that VBO.

    By the way, dynamically updating VBO instead of standard transformations is a very bad idea of doing things.

  3. #3
    Junior Member Newbie
    Join Date
    Aug 2010
    Posts
    5

    Re: VBO GL_DYNAMIC_DRAW and lighting problem

    That's what I thought and that's how it is

    Thanks for replying, got me check my data more closely. I am getting the data from 3d animation application and there is quirk in SDK and vertex normals. For some reason func to get deform normals gave static data and func to get static data gave deformed. So my normals weren't proper and it looked like the lighting was "stuck".

    What I learned: 1) check your data at least thrice 2) don't trust SDK's

    Reason for using dynamic vbo is that in such animation package there are lot of deformers. So I think that is quite reasonable reason

  4. #4
    Senior Member OpenGL Pro Aleksandar's Avatar
    Join Date
    Jul 2009
    Posts
    1,214

    Re: VBO GL_DYNAMIC_DRAW and lighting problem

    Quote Originally Posted by peksi
    Reason for using dynamic vbo is that in such animation package there are lot of deformers. So I think that is quite reasonable reason
    Yes, that is very acceptable reason.

    By the way, you can freely set GL_STATIC_DRAW as a hint, and it will not change the performance.

Similar Threads

  1. switch GL_DYNAMIC_DRAW to GL_STATIC_DRAW at runtime?
    By JasonRay in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 01-22-2016, 10:22 AM
  2. Lighting problem,
    By dreamspaced in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 10-18-2005, 11:46 PM
  3. Replies: 4
    Last Post: 09-27-2004, 06:27 AM
  4. Lighting problem (opengl + shader lighting)
    By ox1d_47 in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 08-19-2004, 09:43 PM
  5. lighting problem
    By jonn82 in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 02-02-2004, 07:19 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean