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

 [SOLVED] GML function to turn on/off "interpolate colors between pixels"

Samuel Venable

Time Killer
I posted a helpdesk ticket with the following contents:
I would like to request for there to be a GML function to turn on and off the feature "interpolate colors between pixels" at runtime, and a GML function to check at runtime whether that feature is currently being used, similarly to what was done for "use synchronization to avoid tearing" with display_set_windows_alternate_sync(flag).

This feature would be very useful for my projects, as some parts of a game I will want sharp edges for pixel art, and smoothness applied to HD elements like the title screen.

Thanks!
Anyone else want this?

If there's enough demand for it, YYG will be more likely to implement it.
 

Mick

Member
Ok, so I tried this, and the functions seem to not do anything. Is this a known bug?
I tried this and noticed that the interpolate setting is ineffective when drawing things at 1:1 pixel ratio, when drawing something scaled, it works. From the manual:

When this is enabled (true) all textures will be smoothed when drawn (this includes sprites as they too are considered textures), meaning that when scaled or moved if there is not a 1:1 pixel ratio then there will be a "smudging" across various pixels which may make images appear blurry depending on the art style used.
Same thing goes when enabling "interpolate colours..." in the game settings.
 
K

Kenjiro

Guest
I tried this and noticed that the interpolate setting is ineffective when drawing things at 1:1 pixel ratio, when drawing something scaled, it works. From the manual:

Same thing goes when enabling "interpolate colours..." in the game settings.
Strange one. Yet it works 1:1 in GMS 1.4.
 

nesrocks

Member
I think it is weird to interpolate on 1:1. Why would anyone want that? It would just blur the image. If you want your 1:1 graphics more blurry why not make it blurred in photoshop?
If what you want is anti alias filter then aa is builtin: display_reset(aa, vsync);
 
Last edited:

Samuel Venable

Time Killer
If what you want is anti alias filter then aa is builtin: display_reset(aa, vsync);
The thing about display_reset though is, does it override the "interpolate colors between pixels", under game options?

I need this for an extension I am developing. If there is the slightest bit of interpolation turned on, by the end user, it breaks my extension, because one of the things my extension can do, is make a single RGB color value in the window client area draw invisibly. If there is the slightest bit of interpolation, the intended color that draws invisibly, will have ugly "in between" colors still visible, along the edges.

Edit:

I just tried it and I was right, it does not override "interpolate colors between pixels", under game options...
 
Last edited:

Samuel Venable

Time Killer
@rwkay

Thank you for the clarification! :)

However, the function you mention I've already tried and it isn't working for me as intended. See earlier posts for more details.
Ok, so I tried this, and the functions seem to not do anything. Is this a known bug?
As @Mick said, my problem occurs when the game is at a 1:1 pixel ratio.
I tried this and noticed that the interpolate setting is ineffective when drawing things at 1:1 pixel ratio, when drawing something scaled, it works.
I reported this to the helpdesk.
 

rwkay

YoYo Games Staff
YYG Staff
If you are drawing at 1:1 (and moving at whole pixels) then it will have no effect in any case it only has an effect when you are moving at fractional pixels or scaling...

Russell
 

Samuel Venable

Time Killer
Ok, thanks for letting me know. :D I thought this was a bug, but since that is the intended behaviour, I'll request the ticket to be closed. Topic solved.
 

gnysek

Member
It's working exactly same as in 1.4 and exactly same as turning it on from Game Settings. Nothing changed in latest releases, my game is using it and have in-game option to enable/disable, so it's for sure working same as in any older GMS version.
 
Top