Running into serious anti alias problems with thin lines

Hi there,

Quick question up top; reading from your post, the towers are model, and the lines are polylines (entities), right?

Starting with the lines; your cables are all black, and looks to be opacity 100%. Have you played with opacity (Cesium does weird things when going from 100% to any other value) and outline? Or even just the color itself, slightly graying it? You could try something like opacity at 90% and line width a bit wider. You could also look into the various polyline MaterialProperties, I’d start with making a material that does some black / opaque altered horizontal lines, but make sure the black part has the width you need (that should mess a bit with the anti-aliasing filter maybe just enough to get some better results).

Another approach might be to dynamically alter the width and / or color and / or outline color of the line based on a scale of distance, so 40m and below is width 1 (or whatever you’ve got as size at close range), and change the width slightly as you zoom away from it, for example around 400m use width 1.4, 1000m use width 1.6, and 2000m and above back to 1 (or turn off). You’ll have to experiment a lot with this to get it right and performing well. The way to do this is to create an event listener (either rendering event, or make up your own using a timer) that calculates the distance of an object to camera (something like Cesium.Cartesian3.distance ( object.position, viewer.camera.position ) ) and update the entities accordingly. Don’t know if you’re using the entity API or primitives etc., and I’d even look into if Cesium.callbackProperty() can be used for this (don’t know; it’s sometimes a bit sporadic if it works or not). I do this for a few other things and it works, but there are performance hits when there’s a lot of objects in the scene.

Finally, you could also look further into the post-processing options, maybe even write a filter that “undo” some of the anti-aliasing if you know what to look for (thin horizontal black lines). See the example for depth perspective and go from there, might be you can use or write a filter that’s helpful and fast enough. I think this was touched up on this post; Poor antialias result on 3D object - #3 by Dorian_Tourin-Lebret and for simplicity look at the last answer (the link is the updated version of the old Google groups post you found above; it has some extra info). I’d download a full Cesium, do a local build, and alter the source code for the antialiasing filter, make some notes, and suggest a way for having those values be configurable in Cesium in future versions.

Good luck, and let us all know how it goes.

Cheers,

Alex