Terrain Texture3D Map

I am trying to map a terrain with 8 512x512 images using texture3D to get blended texture change.
But Opengl forces me to allocate 512x512x512 array instead of 512x512x8
What can be solution

could you elaborate on how exactly do you think it forces you to allocate 512x512x512 dimensions? OpenGL doesn’t have such limitations

Sorry, i got what i was wrong about