Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: A 3d(2d?) array of textures  (Read 1345 times)

0 Members and 1 Guest are viewing this topic.

Shuvi22

  • Newbie
  • *
  • Posts: 6
    • View Profile
A 3d(2d?) array of textures
« on: May 21, 2023, 03:50:38 pm »
I want to make an efficient rendering of the tile map. However, I have a problem with the lines between the tiles (as I understand it, it is a problem in the inaccuracy of the UV). I found such a thing as 3d texture array(rather 2d?), but I didn't find any explicit mention of it in the SFML.

Which way should I look for information about it? Or is it better to use other ways?

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: A 3d(2d?) array of textures
« Reply #1 on: May 22, 2023, 02:20:30 pm »
I couldn't easily find anything on a array of 3D textures. It seems to be either an array of 2D textures or just a 3D texture (not an array).

Regarding the 'breaks' between tiles, there are a few things you can do to approach the problem.
Here are a few of my suggestions to try:
- Lock the co-ordinates to pixel co-ordinates. This is usually integer values but depends on the view.
- Draw to a render texture at pixel co-ordinates and then draw the entire thing where you want (including fractional pixel co-ordinates).
- Increase your tiles in the texture by a pixel in all directions (doubling the outer edge). This can help when the issues is that the texture is grabbing the wrong pixel next to it.
- Increase your tile's size. For example, you could move the bottom-right co-ordinate down and right (by one pixel) and then overlay the other tiles (if you draw from top-to-bottom and left-to-right). Since the texture co-ordinates should also be increased (to keep the same sized tiles), you may need to duplicate the texture edge (as in the suggestion one above).
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

 

anything