Here's the steps I followed in a new project in GMS2. I'm having a hard time figuring out what to do.
1. Make sure the following is checked: Game Options > Windows > General > Disable file system sandbox
2. Import a sprite named sprite0
3. Create a shader named shader0. Change nothing.
4. Import most recently released gmlive. Drag obj_gmilve into room0.
5. Import shader_replace_simple
6. Create an object called TestObject with create code:
shader_set_live(shader0, true);
live_shader_updated = scr_shader_reloaded;
Step code:
var hlsl_vertex_code = @"C:\Users\bitla\Documents\GameMakerStudio2\TEMP\Shader Replace\shaders\shader0\shader0.vsh";
var hlsl_pixel_code = @"C:\Users\bitla\Documents\GameMakerStudio2\TEMP\Shader Replace\shaders\shader0\shader0.fsh";
scr_shader_reloaded(shader0, hlsl_vertex_code, hlsl_pixel_code);
Draw code:
shader_set(shader0);
draw_sprite(sprite0, 0, room_width/2, room_height/2);
shader_reset();
7. Add the object to room0.
8. Create script scr_file_get_contents with code:
var s = argument0, v = argument1;
var b = buffer_create(string_byte_length(v), buffer_grow, 1);
buffer_write(b, buffer_text, v);
buffer_save_ext(b, s, 0, buffer_tell(b));
buffer_delete(b);
9. Create script scr_shader_reloaded. I didn't know what to do so this is blank.
10. Press play.
11. Change shader0's fragment shader logic by adding this line at the end of main:
gl_FragColor.a = 0.5;
12. Press save
13. Shader did not change in the game window