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

Status
Not open for further replies.
S

Sam (Deleted User)

Guest
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.
 
S

Sam (Deleted User)

Guest
OMG! Yes! Thank you! How did I not know about that? Life is good again! :D
 

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:
S

Sam (Deleted User)

Guest
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 by a moderator:
S

Sam (Deleted User)

Guest
@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

GameMaker Staff
GameMaker Dev.
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
 
S

Sam (Deleted User)

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

CMAllen

Member
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.
Is it possible that what you're getting is a result of an image asset being too large to fit on the set dimensions of your game's texture sheets and is being down-sampled as a result? I've had that happen and it took me a few to realize why it was blurrier than expected.
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
Is it possible that what you're getting is a result of an image asset being too large to fit on the set dimensions of your game's texture sheets and is being down-sampled as a result? I've had that happen and it took me a few to realize why it was blurrier than expected.
You are replying to a message from five years ago... While I appreciate the fact you're trying to help, maybe reply to people that have issues NOW... šŸ˜

Going to lock this topic to prevent further replies since it's now been bumped up to the top of the forums.
 
Status
Not open for further replies.
Top