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.


Topics - kiffa

Pages: 1 2 3 [4] 5 6
46
Support / Some issues about rendering when camera moving out.
« on: February 25, 2013, 02:29:22 pm »
With the same object3D and the same lookAt-vector, If i move camera out by Camera.moveCamera(CAMERA_MOVEOUT, distance); some abnormal things will happen:

1, the aliasing between boundaries will be rather obvious.

2, some transparency issues(I'm not very sure, but the appearance seems like that), i.e, some parts of an opacity object3D will be transparent and the object3D behind it will be visible.

3, when rotating object3D/camera, the aliasing between boundaries is rather obvious.

Some images:

1, With the near camra,  the aliasing is not obvious:



2, With the far camera, the aliasing is obvious:



3, With the rotating, the aliasing is obvious:

 

47
Support / Render to target, blit the texture, but got a black screen.
« on: February 02, 2013, 05:51:44 am »
I want to make the special effect like that:





What i do:
1,  Render skeleton animation, assume the frame sequences are  1\2\3\4\5\6...
2,  When rendering frame-1, first render to frameBuffer, then change the transparency  of obj3d, render frame-1 to a texture.
3,  When rendering frame-2, first render to frameBuffer, then blit the last render-target-texture(frame-1). So there are 2 obj3ds in frameBuffer now, one is frame-1 with  transparency, one is frame-2. then change the transparency  of obj3d, render frame-2 to a texture.
4, Goto step 3.

Problem:
When blitting, i got an black-screen. OpenglES 2.0, Code:

Code: [Select]
//onDrawFrame

frameBuffer.clear();
world.renderScene(frameBuffer);
world.draw(frameBuffer);

if(mTexture == null){
      mTexture = new Texture(frameBuffer.getWidth(), frameBuffer.getHeight(), 100);
      Log.d(D.TAG, "texture width: " + mTexture.getWidth());
      Log.d(D.TAG, "texture height: " + mTexture.getHeight());
}
else {
      frameBuffer.blit(mTexture, 0, 0, 0, 0, frameBuffer.getWidth(), frameBuffer.getHeight(), FrameBuffer.TRANSPARENT_BLITTING);
}

obj.setTransparency(100);  // Adjust Config, so transparency value is between 0 - 255;
frameBuffer.setRenderTarget(mTexture);
world.draw(frameBuffer);

frameBuffer.removeRenderTarget();
obj.setTransparency(-1);
 





48
Support / Some issues about materials and lights.
« on: January 30, 2013, 01:07:45 pm »
Does the engine support the materials of models?

For example, export .obj and .mtl, there are some materials data in .mtl, does the engine use them to calculate the lights effect?

Could i specify the ambient\diffuse\specular for Object3D\mesh?

Could i specify the ambient\diffuse\specular for lights?

49
Support / Some issues about Texture.defaultTo4bpp
« on: January 29, 2013, 06:52:28 am »
What does the 4bpp mean? 4 bits per pixel? If so, what's the pixel format? 1111?

Or it means 4 bits per pixel-component?  i.e 4444.

Texture.defaultTo4bpp defined the pixel format of textures in GPU, right? 

50
Support / No supporting World.drawWireframe()?
« on: January 28, 2013, 10:42:42 am »
The java-doc of jPCT-AE doesn't say that, but a run time exception was thrown when running:

01-28 17:33:43.910: E/AndroidRuntime(2477): java.lang.RuntimeException: Wireframe rendering isn't supported ATM!

I want to use this method to do some special effects, could you add it? Thanks.

Another question: what's the "ATM" mean? At the moment?


51
Support / What does the "compiled objects"actually mean?
« on: January 26, 2013, 04:00:25 pm »
I want to know the difference between "uncompiled objects" and "compiled objects".

I have read the wiki, which describe  the advantages and disadvantages of compiled objects. But i want to know more details.

For example, the compiling process 、 the structures of compiled objects 、 why does it have the advantages/disadvantages... and so on.

Thanks.

52
I want to decrease the memory usage and the disk-space of .bones file.

What should i do to get the best result?

1, decrease the total frames of animation.

2, decrease the vertexes of the model.

3, decrease the joints of the model.

My obj has 1818 frames, 4947 vertexes, 18 joints.

53
Support / Could i only draw the object3Ds which are modified per frame?
« on: January 21, 2013, 09:56:10 am »
In my game, some scene has a fixed camera, so there are some object3Ds which are staying the same per frame(background, trees and so on).

I want to just redraw the object3Ds which are modified per frame(for example: animated objs), don't redraw the others.

How to do this? And how much is the difference of the performance between the 2 methods(one is redrawing all the objects per frame, the other is just redrawing the modified ones.) Could i keep some pixes in the framebuffer instead of refilling it?


54
Support / Could i hold the textures on GPU when the surface size changed?
« on: January 11, 2013, 06:59:52 am »
In my app, the window size will change at some time, and i coded below to handle this:

Code: [Select]

  // in class which implements Renderer
  public void onSurfaceChanged(GL10 gl, int width, int height)  {
    Log.d("jPCT-AE", "3d Renderer Surface Changed: " + width + ", " + height);
    Log.d("jPCT-AE", "3d Renderer Surface Changed: update frameBuffer");

    mFrameBuffer.dispose();
    initFrameBuffer(gl, width, height);
    getGameContext().setFrameBuffer(mFrameBuffer);
    initFpsShown();
   
    mGameLogic.onResize(mFrameBuffer.getWidth(), mFrameBuffer.getHeight());
  }

The code "mFrameBuffer.dispose();" will unload all the textures from GPU. There are 2 problems:

1, The action of unloading and reloading will cause a rendering delay.

2, I need hold all the textures in vm memory(Texture.defaultToKeepPixels(true);) or use the Virtualizer(it will cause more delay because of I/O, and can't help with the peak of memeory) .

Could i rebuild other contexts but hold the textures on GPU when the surface size changed?


55
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();



56
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).

57
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?

58
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?

59
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?

60
I have a dog, in scene-1, the dog will be set to texture1 which named "dog".

In scene-2,  i first removeAndUnload("dog"), then new texture2 which is different from texture1 but has the same name "dog", then set the texture2 to the dog.

But the dog in scene-2 looks like with another texture which is not texture2.

Codes:

Code: [Select]
//scene1
texture1 = new texture(in);
textManager.addTexture("dog", texture1);
dog.setTexture("dog");

//do something
...

//switch to scene2
removeAndUnload("dog");

//in scene2
//add some other texture first
textureManager.addTexture("some other textures")

//new texture2 with the same name "dog"
texture2 = new texture(in2);
textureManager.addTexture("dog", texture2);

dog.setTexture("dog");

// the dog seems not to be set to  the texture2, but one of "some other textures"

I guess that was caused by some caching mechanism?











Pages: 1 2 3 [4] 5 6