Border textures stretched instead of tiled #444


  • Accepted
  • Defect
Open
Assigned to shefkin
  • _ForgeUser388539 created this issue Jun 15, 2009

    What steps will reproduce the problem?
    1. Apply any of the border styles available to a layout.
    2. View the result along the top, bottom, right, and left edges closely.

    What is the expected output? What do you see instead?
    Since actual border textures are being used, I expect the edges to be tiled, the same way they would be if a backdrop were used. Stretching the textures instead of tiling is incosistent with how border textures are used everywhere else in the UI.

    What version of the product are you using?
    r20090616012413-nolib

    Do you have an error log of what happened?
    No error is generated.

    Please provide any additional information below.

  • _ForgeUser388539 added the tags New Defect Jun 15, 2009
  • shefkin removed a tag New Jul 18, 2009
  • shefkin added a tag Accepted Jul 18, 2009
  • _ForgeUser388539 posted a comment Sep 16, 2009

    After further investigation, I've remembered why borders were implemented as a group of 8 textures rather than using the frame backdrop. Drawing the borders as a group of textures allows the borders to be "mirrored" according to the layout's preference. This can't be achieved using a backdrop border without supplying multiple variations of the border texture file, one for each possible mirroring.

    Also, with the modular nature of PB, drawing the border as a group of textures allows better control of the border's draw layer, to ensure that certain elements appear in front of or behind the border when they overlap.

    The only way to achieve tiling using a group of textures would be to create an additional variable number of texture objects for each of the sides and "manually" tile them. The number of texture objects required would vary based on the frame's height and width and the border's width. This is not a good approach in terms of resource usage, as there would be a performance penalty associated with layouts having larger frame sizes. (Imagine someone supplied a border texture with a width of 1. To go around a frame 180x60 pixels in size, 478 textures would be required instead of 8.)

    I thought it might be possible to use 4 extra whole frames and simulate a border side using a tiled backdrop background, but it is not possible to restrict the TexCoords of a texture being used in a backdrop background.

    Since there is no acceptably performant solution to this issue, users will simply have to restrict themselves to using SharedMedia border textures with sides that look good when stretched, as opposed to their original tiled intent.

    Please feel free to close this ticket.

  • shefkin posted a comment Mar 27, 2010

    Actually that's not true, you can tile within a single texture. SetTexCoord, if you use a coordinate > 1 then the texture is tiled and you pass the 2nd parameter as true when you do SetTexture. It's just not well documented. I'll get around to look into this eventually.

  • Stanzilla unassigned issue from ckknight Aug 19, 2012
  • Stanzilla assigned issue to shefkin Aug 19, 2012

To post a comment, please login or register a new account.