[GameMaker Studio] Blurry Surfaces… Why??

If you use interpolation for your game’s graphic settings, drawing surfaces can appear blurrier than expected. This is due to graphics being interpolated (smoothed out) when they are drawn to a surface, then being interpolated a second time when the surface is drawn to the main view. There is a simple way to resolve this.

When drawing to a surface, interpolation can be temporarily turned off with texture_set_interpolation() and turned back on when you are finished drawing to the surface. The result is a sharper image when drawing the surface to the main view.

/*** DRAW EVENT ***/
// Set the surface for drawing
surface_set_target(mySurface);

// Turn off interpolation
texture_set_interpolation(false);

// Draw stuff to the surface
draw_sprite(spr_StrongBad, 0, 0);
draw_sprite(spr_HomeStar, 32, 100);

// Turn on interpolation
texture_set_interpolation(true);

// Route drawing back to main view
surface_reset_target();

// Draw the surface to the main view
draw_surface(0, 0);

There!
You should now have a much crisper image when drawing with surfaces!

null

Leave a Reply