GLSL No subshaders can run on this graphics card :( (GTX 980)

[EDIT]
I suspect that I am silly and GLSL doesn’t apply to windows computers xD Am I right?
In that case, is there a way to force it to work?

Hey guys!

Reading this section on basic shaders using GLSL GLSL Programming/Unity/Minimal Shader - Wikibooks, open books for an open world

but when I jump into Unity, I get the error: "Shader warning in ‘GLSL custom shader’: No subshaders can run on this graphics card.
None of the shaders discussed in the further sections of wiki work ether (when copy-pasted)

Even if I reduce all the code to just:

Shader “GLSL custom shader” {
SubShader {
Pass {
GLSLPROGRAM

ENDGLSL
}
}
}

I get the same error. My card is Gigabyte GTX 980

However any CGPROGRAM shaders can compile and execute correctly.
I stumbled accross this guy: Simple shader throws warning "No subshaders can run on this graphics card" - Unity Engine - Unity Discussions

but his code runs fine on my machine, even though he had the same error message on his pc.

Please help and thank you!

Indeed, you have to run unity in a forced openGL mode:

  1. Create a shortcut of unity.exe file
    2)Right click on unity shortcut → properties and change in Target from “C:\Program Files\Unity\Editor\Unity.exe”

to

“C:\Program Files\Unity\Editor\Unity.exe” -force-opengl

  1. double click on that new shortcut to start unity in a forced opengl mode

if it helped anyone, you can check out my youtube channel https://www.youtube.com/user/Kapurod

I ran Unity with the -force-opengl flag and my project worked in the preview. But when I did the Build and Run, it still failed. So I went to the command line and ran the player manually with " myproject.exe -force-opengl" and the got the project to work. Wish there was a way to automate that, but couldn’t find any docs.

1 Like