So I worked some more on my dynamic heightmap loading / level-of-detail thingamabob. I've got it working near-seamlessly. There are two things I need to work on still. The first is that, as the player moves from one grid space to another, I just load a whole new grid centered around the new grid, rather than deleting irrelevant ones from memory and loading only the new ones. That'll save exponentially more cycles when I get around to it, because instead of loading a 5x5 grid (25 tiles in all), I will only load 5 tiles. So if I bump the buffer zone to an 11x11 grid, then instead of loading 131 tiles, I load only 11. Clearly the savings would be tremendous. I just need to get around to that.
The other issue is that of blending level-of-detail. What I mean is that for a certain radius of tiles around the player-centered tile, I render at a common level of detail, and for tiles outside that range, I render at a common lower level of detail.
Above, we see open gaps between tiles of differing levels of detail. This happens because there are twice as many vertices along the seam in the higher level-of-detail tile than in the lower level-of-detail tile (or more, depending on what setting I select). So I need a way to blend them.
Now, in the above picture we see how I can approach this. I can test to see if the lower LOD tile borders a higher LOD tile, and then have the polygons along that seam draw as three triangles like above, instead of the normal two (each square is understood to be two complementary triangles). Now I just need to implement it!
I'm not in a super rush, because I'm just doing this for fun at this point. Additionally, a friend and I have been discussing ideas for a wholly different kind of project, so that may take precedence over my "fun" programming. Hopefully it pans out!
No comments:
Post a Comment