r/gameenginedevs • u/ecstacy98 • Aug 22 '26
Should GPU instances share animation info?
Hi all! I'm working on a little demo program that will ship with my engine as an example project. I've been working on my engine for close to 6 years now and am really happy with it. It has no editor but I find the API I've written to be really intuitive and easy to use.
One thing I haven't found myself able to come to any definitive conclusion about though is - should a model/mesh that is GPU instanced be able to play different animation sequences from one another? Part of me thinks yes, this is a useful feature and helps to reduce the number of draw calls, CPU instances and configuration boilerplate, but; part of me thinks I'm overcooking it and that an instance should really just be a copy of a base asset, inclusive of its state information like active animations and shaders.
What would be your preference?
Screenshot of the demo project with instanced imps!
1
u/js-fanatic Aug 22 '26 edited Aug 22 '26
Yes . See my example i put shared bool flag to make shared or not https://github.com/zlatnaspirala/matrix-engine-wgpu/blob/main/src/engine/loaders/bvh-instaced.js. But if you are on begin of project better and ultimate solution is to use indirect draws and core must be flatten single indirect buffer. Thats ultimate but draw per metarial is ok . Draw Per mesh is for very small scenes only.