martyj Posted October 20, 2015 Share Posted October 20, 2015 I have a few models that use the same texture. When loading my map I noticed that it loads the same textures over in over instead of using a copy of the texture already loaded from a previous model load. Could there be a cache to not have to reload textures in the same path? Thanks, Marty 1 Quote Link to comment Share on other sites More sharing options...
Josh Posted October 20, 2015 Share Posted October 20, 2015 This is already the way the engine works, for all assets. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Rick Posted October 21, 2015 Share Posted October 21, 2015 @martyj I know the logs say it's loading the texture but if the texture is already loaded into memory LE knows to not reload it from disk but to use the one that's already loaded. However, the side effect to this is that if you modify that texture during run-time ALL the models will see that modification since they are using the same instance of the texture which may not be what you want. There are various ways around that though now if you do want that functionality. The way you can tell this is happening is dynamically loading a texture during run-time that was already loaded at startup. It's basically instant and your game doesn't pause (or you don't notice it anyway) which tells you it's not going to disk but just using the existing loaded texture. This is how you can sort of "load" stuff dynamically in your game to create a huge world. You can preload every base asset you'd need and then dynamically cycle through the models you want to load on the fly during run-time 1 every couple frames and you won't notice a slowdown in the game because it's using instances. If you were to go the route of a very dynamic game. That was probably more than you wanted but I was on a roll 1 Quote Link to comment Share on other sites More sharing options...
martyj Posted October 21, 2015 Author Share Posted October 21, 2015 Defiantly good info Rick Quote Link to comment Share on other sites More sharing options...
Josh Posted October 26, 2015 Share Posted October 26, 2015 There's a flag to disable the auto-cache when you load any asset: Asset.Unmanaged The engine should only print "Loading texture blah blah blah..." when it is really being loaded. If all instances of it get deleted, for example, it will be reloaded from disc next time it is needed. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.