rectangle textures and multitexturing ? (FBO inside)

Hello,

I’m obviously having a problem using a rectangular texture inside my multitexture system…

My multexture system was previously set as follows:

	glActiveTextureARB(GL_TEXTURE1_ARB);
	glEnable(GL_TEXTURE_2D);
	glBindTexture(GL_TEXTURE_2D,Material->GLDiff);
	glActiveTextureARB(GL_TEXTURE2_ARB);
	glEnable(GL_TEXTURE_2D);
	glBindTexture(GL_TEXTURE_2D,Material->GLDisp);
	glActiveTextureARB(GL_TEXTURE0_ARB);
	glEnable(GL_TEXTURE_2D);
	glBindTexture(GL_TEXTURE_2D,FBOTexture);

Everything was working perfectly. I decided to transform my power-of-two FBOTexture into a rectangular texture and then… nothing but black renders.

	glActiveTextureARB(GL_TEXTURE1_ARB);
	glEnable(GL_TEXTURE_2D);
	glBindTexture(GL_TEXTURE_2D,Material->GLDiff);
	glActiveTextureARB(GL_TEXTURE2_ARB);
	glEnable(GL_TEXTURE_2D);
	glBindTexture(GL_TEXTURE_2D,Material->GLDisp);
	glActiveTextureARB(GL_TEXTURE0_ARB);
	glEnable(GL_TEXTURE_RECTANGLE_ARB);
	glBindTexture(GL_TEXTURE_RECTANGLE_ARB,FBOTexture);

Actually, I’m not sure if my FBO (yes, you guess it, FBOTexture references to a texture drawn by a Frame Buffer Object) still draw something, or if the problem comes from the second pass (being unable to use both power-of-two and rectangular texture in a multitexturing system…). Of course, my FBOTexture was created appropriately with all the GL_TEXTURE_RECTANGLE_ARB required.

Any tips ?
If you have any code working with both FBO, rectangular texture and multitexturing (and why not, float texture datas), feel free to post it !

Remembered that texture rectangles need unnormalized texture coordinates?
Using the same texture coordinates as before (0-1 range) will only fetch the bottom left texel.

If yes, add more FBO and GL error checks.

That’s it !
I multiplied my texture coordinates by 200 (just to see) and saw my render !

God bless you, was fighting this **** for a month now ! :wink: