Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I suddenly have the feeling that I have absolutely no idea how to implement invisible objects/bones.

Right now, I use hardware instancing to store the world matrix of every bone in a vertex buffer, and then send them all to the pipeline. But when dealing with frustum culling, or having them set to invisible by my simulation for other reasons, means that some of them will be randomly invisible.

Does this mean I effectively need to re-fill the buffer from scratch every frame with only the visible unit's matrices? This seems to me like it would involve a lot of wasted bandwidth.

share|improve this question
Chills from the first sentence... – Byte56 Mar 22 '12 at 22:24
@Byte56 This question best read by flashlight at a campfire. – user14497 Mar 22 '12 at 22:40
Thanks for the funny comments, but I was hoping to, y'know, get some useful input on the problem. – DeadMG Mar 22 '12 at 22:47
Well I don't think you're going to get it for free. Try one, or both, then worry about performance. – Byte56 Mar 23 '12 at 18:41
"Right now, I use hardware instancing to store the world matrix of every bone in a vertex buffer, and then send them all to the pipeline." I don't understand this sentence. Are you doing matrix palette skinning, or are you just rendering a bunch of the same object in different places? Because the latter doesn't involve bones at all. – Nicol Bolas Mar 23 '12 at 23:10
up vote 1 down vote accepted

Might as well put this as an answer... I'd try implementing what I suggested and have units or objects that you want to be invisible reference a bone with zero scale. Really that's only for units that have multiple bones and you want to just make part of it invisible. Otherwise, just remove the position offset or change it to really far away when you want to make a unit invisible. Try letting the graphics card sort out what to draw.

You can't worry too much about performance yet. At least try these things out before disregarding them as to costly. Premature optimization and all that.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.