Legacy GM [SOLVED] Why is there a 1 pixel transparent seam?

Greetings all,

I'm having trouble with 1 pixel transparent seams appearing when drawing sprites next to one another, flipped.
Code:
draw_sprite_ext(test_sprite, 0, x, y, 1,  1, image_angle, c_white, 1);
draw_sprite_ext(test_sprite, 0, x, y, 1, -1, image_angle, c_white, 1); // flipped
I've been trying as much as possible to use powers of two for image sizes, but it doesn't seem to make much difference.

If I draw them without any rotational displacement there is no issue. However, when rotating them with the code below, the result (depending on the image, and angle) is a 1 pixel transparent 'seam'.
Would someone have some advice please?

Code:
var X1 = x;
var Y1 = y;
var X2 = x + some_offset;
var Y2 = y + some_offset;
var tdist = point_distance (X1, Y1, X2, Y2);
var tdir  = point_direction(X1, Y1, X2, Y2) + image_angle;
new_x = X1 + lengthdir_x(tdist, tdir);
new_y = Y1 + lengthdir_y(tdist, tdir);

 
I

icuurd12b42

Guest
1) try disabling interpolation in the game options
2) try changing the background color of your sprite (which is black, alpha 0) to the color of the visible edge, alpha 0
 

RangerX

Member
Have you tried enlarging the texture pages buffer space?
(look in the texture page tab, I don't remember the exact name of the little option)
 
This phenomenon occurs when zooming out.
Certain amounts of zoom do not result in this line appearing, however, while zoomed out at those amounts, moving the view causes the line to appear/shimmer.

Here is an example image:



1) try disabling interpolation in the game options
2) try changing the background color of your sprite (which is black, alpha 0) to the color of the visible edge, alpha 0
Turning off interpolation does fix this issue, however doing that causes "jerky" scrolling of the stars in the background.
 
Last edited:
I

icuurd12b42

Guest
sounds like interpolation could be the cause. if the bottom of your sprite is not on the edge of the image, meaning you have blank pixels at the bottom. those invisible pixels are black and alpha 0. so interpolation of a red pixel on the edge of a picture with that black pixel would make for a blackish red pixel, with an alpha value somewhere between 0 and 1 (full).

it would also make for a translucide edge where you would see the background through... like yours looks like.

so make sure images edges go all the way to sprite edge

You can also try adding to the image_xscale/image_yscale a tiny fraction to bridge the gap
 
sounds like interpolation could be the cause. if the bottom of your sprite is not on the edge of the image, meaning you have blank pixels at the bottom. those invisible pixels are black and alpha 0. so interpolation of a red pixel on the edge of a picture with that black pixel would make for a blackish red pixel, with an alpha value somewhere between 0 and 1 (full).

it would also make for a translucide edge where you would see the background through... like yours looks like.

so make sure images edges go all the way to sprite edge
I adjusted the images so that they reach the edge of the sprite (removed the empty space), and this has solved the issue. Thank you icuurd12b42 :) I have been making my image sizes as close to powers of 2, or at numbers where as many divisions by 2 are possible before hitting a 0.5, and in order to do this I have been leaving empty space.

Also, a thank you to everyone who wrote in to help, I appreciate that. :)
 
I

icuurd12b42

Guest
yeah, you dont need to use power of 2 in the sprite because the images will all be placed on a final texture page which will be the compatible "power of 2" size. you can preview the pages in the game options graphics tab

But still, working with power of 2 in sprites is still somewhat desired, but you can ignore it if it's to your advantage, like fixing a graphic glitch.
 
Top