The texture appeared VERY wrong so I found out by reading around here that I needed to flip the texture key like this: mat_club.setTexture(“DiffuseMap”, assetManager.loadTexture(new TextureKey(“Models/axe/axe.jpg”, false)));
It’s better, but it’s not quite what it’s supposed to look like, see how the texture is stretched all the way instead of mapped:
Note: It’s only 1 texture, only 1 geometry, so it’s obviously the UV map that is not interpreted correctly probably because my code is missing something… what’s wrong here?
PS: For the record, when the TextureKey parameter = true it looks like this:
HOLY F***… what the… REALLY?! +1’ed. I feel stupid now.
That works flawlessly without setting a material, but… OK then could you briefly explain what happens under the hood with j3o files? Is it assuming it’s gonna use the lighting shader or what? What if I wanted to bind it to another shader? I don’t quite understand why it works without a material. (It’s regarding optimization, is it going to switch a lot on shaders if I were to use 10-20 j3o models like this?)
Thx
Wow… that’s like 1 hour of my time lost right there but I’m happy to have learned this
You don’t achieve anything in terms of optimization by doing what you intend(ed) to do. The file in the j3o by default uses the material that the model importer sets, mostly this is lighting.j3md, yes. You can set any material by making a new j3m file and setting that to the geometry as well.
In the scene editor, you can generate the j3m file that will show you how the material is setup in the actual j3o and then you can see what might have been different between your setup and the j3o setup. If you are curious.
Normen, I know my test case is not optimized, but I was wondering how it works under the hood for when comes the time to compress everything in less shaders/textures.
OK thanks Paul. Yes I’m curious about how it generates the stuff, because if I used a bunch of j3o, I fear they will all switch textures/shaders and eventually slow down the app. I’m not used to the scene editor/composer, I’m doing every single thing by code I’ll check it out, thanks! +1’ed for the info.
No, it doesn’t slow down the app. No texture will ever be loaded twice and shaders have to be switched when they have to be switched, nothing to optimize there either.