PDA

View Full Version : Quad strip textures



stacato
02-07-2006, 08:33 AM
Ok - I have posted this before - but I still haven't figured it out. Many thanks to dorbie for attempting to help me.

Is it possible to use a 'piece' of a texture over and over in a quad strip? Say for example I am using a piece of the texture that is at 0,0 in the texture and is 1/8 of the entire width/height of the texture. My texture coords are 0,0; 0,.125; .125,.125; and .125,0. Using straight quads the textures are fine but a strip stretches the section out. IF I inc the texture coords I end up with the entire texture rather then the piece I would like to use. Any help would be appreciated.

memfr0b
02-07-2006, 10:29 AM
Short answer: not possible in that setup.

Long answer: strip geometry shares vertices between adjacent primitives. For quad strip this means that the last two corners on one quad and the first two corners of the next quad are the same vertices. And "the same" means not only they have the same position, but they share all vertex attributes, including texture coordinates.

In your setup, you'd need different texture coordinates for the shared corners, depending which quad you look at. One need texture coordinate 0, the other 0.125. This is simply not possible with strip geometry.

If you need to use a quad strip, you have to modify your texture to only contain the to-be-repeated part, so that you can use texture coordinates 0, 1, 2, 3 ... and so on.

stacato
02-07-2006, 02:20 PM
Originally posted by memfr0b:
Short answer: not possible in that setup.

Long answer: strip geometry shares vertices between adjacent primitives. For quad strip this means that the last two corners on one quad and the first two corners of the next quad are the same vertices. And "the same" means not only they have the same position, but they share all vertex attributes, including texture coordinates.

In your setup, you'd need different texture coordinates for the shared corners, depending which quad you look at. One need texture coordinate 0, the other 0.125. This is simply not possible with strip geometry.

If you need to use a quad strip, you have to modify your texture to only contain the to-be-repeated part, so that you can use texture coordinates 0, 1, 2, 3 ... and so on.Well that explains why i have been going nuts trying to get it to work. Thank you so much for your explanation. :)