Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Live Wallpaper slow animation #29

Closed
ghost opened this issue May 21, 2012 · 4 comments
Closed

Live Wallpaper slow animation #29

ghost opened this issue May 21, 2012 · 4 comments

Comments

@ghost
Copy link

ghost commented May 21, 2012

I have this live wallpaper code

http://pastebin.com/xT5dKx1m

8*8 cubes on it. it take 3-5 seconds from the wake up to load all. (very slow on a galaxy s2 too)
and the other thing: after some time my phone slowed down, and the aniamtions went very laggy, I cant to use the swype/slide function to change the home screens.

Am I doing something wrong?

@MasDennis
Copy link
Member

Hi,
Please check this tutorial ("batching geometry"): http://www.rozengain.com/blog/2012/01/16/rajawali-tutorial-4-optimisation/
The key to better performance is shared material, cloning, grouping and setRenderChildrenAsBatch()

@ghost
Copy link
Author

ghost commented May 23, 2012

Hello, the example not working too...only one cube showing up...I just copied this stuff to my proejct:

Cube rootCube = new Cube(1.5f);
rootCube.setMaterial(new DiffuseMaterial());
rootCube.addLight(mLight);
rootCube.addTexture(mTextureManager.addTexture(b));
// -- This line indicates that all children will use the same material,
// texture, vertices, indices, etc. The children can have their
// own transformation and color.
rootCube.setRenderChildrenAsBatch(true);
addChild(rootCube);

for(int i=0; i<500; i++) {
// -- Clone from the main object and then set a position and rotation.
BaseObject3D c = rootCube.clone();
c.setPosition(-25f + (float)(Math.random() * 50f), -25f + (float)(Math.random() * 50f), -25f + (float)(Math.random() * 50f));
c.setRotation((float)Math.random() * 360, (float)Math.random() * 360, (float)Math.random() * 360);
rootCube.addChild(c);
}

@MasDennis
Copy link
Member

Hi,
Are you using one of the Galaxy devices?
If so, please check out the latest code, this was fixed yesterday.

@ghost
Copy link
Author

ghost commented May 23, 2012

samunsg galaxy s2, I downloaded the new version, but this still error. not cloning

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant