implemented trilinear filter.