[Solved] Sprite AA interpolation issue (dark outline when rotating)

M

Monsi

Guest
This is what the color blending is like in the sprite editor (drawing polygons with anti-aliasing enabled)
upload_2017-9-15_0-27-2.png
upload_2017-9-15_0-25-55.png
Nice smooth transitions.

This is what drawing two rotated sprites ingame looks like:
upload_2017-9-15_0-27-40.pngupload_2017-9-15_0-27-24.png

Does anyone know how I can get the result to look the same as in the editor? ^^
 

RangerX

Member
What's your process exactly? What does the original sprite looks like before being rotated?
The quality of the rotation of your sprites in editor will depend on their size (the bigger the sprite is, the more their are pixels available to represent it).
The quality of a rotation at run time will totally depends on your game's resolution. The resolution at which your sprite is rendered to screen. The higher that resolution, the better will look your rotated sprite for the same reason again: more pixels available to represent the image).
 
M

Monsi

Guest
It's literally a just scribble in the GMS editor, no AA, just selecting the paint brush and drawing one color. It looks crisp pixel perfect at 0 degrees but the moment you rotate it (with pixel interpolation enabled in graphics settings), it develops this dark outline. It's actually the same if you use the resize function to scale it down in the pixel editor with the quality up.
 

Dmi7ry

Member
Try to use pre-multiply alpha button (but keep in mind that it changes sprites) and then draw it with (bm_one, bm_inv_src_alpha) blend mode:
Code:
draw_set_blend_mode_ext(bm_one, bm_inv_src_alpha);
draw_self();
draw_set_blend_mode(bm_normal);
 
P

pieterator

Guest
Are you drawing onto a surface that you then draw to screen?
 
M

Monsi

Guest
Code:
draw_set_blend_mode_ext(bm_one, bm_inv_src_alpha);
draw_self();
draw_set_blend_mode(bm_normal);
upload_2017-9-16_19-0-8.png
upload_2017-9-16_19-3-32.png
That... fixes it! Thank you so much! It works without premultiplying the alpha as well. How come this isn't default behavior? Is it slower or something?

Are you drawing onto a surface that you then draw to screen?
No, just draw_sprite_ext with a rotation value straight to the application_surface
 
Top