Login  Register

Re: JOGL 2 - BumpMap with Shader

Posted by greatdonking on Nov 12, 2012; 6:22pm
URL: https://forum.jogamp.org/JOGL-2-BumpMap-with-Shader-tp4026889p4026896.html

What do you means with valid location ?
Here is my cod to draw :
gl.glPushMatrix();
                gl.glTranslated(4f, 0f, 0f);
                mesh.getShader().enabled();

                gl.glActiveTexture(GL2.GL_TEXTURE1);
                normalMap.bind();
                // Specify that our texture normalMap_location, is on texture unit 1
                gl.glUniform1i(normalMap_location, 1);

                gl.glActiveTexture(GL2.GL_TEXTURE0);
                texture.bind();
                // Specify that our texture texture_location, is on texture unit 0
                gl.glUniform1i(texture_location, 0);

                drawObject();

                mesh.getShader().disabled();
                gl.glPopMatrix();

There my init :
this.texture_location = gl.glGetUniformLocation(mesh.getShader()
                                .getShaderProgramID(), "tex");
                this.normalMap_location = gl.glGetUniformLocation(mesh.getShader()
                                .getShaderProgramID(), "normalMap");

My Texture are com.jogamp.opengl.util.texture.Texture