Dev Diary #040 - Further Examination Of Heightmap Upscaling

posted in ProjectTaival
Published October 07, 2019
Advertisement

Hello and welcome to this weeks Dev Diary!

Today I'll be continuing on how upscaling heightmaps affects the end result, when you wan't to create more detailed terrain with ease.

After last weeks test with the heightmap upscales, I decided to try to upscale the heigthmap even further - from 3000 x 3000 pixels to 40 000 x 40 000 pixels, just to see if there would be any return on investment. Or in other words, if there would be any benefit from the extra detail, that the upscaling algorithm creates.

 

Initial Testing

First, lets compare the first set of renders. Like last week, all the settings remain unchanged between renders and only the heightmap is changed between them. This is done in order to eliminate the changes that changing the the lighting or camera angle could cause by creating/showing shadows in different perspective, if moved between renders.

  • Plane 8m x 8m in size.
  • Subdivided several times, first by 100, second by 6 and third by 1 (or 100:6:1 subdivision)
  • Diffuse Scale 1.0, midpoint 0.5 (defaults)
  • Resolutions from top to bottom; 750 x 750, 3000 x 3000, 40 000 x 40 000.

00_750_x_750_Render_(100x6x1).thumb.png.27063172f19cb47023eafac6a55d1ad2.png

The above 750 x 750 pixel heightmap sample is from the original 3000 x 3000 heightmap.

 

00_3k_x_3k_Render_(100x6x1).thumb.png.ba772b076ea31c99f78fb74027b457d1.png

The above 3000 x 3000 pixel heightmap sample is from the upscaled 12 000 x 12 000 pixel heightmap.

 

00_10k_x_10k_Render_(100x6x1).thumb.png.3cb89d12851f372dd319e6501ccf64cd.png

The above 10 000 x 10 000 pixel heightmap sample is from the upscaled 40 000 x 40 000 pixel heightmap.

 

Both upscales were made using the original 3000 x 3000 pixel heightmap and slicing a 1:16th piece (or 1 km2 piece) from the bottom left corner of each of them, in order to highlight the difference in details.

As you can see, the differences are most notable between the Original and the smaller upscale, but from there, the added detail is a tad harder to notice - but it is there.

After this, I also tried to ramp up the data points, or in other words subdivide the plane even further and see how much that changed the outcome. The settings are identical, but the subdivision is greater (100:10:1 instead of 100:6:1 subdivision)

03_750_x_750_Render_(100x10x1).thumb.png.2f190d03d2c3249525cf43d2ec838e14.png

750 x 750 pixel heightmap sample, with the 100:10:1 subdivision.

 

04_3k_x_3k_Render_(100x10x1).thumb.png.94ee023d50595027ddc25183e9c7473a.png

3000 x 3000 pixel heightmap sample, with the 100:10:1 subdivision.

 

05_10k_x_10k_Render_(100x10x1).thumb.png.bcebbfa0fda0a35bb70bdf01530d4b7f.png

10 000 x 10 000 pixel heightmap sample, with the 100:10:1 subdivision.

 

The added data points did increase the level of detail quite a bit. The difference between the two upscales are still hard to see, but still visible after closer inspection. The difference is more visible on 4K monitors, but can be seen on Full HD monitors also. Having these images on top of each other and toggling between them shows the differences much more clearly.

 

Going For More Detail

Since it will look essentially the same on the rendered images, if I increase the land area of the plane in order to try to bring out even more detail out of the renders, I'm not conducting those tests. How ever, there is still one more way to up the ante - an even further zoom in to the minute detail differences of the upscales. To do this, I needed to take even smaller samples, dividing the heigthmaps in 8x8 grids (instead of 4x4 as shown above) and taking one piece out of each of them. For consistency, I'll use the bottom left corner as a sample.

06_375_x_375_Render_(100x10x1).thumb.png.26384cb67b9b68dac8a0592ef19f0e1e.png

375 x 375 pixel heightmap sample from the 3k heightmap, with the 100:10:1 subdivision.

 

