Implementation of 2D Tiles using OpenGL

Member
Posts: 233
Joined: 2003.05
Post: #16
Great responses! Wow

So, I'm thinking I'll stick with the one big texture full of tiles.

As for a solution to the rotating, scaling without bleeding... I do remember having this problem in earlier tests, and I was getting around it by leaving space around each tile.

I'm thinking of other ways to deal with this as well. If I have only a few objects in the game that need to rotate/scale I can either use a seperate texture for each of these special objects OR use a seperate texture to copy each of the frames into JUST before displaying it... I'm not sure how to do this right without make the evil Memory->VRAM copy.

The extra screen buffer is very intriguing to me as there are many effects possible with this that excite me, but I'm wary of doing it using SDL for cross platform. It seems unlikely that I'll be able to get this to work nicely on multiple systems (Windows, Linux, etc.)

I mean, I know I could get it to "work", just not with any usable performance. ZZZ

Anybody spot any flawed reasoning here? Any other methods people are using? Huh

"Pay no attention to that man behind the curtain." - Wizard of Oz
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #17
Just rotate the quad you draw the tile on if you want to rotate the tile. No copying involved...
Quote this message in a reply
Member
Posts: 233
Joined: 2003.05
Post: #18
That's how I currently do it, and because of the previously discussed filtering it bleeds in from the neighboring parts of the texture. Smile
The extra-border-around-the-sections solution rubs against my artistic nature. Sneaky
Plus, when I've done it in the past, a one pixel border was not always enough... this is just a waste of precious VRAM in my opinion. However, I realize it might be the best compromise.

I was looking for a possible way to avoid the bleeding without adding extra hack work to the initial tile creation.

Aaron

"Pay no attention to that man behind the curtain." - Wizard of Oz
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #19
Well then, just use one texture per tile. But don't say I didn't warn ya Rasp
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Suggestions for Sound Implementation soulstorm 15 7,318 May 15, 2009 07:54 PM
Last Post: Gillissie
  Tiles/Sprites question Bonked 0 2,079 Dec 16, 2006 06:06 AM
Last Post: Bonked
  gluUnproject implementation TomorrowPlusX 3 10,338 Sep 19, 2006 08:27 AM
Last Post: TomorrowPlusX
  Shader implementation questions akb825 12 5,202 Jun 5, 2006 04:39 PM
Last Post: akb825
  Using OpenGL for tiles Taxxodium 6 3,706 Mar 25, 2005 10:06 AM
Last Post: tigakub