Author Topic: Requesting Clarification: Related to textures when DE-serializing object3D  (Read 2402 times)

Offline zoalord12

  • byte
  • *
  • Posts: 29
    • View Profile
Hi I just needed some clarification regarding the serialization and deserialization of object3D

Scenario:

So i have an object3D model with 1 color (RGB = 1,0,0). I see that a texture is created on load with something like obj-255:0:0, and its accessible through the Texture Manager after I serialize on one platform (i-e windows) and deserialize on another (Android).
If i have the same object, textured with abc.jpg, will that texture be created on the platform when i DE-Serialize the object ?

So what im essentially asking i are textures serialized along with the object, and created when they are de-serialized ?

thanks

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Requesting Clarification: Related to textures when DE-serializing object3D
« Reply #1 on: December 10, 2015, 06:32:06 pm »
No, they are not. Only the names are, so you can add textures with the same name before loading the file and the deserializer will use them.

Offline zoalord12

  • byte
  • *
  • Posts: 29
    • View Profile
Re: Requesting Clarification: Related to textures when DE-serializing object3D
« Reply #2 on: December 10, 2015, 08:15:55 pm »
Hmm ok, thanks for solving that problem. I will just look up the naming convention for images that are converted to textures through the mtl file.


can you help me solve this other problem, same domain....



So 2 parts of my mesh have color materials. Eye = RGB = 1 0 0 and feet = RGB 1 0 0
Now, when loading, the TextureManager makes 1 texture and assigns it to both.

When i want to change only the foot, i cant because they are both associated with the same texture, since the dynamic texture id for both is "obj-255:0:0"

is there are way to fix this ? I have a work around, as in have unique colors per part-mesh... but im just wondering if there is a fix here that i dont know of.

The material names are different, color_eye and color_feet.. in the mtl file but once i load the Object3D, all the feet poly and the eye poly are associated to the same texture so going through the polygon manager wont solve this issue either.




Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Requesting Clarification: Related to textures when DE-serializing object3D
« Reply #3 on: December 10, 2015, 08:23:16 pm »
The textures are based on the color, not on the materials' names. There's no other solution than to change the material colors in a 3d editor of your choice.

Offline zoalord12

  • byte
  • *
  • Posts: 29
    • View Profile
Re: Requesting Clarification: Related to textures when DE-serializing object3D
« Reply #4 on: December 11, 2015, 04:56:43 pm »
hmm ok thanks for clarifying that.


Is the texture object fully serializable ?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Requesting Clarification: Related to textures when DE-serializing object3D
« Reply #5 on: December 11, 2015, 06:26:38 pm »
I'm not sure. It might be, but that will work only for desktop-desktop or android-android, not between versions. It would be a huge waste of space anyway. Storing them in their actual image format is a better idea IMHO.