• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM Strange white border around texture interpolated sprites.

M

Misty

Guest
When texture interpolation is on, sprites have a strange white/grey border around their edges.

Setting draw_set_color(c_black) did not work.
Setting the depth to negative did not work.
Setting the background color to green to not chance the border to green.

The device seems to be ignoring the pixels behind/next to the sprite and not interpolating them.
 
J

jackhigh24

Guest
draw with interpolate off then switch back on if you need it.

EDIT
although if you find another way around that as turning interpolation off is not ideal, then let us know as everything iv tired did not work, such as using draw_set_alpha_test and draw_set_alpha_test_ref_value dont seem to work

EDIT
@Misty i just noticed that it happens on sprite drawn from the same object as what you drawing the sprite on, example

i have a menu object that draws it self then draw a medal sprite if you won something on to the menu, has the problem with the alpha on the medal, but if i use another object not the menu one to draw that medal over the menu the problem goes away ?? strange but might be the way to get around it as nothing else seems to work.
actually scrap that as that only worked in one situation, so not sure what is going on.
 
Last edited by a moderator:
@Misty What is the color of the pixels around the edge of your sprite? I know they are probably 0 alpha, but what is their color? If you make the invisible edge pixels the same color as the visible edge, any point between them will be interpolated as the correct color. If your transparent edge has a white color (i know it is invisible, but it cans still have a color), then the edges will appear lighter than they should be because the game will interpolate between the correct visible color of your edge pixels, and the wrong (white) color of your invisible edge pixels.

Solution: Make sure your transparent edges have the same color as your visible edges.

In the sprite editor this can be done by swithcing the blending mode to replace, with 0 opacity using colors selected from your edge.

In photoshop, you have a few options. 1, you can get a plugin called solidify B which will do it for you. 2., you can create an alpha mask of your sprite by control-clicking the layer and clicking add layer mask. Afterward you can paint-in the zero opacity sections of your image with the right colors without affecting the alpha.
 
Last edited:
J

jackhigh24

Guest
umm il try again just to make sure and let you know, by the way what version of game maker did you just try it on.
 
@jackhigh24 1.4.1757

of course I don't know the exact situation that misty is dealing with in their project. I'm just drawing a sprite in an empty room. The sprite contains transparent regions, and I either make those transparent regions have a white color (in which case a halo appears), or else I fill in those regions with the same color as the sprite (in which case the halo goes away).
 
J

jackhigh24

Guest
@flyingsaucerinvasion i just tested an image made in paint.net that has a design with smoothed edges so there is alpha there and then the blank regions i set to a 0 alpha of the same colour white by the way, then loaded it into game maker no matter what option i used to load it in the background alpha in converted to black so i did a bucket fill of 0 alpha white to replace it with with the tolerance set to 64 but still get the same halo, the sprite by the way is just a figure eight like sprite so the alpha is not just around the edge.
 
Probably your problem is that your tollerance just can't get into the very edges. Or it may be that paint.net automatically changes the color of zero opacity regions to zero? I'm not sure because I don't use paint.net. In photoshop you can easily color in the transparent regions with solidify B, even when the edge regions are really fuzzy. It'd be a pain in the butt to do it by hand with fuzzy edges. (unless you've got a sprite that is just a single color, in which case you can just paint over the whole entire picture with the same color using the layer mask method I mentioned in a previous post.).

BTW, with that second method, you must use a layer mask. If you just try to change the color of transparent regions without using a layer mask, photoshop will just remove all the color information from regions with zero opacity. At least my really old version of photoshop does (under some circumstances).
 
Last edited:
J

jackhigh24

Guest
ye mate i did use a layer too, tried as many ways as i could, will have ago with photoshop in a bit, but first im going to see what happens if i just drop the original image into the project folder, maybe that will help.
 
M

Misty

Guest
I am not the artist, so that's on him. There are hundreds of sprites he is gonna have to reedit by making the exterior pixels of 0 alpha match their neighbours. So this is bad news and I was afraid that this would be the case.

Im not turning off interpolation because I dont want it pixelley. Alpha_test_ref just makes it pixelly.

Is there another way besides editing every sprite in photoshop.
 
Top