foxostro / GutsyStorm

Game with voxel graphics similar to Minecraft. (Restart GutsyStorm with Objective-C/Cocoa)
Other
12 stars 4 forks source link

Am I regenerating chunk geometry/VBOs too much? #74

Closed foxostro closed 11 years ago

foxostro commented 11 years ago

It feels like I might be inadvertently generating chunk meshes and/or VBOs too often. These should be generated once when the chunk is loaded and another time each time the chunk is modified. Instead, I regularly turn my back on chunk and later witness them regenerate. So, what's going on?

If I'm regenerating meshes redundantly then fixing this bug could improve startup time by a lot.

foxostro commented 11 years ago

This is fixed as of 29ec87610568bfcfa5fe2e4f746f501302b4a096.

The problem was that chunk visibility flags could be out of date by one frame. No, these are recalculated as soon as we know that the camera has moved. If drawing the active region overlaps a visibility update then tearing may still occur, but has at least been greatly reduced.