• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Black and White draw shader works in Windows 10, macOS, and Linux (errors on Windows 11)

S

Sam (Deleted User)

Guest
Code:
___________________________________________
############################################################################################
FATAL ERROR in Vertex Shader compilation
ShaderName: sdr_Monochrome

Invalid shader
at gml_Object_obj_ViewImages_Draw_64 (line 3) - if (mono) shader_set(sdr_Monochrome);
############################################################################################
gml_Object_obj_ViewImages_Draw_64 (line 3)
GML:
//
// Simple passthrough vertex shader
//
attribute vec3 in_Position;                  // (x,y,z)
//attribute vec3 in_Normal;                  // (x,y,z)     unused in this shader.
attribute vec4 in_Colour;                    // (r,g,b,a)
attribute vec2 in_TextureCoord;              // (u,v)

varying vec2 v_vTexcoord;
varying vec4 v_vColour;

void main()
{
    vec4 object_space_pos = vec4( in_Position.x, in_Position.y, in_Position.z, 1.0);
    gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION] * object_space_pos;
   
    v_vColour = in_Colour;
    v_vTexcoord = in_TextureCoord;
}
GML:
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
void main() {
    vec4 source = v_vColour * texture2D( gm_BaseTexture, v_vTexcoord );
    float brightness = dot( vec3( 0.2989, 0.5870, 0.1140 ), source.rgb );
    gl_FragColor = vec4( vec3( brightness ), source.a );
}
I got the fragment shader from reddit. They said the vertex shader can be the default one generated by the IDE so I kept that. Like the title says, works on Windows 10 (i686 and amd64), macOS (amd64 and arm64), and Linux (armv7, amd64, and arm64) but it doesn't work on Windows 11 regardless of target architecture. Is this a Windows 11 compatibility bug I should report to the helpdesk or something else? Nothing about the drawing code that uses the shader is any different and I'm fairly confident that is not the issue as the shader does exist.
 

devKathy

Member
Guessing you've already done this, but if you haven't, try a different shader real quick, and see if it draws anything :)

Doesn't the console have printouts related to OpenGL on build? If so, what do those say? Is OpenGL installed? :D

I'm only guessing here, don't at me bro!
 
S

Sam (Deleted User)

Guest
The only thing it prints to the console relevant to the issue is the error I already quoted, aside from exiting with a non-zero status:

Code:
"cmd"  /c subst Z: "C:\Users\windows\AppData\Roaming\GameMakerStudio2\Cache\GMS2CACHE"

elapsed time 00:00:00.0488306s for command "cmd" /c subst Z: "C:\Users\windows\AppData\Roaming\GameMakerStudio2\Cache\GMS2CACHE" started at 10/14/2021 19:15:12
"cmd"  /c subst Y: "C:\Users\windows\AppData\Local\GameMakerStudio2\GMS2TEMP"

elapsed time 00:00:00.0548792s for command "cmd" /c subst Y: "C:\Users\windows\AppData\Local\GameMakerStudio2\GMS2TEMP" started at 10/14/2021 19:15:12
"cmd"  /c subst X: "C:\ProgramData\GameMakerStudio2\Cache\runtimes\runtime-2.3.5.458"

elapsed time 00:00:00.0518250s for command "cmd" /c subst X: "C:\ProgramData\GameMakerStudio2\Cache\runtimes\runtime-2.3.5.458" started at 10/14/2021 19:15:12
"C:\ProgramData/GameMakerStudio2/Cache/runtimes\runtime-2.3.5.458/bin/Igor.exe"  -j=8 -options="C:\Users\windows\AppData\Local\GameMakerStudio2\GMS2TEMP\build.bff" -v -- Windows Run

