godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.14k stars 96 forks source link

Add Cesium streaming 3D Tiles geospatial world mapping technology #1749

Closed goatchurchprime closed 2 years ago

goatchurchprime commented 3 years ago

Describe the project you are working on: A simple flight simulator for training hang-glider and paraglider pilots to get to know the terrain in VR before they fly it for real.

Describe the problem or limitation you are having in your project: There is no way to embed geographical terrain into a game. It was once almost possible to hack something into google-earth, but now quite. It's better to bring the images into the games engine, rather than rebuild a games engine into the map viewing system.

Describe the feature / enhancement and how it helps to overcome the problem or limitation: Terrain should be available as it is for the best of games engines.

Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams: An open source cesium plugin for Unreal Engine has been announced as under development here.
https://cesium.com/blog/2020/06/04/cesium-for-unreal-engine/ Perhaps the work on that could be reused.

If this enhancement will not be used often, can it be worked around with a few lines of script?: If the glider is far away from the ground it may be possible to make a spherical texture video in a separate executable that takes GPS coordinates and returns a sky/ground rendering that can be plotted in the game at a slow enough frame rate because it is not changing very fast.

Is there a reason why this should be core and not an add-on in the asset library?: Unknown.

Calinou commented 3 years ago

This sounds like something better suited as a third-party C++ module or GDNative add-on, considering how specialized it is.

goatchurchprime commented 3 years ago

I suspect it would be both: a plugin that hooks with the Cesium API and a change to the core system that handles realtime streaming of textured meshes (just as it handles realtime streaming of videos).

Ideally we'd find a lot more applications for streamed geometry than just the Cesium application. For example, for more sculptured voxel worlds where the heavy computation is done on a server and backed up for streaming, rather than the procedural world building that is popular now where you have to have a relatively simple algorithm that you hope runs the same on each of the player's computers to construct the world (seen in No Man's Sky). A more heavyweight algorithm could simulate the eroding of canyons and cliffs to create much more beautiful geometry that could not be computed locally.

There's a sandbox area on the cesium website here where they show off about 50 different javascript demos that are tantamount to constructing a primitive game engine into a basic web framework, as I said. Watching the network traffic showed files of content-type vnd.quantized-mesh.

There is extensive documentation of the format at https://github.com/CesiumGS/3d-tiles

3D Tiles is an open specification for sharing, visualizing, fusing, and interacting with massive heterogenous 3D geospatial content across desktop, web, and mobile applications... built on glTF, 3D Tiles defines a spatial hierarchy for fast streaming and precision rendering, balancing performance and visual quality at any scale from global to building interiors.

An example of a cesium application for watching a paraglider race is here: https://cesium.com/blog/2019/06/13/red-bull-x-alps-in-cesium/ However, it would be stretching the technology too far to develop this into an interactive game. It's only for watching.

fire commented 3 years ago

Is there a[n] implementation of this in C++?

What is the licensing on the spec?

Can you use this for a first person / third person game? This is for curiosity. I'm sure it works for top down games.

Edited:

I assume it would take modified GLTF2 scene and use a runtime loading system.

aaronfranke commented 3 years ago

This is a fantastic idea of a thing to have, but it doesn't belong in the core engine at all. Therefore this proposal doesn't belong here in this repository, so I suggest you close this issue. Consider posting this in Godot Ideas instead.

I will note that for this idea, #892 would be really nice to have, and it would be required for some types of games using this idea. So you can think of the status of this idea as a soft "depends on #892".

fire commented 3 years ago

https://github.com/CesiumGS/cesium-native was released today.

kisg commented 3 years ago

@aaronfranke I think Cesium support could be implemented even without double precision support in Godot. Unreal itself is using single precision for its core data types (e.g. FVector). The way Cesium solves it is that they have their own double precision computation and they convert between the Unreal types and their internal representation. For example: https://github.com/CesiumGS/cesium-unreal/blob/main/Source/CesiumRuntime/Public/CesiumGeoreferenceComponent.h

Calinou commented 2 years ago

Closing, as this will not be implemented in core due to how specialized it is. It can be implemented with an add-on by a third-party contributor.

GeorgeS2019 commented 6 months ago

@kisg @Calinou => consider re-open @goatchurchprime

msedge_vpO5VpX6Qt

https://youtu.be/LQ4oa8ZQp0g?list=PLFdndNkL5ZR2D72PR6TgRRIJLbNpCbqTY

https://github.com/stuarta0/godot-cesium/issues/1#issue-2229742083

aaronfranke commented 6 months ago

@GeorgeS2019 No.

Unreal itself is using single precision for its core data types (e.g. FVector).

@kisg Note that as of Unreal 5, it only uses double-precision.