Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - kiffa

Pages: 1 ... 7 8 [9] 10 11 ... 14
121
Bones / Re: How to implement dressing?
« on: December 08, 2012, 07:31:19 am »
Yes, that's a solution. But there may be some problems: ram 、loading-time、update.

In my project, there will be many decors(10 hats、10 shoes、10 clothes ... etc). If i loading all of them in the same time, which may cause OOM. And it's hard to use small patch to update the decors(Must update all of the AnimatedGroup, not only the changed one).

I'am not familiar with skin-animations, if i want to do such replacing, what i needed to do?(replace Animated3D in AnimmatedGroup? replace MeshData and SkinData?)

122
Bones / Re: How to implement dressing?
« on: December 08, 2012, 06:34:57 am »
Thanks! I have tried what you say and it works.

Another question:
I hope the hat will be changeable. Now i can change the texture. But how could i change the Mesh?

I can make a new hat model in editor which share the same skeleton with the old one, and i want to just export the new-hat.bones.

Now i have an old AnimatedGroup(Include many sub meshes, such as dog、hat、shoes and so on), a new-hat AnimatedGroup(Include only one mesh: new hat). How could i replace the old-hat-mesh in the old AnimatedGroup with the new-hat-mesh in the new AnimatedGroup?

123
Bones / How to implement dressing?
« on: December 07, 2012, 05:45:39 am »
I have a dog(Animated3D), i want to dress it with different decors. For example: hat、shoes、clothes and so on. And the decors should animate with the dog.

How to implement this?

There is my first ideal:

1, Build dog model and hat model.
2, Make dog-bones-animation and hat-bones-animation.
3, export dog.bones and hat.bones.
4, animate dog.bones and hat.bones.

That's workable. But i think that the hat's animation is just relying to the dog, so i want to build just an animated-dog, and a hat without animation-info(skinclips), let the hat share the skinclips with  the dog. If can do this, how? I tried, but didn't succeed:

1, In maya, build dog model and hat model, let them share the same skeleton.
2, Export dog.bones with full animations, export hat.bones with just 1 frame animations.
3, In code:
Code: [Select]
hat.replaceSkeleton(dog.getSkeleton()); 
hat.setSkinClipSequence(dog.getSkinClipSequence());

//render loop
playDogAnimation();
playHatAnimation();



124
News / Re: Website relaunched
« on: November 15, 2012, 01:42:23 pm »
Looks nice!

And i hope there is a particle system in the jPCT-AE, many games need it ;D

125
2.0

Because jPCT-AE log say:

WARNING: Texture's size is 256/128, but textures should be square for OpenGL ES2.0! This may result in a black texture!


