Billboard rendering issues status?

After using Cesium for the last few weeks, I’ve noticed that there’s a few deficiencies in billboard rendering compared to Google Earth. One of them is particularly noticeable when using labels (which I just now found out are actually billboards with text rendered to a canvas).

Looking through the issues list on Github and this group’s archives, I see some existing issues and discussion:

The two issues are 6 and 9 months old, and the rotation discussion dates back to December.

The distance scaling issue is the biggest behavior deficiency that I see. Google Earth starts shrinking label sizes as you zoom out, and eventually stops rendering them altogether. Cesium, on the other hand, leaves all labels the same size. If you’ve got a bunch of labels (say, one per country), zooming out far enough leaves you with a ton of labels all overlapping and hiding the earth.

The size and rotation specifications aren’t as critical, but would certainly be highly useful additions to the API.

Is there any chance of these being worked on in the next few weeks? I’d happily work on them myself if I could, but I have absolutely no 3D or shader programming experience, and my current tasks at work have me busy full-time. I know you guys have various priorities already - just want to see where these features fit in.

For what it’s worth, I did just pull down the PolylineMaterials merge, and it looks great! Been following the progress, and nice to see that work merged in. Updated my GWT-based application with a freshly-built copy of Cesium, wrapped the changes to the Polyline API, and it all worked the first time I tried. Very nice.

Thanks!

Mark Erikson

Hey Mark,

Believe me, I would love to see these implemented as well. In fact, those of us who work our day jobs together were just lamenting the lack of these specific features today and trying to gode Dan (who implemented the new Polyline stuff) into working on them next (unfortunately I think he still has a bit of additional polyline work that needs to be finished first). So we definitely want to get them done but it’s just a matter of fitting them in with everything else going on (polylines, models, and terrain are probably the major 3D specific things we have happening right now as far as graphics work goes). I’m by no means a 3D developer, but I have thought about taking a crack at some of these myself once I carve out some time.

Our roadmap is by no means set in stone, so if you’re looking at deploying Cesium in a significant project, but need these features, we may be able to help you out. (or as always, if anyone on this list is interested in working on the below features just because you find them interesting or have spare time, we would love the help).

