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

Discussion [SOLVED] GMS2 "Shader Invalid" error when setting a shader

M

Micle

Guest
Hey everyone, I was testing out some shaders in GMS2 today but unfortunately I am getting a really annoying error whenever I try starting my game.

This is what I have in my Draw Event:
Code:
shader_set( shd );
shader_reset();
The shader is the default shader template you get when creating one and it's set to GLSL ES. When I start my game I get an error straight away.
Code:
___________________________________________
############################################################################################
FATAL ERROR in Vertex Shader compilation
ShaderName: shd

Invalid shader
 at gml_Object_obj_Surfaces_Draw_0 (line 3) - shader_set( shd );
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Object_obj_Surfaces_Draw_0 (line 3)
When I download some shader demo off the internet and run it, it works fine but whenever I try creating a shader in my own project it doesn't work. This is really annoying. Any feedback will be appreciated.
 

rIKmAN

Member
Are you editing the shader yourself, or just the default shader that is created gives this error too?

If you right-click the shader in the Resource Tree, check the shader type is set to GLSL_ES.
 
M

Micle

Guest
Thanks for the replies, I went back to it after a while and it seems to be working fine now.
It was just a basic shader you get when creating one and setting it inside a draw event. It was always set to GLSL_ES.

Anyway, it's fixed itself, thanks again.
 
Top