Loaded Macros from C:\Users\windows\AppData\Roaming\GameMakerStudio2\Cache\GMS2CACHE\ArtCompani_DF8D73C9_F97E1FF8\macros.json
Options: X:/bin\platform_setting_defaults.json
Options: C:\Users\windows\AppData\Roaming/GameMakerStudio2\samuelvenable_1076\local_settings.json
Failed to load Options from C:\Users\windows\AppData\Roaming/GameMakerStudio2\samuelvenable_1076\local_settings.json
Options: C:\Users\windows\AppData\Roaming\GameMakerStudio2\Cache\GMS2CACHE\ArtCompani_DF8D73C9_F97E1FF8\targetoptions.json
Setting up the Asset compiler
X://bin/GMAssetCompiler.exe  /c /mv=1 /zpex /iv=0 /rv=0 /bv=0 /j=8  /gn="ArtCompanion" /td="Y:/" /cd="Z:/ArtCompani_DF8D73C9_F97E1FF8" /zpuf="C:\Users\windows\AppData\Roaming/GameMakerStudio2\samuelvenable_1076" /m=windows /tgt=64 /nodnd /cfg="Default" /o="Y:/ArtCompanion_5F593C0C_VM" /sh=True /optionsini="Y:/ArtCompanion_5F593C0C_VM\options.ini"  /cvm /baseproject="X:/BaseProject\BaseProject.yyp" "C:\Users\windows\Documents\GameMakerStudio2\ArtCompanion\ArtCompanion.yyp" /preprocess="Z:/ArtCompani_DF8D73C9_F97E1FF8"
Found Project Format 2
ProjectFileWatcher:StartWatching:C:\Users\windows\Documents\GameMakerStudio2\ArtCompanion
Started: 10/14/2021 7:15:13 PM
Finished: 10/14/2021 7:15:14 PM
Diff: 00:00:01.2776887
Loaded Project: ArtCompanion
Not setting Steam AppId as Steam is not enabled in platform options
finished.
Release build
Options: Z:/ArtCompani_DF8D73C9_F97E1FF8\ExtensionOptions.json
OptionsIni
Options: Z:/ArtCompani_DF8D73C9_F97E1FF8\PlatformOptions.json
[Compile] Run asset compiler
X://bin/GMAssetCompiler.exe  /c /mv=1 /zpex /iv=0 /rv=0 /bv=0 /j=8  /gn="ArtCompanion" /td="Y:/" /cd="Z:/ArtCompani_DF8D73C9_F97E1FF8" /zpuf="C:\Users\windows\AppData\Roaming/GameMakerStudio2\samuelvenable_1076" /m=windows /tgt=64 /nodnd /cfg="Default" /o="Y:/ArtCompanion_5F593C0C_VM" /sh=True /optionsini="Y:/ArtCompanion_5F593C0C_VM\options.ini"  /cvm /baseproject="X:/BaseProject\BaseProject.yyp" "C:\Users\windows\Documents\GameMakerStudio2\ArtCompanion\ArtCompanion.yyp" /bt=run /rt=vm /64bitgame=false
Compile Constants...finished.
Remove DnD...finished.
Compile Scripts...finished.
Compile Rooms...finished.
Compile Objects...finished.
Compile Timelines...finished.
Compile Triggers...finished.
Compile Extensions...finished.
Global scripts...finished.
finished.
collapsing enums.
Final Compile...finished.
Looking for built-in particle images in C:\ProgramData\GameMakerStudio2\Cache\runtimes\runtime-2.3.5.458\bin\ParticleImages
Saving IFF file... Y:/ArtCompanion_5F593C0C_VM\ArtCompanion.win
Writing Chunk... GEN8
option_game_speed=60
Writing Chunk... OPTN
Writing Chunk... LANG
Writing Chunk... EXTN
Writing Chunk... SOND
*writing audio file musicChant.ogg...
*writing audio file musicChantDeep.ogg...
Writing Chunk... AGRP
Writing Chunk... SPRT
Writing Chunk... BGND
Writing Chunk... PATH
Writing Chunk... SCPT
Writing Chunk... GLOB
Writing Chunk... SHDR
Writing Chunk... FONT
Writing Chunk... TMLN
Writing Chunk... OBJT
Writing Chunk... ACRV
Writing Chunk... SEQN
Writing Chunk... TAGS
Writing Chunk... ROOM
Writing Chunk... DAFL
Writing Chunk... EMBI
Writing Chunk... TPAGE
Texture Group - Default
Writing Chunk... TGIN
Writing Chunk... CODE
Writing Chunk... VARI
Writing Chunk... FUNC
Writing Chunk... STRG
Writing Chunk... TXTR
0 Compressing texture... writing texture texture_0.png...
1 Compressing texture... writing texture texture_1.png...
2 Compressing texture... writing texture texture_2.png...
3 Compressing texture... writing texture texture_3.png...
4 Compressing texture... writing texture texture_4.png...
5 Compressing texture... writing texture texture_5.png...
6 Compressing texture... writing texture texture_6.png...
Writing Chunk... AUDO
Writing Chunk... SCPT
Writing Chunk... DBGI
Writing Chunk... INST
Writing Chunk... LOCL
Writing Chunk... DFNC
Writing Chunk... STRG
Writing Audio Group AlwaysOn
Stats : GMA : Elapsed=2822.4055
Stats : GMA : sp=47,au=4,bk=0,pt=0,sc=144,sh=1,fo=4,tl=0,ob=60,ro=19,da=12,ex=3,ma=38,fm=0x5040B31D6FF73EB4
DoSteam
Igor complete.
[Run] Run game
Options: Z:/ArtCompani_DF8D73C9_F97E1FF8\MainOptions.json
X://windows/Runner.exe  -game "Y:/ArtCompanion_5F593C0C_VM\ArtCompanion.win"
Setting scheduler resolution to 1
Attempting to set gamepadcount to 12
DirectX11: Using hardware device
Invalid shader (is it marked as incompatible type for this target?) "sdr_Monochrome":
Collision Event time(microsecs)=35
Audio group 1 -> Loading...
Total memory used = 24850250(0x017b2f4a) bytes
**********************************.
Entering main loop.
**********************************.
Audio group 1 -> Loaded
vector[0] = "C:\Users\windows\Pictures\screenshot00.png"
vector[1] = "C:\Users\windows\Pictures\screenshot01.png"
ERROR!!! :: ############################################################################################
FATAL ERROR in Vertex Shader compilation

