Re: Texture JOGL -> GLSL
Posted by Demoscene Passivist on May 16, 2011; 11:57am
URL: https://forum.jogamp.org/Texture-JOGL-GLSL-tp2947210p2947517.html
For using textures with shaders u have to use the "active texture unit number" instead of the generated "texture id" a sampler uniform value. U are using the "texture id" from getTextureObject() instead. Thats why ur code works unreliable. Try doing stg like this:
inGL.glActiveTexture(inTextureUnit);
inTexture.enable();
inTexture.bind();
ShaderUtils.setUniform1i(inGL,inProgramID,inSamplerUniformName,inTextureUnitNumber);
inTexture.disable();