Loading a model but not its texture/s

I’m trying to get my game to work on android, and one common problem that I’ve been running in to is getting an OutOfMemory error. I think this is atleast partially in part to some of the larger texture sizes that are used on the models in the game. So I had my graphic designer resize all the diffuse and normal maps that are much smaller…

I have no problem adding/changing them out with the code… but I’d like to be able to load the model without the textures on it (but i need the UV mapping to still remain of course) so that I can then manually load the textures and apply them to the material. Without being able to prevent it from loading the default high quality textures I think this whole pursuit would be fruitless.

What is the best way to do this? I’d rather not have my graphic designer go through and manually re-export all the models (with no textures on it) just to do this.

on a side note: is there a common approach to doing this? (having multiple texture qualities). Right now my plan is bassically just to have a varibale in my main application class called “useHighQualityTextures” and use that value when loading assets…

The .j3o should be referring to separate texture assets. Just swap those out with lower-res versions.

Maybe there is something special to do on Android but I don’t think so.

if i have two material files for the same model, theres no way to say “load this j3o, but using this j3m instead?” I’d need to have like model_highres.j3o model_lowres.j3o with the j3m already added to it in the sdk?

@icamefromspace said: if i have two material files for the same model, theres no way to say "load this j3o, but using this j3m instead?" I'd need to have like model_highres.j3o model_lowres.j3o with the j3m already added to it in the sdk?

Your j3o will be referring to foo.png as a texture or whatever. You can either replace that file or you can set up your asset locators to find a different one first. The latter doesn’t necessarily translate to android well.

I don’t think JME has an in-built solution for this problem, unfortunately. It has been discussed a few times, I think but I don’t remember if a good solution was presented.

You could do it programmatically, I guess. Always load the low res textures from the .j3o and then go through the materials and set better textures if space is available.

Alright, well thanks for your help. I think thats what I might just do. have the default textures be the low resolution ones. then if someone wants the high res I’ll just load those extra. anyone using high res probably wouldnt notice a few low res textures (which I think will eventually get GCed?))

Another possibilit yis to simply have each model two times one with low one with heig (do the same as yous aid, but export the high with the binaryexporter afterwards) You could probably hack togheter some kind of high low compiler/generator in a few hours that can materialize every setting.