Hi Grant, Excerpts from gdneshei's message of Sun Jan 30 03:00:21 +0000 2011: > I've been working with animations and observed that they get slower as > I add more actors to the stage. Is this because Clutter paints every > visible actor for every frame of the animation? If so, is there > anyway to not paint actors that aren't part of the animation. > Currently I'm at 21 fps. FYI: If I remove my background it goes to 31 > fps. The background is a 4MB texture. The latest versions of clutter (git master, one of the 1.5development snapshots or the imminent 1.6) have support for automatically clipping redraws to the regions of the screen that change and for culling actors that are offscreen. (Though it is still best practice to perform manual culling in custom containers where possible since custom containers have more contextual information that Clutter itself)
If the large background texture has a severe effect on your performance that points towards a fillrate bottleneck. Here are some ways to try and reduce the memory overhead of your textures: 1) Enable mipmapping for the textures (with ClutterTexture set the texture quality to HIGH.) This will result in the driver pre-computing different scaled copies of your textures and then it will sample the most appropriate size according to the size of your geometry. It will take a bit more memory. 2) Load your textures at smaller sizes. E.g. use the gdk_pixbuf_new_from_file_with_size API to ensure your image isn't loaded at a size larger than you will display it. 3) Strip un-used alpha channels from your image data. Either you can strip the data from the on-disk images or make sure you load the image using a cogl pixel format without an alpha channel, such COGL_PIXEL_FORMAT_RGB888. 4) More involved approaches would be to implement some form of occlusion detection, so you avoid drawing regions of textures that are obscured by other geometry. For example in the Mutter compositor windows get decomposed into non-overlapping regions represented as a list of rectangles and then they are drawn using the cogl_rectangles_with_texture_coords() API. > > I've tried the clip functions in cogl with little improvement to fps. > I was hoping I could just repaint a small portion of the screen to > speed things up. This isn't something that can really be solved only at the application level but with the latest clutter, this should now be automatic. You can use CLUTTER_PAINT=redraws to visualize if it is working or not. If you are using any custom actors though you will first need to implement the get_paint_volume virtual function. Please see this email thread on the clutter-app-devel mailing list for some more details: http://lists.clutter-project.org/pipermail/clutter-app-devel-list/2011-January/000407.html I hope something there helps, if you have further questions though feel free to ask, kind regards, - Robert > > > Thanks for any help. > Grant Nesheim. -- Robert Bragg, Intel Open Source Technology Center _______________________________________________ clutter-app-devel-list mailing list [email protected] http://lists.clutter-project.org/listinfo/clutter-app-devel-list
