Got 3D texture reading to work correctly