• Create Account

Need scary sound effects or creepy audio loops for your next horror-themed game? Check out Highscore Vol.3 - The Horror Edition in our marketplace. 50 sounds and 10 loops for only \$9.99!

### #ActualDrakken255

Posted 07 August 2012 - 09:25 AM

Hello all,

Project Info:

So at the moment, I am using a single instance buffer containing information for roughly 32,000 square faces. There is a high possibility that once every second or slightly less, faces may need removed, or others added. Each face is part of a block is part of a chunk. (Yes... Minecraft clone... I'm bored, okay?) My math says that 3 chunks makes about 32,000 faces that are exposed and must be drawn and Minecraft draws about 50 chunks at a time, so:
32,000 faces / 3 chunks = ~10667 faces per chunk.
A single instance buffer would draw 10,667 * 50 = 533,350 faces to draw.

This, as it is, is too much for XNA to handle at a decent frame rate I am using a testing scenario that renders cubes, so 533350 faces / 6 = ~88891 cubes, which brings frame rate from a flat 60 to the 30s. If we skip that problem and assume it is fine:

What if the player destroys one block? One surface instance must be deleted and 5 more must take its place. That means recalculating every single face needing to be drawn, AND re-initializing an entire instance buffer containing an ungodly amount of instances, all in one frame.

This obviously is not the way to do it, because the engine takes about 6 seconds as it is to load with only 3 chunks.

Question:

Would it hurt the CPU on the average draw call to split one large batch into roughly 50 smaller ones? Would my computer fall over dead if I made each chunk draw its own set of instances, containing about 10,000 faces each?

### #1Drakken255

Posted 07 August 2012 - 08:56 AM

Hello all,

Project Info:

So at the moment, I am using a single instance buffer containing information for roughly 32,000 square faces. There is a high possibility that once every second or slightly less, faces may need removed, or others added. Each face is part of a block is part of a chunk. (Yes... Minecraft clone... I'm bored, okay?) My math says that 3 chunks makes about 32,000 faces that are exposed and must be drawn and Minecraft draws about 50 chunks at a time, so:
32,000 faces / 3 chunks = ~10667 faces per chunk.
A single instance buffer would draw 10,667 * 50 = 533,350 faces to draw.

That may or may not be too much to draw. I don't know because I haven't tried to draw that many yet. Assuming it can be done:

What if the player destroys one block? One surface instance must be deleted and 5 more must take its place. That means recalculating every single face needing to be drawn, AND re-initializing an entire instance buffer containing an ungodly amount of instances, all in one frame.

This obviously is not the way to do it, because the engine takes about 6 seconds as it is to load with only 3 chunks.

Question:

Would it hurt the CPU on the average draw call to split one large batch into roughly 50 smaller ones? Would my computer fall over dead if I made each chunk draw its own set of instances, containing about 10,000 faces each?

PARTNERS