Loading vertices and texture files

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Loading vertices and texture files

      I am just getting started with programming with directx and the MS tutorials only describe loading a single triangle list. I wrote a program that creates a set of triangle strips that forms a half sphere, and maps to a circular sky image(im using this instead of a box for the sky). Where can I find info on how to load this data so that the GPU can render each individual strip (rather than seeing multiple strips as one large strip). Do I need to program the vertex shader to recognize the new strip somehow and load all three of the new vertices for the starting point?

      The post was edited 1 time, last by Roster ().

    • I'm not sure I understand the question or the effect you're trying to achieve. You're saying that you have a hemisphere which is textured with a sky image and you want to break it up into multiple render passes? What's the purpose of this? In general, you want to make as few draw calls as possible. If it's all one connected mesh, you should be able to draw the whole thing in a single render call where breaking it up will require multiple render calls.

      Do I have this right? What are you hoping to achieve?

    • Hey Roster,

      I'd imagine you can do what you're trying to do in one draw call using a triangle strip, but personally I find triangle strips hard to visualize.

      The easy, but inefficient way you might want to try is triangle list (msdn.microsoft.com/en-us/library/windows/desktop/bb206273(v=vs.85).aspx). Using a triangle list you just specify the vertex coordinates for each vertex in each triangle. However this is inefficient because you send a lot of duplicate vertex data.

      The better way to do it is to use vertex and index buffers (msdn.microsoft.com/en-us/library/windows/desktop/bb147325(v=vs.85).aspx). In this case you simply supply all the vertices once, and then supply a buffer full of indices that tell which order to connect the vertices.

      I know for sure that MD2 models are stored this way (list of vertices and list of indices), and I imagine a lot of other types of models store data this way. Rez would certainly know more about that than I do.