Results 1 to 4 of 4

Thread: Texture atlas for objects with shared vertexes.

  1. #1
    Junior Member
    Join Date
    Mar 2009
    Posts
    2

    Texture atlas for objects with shared vertexes.

    Basically I need to optimise my code allot. I'm trying to use a single super texture with all my textures in it and just one draw call. For simplicity the problem comes down to this. I have 3 squares squares in a row that are connected. There are 8 vertexes, 4 of which are shared, triangle_strip seems the best method to draw them but I could just use triangles. The super texture is just a square split into 4 squares. I want to assign the squares a texture at random.

    From what I've read gltexcoordpointer assigns the tex coords to the vertex points, so it's not possible do what I want due to the shared vertexes? This seems wrong since I see people talking about using texture atlases everywhere.

    I guess my question is equivalent to how to draw a cube with a different texture on each side using a single texture file. (the choice of the texture on each side is chosen at runtime).

  2. #2
    Junior Member
    Join Date
    Mar 2009
    Posts
    2

    Re: Texture atlas for objects with shared vertexes.

    Hi;

    I need to do that exactly....to implement a atlas routine for better performance. But How I do that ?

  3. #3
    Senior Member
    Join Date
    May 2006
    Posts
    353

    Re: Texture atlas for objects with shared vertexes.

    If you have discontinuities in your texture coordinates, you need to duplicate vertices. In other words, you need 12 unshared vertices.
    Georg Kolling, Imagination Technologies
    Please ask questions specific to PowerVR hardware or SDKs on the PowerVR Insider Forum
    DevTech@imgtec.com | http://www.powervrinsider.com

  4. #4
    Junior Member
    Join Date
    Mar 2009
    Posts
    2

    Re: Texture atlas for objects with shared vertexes.

    Like Xmas said, you need to duplicate vertexes. Your vertex array has a 1-1 map to the coord array. So You will need to have the same point in the array multiple times. This means you can't use triangle_strip, you need to use triangles to draw as well.

Similar Threads

  1. Shared objects between devices...
    By yurtesen in forum OpenCL
    Replies: 0
    Last Post: 03-11-2012, 04:06 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
  •