1. This forum section is a read-only archive which contains old newsgroup posts. If you wish to post a query, please do so in one of our main forum sections (here). This way you will get a faster, better response from the members on Motherboard Point.

arrays of floats or array of structures for opengl ?

Discussion in 'Nvidia' started by Skybuck Flying, Oct 1, 2009.

  1. Hello,

    I am "researching" vertex buffer objects...

    I am wondering how to combine positions with texture coordinates.

    It seems there are two possibilities:

    array of position;
    array of texture_coordinate;

    or

    array of structure;

    Which this document shows:

    http://www.opengl.org/wiki/Common_Mistakes

    The opengl doc mentions "stride".

    Confusion would be with the possibility of memory being in system memory or
    video memory... the programmer don't know...

    Maybe the graphic cards has an internal format for verteces ? Does it use
    arrays or does it use structures ?

    In other words:

    What would be the best memory layout for performance ?

    Strides would add gaps... so I am thinking... maybe array of floats is
    better ?!? ;)

    This is one of those things that must be decided upon perform starting to
    code a lot of stuff... because it would require significant code changes in
    the future if one has to switch.

    For now I am still in experimenting phase ;)

    Though even for me doing a benchmark would require extra programming time ?!

    Bye,
    Skybuck.
    Skybuck Flying, Oct 1, 2009
    #1
    1. Advertising

  2. Other performance tips.

    This document is nice:

    http://www.opengl.org/resources/code/samples/s2001/perfogl.pdf

    It mentions something interesting:

    "Depth testing is expensive..."

    I am not sure if this includes verteces going out of view or so... in 2d
    mode...

    Maybe depth testing is not required to make verteces go out of view by the z
    value as I was planning to do...

    Actually this is probably not an issue at all anymore... since each verteces
    will be determined after each round or so ?! ;)

    But not completely sure.

    So interesting read anyway.

    Bye,
    Skybuck.
    Skybuck Flying, Oct 1, 2009
    #2
    1. Advertising

  3. Re: Other performance tips.

    This sux:

    "
    Once again, for certain architectures, this may be the best format for
    specifying geometry. The only way
    to know is to conduct a benchmark case
    "

    Would be nice if opengl/drivers had some hints for the programmer for a
    change ! ;)

    Bye,
    Skybuck :)
    Skybuck Flying, Oct 1, 2009
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kenneth Seefried

    Re: State Machine Design - Menu structures

    Kenneth Seefried, Jun 24, 2003, in forum: Embedded
    Replies:
    0
    Views:
    562
    Kenneth Seefried
    Jun 24, 2003
  2. Seeps

    Unions and Structures

    Seeps, Jan 7, 2004, in forum: Embedded
    Replies:
    12
    Views:
    500
    Dave Hansen
    Jan 9, 2004
  3. Replies:
    1
    Views:
    305
    Hans-Bernhard Broeker
    Jan 24, 2005
  4. Mastupristi

    inizializing static const structures

    Mastupristi, Jan 25, 2005, in forum: Embedded
    Replies:
    12
    Views:
    506
    Dave Hansen
    Jan 26, 2005
  5. aravind
    Replies:
    4
    Views:
    250
Loading...

Share This Page