engineering

Reflooding the Fens

I went to Ely this week, and find the idea of Ely appearing like a ship amongst the flooded fenlands very intruiging. I want to download the terrain model and render the Isle of Ely amongst the flooded fens.

The UK has a LiDAR programme which provides LiDAR scans of regions at varying resolution, the rough plan is to use this data in PNG form to displace a surface in blender. Then add some further features like a sea level flood plane to visualise the Isle of Ely.

Terrain Data

Most of the UK has 1m resolution data available, in both DTM (terrain) and DSM (surface) variants. Surface includes trees and buildings whereas terrain has them removed (how?).

Some areas have sub 1m resolution data, but not Ely, sub 1m datasets are rare and collected for specific geographical purpose. A map of what surveys have been completed and their resolution is provided on this environment arcgis page.

So I went to the environment agency's data download website, selected an area around Ely with a polygon I downloaded a tile of 1m resolution LiDAR imagery - lidar_composite_dtm-2022-1-TL57nw. I asked ChatGPT to help me reformat this into a PNG, it offered:

gdalwarp -tr 5 5 -r bilinear input.tif downsampled.tif
gdal_translate -ot Byte -scale downsampled.tif output.png

I've got these tools on my path because I installed QGIS when trying to use some of these datasets before. Here is the result:

This is the area south and slightly west of Ely, showing the river Great Ouse going south towards Cambridge. White is higher ground, dark is lower.

Blender

Formats

I discovered that Blender can directly take the TIFF as a displacement image, so I stopped working with PNGs.

Displacement Mapping

Blender offers a displacement modifier that can be applied to a mesh, which takes a displacement image as input. I started by applying this to a subdivided plane. I swapped to using this displacement image as the displacement input of the plane's material shader. Only because I'm a little more familiar with the shading approach.

I used an image texture node in my material shader, with my terrain TIFF file selected, and found that I needed to set the "Color Space" field to "Non Color". Without this, the higher terrain appeared disproportionately scaled up - I'm not yet sure why. I manually tweaked the displacement scaling until it looked right.

Resolution

Both TIFF resolution and subdivision resolution can limit the render resolution. I found that Blender / my computer could handle the full resolution TIFFs without much trouble, so it dropped the downsampling aswell and used the raw TIFF that I downloaded.

Subdivision

I managed to crash Blender by subdividing the plane too much. So I turned on an experimental feature called "adaptive subdivision" within the subdivision modifier. This subdivides any mesh that is visible in the render until the mesh has sub pixel resolution, so in theory this only subdivides as much as is needed for the render. Although this too crashed blender when I put the camera at a shallow angle.

I got fed up of restarting blender, so I opted to manually subdivide sections of the mesh that were visible in the render view, but this will make it annoying to move the camera. I will give this some more attention later.

Result

After repeating this for the tile adjacent to the north (to include the cathedral), adding a flood plane and background, turing on a sky model and repositioning the camera, I got an initial render of the cathedral from the fens,

Further Work