Legacy GM How to turn off shader for specific browsers in HTML5

Focksbot

Member
My whole-surface shader doesn't display correctly (in fact, it doesn't display anything) in Safari or Amazon's Silk browser, but I can't seem to get it to switch off just for these browsers. I've tried the following:

Code:
if (shader_is_compiled(shader)) {

shader_set(shader)
shader_set_uniform_f(usize,room_width,room_height,blurRadius)//width,height,radius
var int_position = application_get_position();
draw_surface_ext(application_surface,0,0,1,1,0,-1,1);
shader_reset()

}
I've also tried variations on 'if os_browser =' to get this code to run only if the browser *isn't* Safari or Unknown, and I've tried setting the code to run only 'if' the browser is Chrome or Firefox.

None of this works. But if I take out the above code completely, Safari runs the rest of the game all right.

I've even tried removing the code and putting it in a script, then telling the game only to run the script if the browser is Chrome. Safari still, apparently, tries to run it. To be clear, this code -

Code:
if os_browser = browser_chrome {

run_shader();

}
- breaks the game in Safari. If I take out the line 'run_shader()', it works.

Any help appreciated.
 

Focksbot

Member
I haven't remotely solved this issue, but in case anyone finds this thread who's having a similar problem, I've done a fudge where I tell the shader to only run full-screen during transitions. That way at least the Safari screen only goes blank white at particular moments and the game is somewhat playable.
 
Top