Hello Tommaso,
I developed something VERY similar to that algorithm back in 2007 (C++, software rendering), and then again in 2012 (in Java for Android, with GLES).
I got some of your issues fixed back then. Ravines, for instance. You might want to take a look: