Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (497)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  OpenGL TextureRectangles and glScale(-1, 1, 1);  (Read 1992 times)
0 Members and 1 Guest are viewing this topic.
Offline matheus23

JGO Kernel


Medals: 107
Projects: 3


You think about my Avatar right now!


« Posted 2012-05-11 14:50:02 »

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.

See my:
    My development Blog:     | Or look at my RPG | Or simply my coding
http://matheusdev.tumblr.comRuins of Revenge  |      On Github
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #1 - Posted 2012-05-11 15:12:15 »

Try glDisable(GL_CULL_FACE).

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

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline matheus23

JGO Kernel


Medals: 107
Projects: 3


You think about my Avatar right now!


« Reply #2 - Posted 2012-05-11 15:13:46 »

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 Smiley

See my:
    My development Blog:     | Or look at my RPG | Or simply my coding
http://matheusdev.tumblr.comRuins of Revenge  |      On Github
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Eli Delventhal

JGO Kernel


Medals: 42
Projects: 11
Exp: 10 years


Game Engineer


« Reply #3 - Posted 2012-05-11 18:41:42 »

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

See my work:
OTC Software
Offline matheus23

JGO Kernel


Medals: 107
Projects: 3


You think about my Avatar right now!


« Reply #4 - Posted 2012-05-11 22:07:51 »

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 .

See my:
    My development Blog:     | Or look at my RPG | Or simply my coding
http://matheusdev.tumblr.comRuins of Revenge  |      On Github
Offline davedes
« Reply #5 - Posted 2012-05-11 22:58:47 »

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.

Offline theagentd
« Reply #6 - Posted 2012-05-12 08:03:34 »

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?

Myomyomyo.
Offline matheus23

JGO Kernel


Medals: 107
Projects: 3


You think about my Avatar right now!


« Reply #7 - Posted 2012-05-12 08:04:14 »

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...

See my:
    My development Blog:     | Or look at my RPG | Or simply my coding
http://matheusdev.tumblr.comRuins of Revenge  |      On Github
Offline sproingie

JGO Kernel


Medals: 202



« Reply #8 - Posted 2012-05-12 18:15:04 »

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.
Offline theagentd
« Reply #9 - Posted 2012-05-12 19:42:26 »

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...
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.

Myomyomyo.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline matheus23

JGO Kernel


Medals: 107
Projects: 3


You think about my Avatar right now!


« Reply #10 - Posted 2012-05-13 07:50:32 »

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...
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 Tongue (thats why good designed code makes the difference !!!! )

See my:
    My development Blog:     | Or look at my RPG | Or simply my coding
http://matheusdev.tumblr.comRuins of Revenge  |      On Github
Offline davedes
« Reply #11 - Posted 2012-05-13 17:03:31 »

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

Offline Eli Delventhal

JGO Kernel


Medals: 42
Projects: 11
Exp: 10 years


Game Engineer


« Reply #12 - Posted 2012-05-15 00:08:38 »

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 .
Aaah, my bad. Smiley

See my work:
OTC Software
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

BurntPizza (24 views)
2014-09-19 03:14:18

Dwinin (39 views)
2014-09-12 09:08:26

Norakomi (68 views)
2014-09-10 13:57:51

TehJavaDev (93 views)
2014-09-10 06:39:09

Tekkerue (47 views)
2014-09-09 02:24:56

mitcheeb (68 views)
2014-09-08 06:06:29

BurntPizza (51 views)
2014-09-07 01:13:42

Longarmx (38 views)
2014-09-07 01:12:14

Longarmx (44 views)
2014-09-07 01:11:22

Longarmx (40 views)
2014-09-07 01:10:19
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!