Disabling Antialiasing? Vanishing pixels.

Amaror

Member
Hello everyone,

I have a lot of UI boxes in my game which outer edge consists of just a single line of pixels and I have had the problem that when an edge of a such a box is in a specific position it can happen that the line just doesn't render. The line renders fine if I change it by just a single pixel. Higher, lower, it doesn't matter, a single pixel is enough.

I tried a few different things. At first I thought it was an issue with my surfaces, maybe they were just a bit too small, but I managed to rule that out.
I think it might be the game trying to do anti-aliasing and failing. Thing is I can't find any option in gamemaker to enable or disable antialiasing. Is there such an option. Or could something different be the problem?
 

chamaeleon

Member
There is interpolate colors between pixels in game options for the various platforms in the graphics category you could try turning off if it isn't already (not a single setting for the game, it's per platform).
 

Amaror

Member
There is interpolate colors between pixels in game options for the various platforms in the graphics category you could try turning off if it isn't already (not a single setting for the game, it's per platform).
Thanks for the suggestion. It's already off, though, so it isn't the culprit.
 

chamaeleon

Member
Then I'd suggest looking at camera and view port settings, to see if there some scaling going on due to the camera wanting to display more pixels than the view port allows for which will result in lost lines horizontally and/or vertically.
 

Amaror

Member
Then I'd suggest looking at camera and view port settings, to see if there some scaling going on due to the camera wanting to display more pixels than the view port allows for which will result in lost lines horizontally and/or vertically.
I have viewports disabled, could this happen regardless of that?
 

Amaror

Member
I do use drawgui for most things in my game, since it's mostly GUI based. Could it have something to do with that?
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
Moderator
This will happen if the there is any scaling being done in the images, or/and if the x/y coordinates are not integer values. Try using "floor" on all the x/y coords, as that should fix the issue, unless you're drawing at a lower scale in which case the only thing you can do is re-author the graphics at the correct scale rather than scale them down for drawing. Basically, what happens is the GPU can't draw "half" pixels, and so it has to decide whether a pixel is "on" or "off". If your coordinates are not exact integers then some pixels will be on the line between two other pixels and the GPU decides that it's not going to draw them and so they "disappear". This is pretty much the same thing that happens with scaled down graphics too.
 
Top