Skip to main content
GameDev.net gamedev.net

PRO Tired of ads? Read GameDev.net ad-free and help keep the community independent with GameDev Pro — $3/month.

Improved LOD algorithm

Improved LOD algorithm

2,429 3
Been ill most of this week so haven't really been up to much development wise. That said, I still spent most of this afternoon playing around with my Direct3D 11 Terrain Renderer.

During the week I came across a link for the Puget Sound dataset that I thought I'd make use of as it's definitely better than anything I can invent myself!

For those who aren't familiar with Puget Sound, it's the bay area around Seattle. Compare the colour map with a google map (depressingly had to resort of using a Google service as none of the others have a 'terrain' mode [headshake]) and you should be able to identify it - look for the triangle of peaks in the lower-left portion of the image as being Mt Ranier (top), Mt St. Helens (bottom-left) and Mt Adams (bottom-right).

Courtesy of y2kiah's comments in my previous journal entry I implemented a plane-based error metric and pushed ahead with a standard deviation based calculation.

I now have a more complex Compute Shader pre-pass that generates a plane for each patch and takes the distance of each point to the plane as input into the standard deviation equation rather than just the raw height as I had previously done. Essentially I end up with a measurement of coplanarity (is that a word?) - low values indicate that all the points in the patch are roughly following the same flat surface and high values indicate a much rougher/uneven patch. Perfect!

I also modified the way that the final LOD is chosen. I use the standard deviation as well as distance as inputs and have taken to simply adding them together with a given bias. Currently I'm using 35% distance and 65% deviation.

From initial testing the results are pretty much exactly what I want. Flat and distant areas are low detail and rough pieces are high detail subject to their distance to the camera.

Discussion

Loading comments...