Blending between textures

Blitz3D Forums/Blitz3D Beginners Area/Blending between textures

Pete Carter(Posted 2005) [#1]
Im sure you can do this but i dont know how. can you blend the texture of an animated model in real time from fully one texture to a second texture?

Pete


Baystep Productions(Posted 2005) [#2]
Like a fade? Hmm, I don't know much but I'd say you'd have to do something with alpha levels and Blitz doesn't have a function for that.


Shifty Geezer(Posted 2005) [#3]
Not that I know of, short of manually creating a texture and copying a weighted average of two other textures into it.


stayne(Posted 2005) [#4]
if you manually texture the model with entitytexture, you could maybe cycle through the texture frames manually? fade one out, fade the other in? make the first one fade out to 50% white, then the other would start at 50% white and fade in to full.

it'd be pretty much like animating a sprite, so it might not be a good idea depending on the size of the model.

EntityTexture entity,texture[,frame][,index]


Jams(Posted 2005) [#5]
You could have 2 identical models, one with the original texture, and one with the new texture - then slowly fade the first model out while fading in the new model...

You're likely to run into some z-sorting problems with that method...


stayne(Posted 2005) [#6]
he said animated though. would that still be possible to fade to an identical model while animating?


Shifty Geezer(Posted 2005) [#7]
If the second model was always a copy of the first, it should work.


jfk EO-11110(Posted 2005) [#8]
the alpha z-order problem will make this a difficult job. Also, one should be scaled slightly bigger to make this method work. If the texture isn't that big and the fading effect shouldn't last too long, think about to use an animated texture or a number of precalculated fading frames.


OJay(Posted 2005) [#9]
hm, just a thought: you could try multitexturing with 2 textures and change alpha-values of the first texture using writepixelfast(). should be fast enough for small textures and you shouldn't run into z-problems.

cheers


Shifty Geezer(Posted 2005) [#10]
OJay's solution is probably the best.