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;


    array of structure;

    Which this document shows:


    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 ?!

    Skybuck Flying, Oct 1, 2009
    1. Advertisements

  2. This document is nice:


    It mentions something interesting:

    "Depth testing is expensive..."

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

    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.

    Skybuck Flying, Oct 1, 2009
    1. Advertisements

  3. 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 ! ;)

    Skybuck :)
    Skybuck Flying, Oct 1, 2009
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.