A downloadable extensions for Windows

Buy Now$9.95 USD or more

This extension lets you replace a GMS1 or GMS2 shader while the game is running.

It is primarily intended for use with GMLive, but might be useful on its own too.

Supported platforms:

  • GMS1: Windows, recent versions (1.4.1804+) only.
  • GMS2: Windows, no version restriction.

Functions:

  • shader_replace_simple(shader_index, vertex_hlsl_code, pixel_hlsl_code)->error_string
    Attempts to compile a shader from vertex+fragment strings and replace the given game shader by it. Returns "" if successful or error message otherwise.

Notes:

  • Shader must be in GM-compliant HLSL format
    As per above, HLSL9 for GMS1 or HLSL11 for GMS2. Internally, GM always compiles your shaders to HLSL when targeting Windows.
    The easiest way to do so is to pass your GLSL shader through GM's own HLSLCompiler.exe (see demo project for arguments). Or, if you want to get advanced, use Google's ANGLE compiler to assemble your own converter.
    For convenience, I include a "execute_program_pipe" extension that can execute a program and return the output from it, allowing this to be done in-game.
  • Layout must match between old and new shader
    That is, must have the same number/order of attributes/variyings/uniforms.
    If the layout doesn't match, result is undefined.

Demo: Allows you to edit and reload a shader on click.

Purchase

Buy Now$9.95 USD or more

In order to download this extensions you must purchase it at or above the minimum price of $9.95 USD. You will get access to the following files:

execute_program_pipe.gmez 51 kB
shader_replace_simple.gmez 18 kB
shader_replace_simple.yymp 82 kB
shader_replace_simple_demo.yyz 1 MB

Download demo

Download
shader_replace_simple_demo.zip 3 MB