Some basic texture related questions

Hy, first let me say that jme seems to be what i had dreamed about for a long time. So a big thank you to all developers :slight_smile: !

Now that i have started with jme, there have come some basic and openGL related questions. I hope you can help me.

Here are my questions:

  1. How much graphiccard memory does a texture with a size of 129x193 cost? Will it be the exact costs for a 129x193 texture or will the size be expanded

1 and 2 are related. This all depends on the color depth of the image (8 bit, 16 bit, 24 bit, 32 bit, etc). All images are some form of RGB (RGBA, ARGB, etc, etc). I believe (this I could be wrong about), the only image type that is 1 bit per pixel is greyscale RAW. All others, again will depend on the color depth the image is saved as. So, your 128 x 193 images will cost (24,704 x color depth) So, a typical 32 bit images would be 790,528 bits (98,816 bytes). Increasing the size of the image increases the memory taken up by that image. You should also stay with power of 2 texture sizes (256, 512, etc).

3. Not to my knowledge, anyone else know of a way?

4. If it runs out of GPU RAM it will use system RAM, and will have to swap on a binding of a texture. So it will decrease speed.

5. The memory swapping is determined by the speed of the system RAM and the speed of the GPU RAM. You can take steps to decrease the amount of swapping though. Keep objects that share textures grouped in the scene graph, reduce the size of the texture where you are happy with the quality still, mipmapping takes up more memory, so if you don't need it, don't use it.

There are lots of other tips that I'm sure I missed. Hopefully, I didn't give you any misinformation :slight_smile: Someone will be along shortly to correct me, I'm sure.

Thank you mojo.

3. Not to my knowledge, anyone else know of a way?

Ok then i have to calculate by myself, which bring me to three other questions:

6) How much GPU RAM does an empty scenegraph cost? Will it be twice the screen resolution? For example an 1024x768 24 bit screen resolution would cost: 2 x 1024 x 768 x 3 bytes.

7) Are there other things that are stored in the GPU RAM like geometric data (vertices, etc.)? If so, how much do they cost?

8 ) Does a node that is not rendered (out of the camera frustum)
You should also stay with power of 2 texture sizes (256, 512, etc).

One more question, should the texture size be quadratic? So would it be better to avoid sizes like 512x256 and use sizes like 256x256 or 512x512 instead?

Thank you.

Hey guys

As a guide - to get the answers to these questions, can we assume that the main buffers created are the only things passed to the GPU - therefore we can inspect the buffers to judge how much reesource we are using

β€” The students of today are pioneers of tommorrow

well not really since you have texture data, state data and potentially matrix and other data… Furthermore it's hard to say how the card stores the data.