• 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!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

(Updated problem) Interpolate colours + semi transparent sprites + rotation or sub pixel movement = ugly borders

Kinkelin

Member
Hello everyone,

I tried to use image_blend / draw_set_color for colored text and dynamically colored images. No scaling is involved here. But as soon as I turn on the Windows Graphics "Interpolate colours between pixels" game option, some grey pixels appear at the semi-transparent edges of the sprite.
My 2 example are
1. Calibri Bold Size 128 Font drawn with draw_set_color(c_custom_green) beforehand
2. A white sprite with semi transparent white pixels at the borders. It is assigned to an object, where image_blend = c_custom_green.

image_blend with Interpolate:

1622741602800.png
1622741651757.png

image_blend without Interpolate:
1622742018650.png
1622742044746.png

I can probably use a simple shader as a workaround, so it's not too dramatic. My questions would just be:
1. Am I doing something wrong here?
2. Is this a known problem?
3. Is this somewhat intentional / a technical limitation?
4. Is this just a bug?

Thanks for your time!
 

TsukaYuriko

☄️
Forum Staff
Moderator
I copied your setup to the best extent of my abilities and am not encountering the issue you describe with this code:
GML:
gpu_set_texfilter(true);
draw_set_font(calibri128);
draw_set_color($7AF5C8);
draw_text(20, 20, "Tic");
I did, however, encounter it - and by that I mean it looks identical to your screenshot - when I tried to draw at a y coordinate of 20.5. Are you sure you're drawing at integer coordinates?
 

Kinkelin

Member
Rounding the coordinates worked like a charm. Thanks a lot!

I still don't know why it appeared grey (instead of blurry or something), but it is definitely better to draw at integers. Problem solved!
 

Kinkelin

Member
Unfortunately the problem is back now: I added sequences to animate some of my sprites. In the example below the sprites are set on integer coordinates and not moving. The bottom sprite is rotated by the sequence (sprite on top is not rotated ingame, it's just the sprite itself). I do not use image_blend here, it is just a rotated sprite with green pixels.

I could maybe do it myself with shaders instead, but this feels like a bug. And rotation is a standard feature of sequences...
 

Attachments

Last edited:

Kinkelin

Member
1623310342130.png
test.png

I isolated the problem!
GML:
draw_set_color(c_black);

draw_sprite_ext(spr_test,0,200,200,1,1,17.5,c_white,1);
draw_text(200, 300, "Rotated");

draw_sprite_ext(spr_test,0,500,200,1,1,0,c_white,1);
draw_text(500, 300, "Default");

draw_sprite_ext(spr_test,0,800.5,200.5,1,1,0,c_white,1);
draw_text(800, 300, "Non integer coordinates");
With the sprite and this code inside a simple object in a white room you will get the screenshot above (using the Interpolate between colours option). Any ideas? I would probably have to use shaders and code the movement myself, because sequences use the default game maker stuff
 
Top