OpenGL TextureRectangles and glScale(-1, 1, 1);

I have some problems right now…
I use Texture-Rectangles (http://www.opengl.org/registry/specs/ARB/texture_rectangle.txt), to render my Sprites in 2D.
Everything works fine, with glScale(1f, 1f, 1f); and it looks like this:

Just when scaling, to make everything flip, it looks like this (None of the Textures are drawn):

Also, that does not work with normal GL_TEXTURE_2D’s too.
The red-green lines are drawn via glBegin(GL_LINES); these are the proof, that I am doing right vertex transformations. The sprites should be drawn just where thes lines are.

Try glDisable(GL_CULL_FACE).

A negative scale will flip the winding order of your verts, which may be causing them to get culled.

GAAAAAHHHH!!! Of course!.. thank you :slight_smile:

Also the “proper” way to flip things (in my opinion) is to swap the texture coordinates, not change the scale.

Its not only flipping the images, I already did it that way. The problem is, I want to flip the entire SKELETON .

What are people’s thoughts on texture rectangles vs. texture2D as a sprite system base?

My little experience with shaders so far seems to indicate that I’ll usually end up wanting the texcoords in normalized values anyways… So I’m currently using TEXTURE_2D.

There are no advantages of texture rectangles anymore, so why use them?

They gave me performance…

Aren’t texture rectangles a hack that predates the NPOT extension becoming standard? I can’t imagine GPU drivers nowadays being optimized for them in any way.

I’m sure you’re creating this awesome 3D game which samples 8 half-float RGBA textures per pixel and has at least 3x overdraw per pixel, right? I’m sure you’re texture limited and that they’re faster for you. >____>

No, they aren’t faster. +1 to what Sproingie said.

Maybe… I have an option to change that with one constant anyways :stuck_out_tongue: (thats why good designed code makes the difference !!! )

Your app supports both texture rectangles and TEXTURE_2D? ??? That will be a nightmare if you ever decide to write shaders.

Aaah, my bad. :slight_smile: