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

Legacy GM [SOLVED] Vertex Shader compilation crash

S

skeptile

Guest
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.
 
I

icuurd12b42

Guest
check the shader type dropdown in the properties of the shader (in toolbar) maybe?
 
Make sure your graphics card drivers are up to date since you did a reset of your PC.

Also reinstall/update DirectX.
 
Top