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

HTML5 How does gpu_set_texfilter work in HTML5 (GMS2 - 2.2.4)?

Greetings,

I’m trying to make my HTML5 games playable when webgl is enabled and when webgl is disabled. After some testing it seems that disabling linear interpolation when webgl is disabled is a big plus and improvement when it comes to keeping graphics and textures consistent. The global HTML5 settings regarding webgl is on auto detect.

To get to this conclusion I did some tests by manually turning the global interpolate colors between pixels option on and off, checking webgl_enabled, checking gpu_get_texfilter and switching webgl on and off in Firefox using the hidden about:config options. I used these variables to check if game maker studio 2 was actually able to detect webgl changes and what the interpolation options were.

My goal is to turn off linear interpolation, if it is not already off, when I detect that webgl is disabled and I would like to turn it on, if it is not already on, when webgl is enabled. Detecting if webgl is enabled or not works flawless, detecting the current interpolation setting works only when webgl is enabled and changing the interpolation using gpu_set_texfilter doesn’t work when webgl is disabled.

As mentioned, my findings were that my game if webgl is disabled looks better if linear interpolation is also disabled. For some reason I can’t seem to get gpu_set_texfilter to work and gpu_get_texfilter always returns null when I try to detect the interpolation setting when webgl is disabled.

Is there something I missed regarding the use of gpu_set_texfilter and gpu_get_texfilter when it comes down to HTML5? I can get it to work when I change the global interpolation options in game maker itself, but that’s not dynamic. That would mean that I must export two different versions of the game which would be weird as there is a webgl_enabled option.

I’m leaning towards this being a bug as gpu_get_texfilter returns null when webgl is disabled. Which is weird as you can run games with the global interpolation on or off even when webgl is disabled.

Any thoughts?
 
Last edited:
Top