www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: Disastorm on July 16, 2011, 10:40:20 am

Title: Do serialized objects not have the RGB coloring from the original object?
Post by: Disastorm on July 16, 2011, 10:40:20 am
I noticed I load an obj that has a solid color material as opposed to an image file and it seems to work in jpct but after i serialize it for Android, and load it in the android program it does not have those solid color materials?

I also noticed some parts of serialized object looks a bit strange, maybe the textures or something like that.  Is this common?  Not sure if its because of the serialized object or because of android.  Heres an example of the strange textures, those red parts are not supposed to be there: http://i8.photobucket.com/albums/a23/Disastorm/Temporary/weird.jpg

*edit just wanted to point out that the strange textures do not appear on my phone, it ends up appearing perfectly normal.  Is the strange texture something with older version or android or maybe just the emulator?  I wanted my game to be compatible with older versions so I've been using Android 1.6 emulator.
Title: Re: Do serialized objects not have the RGB coloring from the original object?
Post by: EgonOlsen on July 16, 2011, 12:53:06 pm
The emulator is slow, buggy and renders a lot of BS. You can't expect to get proper results from it.

About the missing materials...yes...i hoped that nobody will notice... ;) It's a problem with the way how jPCT handles solid colors. It creates colored textures for all these colors. But textures itself won't be serialized, only their names are. When loading the serialized model, jPCT-AE looks for textures with that name in the texture manager and because it can't find them there, it will use a white dummy texture. For now, you have to create these color textures yourself and add it to the texture manager with the proper names before loading the model. This "process" involves to scan the log of the loading process (of the orginal model, not the serialized one) for output about textures being created like "__3ds-Color:123/234/96". Then create textures with that name and that color (in this example: red=123, green=234, blue=96).
Yes, it's a pain...it's a better idea to assign a real unicolored texture instead in the modeller. Or wait until i've added support for this to the DeSerializer.
Title: Re: Do serialized objects not have the RGB coloring from the original object?
Post by: Disastorm on July 16, 2011, 10:01:38 pm
Ah ok, I will just use small unicolor texture images then.
Title: Re: Do serialized objects not have the RGB coloring from the original object?
Post by: Disastorm on July 17, 2011, 01:20:03 am
Hey egon i noticed that I was using Texture.defaultTo4bpp(true); since it was in an example or something.  if i set that to false the texture problem is actually fixed on the emulator, although I think it runs slower.  So the question is should i just keep it set to true since it runs faster and it seems to work on my real phone?  Is there a chance that it won't work on a different phone (i.e. the texture problem occuring), if so then should i set it to false?