Results 1 to 3 of 3

Thread: vertex arrays

  1. #1
    Junior Member Newbie
    Join Date
    May 2000
    Posts
    1

    vertex arrays

    This may seem like a stupid question but may I change the values of an vertexarray after setting it with glVertexPointer ? I mean will OpenGL take the data from the lokation the pointer from glVertexPointer is pointing to, everytime I call glDrawArrays (or any other draw command) or will OpenGL make a copy some where else (maybe in video memory) and changes in the original array will have no results until I reset the pointer.
    And if OpenGL always takes the values from cpu memory isn't there a way to tell OpenGL that the data won't change and that it can be hold in some better location?

    Thank you for your help.

  2. #2

    Re: vertex arrays

    If you just use vertex arrays the data will be fetched from the arrays at the point where the drawing command is done.

    If you want to tell OpenGL that it may
    copy the data to a "better place" use the compiled_vertex_array extension. Alternatively
    you might look at vendor specific extensions, like Nvidia vertex_array_range for best performace

    Eero

  3. #3
    Senior Member Regular Contributor
    Join Date
    May 2000
    Location
    Oxford, England
    Posts
    472

    Re: vertex arrays

    The vertex pointer is a memory location. OpenGL will read directly from it. It will not copy it due to it not knowing how much data is held after the pointer location.

    If the data doesn't need to be changed, then you can use compiled vertex arrays to allow openGL to store it more efficiently. There are also things like Var available on the nvidia cards that increase the speed slightly more.

Similar Threads

  1. arrays of arrays as vertex output/fragment input
    By tsojtsoj in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 05-17-2018, 08:02 PM
  2. Vertex Arrays, interleaved arrays, mouseMove func
    By Nibirue in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 02-13-2012, 11:17 AM
  3. Big problem show arrays with vertex arrays
    By Rondey in forum OpenGL: Basic Coding
    Replies: 13
    Last Post: 03-15-2009, 10:09 AM
  4. Vertex Arrays: Interleaved or seperated arrays?
    By Jan in forum OpenGL: Advanced Coding
    Replies: 16
    Last Post: 06-21-2005, 05:25 AM
  5. Vertex arrays and ... texture arrays
    By cix>foo in forum OpenGL: Advanced Coding
    Replies: 21
    Last Post: 06-25-2000, 08:15 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