Texturing question.

Blitz3D Forums/Blitz3D Programming/Texturing question.

Right. Thanks GNS. As your example shows, when models/textures are in separate folders each one uses extra ram - no surprises there.

I've done some tests (a bit difficult to zip up and show) but my conclusion is this:
- If two or more models (wherever they are stored) refer to the same common texture internally (e.g. .\brick1.jpg)
- then that texture will only be loaded once by Blitz and as long as the path (or flags) of the texture do not change then the common texture can be used without extra memory usage, by many models.

The proof of this was:
- Load model with internally referenced texture.
- Alt-tab out, and change the texture.
- Press (e.g. an F key) to re-EntityTexure the model.
- The changed texture does NOT appear.

In other words, either Blitz or the graphics card is saying 'I've already got that texture (by name), so I won't reload'.

You actually have to DeleteEntity and reload, to use the new changed texture.

Why is this so important?
The bottom line here is that if I'm sometimes down to 0.8 of 256 mb of AvailMem.
I have each of my models in separate folders, which all contain brick1.jpg, then brick1.jpg will be loaded multiple times.

So to save vidmem all textures must now be in a common accessible folder.
And all internal model references become .\brick1.jpg.