5 ms·
Even drawing front-to-back you don't need the y-buffer, if you switch the loops: for x ... for y ... Another trick I now remember was to interpolate the color
by pjtr 7y ago
Even drawing front-to-back you don't need the y-buffer, if you switch the loops: for x ... for y ...
Another trick I now remember was to interpolate the color values on such a y-segment, to reduce the pixelated look.
- dahart 7y agoSuch good points and so obvious (now that you said them) that first I really want to retract my comment and second now I feel like coding up a terrain generator today. Duh, Doom did (famously) switch the loops for similar reasons!
- s-macke 7y agoIndeed, switching the loops is valid and might or might not give you an additional speedup. I had hoped, that someone figures this out :-). However I think in order to understand the basic algorithm the way in the readme is the better one.
- gliese1337 7y agoDo you know of referenceable pseudocode (or real code) for that somewhere? I've tried modifying your code to switch the loops, but it always comes out garbled; clearly I'm messing up somewhere in the refactoring process, but I don't have enough experience with this algorithm to figure out where!
- s-macke 7y agoA render routine with exchanged for loops looks like this. https://www.pastiebin.com/5e10d48ac6595 https://www.pastiebin.com/5e10d48ac6595 Just exchange the Render() method in my VoxelSpace.html file with the pastie.