The Advanced Cave Culling Algorithm – making Minecraft faster
tomcc.github.io
tomcc.github.io
This sounds very similar to http://en.wikipedia.org/wiki/Potentially_visible_set
I'm not sure why they're doing a full flood-fill-- why compute connectivity instead of visibility? Knowing the answers to "entering through face A, can a ray exit through face B?" should solve the same problem and also be easier to compute.
Maybe you can do the 6 searches in parallel, such that whenever they meet you know you've found a connection between the two edges they were coming from? I don't know if that means any less work except in cases where all 6 edges are trivially connected.
Basically it performs a flood fill on contiguous groups of all the transparent blocks in the chunk. If any group touches two sides they are considered to be able to see each other. Keep in mind this is precomputed and doesn't have a "looking-at" direction.
Perhaps you could perform this test six times, one for each face. Then you would have a direction.
It seems like a combination of both might be feasible. Do something smart like this article on the CPU, which feeds into a greatly reduced set of occlusion queries, small enough to perhaps not introduce significant stalls using the first method.
However, in this article's case, he's specifically targeting the mobile edition of minecraft, where hardware occlusion is not yet universally available! So fast CPU versions are definitely warranted, and I think he's got a really good solution.
I would have thought maybe the ravine problem can be solved by using the heuristics to detect when the search appears to be going down a ravine and then begin raycasting.
This gives me good frame rates (30fps+) on a nexus 4 for reasonable detailed geometry (including large procedural terrain) whilst still being able to run various post-process effects (ssao, bloom).
It's possible that the minecraft scenes are that much more complex though.
I got some of your issues fixed back then. Ravines, for instance. You might want to take a look:
(3-clause BSD): https://github.com/TheFakeMontyOnTheRun/derelict/blob/master...
(GPLv2): https://garage.maemo.org/plugins/scmsvn/viewcvs.php/angstron...
Don't hesitate to get into touch. I will gladly explain anything.
I'm not looking for money. I'm just trying to help. I always felt bad for this algorithm to just gather dust. That post of you made my day.
The open source server (which is based I believe on the orginal server) actually doesn't use function names to describe what the function does, but functions are given names like, "a","b","c","d" in alphabetical order.
Which means you'll see instances of
d.e(a.b(c.f(new b.g())));
There is some work done to clean up function names (see http://mcpold.ocean-labs.de/index.php/Main_Page) but yes, you may see obfuscated names.
http://metro.co.uk/2014/06/26/minecraft-is-now-second-best-s...