Hi! I came across a problem and I have no idea of how to solve it.

I have two textures drawn on 2 rectangles with some space between them. What I’m trying to do is fill the space between the two textures with colors interpolated from the two matching points form the textures, in a GLSL manner.

The problem presented in a simpler manner: consider a cube with one face white and the opposite face black. I have to fill the points inside the cube with gray shades ranging from white (near the white face) to black (near the black face).

Can you suggest me a method of doing this? I have no point from where to start, so any help would be greatly appreciated. I have to use GLSL as there is a lot of parallel computing going on there.

Tnx

le: something like in this image, but I need the white and black sides to be textures, and also to compute the colors of the points inside the cube too.