Game Development Community

Texture management - how to best save resources?

by Thomas \"Man of Ice\" Lund · in Torque Game Engine · 08/04/2004 (1:34 am) · 5 replies

OK - quickie question.

I have 2 models that use the same 512x512 texture. Do these HAVE to be in the same dir for the texture manager not to load the texture twice?

Can the texture manager compare the 2 texture files and see they are the same if placed in different dirs?

Just wondering how to save system resources

#1
08/05/2004 (4:59 am)
Just put the texture in the directory directly above the two directories containing the two models ;)

For example:
/data/shapes/mymodels/texture.jpg
/data/shapes/mymodels/model1/model1.dts
/data/shapes/mymodels/model2/model2.dts
#2
08/05/2004 (7:15 am)
Ahhh!! So the texture/resource manager moves up the tree until it finds a referenced resource? Very cool! Thanks a lot for the answer

I guess this works for interiors too.
#3
08/09/2004 (10:12 am)
But does engine use one texture for both models, or does it create two textures from the same file?

Regards,
Cura
#4
08/09/2004 (10:20 am)
One texture for both models
#5
08/09/2004 (10:50 am)
I loads the texture and uses the id returned by the opengl bind command to tell it what texture to make "current" when drawing. So what matt says :)