Results 1 to 3 of 3

Thread: offset attribute

  1. #1
    killkolor
    Guest

    offset attribute

    hi

    i have a really small questions, just to be sure:
    what exactely does the offset in a polylist define. here an example:
    Code :
    <polylist count="1" material="glassShape-lib-Material">
                        <input offset="0" semantic="VERTEX" source="#glassShape-lib-vertices"/>
                        <input offset="1" semantic="TEXCOORD" source="#glassShape-lib-uvs" set="0"/>
                        <vcount>4</vcount>
     
     
    0 0 1 1 2 2 3 3</p>
    </polylist>

    so, will the indexlist for the vertices be: 0, 0, 1, 1 (first for for offset 0) or 0, 1, 2, 3 (offset applied on every entry)

    i bet on the second guess, but as i said, just have to be sure.

    thanks!
    [/code]

  2. #2
    Senior Member
    Join Date
    Jul 2004
    Location
    Santa Clara
    Posts
    356
    It says that you have 2 indexes (inputs) per entry in the

    element.
    The vcount tells you you have 4 elements (of size 2) in the following

    element
    The first (offset=0) of those 2 indexes is the VERTEX semantic, the second (offset=1) is the TEXCOORD

  3. #3
    Senior Member
    Join Date
    Aug 2004
    Location
    California
    Posts
    771

    Re: offset attribute

    Quote Originally Posted by killkolor
    what exactely does the offset in a polylist define.
    It defines the offset position within the

    list of indices for that <input> stream.
    Quote Originally Posted by killkolor
    so, will the indexlist for the vertices be: 0, 0, 1, 1 (first for for offset 0) or 0, 1, 2, 3 (offset applied on every entry)
    The latter. The example shown will feed index lists to the <input> streams as follows:
    Code :
    Assemble Primitive (vcount=4)
     
        VERTEX   [ 0 1 2 3 ]
        TEXCOORD [ 0 1 2 3 ]
     
    Primitive [ P0[0 0] P1[1 1] P2[2 2] P3[3 3] ], where:
     
    P0 [ VERTEX[0] TEXCOORD[0] ]
    P1 [ VERTEX[1] TEXCOORD[1] ]
    P2 [ VERTEX[2] TEXCOORD[2] ]
    P3 [ VERTEX[3] TEXCOORD[3] ]
    The result is a quadrilateral with vertex attributes that include VERTEX (at least POSITION) and TEXCOORD.

Posting Permissions

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