When i use 256*128(or other texture which isn't square),  all are fine, but because of the warning above, i prefer to make all textures to be square to avoid potential error.

Should I use (2^n * 2^m) or (2^n * 2^n)?

And to convert 512*128 -> 512*512, i won't use Bitmap.scale()(or other similar methods), i just use a file of 512*512 instead.

126
1, I have a 2D icon with an .png file of 512 * 128

2, I use framebuffer.blit() to show the icon, so i need convert the .png to 512*512, and the usage of memory will increase 3 times(from 512*128 to 512*512). And 3/4 of the file is filled with total-transparent pixels. That's waste.

3, Any suggestion to resolve this with little memory increasing? And I don't want to split the file of 512*128 to many small files(For examble: 4 files of 128*128).

127
Support / About defaultToKeepPixels
« on: September 21, 2012, 09:59:10 am »
If i set defaultToKeepPixels=false; the texture in vm will be free after uploaded to gpu.

And you don't suggest doing like this, because if the OpenGL context change, there will some bad things happen.

Could you explain more? When and how will the OpenGL context change? if  defaultToKeepPixels==false and OpenGL conext changed, what will happen?

128
Yes, it's related to obfuscation. I have resolve this by add:

-keepnames class * implements java.io.Serializable

-keepclassmembers class * implements java.io.Serializable {
    static final long serialVersionUID;
    private static final java.io.ObjectStreamField[] serialPersistentFields;
    !static !transient <fields>;
    private void writeObject(java.io.ObjectOutputStream);
    private void readObject(java.io.ObjectInputStream);
    java.lang.Object writeReplace();
    java.lang.Object readResolve();
}

The keep list above is not precise but workable.

129
First the log said:

09-17 18:51:48.890: W/System.err(4142): java.lang.ClassNotFoundException: raft.jpct.bones.MeshData
09-17 18:51:48.890: W/System.err(4142):    at java.lang.Class.classForName(Native Method)
09-17 18:51:48.890: W/System.err(4142):    at java.lang.Class.forName(Class.java:234)
09-17 18:51:48.890: W/System.err(4142):    at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:2564)
09-17 18:51:48.890: W/System.err(4142):    at java.io.ObjectInputStream.readNewClassDesc(ObjectInputStream.java:1823)
09-17 18:51:48.890: W/System.err(4142):    at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:811)
09-17 18:51:48.890: W/System.err(4142):    at java.io.ObjectInputStream.readNewObject(ObjectInputStream.java:2039)
09-17 18:51:48.890: W/System.err(4142):    at java.io.ObjectInputStream.readNonPrimitiveContent(ObjectInputStream.java:916)
09-17 18:51:48.890: W/System.err(4142):    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:2262)
09-17 18:51:48.890: W/System.err(4142):    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:2217)
09-17 18:51:48.890: W/System.err(4142):    at b.a.a.a.<init>(Unknown Source)




Then i add "-keep  class raft.jpct.bones.MeshData" in progurad.cfg, the error changed to:

09-17 18:54:13.400: W/System.err(4211): java.io.InvalidClassException: raft.jpct.bones.MeshData; Incompatible class (SUID): raft.jpct.bones.MeshData: static final long serialVersionUID =1L; but expected raft.jpct.bones.MeshData: static final long serialVersionUID =7143378492676895671L;
09-17 18:54:13.400: W/System.err(4211):    at java.io.ObjectInputStream.verifyAndInit(ObjectInputStream.java:2697)
09-17 18:54:13.400: W/System.err(4211):    at java.io.ObjectInputStream.readNewClassDesc(ObjectInputStream.java:1825)
09-17 18:54:13.400: W/System.err(4211):    at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:811)
09-17 18:54:13.400: W/System.err(4211):    at java.io.ObjectInputStream.readNewObject(ObjectInputStream.java:2039)
09-17 18:54:13.400: W/System.err(4211):    at java.io.ObjectInputStream.readNonPrimitiveContent(ObjectInputStream.java:916)
09-17 18:54:13.400: W/System.err(4211):    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:2262)
09-17 18:54:13.400: W/System.err(4211):    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:2217)
09-17 18:54:13.400: W/System.err(4211):    at raft.jpct.bones.a.<init>(Unknown Source)
09-17 18:54:13.400: W/System.err(4211):    at raft.jpct.bones.c.<init>(Unknown Source)
09-17 18:54:13.400: W/System.err(4211):    at raft.jpct.bones.d.a(Unknown Source)
09-17 18:54:13.400: W/System.err(4211):    at com.zwenyu.k.g.b(Unknown Source)
09-17 18:54:13.400: W/System.err(4211):    at com.zwenyu.i.d.f(Unknown Source)
09-17 18:54:13.400: W/System.err(4211):    at com.zwenyu.i.d.d(Unknown Source)
09-17 18:54:13.400: W/System.err(4211):    at com.zwenyu.i.d.b(Unknown Source)
09-17 18:54:13.400: W/System.err(4211):    at com.zwenyu.i.d.a(Unknown Source)
09-17 18:54:13.400: W/System.err(4211):    at com.zwenyu.i.d.doInBackground(Unknown Source)
09-17 18:54:13.400: W/System.err(4211):    at android.os.AsyncTask$2.call(AsyncTask.java:185)
09-17 18:54:13.400: W/System.err(4211):    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
09-17 18:54:13.400: W/System.err(4211):    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
09-17 18:54:13.400: W/System.err(4211):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
09-17 18:54:13.400: W/System.err(4211):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
09-17 18:54:13.400: W/System.err(4211):    at java.lang.Thread.run(Thread.java:1019)
09-17 18:54:13.400: W/dalvikvm(4211): threadid=11: thread exiting with uncaught exception (group=0x401f8560)



