Hi Joseba, On 8/6/09 9:42 AM, Joseba Rodriguez wrote:
Im trying to do some texture animations in different objects (billboards). For this purpose im using Geometry::setTexCoordArray(unsigned int unit,Array*) in a Update callback. I found out that using this function is quite expensive, making my app slow down from 120 fps to 40 fps with 2000 billboards (quads). Is there any other cheaper way to dinamically change the texture coords?
First of all, you can change the texture coordinates in-place i.e. just modify the existing array. You may need to dirty() the geometry after that.
Secondly, if you're using display lists (which is the default) the geometry has to be recompiled after every dirty() or setTexCoordArray() (which calls dirty internally). This can be a slow process. Try to disable display lists and see what difference that makes.
Thirdly, depending on the animation you're doing you could also use the texture matrix. This works well for scaling, translation, rotation.
Hope this helps, /ulrich _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

