Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Issue with graphics where background joins (screenie inside)

Author
Message
lilpissywilly
AGK Developer
13
Years of Service
User Offline
Joined: 10th Sep 2010
Location: Office Chair
Posted: 15th Oct 2012 19:12
Yeah, like the title says, and as you can see in the picture, there's a graphical error where one layer of background joins another. It doesn't happen for the other background layers, at least in the windows player. The size is correct, they are lined up correct.

On the android player this shows between more layers than this one.

A Long Wave Home copyright Toby and Hank

My hovercraft is full of eels

Attachments

Login to view attachments
lilpissywilly
AGK Developer
13
Years of Service
User Offline
Joined: 10th Sep 2010
Location: Office Chair
Posted: 15th Oct 2012 19:19
I should point out where the error is perhaps, I forgot to highlight it in the picture.

It's about two thirds in (2/3) and quite far down, a vertical line that shouldn't be there.

My hovercraft is full of eels
Zeerun
AGK Developer
18
Years of Service
User Offline
Joined: 28th Aug 2005
Location: United Kingdom
Posted: 15th Oct 2012 19:22
Does that line represent a join in the images?
Is it possible a rouge transparent line of pixels made it into the artwork?

I seek perfection but wear my scars with pride
lilpissywilly
AGK Developer
13
Years of Service
User Offline
Joined: 10th Sep 2010
Location: Office Chair
Posted: 15th Oct 2012 19:26
Yeah the line is where the silhouette joins. And I've checked the pics they are solid.

My hovercraft is full of eels
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 15th Oct 2012 19:44
Can you email me the project or a small example and I'll take a look.
lilpissywilly
AGK Developer
13
Years of Service
User Offline
Joined: 10th Sep 2010
Location: Office Chair
Posted: 15th Oct 2012 19:57
Sure. I'll try to make a smaller example out of the game and mail you. Thanks!

My hovercraft is full of eels
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 15th Oct 2012 19:58
That looks like an simple SetSpriteUvBorder(Spike_Sprite,0.5) issue.

You get issues like this when android devices scale down an image to fit the screen also and is usually fixed with set sprite uv border.

SetSpriteUVBorder

Description

Controls how the sprite handles UVs that might extend beyond the bounds of the image during sampling, for example when the edge of the sprite is halfway across a pixel. By default (border=0.5) the sprite compensates for this by offsetting UV coords by 0.5 pixels inwards, however this means that the outer most pixels of the sprite's image may not show. border=0 removes this offset creating a pixel perfect reproduction of the image, but this may cause texture seams when trying to line up sprites of the same image that don't fall exactly on a whole pixel. Setting the border to 0 may also cause animated sprites, or sprites using a texture atlas, to 'steal' pixels from neighbouring images. You may also increase this effect by setting the border greater than 0.5 pixels.

Definition


SetSpriteUVBorder( iSpriteIndex, border )




Parameters
•iSpriteIndex - The ID of the sprite to modify.
•border - 0=half pixel offset, 1=no pixel offset


Android 2.3 , ZTE Skate , 480x800 , 800 mhz , Samsung Galaxy Y , 240x320 , 832 mhz , Sony ericson arc 480x854 , 1 ghz
Android 4.0 , Dmtech 3g 9738B , 1024x768 , 9.7 inches , 1.2 ghz
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 15th Oct 2012 20:00
Maybe worth setting the images to repeat...

setImageWrapU(img,1)

I've found that this can help - but it depends, and it gets worse if your game allows the screen to zoom in, it can also depend on device resolution.

I would suggest, that you extend each image by 1 pixel, so there's a 1 pixel overlap on each side, and the blending between pixels should cancel out the line. Also - you could try messing with the mip and min mapping for each image, that can cause more issues though, depending on device resolution.

I got a fever, and the only prescription, is more memes.
lilpissywilly
AGK Developer
13
Years of Service
User Offline
Joined: 10th Sep 2010
Location: Office Chair
Posted: 15th Oct 2012 20:08
Very interesting thanks guys. I will definitely try these things.

I should point out that the game doesn't zoom in or out, and the resolution in windows makes the images non-scaled. The resolution on my galaxy s3 is far higher than the games native resolution so I can understand why these "bad wallpapering effects" show up more there.

If I add a couple of rows of pixels however, that will end up creating an image width that is not to the power of 2, the holy image size. Or is this not something we need to worry about anymore?

My hovercraft is full of eels
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 15th Oct 2012 20:15
Yeah, really you'd have to keep the power of 2, making it a bit of a nightmare to redo those images, unless you made a program to stitch them back together and grab the extra pixels automatically.

Try the UV repeat setting before worrying about that though.

I got a fever, and the only prescription, is more memes.
lilpissywilly
AGK Developer
13
Years of Service
User Offline
Joined: 10th Sep 2010
Location: Office Chair
Posted: 15th Oct 2012 20:18
Yep tried it to no avail. But thanks

I'll try the other hints and tips now

My hovercraft is full of eels
lilpissywilly
AGK Developer
13
Years of Service
User Offline
Joined: 10th Sep 2010
Location: Office Chair
Posted: 15th Oct 2012 21:22
@Van B: I'm trying to make sense of the making the picture larger by a
row on each side. The pictures are now 1024 pixels wide and
I'm wondering what making them 1026 would do. Can't I just as
well overlap the current images by one row when I place them,
and if they look odd like that I'll redraw the last row to
match?

My hovercraft is full of eels
Ian Rees
AGK Developer
12
Years of Service
User Offline
Joined: 3rd May 2012
Location: Wales, UK
Posted: 17th Oct 2012 10:27
I had a similar issue in my game.

As Cliff has stated, using the SetSpriteUVBorder command worked for me.

SetSpriteUvBorder(SpriteID, 0.5)

E
lilpissywilly
AGK Developer
13
Years of Service
User Offline
Joined: 10th Sep 2010
Location: Office Chair
Posted: 17th Oct 2012 10:54
That didn't work for me unfortunately

What I find odd is that I have like three other layers of background that are the same size and join at the same place but it only happens to one of them

My hovercraft is full of eels
lilpissywilly
AGK Developer
13
Years of Service
User Offline
Joined: 10th Sep 2010
Location: Office Chair
Posted: 17th Oct 2012 11:41
Solved!

It was the Cliff Mellangard way that did it. But oddly enough not on the layer I thought was the issue.

See I removed the layers one by one and the problem was gone when this one layer was not used, but adding the SetSpriteUvBorder(SpriteID, 0.5) to that one didn't fix it. But adding the UVborder to all of the layers did the trick!

Big thanks!

My hovercraft is full of eels
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 17th Oct 2012 18:35
Quote: "Big thanks!"

We are here to help

Android 2.3 , ZTE Skate , 480x800 , 800 mhz , Samsung Galaxy Y , 240x320 , 832 mhz , Sony ericson arc 480x854 , 1 ghz
Android 4.0 , Dmtech 3g 9738B , 1024x768 , 9.7 inches , 1.2 ghz

Login to post a reply

Server time is: 2024-05-04 16:32:00
Your offset time is: 2024-05-04 16:32:00