Author Topic: A merged single Model with separate texture for each Individual Mesh  (Read 135 times)

Offline mayuran.r

  • byte
  • *
  • Posts: 5
    • View Profile
Hi.
I have large .Obj model, that consist of several meshes combined together and exported as one single .obj. Each mesh is assigned to a different texture( A house with Pillars, Windows, Wall, Steps and Roofs).
The Size is relatively large, I have serialized and then compressed and rendered the model without the texture and also with one single plain image as texture. (if anyone need helps on Serialization I am happy to help)
1. I want to render the model with respective textures for each separate mesh.
2. In which step I have to add the texture for the model, during Serialize the model in the Java Project or during the time of loading serialized object using JPCT-AE (in android) ?
(I have UV unwrapped textures for each mesh)
3. I have a close button also in the app, when I click it, model should be removed and all the textures in TextureManager should be removed.

Please guide me on adding respective textures for the model.

Thanks in Advance.
« Last Edit: September 08, 2017, 04:15:24 pm by mayuran.r »

Offline AGP

  • quad
  • ******
  • Posts: 1524
    • View Profile
Re: A merged single Model with separate texture for each Individual Mesh
« Reply #1 on: September 08, 2017, 10:44:21 pm »
You just have to add the textures to the Texture Manager BEFORE loading the model. But I suspect that if you call merge() you will break the texture references.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11769
    • View Profile
    • http://www.jpct.net
Re: A merged single Model with separate texture for each Individual Mesh
« Reply #2 on: September 11, 2017, 08:41:24 am »
The serialization process keeps the references to the texture names but not the textures, so you have to add textures with the same names to the TextureManager that the object used when serializing it before loading the serialized version and it should assign them automatically.