CesiumGS / cesium-unreal

Bringing the 3D geospatial ecosystem to Unreal Engine
https://cesium.com/platform/cesium-for-unreal/
Apache License 2.0
917 stars 292 forks source link

Add simple viewshed visualization tool #984

Open nithinp7 opened 1 year ago

nithinp7 commented 1 year ago

Visualizing viewsheds is a common GIS feature request and can be very useful in some use cases. This was inspired by conversation from this forum post: https://community.cesium.com/t/regarding-spatial-analysis-features-of-cesium-for-unreal/20684

Quoting my comment from that discussion:

Regarding viewshed, Unreal has custom scene capture components that can capture depth images in a custom render target to mimic sensors. You can later sample this depth image from a custom tileset material, to determine if a given pixel is visible or occluded from the sensor and color it accordingly. This is actually a simplified version of how point-light shadows work, so there are probably tons of tutorials, etc for this type of thing in Unreal. You might even be able to hack Unreal’s lighting to get this to work with an actual Unreal point light.

Should be relatively straightforward since Unreal does most of the heavy-lifting already. This can just as easily be application-level logic, but it would be a useful out-of-box tool for the community and would be impressive for our own demoing as well.

kacperporebski commented 1 year ago

@nithinp7 Any news on this? Was searching for this exact thing but as a newcomer to unreal engine I am unsure on how to implement this. Any help or pointers on how to implement this in the meantime before it becomes a feature for the plugin would be greatly appreciated!