07_1500_x_1500_Render_(100x10x1).thumb.png.aba60953ab3c6ee77f592877f30d1c78.png

1500 x 1500 pixel heightmap sample from the 12k heightmap, with the 100:10:1 subdivision.

 

08_5000_x_5000_Render_(100x10x1).thumb.png.6cd1c06abe05e03f799a3d5bd71184fe.png

5000 x 5000 pixel heightmap sample from the 40k heightmap, with the 100:10:1 subdivision.

Edit; You can see the difference most clearly on the illuminated back portion of the landscape as more "grain" or roughness among the white.

The Question Remains

But is it really worth it? That depends if you want all the possible variation out of the heightmap, that could possibly get squeezed out of it, as it is not necessary. but it might just create enough minute differences in the terrain, that the end result will look more natural in the end. But on the down side, the more faces you have, the more the performance hit will be.

Even as the added data points, or mesh resolution will affect the performance of the game, Skyrim also has high def mesh mods, which make the original rather low poly models into much more detailed meshes, especially the rocks, mountain faces and characters. In this light, it might be more than feasible to increase the detail level of your terrain meshes even further. The land area of the smaller samples of the above testing is roughly 500 square meters, that has been fitted on a 8 by 8 meter plane object.

The second thing to consider is how many objects you would need to divide your terrain in to, in order to maximize the resolution you can get out of the heightmaps. As creating a single object that would be miles long would require some serious machine power and RAM from your computer, it's not feasible for all to make a large monolithic map area. Creating a large amount of smaller pieces on the other hand is more work intensive and requires more time and patience from the developer to insert them all in the game world and line them all up in the correct order.

 

The Conlusion

Edit; The benefits of upscaling your heightmap only show, when you divide it to smaller samples > the smaller the pieces, that you divide your upscaled heightmap at, the more benefit the upscaling has. Alternatively, the same benefits of the upscaled heightmap can be seen when making a larger and closer to IRL size map, but to my knowledge, a huge monolithic map with lots of detail takes up more processing power. Though this might be an utterly out-dated notion these days - I need to do more research on that. What i know for sure, is that it limits the amount of subdivision that can be used while editing the landscape, as Blender is very likely to crash on my PC when I go with any larger subdivision than 100:10:1 and the amount of subdivision matters.

Edit; When you are upscaling your heightmap, the algorithm you do it with matters the most, as the more the algorithm creates more gradual shades between white and black while trying to make sense of the original shapes, the more likely you get more added details to the landscape. Still, this method is not for purists, as it does not bring the absolute original shape of the land back to the image, just adds more variation.

Edit; As an example, if you know that the heightmap represents a 4 km2 sized area and the accuracy of the satellite/airplane measurement was something between 2 - 30 meters. If your heightmap has an accuracy rating of 10 meters, then by upscaling the heightmap to 10 times the size of your source image, your get a simulated accuracy of 1 meters. If you want to have more granularity than that, you can go for as large as you want (or can), but at some point there will be no visual benefits. To determine that point, you need to experiment for your self on a case-by-case basis.

Edit; As the GameDev forum does not show the images in full screen, some of the differences between the images is apparently lost, when trying to spot tiny differences. The original images in full screen show the differences much more clearly. You can download them from here 040.7z

All in all, the more you are willing to work for your terrain mesh fidelity, the more you seem to be able to get out of upscaling your heightmaps. This seems to continue as far as you your self are willing to take it, or at least to much smaller (or larger, depending on how you look at it) scales than what my testing indicates here. It will be interesting to see how much of a performance hit it will have, when using a higher detail mesh for terrain. This will be revealed when I get to the first testing phase, with only a small land area and the 3D character model that I created earlier.

But before that, next weeks Dev Diary will be about slicing big images seamlessly into smaller image files semi-automatically using GIMP, so stay tuned!

Thank you for tuning in, and I'll see you on the next one!

You can check out every possible mid week announcements about the project on these official channels;

• YouTube • Facebook • Twitter • Discord • Reddit • Pinterest • SoundCloud • LinkedIn •

0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement