Hi All,
Currently experimenting with Unreal + ArcGis for use in a flight simulator. I've managed to (kind of) get bodies of water working in an automated way. My current workflow is shapefile -> ESRI JSON -> load into UE. I then use the geometry of the polygons to create mesh modifications and also use the Geometry Script plugin to create dynamic meshes for each of the water bodies. This works *ok* for lakes and such:
They look fine from a distance, but fairly quickly fall apart when close up (1m^2 cube for reference):
As you can see, anywhere that my elevation data has a high slope after the mesh modifications are applied there is a big cliff. Not the end of the world, given the application, but this brings me to rivers and how I've gone about implementing this.
As I mentioned before I'm creating dynamic meshes using the geometry script tool. In order to have the water meshes at the correct height I draped my original vector data over my elevation data to give it Z values. Within Unreal, I then calculate an average height for each polygon and set each point in the polygon to that height. Not doing so i.e. each point has a different Z, results in strange geometry for the water meshes. Now, onto the rivers:
The rivers line up perfectly with my modifications but at various points they are set to too low of a Z. This is obviously because the river polygons cover much more distance and have a greater change in height compared to lakes. The same river as above but further down stream:
I guess my question is, can anyone think of a better way of doing this? It took me a lot of trial and error to get to this point. I've tried setting Z values for the meshes based on elevation data, I've tried triangulating the polygons in an effort to reduce the weird geometry mentioned previously. I've tried subdividing the river polygons - this kind of worked but resulted in stepping between the sections. I also tried using the ArcGis location component, thinking that perhaps the Unreal plugin was doing some interpolation of my elevation - the issue with this was that it can only be used when attached to an actor. It would be great if there was a function we could call to just get the elevation at a given location.
I've seen another post on here, trying to achieve similar with SLPKs and such. I also created a 3d SLPK based on my data but again that resulted in weird geometry (I assume because the polygons were not triangulated).
Amazing workflow! A few thoughts:
Thank you!
I had considered utilising bathymetry but never got around to trying it before my trial of ArcGis Pro ran out - I have a requirement to use my own (offline) data. I'm waiting to hear back from the sales team to potentially get the trial extended before I commit to a full license.
While not with rivers directly, I did experiment creating splines from my polygons to utilise Unreal's water system so I'm sure I can adapt this for rivers. However, some of my river polygons also contain small ponds/pools so I don't think a spline mesh would work in this situation.
On your third point, this had been an idea I had in the back of my head. I wasn't sure how I would "pair" these vertices though, I will have to have a look into the ESRI json spec to see if the order of vertices relates in someway that I could pair "opposite" vertices if you will.
On your last point, there must be some function that provides this functionality or else how does the location component work? From my digging into the source of the plugin I found an ElevationMonitor class (which the location component uses) but I couldn't manage to get it working for my use case. Anyhow, I think the previous solution of pairing up opposite vertices is the best way to go.
Hi @EthanMansfield ,
I'm the author of the post you linked and I'm also investigating the use of this plugin for flight simulator use cases.
The key aspects for it to totally cover the use cases and work with other components were:
- The ability to replace materials of the tiles with water. With ArcGIS Maps 2.0 it is possible to assign materials to elevation and have several maps. I know it might not be optimal but you can have one map with 0 elevation reserved for the ocean water, the thing is that the quads do not have enough resolution to look nicely close to the ground (now water plugins use real-time morphing to have enough resolution in the very close field, normally only the highest resolution LOD alone). In the end, we followed the bathymetry approach, which might be enough for high altitude but not for low altitude because resolution of terrain is normally quite low.
- The ability to replace tiles with detail maps (i.e. with other materials like it is possible at the moment with UE landscapes), starting from maps like landsat land cover.
- The ability to procedurally paint foliage or buildings.
- Smooth rebasing logic implemented. It is important as current weather systems are not planetary and rain and particles generally work only when the Unreal Z is aligned with the ellipsoid local normal direction. Also, realistic ocean materials do not implement triplanar mapping, therefore they stretch when you move far away from your origin (it also happens with clouds). So it is important to update origin periodically and add offsets to materials to keep these things working. I have a custom implementation but it has flickering problems, here the issue.
- LODs without camera frustrum culling only distance culling for placing several views.
I don't exactly know how they did it, but something like this might be extremely useful.
Best regards,
Salva