I noticed that TextureArrays upload all their image data to the GPU at once if they have the isUpdateNeeded flag set. Wouldn’t it be better and more efficient if only the really changed ByteBuffers (= layers) would get uploaded instead?
My problem is that I have a voxel world which consists of a lot of blocks with each of them belonging to a certain block type. Each of these block types uses a different texture of the texture array. Some block types need their texture to be updated on the fly, while others don’t. So everytime one block type updates its texture then all the other texture layers of the TextureArray are getting uploaded to the GPU as well (although they have not changed at all).
While at the moment this is not a problem (because I have just a few block types), this might get a problem when I add more block types to the game.
So basically what I’m asking for is:
is it possible to just upload separate layers of a texture array with OpenGL (I haven’t looked into this yet)
You could actually update specific slices of a texture array, and even specific sub parts of an array slice, via OpenGL. The Renderer.modifyTexture() method in jME3 is designed to modify only 2D textures at the moment though.
Okay. That’s something I can start with. I will try to make the appropriate changes to the JME and send you guys a pull request via github if I succeed.