Terrain exaggeration steps

Hi everyone,

I know unity does not support terrain exaggeration ‘yet’ but I was wondering where someone would start to make it work? Would modifying the `CesiumTilesetShader` be a step in the right direction to make use of vertex displacement?

In my mind terrain exaggeration needs to work with other 3DTileset objects like pointclouds and also take the CesiumGlobeAnchor into account, so objects are correctly placed on the Y axis based on the exaggeration.

A small workaround for quick results is this:

In my example I have a terrain I created as a quantized mesh where I exaggerated the terrain itself before creating the quantized mesh by 20x. Loading this into unity obviously visualizes the terrain nicely with correct exaggeration however objects placed with the `CesiumGlobeAnchor` are not at the right height. A simple solution is to adjust the height by my original terrain exaggeration factor, so a original object height of 50 becomes 50 * 20 = 1000, which now displays the object at the right height.

This works for that small example but it’s really not ideal or flexible.

What steps would someone need to make in order to add terrain exaggeration? It’s such an important visualisation setting and a bummer it’s not in yet for unity.

Happy to have some small guidance here on that topic.

Thanks a lot!

Id like to get some movement here so I’ll share what Ive tried so far and how far I got.

My goal first is to expand the CesiumDefaultTilesetShader to transform the terrain by modifying the vertex position.

First I tried to adjust the Y position of the vertices but that didn’t work due to the curvature I assume so the tiles relativ to the globe center.

The most logical solution would be to scale the vertice (with a factor) along its normal direction relativly to the earth globe center but I was not able to get the math correctly working. For some reason it always thought that the globe center was at unity position 0,0,0.

Variables used:
EarthCenter: (6378137, 6378137, 6356753)
TerrainExaggeration: 1 (default)

This shows the terrain normal (that’s a good start!)

However when trying to increase the exaggeration factor to like 30 we see something interesting

At the unity coordinates 0,0,0 it forms a curvature.

NO general terrain exaggeration is happening and I think it’s because I’m unable to get the correct normal direction.

Anyone an idea or a solution?