Re: Texture JOGL -> GLSL
Posted by
AlexRNL on
May 16, 2011; 3:35pm
URL: https://forum.jogamp.org/Texture-JOGL-GLSL-tp2947210p2948445.html
Demoscene Passivist wrote
ShaderUtils is part of my own framework and not an official part of the JOGL distribution (wich has its own set of utility classes for shader handling). The code for the class can be found
on my github repository:
ShaderUtils.java
If u don't like to use my stuff u can simply replace/inline the setUniform1i with this simple code snippet:
public static void setUniform1i(GL2 inGL,int inProgramID,String inName,int inValue) {
int tUniformLocation = inGL.glGetUniformLocation(inProgramID,inName);
if (tUniformLocation != -1) {
inGL.glUniform1i(tUniformLocation, inValue);
} else {
BaseLogging.getInstance().warning("UNIFORM COULD NOT BE FOUND! NAME="+inName);
}
}
Thanks a lot, it works fine now :)
One last question... To activate the texture, i'm using GL_TEXTURE0. But i'm wondering what this value represent, is it the first texture loaded? is it the texture which has the identifier 0?