Mixing GL_TEXTURE_2D and GL_TEXTURE_RECTANGLE_ARB

Started by
1 comment, last by LordOrion 15 years, 12 months ago
Hi to everyone: I've added this post due I have new question/doubt that come out form the answers I got to my previous post: Using GL_ARB_texture_rectangle with POT textures. the question is: Is it possible to mix GL_TEXTURE_2D and GL_TEXTURE_RECTANGLE_ARB texture targets into the same scene? I.e. can I render one poligon whit a texture associated to GL_TEXTURE_2D and another polygon with GL_TEXTURE_RECTANGLE_ARB target? I omit the reasons why I wish/need to do that just to save space, if you are interested in knowing them just follow the link above and you will get the whole picture.
Bye and Thanks!SiS.Professional Software Developer.
Advertisement
I didn't read the linked post, so this may not apply. Within a single draw call you can use both targets, but not on the same texture unit at the same time. So, for example, unit 0 could be a 2d texture while unit 1 is a rectangle texture. You could not use both targets on unit 0 at the same time however.

Between draw calls you can change the target used by a texture unit. So you could draw one batch of triangles using a rect texture on unit 0 and then draw another batch of triangles using a 2d texture on unit 0. You will have to make a separate draw call for each batch.
Thank you very much for the info! I can do as you suggested: changing the active texture target between 2 consecutive calls!


Bye and Thanks!SiS.Professional Software Developer.

This topic is closed to new replies.

Advertisement