Requesting Clarification: Related to textures when DE-serializing object3D

Started by zoalord12, December 10, 2015, 05:51:08 PM

Previous topic - Next topic

zoalord12

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

EgonOlsen

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.

zoalord12

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.




EgonOlsen

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.

zoalord12

hmm ok thanks for clarifying that.


Is the texture object fully serializable ?

EgonOlsen

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.