Have a GL_TRIANGLE_STRIP SpriteBatch (variant)

Issue #544 wontfix
Antonio Moder
created an issue

Gap of 1 pixel. mouse wheel-zoom, WSAD-move

Comments (14)

  1. Antonio Moder reporter

    Partial resolve with love lua script: loveImage:setFilter('nearest', 'nearest'). Does not always work ! But then does not work smooth images (linear FilterMode for Image) ! This is a bad resolve. Need resolve in C++.

  2. Anders Ruud repo owner

    Probably we need a new type in love which can handle situations where things are supposed to tile. (love.graphics.newTilemap, or perhaps something more low-level, e.g. love.graphics.newVertexBuffer). If we draw the tiled object as a single GL_TRINAGLE_STRIP, we should:

    • Don't get any gaps.
    • Get better performance.

    Antonio: For now, perhaps you can get away with rendering the tiles (at integral coordinates) to canvas, and then scale the canvas?

  3. Antonio Moder reporter

    I looked in the OpenGL GL_LINEAR and concluded. The only way out of this situation: use a frame (1 pixel) in the texture, and duplicate boundary pixels in the frame. See attached info.png.

  4. Antonio Moder reporter
  5. Alex Szpakowski

    Meshes (previously Geometry) can do triangle strips, but I don't think the issue here is (dis)connected vertices.

    From what I can tell, the gaps you're seeing are a combination of both linear filtering and rasterization turning vector coordinates into a grid of pixels.

    These aren't really "bugs", and the recommended solution nearly everywhere is to pad the outsides of images in your texture atlas with the same pixels as the perimeters.

    OpenGL 3 introduces array textures which don't need padding like that, but many systems don't support GL3, plus OpenGL ES 2 (aka nearly all mobile devices) doesn't support array textures, and to use them you would need a custom shader to pick which image in the array texture to use, so I don't think LÖVE will make them available any time soon.

  6. Log in to comment