I rewrote the tesselator!

I promised myself I wouldn’t do this until AFTER survival test release, but..
I implemented two optimizations that have been nagging me for some time now:

* Cull backfaces. This is done per-chunk, so it has to be very forgiving, but it cuts out about 40% of all terrain quads. It works by dividing each chunk into six display lists, one per face, and only rendering the lists that are facing the player.

* Join adjacent strips of the same texture. If there’s a rock next to a rock, why render two quads? Well, because I use a texture atlas, that’s why. But by turning the atlas from a 16x16 grid to a 1x256 grid, I can repeat along u to make strips of the same texture. On a newly generated map, the average strip length is just over 2 tiles, so this cuts out 50% of all quads.

This should give a nice speed boost to low to mid range graphics cards, and as an added bonus, chunk recalculation is MUCH faster now.

As for survival mode, you knock back enemies when hitting them now, and they knock you back as well. It’s possible to kill enemies without getting hit if you time it right.

posted 14 years ago