Found solution for seams

Discussion and feedback on Construct 2

Post » Thu Feb 27, 2014 4:21 pm

I think a question that hasn't been fully answered is the difference between preview and export - There are quite a few rendering differences between preview and export I'm not sure how to fix. These include seams, weird 1-pixel wide extensions from the edges of tiles, stretched gradients rendering differently, etc. Clearly something's causing this...
B
92
S
31
G
24
Posts: 3,191
Reputation: 32,679

Post » Thu Feb 27, 2014 4:49 pm

@sqiddster
thank you buddy!
that is a perfect example why i am ranting ,
tiny little things that are left behind for every new thing that is added to c2 that eventually add up and starts to cause unexpected trouble when you least expect it.
B
15
S
6
G
4
Posts: 277
Reputation: 3,948

Post » Thu Feb 27, 2014 6:03 pm

@Ashley - couldn't this whole problem be solved by making tiles overlap by 2 pixels, or a user adjustable amount?
Moderator
B
94
S
33
G
33
Posts: 3,006
Reputation: 27,744

Post » Thu Feb 27, 2014 6:58 pm

@Arima - that would undo the optimisation that handles entire rectangles of tiles at once, and degrade performance. Imagine a 2x8 tile section with only four tiles down one side. Either you extend by 1px, cover up the seam, and then the unexposed part is rendered too far over, or you don't extend and there's a seam.
Scirra Founder
B
387
S
230
G
88
Posts: 24,249
Reputation: 192,450

Post » Sat Mar 01, 2014 3:03 am

i thought about this problem, and its really bugging me, because ...

1. i want to use linear, it too nice to not use it
2. its perfect on preview
3. other programs use it
4. i want to use construct

consider this linear example

a 16 at 16 tilemap, about 76 frames
sprite tilemap imported from tiled (no plugins needed) hold mouse to move, mousewheel to zoom, starts at zoom 2

download and preview file / perfect no seams no bleeding, even when scaling / construct can
https://dl.dropboxusercontent.com/u/61666915/tilemaptest.capx

on export this happens, the actual background is showing thru = seams, ( no bleeding tho :) ) / construct can't
https://dl.dropboxusercontent.com/u/61666915/tilemaptestv2/index.html

so as showed in my early version with the colors (modified export), its possible to have tiles perfectly aligned and no seams, so this means, whatever happens it is happening internally on the texturemap and not on the positioning of the tiles

ps: what you will have and always have is a little bit of blur from the surounding color but this is not an issue and almost not noticeable (well check the preview)

so its pretty clear to me that construct engine can display linear perfect, so its really a question what happens on export

for the bleeding there's the 1 pixel transparent gap, not actually a problem, but it needs adjustments, it must consider transparent space for two tiles and a setting for these transparent pixels

libgdx has its own texturepacker, there are the follow options, and i think the bleed one is actually another name for what extruding actually is

these are there standard settings:

paddingX The number of pixels between packed images on the x-axis. 2
paddingY The number of pixels between packed images on the y-axis. 2
bleed If true, RGB values for transparent pixels are set based on the RGB values of the nearest non-transparent pixels. This prevents filtering artifacts when RGB values are sampled for transparent pixels. true
edgePadding If true, half of the paddingX and paddingY will be used around the edges of the packed texture.

link: https://code.google.com/p/libgdx/wiki/TexturePacker

this makes sense, because linear will pick the surrounding pixels of the texture actually the subtexture, to make transition, and now the two tiles takes the transparent pixels of the 1px gap, that is why we see this obvious border around the tiles on export.

theres also an analogy between 3d models used in games, always padding between uv's and never stop your texture on the uv-border or you get the same black lines on your model

now for the c2 tilemap, if it would use the same texture method, it could still use the optimization, because again, the texture size is not changed, and there is no overlap.

so i hope you consider testing these settings out, i don't know if this is a convenient workaround, or easy coded, but its definitly worth trying something other engines are putting in and something where most of us are having trouble with, especially when you consider that on preview you could asume that everything is working fine...
ImageImage
B
69
S
21
G
7
Posts: 827
Reputation: 10,017

Previous

Return to Construct 2 General

Who is online

Users browsing this forum: vegapomme27 and 7 guests