• Hey! Guest! The 39th GMC Jam will take place between November 26th, 12:00 UTC and November 30th, 12:00 UTC. Why not join in! Click here to find out more!

Legacy GM Dark outline around white spriteareas on white background

sv3nxd

Member
Hey guys!

So I found myself really enjoying
playing around with this current project of mine.

But today I came up with a REALLY annoying problem.
So basically a lot of people had that problem already, but none of the solutions they had
worked out for me.

If you guys don't mind, I'll be showing you the process through some screenshots:

So to begin with, I remade a sprite of the character,
which was way brighter now.
That is how I first encountered the problem:

"THE OUTLINE"
*DUN DUN DUUUUUUUN*


______________________________

Alright, let's begin:
As you can see, the mouthpart is fully white, but there is a
dark black'ish outline surrounding it.

001.PNG

I thought "Okay, maybe the texture, thatI drew onto it, is messing things up",
so I went into PaintToolSai and changed it:

002.PNG

Still not ...
Maybe it's the background and so I got temporally rid of it.
I also read from @YellowAfterlife on a blog ...
(https://yal.cc/gamemaker-troubleshooting-strange-outlines-on-images/)
... that the alphachannel might be messing things up.
So I went into GIMP and "fixed" the sprite and ended up with this abomination:

wat.png

But even then - it didn't work out:

texture_set_interpolation(false);
display_reset(0, global.vsync);
fsdfsaa.PNG

texture_set_interpolation(true);
display_reset(display_aa, global.vsync)
whyyy.PNG


As you can see:
No matter what I do - the outline won't go away.
I'd be happy about every input of you guys!

Have a great day. :)
 

YellowAfterlife

ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ
Forum Staff
Moderator
... that the alphachannel might be messing things up.
So I went into GIMP and "fixed" the sprite and ended up with this abomination:
but did you add a thin layer of alpha=1/255 pixels? Cause that's the point of the post.
 

sv3nxd

Member
but did you add a thin layer of alpha=1/255 pixels? Cause that's the point of the post.
Hey!
To be honest: I didn't see that anywhere ... and still don't.
Maybe I've missed it or just didn't get it as english isn't my strong-suit.
But the problem I have, seems not to be related to the alphamask I think ... ?
I don't know.
Have a nice day!


Anyways - I found a solution.

When starting the room I've put
application_surface_draw_enable(false) ;
into my shader-object, so I can draw my surface, which had
a distortion-shader. (Like in five-nights at freddys)

That seemed to cause my problem, because when not doing so,
I had no weird outlines ...

(But my shadows wouln't be drawn, until I had put a background into the room)


So I know that solved the issue, but it's ineffecient because the application_surface is drawn twice now.


Unbenannt.PNG
 

CMAllen

Member
Onto a selfmade surface, that I draw in the GUI End Event.
Then your aliased pixels around the periphery of the image are blending with whatever color you filled the surface with when it was created. By default, I believe this is black (ie, 0,0,0). Yes, even if the destination pixel is 100% transparent, you are still going to get color blending, because there's no such thing as a colorless pixel. That's how surfaces work. All channels operate on the same math function. If you filled your surface with red, you'd get a slightly red outline created from any pixels that aren't either 100% opaque or 100% transparent. You can try a slight alteration on your approach and it might help a little. First, disable drawing to the alpha channel. Then draw your intended sprite a little oversized (in effect, extending the pixels around the border of your image out a bit). Re-enable the alpha channel again and draw your sprite a second time at the intended size. This overwrites the original color on the surface with the colors of the sprite, so when you draw your sprite a second time, the colors blend with themselves (or something much closer).

Note: the two pass drawing method requires that you understand how the image scales based on its origin point and can keep the two draw calls correctly centered on each other.
 
What does your shader do exactly? What blending mode are you drawing with? I was under the impression that the application surface is always totally opaque... which would seem to mean that with the normal blending mode and default shader, stuff on the application surface shouldn't blend with whatever the application surface is drawn onto.
 
Top