CesiumGS / CesiumGS/cesium-native

Support for 3D Tiles Styling language

Open
#1,208 3 comments 0 reactions 0 assignees View on GitHub
enhancement research
Dominant language
C++
Stars
623
Forks
277
PR merge metrics
No merged PRs in 30d

Description

One issue we're running into with vector rasterization is that styling loaded GeoJSON documents is done by manipulating the style properties on the document itself. This works great from C++ and is just about as performant as can be, but really falters when it comes to Unreal - trying to run an Unreal Blueprint that iterates over thousands or tens of thousands or hundreds of thousands of GeoJSON objects results in a noticeable freeze when the document is loaded (on the order of several seconds for a modest dataset like the Philadelphia Streets dataset).

It would be nice if we could implement the [3D Tiles Styling language](https://github.com/CesiumGS/3d-tiles/tree/main/specification/Styling) as used in CesiumJS for this purpose. The upside here would be that this is already a tested and capable solution for the problem we're facing, and would give users pretty much all the tools they need to style a GeoJSON document.

The downside is that it requires a JavaScript interpreter.

Now, the 3D Tiles Styling language only uses a very constrained set of JavaScript features, so we don't need to bring in the entire kitchen sink to implement it. And that's very good news, as v8 would add something like 35MB to our binary size for a feature most users wouldn't need. Implementing our own interpreter for the language isn't beyond the pale of possibility, but it would be a significant amount of work.

Luckily, there are plenty of projects out there trying to run JavaScript in very limited environments - particularly in embedded environments, where even 1MB would be considered a gigantic binary.

Some interesting possibilities I've found:
- [duktape](https://duktape.org/)
- [JerryScript](https://jerryscript.net/)

Both of these libraries are meant to run with less than 200KB of flash memory, and both seem to support regex which is necessary for 3D Tiles Styling language support.

Contributor guide

Open the contributing guide

Research direction

Start by reading the linked 3D Tiles Styling specification and evaluating duktape and JerryScript against its constrained JavaScript and regex requirements. Then examine how styling currently mutates GeoJSON properties in Unreal Blueprints, using the Philadelphia Streets dataset to reproduce the freeze. Done would require an agreed interpreter and integration design with supported styling behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, javascript, unreal-engine
Domain
computer-graphics, game-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.