Skip to main content
gamedev.net
🔒 Locked

Texture transitions?

Started by HopeDagger 5 replies 1.2k views
Original Post
HopeDagger
HopeDagger
Is it possible to efficiently blend (interpolate) two textures across, say, a quad with multitexturing? I've heard combiners mentioned before, as well as how they aren't a good choice. I'm not too familiar with this topic, so I'd be quite happy to hear out any suggestions made. :)
zedzeek
zedzeek
yes easiest done with glsl, but u can use texture environment combine ( see the interpolate function ) see opengl.org for the extension registry, its prolly also in the spec which can be downloaded from there also
Kikko-Man
Kikko-Man
I think multitexturing + combiners would be perfect here. I haven't used it before myself, so I'm not sure why someone said they aren't a good choice (bad hardware support? inefficient?).

Another fairly simple method would be to use alpha blending. That is, draw the quad with the first texture and alpha=1.0. Then, draw the quad again with the second texture and alpha=0.5 (or whatever's appropriate).

The one major thing to watch out for here is to set up the depth test so that the second quad actually gets drawn. So with a depth function set to glDepthFunc(GL_LESS), the second quad probably won't get drawn, whereas glDepthFunc(GL_LEQUAL), the second quad *probably* will get drawn. I say probably, because round errors can give you a pretty ugly effect here.

Actually, now that I've gone through all that, multitexturing + combiners is starting to sound like a much cleaner solution.
_the_phantom_
_the_phantom_
Quote:
Original post by Kikko-Man
I think multitexturing + combiners would be perfect here. I haven't used it before myself, so I'm not sure why someone said they aren't a good choice (bad hardware support? inefficient?).


no one said it wasnt a good choice, just that its probably easiest with shaders
Enigma
Enigma
Quote:
Original post by Kikko-Man
The one major thing to watch out for here is to set up the depth test so that the second quad actually gets drawn. So with a depth function set to glDepthFunc(GL_LESS), the second quad probably won't get drawn, whereas glDepthFunc(GL_LEQUAL), the second quad *probably* will get drawn. I say probably, because round errors can give you a pretty ugly effect here.


Provided you use exactly the same vertex coordinates and exactly the same transform and rasterization you will get exactly the same depth values.

Enigma

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.