[LibGDX]Get pixels of a Texture

In LibGDX, you can get the pixels of a Texture by calling texture.getTextureData().prepare() and then textureData.consumePixmap().getPixel(x,y).

My question is, what is the performance of these calls? I am okey with prepare() being slow as its only done once(during loading for example). But what about the other part?

Performance is generally poor, as you’ve got to wait for the GPU to finish rendering before it’s allowed to read back data, and the read back itself isn’t exactly fast, either.

Cas :slight_smile:

For future reference, I read that Pixmap caches the pixel data in CPU.