Code: Select all
f1= texture2D(myTexture, vec2(x,y,slice z).r;
f2 = texture2D(myTexture, vec2(x,y,slice z+1).r;
f=(z-int(z))*f2+(1.0-z+int(z))*f1;
EDIT: To clarify, I have a 1024x1024 texture that I'm indexing as if it were 64 128x128 regions. It's not a problem with the texture or the math itself as far as I can tell.