|
Author
|
Topic: Question about sharing textures
|
Sv Pilot
|
posted 01-17- 03:48 PM
Does anyone know how to guarantee that textures are shared? If two different SM files both refer the same texture path, is the texture shared in video memory- or are both identical textures loaded in?Also, is there any savings in sharing SM objects? In other words, if many planes have the same gun, is it better to use one SM file, or does this not matter? Much thanks! ------------------ -Sv =FC= WWI in SDOE! IP: Logged |
Bryan Russell Pilot
|
posted 01-17- 07:26 PM
A texture is defined as being unique based both on its actual image and its properties. I'm pretty sure that the path/filename isn't considered. When the texture is loaded, a CRC is created based on its image and property fields, and this CRC is used to see if the texture already exists in the texture cache.So, for example you could have two textures that are physically located in different locations, with different names, and as long as the properties (i.e the flags) and the image were the same there would only be one texture in memory. If you share the gun objects using a file reference the mesh information should be shared. IP: Logged |
Sv Pilot
|
posted 01-18- 10:52 AM
Thanks Bryan  IP: Logged |
Bryan Russell Pilot
|
posted 01-18- 07:48 PM
Just thought of an important point regarding this thing (you can probably figure it out but, just to spell it out ). If you have a plane that wants to use a shared texture, you must make sure all of the texture properties are identical, even if you use the same physical texture. IP: Logged | |