Avoid insertion of GLSL version

Hi,

I have a generated .frag that already include “#version 150 core”. it’s used by the tool chain for validation.
So I would like jme doesn’t include “#version”, else I’ve got :

com.jme3.renderer.RendererException: compile error in: ShaderSource[name=Shaders/deferred.frag, defines, type=Fragment, language=GLSL150]
0(2) : error C0204: version directive must be first statement and may not be repeated

Currently I workaround with a crappy hack, I used (in .j3md) an other Caps than one starting by GLSL like :

FragmentShader OpenGL32: Shaders/deferred.frag

Better solution ?

GLSL100 also won’t include a #version because there is no “version 100”

…but leaving that out will screw up JME’s auto-selection if you need support for multiple versions. Maybe that’s not important in your case.

Thanks.

It works with 3.0.10, but it seems that behavior will change with 3.1.0, and GLSL100 will behave like GLSL110 ?

see https://github.com/jMonkeyEngine/jmonkeyengine/blob/master/jme3-lwjgl/src/main/java/com/jme3/renderer/lwjgl/LwjglRenderer.java#L1001

@david.bernard.31 said: Thanks.

It works with 3.0.10, but it seems that behavior will change with 3.1.0, and GLSL100 will behave like GLSL110 ?

see https://github.com/jMonkeyEngine/jmonkeyengine/blob/master/jme3-lwjgl/src/main/java/com/jme3/renderer/lwjgl/LwjglRenderer.java#L1001

Ugh… I guess that’s true. It’s kind of a strange way to fix the problem. :-/