I am new to Jmonkey and tried loading a model from Blender into Jmonkey using the Ogre Xml Exporter. I have already read a lot articles on this site how to do it, and which kind of errors could happen. But nonetheless I didn’t manage to display the Texture the right way.
What texturing method are you using in blender? UV Texture Mapping? For ogre xml and blend models, when you import it to jME, the material is automatically applied to the model when you convert it to j3o. If you don’t use the SDK, just load your model and the material will be automatically applied :
Doing that results in a complete red Modell for me. I already checked the material file, if the link to the texture was wrong, but couldn’t find anything wrong about it.
You need to generate tangents on the model. After you convert it to a j3o, right click on it in the scene explorer window and select tools → Generate Tangents. Then save the file again.
Not positive, but I believe I have had to do that for all models I have loaded in. From the picture there is does look like it doesn’t have the tangents generated. That or oraclefile might have to update his graphics drivers. The other possibility could be that the UV map is has some surfaces of zero area on the black part of the texture. To test this last case, set the background color of the UV texture to bright pink or something and see if the black areas are now pink.
After loading a different model, I noticed it might be a problem of the model, as the new one is displayed in the right way. flipping didn’t seem to help. But another question, dunno if I should post it in here:
How can you clone an object? I don’t think the perfomance would be to good, if I load a model like a thousand time. Didn’t seem to be able to find a way to do that. And another question as well: Can you convert a few loaded models to one to save performance?
For cloning, load your model once and clone it : mySpatial.clone() and for performance you can optimize your geometries, you can do what sploreg suggested : GeometryBatchFactory.optimize(); if you are going to do a minecraft / mythruna / 3070 based game, then you have to look for voxels.
No, I am not going to do anything like that. I am just generating my world based on some different objects, which are static in the final game. Therefore I only need those different models in the beginning.