🔒 Locked
multi texture problem.
Advertisement
Original Post
Are you already using multitexturing?
If it is, all that's required in your case is finding the correct TexCoords if you have a piece of geometry in the place where the bomb exploded.
Else, you will probably have to create a little quad in the area which is textured with the "explosion" texture. In this case multitexturing isn't required, but it'll require an extra pass for the explosion textured quad.
If it is, all that's required in your case is finding the correct TexCoords if you have a piece of geometry in the place where the bomb exploded.
Else, you will probably have to create a little quad in the area which is textured with the "explosion" texture. In this case multitexturing isn't required, but it'll require an extra pass for the explosion textured quad.
Quote:
Original post by zny
yes, now i save many quad for every explode.
because i do not want the explode disappear next frame.
so i want a better way.
i am interesting in that the 1st way you said.
how can i do it with multitexture?
From OpenGL 1.3, or earlier versions through the ARB_multitexture extension, you can use more than one "texture unit" for texturing. To use it, first check if your extension string contains "GL_ARB_multitexture". If it does, your hardware is guaranteed to have atleast 2 texture units.
The default texture unit selected is texture unit 0. Suppose you have a bound texture on texture unit 0, as usual. With multitexture, you may call:
glActiveTexture(GL_TEXTURE1); // this selects the new texture unit 1glBindTexture(GL_TEXTURE_2D, explosion_texture); // bind explosion textureglEnable(GL_TEXTURE_2D); // enable texturing (this state is maintained per texture unit)// ...// specifying texture coordinatesglMultiTexCoord2f(GL_TEXTURE0, 0.0, 0.0); // these are for your terrain textureglMultiTexCoord2f(GL_TEXTURE1, 2.0, 3.0); // these are for your explosion textureglVertex3f(...);And that's it! There are plenty of tutorials on this subject on the internet, but unfortunately I couldn't find even one, so this short introduction above.
Hope this helps!
try http://spy.nodespace.net/ and check my terrain engine, it uses the design you want.
Multitexturing fading, so you have grass and cliffs and stuff
Multitexturing fading, so you have grass and cliffs and stuff
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement