The extra redundant layer is clearly visible. First, we optimize away this layer. My maps are random, so I can’t give the exact same shot twice, but this one is close enough:
If everything behaves as expected, I have practically reduced to half the number of polygons the wall layers uses (only top + bottom) if the entire floor is intact. But there is still a problem. I may be no longer rendering extra wall bottoms, but I am still rendering extra floor tops. Let’s fix this:
And now, for the final shot, with all sides rendered as needed:
Performance has definitely improved, but there are two downsides. First, I am doing a lot more CPU work while determining what part of the mesh to create. So my map scroll/camera rotate operations are not as smooth as they used to be. This can be improved a lot by creating better algorithms. The second problem is that the visual artifacts have become more apparent and some new ones have appeared. I though it was the same problem that is causing the artifacts mentioned in the previous post (and it may be so), but upon further investigation it seems that an extra strip is added sometimes on top of an existing one. I tried to fix it, but kind of ruined it, so I reverted. Anyway, these problems are not that severe. Quite normal actually for something hacked together in a few days while still learning.
I can’t just stop on this note, so I’ll leave you with an early preview of things to come:
And finally, a close-up:
Performance has degraded considerably, but the trees are really poorly optimized. But the new experimental engine can render pretty much as much as it could the first time I presented a 3D engine, but only render. Last time you could interact with the world normally. I am working just on rendering right now. But the big difference is the performance: while the performance is pretty bad, it is at least a hundred times better than last time. Last time it was so bad, I had to abandon the 3D engine because it was unplayable. A GeForce 8800 GT was struggling to keep a double digit framerate.
So the new engine looks promising!