I’m not sure what your current use case for Cesium is, but I will mention that some of us work for a commercial software company (http://www.agi.com) that is also a major corporate backer of Cesium. So paid feature work or support is not out of the question if you are interested in that route.

Feel free to email me directly if you need to maintain discretion in regards to your current projects or needs, but otherwise we use this mailing list to help gauge what we should work on next as time and resources allow. I’m sure it’s only a matter of time before the billboard stuff is at the time of the list (I know I’ll be continuing to push for it).

The current immediate feature that brings this to mind is a requirement that we show country borders and names on our globe. I’ve taken some shapefile datasets from the Natural Earth data website, made a number of changes to my local clone of czml-writer to allow better shapefile->CZML conversion, and generated some CZML that contains polyline borders and label instances. The borders work fine, but since there’s no label/billboard scaling, it all looks pretty bad as you start to zoom out. Sure, the user will probably be spending most of their time zoomed in on specific regions of the world, but having 200 labels obscuring the earth as you zoom out looks kinda tacky :slight_smile: In the absence of current scaling, and given our current time constraints, we’re considering generating an imagery layer that has names pre-rendered, or possibly doing something with text-on-canvas and Image Materials.

As far as feature sponsorship, I’m afraid I’m pretty low on the totem pole and have no real influence on spending decisions. I also suspect that, given budget constraints, it’d be unlikely for us to get any approval to spend money externally anyway, particularly if there’s some workaround we can put in place.

Thanks for the help.

Mark Erikson

Generating imagery with labels and borders baked in may be a good short term solution for you. Hopefully we’ll be able to get the billboard features in sometime in the next few months. As for your local changes, we’re always looking for contributions, so if you have any changes you think are worth contributing back, we’d be happy to have them. (Assuming you can sign our CLA).

Yeah, I’d certainly be interested in at least pushing my changes out so you guys can determine if they’re useful or not, but I’m not entirely sure what the legal ramifications are, considering this was developed as part of a corporate effort on corporate time. I’ll try to ask around and see what I can do.

As a loose summary: czml-writer has shapefile conversion code, but that wasn’t hooked up to the CLI tool. I hooked it up, then pulled in a 3rd-party expression evaluator library and added command-line switches to allow filtering shapefile features and label generation based on arbitrary shapefile metadata fields and comparisons. Also tweaked the polygon conversion to allow generating output as polylines instead of filled polygons.

As an example:

CesiumLanguageConverter.exe -fmf “someTextField” -fmc “.StartsWith(“someString”)” -lmf “someIntegerField” -lmc " > 5" -lmc “name” -spl myShapefile.shp

where the extra command line switches are:

  --fmf=VALUE            Shapefile filtering: Metadata field to search on
  --fmc=VALUE            Shapefile filtering: Metadata comparison to make
  --lmf=VALUE            Shapefile labels: Metadata field to search on
  --lmc=VALUE            Shapefile labels: Metadata comparison to make
  --lmv=VALUE            Shapefile labels: Metadata field to use for label contents
  --spl                  Convert shapefile polygons to polylines

It’s kinda hacked together, but it actually works pretty well so far.

Sounds like an awesome start to something we’ve been wanting to do for a while. We have both corporate and individual CLAs available, linked here and here; if you want to have your company/legal team look over them. I realize it’s mostly out of your hands, but hopefully they’ll be happy to share back.

Hi Mark,

Billboard rotation, orientation, and custom size in pixels are now available in master and will be in the next release.

Regards,

Dan

Sweet! Looking forward to trying those out shortly. Thanks!

Also, to follow up on the other portion of this discussion: word from well above my pay grade is that we’re not releasing any of our changes back to the community. Certainly not a decision I like, although I can understand that approval processes and proprietariness concerns get complicated.

If I get some free time at home, I may take a stab at trying to re-create some of my modifications there. Not sure how much use the czml-writer project is getting in general, particularly the shapefile section.

Mark,

Sorry to hear that you won’t be able to contribute back your changes. Hopefully in the future, the higher-ups will see the benefits. Open-source is self-correcting, in that, it is cheaper to contribute changes back than to maintain a modified fork and continuously integrate the official version. This is why the GPL is somewhat falling out of favor; industry is starting to realize that it it is cheaper to contribute back even if the license doesn’t require it. Perhaps - in time - your decision makers will see it too.

Patrick

Hmph. Not a likely change of mind, unfortunately. To paraphrase the email I got: “giving up copyright has to be approved at the division level, and program contracts can affect this as well since it’s paid for by the government”. In other words, not happening. Trust me, I’m all in favor of contributing back myself whenever possible.

Our CLA - which is the standard Apache CLA - has explicit language that says you are not giving up copyright - you retain copyright (and are credited in various places; at least CONTRIBUTORS.md), and allow us to use the code under the terms of the Apache license. In many cases, like OWF for instance, the government wants funded code to be open source.

No need to take any action now, but these are things to keep in mind next time it comes up or when not being able to contribute back starts to cause integration headaches.

Patrick

Mark,

Are you still maintaining your GWT-integrated Cesium capability? I just published (under Apache 2.0) a partial wrapper of Cesium for GWT. It’s by no means complete but as I tried to do just a few things in my GWT app (add symbols and text to the map, fly to different locations, track the cursor, etc.) I found myself adding more and more Java wrappers around the equivalent Cesium APIs. I tried to somewhat mimic the structure of the Cesium JS libs, so it is not too hard to take a JavaScript sample and translate it to Java GWT.

I don't know if contributing to this library would help you work around the copyright issues you mentioned last year. But more importantly, if there is something I could learn from what you've done (or vice versa), would you mind taking a look at my implementation?

https://github.com/richkadel/cesium-gwt

You can build it with mvn clean package war:war, and copy the war into a tomcat webapps directory or something similar. There is a package of samples, which may be a good place to start.

Patrick recommended I contact you, and also recommended I consider making this a Cesium Plugin (thinking about it).

What I'd really like to do (but I don't have the time to do it) is write a translator that converts the JS library into these wrappers. Keeping up with all of the "breaking changes" is time consuming and error prone. I have not updated in a couple of revs. This is compatible with Cesium b28 and we're on b30 as I write this.

Thanks,
Rich

rkadel (at) harmonia.com

Huh. That’s a very interesting library you’ve got there.

Yeah, we’ve got two related applications using Cesium at the moment. One’s pure JS, and the other is GWT. We just updated the JS app to use Cesium b29, but the GWT one is still on b17. I haven’t had time to upgrade it yet, and obviously the API changes would mean redoing most of the wrapper I had put together. Using your lib would definitely help. It would make sense for me to help get it upgraded to work with b30 and jump straight to that.

As for the auto-translation thing: I totally get where you’re going with that, but I suspect that would get pretty time consuming in and of itself. Given that we’re almost up to Cesium 1.0, the API changes should hopefully be about done.

Nice work, and hopefully we’ll be able to collaborate on that some in the near future.

That sounds great Mark. Looking forward to collaborating!

Thanks,

Rich

Mark,

In case you are still interested, cesium-gwt has been upgraded to Cesium 1.0, and several API improvements were also made as well. I think you will like the improvements, and hopefully you will have an opportunity to leverage and contribute to extending the GWT library.

Thanks,
Rich

Yep, saw your comments. I’m still interested in making use of it, as our GWT application is still using my home-grown wrapper lib with Cesium b17. Other stuff’s been higher priority so far, though. Looks like I might have time to tackle this sometime in the next month. Will definitely see what I can contribute at that time.

Thanks for your help!