• 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!

3D Anti Aliasing for 3D?

kamiyasi

Member
Ok, so here's how my project setup works. The game's view size is 1920x1080, which is then set to the user's display size and the application surface is resized to the user's display size using these lines...
Code:
surface_resize(application_surface,view_wport[0],view_hport[0]);
display_set_gui_size(view_wport[0],view_hport[0]);
window_set_size(view_wport[0],view_hport[0]);
This works great for resizing my game to a variety of screen sizes, but I notice that my 3D elements are very aliased. Here's a snippet of one area where you can clearly see how aliased it is.
upload_2016-11-8_11-31-14.png

Can somebody recommend a way to reduce aliasing? I already have interpolate color between pixels checked on. Thank you.


EDIT:

Actually after just a little more searching I found display_reset() and that works perfectly, however, I have a question.

In the manual, it says
This variable will return a value based on the setting of bits for the different levels. So for only 2xAA, this will report 2, for 2x and 4x availability it will report 6. For 8 and 4 it will report 12. For all 3 levels (2,4 and 8) it will report 14.

if display_aa > 12 display_reset(8, true);
But shouldn't that be " if display_add >= 12 display_reset(8, true) " since it says that for 8xaa the function display_aa will return 12?
 
Last edited:
M

Misu

Guest
There are two alternative ways:

1. Using display_aa to allow anti-alias; I am not sure if this will help you on this project however, this is how it would work:

Code:
 if display_aa > 12 display_reset(8, false);
2. Surface resizing. Similar to what you are doing, except we would want to resize it twice:

CREATE EVENT:
Code:
ss[0] = surface_create(1920,1080)
ss[1] = surface_create(1920/2,1080/2)
DRAW EVENT:
Code:
surface_set_target(ss[0])
draw_clear_alpha(0,0)
//everything that is drawn in your game goes here
surface_reset_target()
GUI EVENT:
Code:
surface_set_target(ss[1])
draw_clear(0)
draw_surface_stretched(ss[0],0,0,1920/2,1080/2)
surface_reset_target()

draw_surface_stretched(ss[1],0,0,1920/4,1080/4)
Still need to adjust screen position though but it looks very nice. This one would likely lag depending on screen size and hardware.
 
Top