Login  Register

Re: Shader does not accept the Parameters.

Posted by Vasilij on Feb 13, 2014; 8:14am
URL: https://forum.jogamp.org/Shader-does-not-accept-the-Parameters-tp4031551p4031560.html

In my opinion, i use that Parameters in Shaders.
Hier is a vShader:

in vec4 a_position;
void main()
{
        gl_Position = a_position;
}

and a fShader:

in vec2 a_texCoord;
uniform sampler2D s_texture;
layout(location = 0) out vec4 data;
void main ()
{
        data = texture(s_texture, a_texCoord);
}

I initialise them like this:
int positionIdx = gl.glGetAttribLocation(shaderProgram, "a_position");
int texCoordIdx = gl.glGetAttribLocation(shaderProgram, "a_texCoord");
int sampIdx = gl.glGetUniformLocation(shaderProgram, "s_texture");

Are my Shaders broken?