For our projects we keep all textures permanently. I did pour through Justin's code for a day and could not understand why it was losing the textures as if they were weak references. (the code looks good, it just didn't work for me) I was calling for the cached textures from two different points in our code and the textures loaded previously from one usage disappeared when I attempted to reuse them later. Justin's code looks very nice but it's 100 times more complex than what I'm doing and somewhere deep in his code I suspect a hashmap is storing a null texture or image. Justin's code is really nice in the way it allows you to select your cache strategy.
Either way, caching textures can have significant benefits to the performance of your code if you have a complex world that uses the same textures several times (in some of our cases complex model loading time was cut in half). - John Wright Starfire Research Justin Couch wrote: > > Artur Biesiadowski wrote: > > > Question for both you and Justin - do you clear cache at some point ? > > Use weak references ? Or just keep all textures forever ? > > The j3d.org setup allows you to request different caching strategies. > There are 3 different types by default - no caching, weak ref, and hold > references forever. For some reason, John was having problems with the > fixed cache dropping references too like it was the weakref > implementation. Unfortunately I could never reproduce what he was seeing > so I couldn't find out what the problem was. Xj3D uses the j3d.org > texture caching code too and we run some *really* large worlds (ie > hundreds of megs of textures) through it and have never noticed a > problem, so it's got me baffled! > > -- > Justin Couch http://www.vlc.com.au/~justin/ > Java Architect & Bit Twiddler http://www.yumetech.com/ > Author, Java 3D FAQ Maintainer http://www.j3d.org/ > ------------------------------------------------------------------- > "Humanism is dead. Animals think, feel; so do machines now. > Neither man nor woman is the measure of all things. Every organism > processes data according to its domain, its environment; you, with > all your brains, would be useless in a mouse's universe..." > - Greg Bear, Slant > ------------------------------------------------------------------- > > =========================================================================== > To unsubscribe, send email to [EMAIL PROTECTED] and include in the body > of the message "signoff JAVA3D-INTEREST". For general help, send email to > [EMAIL PROTECTED] and include in the body of the message "help". =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA3D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
