• 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 AA For GUI elements only [ANSWERED]

Joe Ellis

Member
the thing with gui is it is always at the same scale, so you can easily just create the graphics for it with alpha, the anti aliasing is mainly for polygon\draw\3d functions, any bitmap images will look the same either way if theyre at 1:1 scale, so basically you dont need AA
 
I

Ian

Guest
the thing with gui is it is always at the same scale, so you can easily just create the graphics for it with alpha, the anti aliasing is mainly for polygon\draw\3d functions, any bitmap images will look the same either way if theyre at 1:1 scale, so basically you dont need AA
Sadly most of my GUI uses draw funcs. I have an example above to show the difference between AA and raw.

The problem is that i dont want to render the whole view with AA only gui
 
I

Ian

Guest
Have you tried

Code:
texture_set_interpolation(true);
// Draw GUI stuff.
texture_set_interpolation(false);
Works for only textures so that would not work since most of my GUI is using draw funcs (like above) and not sprites.
 
O

orange451

Guest
Anti-Aliasing in game maker is controlled at the GPU level. It is defined with the Graphics Context of your game, and thus you have no control over what gets aliased or not. Either everything or nothing. You can, however, write your own Anti-Aliasing shader and then have complete control.
 
I

Ian

Guest
Anti-Aliasing in game maker is controlled at the GPU level. It is defined with the Graphics Context of your game, and thus you have no control over what gets aliased or not. Either everything or nothing. You can, however, write your own Anti-Aliasing shader and then have complete control.
Yes ik what shaders are ive coded a few of my own but none to detect edges for something like AA.

Thats basically why ive created this thread, to find a source for AA thats not used for post processing but instead can be used to render GUI
 
Last edited by a moderator:
O

orange451

Guest
If you know what shaders are, then you would know that using them is the best way to get the desired effect you want.
Either that or use high-resolution pre-aliased PNG images to draw your GUI instead of Game Makers draw functions.
The former is much easier to write and much faster to implement, and will lead to a much more consistent style.

If you choose the shader route. Here's a nice research paper on FXAA (http://developer.download.nvidia.com/assets/gamedev/files/sdk/11/FXAA_WhitePaper.pdf).
 

GMWolf

aka fel666
Another option (but probably not the best one) is to use SSAA:
render your GUI at 2x or even 4x resolution, then scale it down. this will give you the best quality AA possible. but may be quite costly depending on the complexity of your GUI.
if you only have a couple GUI elements on screen, you could render them separately onto a same surface (like rendering on a texture page), then rendering primitives in the right locations on screen, using the UVs to grab the right portion of the surface. THis will keep your memory usage, and GPU usage low, whilst still performing SSAA.
 
I

Ian

Guest
If you know what shaders are, then you would know that using them is the best way to get the desired effect you want.
Either that or use high-resolution pre-aliased PNG images to draw your GUI instead of Game Makers draw functions.
The former is much easier to write and much faster to implement, and will lead to a much more consistent style.

If you choose the shader route. Here's a nice research paper on FXAA (http://developer.download.nvidia.com/assets/gamedev/files/sdk/11/FXAA_WhitePaper.pdf).
Yes, no offense but a lil redundant this topic is about shaders (aa in particlar) but thnx for the article! Actually started working on the FXAA shader for it in which i hope to just apply to the GUI surface i have hopefully doing to trick.

Another option (but probably not the best one) is to use SSAA:
render your GUI at 2x or even 4x resolution, then scale it down. this will give you the best quality AA possible. but may be quite costly depending on the complexity of your GUI.
if you only have a couple GUI elements on screen, you could render them separately onto a same surface (like rendering on a texture page), then rendering primitives in the right locations on screen, using the UVs to grab the right portion of the surface. THis will keep your memory usage, and GPU usage low, whilst still performing SSAA.
Good idea dunno why i havent thought about SS, yeah i have the GUI on a surface currently for shader effects. Ill try upscale to downscale in-game when im able to work on it again and see how much it impacts
 
Top