Interpolating between textures

Hey guys,

i need a possibility to interpolate between two textures or texture and color. I have a scene consisting of different nodes which have lighting materials. Now each node has different attribute values clamped between 0 and 1. The user can define a texture/color for nodes with 0-values and for 1-values. Materials in between should be interpolated. Well i think that’s straight forward - take start texture/color and for each pixel generate the interpolated one. Is there something in jme that does what i want?



Nope but there is something in glsl that does that : mix(color1,color2,mixFactor)

It does a linear interpolation between the colors according to the mixFactor (0 to 1).

So you will need a shader to do that.

Copy the lighting shader and, send 2 diffuse textures instead of one, and your mixFactor.

Thanks for the fast reply.

Using a shader is an idea, right. But isn’t it possible to do it on awt base? Maybe read the textures color buffers and interpolate between using a BufferedImage!? I not only wanna interpolate between textures. It should also be possible to interpolate between texture and single color.

Maybe, but I can’t help you on this, I don’t know how it would work with awt.

Beside using shaders would be a lot faster, and hardware accelerated