glEnable(GL_BLEND);//I`ve seen that blending doesn`t affect it
glDepthFunc(GL_ALWAYS);
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
DrawModel(Texture1);//for only 2 textures yet...
DrawModel(Texture2);
glDisable(GL_BLEND);
glDepthFunc(GL_LEQUAL);
Simulating Multitexture
I want to know the exact way to perfectly simulate Multitexturing to do a 3-unit texturing, and more .
I`ve been testing with something like this but I have some unwanted artifacts->
Relative Games - My apps
I eventually found that this works just fine ->(no blending)
but... the model appears in front of everything else and... I need to fix that too... any ideas ?
glDepthFunc(GL_ALWAYS);DrawModel(Texture1);glDepthFunc(GL_LEQUAL);DrawModel(Texture2);glDepthFunc(GL_LEQUAL);
but... the model appears in front of everything else and... I need to fix that too... any ideas ?
Relative Games - My apps
It seems I found the goldmine, and the missing link... the final code->
That works just fine... if you have an alternative let me know
glDepthFunc(GL_LESS);DrawModel(Texture1);glDepthFunc(GL_LEQUAL);DrawModel(Texture2);
That works just fine... if you have an alternative let me know
Relative Games - My apps
glDepthFunc(GL_LEQUAL); // or GL_LESS, depending on your preferenceDrawModel(Texture1);glDepthFunc(GL_EQUAL);DrawModel(Texture2);// glDepthFunc(GL_EQUAL);DrawModel(Texture3);glDepthFunc(...); // Restore the GL_LESS or GL_LEQUAL function
Beware, all texture environments can not be emulated by multipass.
Simple environments like modulation and addition are possible, but things more complex (especially when involving alpha texture) sometimes can not be emulated by hardware with fewer texture units.
[edited by - vincoof on November 10, 2003 8:19:45 AM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement