Skip to content
This repository has been archived by the owner on Aug 14, 2022. It is now read-only.

Run in streaming into game engines (Unity, Unreal) #62

Open
fpibbs opened this issue Jan 30, 2021 · 1 comment
Open

Run in streaming into game engines (Unity, Unreal) #62

fpibbs opened this issue Jan 30, 2021 · 1 comment

Comments

@fpibbs
Copy link

fpibbs commented Jan 30, 2021

The idea is to stream earth data into game engines. As a background for deeper analysis or whatever useful.
I mind if anyone has tried to start the process.

@retroplasma
Copy link
Owner

Probably looking at the code from the client can help put something together. I assume those engines have features to deal with octrees, frustum culling, HTTP and so on. Here's an overview of the files from the client:

  • main.cpp: Render loop, deals with the octree, requests new bulks/nodes, does culling, camera movement, decides which meshes are buffered. Calls functions from the other files
  • rocktree_util.h: Requests data from the servers and calls decoding functions
  • rocktree_http.h: HTTP. Caches some requests. The HTTP cache headers and the browser do the work in the Emscripten case. I think everything is cached for some time aside from the root meta Planetoid.
  • rocktree.proto, rocktree_decoder.h, rocktree_ex.h: Decode raw data. First protobuf, then postprocessing, then putting it in a form so it fits our octree data type and can be rendered
  • rocktree_types.h: Octree data structure with meshes, textures, matrices and download state. Grows/shrinks based on camera position. Instantiated in main
  • rocktree_math.h: Math functions for frustum culling and camera
  • rocktree_gl.h: Graphics binding. The interesting part here is the octant masking. The meshes can be sub-divided with these masks and help with level of detail. This mask binding can be improved by packing it into a smaller uniform value and unpacking it in the shader.

The crucial part is the decoding of the meshes. Everything else depends on how exhaustive and optimized it should be.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants