Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Render 3D Tiles in Unreal Engine #1

Closed
kring opened this issue Mar 11, 2020 · 2 comments
Closed

Render 3D Tiles in Unreal Engine #1

kring opened this issue Mar 11, 2020 · 2 comments

Comments

@kring
Copy link
Member

kring commented Mar 11, 2020

An Unreal Engine Plugin for rendering 3D Tiles Batched 3D Models (b3dm) will likely consist of two main parts:

  • GltfMeshComponent: A UPrimitiveComponent-derived class representing a single tile / glTF model. It may be helpful to derive from UMeshComponent or UCustomMeshComponent, but even if not, looking at their source code will be helpful. We'll also need a corresponding FPrimitiveSceneProxy-derived class, GltfMeshSceneProxy. Graphics Programming Overview has a good explanation of UPrimitiveComponent and FPrimitiveSceneProxy. In short, the former represents the model on Unreal's game thread, while the latter represents it on Unreal's rendering thread.
  • Cesium3DTilesetActor: An Actor class that represents the entire tileset. Its Tick method can be used to select appropriate tiles each frame and create/destroy the primitives above as needed.

With these pieces in place, it should be simple for users to add a 3D Tiles tileset to the world using the Unreal Editor.

We may need to implement most of the code that loads a glTF file and creates Unreal Engine resources from it. While Unreal Engine has a built-in glTF importer plugin, this is meant to be used at design time rather than runtime. It converts the glTF to another form rather than creating a renderable resource directly. For 3D Tiles rendering, we need to be able to load glTFs dynamically. Depending on the license, we may be able to borrow parts of the glTF Importer or the third-party glTF for UE4 plugin, though. The Unreal Engine source code is installed with Unreal Engine and is very easy to explore with Visual Studio.

Rumor has it there is a "glTF runtime translator" coming in Unreal Engine 4.25 that will obviate the need for us to develop our own glTF support.

Useful Resources

@kring
Copy link
Member Author

kring commented Mar 11, 2020

Notes on this from the call with Sebastien, Johan, and Alban from Epic today:

  • Unreal Engine 4.25 will have a feature to load any DataSmith-supported format (including glTF) at runtime, and then convert it to Unreal assets/actors. Should just take 2-5 lines of code.
  • Johan points out this wasn't designed for our use-case - rapid loading and unloading of assets at runtime - but it might be ok, we should try it.
  • We can try it today by downloading the 4.25 preview release from Github (and possibly also from the Epic store?)
  • If we have any questions (about this or in general), we should post to the Unreal Developer Network but also let Seb and Alban know that we did.

@kring
Copy link
Member Author

kring commented Jun 4, 2020

Closing in favor of more specific issues.

@kring kring closed this as completed Jun 4, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant