Greetings.
I am developing a program which uses Cesium for Unreal. While it works great as is, it would be nice to be able to also have foliage just to make it look a bit more real.
I have seen the tutorials here on adding foliage to cesium landscapes. The project is not using using sub levels and the other tutorials are out dated as in the code examples are using an older cesium api and are for either UE 4 or apparently a beta of UE5.
I wrestled with trying to update the tutorial code, but not knowing the cesium API and how it is supposed to work it is rather difficult to fix.
I did manage to find a later project from the same person who made that tutorial for UE5. However, it too is on an older api and has the same issues I have run into trying to update the original tutorial.
It does, however, use GeoJSONs to do its work, which seems to me to be a bit better than the, admittedly clever, “view the scene and determine where grass and trees should go from the color”.
The first level of problems come from obvious moving and/or renaming of some functions.
The first issue is the inability of the plugin (generic foliage) to find HierarchicalInstancedStaticMeshComponent.h
This one is simple to fix, you now need to explicitly include:
#include “Components/HierarchicalInstancedStaticMeshComponent.h”
The next is a complaint about isPointInsideMesh() wanting an actual enum rather than a byte. ALso easy to fix. Change the type of outcome (the offending parameter) to not be TEnumAsByte<> but rather just the pins enum.
Next will be several complaints about unexpected calls but this is really due to an unidentified identifier for FRHIGPUTextureReadback
Again, you now need to add : #include “RHIGPUReadback.h”
At last we come to the parts I have yet to solve and these are the cesium parts.
There are several calls to functions that apparently used to exist in the GeoReference object but have been removed or just moved. Maybe renamed and I couldn’t find it.
TransformLongitudeLatitudeHeightToUnreal()
TransformUnrealToLongitudeLatitudeHeight()
and
ComputeEastSouthUpToUnreal()
Each of these are being called off of a GeoReference->functionnamehere()
I did find similarly named functions in, I believe the name was GeoTransforms.h
However, those expect an origin as well. Something I think was being provided for “free” as a GeoReference object.
Maybe someone can provide some guidance on where to go for these three functions.
Any help is, of course, appreciated.
I’ll come back here and edit/add if I find anything independently.
Thank you.
Edit: One more function I found that is no longer part of GeoReference
TransformEcefToUnreal()