ShaderName: sdr_Monochrome


Invalid shader

at gml_Object_obj_ViewImages_Draw_64 (line 3) - if (mono) shader_set(sdr_Monochrome);
############################################################################################
gml_Object_obj_ViewImages_Draw_64 (line 3)



X://windows/Runner.exe exited with non-zero status (1)
elapsed time 00:00:39.2086353s for command "C:\ProgramData/GameMakerStudio2/Cache/runtimes\runtime-2.3.5.458/bin/Igor.exe" -j=8 -options="C:\Users\windows\AppData\Local\GameMakerStudio2\GMS2TEMP\build.bff" -v -- Windows Run started at 10/14/2021 19:15:12
"cmd"  /c subst Z: /d

elapsed time 00:00:00.0367889s for command "cmd" /c subst Z: /d started at 10/14/2021 19:15:51
"cmd"  /c subst Y: /d

elapsed time 00:00:00.0408666s for command "cmd" /c subst Y: /d started at 10/14/2021 19:15:51
"cmd"  /c subst X: /d

elapsed time 00:00:00.0438502s for command "cmd" /c subst X: /d started at 10/14/2021 19:15:51
FAILED: Run Program Complete
For the details of why this build failed, please review the whole log above and also see your Compile Errors window.
I just installed OpenGL from the MS store to see if that would fix it and the issue remains.

I will try other shaders and see if they work.
 

Gizmo199

Member
Try creating a new vec3 by passing brightness as individual vectors? Not sure but a long shot

Eg: vec3(brightness, brightness, brightness)
 
S

Sam (Deleted User)

Guest
Try creating a new vec3 by passing brightness as individual vectors? Not sure but a long shot

Eg: vec3(brightness, brightness, brightness)
I don't program shaders, just copy and paste ones I find.
 

Gizmo199

Member
I don't program shaders, just copy and paste ones I find.
Gotcha. If you are just trying to grayscale I always use:

Code:
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
void main() {
    vec4 source = v_vColour * texture2D( gm_BaseTexture, v_vTexcoord );
    float lum = ( source.r + source.g + source.b ) / 3.;
    gl_FragColor = vec4( vec3( lum ), source.a );
}
but for this specific shader try this:
Code:
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
void main() {
    vec4 source = v_vColour * texture2D( gm_BaseTexture, v_vTexcoord );
    float brightness = dot( vec3( 0.2989, 0.5870, 0.1140 ), source.rgb );
    source.rgb = vec3(brightness , brightness , brightness);
    gl_FragColor = source;
}
I'm curious if it is a vec issue or a dot issue. Never used that approach so not sure. I can test it out but if it's a win11 issue then I would assume its a function error?
@Xor / @flyingsaucerinvasion thoughts?

edit: Also I don't know why ES vs standard GLSL would make a huge difference if you are running windows. If I remember correctly, ES is for inclusion with apple runtimes (or it might be windows only, I can't quite remember). Don't quote me on that though. haha.
 
Last edited:
S

Sam (Deleted User)

Guest
I was able to verify from trying a load of other shaders from the marketplace that shaders don't seem to work at all on my windows 11 install.

I'll try what you just shared @Gizmo199 and will report whether it works in an edit. Thank you!

Edit: same thing:

GML:
___________________________________________
############################################################################################
FATAL ERROR in Vertex Shader compilation
ShaderName: sdr_Monochrome

Invalid shader
at gml_Object_obj_ViewImages_Draw_64 (line 3) - if (mono) shader_set(sdr_Monochrome);
############################################################################################
gml_Object_obj_ViewImages_Draw_64 (line 3)
I tried both shaders you gave.

...assuming those were fragment shaders.
 
Last edited by a moderator:

Gizmo199

Member
I was able to verify from trying a load of other shaders from the marketplace that shaders don't seem to work at all on my windows 11 install.

I'll try what you just shared @Gizmo199 and will report whether it works in an edit. Thank you!

Edit: same thing:

GML:
___________________________________________
############################################################################################
FATAL ERROR in Vertex Shader compilation
ShaderName: sdr_Monochrome

