Here is the fragment shader code (MyShaders/Shader1.frag):
void main(){
gl_FragColor = vec4(1.0,1.0,1.0,1.0);
}
And the vertex shader code (MyShaders/Shader1.vert):
void main(void)
{
gl_Position=vec4(1.0,1.0,1.0,0.0);
}
And the .j3md material code:
MaterialDef Shader1 {
MaterialParameters {
}
Technique {
VertexShader GLSL100 GLSL150: MyShaders/Shader1.frag
FragmentShader GLSL100 GLSL150: MyShaders/Shader1.vert
}
}
The error stack trace is:
WARNING: Bad compile of:
1 #version 110
2 #define FRAGMENT_SHADER 1
3 void main(void)
4 {
5
6 gl_Position=vec4(1.0,1.0,1.0,0.0);
7
8 }
May 01, 2018 3:35:57 PM com.jme3.app.LegacyApplication handleError
SEVERE: Uncaught exception thrown in Thread[jME3 Main,5,main]
com.jme3.renderer.RendererException: compile error in: ShaderSource[name=MyShaders/Shader1.vert, defines, type=Fragment, language=GLSL100]
ERROR: 0:6: Use of undeclared identifier 'gl_Position'
And here is the code for instantiating the material:
Material mat=new Material(assetManager,"MyShaders/Shader1.j3md");
I think that the bug is somewhere in me not passing any gl_Position parameters into the shader, but how do I do that?
I am using JME3 and Java.