Fixed texture filtering function.