hi all …
i’m trying to use the ofShader addon to work by filtering an ofTexture that i paint on the screen. The main idea is to code a GLSL lumakey effect on the ofTextures painted.
i’m a bit confused with this information found in Nehe Tutorials :
As I said before… textures are available in GLSL via sampler, which have to be uniform. But how do we tell GLSL which texture image should be used for which sampler?
Textures are not directly passed to GLSL, but we pass the texture unit where our texture is bound to OpenGL. This works in the following way:
Get the sampler uniform location.
Bind the texture to texture unit i.
Pass i as an integer by glUniform.
Here an example:
int my_sampler_uniform_location = glGetUniformLocationARB(my_program, my_color_texture);
glActiveTexture(GL_TEXTURE0 + i);
Does anybody knows if i should also make the call to glACtiveTexture() inside the ofTexture code or if i could use textures and shader in some other way ? Any hints or simple texture with shaders ?
i’ve been looking at the information about GLSL texture and i can’t find the way to work properly, when i activate the shader the image gets black.
the thing is that i’ve a code already running in an ATI M9600 computer, but it doesn’t work in NVIDIA M 8700 computer … It’s really strange that this code works, but it does in an ATI old card … confussing even more …
anybody dealed with GLSL shaders affecting an ofTexture ??
many thanks, so stuck on this …