Ideas for Texure Quality Setting?

Well I want to find some ideas/suggestions on how to implement a texture quality choose system to mygame/jme3.



My current Ideas:

→ Generate half and quater sized textures out of all textures used, then swap them

Pro: Simple to use, no changes to jme needed

Contra: More files, and around 1.75 download size for users



→ Integrate some kind fo setting into the Texture to Opengl uploader in jme, that allows to clamp the texturemipmap

Pro: Automatic, just one setting needs to be set,

Contra: wastes ram memory,since there all levels are present

Textures need to have MipMaps





What are your dieas/suggestions, also is the second method really possible that way?

read the texture and store it in a bufferedImage, then reduce the size of the BufferedImage, and give that data to jme.

Pros : 1) 30 lines of code.

2) no performance cost, instead it unleashes the full speed like doing the transformation by hand.

3) no changes to jme needed.

4) no extra file space.

5) automatic.

6) doesn’t waste extra memory



cons: game initialize data time increases by 0.3%.

If you generate mipmaps offline then you can specify an offset from within jME3 so it will actually upload the texture starting at a certain mipmap level. This way you’re not sending the whole texture but only the selected quality, of course you still need to load the texture into memory but I don’t think its an issue.



Also I don’t think texture resolution matters much nowadays … Unless we are talking about really old cards. Probably more important is proper LOD and shader operations.

Well my card has 256 mb ram but most fo the textures I use are planned for 4k textures on largesize objects, for future use. (And due to a hardware bug my card insantly freezes when it needs more than the ram aviable isntead of swaping as it should ) )



Also how can i do this? I lookad around at Texture class and Material and AppSettings and found nothing that seems to clamp the mipmaplevel

To reduce the image’s resolution by half you have to do:

  1. Halve the width and height of image (Image.getWidth()/getHeight())
  2. Delete the first mipmap level by taking Image.getMipMapSizes()[0] and cutting the image’s buffer starting at that point going to the end. Use ByteBuffer.slice() then Image.setData()
  3. Now delete the first entry in Image.getMipMapSizes() by regenerating the array

    You should now be able to upload your image which has exactly half of its resolution. Repeat the process to reduce the quality further. Notice that there’s no data copying or anything like that, this process is fairly fast if you already have the mipmaps generated.

great if you manage to code this please contribute the code, because i am sure it will be usefull to many people.

I have 2024x2024 textures and i would like to downsize them to 1024x1024 at runtime:

  1. because i made them much higher quality i should have.
  2. better than not playing on crappy video cards.

Great i will work this out in a nice way and contribute it then :slight_smile: Good that i already have all mipmap levels generated for all textures :wink:

The textures need to have mipmaps though, otherwise it won’t work. I’ll see if perhaps I can make it work with hardware generated mipmaps instead…