130
This may be caused by Proguard itself, i will have a look.

131
Bones / ClassNotFoundException when loading .bones with obfuscated code.
« on: September 17, 2012, 11:07:54 am »
I use android-proguard to Obfuscate my code, and ClassNotFoundException happened when  loading .bones. All are ok before obfuscated.

Codes:
Code: [Select]
//loading .ser, all are ok
 obj = Loader.loadSerializedObject(in);

//loading .bones, throw ClassNotFoundException :
    AnimatedGroup group = BonesIO.loadGroup(activity.getAssets().open(assetFileName));

Is this caused by Serializable obj? Why loading .ser is ok but .bones is not? Any main difference between them?

132
Support / Re: jPCT and real 3D
« on: September 17, 2012, 05:57:10 am »
This question is also what i am interested in!

And this may depend on the way how the hardware implement real-3D.

133
Support / Problem with android Proguard.
« on: September 17, 2012, 05:48:56 am »
For some reason, i need obscure my code by using Proguard.

And when i do this, there was an error:

[2012-09-17 11:26:12 - AndroidDog] Proguard returned with error code 1. See console
[2012-09-17 11:26:12 - AndroidDog] Warning: com.threed.jpct.BufferUtilNative: can't find referenced class com.badlogic.gdx.utils.BufferUtils
[2012-09-17 11:26:12 - AndroidDog] Warning: com.threed.jpct.BufferUtilNative: can't find referenced class com.badlogic.gdx.utils.BufferUtils
[2012-09-17 11:26:12 - AndroidDog]       You should check if you need to specify additional program jars.
[2012-09-17 11:26:12 - AndroidDog] Warning: there were 2 unresolved references to classes or interfaces.
[2012-09-17 11:26:12 - AndroidDog]          You may need to specify additional library jars (using '-libraryjars').
[2012-09-17 11:26:12 - AndroidDog] java.io.IOException: Please correct the above warnings first.
[2012-09-17 11:26:12 - AndroidDog]    at proguard.Initializer.execute(Initializer.java:321)
[2012-09-17 11:26:12 - AndroidDog]    at proguard.ProGuard.initialize(ProGuard.java:211)
[2012-09-17 11:26:12 - AndroidDog]    at proguard.ProGuard.execute(ProGuard.java:86)
[2012-09-17 11:26:12 - AndroidDog]    at proguard.ProGuard.main(ProGuard.java:492)

Seems jPCT-AE.jar referenced the class  com.badlogic.gdx.utils.BufferUtils, does this class be useful? If so, how to import it?

134
Thanks, i will try small dummy texture. One question: Do all Object3D(s) with the dummy texture share the same texture in memory(means there is only one dummy texture in vm and gpu)?

And the "cache" what i mean is that(i guess):

Object3D.setTexture(name)  -> Objcet3D.setTexture(getTextureIdByName(name)) ->try to getCachedId()  first -> if not fonud, then find and return the real id mapped to the name.

So, if i use the textures which are diffenent but have the same name, getCachedId() may return the last cached but wrong id.

135
I don't want to hold the texture of the dog in memory(both vm and gpu) all the time because of the limited memory. I want to free the texture of the dog when switching to some scenes which don't need the dog.

But i need hold the object of dogModel(Animated3D) in memory all the time(by static reference)  because of the long model-loading time(So i want to just loading once).

So, if the texture name of my dog is always the same, and if i use TextureManager.replaceTextures(), which means i need hold the texture of the dog in memory all the time.

And if i free the texture in some situation,  then create it again later, dog.setTexture(theSameName) will cause an problem which i described above.

Any suggestion? Could i clear the texture cache of the dog by some methods?

Pages: 1 ... 7 8 [9] 10 11 ... 14