realbasic-games
[Top] [All Lists]

Re: Animation and memory issue

To: REALbasic Games <realbasic-games at lists dot realsoftware dot com>
Subject: Re: Animation and memory issue
From: Lo Saeteurn <realbasic at miensoftware dot com>
Date: Sun, 24 Jul 2005 07:16:50 -0700
Delivered-to: realbasic-games at lists dot realsoftware dot com
References: <FF3D4383-F5B1-4405-A67F-BDF52954811A at miensoftware dot com> <D52AC133-DDD0-4558-8725-9508D39F6E79 at chaoticbox dot com>
With declares, you should be able to do both of these in one shot by grabbing each trimesh's data with Q3TriMesh_GetData and putting a copy into a new (empty) trimesh with Q3TriMesh_SetData. IIRC, the Q3TriMesh_GetData method copies only the attributeset reference rather than duplicating it, so textures will be shared but each trimesh will have their own geometry. Keep in mind you'll have to duplicate the the whole display group hierarchy for multi-mesh models, but that's not too difficult.

How would you create an empty trimesh and insert it into an empty Object3D?

You can of course share one set of keyframes between all clones

You mean per animation sequence? Currently an entire animation sequence (run, walk, jump, egc.) for a given model is shared between one shape. What I'm trying to do is share that across multiple copies of that model.

and if you want to refine it further you really only need one set of triangle indices and texture UVs for the whole lot as well. That would probably require you build the your trimeshes from scratch and/or grab and keep that data locally in memoryblocks.

Yeah. That would be difficult to do and won't give much benefits in terms of memory (saves 30-90k RAM per copy). What I'm more concern with is texture memory.

In terms of processing, I think sharing animations that cycle such as run and walk would save some CPU cycles, but I'm not sure how much.

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>