GM:S 1.4 [SOLVED] Vertex Shader compilation crash

Discussion in 'Legacy GameMaker Community Tech Support' started by skeptile, Dec 6, 2017.

  1. skeptile

    skeptile Member

    Joined:
    Aug 10, 2017
    Posts:
    24
    About a week ago I had to perform a factory reset on my PC and thus had to reinstall GMS and import my project files from a backup drive. Everything seemed to be working fine, until I tried to compile an .exe. Whenever I try to run the .exe, I get the following error message:

    Code:
    ___________________________________________
    ############################################################################################
    FATAL ERROR in Vertex Shader compilation
    ShaderName: shader_outline
    
    D3DXCompile failed - result
    
    at gml_Script_draw_sprite_outlined_ext
    ############################################################################################
    --------------------------------------------------------------------------------------------
    stack frame is
    gml_Script_draw_sprite_outlined_ext (line 0)
    gml_Object_obj_menu_Draw_0
    This is especially strange, because 1) I've been using this exact shader for months and have never had any issues with it, whether running the game from the IDE or from a compiled executable, and 2) the crash only occurs when running from the executable; when I run the game from the IDE, it runs without any issue.
    Even stranger, the vertex shader is literally just the default passthrough shader.

    If it might help, here's the fragment shader:
    Code:
    varying vec2 v_vTexcoord;
    varying vec4 v_vColour;
    uniform float pixelH;
    uniform float pixelW;
    uniform float pixelA;
    uniform float outlineR;
    uniform float outlineG;
    uniform float outlineB;
    
    void main()
    {
        vec2 offsetx;
        offsetx.x = pixelW;
        vec2 offsety;
        offsety.y = pixelH;
        
        float alpha = texture2D( gm_BaseTexture, v_vTexcoord ).a;
        int done = 0;
        
        if (texture2D( gm_BaseTexture, v_vTexcoord + offsetx ).a >= float(0.1))
         done = 1;
        else if (texture2D( gm_BaseTexture, v_vTexcoord + offsety ).a >= float(0.1))
         done = 1;
        else if (texture2D( gm_BaseTexture, v_vTexcoord - offsetx ).a >= float(0.1))
         done = 1;
        else if (texture2D( gm_BaseTexture, v_vTexcoord - offsety ).a >= float(0.1))
         done = 1;
        else if (texture2D( gm_BaseTexture, v_vTexcoord + offsetx + offsety ).a >= float(0.1))
         done = 1;
        else if (texture2D( gm_BaseTexture, v_vTexcoord + offsetx - offsety ).a >= float(0.1))
         done = 1;
        else if (texture2D( gm_BaseTexture, v_vTexcoord - offsetx + offsety ).a >= float(0.1))
         done = 1;
        else if (texture2D( gm_BaseTexture, v_vTexcoord - offsetx - offsety ).a >= float(0.1))
         done = 1;
        
        gl_FragColor = v_vColour * texture2D( gm_BaseTexture, v_vTexcoord );
        
        if (done == 1 && alpha < float(0.1)) {
         alpha = float(1);
         gl_FragColor = vec4(outlineR, outlineG, outlineB, 1.0);
         }
        
        gl_FragColor.a = float(done) * pixelA * alpha;
    }
    
    (I know this shader is pretty messy, as I'm still new to writing shaders, but the point is that it has always run without any issues in the past.)

    Thanks for any advice you may have.
     
  2. icuurd12b42

    icuurd12b42 TMC Founder GMC Elder

    Joined:
    Apr 22, 2016
    Posts:
    1,839
    check the shader type dropdown in the properties of the shader (in toolbar) maybe?
     
  3. skeptile

    skeptile Member

    Joined:
    Aug 10, 2017
    Posts:
    24
    Where it says GLSL ES, GLSL, etc?
    I tried each one, and nothing changed..
     
  4. IndianaBones

    IndianaBones Member

    Joined:
    Jul 5, 2016
    Posts:
    2,204
    Make sure your graphics card drivers are up to date since you did a reset of your PC.

    Also reinstall/update DirectX.
     
  5. skeptile

    skeptile Member

    Joined:
    Aug 10, 2017
    Posts:
    24
    That worked! Thanks for the help :)
     
    IndianaBones likes this.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice