I have two textures that are both .jpg, which represent a sky (one during the day, one at night). My question is, is it possible for me to fade one texture into the other? They are created with D3DXCreateTextureFromFileInMemoryEx. How can I perform this kind of transition? I don’t wish to create two objects, just change the texture gradually.
To be clear, I wish to, over time, slowly blend from one texture to another (and back). However, I don’t wish the fade to be going on at all times. Thanks in advance for any advice you can offer.
You have quite a few options here –
You can use both textures with texture blending to transition from one texture to the other.
However, if you’re doing this over a long period of time, you may want to precompute a third texture (the blended state) and just use it as a single texture. Occasionally, recompute the “new” state. This will potentially simplify your rendering, since you’d be using a single texture (that you change slowly over time) instead of having to always do multi-texturing just for this effect. (If you’re not doing anything else but this with the objects you’re texturing, and if the textures aren’t huge, a simple 2 texture multi-texture is no big deal, though.)