What's the highest version of GLSL that JME supports? (a.k.a How to backport a shader)

I need GLSL 430 for a cool filter I found on GitHub to work. However, even after updating my graphics card drivers, the highest version that SDK shows that is supported on my PC is GLSL400.
Is JME GLSL’s version upwards limited or are my drivers crappy?

Google your GPU. There shouldn’t be a limitation for the highest version.
Btw: Are you talking about GLSL or the OpenGL Version, because OpenGL 4 is pretty “new” and I think we are still at GLSL 150 or 200?

Anyway, you might work around those higher features and simulating them in OpenGL2.0

@Darkchaos from opengl 4, opengl and glsl version are aligned.
glsl150, was opengl 3.2 or something like that.

@grizeldi if your card supports it, then JME won’t limit you. Though 4.30 is pretty high and you might have issue when distribute your game

Okay then probably my GPU doesn’t support it… When I try “Check graphic capabilities” it writes that my GPU supports GLSL 400, but apparently not OpenGL 4.3 (GLSL 430).
The problem about simulating advanced features is that I have no clue about GLSL yet and I just wanted a filter that would work out of the box. Then I guess it’s time to learn advanced GLSL…

just out of curiosity what does the filter you are talking about?

Well you should start by finding out what’s wrong (i.e. trying to launch the code and see what the compiler complains about).

Then you see what behavior you need to implement. Most of the times there are “OpenGL Extensions”, which means they work on lower opengl versions and are implement driver side I guess.

Some Extensions later get merged in core, so find out what you miss and ask our pros here.

What’s the lower limit?

Lava shader.

glsl 1.1 for opengl 2.0

1 Like

Then i’m not sure why you need glsl 4.3 or any extension/workaround, in the way i picture a “lava shader” (that is a pretty generic definition) it can be done with glsl1.1 or at most glsl3.2 if you want to use a geometry shader.

Perhaps you should provide a link to the filter so we can tear it apart… I mean, determine if 4.3 is really required.

1 Like

@RiccardoBlb I also don’t know because I have no clue what’s going on in there.

@pspeed and others, the shader is right there:

Maybe it could be useful to someone else too, because it looks really cool.

1 Like

Rather use any suitable search engine to look for information about your GPU.

That shader will run just fine on OpenGL 2.0 / GLSL 1.1.
It’s just that it has a lot of instructions so might be a bit slow on lower-end GPUs.

Um nope, I tried with GLSL 150 and it threw some errors sadly. Don’t have time to test again to post them here ATM, but if I remember correctly it was some extension missing or something like that.

EDIT: Here’s the error on GLSL110:

Uncaught exception thrown in Thread[jME3 Main,5,main]
RendererException: compile error in: ShaderSource[name=Shaders/LavaShader/lavaShader.frag, defines, type=Fragment, language=GLSL110]
Fragment shader failed to compile with the following errors:
ERROR: 0:3: error(#133) Reserved word: in
ERROR: 0:4: error(#133) Reserved word: in
ERROR: 0:5: error(#133) Reserved word: in
ERROR: 0:6: error(#133) Reserved word: in
ERROR: 0:39: error(#201) Requires extension support: subroutine (GL_ARB_shader_subroutine)
ERROR: 0:40: error(#201) Requires extension support: subroutine (GL_ARB_shader_subroutine)
ERROR: 0:40: error(#201) Requires extension support: subroutine uniform (GL_ARB_shader_subroutine)
ERROR: 0:40: error(#132) Syntax error: "RenderPass" declare without uniform qualifier!
ERROR: error(#273) 8 compilation errors.  No code generated

And on GLSL 150:

Uncaught exception thrown in Thread[jME3 Main,5,main]
RendererException: compile error in: ShaderSource[name=Shaders/LavaShader/lavaShader.frag, defines, type=Fragment, language=GLSL150]
Fragment shader failed to compile with the following errors:
ERROR: 0:39: error(#201) Requires extension support: subroutine (GL_ARB_shader_subroutine)
ERROR: 0:40: error(#201) Requires extension support: subroutine (GL_ARB_shader_subroutine)
ERROR: 0:40: error(#201) Requires extension support: subroutine uniform (GL_ARB_shader_subroutine)
ERROR: 0:40: error(#132) Syntax error: "RenderPass" declare without uniform qualifier!
ERROR: error(#273) 4 compilation errors.  No code generated

Simply changing the version won’t work.
It uses shader subroutines (GLSL 4.3 feature) but that doesn’t really require GPU support. It could be easily implemented in GLSL 1.1 using defines.

2 Likes

Oh, okay thanks. Some googling awaits then :wink:

1 Like