I have a plugin with custom shaders. I thought I don't have to gl_enable the texture when I use custom shaders. As I had problems with a plugin (black output) I tried to add gl_enable(GL_TEXTURE_2D) and now it works
FFGL - custom shader need to gl_enable(GL_TEXTURE_2D)
FFGL - custom shader need to gl_enable(GL_TEXTURE_2D)
Hi,
I have a plugin with custom shaders. I thought I don't have to gl_enable the texture when I use custom shaders. As I had problems with a plugin (black output) I tried to add gl_enable(GL_TEXTURE_2D) and now it works
Is there an OpenGL expert who can explain that, please?
I have a plugin with custom shaders. I thought I don't have to gl_enable the texture when I use custom shaders. As I had problems with a plugin (black output) I tried to add gl_enable(GL_TEXTURE_2D) and now it works
Re: FFGL - custom shader need to gl_enable(GL_TEXTURE_2D)
Hmmm. That's the normal way to enable texturing, so it makes sense there'd be black output without it. Is there any particular reason you thought it wasn't necessary?
Re: FFGL - custom shader need to gl_enable(GL_TEXTURE_2D)
Hi Joris,
thanks for your answer!!
Yepp, there is. In the example code of the FFGL SDK (FFGLTile.cpp - line 121) says
and also this example does not use the glEnable command 
thanks for your answer!!
Yepp, there is. In the example code of the FFGL SDK (FFGLTile.cpp - line 121) says
Code: Select all
//activate rendering with the input texture
//note that when using shaders, no glEnable(Texture.Target) is required
glBindTexture(GL_TEXTURE_2D, Texture.Handle);Re: FFGL - custom shader need to gl_enable(GL_TEXTURE_2D)
....
Ehm...
Yeah...
That's just.... weird....
Ehm...
Yeah...
That's just.... weird....
Re: FFGL - custom shader need to gl_enable(GL_TEXTURE_2D)
I usually call glEnable( GL_TEXTURE_2D ) also when using shaders...
but it seems like it is really not necessary, found this link maybe it can be useful
http://www.opengl.org/wiki/GLSL_:_common_mistakes
perhaps you are not calling glEnable before creating the texture?
but it seems like it is really not necessary, found this link maybe it can be useful
http://www.opengl.org/wiki/GLSL_:_common_mistakes
perhaps you are not calling glEnable before creating the texture?
Re: FFGL - custom shader need to gl_enable(GL_TEXTURE_2D)
From now on, me toodrand48 wrote:I usually call glEnable( GL_TEXTURE_2D ) also when using shaders...
What do you mean here? - Before binding the input texture coming from the host application, or before calling glCopyTexSubImage2D?drand48 wrote:perhaps you are not calling glEnable before creating the texture?
Re: FFGL - custom shader need to gl_enable(GL_TEXTURE_2D)
just once before you do any calls related to a 2d texture.
so in the case of glCopyTexSubImage2D you would do something like
so in the case of glCopyTexSubImage2D you would do something like
Code: Select all
glEnable(GL_TEXTURE2D);
glBindTexture(GL_TEXTURE_2D, Texture.Handle);
glCopyTexSubImage( ... )