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

Is it possible to re render only animation objects #319

Open
JungleeRaju opened this issue Jan 7, 2019 · 3 comments
Open

Is it possible to re render only animation objects #319

JungleeRaju opened this issue Jan 7, 2019 · 3 comments

Comments

@JungleeRaju
Copy link

I have a query regarding stage rendering feature.

Let us say there are plenty of objects on my game and few objects that are having animation(for example graphics gets updated for these objects). Can i re render only the animation objects as per animation and stop rendering other objects. Is it really possible to do this?

If possible, Is it a good idea to do this?

@JungleeRaju
Copy link
Author

Basically my interest is on stopping rendering of static objects so that i can save some cpu usage of the application.

Otherwise if animation objects are animating continuously, i have to set renderMode to ONCE continously and it is same as setting renderMode to AUTO.

Please suggest...

@bp74
Copy link
Owner

bp74 commented Jan 15, 2019

Hi, thanks for the question. If a DisplayObjectContainer has many children, it may help to call the "applyCache" method on the DisplayObjectContainer. This way all children are rendered to a texture and the following render passes will use this texture to render the DisplayObjectContainer.

But there are a few things you need to consider. If you use the WebGL renderer, many textures will cause many render calls to the GPU, which is bad and slow. If you only use the applyCache method on a few DisplayObjectContainers its not an issue, but if you do it on e.g. 50 or even more it is a problem.

The most important thing to get best performance is texture management (assuming you use the WebGL renderer). If all BitmapDatas come from the same texture atlas, you should be able to render many thousand objects on slow hardware. Take a look at "TexturePacker", it's a great tool to generate texture atlases. There are also tutorials on the website that explain the importance of texture atlases.

@bp74
Copy link
Owner

bp74 commented Jan 15, 2019

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

2 participants