Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (120)
games submitted by our members
Games in WIP (577)
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  
  [SOLVED] Bug with rendering texture VBOs with OpenGL Translation  (Read 691 times)
0 Members and 1 Guest are viewing this topic.
Offline DazKins
« Posted 2013-07-18 11:32:01 »

So I'm rendering out a bunch of flat textured quads in OpenGL. I add all the vertexes of the quads and their texture coordinates to a VBO and then render it. However, whenever the camera moves (OpenGL transformation is applied), little gaps in between to tiles begin to appear like they're not all rendering in a perfect grid. When the camera stops moving (OpenGL transformation stops), the gaps between the tiles disappear and the textures are rendered correctly in the grid.

I have already tried calling:
1  
2  
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL12.GL_CLAMP_TO_EDGE);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL12.GL_CLAMP_TO_EDGE);

in my texture loading code and it had no effect. I did notice the effect slightly lessened when I turned of depth testing but other than this i have nothing to go on.


Anybody got any suggestions as to why this might be or how i could fix it  Huh

DazKins

Check out my Dev Blog: http://dazkins.tumblr.com
Offline Mac70
« Reply #1 - Posted 2013-07-18 11:40:00 »

Are you using power of two textures?

Another possibility (mostly if you are loading textures from sprite sheet): http://gamedev.stackexchange.com/questions/46963/how-to-avoid-texture-bleeding-in-a-texture-atlas

Check out my Devblog! Smiley
Offline DazKins
« Reply #2 - Posted 2013-07-18 12:17:06 »

Yes I am using power of 2 textures, they are 16x16 sprites loaded in from a 256x256 image

I don't think the article you linked me to has much relevance to my current issue because  I am rendering in 2D not 3D and also his issue seems to be different to mine. His textures just seem to be linking together incorrectly whereas mine seem to pull apart whenever transformation is applied


DazKins

Check out my Dev Blog: http://dazkins.tumblr.com
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Mac70
« Reply #3 - Posted 2013-07-18 12:21:22 »

Could you post screenshot of the issue?

Check out my Devblog! Smiley
Offline DazKins
« Reply #4 - Posted 2013-07-18 12:33:06 »

It took me a while to try and snap a shot of it, but here is what it looks like horizontally, the same happens vertically as well when you move upwards:


DazKins

Check out my Dev Blog: http://dazkins.tumblr.com
Offline Mac70
« Reply #5 - Posted 2013-07-18 12:45:41 »

I had the same problem in my first project - tip in linked article fixed it.

Check out my Devblog! Smiley
Offline DazKins
« Reply #6 - Posted 2013-07-18 12:54:13 »

Which tip in particular? There are many answers given

DazKins

Check out my Dev Blog: http://dazkins.tumblr.com
Offline Mac70
« Reply #7 - Posted 2013-07-18 13:02:32 »

http://gamedev.stackexchange.com/a/49585

Check out my Devblog! Smiley
Offline DazKins
« Reply #8 - Posted 2013-07-18 19:03:52 »

Ok, thanks alot, this worked perfectly  Grin

Cheers

Edit: And thanks for following my blog aswell  Smiley

DazKins

Check out my Dev Blog: http://dazkins.tumblr.com
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.

Longarmx (52 views)
2014-10-17 03:59:02

Norakomi (44 views)
2014-10-16 15:22:06

Norakomi (34 views)
2014-10-16 15:20:20

lcass (38 views)
2014-10-15 16:18:58

TehJavaDev (68 views)
2014-10-14 00:39:48

TehJavaDev (68 views)
2014-10-14 00:35:47

TehJavaDev (60 views)
2014-10-14 00:32:37

BurntPizza (73 views)
2014-10-11 23:24:42

BurntPizza (45 views)
2014-10-11 23:10:45

BurntPizza (86 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

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