Login  Register

Re: JOGL - GLSL Bump Mapping (Please Help!)

Posted by Demoscene Passivist on Oct 31, 2011; 1:50pm
URL: https://forum.jogamp.org/JOGL-GLSL-Bump-Mapping-Please-Help-tp3467550p3467865.html

>How would I go about making this implementation work for multiple objects?

Simply load multiple texture objects to an array and bind them in ur draw-loop ?!

Stg like this:

for (int i=0; i<10; i++) {
gl.glActiveTexture(GL2.GL_TEXTURE1);
                        texture[i].enable(gl);
                        texture[i].bind(gl);
                        setUniform1i(gl,shaderID,"colorMap",texture[i].getTextureObject(gl));
                        texture[i].disable(gl);
gl.glActiveTexture(GL2.GL_TEXTURE2);
                        normalMap[i].enable(gl);
                        normalMap[i].bind(gl);
                        setUniform1i(gl,shaderID,"normalMap",normalMap[i].getTextureObject(gl));
                        normalMap[i].disable(gl);

//... ur draw code here ...

}