Invalid shader
at gml_Object_obj_ViewImages_Draw_64 (line 3) - if (mono) shader_set(sdr_Monochrome);
############################################################################################
gml_Object_obj_ViewImages_Draw_64 (line 3)
okay yeah, seems like an OS/openGL issue (though you mentioned you re-installed openGL?). Can you run compiled shaders (e.g. an .EXE game that has shaders?).
Edit: This is getting a bit out of my area of expertise. The only thing left I could as would be, does a blank (default) shader run at all?
 
S

Sam (Deleted User)

Guest
okay yeah, seems like an OS/openGL issue (though you mentioned you re-installed openGL?). Can you run compiled shaders (e.g. an .EXE game that has shaders?).
Running from the ide is no different from building a game, either way it produces the same .win file with identical contents which is read by the VM runner. Or do you mean I should use YYC?

It's odd it is a vertex shader compilation error, since I used the exact default text for that when i created the shader resource.

Is anyone else having this issue on Windows 11?
 

Gizmo199

Member
Running from the ide is no different from building a game, either way it produces the same .win file with identical contents which is read by the VM runner. Or do you mean I should use YYC?

It's odd it is a vertex shader compilation error, since I used the exact default text for that when i created the shader resource.

Is anyone else having this issue on Windows 11?
I mean an actual build .exe file. Does webGL run?
[expunged]

edit: I'm an idiot and mis understood what you were meaning. Maybe the YYC could help. I am still curious though if webGL works or not. But yeah, I've exhausted all of my thoughts on the issue, and I definitely don't know much about win11.
@Xor or @flyingsaucerinvasion are your best bet. Wish I could help more! :(
 
Last edited:
S

Sam (Deleted User)

Guest
I mean an actual build .exe file.
I know what you meant. I don't need it to run on WebGL or HTML5 because that is not what my client is looking to target. I can try it but it still won't solve the issue with it not working on the Win32 target.

Did you not know the executable you "build" is just the runner with a different icon slapped on it with the data.win put in the same directory instead of a temporary one? That's kinda why I said its no different, unless you meant I should use the YYC, which actually is different from the VM. Whether running from the IDE or from a double click in file exporer, the VM target is the same whatever way you choose to run it.

Thanks for being patient with me, I just thought that needed some clarification.

Edit: the HTML5 shader worked, trying the executable now...
 

Gizmo199

Member
I know what you meant. I don't need it to run on WebGL or HTML5 because that is not what my client is looking to target. I can try it but it still won't solve the issue with it not working on the Win32 target.

Did you not know the executable you "build" is just the runner with a different icon slapped on it with the data.win put in the same directory instead of a temporary one? That's kinda why I said its no different, unless you meant I should use the YYC, which actually is different from the VM. Whether running from the IDE or from a double click in file exporer, the VM target is the same whatever way you choose to run it.

Thanks for being patient with me, I just thought that needed some clarification.
Sorry, yeah I just edited my comment above. I'm an idiot. haha. I don't know if the YYC would do much good but it's worth a shot! Best of luck. This is very strange! haha
 
S

Sam (Deleted User)

Guest
You're not an idiot, you're trying to help which is a kind gesture no one is forcing you to do. If anything I'm thankful you stopped by.

Edit: I'm trying to make a project based on the extension file. I didn't see a demo exe but maybe I didn't look hard enough.

Edit: beginning to think this is a hardware limitation because it still didn't work. Really odd because i bought this laptop new, not used or refurbished, it was bought this year.
 
Last edited by a moderator:

devKathy

Member
Microsoft hates OpenGL, and wants to break it :p

OpenGL should come with demos; have you run any of those, and what's the result? When I installed the drivers so that my TensorFlow could talk to my GPU using OpenCL, the demos came with. I was able to execute and thus verify that they worked. This was on Linux, so I may not be able to help with specifics. Nonetheless, the demos should be there.

EDIT: what's your GPU? Is it integrated graphics by any chance?
 
S

Sam (Deleted User)

Guest
I've used enough time trying to figure this out for now, I'll use windows 10 on my mac mini until i have more time to investigate this. Thanks guys!
 

GMWolf

aka fel666
One option may be to have a windows specific shader.
So use the GLSL ES on all platforms.
Use the hlsl shader on windows.
Converting it to hlsl shouldn't be a big deal, I'm sure lots of people can help you with that.
 

gnysek

Member
But in this case it seems that it works on Win10, not working on WIn 11, so this solution might not work (but in other case shader_is_compiled should allow to find optimal one when having few shaders). I believe that direct x might be an issue here.
 

O.Stogden

Member
The shader works fine on Windows 11 for me (Just upgraded from Windows 10 today and thought I'd try this shader out just in case there was an issue).

Could be that your specific hardware config is having issues with newer drivers/software maybe?
 
Top