View Full Version : 2 textures on the same quad
is that possible? how should it be done?will it works this way?
draw quad with texture1
draw the same quad with texture2
04-16-2003, 09:30 AM
basically...yes. you bind your first texture, then draw the quad. then you bind the second texture, then draw the quad again. there is a multitexturing extension that will allow you to do this in one pass.
04-16-2003, 09:35 AM
what i ment was if it is possible to show one texture on front side and other one on the back side
04-16-2003, 08:02 PM
Same as what Jebus said but 1 quad is made clockwise, second is made counter-clockwise, and enable back face culling.
04-16-2003, 10:08 PM
To be a bit more specific:
glEnable( GL_CULL_FACE );
glFrontFace( GL_CCW ); // or GL_CW, depending on how you draw
glCullFace( GL_BACK );
glBindTexture( GL_TEXTURE_2D, front_texture );
glCullFace( GL_FRONT );
glBindTexture( GL_TEXTURE_2D, back_texture );
This should not cost too much if you do it right (e.g. use vertex arrays and do all front faces in one go and then all back faces), since face culling is done very early in the rendering pipeline (after transformation but before lighting and rasterization I believe).
[This message has been edited by marcus256 (edited 04-16-2003).]
Powered by vBulletin® Version 4.2.3 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.